aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-04-26 10:05:33 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-19 14:00:46 -0400
commit03ddd40f1451674e94f717e6a2bff58ddebf3eef (patch)
tree1f27b209690d723e757284ced078dace7697064a /drivers
parent4ad3198c5bb223c94d1b188ea1d8433c54ae888e (diff)
Staging: rt3070: remove dead DOT11N_DRAFT3 code
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/rt3070/ap.h11
-rw-r--r--drivers/staging/rt3070/common/action.c352
-rw-r--r--drivers/staging/rt3070/common/cmm_data.c13
-rw-r--r--drivers/staging/rt3070/common/cmm_sanity.c70
-rw-r--r--drivers/staging/rt3070/common/cmm_sync.c15
-rw-r--r--drivers/staging/rt3070/common/mlme.c116
-rw-r--r--drivers/staging/rt3070/common/rtmp_init.c11
-rw-r--r--drivers/staging/rt3070/common/spectrum.c22
-rw-r--r--drivers/staging/rt3070/mlme.h4
-rw-r--r--drivers/staging/rt3070/rtmp.h119
-rw-r--r--drivers/staging/rt3070/rtmp_def.h8
-rw-r--r--drivers/staging/rt3070/sta/connect.c29
-rw-r--r--drivers/staging/rt3070/sta/sync.c93
13 files changed, 1 insertions, 862 deletions
diff --git a/drivers/staging/rt3070/ap.h b/drivers/staging/rt3070/ap.h
index f5ba042e52b..fb59ad09569 100644
--- a/drivers/staging/rt3070/ap.h
+++ b/drivers/staging/rt3070/ap.h
@@ -159,9 +159,6 @@ USHORT APBuildAssociation(
159 IN UCHAR *pRSNLen, 159 IN UCHAR *pRSNLen,
160 IN BOOLEAN bWmmCapable, 160 IN BOOLEAN bWmmCapable,
161 IN ULONG RalinkIe, 161 IN ULONG RalinkIe,
162#ifdef DOT11N_DRAFT3
163 IN EXT_CAP_INFO_ELEMENT ExtCapInfo,
164#endif // DOT11N_DRAFT3 //
165 IN HT_CAPABILITY_IE *pHtCapability, 162 IN HT_CAPABILITY_IE *pHtCapability,
166 IN UCHAR HtCapabilityLen, 163 IN UCHAR HtCapabilityLen,
167 OUT USHORT *pAid); 164 OUT USHORT *pAid);
@@ -294,11 +291,6 @@ VOID SupportRate(
294BOOLEAN ApScanRunning( 291BOOLEAN ApScanRunning(
295 IN PRTMP_ADAPTER pAd); 292 IN PRTMP_ADAPTER pAd);
296 293
297#ifdef DOT11N_DRAFT3
298VOID APOverlappingBSSScan(
299 IN RTMP_ADAPTER *pAd);
300#endif // DOT11N_DRAFT3 //
301
302// ap_wpa.c 294// ap_wpa.c
303 295
304VOID APWpaStateMachineInit( 296VOID APWpaStateMachineInit(
@@ -491,9 +483,6 @@ BOOLEAN PeerAssocReqCmmSanity(
491 OUT UCHAR *pRSNLen, 483 OUT UCHAR *pRSNLen,
492 OUT BOOLEAN *pbWmmCapable, 484 OUT BOOLEAN *pbWmmCapable,
493 OUT ULONG *pRalinkIe, 485 OUT ULONG *pRalinkIe,
494#ifdef DOT11N_DRAFT3
495 OUT EXT_CAP_INFO_ELEMENT *pExtCapInfo,
496#endif // DOT11N_DRAFT3 //
497 OUT UCHAR *pHtCapabilityLen, 486 OUT UCHAR *pHtCapabilityLen,
498 OUT HT_CAPABILITY_IE *pHtCapability); 487 OUT HT_CAPABILITY_IE *pHtCapability);
499 488
diff --git a/drivers/staging/rt3070/common/action.c b/drivers/staging/rt3070/common/action.c
index b7a403294c3..e36f90f46a4 100644
--- a/drivers/staging/rt3070/common/action.c
+++ b/drivers/staging/rt3070/common/action.c
@@ -308,321 +308,14 @@ VOID PeerBAAction(
308 break; 308 break;
309 } 309 }
310} 310}
311
312
313#ifdef DOT11N_DRAFT3
314
315#ifdef CONFIG_STA_SUPPORT
316VOID StaPublicAction(
317 IN PRTMP_ADAPTER pAd,
318 IN UCHAR Bss2040Coexist)
319{
320 BSS_2040_COEXIST_IE BssCoexist;
321 MLME_SCAN_REQ_STRUCT ScanReq;
322
323 BssCoexist.word = Bss2040Coexist;
324 // 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
325 if ((BssCoexist.field.InfoReq == 1) && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SCAN_2040)))
326 {
327 // Clear record first. After scan , will update those bit and send back to transmiter.
328 pAd->CommonCfg.BSSCoexist2040.field.InfoReq = 1;
329 pAd->CommonCfg.BSSCoexist2040.field.Intolerant40 = 0;
330 pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq = 0;
331 // Fill out stuff for scan request
332 ScanParmFill(pAd, &ScanReq, ZeroSsid, 0, BSS_ANY, SCAN_2040_BSS_COEXIST);
333 MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
334 pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
335 }
336}
337
338
339/*
340Description : Build Intolerant Channel Rerpot from Trigger event table.
341return : how many bytes copied.
342*/
343ULONG BuildIntolerantChannelRep(
344 IN PRTMP_ADAPTER pAd,
345 IN PUCHAR pDest)
346{
347 ULONG FrameLen = 0;
348 ULONG ReadOffset = 0;
349 UCHAR i;
350 UCHAR LastRegClass = 0xff;
351 PUCHAR pLen;
352
353 for ( i = 0;i < MAX_TRIGGER_EVENT;i++)
354 {
355 if (pAd->CommonCfg.TriggerEventTab.EventA[i].bValid == TRUE)
356 {
357 if (pAd->CommonCfg.TriggerEventTab.EventA[i].RegClass == LastRegClass)
358 {
359 *(pDest + ReadOffset) = (UCHAR)pAd->CommonCfg.TriggerEventTab.EventA[i].Channel;
360 *pLen++;
361 ReadOffset++;
362 FrameLen++;
363 }
364 else
365 {
366 *(pDest + ReadOffset) = IE_2040_BSS_INTOLERANT_REPORT; // IE
367 *(pDest + ReadOffset + 1) = 2; // Len = RegClass byte + channel byte.
368 pLen = pDest + ReadOffset + 1;
369 LastRegClass = pAd->CommonCfg.TriggerEventTab.EventA[i].RegClass;
370 *(pDest + ReadOffset + 2) = LastRegClass; // Len = RegClass byte + channel byte.
371 *(pDest + ReadOffset + 3) = (UCHAR)pAd->CommonCfg.TriggerEventTab.EventA[i].Channel;
372 FrameLen += 4;
373 ReadOffset += 4;
374 }
375
376 }
377 }
378 return FrameLen;
379}
380
381
382/*
383Description : Send 20/40 BSS Coexistence Action frame If one trigger event is triggered.
384*/
385VOID Send2040CoexistAction(
386 IN PRTMP_ADAPTER pAd,
387 IN UCHAR Wcid,
388 IN BOOLEAN bAddIntolerantCha)
389{
390 PUCHAR pOutBuffer = NULL;
391 NDIS_STATUS NStatus;
392 FRAME_ACTION_HDR Frame;
393 ULONG FrameLen;
394 ULONG IntolerantChaRepLen;
395
396 IntolerantChaRepLen = 0;
397 NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
398 if(NStatus != NDIS_STATUS_SUCCESS)
399 {
400 DBGPRINT(RT_DEBUG_ERROR,("ACT - Send2040CoexistAction() allocate memory failed \n"));
401 return;
402 }
403 ActHeaderInit(pAd, &Frame.Hdr, pAd->MacTab.Content[Wcid].Addr, pAd->CommonCfg.Bssid);
404 Frame.Category = CATEGORY_PUBLIC;
405 Frame.Action = ACTION_BSS_2040_COEXIST;
406
407 MakeOutgoingFrame(pOutBuffer, &FrameLen,
408 sizeof(FRAME_ACTION_HDR), &Frame,
409 END_OF_ARGS);
410
411 *(pOutBuffer + FrameLen) = pAd->CommonCfg.BSSCoexist2040.word;
412 FrameLen++;
413
414 if (bAddIntolerantCha == TRUE)
415 IntolerantChaRepLen = BuildIntolerantChannelRep(pAd, pOutBuffer + FrameLen);
416
417 MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen + IntolerantChaRepLen);
418 DBGPRINT(RT_DEBUG_ERROR,("ACT - Send2040CoexistAction( BSSCoexist2040 = 0x%x ) \n", pAd->CommonCfg.BSSCoexist2040.word));
419
420}
421
422
423/*
424 ==========================================================================
425 Description:
426 After scan, Update 20/40 BSS Coexistence IE and send out.
427 According to 802.11n D3.03 11.14.10
428
429 Parameters:
430 ==========================================================================
431 */
432VOID Update2040CoexistFrameAndNotify(
433 IN PRTMP_ADAPTER pAd,
434 IN UCHAR Wcid,
435 IN BOOLEAN bAddIntolerantCha)
436{
437 BSS_2040_COEXIST_IE OldValue;
438
439 OldValue.word = pAd->CommonCfg.BSSCoexist2040.word;
440 if ((pAd->CommonCfg.TriggerEventTab.EventANo > 0) || (pAd->CommonCfg.TriggerEventTab.EventBCountDown > 0))
441 pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq = 1;
442
443 // Need to check !!!!
444 // How STA will set Intolerant40 if implementation dependent. Now we don't set this bit first.!!!!!
445 // So Only check BSS20WidthReq change.
446 if (OldValue.field.BSS20WidthReq != pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq)
447 {
448 Send2040CoexistAction(pAd, Wcid, bAddIntolerantCha);
449 }
450}
451#endif // CONFIG_STA_SUPPORT //
452
453
454BOOLEAN ChannelSwitchSanityCheck(
455 IN PRTMP_ADAPTER pAd,
456 IN UCHAR Wcid,
457 IN UCHAR NewChannel,
458 IN UCHAR Secondary)
459{
460 UCHAR i;
461
462 if (Wcid >= MAX_LEN_OF_MAC_TABLE)
463 return FALSE;
464
465 if ((NewChannel > 7) && (Secondary == 1))
466 return FALSE;
467
468 if ((NewChannel < 5) && (Secondary == 3))
469 return FALSE;
470
471 // 0. Check if new channel is in the channellist.
472 for (i = 0;i < pAd->ChannelListNum;i++)
473 {
474 if (pAd->ChannelList[i].Channel == NewChannel)
475 {
476 break;
477 }
478 }
479
480 if (i == pAd->ChannelListNum)
481 return FALSE;
482
483 return TRUE;
484}
485
486
487VOID ChannelSwitchAction(
488 IN PRTMP_ADAPTER pAd,
489 IN UCHAR Wcid,
490 IN UCHAR NewChannel,
491 IN UCHAR Secondary)
492{
493 UCHAR BBPValue = 0;
494 ULONG MACValue;
495
496 DBGPRINT(RT_DEBUG_TRACE,("SPECTRUM - ChannelSwitchAction(NewChannel = %d , Secondary = %d) \n", NewChannel, Secondary));
497
498 if (ChannelSwitchSanityCheck(pAd, Wcid, NewChannel, Secondary) == FALSE)
499 return;
500
501 // 1. Switches to BW = 20.
502 if (Secondary == 0)
503 {
504 RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
505 BBPValue&= (~0x18);
506 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
507 if (pAd->MACVersion == 0x28600100)
508 {
509 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16);
510 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x08);
511 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x11);
512 DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" ));
513 }
514 pAd->CommonCfg.BBPCurrentBW = BW_20;
515 pAd->CommonCfg.Channel = NewChannel;
516 pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel;
517 AsicSwitchChannel(pAd, pAd->CommonCfg.Channel,FALSE);
518 AsicLockChannel(pAd, pAd->CommonCfg.Channel);
519 pAd->MacTab.Content[Wcid].HTPhyMode.field.BW = 0;
520 DBGPRINT(RT_DEBUG_TRACE, ("!!!20MHz !!! \n" ));
521 }
522 // 1. Switches to BW = 40 And Station supports BW = 40.
523 else if (((Secondary == 1) || (Secondary == 3)) && (pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth == 1))
524 {
525 pAd->CommonCfg.Channel = NewChannel;
526
527 if (Secondary == 1)
528 {
529 // Secondary above.
530 pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel + 2;
531 RTMP_IO_READ32(pAd, TX_BAND_CFG, &MACValue);
532 MACValue &= 0xfe;
533 RTMP_IO_WRITE32(pAd, TX_BAND_CFG, MACValue);
534 RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
535 BBPValue&= (~0x18);
536 BBPValue|= (0x10);
537 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
538 RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPValue);
539 BBPValue&= (~0x20);
540 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPValue);
541 DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Lower LINK UP !!! Control Channel at Below. Central = %d \n", pAd->CommonCfg.CentralChannel ));
542 }
543 else
544 {
545 // Secondary below.
546 pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel - 2;
547 RTMP_IO_READ32(pAd, TX_BAND_CFG, &MACValue);
548 MACValue &= 0xfe;
549 MACValue |= 0x1;
550 RTMP_IO_WRITE32(pAd, TX_BAND_CFG, MACValue);
551 RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
552 BBPValue&= (~0x18);
553 BBPValue|= (0x10);
554 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
555 RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPValue);
556 BBPValue&= (~0x20);
557 BBPValue|= (0x20);
558 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPValue);
559 DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Upper LINK UP !!! Control Channel at UpperCentral = %d \n", pAd->CommonCfg.CentralChannel ));
560 }
561 pAd->CommonCfg.BBPCurrentBW = BW_40;
562 AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
563 AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
564 pAd->MacTab.Content[Wcid].HTPhyMode.field.BW = 1;
565 }
566}
567#endif // DOT11N_DRAFT3 //
568#endif // DOT11_N_SUPPORT // 311#endif // DOT11_N_SUPPORT //
569 312
570VOID PeerPublicAction( 313VOID PeerPublicAction(
571 IN PRTMP_ADAPTER pAd, 314 IN PRTMP_ADAPTER pAd,
572 IN MLME_QUEUE_ELEM *Elem) 315 IN MLME_QUEUE_ELEM *Elem)
573{ 316{
574#ifdef DOT11N_DRAFT3
575 UCHAR Action = Elem->Msg[LENGTH_802_11+1];
576#endif // DOT11N_DRAFT3 //
577
578 if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE) 317 if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
579 return; 318 return;
580
581#ifdef DOT11N_DRAFT3
582 switch(Action)
583 {
584 case ACTION_BSS_2040_COEXIST: // Format defined in IEEE 7.4.7a.1 in 11n Draf3.03
585 {
586 //UCHAR BssCoexist;
587 BSS_2040_COEXIST_ELEMENT *pCoexistInfo;
588 BSS_2040_COEXIST_IE *pBssCoexistIe;
589 BSS_2040_INTOLERANT_CH_REPORT *pIntolerantReport = NULL;
590
591 if (Elem->MsgLen <= (LENGTH_802_11 + sizeof(BSS_2040_COEXIST_ELEMENT)) )
592 {
593 DBGPRINT(RT_DEBUG_ERROR, ("ACTION - 20/40 BSS Coexistence Management Frame length too short! len = %ld!\n", Elem->MsgLen));
594 break;
595 }
596 DBGPRINT(RT_DEBUG_TRACE, ("ACTION - 20/40 BSS Coexistence Management action----> \n"));
597 hex_dump("CoexistenceMgmtFrame", Elem->Msg, Elem->MsgLen);
598
599
600 pCoexistInfo = (BSS_2040_COEXIST_ELEMENT *) &Elem->Msg[LENGTH_802_11+2];
601 //hex_dump("CoexistInfo", (PUCHAR)pCoexistInfo, sizeof(BSS_2040_COEXIST_ELEMENT));
602 if (Elem->MsgLen >= (LENGTH_802_11 + sizeof(BSS_2040_COEXIST_ELEMENT) + sizeof(BSS_2040_INTOLERANT_CH_REPORT)))
603 {
604 pIntolerantReport = (BSS_2040_INTOLERANT_CH_REPORT *)((PUCHAR)pCoexistInfo + sizeof(BSS_2040_COEXIST_ELEMENT));
605 }
606 //hex_dump("IntolerantReport ", (PUCHAR)pIntolerantReport, sizeof(BSS_2040_INTOLERANT_CH_REPORT));
607
608 pBssCoexistIe = (BSS_2040_COEXIST_IE *)(&pCoexistInfo->BssCoexistIe);
609
610#ifdef CONFIG_STA_SUPPORT
611 IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
612 {
613 if (INFRA_ON(pAd))
614 {
615 StaPublicAction(pAd, pCoexistInfo);
616 }
617 }
618#endif // CONFIG_STA_SUPPORT //
619
620 }
621 break;
622 }
623
624#endif // DOT11N_DRAFT3 //
625
626} 319}
627 320
628 321
@@ -701,51 +394,6 @@ static VOID respond_ht_information_exchange_action(
701 MlmeFreeMemory(pAd, pOutBuffer); 394 MlmeFreeMemory(pAd, pOutBuffer);
702} 395}
703 396
704
705#ifdef DOT11N_DRAFT3
706VOID SendNotifyBWActionFrame(
707 IN PRTMP_ADAPTER pAd,
708 IN UCHAR Wcid,
709 IN UCHAR apidx)
710{
711 PUCHAR pOutBuffer = NULL;
712 NDIS_STATUS NStatus;
713 FRAME_ACTION_HDR Frame;
714 ULONG FrameLen;
715 PUCHAR pAddr1;
716
717
718 NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
719 if(NStatus != NDIS_STATUS_SUCCESS)
720 {
721 DBGPRINT(RT_DEBUG_ERROR,("ACT - SendNotifyBWAction() allocate memory failed \n"));
722 return;
723 }
724
725 if (Wcid == MCAST_WCID)
726 pAddr1 = &BROADCAST_ADDR[0];
727 else
728 pAddr1 = pAd->MacTab.Content[Wcid].Addr;
729 ActHeaderInit(pAd, &Frame.Hdr, pAddr1, pAd->ApCfg.MBSSID[apidx].Bssid, pAd->ApCfg.MBSSID[apidx].Bssid);
730
731 Frame.Category = CATEGORY_HT;
732 Frame.Action = NOTIFY_BW_ACTION;
733
734 MakeOutgoingFrame(pOutBuffer, &FrameLen,
735 sizeof(FRAME_ACTION_HDR), &Frame,
736 END_OF_ARGS);
737
738 *(pOutBuffer + FrameLen) = pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth;
739 FrameLen++;
740
741
742 MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
743 DBGPRINT(RT_DEBUG_TRACE,("ACT - SendNotifyBWAction(NotifyBW= %d)!\n", pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth));
744
745}
746#endif // DOT11N_DRAFT3 //
747
748
749VOID PeerHTAction( 397VOID PeerHTAction(
750 IN PRTMP_ADAPTER pAd, 398 IN PRTMP_ADAPTER pAd,
751 IN MLME_QUEUE_ELEM *Elem) 399 IN MLME_QUEUE_ELEM *Elem)
diff --git a/drivers/staging/rt3070/common/cmm_data.c b/drivers/staging/rt3070/common/cmm_data.c
index 93503b50c82..319480861d0 100644
--- a/drivers/staging/rt3070/common/cmm_data.c
+++ b/drivers/staging/rt3070/common/cmm_data.c
@@ -1174,10 +1174,6 @@ VOID RTMPWriteTxWI(
1174 1174
1175 // If CCK or OFDM, BW must be 20 1175 // If CCK or OFDM, BW must be 20
1176 pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW); 1176 pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW);
1177#ifdef DOT11N_DRAFT3
1178 if (pTxWI->BW)
1179 pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW);
1180#endif // DOT11N_DRAFT3 //
1181 1177
1182 pTxWI->MCS = pTransmit->field.MCS; 1178 pTxWI->MCS = pTransmit->field.MCS;
1183 pTxWI->PHYMODE = pTransmit->field.MODE; 1179 pTxWI->PHYMODE = pTransmit->field.MODE;
@@ -1257,10 +1253,6 @@ VOID RTMPWriteTxWI_Data(
1257 // If CCK or OFDM, BW must be 20 1253 // If CCK or OFDM, BW must be 20
1258 pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW); 1254 pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW);
1259#ifdef DOT11_N_SUPPORT 1255#ifdef DOT11_N_SUPPORT
1260#ifdef DOT11N_DRAFT3
1261 if (pTxWI->BW)
1262 pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW);
1263#endif // DOT11N_DRAFT3 //
1264 pTxWI->AMPDU = ((pTxBlk->TxFrameType == TX_AMPDU_FRAME) ? TRUE : FALSE); 1256 pTxWI->AMPDU = ((pTxBlk->TxFrameType == TX_AMPDU_FRAME) ? TRUE : FALSE);
1265 1257
1266 // John tune the performace with Intel Client in 20 MHz performance 1258 // John tune the performace with Intel Client in 20 MHz performance
@@ -1371,11 +1363,6 @@ VOID RTMPWriteTxWI_Cache(
1371 pTxWI->AMPDU = ((pMacEntry->NoBADataCountDown == 0) ? TRUE: FALSE); 1363 pTxWI->AMPDU = ((pMacEntry->NoBADataCountDown == 0) ? TRUE: FALSE);
1372 pTxWI->MIMOps = 0; 1364 pTxWI->MIMOps = 0;
1373 1365
1374#ifdef DOT11N_DRAFT3
1375 if (pTxWI->BW)
1376 pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW);
1377#endif // DOT11N_DRAFT3 //
1378
1379 if (pAd->CommonCfg.bMIMOPSEnable) 1366 if (pAd->CommonCfg.bMIMOPSEnable)
1380 { 1367 {
1381 // MIMO Power Save Mode 1368 // MIMO Power Save Mode
diff --git a/drivers/staging/rt3070/common/cmm_sanity.c b/drivers/staging/rt3070/common/cmm_sanity.c
index 95d0a0ebd60..4df3580180a 100644
--- a/drivers/staging/rt3070/common/cmm_sanity.c
+++ b/drivers/staging/rt3070/common/cmm_sanity.c
@@ -786,76 +786,6 @@ BOOLEAN PeerBeaconAndProbeRspSanity(
786 786
787} 787}
788 788
789#ifdef DOT11N_DRAFT3
790/*
791 ==========================================================================
792 Description:
793 MLME message sanity check for some IE addressed in 802.11n d3.03.
794 Return:
795 TRUE if all parameters are OK, FALSE otherwise
796
797 IRQL = DISPATCH_LEVEL
798
799 ==========================================================================
800 */
801BOOLEAN PeerBeaconAndProbeRspSanity2(
802 IN PRTMP_ADAPTER pAd,
803 IN VOID *Msg,
804 IN ULONG MsgLen,
805 OUT UCHAR *RegClass)
806{
807 CHAR *Ptr;
808 PFRAME_802_11 pFrame;
809 PEID_STRUCT pEid;
810 ULONG Length = 0;
811
812 pFrame = (PFRAME_802_11)Msg;
813
814 *RegClass = 0;
815 Ptr = pFrame->Octet;
816 Length += LENGTH_802_11;
817
818 // get timestamp from payload and advance the pointer
819 Ptr += TIMESTAMP_LEN;
820 Length += TIMESTAMP_LEN;
821
822 // get beacon interval from payload and advance the pointer
823 Ptr += 2;
824 Length += 2;
825
826 // get capability info from payload and advance the pointer
827 Ptr += 2;
828 Length += 2;
829
830 pEid = (PEID_STRUCT) Ptr;
831
832 // get variable fields from payload and advance the pointer
833 while ((Length + 2 + pEid->Len) <= MsgLen)
834 {
835 switch(pEid->Eid)
836 {
837 case IE_SUPP_REG_CLASS:
838 if(pEid->Len > 0)
839 {
840 *RegClass = *pEid->Octet;
841 }
842 else
843 {
844 DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAndProbeRspSanity - wrong IE_SSID (len=%d)\n",pEid->Len));
845 return FALSE;
846 }
847 break;
848 }
849
850 Length = Length + 2 + pEid->Len; // Eid[1] + Len[1]+ content[Len]
851 pEid = (PEID_STRUCT)((UCHAR*)pEid + 2 + pEid->Len);
852 }
853
854 return TRUE;
855
856}
857#endif // DOT11N_DRAFT3 //
858
859/* 789/*
860 ========================================================================== 790 ==========================================================================
861 Description: 791 Description:
diff --git a/drivers/staging/rt3070/common/cmm_sync.c b/drivers/staging/rt3070/common/cmm_sync.c
index 1d6954ef121..5dfbb7fc502 100644
--- a/drivers/staging/rt3070/common/cmm_sync.c
+++ b/drivers/staging/rt3070/common/cmm_sync.c
@@ -639,21 +639,6 @@ VOID ScanNextChannel(
639#endif // RT_BIG_ENDIAN // 639#endif // RT_BIG_ENDIAN //
640 } 640 }
641 FrameLen += Tmp; 641 FrameLen += Tmp;
642
643#ifdef DOT11N_DRAFT3
644 if (pAd->CommonCfg.BACapability.field.b2040CoexistScanSup == 1)
645 {
646 ULONG Tmp;
647 HtLen = 1;
648 MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
649 1, &ExtHtCapIe,
650 1, &HtLen,
651 1, &pAd->CommonCfg.BSSCoexist2040.word,
652 END_OF_ARGS);
653
654 FrameLen += Tmp;
655 }
656#endif // DOT11N_DRAFT3 //
657 } 642 }
658#endif // DOT11_N_SUPPORT // 643#endif // DOT11_N_SUPPORT //
659 644
diff --git a/drivers/staging/rt3070/common/mlme.c b/drivers/staging/rt3070/common/mlme.c
index d15e9da6f39..daf040e5d25 100644
--- a/drivers/staging/rt3070/common/mlme.c
+++ b/drivers/staging/rt3070/common/mlme.c
@@ -346,9 +346,6 @@ UCHAR ExtRateIe = IE_EXT_SUPP_RATES;
346UCHAR HtCapIe = IE_HT_CAP; 346UCHAR HtCapIe = IE_HT_CAP;
347UCHAR AddHtInfoIe = IE_ADD_HT; 347UCHAR AddHtInfoIe = IE_ADD_HT;
348UCHAR NewExtChanIe = IE_SECONDARY_CH_OFFSET; 348UCHAR NewExtChanIe = IE_SECONDARY_CH_OFFSET;
349#ifdef DOT11N_DRAFT3
350UCHAR ExtHtCapIe = IE_EXT_CAPABILITY;
351#endif // DOT11N_DRAFT3 //
352#endif // DOT11_N_SUPPORT // 349#endif // DOT11_N_SUPPORT //
353UCHAR ErpIe = IE_ERP; 350UCHAR ErpIe = IE_ERP;
354UCHAR DsIe = IE_DS_PARM; 351UCHAR DsIe = IE_DS_PARM;
@@ -1208,14 +1205,6 @@ SKIP_AUTO_SCAN_CONN:
1208 } 1205 }
1209#endif // DOT11_N_SUPPORT // 1206#endif // DOT11_N_SUPPORT //
1210 1207
1211
1212#ifdef DOT11_N_SUPPORT
1213#ifdef DOT11N_DRAFT3
1214 if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SCAN_2040))
1215 TriEventCounterMaintenance(pAd);
1216#endif // DOT11N_DRAFT3 //
1217#endif // DOT11_N_SUPPORT //
1218
1219 return; 1208 return;
1220} 1209}
1221 1210
@@ -3792,111 +3781,6 @@ ULONG BssTableSetEntry(
3792} 3781}
3793 3782
3794#ifdef CONFIG_STA_SUPPORT 3783#ifdef CONFIG_STA_SUPPORT
3795#ifdef DOT11_N_SUPPORT
3796#ifdef DOT11N_DRAFT3
3797VOID TriEventInit(
3798 IN PRTMP_ADAPTER pAd)
3799{
3800 UCHAR i;
3801
3802 for (i = 0;i < MAX_TRIGGER_EVENT;i++)
3803 pAd->CommonCfg.TriggerEventTab.EventA[i].bValid = FALSE;
3804
3805 pAd->CommonCfg.TriggerEventTab.EventANo = 0;
3806 pAd->CommonCfg.TriggerEventTab.EventBCountDown = 0;
3807}
3808
3809ULONG TriEventTableSetEntry(
3810 IN PRTMP_ADAPTER pAd,
3811 OUT TRIGGER_EVENT_TAB *Tab,
3812 IN PUCHAR pBssid,
3813 IN HT_CAPABILITY_IE *pHtCapability,
3814 IN UCHAR HtCapabilityLen,
3815 IN UCHAR RegClass,
3816 IN UCHAR ChannelNo)
3817{
3818 // Event A
3819 if (HtCapabilityLen == 0)
3820 {
3821 if (Tab->EventANo < MAX_TRIGGER_EVENT)
3822 {
3823 RTMPMoveMemory(Tab->EventA[Tab->EventANo].BSSID, pBssid, 6);
3824 Tab->EventA[Tab->EventANo].bValid = TRUE;
3825 Tab->EventA[Tab->EventANo].Channel = ChannelNo;
3826 Tab->EventA[Tab->EventANo].CDCounter = pAd->CommonCfg.Dot11BssWidthChanTranDelay;
3827 if (RegClass != 0)
3828 {
3829 // Beacon has Regulatory class IE. So use beacon's
3830 Tab->EventA[Tab->EventANo].RegClass = RegClass;
3831 }
3832 else
3833 {
3834 // Use Station's Regulatory class instead.
3835 if (pAd->StaActive.SupportedHtPhy.bHtEnable == TRUE)
3836 {
3837 if (pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel)
3838 {
3839 Tab->EventA[Tab->EventANo].RegClass = 32;
3840 }
3841 else if (pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel)
3842 Tab->EventA[Tab->EventANo].RegClass = 33;
3843 }
3844 else
3845 Tab->EventA[Tab->EventANo].RegClass = ??;
3846
3847 }
3848
3849 Tab->EventANo ++;
3850 }
3851 }
3852 else if (pHtCapability->HtCapInfo.Intolerant40)
3853 {
3854 Tab->EventBCountDown = pAd->CommonCfg.Dot11BssWidthChanTranDelay;
3855 }
3856
3857}
3858
3859/*
3860 ========================================================================
3861 Routine Description:
3862 Trigger Event table Maintainence called once every second.
3863
3864 Arguments:
3865 // IRQL = DISPATCH_LEVEL
3866 ========================================================================
3867*/
3868VOID TriEventCounterMaintenance(
3869 IN PRTMP_ADAPTER pAd)
3870{
3871 UCHAR i;
3872 BOOLEAN bNotify = FALSE;
3873 for (i = 0;i < MAX_TRIGGER_EVENT;i++)
3874 {
3875 if (pAd->CommonCfg.TriggerEventTab.EventA[i].bValid && (pAd->CommonCfg.TriggerEventTab.EventA[i].CDCounter > 0))
3876 {
3877 pAd->CommonCfg.TriggerEventTab.EventA[i].CDCounter--;
3878 if (pAd->CommonCfg.TriggerEventTab.EventA[i].CDCounter == 0)
3879 {
3880 pAd->CommonCfg.TriggerEventTab.EventA[i].bValid = FALSE;
3881 pAd->CommonCfg.TriggerEventTab.EventANo --;
3882 // Need to send 20/40 Coexistence Notify frame if has status change.
3883 bNotify = TRUE;
3884 }
3885 }
3886 }
3887 if (pAd->CommonCfg.TriggerEventTab.EventBCountDown > 0)
3888 {
3889 pAd->CommonCfg.TriggerEventTab.EventBCountDown--;
3890 if (pAd->CommonCfg.TriggerEventTab.EventBCountDown == 0)
3891 bNotify = TRUE;
3892 }
3893
3894 if (bNotify == TRUE)
3895 Update2040CoexistFrameAndNotify(pAd, BSSID_WCID, TRUE);
3896}
3897#endif // DOT11N_DRAFT3 //
3898#endif // DOT11_N_SUPPORT //
3899
3900// IRQL = DISPATCH_LEVEL 3784// IRQL = DISPATCH_LEVEL
3901VOID BssTableSsidSort( 3785VOID BssTableSsidSort(
3902 IN PRTMP_ADAPTER pAd, 3786 IN PRTMP_ADAPTER pAd,
diff --git a/drivers/staging/rt3070/common/rtmp_init.c b/drivers/staging/rt3070/common/rtmp_init.c
index 68028f67dab..a4e8b3bc48b 100644
--- a/drivers/staging/rt3070/common/rtmp_init.c
+++ b/drivers/staging/rt3070/common/rtmp_init.c
@@ -3305,17 +3305,6 @@ VOID UserCfgInit(
3305 pAd->bBroadComHT = FALSE; 3305 pAd->bBroadComHT = FALSE;
3306 pAd->CommonCfg.bRdg = FALSE; 3306 pAd->CommonCfg.bRdg = FALSE;
3307 3307
3308#ifdef DOT11N_DRAFT3
3309 pAd->CommonCfg.Dot11OBssScanPassiveDwell = dot11OBSSScanPassiveDwell; // Unit : TU. 5~1000
3310 pAd->CommonCfg.Dot11OBssScanActiveDwell = dot11OBSSScanActiveDwell; // Unit : TU. 10~1000
3311 pAd->CommonCfg.Dot11BssWidthTriggerScanInt = dot11BSSWidthTriggerScanInterval; // Unit : Second
3312 pAd->CommonCfg.Dot11OBssScanPassiveTotalPerChannel = dot11OBSSScanPassiveTotalPerChannel; // Unit : TU. 200~10000
3313 pAd->CommonCfg.Dot11OBssScanActiveTotalPerChannel = dot11OBSSScanActiveTotalPerChannel; // Unit : TU. 20~10000
3314 pAd->CommonCfg.Dot11BssWidthChanTranDelayFactor = dot11BSSWidthChannelTransactionDelayFactor;
3315 pAd->CommonCfg.Dot11OBssScanActivityThre = dot11BSSScanActivityThreshold; // Unit : percentage
3316 pAd->CommonCfg.Dot11BssWidthChanTranDelay = (pAd->CommonCfg.Dot11BssWidthTriggerScanInt * pAd->CommonCfg.Dot11BssWidthChanTranDelayFactor);
3317#endif // DOT11N_DRAFT3 //
3318
3319 NdisZeroMemory(&pAd->CommonCfg.AddHTInfo, sizeof(pAd->CommonCfg.AddHTInfo)); 3308 NdisZeroMemory(&pAd->CommonCfg.AddHTInfo, sizeof(pAd->CommonCfg.AddHTInfo));
3320 pAd->CommonCfg.BACapability.field.MMPSmode = MMPS_ENABLE; 3309 pAd->CommonCfg.BACapability.field.MMPSmode = MMPS_ENABLE;
3321 pAd->CommonCfg.BACapability.field.MpduDensity = 0; 3310 pAd->CommonCfg.BACapability.field.MpduDensity = 0;
diff --git a/drivers/staging/rt3070/common/spectrum.c b/drivers/staging/rt3070/common/spectrum.c
index df68d955aff..2762b57dd14 100644
--- a/drivers/staging/rt3070/common/spectrum.c
+++ b/drivers/staging/rt3070/common/spectrum.c
@@ -1734,28 +1734,6 @@ VOID PeerSpectrumAction(
1734 1734
1735 case SPEC_CHANNEL_SWITCH: 1735 case SPEC_CHANNEL_SWITCH:
1736{ 1736{
1737#ifdef DOT11N_DRAFT3
1738 SEC_CHA_OFFSET_IE Secondary;
1739 CHA_SWITCH_ANNOUNCE_IE ChannelSwitch;
1740
1741 // 802.11h only has Channel Switch Announcement IE.
1742 RTMPMoveMemory(&ChannelSwitch, &Elem->Msg[LENGTH_802_11+4], sizeof (CHA_SWITCH_ANNOUNCE_IE));
1743
1744 // 802.11n D3.03 adds secondary channel offset element in the end.
1745 if (Elem->MsgLen == (LENGTH_802_11 + 2 + sizeof (CHA_SWITCH_ANNOUNCE_IE) + sizeof (SEC_CHA_OFFSET_IE)))
1746 {
1747 RTMPMoveMemory(&Secondary, &Elem->Msg[LENGTH_802_11+9], sizeof (SEC_CHA_OFFSET_IE));
1748 }
1749 else
1750 {
1751 Secondary.SecondaryChannelOffset = 0;
1752 }
1753
1754 if ((Elem->Msg[LENGTH_802_11+2] == IE_CHANNEL_SWITCH_ANNOUNCEMENT) && (Elem->Msg[LENGTH_802_11+3] == 3))
1755 {
1756 ChannelSwitchAction(pAd, Elem->Wcid, ChannelSwitch.NewChannel, Secondary.SecondaryChannelOffset);
1757 }
1758#endif // DOT11N_DRAFT3 //
1759} 1737}
1760 PeerChSwAnnAction(pAd, Elem); 1738 PeerChSwAnnAction(pAd, Elem);
1761 break; 1739 break;
diff --git a/drivers/staging/rt3070/mlme.h b/drivers/staging/rt3070/mlme.h
index 50e83dc6331..c530282ad8f 100644
--- a/drivers/staging/rt3070/mlme.h
+++ b/drivers/staging/rt3070/mlme.h
@@ -134,10 +134,6 @@
134#define SCAN_CISCO_CHANNEL_LOAD 23 // Single channel passive scan for channel load collection 134#define SCAN_CISCO_CHANNEL_LOAD 23 // Single channel passive scan for channel load collection
135#define FAST_SCAN_ACTIVE 24 // scan with probe request, and wait beacon and probe response 135#define FAST_SCAN_ACTIVE 24 // scan with probe request, and wait beacon and probe response
136 136
137#ifdef DOT11N_DRAFT3
138#define SCAN_2040_BSS_COEXIST 26
139#endif // DOT11N_DRAFT3 //
140
141//#define BSS_TABLE_EMPTY(x) ((x).BssNr == 0) 137//#define BSS_TABLE_EMPTY(x) ((x).BssNr == 0)
142#define MAC_ADDR_IS_GROUP(Addr) (((Addr[0]) & 0x01)) 138#define MAC_ADDR_IS_GROUP(Addr) (((Addr[0]) & 0x01))
143#define MAC_ADDR_HASH(Addr) (Addr[0] ^ Addr[1] ^ Addr[2] ^ Addr[3] ^ Addr[4] ^ Addr[5]) 139#define MAC_ADDR_HASH(Addr) (Addr[0] ^ Addr[1] ^ Addr[2] ^ Addr[3] ^ Addr[4] ^ Addr[5])
diff --git a/drivers/staging/rt3070/rtmp.h b/drivers/staging/rt3070/rtmp.h
index d754886d00d..c8f81511548 100644
--- a/drivers/staging/rt3070/rtmp.h
+++ b/drivers/staging/rt3070/rtmp.h
@@ -240,9 +240,6 @@ extern UCHAR ExtRateIe;
240extern UCHAR HtCapIe; 240extern UCHAR HtCapIe;
241extern UCHAR AddHtInfoIe; 241extern UCHAR AddHtInfoIe;
242extern UCHAR NewExtChanIe; 242extern UCHAR NewExtChanIe;
243#ifdef DOT11N_DRAFT3
244extern UCHAR ExtHtCapIe;
245#endif // DOT11N_DRAFT3 //
246#endif // DOT11_N_SUPPORT // 243#endif // DOT11_N_SUPPORT //
247 244
248extern UCHAR ErpIe; 245extern UCHAR ErpIe;
@@ -1278,9 +1275,6 @@ typedef struct _BBP_R66_TUNING {
1278typedef struct _CHANNEL_TX_POWER { 1275typedef struct _CHANNEL_TX_POWER {
1279 USHORT RemainingTimeForUse; //unit: sec 1276 USHORT RemainingTimeForUse; //unit: sec
1280 UCHAR Channel; 1277 UCHAR Channel;
1281#ifdef DOT11N_DRAFT3
1282 BOOLEAN bEffectedChannel; // For BW 40 operating in 2.4GHz , the "effected channel" is the channel that is covered in 40Mhz.
1283#endif // DOT11N_DRAFT3 //
1284 CHAR Power; 1278 CHAR Power;
1285 CHAR Power2; 1279 CHAR Power2;
1286 UCHAR MaxTxPwr; 1280 UCHAR MaxTxPwr;
@@ -1726,17 +1720,6 @@ typedef struct _MULTISSID_STRUCT {
1726 UCHAR BcnBufIdx; 1720 UCHAR BcnBufIdx;
1727} MULTISSID_STRUCT, *PMULTISSID_STRUCT; 1721} MULTISSID_STRUCT, *PMULTISSID_STRUCT;
1728 1722
1729
1730
1731#ifdef DOT11N_DRAFT3
1732typedef enum _BSS2040COEXIST_FLAG{
1733 BSS_2040_COEXIST_DISABLE = 0,
1734 BSS_2040_COEXIST_TIMER_FIRED = 1,
1735 BSS_2040_COEXIST_INFO_SYNC = 2,
1736 BSS_2040_COEXIST_INFO_NOTIFY = 4,
1737}BSS2040COEXIST_FLAG;
1738#endif // DOT11N_DRAFT3 //
1739
1740// configuration common to OPMODE_AP as well as OPMODE_STA 1723// configuration common to OPMODE_AP as well as OPMODE_STA
1741typedef struct _COMMON_CONFIG { 1724typedef struct _COMMON_CONFIG {
1742 1725
@@ -1853,33 +1836,6 @@ typedef struct _COMMON_CONFIG {
1853 //This IE is included in channel switch ammouncement frames 7.4.1.5, beacons, probe Rsp. 1836 //This IE is included in channel switch ammouncement frames 7.4.1.5, beacons, probe Rsp.
1854 NEW_EXT_CHAN_IE NewExtChanOffset; //7.3.2.20A, 1 if extension channel is above the control channel, 3 if below, 0 if not present 1837 NEW_EXT_CHAN_IE NewExtChanOffset; //7.3.2.20A, 1 if extension channel is above the control channel, 3 if below, 0 if not present
1855 1838
1856#ifdef DOT11N_DRAFT3
1857 UCHAR Bss2040CoexistFlag; // bit 0: bBssCoexistTimerRunning, bit 1: NeedSyncAddHtInfo.
1858 RALINK_TIMER_STRUCT Bss2040CoexistTimer;
1859
1860 //This IE is used for 20/40 BSS Coexistence.
1861 BSS_2040_COEXIST_IE BSS2040CoexistInfo;
1862 // ====== 11n D3.0 =======================>
1863 USHORT Dot11OBssScanPassiveDwell; // Unit : TU. 5~1000
1864 USHORT Dot11OBssScanActiveDwell; // Unit : TU. 10~1000
1865 USHORT Dot11BssWidthTriggerScanInt; // Unit : Second
1866 USHORT Dot11OBssScanPassiveTotalPerChannel; // Unit : TU. 200~10000
1867 USHORT Dot11OBssScanActiveTotalPerChannel; // Unit : TU. 20~10000
1868 USHORT Dot11BssWidthChanTranDelayFactor;
1869 USHORT Dot11OBssScanActivityThre; // Unit : percentage
1870
1871 ULONG Dot11BssWidthChanTranDelay; // multiple of (Dot11BssWidthTriggerScanInt * Dot11BssWidthChanTranDelayFactor)
1872 ULONG CountDownCtr; // CountDown Counter from (Dot11BssWidthTriggerScanInt * Dot11BssWidthChanTranDelayFactor)
1873
1874 NDIS_SPIN_LOCK TriggerEventTabLock;
1875 BSS_2040_COEXIST_IE LastBSSCoexist2040;
1876 BSS_2040_COEXIST_IE BSSCoexist2040;
1877 TRIGGER_EVENT_TAB TriggerEventTab;
1878 UCHAR ChannelListIdx;
1879 // <====== 11n D3.0 =======================
1880 BOOLEAN bOverlapScanning;
1881#endif // DOT11N_DRAFT3 //
1882
1883 BOOLEAN bHTProtect; 1839 BOOLEAN bHTProtect;
1884 BOOLEAN bMIMOPSEnable; 1840 BOOLEAN bMIMOPSEnable;
1885 BOOLEAN bBADecline; 1841 BOOLEAN bBADecline;
@@ -2308,10 +2264,6 @@ typedef struct _MAC_TABLE_ENTRY {
2308 UCHAR MmpsMode; // MIMO power save more. 2264 UCHAR MmpsMode; // MIMO power save more.
2309 2265
2310 HT_CAPABILITY_IE HTCapability; 2266 HT_CAPABILITY_IE HTCapability;
2311
2312#ifdef DOT11N_DRAFT3
2313 UCHAR BSS2040CoexistenceMgmtSupport;
2314#endif // DOT11N_DRAFT3 //
2315#endif // DOT11_N_SUPPORT // 2267#endif // DOT11_N_SUPPORT //
2316 2268
2317 BOOLEAN bAutoTxRateSwitch; 2269 BOOLEAN bAutoTxRateSwitch;
@@ -3629,46 +3581,6 @@ VOID SendPSMPAction(
3629 IN UCHAR Wcid, 3581 IN UCHAR Wcid,
3630 IN UCHAR Psmp); 3582 IN UCHAR Psmp);
3631 3583
3632
3633#ifdef DOT11N_DRAFT3
3634VOID SendBSS2040CoexistMgmtAction(
3635 IN PRTMP_ADAPTER pAd,
3636 IN UCHAR Wcid,
3637 IN UCHAR apidx,
3638 IN UCHAR InfoReq);
3639
3640VOID SendNotifyBWActionFrame(
3641 IN PRTMP_ADAPTER pAd,
3642 IN UCHAR Wcid,
3643 IN UCHAR apidx);
3644
3645BOOLEAN ChannelSwitchSanityCheck(
3646 IN PRTMP_ADAPTER pAd,
3647 IN UCHAR Wcid,
3648 IN UCHAR NewChannel,
3649 IN UCHAR Secondary);
3650
3651VOID ChannelSwitchAction(
3652 IN PRTMP_ADAPTER pAd,
3653 IN UCHAR Wcid,
3654 IN UCHAR Channel,
3655 IN UCHAR Secondary);
3656
3657ULONG BuildIntolerantChannelRep(
3658 IN PRTMP_ADAPTER pAd,
3659 IN PUCHAR pDest);
3660
3661VOID Update2040CoexistFrameAndNotify(
3662 IN PRTMP_ADAPTER pAd,
3663 IN UCHAR Wcid,
3664 IN BOOLEAN bAddIntolerantCha);
3665
3666VOID Send2040CoexistAction(
3667 IN PRTMP_ADAPTER pAd,
3668 IN UCHAR Wcid,
3669 IN BOOLEAN bAddIntolerantCha);
3670#endif // DOT11N_DRAFT3 //
3671
3672VOID PeerRMAction( 3584VOID PeerRMAction(
3673 IN PRTMP_ADAPTER pAd, 3585 IN PRTMP_ADAPTER pAd,
3674 IN MLME_QUEUE_ELEM *Elem); 3586 IN MLME_QUEUE_ELEM *Elem);
@@ -4350,30 +4262,6 @@ VOID BATableInsertEntry(
4350 IN UCHAR BAWinSize, 4262 IN UCHAR BAWinSize,
4351 IN UCHAR OriginatorStatus, 4263 IN UCHAR OriginatorStatus,
4352 IN BOOLEAN IsRecipient); 4264 IN BOOLEAN IsRecipient);
4353
4354#ifdef DOT11N_DRAFT3
4355VOID Bss2040CoexistTimeOut(
4356 IN PVOID SystemSpecific1,
4357 IN PVOID FunctionContext,
4358 IN PVOID SystemSpecific2,
4359 IN PVOID SystemSpecific3);
4360
4361
4362VOID TriEventInit(
4363 IN PRTMP_ADAPTER pAd);
4364
4365ULONG TriEventTableSetEntry(
4366 IN PRTMP_ADAPTER pAd,
4367 OUT TRIGGER_EVENT_TAB *Tab,
4368 IN PUCHAR pBssid,
4369 IN HT_CAPABILITY_IE *pHtCapability,
4370 IN UCHAR HtCapabilityLen,
4371 IN UCHAR RegClass,
4372 IN UCHAR ChannelNo);
4373
4374VOID TriEventCounterMaintenance(
4375 IN PRTMP_ADAPTER pAd);
4376#endif // DOT11N_DRAFT3 //
4377#endif // DOT11_N_SUPPORT // 4265#endif // DOT11_N_SUPPORT //
4378 4266
4379VOID BssTableSsidSort( 4267VOID BssTableSsidSort(
@@ -5563,13 +5451,6 @@ CHAR ConvertToRssi(
5563 IN CHAR Rssi, 5451 IN CHAR Rssi,
5564 IN UCHAR RssiNumber); 5452 IN UCHAR RssiNumber);
5565 5453
5566
5567#ifdef DOT11N_DRAFT3
5568VOID BuildEffectedChannelList(
5569 IN PRTMP_ADAPTER pAd);
5570#endif // DOT11N_DRAFT3 //
5571
5572
5573VOID APAsicEvaluateRxAnt( 5454VOID APAsicEvaluateRxAnt(
5574 IN PRTMP_ADAPTER pAd); 5455 IN PRTMP_ADAPTER pAd);
5575 5456
diff --git a/drivers/staging/rt3070/rtmp_def.h b/drivers/staging/rt3070/rtmp_def.h
index 2d6c6ec2ce2..8e01b6e37f9 100644
--- a/drivers/staging/rt3070/rtmp_def.h
+++ b/drivers/staging/rt3070/rtmp_def.h
@@ -213,10 +213,6 @@
213#define fOP_STATUS_WAKEUP_NOW 0x00008000 213#define fOP_STATUS_WAKEUP_NOW 0x00008000
214#define fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE 0x00020000 214#define fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE 0x00020000
215 215
216#ifdef DOT11N_DRAFT3
217#define fOP_STATUS_SCAN_2040 0x00040000
218#endif // DOT11N_DRAFT3 //
219
220#define CCKSETPROTECT 0x1 216#define CCKSETPROTECT 0x1
221#define OFDMSETPROTECT 0x2 217#define OFDMSETPROTECT 0x2
222#define MM20SETPROTECT 0x4 218#define MM20SETPROTECT 0x4
@@ -241,10 +237,6 @@
241#define fCLIENT_STATUS_MCSFEEDBACK_CAPABLE 0x00000400 237#define fCLIENT_STATUS_MCSFEEDBACK_CAPABLE 0x00000400
242#define fCLIENT_STATUS_APSD_CAPABLE 0x00000800 /* UAPSD STATION */ 238#define fCLIENT_STATUS_APSD_CAPABLE 0x00000800 /* UAPSD STATION */
243 239
244#ifdef DOT11N_DRAFT3
245#define fCLIENT_STATUS_BSSCOEXIST_CAPABLE 0x00001000
246#endif // DOT11N_DRAFT3 //
247
248#define fCLIENT_STATUS_RALINK_CHIPSET 0x00100000 240#define fCLIENT_STATUS_RALINK_CHIPSET 0x00100000
249// 241//
250// STA configuration flags 242// STA configuration flags
diff --git a/drivers/staging/rt3070/sta/connect.c b/drivers/staging/rt3070/sta/connect.c
index ff5896c534b..66f28dec6dd 100644
--- a/drivers/staging/rt3070/sta/connect.c
+++ b/drivers/staging/rt3070/sta/connect.c
@@ -178,13 +178,6 @@ VOID MlmeCntlMachinePerformAction(
178 pAd->bLedOnScanning = FALSE; 178 pAd->bLedOnScanning = FALSE;
179 RTMPSetLED(pAd, pAd->LedStatus); 179 RTMPSetLED(pAd, pAd->LedStatus);
180 } 180 }
181#ifdef DOT11N_DRAFT3
182 // AP sent a 2040Coexistence mgmt frame, then station perform a scan, and then send back the respone.
183 if (pAd->CommonCfg.BSSCoexist2040.field.InfoReq == 1)
184 {
185 Update2040CoexistFrameAndNotify(pAd, BSSID_WCID, TRUE);
186 }
187#endif // DOT11N_DRAFT3 //
188 } 181 }
189 break; 182 break;
190 183
@@ -1781,16 +1774,6 @@ VOID LinkUp(
1781 } 1774 }
1782 1775
1783 RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS); 1776 RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
1784
1785#ifdef DOT11_N_SUPPORT
1786#ifdef DOT11N_DRAFT3
1787 if ((pAd->CommonCfg.BACapability.field.b2040CoexistScanSup) && (pAd->CommonCfg.Channel <= 11))
1788 {
1789 OPSTATUS_SET_FLAG(pAd, fOP_STATUS_SCAN_2040);
1790 BuildEffectedChannelList(pAd);
1791 }
1792#endif // DOT11N_DRAFT3 //
1793#endif // DOT11_N_SUPPORT //
1794} 1777}
1795 1778
1796/* 1779/*
@@ -2048,18 +2031,6 @@ VOID LinkDown(
2048 pAd->CommonCfg.IOTestParm.bCurrentAtheros = FALSE; 2031 pAd->CommonCfg.IOTestParm.bCurrentAtheros = FALSE;
2049 pAd->CommonCfg.IOTestParm.bNowAtherosBurstOn = FALSE; 2032 pAd->CommonCfg.IOTestParm.bNowAtherosBurstOn = FALSE;
2050 2033
2051#ifdef DOT11_N_SUPPORT
2052#ifdef DOT11N_DRAFT3
2053 OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SCAN_2040);
2054 pAd->CommonCfg.BSSCoexist2040.word = 0;
2055 TriEventInit(pAd);
2056 for (i = 0; i < (pAd->ChannelListNum - 1); i++)
2057 {
2058 pAd->ChannelList[i].bEffectedChannel = FALSE;
2059 }
2060#endif // DOT11N_DRAFT3 //
2061#endif // DOT11_N_SUPPORT //
2062
2063 RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, 0x1fff); 2034 RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, 0x1fff);
2064 RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS); 2035 RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
2065 2036
diff --git a/drivers/staging/rt3070/sta/sync.c b/drivers/staging/rt3070/sta/sync.c
index f611cc45653..62d0a3db668 100644
--- a/drivers/staging/rt3070/sta/sync.c
+++ b/drivers/staging/rt3070/sta/sync.c
@@ -634,16 +634,7 @@ VOID PeerBeaconAtScanAction(
634 &CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability, 634 &CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability,
635 &AddHtInfo, HtCapabilityLen, AddHtInfoLen, NewExtChannelOffset, Channel, Rssi, TimeStamp, CkipFlag, 635 &AddHtInfo, HtCapabilityLen, AddHtInfoLen, NewExtChannelOffset, Channel, Rssi, TimeStamp, CkipFlag,
636 &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE); 636 &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE);
637#ifdef DOT11_N_SUPPORT 637
638#ifdef DOT11N_DRAFT3
639 if (pAd->ChannelList[pAd->CommonCfg.ChannelListIdx].bEffectedChannel == TRUE)
640 {
641 UCHAR RegClass;
642 PeerBeaconAndProbeRspSanity2(pAd, Elem->Msg, Elem->MsgLen, &RegClass);
643 TriEventTableSetEntry(pAd, &pAd->CommonCfg.TriggerEventTab, Bssid, &HtCapability, HtCapabilityLen, RegClass, Channel);
644 }
645#endif // DOT11N_DRAFT3 //
646#endif // DOT11_N_SUPPORT //
647 if (Idx != BSS_NOT_FOUND) 638 if (Idx != BSS_NOT_FOUND)
648 { 639 {
649 NdisMoveMemory(pAd->ScanTab.BssEntry[Idx].PTSF, &Elem->Msg[24], 4); 640 NdisMoveMemory(pAd->ScanTab.BssEntry[Idx].PTSF, &Elem->Msg[24], 4);
@@ -1621,88 +1612,6 @@ VOID EnqueueProbeRequest(
1621 1612
1622} 1613}
1623 1614
1624#ifdef DOT11_N_SUPPORT
1625#ifdef DOT11N_DRAFT3
1626VOID BuildEffectedChannelList(
1627 IN PRTMP_ADAPTER pAd)
1628{
1629 UCHAR EChannel[11];
1630 UCHAR i, j, k;
1631 UCHAR UpperChannel = 0, LowerChannel = 0;
1632
1633 RTMPZeroMemory(EChannel, 11);
1634 i = 0;
1635 // Find upper channel and lower channel.
1636 if (pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel)
1637 {
1638 UpperChannel = pAd->CommonCfg.Channel;
1639 LowerChannel = pAd->CommonCfg.CentralChannel;
1640 }
1641 else if (pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel)
1642 {
1643 UpperChannel = pAd->CommonCfg.CentralChannel;
1644 LowerChannel = pAd->CommonCfg.Channel;
1645 }
1646 else
1647 {
1648 return;
1649 }
1650
1651 // Record channels that is below lower channel..
1652 if (LowerChannel > 1)
1653 {
1654 EChannel[0] = LowerChannel - 1;
1655 i = 1;
1656 if (LowerChannel > 2)
1657 {
1658 EChannel[1] = LowerChannel - 2;
1659 i = 2;
1660 if (LowerChannel > 3)
1661 {
1662 EChannel[2] = LowerChannel - 3;
1663 i = 3;
1664 }
1665 }
1666 }
1667 // Record channels that is between lower channel and upper channel.
1668 for (k = LowerChannel;k < UpperChannel;k++)
1669 {
1670 EChannel[i] = k;
1671 i++;
1672 }
1673 // Record channels that is above upper channel..
1674 if (LowerChannel < 11)
1675 {
1676 EChannel[i] = UpperChannel + 1;
1677 i++;
1678 if (LowerChannel < 10)
1679 {
1680 EChannel[i] = LowerChannel + 2;
1681 i++;
1682 if (LowerChannel < 9)
1683 {
1684 EChannel[i] = LowerChannel + 3;
1685 i++;
1686 }
1687 }
1688 }
1689 //
1690 for (j = 0;j < i;j++)
1691 {
1692 for (k = 0;k < pAd->ChannelListNum;k++)
1693 {
1694 if (pAd->ChannelList[k].Channel == EChannel[j])
1695 {
1696 pAd->ChannelList[k].bEffectedChannel = TRUE;
1697 DBGPRINT(RT_DEBUG_TRACE,(" EffectedChannel( =%d)\n", EChannel[j]));
1698 break;
1699 }
1700 }
1701 }
1702}
1703#endif // DOT11N_DRAFT3 //
1704#endif // DOT11_N_SUPPORT //
1705
1706BOOLEAN ScanRunning( 1615BOOLEAN ScanRunning(
1707 IN PRTMP_ADAPTER pAd) 1616 IN PRTMP_ADAPTER pAd)
1708{ 1617{