Loading drivers/staging/rt3070/ap.h +0 −11 Original line number Diff line number Diff line Loading @@ -159,9 +159,6 @@ USHORT APBuildAssociation( IN UCHAR *pRSNLen, IN BOOLEAN bWmmCapable, IN ULONG RalinkIe, #ifdef DOT11N_DRAFT3 IN EXT_CAP_INFO_ELEMENT ExtCapInfo, #endif // DOT11N_DRAFT3 // IN HT_CAPABILITY_IE *pHtCapability, IN UCHAR HtCapabilityLen, OUT USHORT *pAid); Loading Loading @@ -294,11 +291,6 @@ VOID SupportRate( BOOLEAN ApScanRunning( IN PRTMP_ADAPTER pAd); #ifdef DOT11N_DRAFT3 VOID APOverlappingBSSScan( IN RTMP_ADAPTER *pAd); #endif // DOT11N_DRAFT3 // // ap_wpa.c VOID APWpaStateMachineInit( Loading Loading @@ -491,9 +483,6 @@ BOOLEAN PeerAssocReqCmmSanity( OUT UCHAR *pRSNLen, OUT BOOLEAN *pbWmmCapable, OUT ULONG *pRalinkIe, #ifdef DOT11N_DRAFT3 OUT EXT_CAP_INFO_ELEMENT *pExtCapInfo, #endif // DOT11N_DRAFT3 // OUT UCHAR *pHtCapabilityLen, OUT HT_CAPABILITY_IE *pHtCapability); Loading drivers/staging/rt3070/common/action.c +0 −352 Original line number Diff line number Diff line Loading @@ -308,321 +308,14 @@ VOID PeerBAAction( break; } } #ifdef DOT11N_DRAFT3 #ifdef CONFIG_STA_SUPPORT VOID StaPublicAction( IN PRTMP_ADAPTER pAd, IN UCHAR Bss2040Coexist) { BSS_2040_COEXIST_IE BssCoexist; MLME_SCAN_REQ_STRUCT ScanReq; BssCoexist.word = Bss2040Coexist; // AP asks Station to return a 20/40 BSS Coexistence mgmt frame. So we first starts a scan, then send back 20/40 BSS Coexistence mgmt frame if ((BssCoexist.field.InfoReq == 1) && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SCAN_2040))) { // Clear record first. After scan , will update those bit and send back to transmiter. pAd->CommonCfg.BSSCoexist2040.field.InfoReq = 1; pAd->CommonCfg.BSSCoexist2040.field.Intolerant40 = 0; pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq = 0; // Fill out stuff for scan request ScanParmFill(pAd, &ScanReq, ZeroSsid, 0, BSS_ANY, SCAN_2040_BSS_COEXIST); MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq); pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN; } } /* Description : Build Intolerant Channel Rerpot from Trigger event table. return : how many bytes copied. */ ULONG BuildIntolerantChannelRep( IN PRTMP_ADAPTER pAd, IN PUCHAR pDest) { ULONG FrameLen = 0; ULONG ReadOffset = 0; UCHAR i; UCHAR LastRegClass = 0xff; PUCHAR pLen; for ( i = 0;i < MAX_TRIGGER_EVENT;i++) { if (pAd->CommonCfg.TriggerEventTab.EventA[i].bValid == TRUE) { if (pAd->CommonCfg.TriggerEventTab.EventA[i].RegClass == LastRegClass) { *(pDest + ReadOffset) = (UCHAR)pAd->CommonCfg.TriggerEventTab.EventA[i].Channel; *pLen++; ReadOffset++; FrameLen++; } else { *(pDest + ReadOffset) = IE_2040_BSS_INTOLERANT_REPORT; // IE *(pDest + ReadOffset + 1) = 2; // Len = RegClass byte + channel byte. pLen = pDest + ReadOffset + 1; LastRegClass = pAd->CommonCfg.TriggerEventTab.EventA[i].RegClass; *(pDest + ReadOffset + 2) = LastRegClass; // Len = RegClass byte + channel byte. *(pDest + ReadOffset + 3) = (UCHAR)pAd->CommonCfg.TriggerEventTab.EventA[i].Channel; FrameLen += 4; ReadOffset += 4; } } } return FrameLen; } /* Description : Send 20/40 BSS Coexistence Action frame If one trigger event is triggered. */ VOID Send2040CoexistAction( IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN BOOLEAN bAddIntolerantCha) { PUCHAR pOutBuffer = NULL; NDIS_STATUS NStatus; FRAME_ACTION_HDR Frame; ULONG FrameLen; ULONG IntolerantChaRepLen; IntolerantChaRepLen = 0; NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory if(NStatus != NDIS_STATUS_SUCCESS) { DBGPRINT(RT_DEBUG_ERROR,("ACT - Send2040CoexistAction() allocate memory failed \n")); return; } ActHeaderInit(pAd, &Frame.Hdr, pAd->MacTab.Content[Wcid].Addr, pAd->CommonCfg.Bssid); Frame.Category = CATEGORY_PUBLIC; Frame.Action = ACTION_BSS_2040_COEXIST; MakeOutgoingFrame(pOutBuffer, &FrameLen, sizeof(FRAME_ACTION_HDR), &Frame, END_OF_ARGS); *(pOutBuffer + FrameLen) = pAd->CommonCfg.BSSCoexist2040.word; FrameLen++; if (bAddIntolerantCha == TRUE) IntolerantChaRepLen = BuildIntolerantChannelRep(pAd, pOutBuffer + FrameLen); MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen + IntolerantChaRepLen); DBGPRINT(RT_DEBUG_ERROR,("ACT - Send2040CoexistAction( BSSCoexist2040 = 0x%x ) \n", pAd->CommonCfg.BSSCoexist2040.word)); } /* ========================================================================== Description: After scan, Update 20/40 BSS Coexistence IE and send out. According to 802.11n D3.03 11.14.10 Parameters: ========================================================================== */ VOID Update2040CoexistFrameAndNotify( IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN BOOLEAN bAddIntolerantCha) { BSS_2040_COEXIST_IE OldValue; OldValue.word = pAd->CommonCfg.BSSCoexist2040.word; if ((pAd->CommonCfg.TriggerEventTab.EventANo > 0) || (pAd->CommonCfg.TriggerEventTab.EventBCountDown > 0)) pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq = 1; // Need to check !!!! // How STA will set Intolerant40 if implementation dependent. Now we don't set this bit first.!!!!! // So Only check BSS20WidthReq change. if (OldValue.field.BSS20WidthReq != pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq) { Send2040CoexistAction(pAd, Wcid, bAddIntolerantCha); } } #endif // CONFIG_STA_SUPPORT // BOOLEAN ChannelSwitchSanityCheck( IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN UCHAR NewChannel, IN UCHAR Secondary) { UCHAR i; if (Wcid >= MAX_LEN_OF_MAC_TABLE) return FALSE; if ((NewChannel > 7) && (Secondary == 1)) return FALSE; if ((NewChannel < 5) && (Secondary == 3)) return FALSE; // 0. Check if new channel is in the channellist. for (i = 0;i < pAd->ChannelListNum;i++) { if (pAd->ChannelList[i].Channel == NewChannel) { break; } } if (i == pAd->ChannelListNum) return FALSE; return TRUE; } VOID ChannelSwitchAction( IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN UCHAR NewChannel, IN UCHAR Secondary) { UCHAR BBPValue = 0; ULONG MACValue; DBGPRINT(RT_DEBUG_TRACE,("SPECTRUM - ChannelSwitchAction(NewChannel = %d , Secondary = %d) \n", NewChannel, Secondary)); if (ChannelSwitchSanityCheck(pAd, Wcid, NewChannel, Secondary) == FALSE) return; // 1. Switches to BW = 20. if (Secondary == 0) { RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue); BBPValue&= (~0x18); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue); if (pAd->MACVersion == 0x28600100) { RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x08); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x11); DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" )); } pAd->CommonCfg.BBPCurrentBW = BW_20; pAd->CommonCfg.Channel = NewChannel; pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel; AsicSwitchChannel(pAd, pAd->CommonCfg.Channel,FALSE); AsicLockChannel(pAd, pAd->CommonCfg.Channel); pAd->MacTab.Content[Wcid].HTPhyMode.field.BW = 0; DBGPRINT(RT_DEBUG_TRACE, ("!!!20MHz !!! \n" )); } // 1. Switches to BW = 40 And Station supports BW = 40. else if (((Secondary == 1) || (Secondary == 3)) && (pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth == 1)) { pAd->CommonCfg.Channel = NewChannel; if (Secondary == 1) { // Secondary above. pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel + 2; RTMP_IO_READ32(pAd, TX_BAND_CFG, &MACValue); MACValue &= 0xfe; RTMP_IO_WRITE32(pAd, TX_BAND_CFG, MACValue); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue); BBPValue&= (~0x18); BBPValue|= (0x10); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPValue); BBPValue&= (~0x20); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPValue); DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Lower LINK UP !!! Control Channel at Below. Central = %d \n", pAd->CommonCfg.CentralChannel )); } else { // Secondary below. pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel - 2; RTMP_IO_READ32(pAd, TX_BAND_CFG, &MACValue); MACValue &= 0xfe; MACValue |= 0x1; RTMP_IO_WRITE32(pAd, TX_BAND_CFG, MACValue); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue); BBPValue&= (~0x18); BBPValue|= (0x10); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPValue); BBPValue&= (~0x20); BBPValue|= (0x20); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPValue); DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Upper LINK UP !!! Control Channel at UpperCentral = %d \n", pAd->CommonCfg.CentralChannel )); } pAd->CommonCfg.BBPCurrentBW = BW_40; AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE); AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel); pAd->MacTab.Content[Wcid].HTPhyMode.field.BW = 1; } } #endif // DOT11N_DRAFT3 // #endif // DOT11_N_SUPPORT // VOID PeerPublicAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { #ifdef DOT11N_DRAFT3 UCHAR Action = Elem->Msg[LENGTH_802_11+1]; #endif // DOT11N_DRAFT3 // if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE) return; #ifdef DOT11N_DRAFT3 switch(Action) { case ACTION_BSS_2040_COEXIST: // Format defined in IEEE 7.4.7a.1 in 11n Draf3.03 { //UCHAR BssCoexist; BSS_2040_COEXIST_ELEMENT *pCoexistInfo; BSS_2040_COEXIST_IE *pBssCoexistIe; BSS_2040_INTOLERANT_CH_REPORT *pIntolerantReport = NULL; if (Elem->MsgLen <= (LENGTH_802_11 + sizeof(BSS_2040_COEXIST_ELEMENT)) ) { DBGPRINT(RT_DEBUG_ERROR, ("ACTION - 20/40 BSS Coexistence Management Frame length too short! len = %ld!\n", Elem->MsgLen)); break; } DBGPRINT(RT_DEBUG_TRACE, ("ACTION - 20/40 BSS Coexistence Management action----> \n")); hex_dump("CoexistenceMgmtFrame", Elem->Msg, Elem->MsgLen); pCoexistInfo = (BSS_2040_COEXIST_ELEMENT *) &Elem->Msg[LENGTH_802_11+2]; //hex_dump("CoexistInfo", (PUCHAR)pCoexistInfo, sizeof(BSS_2040_COEXIST_ELEMENT)); if (Elem->MsgLen >= (LENGTH_802_11 + sizeof(BSS_2040_COEXIST_ELEMENT) + sizeof(BSS_2040_INTOLERANT_CH_REPORT))) { pIntolerantReport = (BSS_2040_INTOLERANT_CH_REPORT *)((PUCHAR)pCoexistInfo + sizeof(BSS_2040_COEXIST_ELEMENT)); } //hex_dump("IntolerantReport ", (PUCHAR)pIntolerantReport, sizeof(BSS_2040_INTOLERANT_CH_REPORT)); pBssCoexistIe = (BSS_2040_COEXIST_IE *)(&pCoexistInfo->BssCoexistIe); #ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (INFRA_ON(pAd)) { StaPublicAction(pAd, pCoexistInfo); } } #endif // CONFIG_STA_SUPPORT // } break; } #endif // DOT11N_DRAFT3 // } Loading Loading @@ -701,51 +394,6 @@ static VOID respond_ht_information_exchange_action( MlmeFreeMemory(pAd, pOutBuffer); } #ifdef DOT11N_DRAFT3 VOID SendNotifyBWActionFrame( IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN UCHAR apidx) { PUCHAR pOutBuffer = NULL; NDIS_STATUS NStatus; FRAME_ACTION_HDR Frame; ULONG FrameLen; PUCHAR pAddr1; NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory if(NStatus != NDIS_STATUS_SUCCESS) { DBGPRINT(RT_DEBUG_ERROR,("ACT - SendNotifyBWAction() allocate memory failed \n")); return; } if (Wcid == MCAST_WCID) pAddr1 = &BROADCAST_ADDR[0]; else pAddr1 = pAd->MacTab.Content[Wcid].Addr; ActHeaderInit(pAd, &Frame.Hdr, pAddr1, pAd->ApCfg.MBSSID[apidx].Bssid, pAd->ApCfg.MBSSID[apidx].Bssid); Frame.Category = CATEGORY_HT; Frame.Action = NOTIFY_BW_ACTION; MakeOutgoingFrame(pOutBuffer, &FrameLen, sizeof(FRAME_ACTION_HDR), &Frame, END_OF_ARGS); *(pOutBuffer + FrameLen) = pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth; FrameLen++; MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen); DBGPRINT(RT_DEBUG_TRACE,("ACT - SendNotifyBWAction(NotifyBW= %d)!\n", pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth)); } #endif // DOT11N_DRAFT3 // VOID PeerHTAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) Loading drivers/staging/rt3070/common/cmm_data.c +0 −13 Original line number Diff line number Diff line Loading @@ -1174,10 +1174,6 @@ VOID RTMPWriteTxWI( // If CCK or OFDM, BW must be 20 pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW); #ifdef DOT11N_DRAFT3 if (pTxWI->BW) pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW); #endif // DOT11N_DRAFT3 // pTxWI->MCS = pTransmit->field.MCS; pTxWI->PHYMODE = pTransmit->field.MODE; Loading Loading @@ -1257,10 +1253,6 @@ VOID RTMPWriteTxWI_Data( // If CCK or OFDM, BW must be 20 pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW); #ifdef DOT11_N_SUPPORT #ifdef DOT11N_DRAFT3 if (pTxWI->BW) pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW); #endif // DOT11N_DRAFT3 // pTxWI->AMPDU = ((pTxBlk->TxFrameType == TX_AMPDU_FRAME) ? TRUE : FALSE); // John tune the performace with Intel Client in 20 MHz performance Loading Loading @@ -1371,11 +1363,6 @@ VOID RTMPWriteTxWI_Cache( pTxWI->AMPDU = ((pMacEntry->NoBADataCountDown == 0) ? TRUE: FALSE); pTxWI->MIMOps = 0; #ifdef DOT11N_DRAFT3 if (pTxWI->BW) pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW); #endif // DOT11N_DRAFT3 // if (pAd->CommonCfg.bMIMOPSEnable) { // MIMO Power Save Mode Loading drivers/staging/rt3070/common/cmm_sanity.c +0 −70 Original line number Diff line number Diff line Loading @@ -786,76 +786,6 @@ BOOLEAN PeerBeaconAndProbeRspSanity( } #ifdef DOT11N_DRAFT3 /* ========================================================================== Description: MLME message sanity check for some IE addressed in 802.11n d3.03. Return: TRUE if all parameters are OK, FALSE otherwise IRQL = DISPATCH_LEVEL ========================================================================== */ BOOLEAN PeerBeaconAndProbeRspSanity2( IN PRTMP_ADAPTER pAd, IN VOID *Msg, IN ULONG MsgLen, OUT UCHAR *RegClass) { CHAR *Ptr; PFRAME_802_11 pFrame; PEID_STRUCT pEid; ULONG Length = 0; pFrame = (PFRAME_802_11)Msg; *RegClass = 0; Ptr = pFrame->Octet; Length += LENGTH_802_11; // get timestamp from payload and advance the pointer Ptr += TIMESTAMP_LEN; Length += TIMESTAMP_LEN; // get beacon interval from payload and advance the pointer Ptr += 2; Length += 2; // get capability info from payload and advance the pointer Ptr += 2; Length += 2; pEid = (PEID_STRUCT) Ptr; // get variable fields from payload and advance the pointer while ((Length + 2 + pEid->Len) <= MsgLen) { switch(pEid->Eid) { case IE_SUPP_REG_CLASS: if(pEid->Len > 0) { *RegClass = *pEid->Octet; } else { DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAndProbeRspSanity - wrong IE_SSID (len=%d)\n",pEid->Len)); return FALSE; } break; } Length = Length + 2 + pEid->Len; // Eid[1] + Len[1]+ content[Len] pEid = (PEID_STRUCT)((UCHAR*)pEid + 2 + pEid->Len); } return TRUE; } #endif // DOT11N_DRAFT3 // /* ========================================================================== Description: Loading drivers/staging/rt3070/common/cmm_sync.c +0 −15 Original line number Diff line number Diff line Loading @@ -639,21 +639,6 @@ VOID ScanNextChannel( #endif // RT_BIG_ENDIAN // } FrameLen += Tmp; #ifdef DOT11N_DRAFT3 if (pAd->CommonCfg.BACapability.field.b2040CoexistScanSup == 1) { ULONG Tmp; HtLen = 1; MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp, 1, &ExtHtCapIe, 1, &HtLen, 1, &pAd->CommonCfg.BSSCoexist2040.word, END_OF_ARGS); FrameLen += Tmp; } #endif // DOT11N_DRAFT3 // } #endif // DOT11_N_SUPPORT // Loading Loading
drivers/staging/rt3070/ap.h +0 −11 Original line number Diff line number Diff line Loading @@ -159,9 +159,6 @@ USHORT APBuildAssociation( IN UCHAR *pRSNLen, IN BOOLEAN bWmmCapable, IN ULONG RalinkIe, #ifdef DOT11N_DRAFT3 IN EXT_CAP_INFO_ELEMENT ExtCapInfo, #endif // DOT11N_DRAFT3 // IN HT_CAPABILITY_IE *pHtCapability, IN UCHAR HtCapabilityLen, OUT USHORT *pAid); Loading Loading @@ -294,11 +291,6 @@ VOID SupportRate( BOOLEAN ApScanRunning( IN PRTMP_ADAPTER pAd); #ifdef DOT11N_DRAFT3 VOID APOverlappingBSSScan( IN RTMP_ADAPTER *pAd); #endif // DOT11N_DRAFT3 // // ap_wpa.c VOID APWpaStateMachineInit( Loading Loading @@ -491,9 +483,6 @@ BOOLEAN PeerAssocReqCmmSanity( OUT UCHAR *pRSNLen, OUT BOOLEAN *pbWmmCapable, OUT ULONG *pRalinkIe, #ifdef DOT11N_DRAFT3 OUT EXT_CAP_INFO_ELEMENT *pExtCapInfo, #endif // DOT11N_DRAFT3 // OUT UCHAR *pHtCapabilityLen, OUT HT_CAPABILITY_IE *pHtCapability); Loading
drivers/staging/rt3070/common/action.c +0 −352 Original line number Diff line number Diff line Loading @@ -308,321 +308,14 @@ VOID PeerBAAction( break; } } #ifdef DOT11N_DRAFT3 #ifdef CONFIG_STA_SUPPORT VOID StaPublicAction( IN PRTMP_ADAPTER pAd, IN UCHAR Bss2040Coexist) { BSS_2040_COEXIST_IE BssCoexist; MLME_SCAN_REQ_STRUCT ScanReq; BssCoexist.word = Bss2040Coexist; // AP asks Station to return a 20/40 BSS Coexistence mgmt frame. So we first starts a scan, then send back 20/40 BSS Coexistence mgmt frame if ((BssCoexist.field.InfoReq == 1) && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SCAN_2040))) { // Clear record first. After scan , will update those bit and send back to transmiter. pAd->CommonCfg.BSSCoexist2040.field.InfoReq = 1; pAd->CommonCfg.BSSCoexist2040.field.Intolerant40 = 0; pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq = 0; // Fill out stuff for scan request ScanParmFill(pAd, &ScanReq, ZeroSsid, 0, BSS_ANY, SCAN_2040_BSS_COEXIST); MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq); pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN; } } /* Description : Build Intolerant Channel Rerpot from Trigger event table. return : how many bytes copied. */ ULONG BuildIntolerantChannelRep( IN PRTMP_ADAPTER pAd, IN PUCHAR pDest) { ULONG FrameLen = 0; ULONG ReadOffset = 0; UCHAR i; UCHAR LastRegClass = 0xff; PUCHAR pLen; for ( i = 0;i < MAX_TRIGGER_EVENT;i++) { if (pAd->CommonCfg.TriggerEventTab.EventA[i].bValid == TRUE) { if (pAd->CommonCfg.TriggerEventTab.EventA[i].RegClass == LastRegClass) { *(pDest + ReadOffset) = (UCHAR)pAd->CommonCfg.TriggerEventTab.EventA[i].Channel; *pLen++; ReadOffset++; FrameLen++; } else { *(pDest + ReadOffset) = IE_2040_BSS_INTOLERANT_REPORT; // IE *(pDest + ReadOffset + 1) = 2; // Len = RegClass byte + channel byte. pLen = pDest + ReadOffset + 1; LastRegClass = pAd->CommonCfg.TriggerEventTab.EventA[i].RegClass; *(pDest + ReadOffset + 2) = LastRegClass; // Len = RegClass byte + channel byte. *(pDest + ReadOffset + 3) = (UCHAR)pAd->CommonCfg.TriggerEventTab.EventA[i].Channel; FrameLen += 4; ReadOffset += 4; } } } return FrameLen; } /* Description : Send 20/40 BSS Coexistence Action frame If one trigger event is triggered. */ VOID Send2040CoexistAction( IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN BOOLEAN bAddIntolerantCha) { PUCHAR pOutBuffer = NULL; NDIS_STATUS NStatus; FRAME_ACTION_HDR Frame; ULONG FrameLen; ULONG IntolerantChaRepLen; IntolerantChaRepLen = 0; NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory if(NStatus != NDIS_STATUS_SUCCESS) { DBGPRINT(RT_DEBUG_ERROR,("ACT - Send2040CoexistAction() allocate memory failed \n")); return; } ActHeaderInit(pAd, &Frame.Hdr, pAd->MacTab.Content[Wcid].Addr, pAd->CommonCfg.Bssid); Frame.Category = CATEGORY_PUBLIC; Frame.Action = ACTION_BSS_2040_COEXIST; MakeOutgoingFrame(pOutBuffer, &FrameLen, sizeof(FRAME_ACTION_HDR), &Frame, END_OF_ARGS); *(pOutBuffer + FrameLen) = pAd->CommonCfg.BSSCoexist2040.word; FrameLen++; if (bAddIntolerantCha == TRUE) IntolerantChaRepLen = BuildIntolerantChannelRep(pAd, pOutBuffer + FrameLen); MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen + IntolerantChaRepLen); DBGPRINT(RT_DEBUG_ERROR,("ACT - Send2040CoexistAction( BSSCoexist2040 = 0x%x ) \n", pAd->CommonCfg.BSSCoexist2040.word)); } /* ========================================================================== Description: After scan, Update 20/40 BSS Coexistence IE and send out. According to 802.11n D3.03 11.14.10 Parameters: ========================================================================== */ VOID Update2040CoexistFrameAndNotify( IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN BOOLEAN bAddIntolerantCha) { BSS_2040_COEXIST_IE OldValue; OldValue.word = pAd->CommonCfg.BSSCoexist2040.word; if ((pAd->CommonCfg.TriggerEventTab.EventANo > 0) || (pAd->CommonCfg.TriggerEventTab.EventBCountDown > 0)) pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq = 1; // Need to check !!!! // How STA will set Intolerant40 if implementation dependent. Now we don't set this bit first.!!!!! // So Only check BSS20WidthReq change. if (OldValue.field.BSS20WidthReq != pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq) { Send2040CoexistAction(pAd, Wcid, bAddIntolerantCha); } } #endif // CONFIG_STA_SUPPORT // BOOLEAN ChannelSwitchSanityCheck( IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN UCHAR NewChannel, IN UCHAR Secondary) { UCHAR i; if (Wcid >= MAX_LEN_OF_MAC_TABLE) return FALSE; if ((NewChannel > 7) && (Secondary == 1)) return FALSE; if ((NewChannel < 5) && (Secondary == 3)) return FALSE; // 0. Check if new channel is in the channellist. for (i = 0;i < pAd->ChannelListNum;i++) { if (pAd->ChannelList[i].Channel == NewChannel) { break; } } if (i == pAd->ChannelListNum) return FALSE; return TRUE; } VOID ChannelSwitchAction( IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN UCHAR NewChannel, IN UCHAR Secondary) { UCHAR BBPValue = 0; ULONG MACValue; DBGPRINT(RT_DEBUG_TRACE,("SPECTRUM - ChannelSwitchAction(NewChannel = %d , Secondary = %d) \n", NewChannel, Secondary)); if (ChannelSwitchSanityCheck(pAd, Wcid, NewChannel, Secondary) == FALSE) return; // 1. Switches to BW = 20. if (Secondary == 0) { RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue); BBPValue&= (~0x18); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue); if (pAd->MACVersion == 0x28600100) { RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x08); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x11); DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" )); } pAd->CommonCfg.BBPCurrentBW = BW_20; pAd->CommonCfg.Channel = NewChannel; pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel; AsicSwitchChannel(pAd, pAd->CommonCfg.Channel,FALSE); AsicLockChannel(pAd, pAd->CommonCfg.Channel); pAd->MacTab.Content[Wcid].HTPhyMode.field.BW = 0; DBGPRINT(RT_DEBUG_TRACE, ("!!!20MHz !!! \n" )); } // 1. Switches to BW = 40 And Station supports BW = 40. else if (((Secondary == 1) || (Secondary == 3)) && (pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth == 1)) { pAd->CommonCfg.Channel = NewChannel; if (Secondary == 1) { // Secondary above. pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel + 2; RTMP_IO_READ32(pAd, TX_BAND_CFG, &MACValue); MACValue &= 0xfe; RTMP_IO_WRITE32(pAd, TX_BAND_CFG, MACValue); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue); BBPValue&= (~0x18); BBPValue|= (0x10); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPValue); BBPValue&= (~0x20); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPValue); DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Lower LINK UP !!! Control Channel at Below. Central = %d \n", pAd->CommonCfg.CentralChannel )); } else { // Secondary below. pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel - 2; RTMP_IO_READ32(pAd, TX_BAND_CFG, &MACValue); MACValue &= 0xfe; MACValue |= 0x1; RTMP_IO_WRITE32(pAd, TX_BAND_CFG, MACValue); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue); BBPValue&= (~0x18); BBPValue|= (0x10); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue); RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPValue); BBPValue&= (~0x20); BBPValue|= (0x20); RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPValue); DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Upper LINK UP !!! Control Channel at UpperCentral = %d \n", pAd->CommonCfg.CentralChannel )); } pAd->CommonCfg.BBPCurrentBW = BW_40; AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE); AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel); pAd->MacTab.Content[Wcid].HTPhyMode.field.BW = 1; } } #endif // DOT11N_DRAFT3 // #endif // DOT11_N_SUPPORT // VOID PeerPublicAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) { #ifdef DOT11N_DRAFT3 UCHAR Action = Elem->Msg[LENGTH_802_11+1]; #endif // DOT11N_DRAFT3 // if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE) return; #ifdef DOT11N_DRAFT3 switch(Action) { case ACTION_BSS_2040_COEXIST: // Format defined in IEEE 7.4.7a.1 in 11n Draf3.03 { //UCHAR BssCoexist; BSS_2040_COEXIST_ELEMENT *pCoexistInfo; BSS_2040_COEXIST_IE *pBssCoexistIe; BSS_2040_INTOLERANT_CH_REPORT *pIntolerantReport = NULL; if (Elem->MsgLen <= (LENGTH_802_11 + sizeof(BSS_2040_COEXIST_ELEMENT)) ) { DBGPRINT(RT_DEBUG_ERROR, ("ACTION - 20/40 BSS Coexistence Management Frame length too short! len = %ld!\n", Elem->MsgLen)); break; } DBGPRINT(RT_DEBUG_TRACE, ("ACTION - 20/40 BSS Coexistence Management action----> \n")); hex_dump("CoexistenceMgmtFrame", Elem->Msg, Elem->MsgLen); pCoexistInfo = (BSS_2040_COEXIST_ELEMENT *) &Elem->Msg[LENGTH_802_11+2]; //hex_dump("CoexistInfo", (PUCHAR)pCoexistInfo, sizeof(BSS_2040_COEXIST_ELEMENT)); if (Elem->MsgLen >= (LENGTH_802_11 + sizeof(BSS_2040_COEXIST_ELEMENT) + sizeof(BSS_2040_INTOLERANT_CH_REPORT))) { pIntolerantReport = (BSS_2040_INTOLERANT_CH_REPORT *)((PUCHAR)pCoexistInfo + sizeof(BSS_2040_COEXIST_ELEMENT)); } //hex_dump("IntolerantReport ", (PUCHAR)pIntolerantReport, sizeof(BSS_2040_INTOLERANT_CH_REPORT)); pBssCoexistIe = (BSS_2040_COEXIST_IE *)(&pCoexistInfo->BssCoexistIe); #ifdef CONFIG_STA_SUPPORT IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { if (INFRA_ON(pAd)) { StaPublicAction(pAd, pCoexistInfo); } } #endif // CONFIG_STA_SUPPORT // } break; } #endif // DOT11N_DRAFT3 // } Loading Loading @@ -701,51 +394,6 @@ static VOID respond_ht_information_exchange_action( MlmeFreeMemory(pAd, pOutBuffer); } #ifdef DOT11N_DRAFT3 VOID SendNotifyBWActionFrame( IN PRTMP_ADAPTER pAd, IN UCHAR Wcid, IN UCHAR apidx) { PUCHAR pOutBuffer = NULL; NDIS_STATUS NStatus; FRAME_ACTION_HDR Frame; ULONG FrameLen; PUCHAR pAddr1; NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory if(NStatus != NDIS_STATUS_SUCCESS) { DBGPRINT(RT_DEBUG_ERROR,("ACT - SendNotifyBWAction() allocate memory failed \n")); return; } if (Wcid == MCAST_WCID) pAddr1 = &BROADCAST_ADDR[0]; else pAddr1 = pAd->MacTab.Content[Wcid].Addr; ActHeaderInit(pAd, &Frame.Hdr, pAddr1, pAd->ApCfg.MBSSID[apidx].Bssid, pAd->ApCfg.MBSSID[apidx].Bssid); Frame.Category = CATEGORY_HT; Frame.Action = NOTIFY_BW_ACTION; MakeOutgoingFrame(pOutBuffer, &FrameLen, sizeof(FRAME_ACTION_HDR), &Frame, END_OF_ARGS); *(pOutBuffer + FrameLen) = pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth; FrameLen++; MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen); DBGPRINT(RT_DEBUG_TRACE,("ACT - SendNotifyBWAction(NotifyBW= %d)!\n", pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth)); } #endif // DOT11N_DRAFT3 // VOID PeerHTAction( IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM *Elem) Loading
drivers/staging/rt3070/common/cmm_data.c +0 −13 Original line number Diff line number Diff line Loading @@ -1174,10 +1174,6 @@ VOID RTMPWriteTxWI( // If CCK or OFDM, BW must be 20 pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW); #ifdef DOT11N_DRAFT3 if (pTxWI->BW) pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW); #endif // DOT11N_DRAFT3 // pTxWI->MCS = pTransmit->field.MCS; pTxWI->PHYMODE = pTransmit->field.MODE; Loading Loading @@ -1257,10 +1253,6 @@ VOID RTMPWriteTxWI_Data( // If CCK or OFDM, BW must be 20 pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW); #ifdef DOT11_N_SUPPORT #ifdef DOT11N_DRAFT3 if (pTxWI->BW) pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW); #endif // DOT11N_DRAFT3 // pTxWI->AMPDU = ((pTxBlk->TxFrameType == TX_AMPDU_FRAME) ? TRUE : FALSE); // John tune the performace with Intel Client in 20 MHz performance Loading Loading @@ -1371,11 +1363,6 @@ VOID RTMPWriteTxWI_Cache( pTxWI->AMPDU = ((pMacEntry->NoBADataCountDown == 0) ? TRUE: FALSE); pTxWI->MIMOps = 0; #ifdef DOT11N_DRAFT3 if (pTxWI->BW) pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW); #endif // DOT11N_DRAFT3 // if (pAd->CommonCfg.bMIMOPSEnable) { // MIMO Power Save Mode Loading
drivers/staging/rt3070/common/cmm_sanity.c +0 −70 Original line number Diff line number Diff line Loading @@ -786,76 +786,6 @@ BOOLEAN PeerBeaconAndProbeRspSanity( } #ifdef DOT11N_DRAFT3 /* ========================================================================== Description: MLME message sanity check for some IE addressed in 802.11n d3.03. Return: TRUE if all parameters are OK, FALSE otherwise IRQL = DISPATCH_LEVEL ========================================================================== */ BOOLEAN PeerBeaconAndProbeRspSanity2( IN PRTMP_ADAPTER pAd, IN VOID *Msg, IN ULONG MsgLen, OUT UCHAR *RegClass) { CHAR *Ptr; PFRAME_802_11 pFrame; PEID_STRUCT pEid; ULONG Length = 0; pFrame = (PFRAME_802_11)Msg; *RegClass = 0; Ptr = pFrame->Octet; Length += LENGTH_802_11; // get timestamp from payload and advance the pointer Ptr += TIMESTAMP_LEN; Length += TIMESTAMP_LEN; // get beacon interval from payload and advance the pointer Ptr += 2; Length += 2; // get capability info from payload and advance the pointer Ptr += 2; Length += 2; pEid = (PEID_STRUCT) Ptr; // get variable fields from payload and advance the pointer while ((Length + 2 + pEid->Len) <= MsgLen) { switch(pEid->Eid) { case IE_SUPP_REG_CLASS: if(pEid->Len > 0) { *RegClass = *pEid->Octet; } else { DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAndProbeRspSanity - wrong IE_SSID (len=%d)\n",pEid->Len)); return FALSE; } break; } Length = Length + 2 + pEid->Len; // Eid[1] + Len[1]+ content[Len] pEid = (PEID_STRUCT)((UCHAR*)pEid + 2 + pEid->Len); } return TRUE; } #endif // DOT11N_DRAFT3 // /* ========================================================================== Description: Loading
drivers/staging/rt3070/common/cmm_sync.c +0 −15 Original line number Diff line number Diff line Loading @@ -639,21 +639,6 @@ VOID ScanNextChannel( #endif // RT_BIG_ENDIAN // } FrameLen += Tmp; #ifdef DOT11N_DRAFT3 if (pAd->CommonCfg.BACapability.field.b2040CoexistScanSup == 1) { ULONG Tmp; HtLen = 1; MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp, 1, &ExtHtCapIe, 1, &HtLen, 1, &pAd->CommonCfg.BSSCoexist2040.word, END_OF_ARGS); FrameLen += Tmp; } #endif // DOT11N_DRAFT3 // } #endif // DOT11_N_SUPPORT // Loading