wlan_bearer/wlanldd/wlan_common/umac_common/inc/UmacMacActionState.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 WlanMacActionState class.
       
    15 *
       
    16 */
       
    17 
       
    18 /*
       
    19 * %version: 27 %
       
    20 */
       
    21 
       
    22 #ifndef WLANMACACTIONSTATE_H
       
    23 #define WLANMACACTIONSTATE_H
       
    24 
       
    25 #include "UmacMacState.h"
       
    26 #include "umacwhacommandclient.h"
       
    27 
       
    28 class WlanDot11State;
       
    29 class WlanWsaComplexCommand;
       
    30 class WlanWsaCommand;
       
    31 class WlanDot11InfrastructureMode;
       
    32 class WlanDot11IbssMode;
       
    33 
       
    34 /**
       
    35 *  ?one_line_short_description.
       
    36 *  ?other_description_lines
       
    37 *
       
    38 *  @lib wlanumac.lib
       
    39 *  @since Series 60 3.1
       
    40 */
       
    41 class WlanMacActionState : 
       
    42     public WlanMacState,
       
    43     public MWlanWhaCommandClient
       
    44     {
       
    45 public:
       
    46 
       
    47     /**
       
    48     * Destructor.
       
    49     */
       
    50     virtual inline ~WlanMacActionState();
       
    51 
       
    52 public:
       
    53 
       
    54     virtual void OnWhaCommandResponse( 
       
    55         WlanContextImpl& aCtxImpl, 
       
    56         WHA::TCommandId aCommandId, 
       
    57         WHA::TStatus aStatus,
       
    58         const WHA::UCommandResponseParams& aCommandResponseParams,
       
    59         TUint32 aAct );
       
    60 
       
    61     /**
       
    62     * Transmit a protocol stack frame
       
    63     * 
       
    64     * The frame to be sent needs to be in 802.3 format
       
    65     * @param aCtxImpl global state machine context
       
    66     * @param aDataBuffer meta header of the frame to be transmitted
       
    67     * @param aMore ETrue if another frame is also ready to be transmitted
       
    68     *              EFalse otherwise
       
    69     */
       
    70     virtual TBool TxData( 
       
    71         WlanContextImpl& aCtxImpl,
       
    72         TDataBuffer& aDataBuffer,
       
    73         TBool aMore );
       
    74 
       
    75     virtual void TxMgmtData( 
       
    76         WlanContextImpl& aCtxImpl,
       
    77         TDataBuffer& aDataBuffer );
       
    78 
       
    79     virtual void Indication( 
       
    80         WlanContextImpl& aCtxImpl, 
       
    81         WHA::TIndicationId aIndicationId,
       
    82         const WHA::UIndicationParams& aIndicationParams );
       
    83 
       
    84     // Frame receive
       
    85 
       
    86     virtual TAny* RequestForBuffer ( 
       
    87         WlanContextImpl& aCtxImpl,             
       
    88         TUint16 aLength );
       
    89 
       
    90     virtual void ReceivePacket( 
       
    91         WlanContextImpl& aCtxImpl, 
       
    92         WHA::TStatus aStatus,
       
    93         const void* aFrame,
       
    94         TUint16 aLength,
       
    95         WHA::TRate aRate,
       
    96         WHA::TRcpi aRcpi,
       
    97         WHA::TChannelNumber aChannel,
       
    98         TUint8* aBuffer,
       
    99         TUint32 aFlags );
       
   100 
       
   101     // from packet scheduler
       
   102 
       
   103     /**
       
   104      * Method called when packet has been transferred to the WLAN device
       
   105      *
       
   106      * @since S60 3.1
       
   107      * @param aCtxImpl global state machine context
       
   108      * @param aPacketId packet whose transfer is complete
       
   109      * @param aMetaHeader frame meta header
       
   110      */
       
   111     virtual void OnPacketTransferComplete( 
       
   112         WlanContextImpl& aCtxImpl, 
       
   113         TUint32 aPacketId,
       
   114         TDataBuffer* aMetaHeader );
       
   115 
       
   116     virtual void OnPacketSendComplete(
       
   117         WlanContextImpl& aCtxImpl, 
       
   118         WHA::TStatus aStatus,
       
   119         TUint32 aPacketId,
       
   120         WHA::TRate aRate,
       
   121         TUint32 aPacketQueueDelay,
       
   122         TUint32 aMediaDelay,
       
   123         TUint aTotalTxDelay,
       
   124         TUint8 aAckFailures,
       
   125         WHA::TQueueId aQueueId,
       
   126         WHA::TRate aRequestedRate,
       
   127         TBool aMulticastData );
       
   128 
       
   129     /**
       
   130     * Method called when Packet Scheduler's packet scheduling method 
       
   131     * should be called, as there exists a packet that is suitable for 
       
   132     * transmission.
       
   133     * NOTE: if any other Packet Scheduler method is called within this
       
   134     * context the result is undefined.
       
   135     * 
       
   136     * @param aMore ETrue if another frame is also ready to be transmitted
       
   137     *              EFalse otherwise
       
   138     */
       
   139     virtual void CallPacketSchedule( 
       
   140         WlanContextImpl& aCtxImpl,
       
   141         TBool aMore );
       
   142     
       
   143     virtual void OnPacketPushPossible( WlanContextImpl& aCtxImpl );
       
   144     
       
   145 protected:
       
   146 
       
   147     /**
       
   148     * C++ default constructor.
       
   149     */
       
   150     WlanMacActionState() : iDot11HistoryState( NULL ) {};
       
   151 
       
   152     void ChangeState( 
       
   153         WlanContextImpl& aCtxImpl, 
       
   154         WlanDot11State& aPrevState,
       
   155         WlanDot11State& aNewState );
       
   156 
       
   157     void ChangeState( 
       
   158         WlanContextImpl& aCtxImpl, 
       
   159         WlanDot11State& aPrevState,
       
   160         WlanWsaComplexCommand& aNewState,
       
   161         TUint32 aAct = 0 );
       
   162 
       
   163     void ChangeState( 
       
   164         WlanContextImpl& aCtxImpl, 
       
   165         WlanDot11State& aPrevState,
       
   166         WlanWsaCommand& aNewState,
       
   167         TUint32 aAct = 0 );
       
   168 
       
   169     void ChangeState( 
       
   170         WlanContextImpl& aCtxImpl, 
       
   171         WlanWsaComplexCommand& aPrevState,
       
   172         WlanWsaCommand& aNewState );
       
   173 
       
   174     void ChangeState( 
       
   175         WlanContextImpl& aCtxImpl, 
       
   176         WlanWsaComplexCommand& aPrevState,
       
   177         WlanDot11State& aNewState );
       
   178 
       
   179     /**
       
   180      * dot11 protocol statemachine traversal from global state space
       
   181      * to dot11infrastructuremode state space
       
   182      *
       
   183      * @since S60 3.1
       
   184      * @param ?arg1 ?description
       
   185      * @param ?arg2 ?description
       
   186      */
       
   187     void ChangeState( 
       
   188         WlanContextImpl& aCtxImpl, 
       
   189         WlanDot11State& aPrevState,
       
   190         WlanDot11InfrastructureMode& aNewState );
       
   191 
       
   192     /**
       
   193      * dot11 protocol statemachine traversal 
       
   194      * within dot11infrastructuremode state space
       
   195      *
       
   196      * @since S60 3.1
       
   197      * @param ?arg1 ?description
       
   198      * @param ?arg2 ?description
       
   199      */
       
   200     void ChangeState( 
       
   201         WlanContextImpl& aCtxImpl, 
       
   202         WlanDot11InfrastructureMode& aPrevState,
       
   203         WlanDot11InfrastructureMode& aNewState );
       
   204 
       
   205     /**
       
   206      * dot11 protocol statemachine traversal 
       
   207      * from dot11infrastructuremode state space to the global state space
       
   208      *
       
   209      * @since S60 3.1
       
   210      * @param ?arg1 ?description
       
   211      * @param ?arg2 ?description
       
   212      */
       
   213     void ChangeState( 
       
   214         WlanContextImpl& aCtxImpl, 
       
   215         WlanDot11InfrastructureMode& aPrevState,
       
   216         WlanDot11State& aNewState );
       
   217 
       
   218     /**
       
   219      * dot11 protocol statemachine traversal from global state space
       
   220      * to dot11ibssmode state space
       
   221      *
       
   222      * @since S60 3.1
       
   223      * @param ?arg1 ?description
       
   224      * @param ?arg2 ?description
       
   225      */
       
   226     void ChangeState( 
       
   227         WlanContextImpl& aCtxImpl, 
       
   228         WlanDot11State& aPrevState,
       
   229         WlanDot11IbssMode& aNewState );
       
   230 
       
   231     /**
       
   232      * dot11 protocol statemachine traversal 
       
   233      * within dot11ibssmode state space
       
   234      *
       
   235      * @since S60 3.1
       
   236      * @param ?arg1 ?description
       
   237      * @param ?arg2 ?description
       
   238      */
       
   239     void ChangeState( 
       
   240         WlanContextImpl& aCtxImpl, 
       
   241         WlanDot11IbssMode& aPrevState,
       
   242         WlanDot11IbssMode& aNewState );
       
   243 
       
   244     /**
       
   245      * dot11 protocol statemachine traversal 
       
   246      * from dot11ibssmode state space to the global state space
       
   247      *
       
   248      * @since S60 3.1
       
   249      * @param ?arg1 ?description
       
   250      * @param ?arg2 ?description
       
   251      */
       
   252     void ChangeState( 
       
   253         WlanContextImpl& aCtxImpl, 
       
   254         WlanDot11IbssMode& aPrevState,
       
   255         WlanDot11State& aNewState );
       
   256 
       
   257     inline WlanDot11State& Dot11History();
       
   258 
       
   259 private:
       
   260 
       
   261     inline void Dot11History( WlanDot11State& aState );
       
   262 
       
   263     void OnDot11InfrastructureModeStateSpaceEntry( 
       
   264         WlanContextImpl& aCtxImpl );
       
   265 
       
   266     void OnDot11InfrastructureModeStateSpaceExit( 
       
   267         WlanContextImpl& aCtxImpl ) const;
       
   268 
       
   269     void OnDot11IbssModeStateSpaceEntry(
       
   270         WlanContextImpl& aCtxImpl ) const;
       
   271 
       
   272     void OnDot11IbssModeStateSpaceExit(
       
   273         WlanContextImpl& aCtxImpl ) const;
       
   274 
       
   275     /**
       
   276     * Sets the Tx offset for every frame type which can be transmitted
       
   277     *
       
   278     * @param aCtxImpl global statemachine context
       
   279     */
       
   280     void SetMgmtSideTxOffsets( WlanContextImpl& aCtxImpl ) const;    
       
   281 
       
   282 private:    // Data
       
   283 
       
   284     /**
       
   285     * History (previous) state
       
   286     * Not own
       
   287     */
       
   288     WlanDot11State*   iDot11HistoryState;
       
   289     };
       
   290 
       
   291 
       
   292 #include "UmacMacActionState.inl"
       
   293 
       
   294 #endif      // WLANMACACTIONSTATE_H
       
   295