wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacDot11AssociationPending.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Declaration of the WlanDot11AssociationPending class
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 23 %
       
    20 */
       
    21 
       
    22 #ifndef WLANDOT11ASSOCIATIONPENDING_H
       
    23 #define WLANDOT11ASSOCIATIONPENDING_H
       
    24 
       
    25 #include "UmacDot11Connecting.h"
       
    26 
       
    27 /**
       
    28 * AssociationPending is a state where STA has been successfully authenticated
       
    29 * itself with an AP and has issued an association request 
       
    30 * and it's waiting a response to it.
       
    31 */
       
    32 class WlanDot11AssociationPending : public WlanDot11Connecting
       
    33     {
       
    34 
       
    35 public:
       
    36    
       
    37     /**
       
    38     * C++ default constructor.
       
    39     */
       
    40     WlanDot11AssociationPending() : iState( EINIT ) {};
       
    41 
       
    42     /**
       
    43     * Destructor.
       
    44     */
       
    45     virtual ~WlanDot11AssociationPending() {};
       
    46 
       
    47 protected:
       
    48 
       
    49     // Types for the FSM
       
    50     //
       
    51 
       
    52     // events for the FSM
       
    53     enum TEvent
       
    54         {
       
    55         // state entry action to be executed
       
    56         ESTATEENTRY,
       
    57         // an association response message has been processed
       
    58         ERXASSOCRESPONSE,
       
    59         // associate request frame has been xferred 
       
    60         // to the WLAN device tx queue
       
    61         ETX_ASSOCFRAME_XFER,
       
    62         ETXCOMPLETE,
       
    63         ETIMEOUT,           // association timer timeout event       
       
    64         ETX_SCHEDULER_FULL, // packet scheduler is full
       
    65         EPUSHPACKET,        // packet push to packet scheduler possible
       
    66         // defined as an upper bound
       
    67         EEVENTMAX           
       
    68         };
       
    69 
       
    70     // states of the FSM
       
    71     enum TState
       
    72         {
       
    73         // start state of the state machine
       
    74         EINIT,           
       
    75         // dot11-association message is sent            
       
    76         ETXASSOCREQFRAME,
       
    77         // association response message is waited
       
    78         EWAIT4ASSOCRESPONSE,
       
    79         // AC configuration is done
       
    80         ECONFIGUREAC,
       
    81         // EPUSHPACKET event waited
       
    82         EWAIT4PUSHPACKET,
       
    83         // junction state prior moving to next dot11 state
       
    84         ECONTINUEDOT11TRAVERSE,
       
    85         // defined as an upper bound        
       
    86         ESTATEMAX                       
       
    87         }; 
       
    88 
       
    89     // association frame received flag
       
    90     static const TUint32 KAssocReceived            = (1 << 0);
       
    91     // association was a success flag
       
    92     static const TUint32 KAssocSuccess             = (1 << 1);
       
    93     // need to issue the ConfigureAc WHA cmd flag
       
    94     static const TUint32 KConfigureAc              = (1 << 2);
       
    95 
       
    96     /**
       
    97     * ?member_description.
       
    98     * @since S60 3.1
       
    99     * @return ETrue if we are associated EFalse in otherwise
       
   100     */    
       
   101     inline TBool Associated() const;
       
   102 
       
   103     void Fsm( 
       
   104         WlanContextImpl& aCtxImpl, 
       
   105         TEvent aEvent );
       
   106 
       
   107     void OnStateEntryEvent( 
       
   108         WlanContextImpl& aCtxImpl );
       
   109 
       
   110     void OnTimeoutEvent( WlanContextImpl& aCtxImpl );
       
   111 
       
   112     void OnTxAssocFrameXferEvent( WlanContextImpl& aCtxImpl );
       
   113 
       
   114     void OnRxAssociationResponseEvent( WlanContextImpl& aCtxImpl );
       
   115 
       
   116     void OnTxCompleteEvent( WlanContextImpl& aCtxImpl );
       
   117 
       
   118     void OnTxSchedulerFullEvent( WlanContextImpl& aCtxImpl );
       
   119 
       
   120     void OnPushPacketEvent( WlanContextImpl& aCtxImpl );
       
   121 
       
   122     void ContinueDot11StateTraversal( 
       
   123         WlanContextImpl& aCtxImpl );
       
   124 
       
   125     void ChangeInternalState( 
       
   126         WlanContextImpl& aCtxImpl, 
       
   127         TState aNewState );
       
   128 
       
   129     TBool SendAssociationRequest( WlanContextImpl& aCtxImpl );
       
   130 
       
   131     TUint virtual ConstructAssociationRequestFrame( 
       
   132         WlanContextImpl& aCtxImpl,
       
   133         TUint8*& aStartOfFrame );
       
   134 
       
   135     /**
       
   136     * Determines if association succeeded
       
   137     * @param aCtxImpl global statemachine context
       
   138     * @param aFrame pointer to the beginning of the association response
       
   139     *               frame
       
   140     * @param aFlags flags from WHA frame receive method
       
   141     */    
       
   142     static T802Dot11ManagementStatusCode IsRxAssociationSuccess( 
       
   143         WlanContextImpl& aCtxImpl,
       
   144         const void* aFrame,
       
   145         TUint32 aFlags );
       
   146 
       
   147     static void StartAssociationFrameResponseTimer( 
       
   148         WlanContextImpl& aCtxImpl );
       
   149 
       
   150     void ConfigureAc( 
       
   151         WlanContextImpl& aCtxImpl );
       
   152 
       
   153     // from base class ?
       
   154 
       
   155     /**
       
   156     * Returns the states name
       
   157     * @param aLength (OUT) length of the name of the state
       
   158     * @return name of the state
       
   159     */
       
   160 #ifndef NDEBUG 
       
   161         virtual const TInt8* GetStateName( TUint8& aLength ) const;
       
   162 #endif // !NDEBUG 
       
   163 
       
   164     virtual void Entry( WlanContextImpl& aCtxImpl );
       
   165     
       
   166     virtual void Exit( WlanContextImpl& aCtxImpl );
       
   167     
       
   168     /**
       
   169      * Method called when packet has been transferred to the WLAN device
       
   170      *
       
   171      * @since S60 3.1
       
   172      * @param aCtxImpl global state machine context
       
   173      * @param aPacketId packet whose transfer is complete
       
   174      * @param aMetaHeader frame meta header
       
   175      */
       
   176     virtual void OnPacketTransferComplete( 
       
   177         WlanContextImpl& aCtxImpl, 
       
   178         TUint32 aPacketId,
       
   179         TDataBuffer* aMetaHeader );
       
   180 
       
   181     virtual void ReceivePacket( 
       
   182         WlanContextImpl& aCtxImpl,
       
   183         WHA::TStatus aStatus,
       
   184         const void* aFrame,
       
   185         TUint16 aLength,
       
   186         WHA::TRate aRate,
       
   187         WHA::TRcpi aRcpi,
       
   188         WHA::TChannelNumber aChannel,
       
   189         TUint8* aBuffer,
       
   190         TUint32 aFlags );
       
   191 
       
   192     virtual void OnReceiveFrameSuccess(
       
   193         WlanContextImpl& aCtxImpl,
       
   194         const void* aFrame,
       
   195         TUint16 aLength,
       
   196         WHA::TRcpi aRcpi,
       
   197         TUint32 aFlags,
       
   198         TUint8* aBuffer );
       
   199 
       
   200     /**
       
   201     * Timer timeout function
       
   202     *
       
   203     * @since Series 60 3.1
       
   204     * @param aCtxImpl global statemachine context
       
   205     * @return ETrue if a state change occurred in the state machine
       
   206     *         EFalse otherwise
       
   207     */
       
   208     virtual TBool OnTimeout( WlanContextImpl& aCtxImpl );
       
   209 
       
   210     virtual void OnPacketPushPossible( WlanContextImpl& aCtxImpl );
       
   211 
       
   212 private:
       
   213     
       
   214     // Prohibit copy constructor
       
   215     WlanDot11AssociationPending( 
       
   216         const WlanDot11AssociationPending& );
       
   217     // Prohibit assigment operator
       
   218     WlanDot11AssociationPending& operator= ( 
       
   219         const WlanDot11AssociationPending& );
       
   220 
       
   221 private:   // Data
       
   222 
       
   223     TState              iState;
       
   224         
       
   225 #ifndef NDEBUG
       
   226     // max length of state name for tracing
       
   227     enum { KMaxStateStringLength = 50 };
       
   228     // max length of event name for tracing
       
   229     enum { KMaxEventStringLength = KMaxStateStringLength };
       
   230 
       
   231     // state names for tracing
       
   232     static const TUint8 iStateName[ESTATEMAX][KMaxStateStringLength];
       
   233     // event names for tracing
       
   234     static const TUint8 iEventName[EEVENTMAX][KMaxEventStringLength];             
       
   235     /** holds the name of the state */
       
   236     static const TInt8 iName[];        
       
   237 #endif 
       
   238     };
       
   239 
       
   240 #include "umacdot11associatepending.inl"
       
   241 
       
   242 #endif      // WLANDOT11ASSOCIATIONPENDING_H
       
   243