wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacDot11ReassociationPending.h
changeset 0 c40eb8fe8501
equal deleted inserted replaced
-1:000000000000 0:c40eb8fe8501
       
     1 /*
       
     2 * Copyright (c) 2002-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 UmacDot11ReassociationPending class
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 22 %
       
    20 */
       
    21 
       
    22 #ifndef WLANDOT11REASSOCIATIONPENDING_H
       
    23 #define WLANDOT11REASSOCIATIONPENDING_H
       
    24 
       
    25 #include "UmacDot11Connecting.h"
       
    26 
       
    27 /**
       
    28 *  This is a state where STA has been successfully 
       
    29 *  authenticated with an AP, STA issues a reassociation request 
       
    30 *  and then waits for a response to it.
       
    31 *
       
    32 *  @lib wlanumac.lib
       
    33 *  @since S60 v3.1
       
    34 */
       
    35 class WlanDot11ReassociationPending : public WlanDot11Connecting
       
    36     {
       
    37 public:
       
    38    
       
    39     /**
       
    40     * C++ default constructor.
       
    41     */
       
    42     WlanDot11ReassociationPending();
       
    43 
       
    44     /**
       
    45     * Destructor.
       
    46     */
       
    47     virtual ~WlanDot11ReassociationPending();
       
    48 
       
    49 protected:
       
    50             
       
    51     // events for the FSM
       
    52     enum TEvent
       
    53         {
       
    54         // state entry action to be executed
       
    55         ESTATEENTRY,
       
    56         // reassociation request frame has been xferred 
       
    57         // to the WLAN device tx queue
       
    58         ETXREASSOCFRAMEXFER,        
       
    59         // reassociation response message has been processed
       
    60         ERXREASSOCRESPONSE,
       
    61         ETXCOMPLETE,
       
    62         // reassociation timeout event       
       
    63         ETIMEOUT,
       
    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-reassociation message is sent                        
       
    76         ETXREASSOCIATIONFRAME,        
       
    77         // reassociation response message is waited
       
    78         EWAIT4REASSOCIATIONRESPONSE,
       
    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     // reassociation frame received flag
       
    90     static const TUint32 KReassocReceived              = (1 << 0);
       
    91     // reassociation was a success, flag
       
    92     static const TUint32 KReassocSuccess               = (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( WlanContextImpl& aCtxImpl, 
       
   104               TEvent aEvent );
       
   105 
       
   106     void OnStateEntryEvent( WlanContextImpl& aCtxImpl );
       
   107 
       
   108     inline void OnTxReassocFrameXferEvent( WlanContextImpl& aCtxImpl );
       
   109 
       
   110     void OnRxReassocResponseEvent( WlanContextImpl& aCtxImpl );
       
   111 
       
   112     void OnTxCompleteEvent( WlanContextImpl& aCtxImpl );
       
   113 
       
   114     void OnTimeoutEvent( WlanContextImpl& aCtxImpl );
       
   115 
       
   116     void OnTxSchedulerFullEvent( WlanContextImpl& aCtxImpl );
       
   117 
       
   118     void OnPushPacketEvent( WlanContextImpl& aCtxImpl );
       
   119 
       
   120     void ContinueDot11StateTraversal( WlanContextImpl& aCtxImpl );
       
   121 
       
   122     void ChangeInternalState( 
       
   123         WlanContextImpl& aCtxImpl, 
       
   124         TState aNewState );
       
   125 
       
   126     TBool SendReassociationRequest( WlanContextImpl& aCtxImpl );
       
   127 
       
   128     virtual TUint32 ConstructReassociationRequestFrame( 
       
   129         WlanContextImpl& aCtxImpl,
       
   130         TUint8*& aStartOfFrame );
       
   131 
       
   132     void StartReassociationResponseTimer( 
       
   133         WlanContextImpl& aCtxImpl ) const;
       
   134 
       
   135     static T802Dot11ManagementStatusCode IsRxReassociationSuccess( 
       
   136         WlanContextImpl& aCtxImpl,
       
   137         const void* aFrame,
       
   138         TUint32 aFlags );
       
   139         
       
   140     inline void ConfigureAc( 
       
   141         WlanContextImpl& aCtxImpl );
       
   142 
       
   143     /**
       
   144     * Returns the state's name
       
   145     * @since Series 60 3.1
       
   146     * @param aLength (OUT) length of the name of the state
       
   147     * @return name of the state
       
   148     */
       
   149 #ifndef NDEBUG 
       
   150         virtual const TInt8* GetStateName( TUint8& aLength ) const;
       
   151 #endif // !NDEBUG 
       
   152 
       
   153     virtual void Entry( WlanContextImpl& aCtxImpl );
       
   154 
       
   155     virtual void Exit( WlanContextImpl& aCtxImpl );
       
   156 
       
   157     /**
       
   158      * Method called when packet has been transferred to the WLAN device
       
   159      *
       
   160      * @since S60 3.1
       
   161      * @param aCtxImpl global state machine context
       
   162      * @param aPacketId packet whose transfer is complete
       
   163      * @param aMetaHeader frame meta header
       
   164      */
       
   165     virtual void OnPacketTransferComplete( 
       
   166         WlanContextImpl& aCtxImpl, 
       
   167         TUint32 aPacketId,
       
   168         TDataBuffer* aMetaHeader );
       
   169 
       
   170     virtual void ReceivePacket( 
       
   171         WlanContextImpl& aCtxImpl,
       
   172         WHA::TStatus aStatus,
       
   173         const void* aFrame,
       
   174         TUint16 aLength,
       
   175         WHA::TRate aRate,
       
   176         WHA::TRcpi aRcpi,
       
   177         WHA::TChannelNumber aChannel,
       
   178         TUint8* aBuffer,
       
   179         TUint32 aFlags );
       
   180 
       
   181     virtual void OnReceiveFrameSuccess(
       
   182         WlanContextImpl& aCtxImpl,
       
   183         const void* aFrame,
       
   184         TUint16 aLength,
       
   185         WHA::TRcpi aRcpi,
       
   186         TUint32 aFlags,
       
   187         TUint8* aBuffer );
       
   188 
       
   189     virtual void OnPacketPushPossible( WlanContextImpl& aCtxImpl );
       
   190 
       
   191     virtual TBool OnTimeout( WlanContextImpl& aCtxImpl );        
       
   192 
       
   193 private:
       
   194 
       
   195     // Prohibit copy constructor 
       
   196     WlanDot11ReassociationPending( 
       
   197         const WlanDot11ReassociationPending& );
       
   198     // Prohibit assigment operator 
       
   199     WlanDot11ReassociationPending& operator= ( 
       
   200         const WlanDot11ReassociationPending& );
       
   201 
       
   202 protected:   // Data
       
   203 
       
   204     TState              iState;
       
   205 
       
   206 #ifndef NDEBUG
       
   207     // max length of state name for tracing
       
   208     enum { KMaxStateStringLength = 50 };
       
   209     // max length of event name for tracing
       
   210     enum { KMaxEventStringLength = KMaxStateStringLength };
       
   211 
       
   212     // state names for tracing
       
   213     static const TUint8 iStateName[ESTATEMAX][KMaxStateStringLength];
       
   214     // event names for tracing
       
   215     static const TUint8 iEventName[EEVENTMAX][KMaxEventStringLength];        
       
   216     // holds the name of the state
       
   217     static const TInt8 iName[];        
       
   218 #endif 
       
   219     };
       
   220 
       
   221 #include "umacdot11reassociationpending.inl"
       
   222 
       
   223 #endif      // WLANDOT11REASSOCIATIONPENDING_H