VOID p2pStateAbort_CHNL_ON_HAND ( IN P_ADAPTER_T prAdapter, IN P_P2P_FSM_INFO_T prP2pFsmInfo, IN P_BSS_INFO_T prP2pBssInfo, IN ENUM_P2P_STATE_T eNextState ) { P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL; do { ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL)); prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo); cnmTimerStopTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer)); /* Restore the original channel info. */ prP2pBssInfo->ucPrimaryChannel = prChnlReqInfo->ucOriChnlNum; prP2pBssInfo->eBand = prChnlReqInfo->eOriBand; prP2pBssInfo->eBssSCO = prChnlReqInfo->eOriChnlSco; if (eNextState != P2P_STATE_CHNL_ON_HAND) { /* Indicate channel return. */ kalP2PIndicateChannelExpired(prAdapter->prGlueInfo, &prP2pFsmInfo->rChnlReqInfo); // Return Channel. p2pFuncReleaseCh(prAdapter, &(prP2pFsmInfo->rChnlReqInfo)); } } while (FALSE); return; } /* p2pStateAbort_CHNL_ON_HAND */
VOID p2pStateAbort_IDLE ( IN P_ADAPTER_T prAdapter, IN P_P2P_FSM_INFO_T prP2pFsmInfo, IN ENUM_P2P_STATE_T eNextState ) { P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T)NULL; do { ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL)); prChnlReqInfo = &prP2pFsmInfo->rChnlReqInfo; if (prChnlReqInfo->fgIsChannelRequested) { /* Release channel before timeout. */ p2pFuncReleaseCh(prAdapter, prChnlReqInfo); } /* Stop timer for leaving this state. */ cnmTimerStopTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer)); } while (FALSE); return; } /* p2pStateAbort_IDLE */
VOID p2pDevStateAbort_REQING_CHANNEL(IN P_ADAPTER_T prAdapter, IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo, IN ENUM_P2P_DEV_STATE_T eNextState) { do { ASSERT_BREAK((prAdapter != NULL) && (prChnlReqInfo != NULL) && (eNextState < P2P_DEV_STATE_NUM)); switch (eNextState) { case P2P_DEV_STATE_IDLE: /* Channel abort case. */ p2pFuncReleaseCh(prAdapter, P2P_DEV_BSS_INDEX, prChnlReqInfo); break; case P2P_DEV_STATE_CHNL_ON_HAND: /* Channel on hand case. */ break; default: /* Un-expected state transition. */ DBGLOG(P2P, ERROR, ("Unexpected State Transition(%d)\n", eNextState)); ASSERT(FALSE); break; } } while (FALSE); return; } /* p2pDevStateAbort_REQING_CHANNEL */
VOID p2pDevStateAbort_OFF_CHNL_TX(IN P_ADAPTER_T prAdapter, IN P_P2P_MGMT_TX_REQ_INFO_T prP2pMgmtTxInfo, IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo, IN ENUM_P2P_DEV_STATE_T eNextState) { P_P2P_OFF_CHNL_TX_REQ_INFO_T prP2pOffChnlTxPkt = (P_P2P_OFF_CHNL_TX_REQ_INFO_T) NULL; do { ASSERT_BREAK((prAdapter != NULL) && (prP2pMgmtTxInfo != NULL) && (prChnlReqInfo != NULL)); if (eNextState != P2P_DEV_STATE_OFF_CHNL_TX) { while (!LINK_IS_EMPTY(&(prP2pMgmtTxInfo->rP2pTxReqLink))) { LINK_REMOVE_HEAD(&(prP2pMgmtTxInfo->rP2pTxReqLink), prP2pOffChnlTxPkt, P_P2P_OFF_CHNL_TX_REQ_INFO_T); kalP2PIndicateMgmtTxStatus(prAdapter->prGlueInfo, prP2pOffChnlTxPkt->prMgmtTxMsdu, FALSE); } p2pFuncReleaseCh(prAdapter, P2P_DEV_BSS_INDEX, prChnlReqInfo); } } while (FALSE); return; } /* p2pDevSateAbort_OFF_CHNL_TX */
VOID p2pDevStateAbort_CHNL_ON_HAND(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prP2pBssInfo, IN P_P2P_DEV_FSM_INFO_T prP2pDevFsmInfo, IN P_P2P_CHNL_REQ_INFO_T prChnlReqInfo) { do { ASSERT_BREAK((prAdapter != NULL) || (prChnlReqInfo != NULL)); cnmTimerStopTimer(prAdapter, &(prP2pDevFsmInfo->rP2pFsmTimeoutTimer)); prP2pBssInfo->ucPrimaryChannel = prChnlReqInfo->ucOriChnlNum; prP2pBssInfo->eBand = prChnlReqInfo->eOriBand; prP2pBssInfo->eBssSCO = prChnlReqInfo->eOriChnlSco; kalP2PIndicateChannelExpired(prAdapter->prGlueInfo, prChnlReqInfo->u8Cookie, prChnlReqInfo->ucReqChnlNum, prChnlReqInfo->eBand, prChnlReqInfo->eChnlSco); p2pFuncReleaseCh(prAdapter, prP2pDevFsmInfo->ucBssIndex, prChnlReqInfo); } while (FALSE); return; } /* p2pDevStateAbort_CHNL_ON_HAND */
VOID p2pStateAbort_REQING_CHANNEL ( IN P_ADAPTER_T prAdapter, IN P_P2P_FSM_INFO_T prP2pFsmInfo, IN ENUM_P2P_STATE_T eNextState ) { P_BSS_INFO_T prP2pBssInfo = (P_BSS_INFO_T)NULL; P_P2P_SPECIFIC_BSS_INFO_T prP2pSpecificBssInfo = (P_P2P_SPECIFIC_BSS_INFO_T)NULL; do { ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL) && (eNextState < P2P_STATE_NUM)); prP2pBssInfo = &(prAdapter->rWifiVar.arBssInfo[NETWORK_TYPE_P2P_INDEX]); prP2pSpecificBssInfo = prAdapter->rWifiVar.prP2pSpecificBssInfo; if (eNextState == P2P_STATE_IDLE) { if (prP2pBssInfo->eIntendOPMode == OP_MODE_ACCESS_POINT) { /* Intend to be AP. */ /* Setup for AP mode. */ #if 0 p2pFuncStartGO(prAdapter, prP2pBssInfo, prP2pSpecificBssInfo->aucGroupSsid, prP2pSpecificBssInfo->u2GroupSsidLen, prP2pSpecificBssInfo->ucPreferredChannel, prP2pSpecificBssInfo->eRfBand, prP2pSpecificBssInfo->eRfSco, prP2pFsmInfo->fgIsApMode); #endif } else { // Return Channel. p2pFuncReleaseCh(prAdapter, &(prP2pFsmInfo->rChnlReqInfo)); } } } while (FALSE); return; } /* p2pStateInit_AP_CHANNEL_DETECT */
/*----------------------------------------------------------------------------*/ VOID p2pStateAbort_GC_JOIN ( IN P_ADAPTER_T prAdapter, IN P_P2P_FSM_INFO_T prP2pFsmInfo, IN P_P2P_JOIN_INFO_T prJoinInfo, IN ENUM_P2P_STATE_T eNextState ) { P_MSG_JOIN_ABORT_T prJoinAbortMsg = (P_MSG_JOIN_ABORT_T)NULL; do { ASSERT_BREAK((prAdapter != NULL) && (prP2pFsmInfo != NULL) && (prJoinInfo != NULL)); if (prJoinInfo->fgIsJoinComplete == FALSE) { prJoinAbortMsg = (P_MSG_JOIN_ABORT_T)cnmMemAlloc(prAdapter, RAM_TYPE_MSG, sizeof(MSG_JOIN_ABORT_T)); if (!prJoinAbortMsg) { DBGLOG(P2P, TRACE, ("Fail to allocate join abort message buffer\n")); ASSERT(FALSE); return; } prJoinAbortMsg->rMsgHdr.eMsgId = MID_P2P_SAA_FSM_ABORT; prJoinAbortMsg->ucSeqNum = prJoinInfo->ucSeqNumOfReqMsg; prJoinAbortMsg->prStaRec = prJoinInfo->prTargetStaRec; mboxSendMsg(prAdapter, MBOX_ID_0, (P_MSG_HDR_T)prJoinAbortMsg, MSG_SEND_METHOD_BUF); } /* Stop Join Timer. */ cnmTimerStopTimer(prAdapter, &(prP2pFsmInfo->rP2pFsmTimeoutTimer)); /* Release channel requested. */ p2pFuncReleaseCh(prAdapter, &(prP2pFsmInfo->rChnlReqInfo)); } while (FALSE); return; } /* p2pStateAbort_GC_JOIN */