656 CPDPDefaultSubConnectionProvider &tNode = static_cast<CPDPDefaultSubConnectionProvider&>(iContext.Node()); |
658 CPDPDefaultSubConnectionProvider &tNode = static_cast<CPDPDefaultSubConnectionProvider&>(iContext.Node()); |
657 |
659 |
658 User::LeaveIfError(tNode.iProvisionFailure); |
660 User::LeaveIfError(tNode.iProvisionFailure); |
659 |
661 |
660 ASSERT(tNode.iPdpFsmInterface); |
662 ASSERT(tNode.iPdpFsmInterface); |
661 |
663 |
662 iContext.Node().PostToClients<TDefaultClientMatchPolicy>( |
664 tNode.PostToClients<TDefaultClientMatchPolicy>( |
663 iContext.NodeId(), |
665 iContext.NodeId(), |
664 TCFMessage::TStateChange( |
666 TCFMessage::TStateChange( |
665 Elements::TStateChange(KPsdStartingConfiguration, KErrNone)).CRef(), |
667 Elements::TStateChange(KPsdStartingConfiguration, KErrNone)).CRef(), |
666 TClientType(TCFClientType::ECtrlProvider)); |
668 TClientType(TCFClientType::ECtrlProvider)); |
667 |
669 |
668 CGPRSProvision* gprsProvision = const_cast<CGPRSProvision*>(static_cast<const CGPRSProvision*>( |
670 CGPRSProvision* gprsProvision = const_cast<CGPRSProvision*>(static_cast<const CGPRSProvision*>( |
669 iContext.Node().AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId)))); |
671 tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId)))); |
670 |
672 |
671 //retrieve QoS (should be provisioned, but can also be overriden with SetParams). |
673 if (gprsProvision == NULL) |
672 RPacketQoS::TQoSR5Requested qosOverridenParams; |
674 { |
673 const RPacketQoS::TQoSR5Requested* qosParams = NULL; |
675 User::Leave(KErrCorrupt); |
674 if (! iContext.Node().iParameterBundle.IsNull() && ! iContext.Node().iParameterBundle.FindFamily(KSubConQoSFamily).IsNull()) |
676 } |
675 { |
677 |
676 MPDPParamMapper::MapQosParamBundleToEtelL(iContext.Node().iParameterBundle, qosOverridenParams); |
678 //retrieve QoS (should be provisioned, but can also be overriden with SetParams). |
677 qosParams = &qosOverridenParams; |
679 RPacketQoS::TQoSR5Requested qosOverridenParams; |
678 } |
680 |
679 else |
681 const RPacketQoS::TQoSR5Requested* qosParams = NULL; |
680 { |
682 |
681 const CDefaultPacketQoSProvision* defaultQoSProvision = static_cast<const CDefaultPacketQoSProvision*>( |
683 if ((!tNode.iParameterBundle.IsNull()) &&\ |
682 iContext.Node().AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CDefaultPacketQoSProvision::EUid,CDefaultPacketQoSProvision::ETypeId))); |
684 (!tNode.iParameterBundle.FindFamily(KSubConQoSFamily).IsNull())) |
683 qosParams = defaultQoSProvision ? &defaultQoSProvision->iParams : NULL; |
685 { |
684 |
686 MPDPParamMapper::MapQosParamBundleToEtelL(tNode.iParameterBundle, qosOverridenParams); |
|
687 qosParams = &qosOverridenParams; |
|
688 } |
|
689 else |
|
690 { |
|
691 const CDefaultPacketQoSProvision* defaultQoSProvision = static_cast<const CDefaultPacketQoSProvision*>( |
|
692 tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CDefaultPacketQoSProvision::EUid,CDefaultPacketQoSProvision::ETypeId))); |
|
693 |
|
694 if (defaultQoSProvision) |
|
695 { |
|
696 qosParams = &defaultQoSProvision->iParams; |
|
697 } |
|
698 else |
|
699 { |
|
700 User::Leave(KErrCorrupt); |
|
701 } |
|
702 |
685 //Here we're taking the qos defaults from the provision info, hence skipping the iParameterBundle. |
703 //Here we're taking the qos defaults from the provision info, hence skipping the iParameterBundle. |
686 //The lack of iParameterBundle however and the respective ERequested params is badly tolerated by the rest |
704 //The lack of iParameterBundle however and the respective ERequested params is badly tolerated by the rest |
687 //of the code (e.g.: when subsequently raising granted params it is assumed something has been requested). |
705 //of the code (e.g.: when subsequently raising granted params it is assumed something has been requested). |
688 //Let's create a phoney requested params. |
706 |
689 //iContext.Node().CreateParameterBundleL(); |
707 // These parameter bundles are also used in a situation when a context has failed to create because of a lack |
690 //RParameterFamily family = iContext.Node().iParameterBundle.CreateFamilyL(KSubConQoSFamily); //PJLEFT |
708 // of modem / network resources, as the SCPR isn't torn down, the parameter bundles need to hold the |
691 |
709 // information of the default QoS otherwise bad things happen [bad QoS]. |
692 RCFParameterFamilyBundle newBundle; |
710 |
693 newBundle.CreateL(); |
711 RCFParameterFamilyBundle newBundle; |
694 iContext.Node().iParameterBundle.Open(newBundle); |
712 newBundle.CreateL(); |
695 RParameterFamily family = newBundle.CreateFamilyL(KSubConQoSFamily); |
713 tNode.iParameterBundle.Open(newBundle); |
696 CSubConQosGenericParamSet::NewL(family, RParameterFamily::ERequested); |
714 RParameterFamily family = newBundle.CreateFamilyL(KSubConQoSFamily); |
697 } |
715 |
698 TTFTInfo tft; //We'll use empty/thus default TFT |
716 TInt tRelease = gprsProvision->UmtsGprsRelease(); |
699 if (gprsProvision == NULL || qosParams == NULL) |
717 |
700 { |
718 CSubConQosR99ParamSet* extRequestedR99 = NULL; |
701 User::Leave(KErrCorrupt); |
719 CSubConQosR99ParamSet* extAcceptableR99 = NULL; |
702 } |
720 CSubConQosR5ParamSet* extRequestedR5 = NULL; |
703 |
721 CSubConQosR5ParamSet* extAcceptableR5 = NULL; |
704 const CImsExtProvision* imsprov = static_cast<const CImsExtProvision*>( |
722 |
705 iContext.Node().AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CImsExtProvision::EUid, CImsExtProvision::ETypeId))); |
723 if (tRelease == TPacketDataConfigBase::KConfigRel5) |
706 |
724 { |
707 TRAP_IGNORE(iContext.Node().iIsModeGsm = IsModeGsmL()); |
725 // R5 - basically R4 + a few parameters |
708 |
726 |
709 switch (gprsProvision->UmtsGprsRelease()) |
727 extRequestedR5 = CSubConQosR5ParamSet::NewL(family,RParameterFamily::ERequested); |
710 { |
728 extAcceptableR5 = CSubConQosR5ParamSet::NewL(family,RParameterFamily::EAcceptable); |
711 case TPacketDataConfigBase::KConfigGPRS: |
729 |
712 { |
730 // Requested QoS Parameters |
713 SetImsSignallingFlagL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption, imsprov->iImsSignalIndicator); |
731 extRequestedR5->SetSourceStatisticsDescriptor(qosParams->iSourceStatisticsDescriptor); |
714 |
732 extRequestedR5->SetSignallingIndicator(qosParams->iSignallingIndication); |
715 // Only request SIP server address retrieval when network not in GSM/GPRS mode |
733 |
716 // e.g. UMTS/WCDMA |
734 extRequestedR99 = dynamic_cast<CSubConQosR99ParamSet*>(extRequestedR5); |
717 if (!iContext.Node().iIsModeGsm) |
735 |
718 { |
736 // Acceptable QoS Parameters |
719 SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption); |
737 |
720 } |
738 extAcceptableR5->SetSourceStatisticsDescriptor(qosParams->iSourceStatisticsDescriptor); |
721 |
739 extAcceptableR5->SetSignallingIndicator(qosParams->iSignallingIndication); |
722 SetChapInformationL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption); |
740 |
723 |
741 extAcceptableR99 = dynamic_cast<CSubConQosR99ParamSet*>(extAcceptableR5); |
724 } |
742 |
725 break; |
743 } |
726 |
744 else |
727 case TPacketDataConfigBase::KConfigRel5: |
745 { |
728 case TPacketDataConfigBase::KConfigRel99Rel4: |
746 // R4 and R99 |
729 { |
747 extRequestedR99 = CSubConQosR99ParamSet::NewL(family,RParameterFamily::ERequested); |
730 SetImsSignallingFlagL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption, imsprov->iImsSignalIndicator); |
748 extAcceptableR99 = CSubConQosR99ParamSet::NewL(family,RParameterFamily::EAcceptable); |
731 |
749 } |
732 // Only request SIP server address retrieval when network not in GSM/GPRS mode |
750 |
733 // e.g. UMTS/WCDMA |
751 // Requested QoS Parameters |
734 if (!iContext.Node().iIsModeGsm) |
752 extRequestedR99->SetTrafficClass(qosParams->iReqTrafficClass); |
735 { |
753 extRequestedR99->SetDeliveryOrder(qosParams->iReqDeliveryOrderReqd); |
736 SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption); |
754 extRequestedR99->SetErroneousSDUDelivery(qosParams->iReqDeliverErroneousSDU); |
737 } |
755 extRequestedR99->SetResidualBitErrorRatio(qosParams->iReqBER); |
738 |
756 extRequestedR99->SetSDUErrorRatio(qosParams->iReqSDUErrorRatio); |
739 SetChapInformationL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption); |
757 extRequestedR99->SetTrafficHandlingPriority(qosParams->iReqTrafficHandlingPriority); |
740 |
758 extRequestedR99->SetTransferDelay(qosParams->iReqTransferDelay); |
741 } |
759 extRequestedR99->SetMaxSduSize(qosParams->iReqMaxSDUSize); |
742 break; |
760 extRequestedR99->SetMaxBitrateUplink(qosParams->iReqMaxRate.iUplinkRate); |
743 } |
761 extRequestedR99->SetMaxBitrateDownlink(qosParams->iReqMaxRate.iDownlinkRate); |
744 |
762 extRequestedR99->SetGuaBitrateUplink(qosParams->iReqGuaranteedRate.iUplinkRate); |
745 iContext.Node().iPDPFsmContextId = iContext.Node().iPdpFsmInterface->NewFsmContextL(iContext.Node(),SpudMan::EPrimary); |
763 extRequestedR99->SetGuaBitrateDownlink(qosParams->iReqGuaranteedRate.iDownlinkRate); |
746 |
764 |
747 iContext.Node().PostToClients<TDefaultClientMatchPolicy>( |
765 // Acceptable QoS Parameters |
|
766 extAcceptableR99->SetTrafficClass(qosParams->iMinTrafficClass); |
|
767 extAcceptableR99->SetDeliveryOrder(qosParams->iMinDeliveryOrderReqd); |
|
768 extAcceptableR99->SetErroneousSDUDelivery(qosParams->iMinDeliverErroneousSDU); |
|
769 extAcceptableR99->SetResidualBitErrorRatio(qosParams->iMaxBER); |
|
770 extAcceptableR99->SetSDUErrorRatio(qosParams->iMaxSDUErrorRatio); |
|
771 extAcceptableR99->SetTrafficHandlingPriority(qosParams->iMinTrafficHandlingPriority); |
|
772 extAcceptableR99->SetTransferDelay(qosParams->iMaxTransferDelay); |
|
773 extAcceptableR99->SetMaxSduSize(qosParams->iMinAcceptableMaxSDUSize); |
|
774 extAcceptableR99->SetMaxBitrateUplink(qosParams->iMinAcceptableMaxRate.iUplinkRate); |
|
775 extAcceptableR99->SetMaxBitrateDownlink(qosParams->iMinAcceptableMaxRate.iDownlinkRate); |
|
776 extAcceptableR99->SetGuaBitrateUplink(qosParams->iMinGuaranteedRate.iUplinkRate); |
|
777 extAcceptableR99->SetGuaBitrateDownlink(qosParams->iMinGuaranteedRate.iDownlinkRate); |
|
778 |
|
779 } |
|
780 |
|
781 TTFTInfo tft; //We'll use empty/thus default TFT |
|
782 |
|
783 const CImsExtProvision* imsprov = static_cast<const CImsExtProvision*>( |
|
784 tNode.AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CImsExtProvision::EUid, CImsExtProvision::ETypeId))); |
|
785 |
|
786 TRAP_IGNORE(tNode.iIsModeGsm = IsModeGsmL()); |
|
787 |
|
788 switch (gprsProvision->UmtsGprsRelease()) |
|
789 { |
|
790 case TPacketDataConfigBase::KConfigGPRS: |
|
791 { |
|
792 SetImsSignallingFlagL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption, imsprov->iImsSignalIndicator); |
|
793 |
|
794 // Only request SIP server address retrieval when network not in GSM/GPRS mode |
|
795 // e.g. UMTS/WCDMA |
|
796 if (!tNode.iIsModeGsm) |
|
797 { |
|
798 SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption); |
|
799 } |
|
800 |
|
801 SetChapInformationL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>().iProtocolConfigOption); |
|
802 |
|
803 } |
|
804 break; |
|
805 |
|
806 case TPacketDataConfigBase::KConfigRel5: |
|
807 case TPacketDataConfigBase::KConfigRel99Rel4: |
|
808 { |
|
809 SetImsSignallingFlagL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption, imsprov->iImsSignalIndicator); |
|
810 |
|
811 // Only request SIP server address retrieval when network not in GSM/GPRS mode |
|
812 // e.g. UMTS/WCDMA |
|
813 if (!tNode.iIsModeGsm) |
|
814 { |
|
815 SetupSipServerAddrRetrievalL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption); |
|
816 } |
|
817 |
|
818 SetChapInformationL(gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>().iProtocolConfigOption); |
|
819 |
|
820 } |
|
821 break; |
|
822 } |
|
823 |
|
824 tNode.iPDPFsmContextId = tNode.iPdpFsmInterface->NewFsmContextL(tNode,SpudMan::EPrimary); |
|
825 |
|
826 tNode.PostToClients<TDefaultClientMatchPolicy>( |
748 iContext.NodeId(), |
827 iContext.NodeId(), |
749 TCFMessage::TStateChange( |
828 TCFMessage::TStateChange( |
750 Elements::TStateChange(KPsdFinishedConfiguration, KErrNone)).CRef(), |
829 Elements::TStateChange(KPsdFinishedConfiguration, KErrNone)).CRef(), |
751 TClientType(TCFClientType::ECtrlProvider)); |
830 TClientType(TCFClientType::ECtrlProvider)); |
752 |
831 |
753 iContext.Node().PostToClients<TDefaultClientMatchPolicy>( |
832 tNode.PostToClients<TDefaultClientMatchPolicy>( |
754 iContext.NodeId(), |
833 iContext.NodeId(), |
755 TCFMessage::TStateChange( |
834 TCFMessage::TStateChange( |
756 Elements::TStateChange(KPsdStartingActivation, KErrNone)).CRef(), |
835 Elements::TStateChange(KPsdStartingActivation, KErrNone)).CRef(), |
757 TClientType(TCFClientType::ECtrlProvider)); |
836 TClientType(TCFClientType::ECtrlProvider)); |
758 |
837 |
759 ASSERT(iContext.Node().iPDPFsmContextId == KPrimaryContextId); |
838 ASSERT(tNode.iPDPFsmContextId == KPrimaryContextId); |
760 iContext.Node().iContextType=SpudMan::EPrimary; |
839 tNode.iContextType=SpudMan::EPrimary; |
761 iContext.Node().iPdpFsmInterface->Set(KPrimaryContextId, gprsProvision->GetScratchContextAs<TPacketDataConfigBase>()); |
840 tNode.iPdpFsmInterface->Set(KPrimaryContextId, gprsProvision->GetScratchContextAs<TPacketDataConfigBase>()); |
762 //Set default QoS |
841 //Set default QoS |
763 iContext.Node().iPdpFsmInterface->Set(KPrimaryContextId, *qosParams); |
842 tNode.iPdpFsmInterface->Set(KPrimaryContextId, *qosParams); |
764 //Set default TFTs |
843 //Set default TFTs |
765 iContext.Node().iPdpFsmInterface->Set(KPrimaryContextId, tft); // ignore any error |
844 tNode.iPdpFsmInterface->Set(KPrimaryContextId, tft); // ignore any error |
766 //Start the primary. |
845 //Start the primary. |
767 User::LeaveIfError(iContext.Node().iPdpFsmInterface->Input(KPrimaryContextId, SpudMan::ECreatePrimaryPDPContext)); |
846 User::LeaveIfError(tNode.iPdpFsmInterface->Input(KPrimaryContextId, SpudMan::ECreatePrimaryPDPContext)); |
768 iContext.iNodeActivity->ClearPostedTo(); |
847 iContext.iNodeActivity->ClearPostedTo(); |
769 iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId(); |
848 tNode.iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId(); |
770 } |
849 } |
771 |
850 |
772 DEFINE_SMELEMENT(TOverrideProvision, NetStateMachine::MStateTransition, PDPSCprStates::TContext) |
851 DEFINE_SMELEMENT(TOverrideProvision, NetStateMachine::MStateTransition, PDPSCprStates::TContext) |
773 void TOverrideProvision::DoL() |
852 void TOverrideProvision::DoL() |
774 { |
853 { |
1462 //Expect Response |
1541 //Expect Response |
1463 iContext.iNodeActivity->ClearPostedTo(); |
1542 iContext.iNodeActivity->ClearPostedTo(); |
1464 iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId(); |
1543 iContext.Node().iActivityAwaitingResponse = iContext.iNodeActivity->ActivityId(); |
1465 } |
1544 } |
1466 |
1545 |
|
1546 DEFINE_SMELEMENT(TCleanupFSM, NetStateMachine::MStateTransition, PDPSCprStates::TContext) |
|
1547 void TCleanupFSM::DoL() |
|
1548 { |
|
1549 CPDPSubConnectionProvider &tNode = static_cast<CPDPSubConnectionProvider &>(iContext.Node()); |
|
1550 |
|
1551 if (tNode.iPDPFsmContextId != CPDPSubConnectionProvider::EInvalidContextId) |
|
1552 { |
|
1553 |
|
1554 // removing the memory associated with the context - this should hopefully |
|
1555 // ensure that the memory allocations that happen afterwards can be |
|
1556 // accomplished without OOM errors |
|
1557 |
|
1558 tNode.iPdpFsmInterface->DeleteFsmContext(tNode.iPDPFsmContextId); |
|
1559 |
|
1560 if (tNode.ContentionRequested() == EFalse) |
|
1561 { |
|
1562 CSubConGenEventSubConDown* event = CSubConGenEventSubConDown::NewL(); |
|
1563 CleanupStack::PushL(event); |
|
1564 tNode.NotifyClientsL(*event); |
|
1565 CleanupStack::Pop(event); |
|
1566 } |
|
1567 |
|
1568 if (tNode.iPDPFsmContextId == KPrimaryContextId) |
|
1569 { |
|
1570 tNode.PostToClients<TDefaultClientMatchPolicy>( |
|
1571 iContext.NodeId(), |
|
1572 TCFMessage::TStateChange( |
|
1573 Elements::TStateChange(KPsdFinishedDeactivation, KErrNone)).CRef(), |
|
1574 TClientType(TCFClientType::ECtrlProvider)); |
|
1575 } |
|
1576 |
|
1577 tNode.iPDPFsmContextId = CPDPSubConnectionProvider::EInvalidContextId; |
|
1578 |
|
1579 } |
|
1580 } |
|
1581 |
|
1582 |
1467 DEFINE_SMELEMENT(TAwaitingPDPContextDestroyed, NetStateMachine::MState, PDPSCprStates::TContext) |
1583 DEFINE_SMELEMENT(TAwaitingPDPContextDestroyed, NetStateMachine::MState, PDPSCprStates::TContext) |
1468 TBool TAwaitingPDPContextDestroyed::Accept() |
1584 TBool TAwaitingPDPContextDestroyed::Accept() |
1469 { |
1585 { |
1470 if (TAwaitingPDPFSMMessage::Accept(KContextDeleteEvent)) |
1586 if (TAwaitingPDPFSMMessage::Accept(KContextDeleteEvent)) |
1471 { |
1587 { |
1472 if (iContext.Node().iPDPFsmContextId != CPDPSubConnectionProvider::EInvalidContextId) |
|
1473 { |
|
1474 if (!iContext.Node().ContentionRequested()) |
|
1475 { |
|
1476 CSubConGenEventSubConDown* event = CSubConGenEventSubConDown::NewL(); |
|
1477 CleanupStack::PushL(event); |
|
1478 iContext.Node().NotifyClientsL(*event); |
|
1479 CleanupStack::Pop(event); |
|
1480 } |
|
1481 |
|
1482 if (iContext.Node().iPDPFsmContextId == KPrimaryContextId) |
|
1483 { |
|
1484 iContext.Node().PostToClients<TDefaultClientMatchPolicy>( |
|
1485 iContext.NodeId(), |
|
1486 TCFMessage::TStateChange( |
|
1487 Elements::TStateChange(KPsdFinishedDeactivation, KErrNone)).CRef(), |
|
1488 TClientType(TCFClientType::ECtrlProvider)); |
|
1489 } |
|
1490 |
|
1491 iContext.Node().iPdpFsmInterface->DeleteFsmContext(iContext.Node().iPDPFsmContextId); |
|
1492 iContext.Node().iPDPFsmContextId = CPDPSubConnectionProvider::EInvalidContextId; |
|
1493 } |
|
1494 return ETrue; |
1588 return ETrue; |
1495 } |
1589 } |
1496 return EFalse; |
1590 return EFalse; |
1497 } |
1591 } |
1498 |
1592 |