aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-04-26 10:06:14 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-19 14:00:49 -0400
commitac7e7d5a88b9db7b7557e22893cdf94013fafa31 (patch)
tree0b864748e7a53bb23e84b3c96b31af28dad332d6 /drivers
parent96f139ee99322060523883d4a665b10780ca3182 (diff)
Staging: rt2870: remove dead 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/rt2870/ap.h12
-rw-r--r--drivers/staging/rt2870/chlist.h43
-rw-r--r--drivers/staging/rt2870/common/2870_rtmp_init.c22
-rw-r--r--drivers/staging/rt2870/common/action.c10
-rw-r--r--drivers/staging/rt2870/common/ba_action.c46
-rw-r--r--drivers/staging/rt2870/common/cmm_data.c113
-rw-r--r--drivers/staging/rt2870/common/cmm_info.c322
-rw-r--r--drivers/staging/rt2870/common/cmm_sanity.c31
-rw-r--r--drivers/staging/rt2870/common/cmm_wpa.c10
-rw-r--r--drivers/staging/rt2870/common/dfs.c12
-rw-r--r--drivers/staging/rt2870/common/eeprom.c10
-rw-r--r--drivers/staging/rt2870/common/mlme.c113
-rw-r--r--drivers/staging/rt2870/common/rtmp_init.c195
-rw-r--r--drivers/staging/rt2870/common/rtmp_tkip.c3
-rw-r--r--drivers/staging/rt2870/common/rtmp_wep.c9
-rw-r--r--drivers/staging/rt2870/common/rtusb_bulk.c684
-rw-r--r--drivers/staging/rt2870/common/rtusb_data.c13
-rw-r--r--drivers/staging/rt2870/common/rtusb_io.c31
-rw-r--r--drivers/staging/rt2870/mlme.h24
-rw-r--r--drivers/staging/rt2870/oid.h23
-rw-r--r--drivers/staging/rt2870/rt2870.h39
-rw-r--r--drivers/staging/rt2870/rt28xx.h46
-rw-r--r--drivers/staging/rt2870/rt_linux.c40
-rw-r--r--drivers/staging/rt2870/rt_linux.h32
-rw-r--r--drivers/staging/rt2870/rt_main_dev.c132
-rw-r--r--drivers/staging/rt2870/rt_profile.c42
-rw-r--r--drivers/staging/rt2870/rtmp.h138
-rw-r--r--drivers/staging/rt2870/rtmp_def.h18
-rw-r--r--drivers/staging/rt2870/sta/connect.c10
-rw-r--r--drivers/staging/rt2870/sta/rtmp_data.c4
-rw-r--r--drivers/staging/rt2870/sta/sync.c1
-rw-r--r--drivers/staging/rt2870/sta/wpa.c13
-rw-r--r--drivers/staging/rt2870/sta_ioctl.c19
33 files changed, 11 insertions, 2249 deletions
diff --git a/drivers/staging/rt2870/ap.h b/drivers/staging/rt2870/ap.h
index 4b5457199252..a814d55abeff 100644
--- a/drivers/staging/rt2870/ap.h
+++ b/drivers/staging/rt2870/ap.h
@@ -163,18 +163,6 @@ USHORT APBuildAssociation(
163 IN UCHAR HtCapabilityLen, 163 IN UCHAR HtCapabilityLen,
164 OUT USHORT *pAid); 164 OUT USHORT *pAid);
165 165
166/*
167VOID RTMPAddClientSec(
168 IN PRTMP_ADAPTER pAd,
169 IN UCHAR BssIdx,
170 IN UCHAR KeyIdx,
171 IN UCHAR CipherAlg,
172 IN PUCHAR pKey,
173 IN PUCHAR pTxMic,
174 IN PUCHAR pRxMic,
175 IN MAC_TABLE_ENTRY *pEntry);
176*/
177
178// ap_auth.c 166// ap_auth.c
179 167
180void APAuthStateMachineInit( 168void APAuthStateMachineInit(
diff --git a/drivers/staging/rt2870/chlist.h b/drivers/staging/rt2870/chlist.h
index 60f8548a57ea..f49a35c95de6 100644
--- a/drivers/staging/rt2870/chlist.h
+++ b/drivers/staging/rt2870/chlist.h
@@ -1195,49 +1195,6 @@ static inline VOID N_ChannelCheck(
1195 pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20; 1195 pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
1196 //pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_NONE; // We didn't set the ExtCh as NONE due to it'll set in RTMPSetHT() 1196 //pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_NONE; // We didn't set the ExtCh as NONE due to it'll set in RTMPSetHT()
1197 } 1197 }
1198#if 0
1199 switch (pAd->CommonCfg.CountryRegion & 0x7f)
1200 {
1201 case REGION_0_BG_BAND: // 1 -11
1202 case REGION_1_BG_BAND: // 1 - 13
1203 case REGION_5_BG_BAND: // 1 - 14
1204 if (Channel <= 4)
1205 {
1206 pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_ABOVE;
1207 }
1208 else if (Channel >= 8)
1209 {
1210 if ((ChannelNum - Channel) < 4)
1211 pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_BELOW;
1212 }
1213 break;
1214
1215 case REGION_2_BG_BAND: // 10 - 11
1216 case REGION_3_BG_BAND: // 10 - 13
1217 case REGION_4_BG_BAND: // 14
1218 pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
1219 break;
1220
1221 case REGION_6_BG_BAND: // 3 - 9
1222 if (Channel <= 5)
1223 pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_ABOVE;
1224 else if (Channel == 6)
1225 pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
1226 else if (Channel >= 7)
1227 pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_BELOW;
1228 break;
1229
1230 case REGION_7_BG_BAND: // 5 - 13
1231 if (Channel <= 8)
1232 pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_ABOVE;
1233 else if (Channel >= 10)
1234 pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_BELOW;
1235 break;
1236
1237 default: // Error. should never happen
1238 break;
1239 }
1240#endif
1241 } 1198 }
1242 } 1199 }
1243 1200
diff --git a/drivers/staging/rt2870/common/2870_rtmp_init.c b/drivers/staging/rt2870/common/2870_rtmp_init.c
index 70ad919f86e1..b8c589611fff 100644
--- a/drivers/staging/rt2870/common/2870_rtmp_init.c
+++ b/drivers/staging/rt2870/common/2870_rtmp_init.c
@@ -266,27 +266,6 @@ NDIS_STATUS NICInitTransmit(
266 // 266 //
267 // MGMT_RING_SIZE 267 // MGMT_RING_SIZE
268 // 268 //
269#if 0
270 for(i=0; i<MGMT_RING_SIZE; i++) // 8
271 {
272 PTX_CONTEXT pMLMEContext = &(pAd->MLMEContext[i]);
273
274
275 NdisZeroMemory(pMLMEContext, sizeof(TX_CONTEXT));
276
277 //Allocate URB
278 LM_USB_ALLOC(pObj, pMLMEContext, PTX_BUFFER, sizeof(TX_BUFFER), Status,
279 ("<-- ERROR in Alloc TX MLMEContext[%d] urb!! \n", i),
280 out2,
281 ("<-- ERROR in Alloc TX MLMEContext[%d] TX_BUFFER !! \n", i),
282 out2);
283
284 pMLMEContext->pAd = pAd;
285 pMLMEContext->pIrp = NULL;
286 pMLMEContext->InUse = FALSE;
287 pMLMEContext->IRPPending = FALSE;
288 }
289#else
290 // Allocate MGMT ring descriptor's memory 269 // Allocate MGMT ring descriptor's memory
291 pAd->MgmtDescRing.AllocSize = MGMT_RING_SIZE * sizeof(TX_CONTEXT); 270 pAd->MgmtDescRing.AllocSize = MGMT_RING_SIZE * sizeof(TX_CONTEXT);
292 RTMPAllocateMemory(&pAd->MgmtDescRing.AllocVa, pAd->MgmtDescRing.AllocSize); 271 RTMPAllocateMemory(&pAd->MgmtDescRing.AllocVa, pAd->MgmtDescRing.AllocSize);
@@ -336,7 +315,6 @@ NDIS_STATUS NICInitTransmit(
336 pAd->MgmtRing.TxSwFreeIdx = MGMT_RING_SIZE; 315 pAd->MgmtRing.TxSwFreeIdx = MGMT_RING_SIZE;
337 pAd->MgmtRing.TxCpuIdx = 0; 316 pAd->MgmtRing.TxCpuIdx = 0;
338 pAd->MgmtRing.TxDmaIdx = 0; 317 pAd->MgmtRing.TxDmaIdx = 0;
339#endif
340 318
341 // 319 //
342 // BEACON_RING_SIZE 320 // BEACON_RING_SIZE
diff --git a/drivers/staging/rt2870/common/action.c b/drivers/staging/rt2870/common/action.c
index ddef39d4572d..a32d361fe90e 100644
--- a/drivers/staging/rt2870/common/action.c
+++ b/drivers/staging/rt2870/common/action.c
@@ -466,11 +466,6 @@ VOID ORIBATimerTimeout(
466{ 466{
467 MAC_TABLE_ENTRY *pEntry; 467 MAC_TABLE_ENTRY *pEntry;
468 INT i, total; 468 INT i, total;
469// FRAME_BAR FrameBar;
470// ULONG FrameLen;
471// NDIS_STATUS NStatus;
472// PUCHAR pOutBuffer = NULL;
473// USHORT Sequence;
474 UCHAR TID; 469 UCHAR TID;
475 470
476 total = pAd->MacTab.Size * NUM_OF_TID; 471 total = pAd->MacTab.Size * NUM_OF_TID;
@@ -535,10 +530,9 @@ VOID SendRefreshBAR(
535 MakeOutgoingFrame(pOutBuffer, &FrameLen, 530 MakeOutgoingFrame(pOutBuffer, &FrameLen,
536 sizeof(FRAME_BAR), &FrameBar, 531 sizeof(FRAME_BAR), &FrameBar,
537 END_OF_ARGS); 532 END_OF_ARGS);
538 //if (!(CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_RALINK_CHIPSET))) 533
539 if (1) // Now we always send BAR. 534 if (1) // Now we always send BAR.
540 { 535 {
541 //MiniportMMRequestUnlock(pAd, 0, pOutBuffer, FrameLen);
542 MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen); 536 MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
543 } 537 }
544 MlmeFreeMemory(pAd, pOutBuffer); 538 MlmeFreeMemory(pAd, pOutBuffer);
@@ -568,8 +562,6 @@ VOID BarHeaderInit(
568 IN PUCHAR pDA, 562 IN PUCHAR pDA,
569 IN PUCHAR pSA) 563 IN PUCHAR pSA)
570{ 564{
571// USHORT Duration;
572
573 NdisZeroMemory(pCntlBar, sizeof(FRAME_BAR)); 565 NdisZeroMemory(pCntlBar, sizeof(FRAME_BAR));
574 pCntlBar->FC.Type = BTYPE_CNTL; 566 pCntlBar->FC.Type = BTYPE_CNTL;
575 pCntlBar->FC.SubType = SUBTYPE_BLOCK_ACK_REQ; 567 pCntlBar->FC.SubType = SUBTYPE_BLOCK_ACK_REQ;
diff --git a/drivers/staging/rt2870/common/ba_action.c b/drivers/staging/rt2870/common/ba_action.c
index 072f272f672d..142c6698ac2a 100644
--- a/drivers/staging/rt2870/common/ba_action.c
+++ b/drivers/staging/rt2870/common/ba_action.c
@@ -462,19 +462,6 @@ void ba_flush_reordering_timeout_mpdus(
462 } 462 }
463 463
464 } 464 }
465#if 0
466 else if (
467 (RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer+(MAX_REORDERING_PACKET_TIMEOUT))) &&
468 (pBAEntry->list.qlen > 1))
469 )
470 {
471 DBGPRINT(RT_DEBUG_TRACE,("timeout[%d] (%lx-%lx = %d > %d): %x\n ", pBAEntry->list.qlen, Now32, (pBAEntry->LastIndSeqAtTimer),
472 (int)((long) Now32 - (long)(pBAEntry->LastIndSeqAtTimer)), MAX_REORDERING_PACKET_TIMEOUT,
473 pBAEntry->LastIndSeq));
474 ba_refresh_reordering_mpdus(pAd, pBAEntry);
475 pBAEntry->LastIndSeqAtTimer = Now32;
476 }
477#endif
478} 465}
479 466
480 467
@@ -688,10 +675,6 @@ BOOLEAN BARecSessionAdd(
688 RTMPInitTimer(pAd, &pBAEntry->RECBATimer, GET_TIMER_FUNCTION(BARecSessionIdleTimeout), pBAEntry, TRUE); 675 RTMPInitTimer(pAd, &pBAEntry->RECBATimer, GET_TIMER_FUNCTION(BARecSessionIdleTimeout), pBAEntry, TRUE);
689 } 676 }
690 677
691#if 0 // for debugging
692 RTMPSetTimer(&pBAEntry->RECBATimer, REC_BA_SESSION_IDLE_TIMEOUT);
693#endif
694
695 // Set Bitmap flag. 678 // Set Bitmap flag.
696 pEntry->RXBAbitmap |= (1<<TID); 679 pEntry->RXBAbitmap |= (1<<TID);
697 pEntry->BARecWcidArray[TID] = Idx; 680 pEntry->BARecWcidArray[TID] = Idx;
@@ -1552,13 +1535,9 @@ static VOID ba_enqueue_reordering_packet(
1552 } 1535 }
1553 else 1536 else
1554 { 1537 {
1555#if 0
1556 DBGPRINT(RT_DEBUG_ERROR, ("!!! (%d:%d) Can't allocate reordering mpdu blk\n",
1557 blk_count, pBAEntry->list.qlen));
1558#else
1559 DBGPRINT(RT_DEBUG_ERROR, ("!!! (%d) Can't allocate reordering mpdu blk\n", 1538 DBGPRINT(RT_DEBUG_ERROR, ("!!! (%d) Can't allocate reordering mpdu blk\n",
1560 pBAEntry->list.qlen)); 1539 pBAEntry->list.qlen));
1561#endif 1540
1562 /* 1541 /*
1563 * flush all pending reordering mpdus 1542 * flush all pending reordering mpdus
1564 * and receving mpdu to upper layer 1543 * and receving mpdu to upper layer
@@ -1606,29 +1585,11 @@ VOID Indicate_AMPDU_Packet(
1606 1585
1607 if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU) && (pRxBlk->DataSize > MAX_RX_PKT_LEN)) 1586 if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU) && (pRxBlk->DataSize > MAX_RX_PKT_LEN))
1608 { 1587 {
1609#if 0 // sample take off, no use
1610 static int err_size;
1611
1612 err_size++;
1613 if (err_size > 20) {
1614 printk("AMPDU DataSize = %d\n", pRxBlk->DataSize);
1615 hex_dump("802.11 Header", (UCHAR *)pRxBlk->pHeader, 24);
1616 hex_dump("Payload", pRxBlk->pData, 64);
1617 err_size = 0;
1618 }
1619#endif
1620 // release packet 1588 // release packet
1621 RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE); 1589 RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
1622 return; 1590 return;
1623 } 1591 }
1624 1592
1625
1626#if 0 // test
1627 /* Rec BA Session had been torn down */
1628 INDICATE_LEGACY_OR_AMSDU(pAd, pRxBlk, FromWhichBSSID);
1629 return;
1630#endif
1631
1632 if (Wcid < MAX_LEN_OF_MAC_TABLE) 1593 if (Wcid < MAX_LEN_OF_MAC_TABLE)
1633 { 1594 {
1634 Idx = pAd->MacTab.Content[Wcid].BARecWcidArray[TID]; 1595 Idx = pAd->MacTab.Content[Wcid].BARecWcidArray[TID];
@@ -1723,10 +1684,6 @@ VOID Indicate_AMPDU_Packet(
1723 // 1684 //
1724 else 1685 else
1725 { 1686 {
1726#if 0
1727 ba_refresh_reordering_mpdus(pAd, pBAEntry);
1728 INDICATE_LEGACY_OR_AMSDU(pAd, pRxBlk, FromWhichBSSID);
1729#else
1730 LONG WinStartSeq, TmpSeq; 1687 LONG WinStartSeq, TmpSeq;
1731 1688
1732 1689
@@ -1748,6 +1705,5 @@ VOID Indicate_AMPDU_Packet(
1748 { 1705 {
1749 pBAEntry->LastIndSeq = TmpSeq; 1706 pBAEntry->LastIndSeq = TmpSeq;
1750 } 1707 }
1751#endif
1752 } 1708 }
1753} 1709}
diff --git a/drivers/staging/rt2870/common/cmm_data.c b/drivers/staging/rt2870/common/cmm_data.c
index cb31a08230b4..0ca1ab6c8d83 100644
--- a/drivers/staging/rt2870/common/cmm_data.c
+++ b/drivers/staging/rt2870/common/cmm_data.c
@@ -67,7 +67,6 @@ UCHAR RxwiMCSToOfdmRate[12] = {
67char* MCSToMbps[] = {"1Mbps","2Mbps","5.5Mbps","11Mbps","06Mbps","09Mbps","12Mbps","18Mbps","24Mbps","36Mbps","48Mbps","54Mbps","MM-0","MM-1","MM-2","MM-3","MM-4","MM-5","MM-6","MM-7","MM-8","MM-9","MM-10","MM-11","MM-12","MM-13","MM-14","MM-15","MM-32","ee1","ee2","ee3"}; 67char* MCSToMbps[] = {"1Mbps","2Mbps","5.5Mbps","11Mbps","06Mbps","09Mbps","12Mbps","18Mbps","24Mbps","36Mbps","48Mbps","54Mbps","MM-0","MM-1","MM-2","MM-3","MM-4","MM-5","MM-6","MM-7","MM-8","MM-9","MM-10","MM-11","MM-12","MM-13","MM-14","MM-15","MM-32","ee1","ee2","ee3"};
68 68
69UCHAR default_cwmin[]={CW_MIN_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS-1, CW_MIN_IN_BITS-2}; 69UCHAR default_cwmin[]={CW_MIN_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS-1, CW_MIN_IN_BITS-2};
70//UCHAR default_cwmax[]={CW_MAX_IN_BITS, CW_MAX_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS-1};
71UCHAR default_sta_aifsn[]={3,7,2,2}; 70UCHAR default_sta_aifsn[]={3,7,2,2};
72 71
73UCHAR MapUserPriorityToAccessCategory[8] = {QID_AC_BE, QID_AC_BK, QID_AC_BK, QID_AC_BE, QID_AC_VI, QID_AC_VI, QID_AC_VO, QID_AC_VO}; 72UCHAR MapUserPriorityToAccessCategory[8] = {QID_AC_BE, QID_AC_BK, QID_AC_BK, QID_AC_BE, QID_AC_VI, QID_AC_VI, QID_AC_VO, QID_AC_VO};
@@ -233,17 +232,11 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
233 232
234 RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen); 233 RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
235 234
236 // Make sure MGMT ring resource won't be used by other threads
237// sample, for IRQ LOCK -> SEM LOCK
238// IrqState = pAd->irq_disabled;
239// if (!IrqState)
240 RTMP_SEM_LOCK(&pAd->MgmtRingLock); 235 RTMP_SEM_LOCK(&pAd->MgmtRingLock);
241 236
242 237
243 if (pSrcBufVA == NULL) 238 if (pSrcBufVA == NULL)
244 { 239 {
245 // The buffer shouldn't be NULL
246// if (!IrqState)
247 RTMP_SEM_UNLOCK(&pAd->MgmtRingLock); 240 RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
248 return NDIS_STATUS_FAILURE; 241 return NDIS_STATUS_FAILURE;
249 } 242 }
@@ -318,9 +311,6 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
318 } 311 }
319 else // BTYPE_MGMT or BTYPE_DATA(must be NULL frame) 312 else // BTYPE_MGMT or BTYPE_DATA(must be NULL frame)
320 { 313 {
321 //pAd->Sequence++;
322 //pHeader_802_11->Sequence = pAd->Sequence;
323
324 if (pHeader_802_11->Addr1[0] & 0x01) // MULTICAST, BROADCAST 314 if (pHeader_802_11->Addr1[0] & 0x01) // MULTICAST, BROADCAST
325 { 315 {
326 bAckRequired = FALSE; 316 bAckRequired = FALSE;
@@ -348,8 +338,7 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
348 && (pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)) 338 && (pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE))
349 { 339 {
350 DBGPRINT(RT_DEBUG_ERROR,("MlmeHardTransmit --> radar detect not in normal mode !!!\n")); 340 DBGPRINT(RT_DEBUG_ERROR,("MlmeHardTransmit --> radar detect not in normal mode !!!\n"));
351// if (!IrqState) 341 RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
352 RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
353 return (NDIS_STATUS_FAILURE); 342 return (NDIS_STATUS_FAILURE);
354 } 343 }
355 344
@@ -362,7 +351,6 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
362 // Initialize TX Descriptor 351 // Initialize TX Descriptor
363 // For inter-frame gap, the number is for this frame and next frame 352 // For inter-frame gap, the number is for this frame and next frame
364 // For MLME rate, we will fix as 2Mb to match other vendor's implement 353 // For MLME rate, we will fix as 2Mb to match other vendor's implement
365// pAd->CommonCfg.MlmeTransmit.field.MODE = 1;
366 354
367// management frame doesn't need encryption. so use RESERVED_WCID no matter u are sending to specific wcid or not. 355// management frame doesn't need encryption. so use RESERVED_WCID no matter u are sending to specific wcid or not.
368 if (pMacEntry == NULL) 356 if (pMacEntry == NULL)
@@ -384,8 +372,7 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
384 HAL_KickOutMgmtTx(pAd, QueIdx, pPacket, pSrcBufVA, SrcBufLen); 372 HAL_KickOutMgmtTx(pAd, QueIdx, pPacket, pSrcBufVA, SrcBufLen);
385 373
386 // Make sure to release MGMT ring resource 374 // Make sure to release MGMT ring resource
387// if (!IrqState) 375 RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
388 RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
389 return NDIS_STATUS_SUCCESS; 376 return NDIS_STATUS_SUCCESS;
390} 377}
391 378
@@ -408,51 +395,6 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
408 RTMP_IRQ_UNLOCK((lock), IrqFlags); \ 395 RTMP_IRQ_UNLOCK((lock), IrqFlags); \
409 }while(0) 396 }while(0)
410 397
411
412#if 0
413static VOID dumpTxBlk(TX_BLK *pTxBlk)
414{
415 NDIS_PACKET *pPacket;
416 int i, frameNum;
417 PQUEUE_ENTRY pQEntry;
418
419 printk("Dump TX_BLK Structure:\n");
420 printk("\tTxFrameType=%d!\n", pTxBlk->TxFrameType);
421 printk("\tTotalFrameLen=%d\n", pTxBlk->TotalFrameLen);
422 printk("\tTotalFrameNum=%ld!\n", pTxBlk->TxPacketList.Number);
423 printk("\tTotalFragNum=%d!\n", pTxBlk->TotalFragNum);
424 printk("\tpPacketList=\n");
425
426 frameNum = pTxBlk->TxPacketList.Number;
427
428 for(i=0; i < frameNum; i++)
429 { int j;
430 UCHAR *pBuf;
431
432 pQEntry = RemoveHeadQueue(&pTxBlk->TxPacketList);
433 pPacket = QUEUE_ENTRY_TO_PACKET(pQEntry);
434 if (pPacket)
435 {
436 pBuf = GET_OS_PKT_DATAPTR(pPacket);
437 printk("\t\t[%d]:ptr=0x%x, Len=%d!\n", i, (UINT32)(GET_OS_PKT_DATAPTR(pPacket)), GET_OS_PKT_LEN(pPacket));
438 printk("\t\t");
439 for (j =0 ; j < GET_OS_PKT_LEN(pPacket); j++)
440 {
441 printk("%02x ", (pBuf[j] & 0xff));
442 if (j == 16)
443 break;
444 }
445 InsertTailQueue(&pTxBlk->TxPacketList, PACKET_TO_QUEUE_ENTRY(pPacket));
446 }
447 }
448 printk("\tWcid=%d!\n", pTxBlk->Wcid);
449 printk("\tapidx=%d!\n", pTxBlk->apidx);
450 printk("----EndOfDump\n");
451
452}
453#endif
454
455
456/* 398/*
457 ======================================================================== 399 ========================================================================
458 Tx Path design algorithm: 400 Tx Path design algorithm:
@@ -813,7 +755,6 @@ VOID RTMPDeQueuePacket(
813 755
814 pTxBlk = &TxBlk; 756 pTxBlk = &TxBlk;
815 NdisZeroMemory((PUCHAR)pTxBlk, sizeof(TX_BLK)); 757 NdisZeroMemory((PUCHAR)pTxBlk, sizeof(TX_BLK));
816 //InitializeQueueHeader(&pTxBlk->TxPacketList); // Didn't need it because we already memzero it.
817 pTxBlk->QueIdx = QueIdx; 758 pTxBlk->QueIdx = QueIdx;
818 759
819 pPacket = QUEUE_ENTRY_TO_PKT(pEntry); 760 pPacket = QUEUE_ENTRY_TO_PKT(pEntry);
@@ -880,14 +821,6 @@ VOID RTMPDeQueuePacket(
880 821
881 // Do HardTransmit now. 822 // Do HardTransmit now.
882 Status = STAHardTransmit(pAd, pTxBlk, QueIdx); 823 Status = STAHardTransmit(pAd, pTxBlk, QueIdx);
883
884#if 0 // We should not break if HardTransmit failed. Well, at least now we should not!
885 if (Status != NDIS_STATUS_SUCCESS)
886 {
887 DBGPRINT(RT_DEBUG_TRACE /*RT_DEBUG_INFO*/,("RTMPHardTransmit return failed!!!\n"));
888 break;
889 }
890#endif
891 } 824 }
892 825
893 RT28XX_STOP_DEQUEUE(pAd, QueIdx, IrqFlags); 826 RT28XX_STOP_DEQUEUE(pAd, QueIdx, IrqFlags);
@@ -1129,11 +1062,6 @@ VOID RTMPWriteTxWI_Data(
1129 BASize = pAd->BATable.BAOriEntry[RABAOriIdx].BAWinSize; 1062 BASize = pAd->BATable.BAOriEntry[RABAOriIdx].BAWinSize;
1130 } 1063 }
1131 1064
1132#if 0 // 3*3
1133 if (BASize > 7)
1134 BASize = 7;
1135#endif
1136
1137 pTxWI->TxBF = pTransmit->field.TxBF; 1065 pTxWI->TxBF = pTransmit->field.TxBF;
1138 pTxWI->BAWinSize = BASize; 1066 pTxWI->BAWinSize = BASize;
1139 pTxWI->ShortGI = pTransmit->field.ShortGI; 1067 pTxWI->ShortGI = pTransmit->field.ShortGI;
@@ -1187,7 +1115,7 @@ VOID RTMPWriteTxWI_Cache(
1187 IN OUT PTXWI_STRUC pTxWI, 1115 IN OUT PTXWI_STRUC pTxWI,
1188 IN TX_BLK *pTxBlk) 1116 IN TX_BLK *pTxBlk)
1189{ 1117{
1190 PHTTRANSMIT_SETTING /*pTxHTPhyMode,*/ pTransmit; 1118 PHTTRANSMIT_SETTING pTransmit;
1191 PMAC_TABLE_ENTRY pMacEntry; 1119 PMAC_TABLE_ENTRY pMacEntry;
1192 1120
1193 // 1121 //
@@ -1288,8 +1216,6 @@ VOID RTMPWriteTxDescriptor(
1288 1216
1289 pTxD->WIV = (bWIV) ? 1: 0; 1217 pTxD->WIV = (bWIV) ? 1: 0;
1290 pTxD->QSEL= (QueueSEL); 1218 pTxD->QSEL= (QueueSEL);
1291 //RT2860c?? fixed using EDCA queue for test... We doubt Queue1 has problem. 2006-09-26 Jan
1292 //pTxD->QSEL= FIFO_EDCA;
1293 if (pAd->bGenOneHCCA == TRUE) 1219 if (pAd->bGenOneHCCA == TRUE)
1294 pTxD->QSEL= FIFO_HCCA; 1220 pTxD->QSEL= FIFO_HCCA;
1295 pTxD->DMADONE = 0; 1221 pTxD->DMADONE = 0;
@@ -1388,11 +1314,7 @@ PQUEUE_HEADER RTMPCheckTxSwQueue(
1388 IN PRTMP_ADAPTER pAd, 1314 IN PRTMP_ADAPTER pAd,
1389 OUT PUCHAR pQueIdx) 1315 OUT PUCHAR pQueIdx)
1390{ 1316{
1391
1392 ULONG Number; 1317 ULONG Number;
1393 // 2004-11-15 to be removed. test aggregation only
1394// if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED)) && (*pNumber < 2))
1395// return NULL;
1396 1318
1397 Number = pAd->TxSwQueue[QID_AC_BK].Number 1319 Number = pAd->TxSwQueue[QID_AC_BK].Number
1398 + pAd->TxSwQueue[QID_AC_BE].Number 1320 + pAd->TxSwQueue[QID_AC_BE].Number
@@ -1463,14 +1385,11 @@ VOID RTMPSuspendMsduTransmission(
1463 RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R66, &pAd->BbpTuning.R66CurrentValue); 1385 RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R66, &pAd->BbpTuning.R66CurrentValue);
1464 1386
1465 // set BBP_R66 to 0x30/0x40 when scanning (AsicSwitchChannel will set R66 according to channel when scanning) 1387 // set BBP_R66 to 0x30/0x40 when scanning (AsicSwitchChannel will set R66 according to channel when scanning)
1466 //RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, (0x26 + GET_LNA_GAIN(pAd)));
1467 RTMPSetAGCInitValue(pAd, BW_20); 1388 RTMPSetAGCInitValue(pAd, BW_20);
1468 1389
1469 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS); 1390 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
1470 //RTMP_IO_WRITE32(pAd, TX_CNTL_CSR, 0x000f0000); // abort all TX rings
1471} 1391}
1472 1392
1473
1474/* 1393/*
1475 ======================================================================== 1394 ========================================================================
1476 1395
@@ -1492,19 +1411,12 @@ VOID RTMPSuspendMsduTransmission(
1492VOID RTMPResumeMsduTransmission( 1411VOID RTMPResumeMsduTransmission(
1493 IN PRTMP_ADAPTER pAd) 1412 IN PRTMP_ADAPTER pAd)
1494{ 1413{
1495// UCHAR IrqState;
1496
1497 DBGPRINT(RT_DEBUG_TRACE,("SCAN done, resume MSDU transmission ...\n")); 1414 DBGPRINT(RT_DEBUG_TRACE,("SCAN done, resume MSDU transmission ...\n"));
1498 1415
1499 1416
1500 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, pAd->BbpTuning.R66CurrentValue); 1417 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, pAd->BbpTuning.R66CurrentValue);
1501 1418
1502 RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS); 1419 RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
1503// sample, for IRQ LOCK to SEM LOCK
1504// IrqState = pAd->irq_disabled;
1505// if (IrqState)
1506// RTMPDeQueuePacket(pAd, TRUE, NUM_OF_TX_RING, MAX_TX_PROCESS);
1507// else
1508 RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS); 1420 RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
1509} 1421}
1510 1422
@@ -1533,9 +1445,7 @@ UINT deaggregate_AMSDU_announce(
1533 1445
1534 nMSDU++; 1446 nMSDU++;
1535 1447
1536 //hex_dump("subheader", pData, 64);
1537 pAMSDUsubheader = (PHEADER_802_3)pData; 1448 pAMSDUsubheader = (PHEADER_802_3)pData;
1538 //pData += LENGTH_802_3;
1539 PayloadSize = pAMSDUsubheader->Octet[1] + (pAMSDUsubheader->Octet[0]<<8); 1449 PayloadSize = pAMSDUsubheader->Octet[1] + (pAMSDUsubheader->Octet[0]<<8);
1540 SubFrameSize = PayloadSize + LENGTH_802_3; 1450 SubFrameSize = PayloadSize + LENGTH_802_3;
1541 1451
@@ -1545,8 +1455,6 @@ UINT deaggregate_AMSDU_announce(
1545 break; 1455 break;
1546 } 1456 }
1547 1457
1548 //printk("%d subframe: Size = %d\n", nMSDU, PayloadSize);
1549
1550 pPayload = pData + LENGTH_802_3; 1458 pPayload = pData + LENGTH_802_3;
1551 pDA = pData; 1459 pDA = pData;
1552 pSA = pData + MAC_ADDR_LEN; 1460 pSA = pData + MAC_ADDR_LEN;
@@ -1792,8 +1700,6 @@ BOOLEAN MacTableDeleteEntry(
1792 USHORT HashIdx; 1700 USHORT HashIdx;
1793 MAC_TABLE_ENTRY *pEntry, *pPrevEntry, *pProbeEntry; 1701 MAC_TABLE_ENTRY *pEntry, *pPrevEntry, *pProbeEntry;
1794 BOOLEAN Cancelled; 1702 BOOLEAN Cancelled;
1795 //USHORT offset; // unused variable
1796 //UCHAR j; // unused variable
1797 1703
1798 if (wcid >= MAX_LEN_OF_MAC_TABLE) 1704 if (wcid >= MAX_LEN_OF_MAC_TABLE)
1799 return FALSE; 1705 return FALSE;
@@ -1801,7 +1707,6 @@ BOOLEAN MacTableDeleteEntry(
1801 NdisAcquireSpinLock(&pAd->MacTabLock); 1707 NdisAcquireSpinLock(&pAd->MacTabLock);
1802 1708
1803 HashIdx = MAC_ADDR_HASH_INDEX(pAddr); 1709 HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
1804 //pEntry = pAd->MacTab.Hash[HashIdx];
1805 pEntry = &pAd->MacTab.Content[wcid]; 1710 pEntry = &pAd->MacTab.Content[wcid];
1806 1711
1807 if (pEntry && (pEntry->ValidAsCLI || pEntry->ValidAsApCli || pEntry->ValidAsWDS || pEntry->ValidAsMesh 1712 if (pEntry && (pEntry->ValidAsCLI || pEntry->ValidAsApCli || pEntry->ValidAsWDS || pEntry->ValidAsMesh
@@ -2209,18 +2114,6 @@ VOID Indicate_Legacy_Packet(
2209 2114
2210 if (pRxBlk->DataSize > MAX_RX_PKT_LEN) 2115 if (pRxBlk->DataSize > MAX_RX_PKT_LEN)
2211 { 2116 {
2212#if 0 // sample take off, for multiple card design
2213 static int err_size;
2214
2215 err_size++;
2216 if (err_size > 20)
2217 {
2218 printk("Legacy DataSize = %d\n", pRxBlk->DataSize);
2219 hex_dump("802.3 Header", Header802_3, LENGTH_802_3);
2220 hex_dump("Payload", pRxBlk->pData, 64);
2221 err_size = 0;
2222 }
2223#endif
2224 2117
2225 // release packet 2118 // release packet
2226 RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE); 2119 RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
diff --git a/drivers/staging/rt2870/common/cmm_info.c b/drivers/staging/rt2870/common/cmm_info.c
index 61442791298d..2917d5f74bf6 100644
--- a/drivers/staging/rt2870/common/cmm_info.c
+++ b/drivers/staging/rt2870/common/cmm_info.c
@@ -783,9 +783,6 @@ INT Set_ResetStatCounter_Proc(
783 IN PRTMP_ADAPTER pAd, 783 IN PRTMP_ADAPTER pAd,
784 IN PUCHAR arg) 784 IN PUCHAR arg)
785{ 785{
786 //UCHAR i;
787 //MAC_TABLE_ENTRY *pEntry;
788
789 DBGPRINT(RT_DEBUG_TRACE, ("==>Set_ResetStatCounter_Proc\n")); 786 DBGPRINT(RT_DEBUG_TRACE, ("==>Set_ResetStatCounter_Proc\n"));
790 787
791 // add the most up-to-date h/w raw counters into software counters 788 // add the most up-to-date h/w raw counters into software counters
@@ -795,316 +792,9 @@ INT Set_ResetStatCounter_Proc(
795 NdisZeroMemory(&pAd->Counters8023, sizeof(COUNTER_802_3)); 792 NdisZeroMemory(&pAd->Counters8023, sizeof(COUNTER_802_3));
796 NdisZeroMemory(&pAd->RalinkCounters, sizeof(COUNTER_RALINK)); 793 NdisZeroMemory(&pAd->RalinkCounters, sizeof(COUNTER_RALINK));
797 794
798 // Reset HotSpot counter
799#if 0 // ToDo.
800 for (i = 0; i < MAX_LEN_OF_MAC_TABLE; i++)
801 {
802 pEntry = &pAd->MacTab.Content[i];
803
804 if ((pEntry->Valid == FALSE) || (pEntry->Sst != SST_ASSOC))
805 continue;
806
807 pEntry->HSCounter.LastDataPacketTime = 0;
808 pEntry->HSCounter.TotalRxByteCount= 0;
809 pEntry->HSCounter.TotalTxByteCount= 0;
810 }
811#endif
812
813
814 return TRUE; 795 return TRUE;
815} 796}
816 797
817/*
818 ========================================================================
819
820 Routine Description:
821 Add WPA key process.
822 In Adhoc WPANONE, bPairwise = 0; KeyIdx = 0;
823
824 Arguments:
825 pAd Pointer to our adapter
826 pBuf Pointer to the where the key stored
827
828 Return Value:
829 NDIS_SUCCESS Add key successfully
830
831 IRQL = DISPATCH_LEVEL
832
833 Note:
834
835 ========================================================================
836*/
837#if 0 // remove by AlbertY
838NDIS_STATUS RTMPWPAAddKeyProc(
839 IN PRTMP_ADAPTER pAd,
840 IN PVOID pBuf)
841{
842 PNDIS_802_11_KEY pKey;
843 ULONG KeyIdx;
844// NDIS_STATUS Status;
845// ULONG offset; // unused variable, snowpin 2006.07.13
846
847 PUCHAR pTxMic, pRxMic;
848 BOOLEAN bTxKey; // Set the key as transmit key
849 BOOLEAN bPairwise; // Indicate the key is pairwise key
850 BOOLEAN bKeyRSC; // indicate the receive SC set by KeyRSC value.
851 // Otherwise, it will set by the NIC.
852 BOOLEAN bAuthenticator; // indicate key is set by authenticator.
853 UCHAR apidx = BSS0;
854
855 pKey = (PNDIS_802_11_KEY) pBuf;
856 KeyIdx = pKey->KeyIndex & 0xff;
857 // Bit 31 of Add-key, Tx Key
858 bTxKey = (pKey->KeyIndex & 0x80000000) ? TRUE : FALSE;
859 // Bit 30 of Add-key PairwiseKey
860 bPairwise = (pKey->KeyIndex & 0x40000000) ? TRUE : FALSE;
861 // Bit 29 of Add-key KeyRSC
862 bKeyRSC = (pKey->KeyIndex & 0x20000000) ? TRUE : FALSE;
863 // Bit 28 of Add-key Authenticator
864 bAuthenticator = (pKey->KeyIndex & 0x10000000) ? TRUE : FALSE;
865
866 DBGPRINT(RT_DEBUG_TRACE,("RTMPWPAAddKeyProc==>pKey->KeyIndex = %x. bPairwise= %d\n", pKey->KeyIndex, bPairwise));
867 // 1. Check Group / Pairwise Key
868 if (bPairwise) // Pairwise Key
869 {
870 // 1. KeyIdx must be 0, otherwise, return NDIS_STATUS_INVALID_DATA
871 if (KeyIdx != 0)
872 return(NDIS_STATUS_INVALID_DATA);
873
874 // 2. Check bTx, it must be true, otherwise, return NDIS_STATUS_INVALID_DATA
875 if (bTxKey == FALSE)
876 return(NDIS_STATUS_INVALID_DATA);
877
878 // 3. If BSSID is all 0xff, return NDIS_STATUS_INVALID_DATA
879 if (MAC_ADDR_EQUAL(pKey->BSSID, BROADCAST_ADDR))
880 return(NDIS_STATUS_INVALID_DATA);
881
882 // 3.1 Check Pairwise key length for TKIP key. For AES, it's always 128 bits
883 //if ((pAdapter->PortCfg.WepStatus == Ndis802_11Encryption2Enabled) && (pKey->KeyLength != LEN_TKIP_KEY))
884 if ((pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled) && (pKey->KeyLength != LEN_TKIP_KEY))
885 return(NDIS_STATUS_INVALID_DATA);
886
887 pAd->SharedKey[apidx][KeyIdx].Type = PAIRWISE_KEY;
888
889 if (pAd->ApCfg.MBSSID[apidx].AuthMode == Ndis802_11AuthModeWPA2)
890 {
891 // Send media specific event to start PMKID caching
892 RTMPIndicateWPA2Status(pAd);
893 }
894 }
895 else
896 {
897 // 1. Check BSSID, if not current BSSID or Bcast, return NDIS_STATUS_INVALID_DATA
898 if ((! MAC_ADDR_EQUAL(pKey->BSSID, BROADCAST_ADDR)) &&
899 (! MAC_ADDR_EQUAL(pKey->BSSID, pAd->ApCfg.MBSSID[apidx].Bssid)))
900 return(NDIS_STATUS_INVALID_DATA);
901
902 // 2. Check Key index for supported Group Key
903 if (KeyIdx >= GROUP_KEY_NUM)
904 return(NDIS_STATUS_INVALID_DATA);
905
906 // 3. Set as default Tx Key if bTxKey is TRUE
907 if (bTxKey == TRUE)
908 pAd->ApCfg.MBSSID[apidx].DefaultKeyId = (UCHAR) KeyIdx;
909
910 pAd->SharedKey[apidx][KeyIdx].Type = GROUP_KEY;
911 }
912
913 // 4. Select RxMic / TxMic based on Supp / Authenticator
914 if (pAd->ApCfg.MBSSID[apidx].AuthMode == Ndis802_11AuthModeWPANone)
915 {
916 // for WPA-None Tx, Rx MIC is the same
917 pTxMic = (PUCHAR) (&pKey->KeyMaterial) + 16;
918 pRxMic = pTxMic;
919 }
920 else if (bAuthenticator == TRUE)
921 {
922 pTxMic = (PUCHAR) (&pKey->KeyMaterial) + 16;
923 pRxMic = (PUCHAR) (&pKey->KeyMaterial) + 24;
924 }
925 else
926 {
927 pRxMic = (PUCHAR) (&pKey->KeyMaterial) + 16;
928 pTxMic = (PUCHAR) (&pKey->KeyMaterial) + 24;
929 }
930
931 // 6. Check RxTsc
932 if (bKeyRSC == TRUE)
933 {
934 NdisMoveMemory(pAd->SharedKey[apidx][KeyIdx].RxTsc, &pKey->KeyRSC, 6);
935 NdisMoveMemory(pAd->MacTab.Content[BSSID_WCID].PairwiseKey.RxTsc, &pKey->KeyRSC, 6);
936 }
937 else
938 {
939 NdisZeroMemory(pAd->SharedKey[apidx][KeyIdx].RxTsc, 6);
940 }
941
942 // 7. Copy information into Pairwise Key structure.
943 // pKey->KeyLength will include TxMic and RxMic, therefore, we use 16 bytes hardcoded.
944 pAd->SharedKey[apidx][KeyIdx].KeyLen = (UCHAR) pKey->KeyLength;
945 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.KeyLen = (UCHAR)pKey->KeyLength;
946 NdisMoveMemory(pAd->SharedKey[BSS0][KeyIdx].Key, &pKey->KeyMaterial, 16);
947 NdisMoveMemory(pAd->MacTab.Content[BSSID_WCID].PairwiseKey.Key, &pKey->KeyMaterial, 16);
948 if (pKey->KeyLength == LEN_TKIP_KEY)
949 {
950 // Only Key lenth equal to TKIP key have these
951 NdisMoveMemory(pAd->SharedKey[apidx][KeyIdx].RxMic, pRxMic, 8);
952 NdisMoveMemory(pAd->SharedKey[apidx][KeyIdx].TxMic, pTxMic, 8);
953 NdisMoveMemory(pAd->MacTab.Content[BSSID_WCID].PairwiseKey.RxMic, pRxMic, 8);
954 NdisMoveMemory(pAd->MacTab.Content[BSSID_WCID].PairwiseKey.TxMic, pTxMic, 8);
955 }
956
957 COPY_MAC_ADDR(pAd->SharedKey[BSS0][KeyIdx].BssId, pKey->BSSID);
958
959 // Init TxTsc to one based on WiFi WPA specs
960 pAd->SharedKey[apidx][KeyIdx].TxTsc[0] = 1;
961 pAd->SharedKey[apidx][KeyIdx].TxTsc[1] = 0;
962 pAd->SharedKey[apidx][KeyIdx].TxTsc[2] = 0;
963 pAd->SharedKey[apidx][KeyIdx].TxTsc[3] = 0;
964 pAd->SharedKey[apidx][KeyIdx].TxTsc[4] = 0;
965 pAd->SharedKey[apidx][KeyIdx].TxTsc[5] = 0;
966 // 4. Init TxTsc to one based on WiFi WPA specs
967 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.TxTsc[0] = 1;
968 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.TxTsc[1] = 0;
969 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.TxTsc[2] = 0;
970 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.TxTsc[3] = 0;
971 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.TxTsc[4] = 0;
972 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.TxTsc[5] = 0;
973
974 if (pAd->ApCfg.MBSSID[apidx].WepStatus == Ndis802_11Encryption3Enabled)
975 {
976 pAd->SharedKey[apidx][KeyIdx].CipherAlg = CIPHER_AES;
977 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.CipherAlg = CIPHER_AES;
978 }
979 else if (pAd->ApCfg.MBSSID[apidx].WepStatus == Ndis802_11Encryption2Enabled)
980 {
981 pAd->SharedKey[apidx][KeyIdx].CipherAlg = CIPHER_TKIP;
982 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.CipherAlg = CIPHER_TKIP;
983 }
984 else if (pAd->ApCfg.MBSSID[apidx].WepStatus == Ndis802_11Encryption1Enabled)
985 {
986 if (pAd->SharedKey[apidx][KeyIdx].KeyLen == 5)
987 {
988 pAd->SharedKey[apidx][KeyIdx].CipherAlg = CIPHER_WEP64;
989 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.CipherAlg = CIPHER_WEP64;
990 }
991 else if (pAd->SharedKey[apidx][KeyIdx].KeyLen == 13)
992 {
993 pAd->SharedKey[apidx][KeyIdx].CipherAlg = CIPHER_WEP128;
994 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.CipherAlg = CIPHER_WEP128;
995 }
996 else
997 {
998 pAd->SharedKey[apidx][KeyIdx].CipherAlg = CIPHER_NONE;
999 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.CipherAlg = CIPHER_NONE;
1000 }
1001 }
1002 else
1003 {
1004 pAd->SharedKey[apidx][KeyIdx].CipherAlg = CIPHER_NONE;
1005 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.CipherAlg = CIPHER_NONE;
1006 }
1007
1008 if ((pAd->OpMode == OPMODE_STA)) // Pairwise Key. Add BSSID to WCTable
1009 {
1010 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.CipherAlg = pAd->SharedKey[BSS0][KeyIdx].CipherAlg;
1011 pAd->MacTab.Content[BSSID_WCID].PairwiseKey.KeyLen = pAd->SharedKey[BSS0][KeyIdx].KeyLen;
1012 }
1013
1014 if ((pAd->ApCfg.MBSSID[apidx].AuthMode == Ndis802_11AuthModeWPA2) ||
1015 (pAd->ApCfg.MBSSID[apidx].AuthMode == Ndis802_11AuthModeWPA2PSK))
1016 {
1017 //
1018 // On WPA2, Update Group Key Cipher.
1019 //
1020 if (!bPairwise)
1021 {
1022 if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
1023 pAd->SharedKey[apidx][KeyIdx].CipherAlg = CIPHER_AES;
1024 else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled)
1025 pAd->SharedKey[apidx][KeyIdx].CipherAlg = CIPHER_TKIP;
1026 }
1027 }
1028
1029 DBGPRINT(RT_DEBUG_TRACE, ("pAd->SharedKey[%d][%d].CipherAlg = %d\n", apidx, KeyIdx, pAd->SharedKey[apidx][KeyIdx].CipherAlg));
1030
1031#if 0
1032 DBGPRINT_RAW(RT_DEBUG_TRACE, ("%s Key #%d", CipherName[pAd->SharedKey[apidx][KeyIdx].CipherAlg],KeyIdx));
1033 for (i = 0; i < 16; i++)
1034 {
1035 DBGPRINT_RAW(RT_DEBUG_TRACE, ("%02x:", pAd->SharedKey[apidx][KeyIdx].Key[i]));
1036 }
1037 DBGPRINT_RAW(RT_DEBUG_TRACE, ("\n Rx MIC Key = "));
1038 for (i = 0; i < 8; i++)
1039 {
1040 DBGPRINT_RAW(RT_DEBUG_TRACE, ("%02x:", pAd->SharedKey[apidx][KeyIdx].RxMic[i]));
1041 }
1042 DBGPRINT_RAW(RT_DEBUG_TRACE, ("\n Tx MIC Key = "));
1043 for (i = 0; i < 8; i++)
1044 {
1045 DBGPRINT_RAW(RT_DEBUG_TRACE, ("%02x:", pAd->SharedKey[apidx][KeyIdx].TxMic[i]));
1046 }
1047 DBGPRINT_RAW(RT_DEBUG_TRACE, ("\n RxTSC = "));
1048 for (i = 0; i < 6; i++)
1049 {
1050 DBGPRINT_RAW(RT_DEBUG_TRACE, ("%02x:", pAd->SharedKey[apidx][KeyIdx].RxTsc[i]));
1051 }
1052#endif
1053 DBGPRINT_RAW(RT_DEBUG_TRACE, ("\n pKey-> BSSID:%02x:%02x:%02x:%02x:%02x:%02x \n",
1054 pKey->BSSID[0],pKey->BSSID[1],pKey->BSSID[2],pKey->BSSID[3],pKey->BSSID[4],pKey->BSSID[5]));
1055
1056 if ((bTxKey) && (pAd->OpMode == OPMODE_STA)) // Pairwise Key. Add BSSID to WCTable
1057 RTMPAddBSSIDCipher(pAd, BSSID_WCID, pKey, pAd->SharedKey[BSS0][KeyIdx].CipherAlg);
1058
1059
1060 // No matter pairwise key or what leyidx is, always has a copy at on-chip SharedKeytable.
1061 AsicAddSharedKeyEntry(pAd,
1062 apidx,
1063 (UCHAR)KeyIdx,
1064 pAd->SharedKey[apidx][KeyIdx].CipherAlg,
1065 pAd->SharedKey[apidx][KeyIdx].Key,
1066 pAd->SharedKey[apidx][KeyIdx].TxMic,
1067 pAd->SharedKey[apidx][KeyIdx].RxMic);
1068
1069 // The WCID key specified in used at Tx. For STA, always use pairwise key.
1070
1071 // ad-hoc mode need to specify WAP Group key with WCID index=BSS0Mcast_WCID. Let's always set this key here.
1072/* if (bPairwise == FALSE)
1073 {
1074 offset = MAC_IVEIV_TABLE_BASE + (BSS0Mcast_WCID * HW_IVEIV_ENTRY_SIZE);
1075 NdisZeroMemory(IVEIV, 8);
1076 // 1. IV/EIV
1077 // Specify key index to find shared key.
1078 if ((pAd->SharedKey[BSS0][KeyIdx].CipherAlg==CIPHER_TKIP) ||
1079 (pAd->SharedKey[BSS0][KeyIdx].CipherAlg==CIPHER_AES))
1080 IVEIV[3] = 0x20; // Eiv bit on. keyid always 0 for pairwise key
1081 IVEIV[3] |= (KeyIdx<< 6); // groupkey index is not 0
1082 for (i=0; i<8; i++)
1083 {
1084 RTMP_IO_WRITE8(pAd, offset+i, IVEIV[i]);
1085 }
1086
1087 // 2. WCID Attribute UDF:3, BSSIdx:3, Alg:3, Keytable:use share key, BSSIdx is 0
1088 WCIDAttri = (pAd->SharedKey[BSS0][KeyIdx].CipherAlg<<1)|PAIRWISEKEYTABLE;
1089 offset = MAC_WCID_ATTRIBUTE_BASE + (BSS0Mcast_WCID* HW_WCID_ATTRI_SIZE);
1090 RTMP_IO_WRITE32(pAd, offset, WCIDAttri);
1091
1092 }
1093
1094*/
1095
1096 if (pAd->SharedKey[apidx][KeyIdx].Type == GROUP_KEY)
1097 {
1098 // 802.1x port control
1099 pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
1100 DBGPRINT(RT_DEBUG_TRACE,("!!WPA_802_1X_PORT_SECURED!!\n"));
1101
1102 }
1103
1104 return (NDIS_STATUS_SUCCESS);
1105}
1106#endif
1107
1108BOOLEAN RTMPCheckStrPrintAble( 798BOOLEAN RTMPCheckStrPrintAble(
1109 IN CHAR *pInPutStr, 799 IN CHAR *pInPutStr,
1110 IN UCHAR strLen) 800 IN UCHAR strLen)
@@ -1425,11 +1115,6 @@ VOID RTMPSetPhyMode(
1425 INT i; 1115 INT i;
1426 // the selected phymode must be supported by the RF IC encoded in E2PROM 1116 // the selected phymode must be supported by the RF IC encoded in E2PROM
1427 1117
1428 // if no change, do nothing
1429 /* bug fix
1430 if (pAd->CommonCfg.PhyMode == phymode)
1431 return;
1432 */
1433 pAd->CommonCfg.PhyMode = (UCHAR)phymode; 1118 pAd->CommonCfg.PhyMode = (UCHAR)phymode;
1434 1119
1435 DBGPRINT(RT_DEBUG_TRACE,("RTMPSetPhyMode : PhyMode=%d, channel=%d \n", pAd->CommonCfg.PhyMode, pAd->CommonCfg.Channel)); 1120 DBGPRINT(RT_DEBUG_TRACE,("RTMPSetPhyMode : PhyMode=%d, channel=%d \n", pAd->CommonCfg.PhyMode, pAd->CommonCfg.Channel));
@@ -2206,11 +1891,6 @@ VOID RTMPIoctlGetMacTable(
2206 1891
2207 // the connected time per entry 1892 // the connected time per entry
2208 MacTab.Entry[MacTab.Num].ConnectedTime = pAd->MacTab.Content[i].StaConnectTime; 1893 MacTab.Entry[MacTab.Num].ConnectedTime = pAd->MacTab.Content[i].StaConnectTime;
2209#if 0 // ToDo
2210 MacTab.Entry[MacTab.Num].HSCounter.LastDataPacketTime = pAd->MacTab.Content[i].HSCounter.LastDataPacketTime;
2211 MacTab.Entry[MacTab.Num].HSCounter.TotalRxByteCount = pAd->MacTab.Content[i].HSCounter.TotalRxByteCount;
2212 MacTab.Entry[MacTab.Num].HSCounter.TotalTxByteCount = pAd->MacTab.Content[i].HSCounter.TotalTxByteCount;
2213#endif
2214 MacTab.Entry[MacTab.Num].TxRate.field.MCS = pAd->MacTab.Content[i].HTPhyMode.field.MCS; 1894 MacTab.Entry[MacTab.Num].TxRate.field.MCS = pAd->MacTab.Content[i].HTPhyMode.field.MCS;
2215 MacTab.Entry[MacTab.Num].TxRate.field.BW = pAd->MacTab.Content[i].HTPhyMode.field.BW; 1895 MacTab.Entry[MacTab.Num].TxRate.field.BW = pAd->MacTab.Content[i].HTPhyMode.field.BW;
2216 MacTab.Entry[MacTab.Num].TxRate.field.ShortGI = pAd->MacTab.Content[i].HTPhyMode.field.ShortGI; 1896 MacTab.Entry[MacTab.Num].TxRate.field.ShortGI = pAd->MacTab.Content[i].HTPhyMode.field.ShortGI;
@@ -2277,7 +1957,6 @@ INT Set_BASetup_Proc(
2277 =>The six 2 digit hex-decimal number previous are the Mac address, 1957 =>The six 2 digit hex-decimal number previous are the Mac address,
2278 =>The seventh decimal number is the tid value. 1958 =>The seventh decimal number is the tid value.
2279*/ 1959*/
2280 //printk("\n%s\n", arg);
2281 1960
2282 if(strlen(arg) < 19) //Mac address acceptable format 01:02:03:04:05:06 length 17 plus the "-" and tid value in decimal format. 1961 if(strlen(arg) < 19) //Mac address acceptable format 01:02:03:04:05:06 length 17 plus the "-" and tid value in decimal format.
2283 return FALSE; 1962 return FALSE;
@@ -2351,7 +2030,6 @@ INT Set_BAOriTearDown_Proc(
2351 INT i; 2030 INT i;
2352 MAC_TABLE_ENTRY *pEntry; 2031 MAC_TABLE_ENTRY *pEntry;
2353 2032
2354 //printk("\n%s\n", arg);
2355/* 2033/*
2356 The BAOriTearDown inupt string format should be xx:xx:xx:xx:xx:xx-d, 2034 The BAOriTearDown inupt string format should be xx:xx:xx:xx:xx:xx-d,
2357 =>The six 2 digit hex-decimal number previous are the Mac address, 2035 =>The six 2 digit hex-decimal number previous are the Mac address,
diff --git a/drivers/staging/rt2870/common/cmm_sanity.c b/drivers/staging/rt2870/common/cmm_sanity.c
index a12e3991d6d4..843e44e41abe 100644
--- a/drivers/staging/rt2870/common/cmm_sanity.c
+++ b/drivers/staging/rt2870/common/cmm_sanity.c
@@ -81,14 +81,6 @@ BOOLEAN MlmeAddBAReqSanity(
81 return FALSE; 81 return FALSE;
82 } 82 }
83 83
84 /*
85 if ((pInfo->BaBufSize > MAX_RX_REORDERBUF) || (pInfo->BaBufSize < 2))
86 {
87 DBGPRINT(RT_DEBUG_TRACE, ("MlmeAddBAReqSanity fail - Rx Reordering buffer too big or too small\n"));
88 return FALSE;
89 }
90 */
91
92 if ((pInfo->pAddr[0]&0x01) == 0x01) 84 if ((pInfo->pAddr[0]&0x01) == 0x01)
93 { 85 {
94 DBGPRINT(RT_DEBUG_TRACE, ("MlmeAddBAReqSanity fail - broadcast address not support BA\n")); 86 DBGPRINT(RT_DEBUG_TRACE, ("MlmeAddBAReqSanity fail - broadcast address not support BA\n"));
@@ -185,7 +177,6 @@ BOOLEAN PeerAddBARspActionSanity(
185 IN VOID *pMsg, 177 IN VOID *pMsg,
186 IN ULONG MsgLen) 178 IN ULONG MsgLen)
187{ 179{
188 //PFRAME_802_11 pFrame = (PFRAME_802_11)pMsg;
189 PFRAME_ADDBA_RSP pAddFrame; 180 PFRAME_ADDBA_RSP pAddFrame;
190 181
191 pAddFrame = (PFRAME_ADDBA_RSP)(pMsg); 182 pAddFrame = (PFRAME_ADDBA_RSP)(pMsg);
@@ -341,8 +332,6 @@ BOOLEAN PeerBeaconAndProbeRspSanity(
341 COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2); 332 COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
342 COPY_MAC_ADDR(pBssid, pFrame->Hdr.Addr3); 333 COPY_MAC_ADDR(pBssid, pFrame->Hdr.Addr3);
343 334
344// hex_dump("Beacon", Msg, MsgLen);
345
346 Ptr = pFrame->Octet; 335 Ptr = pFrame->Octet;
347 Length += LENGTH_802_11; 336 Length += LENGTH_802_11;
348 337
@@ -556,26 +545,6 @@ BOOLEAN PeerBeaconAndProbeRspSanity(
556 // Wifi WMM use the same IE vale, need to parse that too 545 // Wifi WMM use the same IE vale, need to parse that too
557 // case IE_WPA: 546 // case IE_WPA:
558 case IE_VENDOR_SPECIFIC: 547 case IE_VENDOR_SPECIFIC:
559 // Check Broadcom/Atheros 802.11n OUI version, for HT Capability IE.
560 // This HT IE is before IEEE draft set HT IE value.2006-09-28 by Jan.
561 /*if (NdisEqualMemory(pEid->Octet, BROADCOM_OUI, 3) && (pEid->Len >= 4))
562 {
563 if ((pEid->Octet[3] == OUI_BROADCOM_HT) && (pEid->Len >= 30))
564 {
565 {
566 NdisMoveMemory(pHtCapability, &pEid->Octet[4], sizeof(HT_CAPABILITY_IE));
567 *pHtCapabilityLen = SIZE_HT_CAP_IE; // Nnow we only support 26 bytes.
568 }
569 }
570 if ((pEid->Octet[3] == OUI_BROADCOM_HT) && (pEid->Len >= 26))
571 {
572 {
573 NdisMoveMemory(AddHtInfo, &pEid->Octet[4], sizeof(ADD_HT_INFO_IE));
574 *AddHtInfoLen = SIZE_ADD_HT_INFO_IE; // Nnow we only support 26 bytes.
575 }
576 }
577 }
578 */
579 // Check the OUI version, filter out non-standard usage 548 // Check the OUI version, filter out non-standard usage
580 if (NdisEqualMemory(pEid->Octet, RALINK_OUI, 3) && (pEid->Len == 7)) 549 if (NdisEqualMemory(pEid->Octet, RALINK_OUI, 3) && (pEid->Len == 7))
581 { 550 {
diff --git a/drivers/staging/rt2870/common/cmm_wpa.c b/drivers/staging/rt2870/common/cmm_wpa.c
index a44735caba7d..e206077e278a 100644
--- a/drivers/staging/rt2870/common/cmm_wpa.c
+++ b/drivers/staging/rt2870/common/cmm_wpa.c
@@ -1248,16 +1248,6 @@ VOID ConstructEapolMsg(
1248 *(USHORT *)(&pMsg->KeyDesc.KeyInfo) = cpu2le16(*(USHORT *)(&pMsg->KeyDesc.KeyInfo)); 1248 *(USHORT *)(&pMsg->KeyDesc.KeyInfo) = cpu2le16(*(USHORT *)(&pMsg->KeyDesc.KeyInfo));
1249 1249
1250 // Fill in Key Length 1250 // Fill in Key Length
1251#if 0
1252 if (bWPA2)
1253 {
1254 // In WPA2 mode, the field indicates the length of pairwise key cipher,
1255 // so only pairwise_msg_1 and pairwise_msg_3 need to fill.
1256 if ((MsgType == EAPOL_PAIR_MSG_1) || (MsgType == EAPOL_PAIR_MSG_3))
1257 pMsg->KeyDesc.KeyLength[1] = ((WepStatus == Ndis802_11Encryption2Enabled) ? LEN_TKIP_KEY : LEN_AES_KEY);
1258 }
1259 else if (!bWPA2)
1260#endif
1261 { 1251 {
1262 if (MsgType >= EAPOL_GROUP_MSG_1) 1252 if (MsgType >= EAPOL_GROUP_MSG_1)
1263 { 1253 {
diff --git a/drivers/staging/rt2870/common/dfs.c b/drivers/staging/rt2870/common/dfs.c
index 87289627e9e7..23330f2661d9 100644
--- a/drivers/staging/rt2870/common/dfs.c
+++ b/drivers/staging/rt2870/common/dfs.c
@@ -80,18 +80,6 @@ VOID BbpRadarDetectionStart(
80 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 124, 0x28); 80 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 124, 0x28);
81 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 125, 0xff); 81 RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 125, 0xff);
82 82
83#if 0
84 // toggle Rx enable bit for radar detection.
85 // it's Andy's recommand.
86 {
87 UINT32 Value;
88 RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
89 Value |= (0x1 << 3);
90 RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
91 Value &= ~(0x1 << 3);
92 RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
93 }
94#endif
95 RadarPeriod = ((UINT)RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + (UINT)pAd->CommonCfg.RadarDetect.DfsSessionTime) < 250 ? 83 RadarPeriod = ((UINT)RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + (UINT)pAd->CommonCfg.RadarDetect.DfsSessionTime) < 250 ?
96 (RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + pAd->CommonCfg.RadarDetect.DfsSessionTime) : 250; 84 (RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + pAd->CommonCfg.RadarDetect.DfsSessionTime) : 250;
97 85
diff --git a/drivers/staging/rt2870/common/eeprom.c b/drivers/staging/rt2870/common/eeprom.c
index 33f16ed9c491..bed2d666629c 100644
--- a/drivers/staging/rt2870/common/eeprom.c
+++ b/drivers/staging/rt2870/common/eeprom.c
@@ -36,16 +36,6 @@
36*/ 36*/
37#include "../rt_config.h" 37#include "../rt_config.h"
38 38
39#if 0
40#define EEPROM_SIZE 0x200
41#define NVRAM_OFFSET 0x30000
42#define RF_OFFSET 0x40000
43
44static UCHAR init_flag = 0;
45static PUCHAR nv_ee_start = 0;
46
47static UCHAR EeBuffer[EEPROM_SIZE];
48#endif
49// IRQL = PASSIVE_LEVEL 39// IRQL = PASSIVE_LEVEL
50VOID RaiseClock( 40VOID RaiseClock(
51 IN PRTMP_ADAPTER pAd, 41 IN PRTMP_ADAPTER pAd,
diff --git a/drivers/staging/rt2870/common/mlme.c b/drivers/staging/rt2870/common/mlme.c
index bef9ba5cface..399ced285731 100644
--- a/drivers/staging/rt2870/common/mlme.c
+++ b/drivers/staging/rt2870/common/mlme.c
@@ -243,19 +243,11 @@ UCHAR RateSwitchTable11BGN3S[] = { // 3*3
243 0x02, 0x21, 2, 20, 50, 243 0x02, 0x21, 2, 20, 50,
244 0x03, 0x21, 3, 20, 50, 244 0x03, 0x21, 3, 20, 50,
245 0x04, 0x21, 4, 15, 50, 245 0x04, 0x21, 4, 15, 50,
246#if 1
247 0x05, 0x20, 20, 15, 30, 246 0x05, 0x20, 20, 15, 30,
248 0x06, 0x20, 21, 8, 20, 247 0x06, 0x20, 21, 8, 20,
249 0x07, 0x20, 22, 8, 20, 248 0x07, 0x20, 22, 8, 20,
250 0x08, 0x20, 23, 8, 25, 249 0x08, 0x20, 23, 8, 25,
251 0x09, 0x22, 23, 8, 25, 250 0x09, 0x22, 23, 8, 25,
252#else // for RT2860 2*3 test
253 0x05, 0x20, 12, 15, 30,
254 0x06, 0x20, 13, 8, 20,
255 0x07, 0x20, 14, 8, 20,
256 0x08, 0x20, 15, 8, 25,
257 0x09, 0x22, 15, 8, 25,
258#endif
259}; 251};
260 252
261UCHAR RateSwitchTable11BGN2SForABand[] = { 253UCHAR RateSwitchTable11BGN2SForABand[] = {
@@ -822,8 +814,6 @@ VOID MlmePeriodicExec(
822 rx_Total = 0; 814 rx_Total = 0;
823 } 815 }
824 816
825 //ORIBATimerTimeout(pAd);
826
827 // Media status changed, report to NDIS 817 // Media status changed, report to NDIS
828 if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_MEDIA_STATE_CHANGE)) 818 if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_MEDIA_STATE_CHANGE))
829 { 819 {
@@ -854,13 +844,6 @@ VOID MlmePeriodicExec(
854 // Need statistics after read counter. So put after NICUpdateRawCounters 844 // Need statistics after read counter. So put after NICUpdateRawCounters
855 ORIBATimerTimeout(pAd); 845 ORIBATimerTimeout(pAd);
856 846
857 // if MGMT RING is full more than twice within 1 second, we consider there's
858 // a hardware problem stucking the TX path. In this case, try a hardware reset
859 // to recover the system
860 // if (pAd->RalinkCounters.MgmtRingFullCount >= 2)
861 // RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HARDWARE_ERROR);
862 // else
863 // pAd->RalinkCounters.MgmtRingFullCount = 0;
864 847
865 // The time period for checking antenna is according to traffic 848 // The time period for checking antenna is according to traffic
866 if (pAd->Mlme.bEnableAutoAntennaCheck) 849 if (pAd->Mlme.bEnableAutoAntennaCheck)
@@ -978,8 +961,6 @@ VOID STAMlmePeriodicExec(
978 DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - No BEACON. restore R66 to the low bound(%d) \n", (0x2E + GET_LNA_GAIN(pAd)))); 961 DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - No BEACON. restore R66 to the low bound(%d) \n", (0x2E + GET_LNA_GAIN(pAd))));
979 } 962 }
980 963
981 //if ((pAd->RalinkCounters.OneSecTxNoRetryOkCount == 0) &&
982 // (pAd->RalinkCounters.OneSecTxRetryOkCount == 0))
983 { 964 {
984 if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable) 965 if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable)
985 { 966 {
@@ -1015,7 +996,6 @@ VOID STAMlmePeriodicExec(
1015 wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL); 996 wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
1016 } 997 }
1017 998
1018 // RTMPPatchMacBbpBug(pAd);
1019 MlmeAutoReconnectLastSSID(pAd); 999 MlmeAutoReconnectLastSSID(pAd);
1020 } 1000 }
1021 else if (CQI_IS_BAD(pAd->Mlme.ChannelQuality)) 1001 else if (CQI_IS_BAD(pAd->Mlme.ChannelQuality))
@@ -1295,8 +1275,6 @@ VOID MlmeSelectTxRateTable(
1295 break; 1275 break;
1296 } 1276 }
1297 1277
1298 //if ((pAd->StaActive.SupRateLen + pAd->StaActive.ExtRateLen == 12) && (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) &&
1299 // ((pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0x00) || (pAd->Antenna.field.TxPath == 1)))
1300 if ((pEntry->RateLen == 12) && (pEntry->HTCapability.MCSSet[0] == 0xff) && 1278 if ((pEntry->RateLen == 12) && (pEntry->HTCapability.MCSSet[0] == 0xff) &&
1301 ((pEntry->HTCapability.MCSSet[1] == 0x00) || (pAd->CommonCfg.TxStream == 1))) 1279 ((pEntry->HTCapability.MCSSet[1] == 0x00) || (pAd->CommonCfg.TxStream == 1)))
1302 {// 11BGN 1S AP 1280 {// 11BGN 1S AP
@@ -1307,8 +1285,6 @@ VOID MlmeSelectTxRateTable(
1307 break; 1285 break;
1308 } 1286 }
1309 1287
1310 //else if ((pAd->StaActive.SupRateLen + pAd->StaActive.ExtRateLen == 12) && (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) &&
1311 // (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0xff) && (pAd->Antenna.field.TxPath == 2))
1312 if ((pEntry->RateLen == 12) && (pEntry->HTCapability.MCSSet[0] == 0xff) && 1288 if ((pEntry->RateLen == 12) && (pEntry->HTCapability.MCSSet[0] == 0xff) &&
1313 (pEntry->HTCapability.MCSSet[1] == 0xff) && (pAd->CommonCfg.TxStream == 2)) 1289 (pEntry->HTCapability.MCSSet[1] == 0xff) && (pAd->CommonCfg.TxStream == 2))
1314 {// 11BGN 2S AP 1290 {// 11BGN 2S AP
@@ -1329,7 +1305,6 @@ VOID MlmeSelectTxRateTable(
1329 break; 1305 break;
1330 } 1306 }
1331 1307
1332 //else if ((pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) && ((pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0x00) || (pAd->Antenna.field.TxPath == 1)))
1333 if ((pEntry->HTCapability.MCSSet[0] == 0xff) && ((pEntry->HTCapability.MCSSet[1] == 0x00) || (pAd->CommonCfg.TxStream == 1))) 1308 if ((pEntry->HTCapability.MCSSet[0] == 0xff) && ((pEntry->HTCapability.MCSSet[1] == 0x00) || (pAd->CommonCfg.TxStream == 1)))
1334 {// 11N 1S AP 1309 {// 11N 1S AP
1335 *ppTable = RateSwitchTable11N1S; 1310 *ppTable = RateSwitchTable11N1S;
@@ -1339,7 +1314,6 @@ VOID MlmeSelectTxRateTable(
1339 break; 1314 break;
1340 } 1315 }
1341 1316
1342 //else if ((pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) && (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0xff) && (pAd->Antenna.field.TxPath == 2))
1343 if ((pEntry->HTCapability.MCSSet[0] == 0xff) && (pEntry->HTCapability.MCSSet[1] == 0xff) && (pAd->CommonCfg.TxStream == 2)) 1317 if ((pEntry->HTCapability.MCSSet[0] == 0xff) && (pEntry->HTCapability.MCSSet[1] == 0xff) && (pAd->CommonCfg.TxStream == 2))
1344 {// 11N 2S AP 1318 {// 11N 2S AP
1345 if (pAd->LatchRfRegs.Channel <= 14) 1319 if (pAd->LatchRfRegs.Channel <= 14)
@@ -2003,7 +1977,6 @@ VOID MlmeDynamicTxRateSwitching(
2003 { 1977 {
2004 MCS14 = idx; 1978 MCS14 = idx;
2005 } 1979 }
2006 //else if ((pCurrTxRate->CurrMCS == MCS_15)/* && (pCurrTxRate->ShortGI == GI_800)*/) //we hope to use ShortGI as initial rate
2007 else if ((pCurrTxRate->CurrMCS == MCS_15) && (pCurrTxRate->ShortGI == GI_800)) //we hope to use ShortGI as initial rate, however Atheros's chip has bugs when short GI 1980 else if ((pCurrTxRate->CurrMCS == MCS_15) && (pCurrTxRate->ShortGI == GI_800)) //we hope to use ShortGI as initial rate, however Atheros's chip has bugs when short GI
2008 { 1981 {
2009 MCS15 = idx; 1982 MCS15 = idx;
@@ -2074,7 +2047,6 @@ VOID MlmeDynamicTxRateSwitching(
2074 else 2047 else
2075 TxRateIdx = MCS0; 2048 TxRateIdx = MCS0;
2076 } 2049 }
2077// else if ((pTable == RateSwitchTable11BGN2S) || (pTable == RateSwitchTable11BGN2SForABand) ||(pTable == RateSwitchTable11N2S) ||(pTable == RateSwitchTable11N2SForABand) || (pTable == RateSwitchTable))
2078 else if ((pTable == RateSwitchTable11BGN2S) || (pTable == RateSwitchTable11BGN2SForABand) ||(pTable == RateSwitchTable11N2S) ||(pTable == RateSwitchTable11N2SForABand)) // 3*3 2050 else if ((pTable == RateSwitchTable11BGN2S) || (pTable == RateSwitchTable11BGN2SForABand) ||(pTable == RateSwitchTable11N2S) ||(pTable == RateSwitchTable11N2SForABand)) // 3*3
2079 {// N mode with 2 stream 2051 {// N mode with 2 stream
2080 if (MCS15 && (Rssi >= (-70+RssiOffset))) 2052 if (MCS15 && (Rssi >= (-70+RssiOffset)))
@@ -2137,7 +2109,6 @@ VOID MlmeDynamicTxRateSwitching(
2137 TxRateIdx = MCS0; 2109 TxRateIdx = MCS0;
2138 } 2110 }
2139 2111
2140 // if (TxRateIdx != pAd->CommonCfg.TxRateIndex)
2141 { 2112 {
2142 pEntry->CurrTxRateIndex = TxRateIdx; 2113 pEntry->CurrTxRateIndex = TxRateIdx;
2143 pNextTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(pEntry->CurrTxRateIndex+1)*5]; 2114 pNextTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(pEntry->CurrTxRateIndex+1)*5];
@@ -2378,14 +2349,6 @@ VOID StaQuickResponeForRateUpExec(
2378 pAd->WlanCounters.RetryCount.u.LowPart += StaTx1.field.TxRetransmit; 2349 pAd->WlanCounters.RetryCount.u.LowPart += StaTx1.field.TxRetransmit;
2379 pAd->WlanCounters.FailedCount.u.LowPart += TxStaCnt0.field.TxFailCount; 2350 pAd->WlanCounters.FailedCount.u.LowPart += TxStaCnt0.field.TxFailCount;
2380 2351
2381#if 0 // test by Gary.
2382 // if no traffic in the past 1-sec period, don't change TX rate,
2383 // but clear all bad history. because the bad history may affect the next
2384 // Chariot throughput test
2385 TxTotalCnt = pAd->RalinkCounters.OneSecTxNoRetryOkCount +
2386 pAd->RalinkCounters.OneSecTxRetryOkCount +
2387 pAd->RalinkCounters.OneSecTxFailCount;
2388#endif
2389 if (TxTotalCnt) 2352 if (TxTotalCnt)
2390 TxErrorRatio = ((TxRetransmit + TxFailCount) * 100) / TxTotalCnt; 2353 TxErrorRatio = ((TxRetransmit + TxFailCount) * 100) / TxTotalCnt;
2391 } 2354 }
@@ -2538,10 +2501,7 @@ VOID MlmeCheckPsmChange(
2538 if (INFRA_ON(pAd) && 2501 if (INFRA_ON(pAd) &&
2539 (PowerMode != Ndis802_11PowerModeCAM) && 2502 (PowerMode != Ndis802_11PowerModeCAM) &&
2540 (pAd->StaCfg.Psm == PWR_ACTIVE) && 2503 (pAd->StaCfg.Psm == PWR_ACTIVE) &&
2541// (! RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) 2504 (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE))
2542 (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE) /*&&
2543 (pAd->RalinkCounters.OneSecTxNoRetryOkCount == 0) &&
2544 (pAd->RalinkCounters.OneSecTxRetryOkCount == 0)*/)
2545 { 2505 {
2546 NdisGetSystemUpTime(&pAd->Mlme.LastSendNULLpsmTime); 2506 NdisGetSystemUpTime(&pAd->Mlme.LastSendNULLpsmTime);
2547 pAd->RalinkCounters.RxCountSinceLastNULL = 0; 2507 pAd->RalinkCounters.RxCountSinceLastNULL = 0;
@@ -2734,28 +2694,20 @@ VOID MlmeUpdateTxRates(
2734 // specified; otherwise disabled 2694 // specified; otherwise disabled
2735 if (num <= 1) 2695 if (num <= 1)
2736 { 2696 {
2737 //OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
2738 //pAd->CommonCfg.bAutoTxRateSwitch = FALSE;
2739 *auto_rate_cur_p = FALSE; 2697 *auto_rate_cur_p = FALSE;
2740 } 2698 }
2741 else 2699 else
2742 { 2700 {
2743 //OPSTATUS_SET_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
2744 //pAd->CommonCfg.bAutoTxRateSwitch = TRUE;
2745 *auto_rate_cur_p = TRUE; 2701 *auto_rate_cur_p = TRUE;
2746 } 2702 }
2747 2703
2748#if 1 2704#if 1
2749 if (HtMcs != MCS_AUTO) 2705 if (HtMcs != MCS_AUTO)
2750 { 2706 {
2751 //OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
2752 //pAd->CommonCfg.bAutoTxRateSwitch = FALSE;
2753 *auto_rate_cur_p = FALSE; 2707 *auto_rate_cur_p = FALSE;
2754 } 2708 }
2755 else 2709 else
2756 { 2710 {
2757 //OPSTATUS_SET_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
2758 //pAd->CommonCfg.bAutoTxRateSwitch = TRUE;
2759 *auto_rate_cur_p = TRUE; 2711 *auto_rate_cur_p = TRUE;
2760 } 2712 }
2761#endif 2713#endif
@@ -2824,9 +2776,6 @@ VOID MlmeUpdateTxRates(
2824 2776
2825 RTMP_IO_WRITE32(pAd, LEGACY_BASIC_RATE, BasicRateBitmap); 2777 RTMP_IO_WRITE32(pAd, LEGACY_BASIC_RATE, BasicRateBitmap);
2826 2778
2827 // bug fix
2828 // pAd->CommonCfg.BasicRateBitmap = BasicRateBitmap;
2829
2830 // calculate the exptected ACK rate for each TX rate. This info is used to caculate 2779 // calculate the exptected ACK rate for each TX rate. This info is used to caculate
2831 // the DURATION field of outgoing uniicast DATA/MGMT frame 2780 // the DURATION field of outgoing uniicast DATA/MGMT frame
2832 for (i=0; i<MAX_LEN_OF_SUPPORTED_RATES; i++) 2781 for (i=0; i<MAX_LEN_OF_SUPPORTED_RATES; i++)
@@ -2844,14 +2793,6 @@ VOID MlmeUpdateTxRates(
2844 pAd->CommonCfg.MaxTxRate = MaxDesire; 2793 pAd->CommonCfg.MaxTxRate = MaxDesire;
2845 2794
2846 pAd->CommonCfg.MinTxRate = MinSupport; 2795 pAd->CommonCfg.MinTxRate = MinSupport;
2847 // 2003-07-31 john - 2500 doesn't have good sensitivity at high OFDM rates. to increase the success
2848 // ratio of initial DHCP packet exchange, TX rate starts from a lower rate depending
2849 // on average RSSI
2850 // 1. RSSI >= -70db, start at 54 Mbps (short distance)
2851 // 2. -70 > RSSI >= -75, start at 24 Mbps (mid distance)
2852 // 3. -75 > RSSI, start at 11 Mbps (long distance)
2853 //if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED)/* &&
2854 // OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)*/)
2855 if (*auto_rate_cur_p) 2796 if (*auto_rate_cur_p)
2856 { 2797 {
2857 short dbm = 0; 2798 short dbm = 0;
@@ -2920,11 +2861,7 @@ VOID MlmeUpdateTxRates(
2920 pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_CCK; 2861 pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_CCK;
2921 pAd->CommonCfg.MlmeTransmit.field.MCS = RATE_1; 2862 pAd->CommonCfg.MlmeTransmit.field.MCS = RATE_1;
2922 2863
2923//#ifdef WIFI_TEST
2924 pAd->CommonCfg.RtsRate = RATE_11; 2864 pAd->CommonCfg.RtsRate = RATE_11;
2925//#else
2926// pAd->CommonCfg.RtsRate = RATE_1;
2927//#endif
2928 break; 2865 break;
2929 case PHY_11G: 2866 case PHY_11G:
2930 case PHY_11A: 2867 case PHY_11A:
@@ -4278,8 +4215,6 @@ VOID MgtMacHeaderInit(
4278 4215
4279 pHdr80211->FC.Type = BTYPE_MGMT; 4216 pHdr80211->FC.Type = BTYPE_MGMT;
4280 pHdr80211->FC.SubType = SubType; 4217 pHdr80211->FC.SubType = SubType;
4281// if (SubType == SUBTYPE_ACK) // sample, no use, it will conflict with ACTION frame sub type
4282// pHdr80211->FC.Type = BTYPE_CNTL;
4283 pHdr80211->FC.ToDs = ToDs; 4218 pHdr80211->FC.ToDs = ToDs;
4284 COPY_MAC_ADDR(pHdr80211->Addr1, pDA); 4219 COPY_MAC_ADDR(pHdr80211->Addr1, pDA);
4285 4220
@@ -5122,9 +5057,7 @@ VOID AsicUpdateProtect(
5122 // Config ASIC RTS threshold register 5057 // Config ASIC RTS threshold register
5123 RTMP_IO_READ32(pAd, TX_RTS_CFG, &MacReg); 5058 RTMP_IO_READ32(pAd, TX_RTS_CFG, &MacReg);
5124 MacReg &= 0xFF0000FF; 5059 MacReg &= 0xFF0000FF;
5125#if 0 5060
5126 MacReg |= (pAd->CommonCfg.RtsThreshold << 8);
5127#else
5128 // If the user want disable RtsThreshold and enable Amsdu/Ralink-Aggregation, set the RtsThreshold as 4096 5061 // If the user want disable RtsThreshold and enable Amsdu/Ralink-Aggregation, set the RtsThreshold as 4096
5129 if (( 5062 if ((
5130 (pAd->CommonCfg.BACapability.field.AmsduEnable) || 5063 (pAd->CommonCfg.BACapability.field.AmsduEnable) ||
@@ -5137,7 +5070,6 @@ VOID AsicUpdateProtect(
5137 { 5070 {
5138 MacReg |= (pAd->CommonCfg.RtsThreshold << 8); 5071 MacReg |= (pAd->CommonCfg.RtsThreshold << 8);
5139 } 5072 }
5140#endif
5141 5073
5142 RTMP_IO_WRITE32(pAd, TX_RTS_CFG, MacReg); 5074 RTMP_IO_WRITE32(pAd, TX_RTS_CFG, MacReg);
5143 5075
@@ -5831,10 +5763,7 @@ VOID AsicAdjustTxPower(
5831 break; 5763 break;
5832 } 5764 }
5833 // The index is the step we should decrease, idx = 0 means there is nothing to compensate 5765 // The index is the step we should decrease, idx = 0 means there is nothing to compensate
5834// if (R3 > (ULONG) (TxAgcStep * (idx-1))) 5766 *pTxAgcCompensate = -(TxAgcStep * (idx-1));
5835 *pTxAgcCompensate = -(TxAgcStep * (idx-1));
5836// else
5837// *pTxAgcCompensate = -((UCHAR)R3);
5838 5767
5839 DeltaPwr += (*pTxAgcCompensate); 5768 DeltaPwr += (*pTxAgcCompensate);
5840 DBGPRINT(RT_DEBUG_TRACE, ("-- Tx Power, BBP R1=%x, TssiRef=%x, TxAgcStep=%x, step = -%d\n", 5769 DBGPRINT(RT_DEBUG_TRACE, ("-- Tx Power, BBP R1=%x, TssiRef=%x, TxAgcStep=%x, step = -%d\n",
@@ -6116,11 +6045,6 @@ VOID AsicDisableRDG(
6116 RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &Data); 6045 RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &Data);
6117 6046
6118 Data &= 0xFFFFFF00; 6047 Data &= 0xFFFFFF00;
6119 //Data |= 0x20;
6120#ifndef WIFI_TEST
6121 //if ( pAd->CommonCfg.bEnableTxBurst )
6122 // Data |= 0x60; // for performance issue not set the TXOP to 0
6123#endif
6124 if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_DYNAMIC_BE_TXOP_ACTIVE) 6048 if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_DYNAMIC_BE_TXOP_ACTIVE)
6125 && (pAd->MacTab.fAnyStationMIMOPSDynamic == FALSE) 6049 && (pAd->MacTab.fAnyStationMIMOPSDynamic == FALSE)
6126 ) 6050 )
@@ -6177,7 +6101,6 @@ VOID AsicEnableBssSync(
6177 DBGPRINT(RT_DEBUG_TRACE, ("--->AsicEnableBssSync(INFRA mode)\n")); 6101 DBGPRINT(RT_DEBUG_TRACE, ("--->AsicEnableBssSync(INFRA mode)\n"));
6178 6102
6179 RTMP_IO_READ32(pAd, BCN_TIME_CFG, &csr.word); 6103 RTMP_IO_READ32(pAd, BCN_TIME_CFG, &csr.word);
6180// RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, 0x00000000);
6181 6104
6182 { 6105 {
6183 csr.field.BeaconInterval = pAd->CommonCfg.BeaconPeriod << 4; // ASIC register in units of 1/16 TU 6106 csr.field.BeaconInterval = pAd->CommonCfg.BeaconPeriod << 4; // ASIC register in units of 1/16 TU
@@ -6223,8 +6146,6 @@ VOID AsicEnableIbssSync(
6223 ptr = (PUCHAR)&pAd->BeaconTxWI; 6146 ptr = (PUCHAR)&pAd->BeaconTxWI;
6224 for (i=0; i<TXWI_SIZE; i+=2) // 16-byte TXWI field 6147 for (i=0; i<TXWI_SIZE; i+=2) // 16-byte TXWI field
6225 { 6148 {
6226 //UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24);
6227 //RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + i, longptr);
6228 RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + i, ptr, 2); 6149 RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + i, ptr, 2);
6229 ptr += 2; 6150 ptr += 2;
6230 } 6151 }
@@ -6233,19 +6154,11 @@ VOID AsicEnableIbssSync(
6233 ptr = pAd->BeaconBuf; 6154 ptr = pAd->BeaconBuf;
6234 for (i=0; i< pAd->BeaconTxWI.MPDUtotalByteCount; i+=2) 6155 for (i=0; i< pAd->BeaconTxWI.MPDUtotalByteCount; i+=2)
6235 { 6156 {
6236 //UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24);
6237 //RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, longptr);
6238 RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, ptr, 2); 6157 RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, ptr, 2);
6239 ptr +=2; 6158 ptr +=2;
6240 } 6159 }
6241#endif // RT2870 // 6160#endif // RT2870 //
6242 6161
6243 //
6244 // For Wi-Fi faily generated beacons between participating stations.
6245 // Set TBTT phase adaptive adjustment step to 8us (default 16us)
6246 // don't change settings 2006-5- by Jerry
6247 //RTMP_IO_WRITE32(pAd, TBTT_SYNC_CFG, 0x00001010);
6248
6249 // start sending BEACON 6162 // start sending BEACON
6250 csr9.field.BeaconInterval = pAd->CommonCfg.BeaconPeriod << 4; // ASIC register in units of 1/16 TU 6163 csr9.field.BeaconInterval = pAd->CommonCfg.BeaconPeriod << 4; // ASIC register in units of 1/16 TU
6251 csr9.field.bTsfTicking = 1; 6164 csr9.field.bTsfTicking = 1;
@@ -6293,7 +6206,6 @@ VOID AsicSetEdcaParm(
6293 //======================================================== 6206 //========================================================
6294 // MAC Register has a copy . 6207 // MAC Register has a copy .
6295 //======================================================== 6208 //========================================================
6296//#ifndef WIFI_TEST
6297 if( pAd->CommonCfg.bEnableTxBurst ) 6209 if( pAd->CommonCfg.bEnableTxBurst )
6298 { 6210 {
6299 // For CWC test, change txop from 0x30 to 0x20 in TxBurst mode 6211 // For CWC test, change txop from 0x30 to 0x20 in TxBurst mode
@@ -6301,9 +6213,6 @@ VOID AsicSetEdcaParm(
6301 } 6213 }
6302 else 6214 else
6303 Ac0Cfg.field.AcTxop = 0; // QID_AC_BE 6215 Ac0Cfg.field.AcTxop = 0; // QID_AC_BE
6304//#else
6305// Ac0Cfg.field.AcTxop = 0; // QID_AC_BE
6306//#endif
6307 Ac0Cfg.field.Cwmin = CW_MIN_IN_BITS; 6216 Ac0Cfg.field.Cwmin = CW_MIN_IN_BITS;
6308 Ac0Cfg.field.Cwmax = CW_MAX_IN_BITS; 6217 Ac0Cfg.field.Cwmax = CW_MAX_IN_BITS;
6309 Ac0Cfg.field.Aifsn = 2; 6218 Ac0Cfg.field.Aifsn = 2;
@@ -6807,18 +6716,14 @@ VOID AsicAddKeyEntry(
6807 IN BOOLEAN bTxKey) 6716 IN BOOLEAN bTxKey)
6808{ 6717{
6809 ULONG offset; 6718 ULONG offset;
6810// ULONG WCIDAttri = 0;
6811 UCHAR IV4 = 0; 6719 UCHAR IV4 = 0;
6812 PUCHAR pKey = pCipherKey->Key; 6720 PUCHAR pKey = pCipherKey->Key;
6813// ULONG KeyLen = pCipherKey->KeyLen;
6814 PUCHAR pTxMic = pCipherKey->TxMic; 6721 PUCHAR pTxMic = pCipherKey->TxMic;
6815 PUCHAR pRxMic = pCipherKey->RxMic; 6722 PUCHAR pRxMic = pCipherKey->RxMic;
6816 PUCHAR pTxtsc = pCipherKey->TxTsc; 6723 PUCHAR pTxtsc = pCipherKey->TxTsc;
6817 UCHAR CipherAlg = pCipherKey->CipherAlg; 6724 UCHAR CipherAlg = pCipherKey->CipherAlg;
6818 SHAREDKEY_MODE_STRUC csr1; 6725 SHAREDKEY_MODE_STRUC csr1;
6819 6726
6820// ASSERT(KeyLen <= MAX_LEN_OF_PEER_KEY);
6821
6822 DBGPRINT(RT_DEBUG_TRACE, ("==> AsicAddKeyEntry\n")); 6727 DBGPRINT(RT_DEBUG_TRACE, ("==> AsicAddKeyEntry\n"));
6823 // 6728 //
6824 // 1.) decide key table offset 6729 // 1.) decide key table offset
@@ -7561,18 +7466,6 @@ VOID APSDPeriodicExec(
7561 7466
7562 pAd->CommonCfg.TriggerTimerCount++; 7467 pAd->CommonCfg.TriggerTimerCount++;
7563 7468
7564// Driver should not send trigger frame, it should be send by application layer
7565/*
7566 if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable
7567 && (pAd->CommonCfg.bNeedSendTriggerFrame ||
7568 (((pAd->CommonCfg.TriggerTimerCount%20) == 19) && (!pAd->CommonCfg.bAPSDAC_BE || !pAd->CommonCfg.bAPSDAC_BK || !pAd->CommonCfg.bAPSDAC_VI || !pAd->CommonCfg.bAPSDAC_VO))))
7569 {
7570 DBGPRINT(RT_DEBUG_TRACE,("Sending trigger frame and enter service period when support APSD\n"));
7571 RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
7572 pAd->CommonCfg.bNeedSendTriggerFrame = FALSE;
7573 pAd->CommonCfg.TriggerTimerCount = 0;
7574 pAd->CommonCfg.bInServicePeriod = TRUE;
7575 }*/
7576} 7469}
7577 7470
7578/* 7471/*
diff --git a/drivers/staging/rt2870/common/rtmp_init.c b/drivers/staging/rt2870/common/rtmp_init.c
index 534645af815d..69de5a34a111 100644
--- a/drivers/staging/rt2870/common/rtmp_init.c
+++ b/drivers/staging/rt2870/common/rtmp_init.c
@@ -176,12 +176,10 @@ RTMP_REG_PAIR MACRegTable[] = {
176 {TX_SW_CFG0, 0x0}, // Gary,2008-05-21 for CWC test 176 {TX_SW_CFG0, 0x0}, // Gary,2008-05-21 for CWC test
177 {TX_SW_CFG1, 0x80606}, // Gary,2006-08-23 177 {TX_SW_CFG1, 0x80606}, // Gary,2006-08-23
178 {TX_LINK_CFG, 0x1020}, // Gary,2006-08-23 178 {TX_LINK_CFG, 0x1020}, // Gary,2006-08-23
179 //{TX_TIMEOUT_CFG, 0x00182090}, // CCK has some problem. So increase timieout value. 2006-10-09// MArvek RT
180 {TX_TIMEOUT_CFG, 0x000a2090}, // CCK has some problem. So increase timieout value. 2006-10-09// MArvek RT , Modify for 2860E ,2007-08-01 179 {TX_TIMEOUT_CFG, 0x000a2090}, // CCK has some problem. So increase timieout value. 2006-10-09// MArvek RT , Modify for 2860E ,2007-08-01
181 {MAX_LEN_CFG, MAX_AGGREGATION_SIZE | 0x00001000}, // 0x3018, MAX frame length. Max PSDU = 16kbytes. 180 {MAX_LEN_CFG, MAX_AGGREGATION_SIZE | 0x00001000}, // 0x3018, MAX frame length. Max PSDU = 16kbytes.
182 {LED_CFG, 0x7f031e46}, // Gary, 2006-08-23 181 {LED_CFG, 0x7f031e46}, // Gary, 2006-08-23
183 {PBF_MAX_PCNT, 0x1F3FBF9F}, //0x1F3f7f9f}, //Jan, 2006/04/20 182 {PBF_MAX_PCNT, 0x1F3FBF9F}, //0x1F3f7f9f}, //Jan, 2006/04/20
184 //{TX_RTY_CFG, 0x6bb80408}, // Jan, 2006/11/16
185 {TX_RTY_CFG, 0x47d01f0f}, // Jan, 2006/11/16, Set TxWI->ACK =0 in Probe Rsp Modify for 2860E ,2007-08-03 183 {TX_RTY_CFG, 0x47d01f0f}, // Jan, 2006/11/16, Set TxWI->ACK =0 in Probe Rsp Modify for 2860E ,2007-08-03
186 {AUTO_RSP_CFG, 0x00000013}, // Initial Auto_Responder, because QA will turn off Auto-Responder 184 {AUTO_RSP_CFG, 0x00000013}, // Initial Auto_Responder, because QA will turn off Auto-Responder
187 {CCK_PROT_CFG, 0x05740003 /*0x01740003*/}, // Initial Auto_Responder, because QA will turn off Auto-Responder. And RTS threshold is enabled. 185 {CCK_PROT_CFG, 0x05740003 /*0x01740003*/}, // Initial Auto_Responder, because QA will turn off Auto-Responder. And RTS threshold is enabled.
@@ -196,11 +194,7 @@ RTMP_REG_PAIR MACRegTable[] = {
196 {MM20_PROT_CFG, 0x01744004}, 194 {MM20_PROT_CFG, 0x01744004},
197 {TXOP_CTRL_CFG, 0x0000583f, /*0x0000243f*/ /*0x000024bf*/}, //Extension channel backoff. 195 {TXOP_CTRL_CFG, 0x0000583f, /*0x0000243f*/ /*0x000024bf*/}, //Extension channel backoff.
198 {TX_RTS_CFG, 0x00092b20}, 196 {TX_RTS_CFG, 0x00092b20},
199//#ifdef WIFI_TEST
200 {EXP_ACK_TIME, 0x002400ca}, // default value 197 {EXP_ACK_TIME, 0x002400ca}, // default value
201//#else
202// {EXP_ACK_TIME, 0x005400ca}, // suggested by Gray @ 20070323 for 11n intel-sta throughput
203//#endif // end - WIFI_TEST //
204 {TXOP_HLDR_ET, 0x00000002}, 198 {TXOP_HLDR_ET, 0x00000002},
205 199
206 /* Jerry comments 2008/01/16: we use SIFS = 10us in CCK defaultly, but it seems that 10us 200 /* Jerry comments 2008/01/16: we use SIFS = 10us in CCK defaultly, but it seems that 10us
@@ -877,8 +871,6 @@ VOID RTMPReadChannelPwr(
877 // 0. 11b/g, ch1 - ch 14 871 // 0. 11b/g, ch1 - ch 14
878 for (i = 0; i < 7; i++) 872 for (i = 0; i < 7; i++)
879 { 873 {
880// Power.word = RTMP_EEPROM_READ16(pAd, EEPROM_G_TX_PWR_OFFSET + i * 2);
881// Power2.word = RTMP_EEPROM_READ16(pAd, EEPROM_G_TX2_PWR_OFFSET + i * 2);
882 RT28xx_EEPROM_READ16(pAd, EEPROM_G_TX_PWR_OFFSET + i * 2, Power.word); 874 RT28xx_EEPROM_READ16(pAd, EEPROM_G_TX_PWR_OFFSET + i * 2, Power.word);
883 RT28xx_EEPROM_READ16(pAd, EEPROM_G_TX2_PWR_OFFSET + i * 2, Power2.word); 875 RT28xx_EEPROM_READ16(pAd, EEPROM_G_TX2_PWR_OFFSET + i * 2, Power2.word);
884 pAd->TxPower[i * 2].Channel = i * 2 + 1; 876 pAd->TxPower[i * 2].Channel = i * 2 + 1;
@@ -926,8 +918,6 @@ VOID RTMPReadChannelPwr(
926 // 1.2 Fill up power 918 // 1.2 Fill up power
927 for (i = 0; i < 6; i++) 919 for (i = 0; i < 6; i++)
928 { 920 {
929// Power.word = RTMP_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + i * 2);
930// Power2.word = RTMP_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + i * 2);
931 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + i * 2, Power.word); 921 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + i * 2, Power.word);
932 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + i * 2, Power2.word); 922 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + i * 2, Power2.word);
933 923
@@ -968,8 +958,6 @@ VOID RTMPReadChannelPwr(
968 // 2.2 Fill up power 958 // 2.2 Fill up power
969 for (i = 0; i < 8; i++) 959 for (i = 0; i < 8; i++)
970 { 960 {
971// Power.word = RTMP_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + (choffset - 14) + i * 2);
972// Power2.word = RTMP_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + (choffset - 14) + i * 2);
973 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + (choffset - 14) + i * 2, Power.word); 961 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + (choffset - 14) + i * 2, Power.word);
974 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + (choffset - 14) + i * 2, Power2.word); 962 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + (choffset - 14) + i * 2, Power2.word);
975 963
@@ -1010,8 +998,6 @@ VOID RTMPReadChannelPwr(
1010 // 3.2 Fill up power 998 // 3.2 Fill up power
1011 for (i = 0; i < 4; i++) 999 for (i = 0; i < 4; i++)
1012 { 1000 {
1013// Power.word = RTMP_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + (choffset - 14) + i * 2);
1014// Power2.word = RTMP_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + (choffset - 14) + i * 2);
1015 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + (choffset - 14) + i * 2, Power.word); 1001 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + (choffset - 14) + i * 2, Power.word);
1016 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + (choffset - 14) + i * 2, Power2.word); 1002 RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + (choffset - 14) + i * 2, Power2.word);
1017 1003
@@ -1337,20 +1323,6 @@ VOID NICReadEEPROMParameters(
1337 1323
1338 1324
1339 { 1325 {
1340#if 0
1341 USHORT Addr01,Addr23,Addr45 ;
1342
1343 Addr01=RTMP_EEPROM_READ16(pAd, 0x04);
1344 Addr23=RTMP_EEPROM_READ16(pAd, 0x06);
1345 Addr45=RTMP_EEPROM_READ16(pAd, 0x08);
1346
1347 pAd->PermanentAddress[0] = (UCHAR)(Addr01 & 0xff);
1348 pAd->PermanentAddress[1] = (UCHAR)(Addr01 >> 8);
1349 pAd->PermanentAddress[2] = (UCHAR)(Addr23 & 0xff);
1350 pAd->PermanentAddress[3] = (UCHAR)(Addr23 >> 8);
1351 pAd->PermanentAddress[4] = (UCHAR)(Addr45 & 0xff);
1352 pAd->PermanentAddress[5] = (UCHAR)(Addr45 >> 8);
1353#endif
1354 //more conveninet to test mbssid, so ap's bssid &0xf1 1326 //more conveninet to test mbssid, so ap's bssid &0xf1
1355 if (pAd->PermanentAddress[0] == 0xff) 1327 if (pAd->PermanentAddress[0] == 0xff)
1356 pAd->PermanentAddress[0] = RandomByte(pAd)&0xf8; 1328 pAd->PermanentAddress[0] = RandomByte(pAd)&0xf8;
@@ -1751,7 +1723,6 @@ VOID NICInitAsicFromEEPROM(
1751 { 1723 {
1752 pAd->StaCfg.bHwRadio = FALSE; 1724 pAd->StaCfg.bHwRadio = FALSE;
1753 pAd->StaCfg.bRadio = FALSE; 1725 pAd->StaCfg.bRadio = FALSE;
1754// RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0x00001818);
1755 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF); 1726 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
1756 } 1727 }
1757 } 1728 }
@@ -1771,7 +1742,6 @@ VOID NICInitAsicFromEEPROM(
1771 // Turn off patching for cardbus controller 1742 // Turn off patching for cardbus controller
1772 if (NicConfig2.field.CardbusAcceleration == 1) 1743 if (NicConfig2.field.CardbusAcceleration == 1)
1773 { 1744 {
1774// pAd->bTest1 = TRUE;
1775 } 1745 }
1776 1746
1777 if (NicConfig2.field.DynamicTxAgcControl == 1) 1747 if (NicConfig2.field.DynamicTxAgcControl == 1)
@@ -1840,7 +1810,6 @@ NDIS_STATUS NICInitializeAdapter(
1840{ 1810{
1841 NDIS_STATUS Status = NDIS_STATUS_SUCCESS; 1811 NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
1842 WPDMA_GLO_CFG_STRUC GloCfg; 1812 WPDMA_GLO_CFG_STRUC GloCfg;
1843// INT_MASK_CSR_STRUC IntMask;
1844 ULONG i =0, j=0; 1813 ULONG i =0, j=0;
1845 AC_TXOP_CSR0_STRUC csr0; 1814 AC_TXOP_CSR0_STRUC csr0;
1846 1815
@@ -2129,10 +2098,6 @@ NDIS_STATUS NICInitializeAsic(
2129 } 2098 }
2130 } 2099 }
2131 2100
2132 // assert HOST ready bit
2133// RTMP_IO_WRITE32(pAd, MAC_CSR1, 0x0); // 2004-09-14 asked by Mark
2134// RTMP_IO_WRITE32(pAd, MAC_CSR1, 0x4);
2135
2136 // It isn't necessary to clear this space when not hard reset. 2101 // It isn't necessary to clear this space when not hard reset.
2137 if (bHardReset == TRUE) 2102 if (bHardReset == TRUE)
2138 { 2103 {
@@ -2194,9 +2159,6 @@ VOID NICIssueReset(
2194 UINT32 Value = 0; 2159 UINT32 Value = 0;
2195 DBGPRINT(RT_DEBUG_TRACE, ("--> NICIssueReset\n")); 2160 DBGPRINT(RT_DEBUG_TRACE, ("--> NICIssueReset\n"));
2196 2161
2197 // Abort Tx, prevent ASIC from writing to Host memory
2198 //RTMP_IO_WRITE32(pAd, TX_CNTL_CSR, 0x001f0000);
2199
2200 // Disable Rx, register value supposed will remain after reset 2162 // Disable Rx, register value supposed will remain after reset
2201 RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value); 2163 RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
2202 Value &= (0xfffffff3); 2164 Value &= (0xfffffff3);
@@ -2280,10 +2242,6 @@ VOID NICUpdateFifoStaCounters(
2280 if (pEntry->FIFOCount >= 1) 2242 if (pEntry->FIFOCount >= 1)
2281 { 2243 {
2282 DBGPRINT(RT_DEBUG_TRACE, ("#")); 2244 DBGPRINT(RT_DEBUG_TRACE, ("#"));
2283#if 0
2284 SendRefreshBAR(pAd, pEntry);
2285 pEntry->NoBADataCountDown = 64;
2286#else
2287 pEntry->NoBADataCountDown = 64; 2245 pEntry->NoBADataCountDown = 64;
2288 2246
2289 if(pEntry->PsMode == PWR_ACTIVE) 2247 if(pEntry->PsMode == PWR_ACTIVE)
@@ -2304,10 +2262,7 @@ VOID NICUpdateFifoStaCounters(
2304 pEntry->FIFOCount = 0; 2262 pEntry->FIFOCount = 0;
2305 pEntry->ContinueTxFailCnt = 0; 2263 pEntry->ContinueTxFailCnt = 0;
2306 } 2264 }
2307#endif
2308 //pEntry->FIFOCount = 0;
2309 } 2265 }
2310 //pEntry->bSendBAR = TRUE;
2311 } 2266 }
2312 else 2267 else
2313 { 2268 {
@@ -2431,7 +2386,6 @@ VOID NICUpdateRawCounters(
2431 // Update RX Overflow counter 2386 // Update RX Overflow counter
2432 pAd->Counters8023.RxNoBuffer += (RxStaCnt2.field.RxFifoOverflowCount); 2387 pAd->Counters8023.RxNoBuffer += (RxStaCnt2.field.RxFifoOverflowCount);
2433 2388
2434 //pAd->RalinkCounters.RxCount = 0;
2435#ifdef RT2870 2389#ifdef RT2870
2436 if (pAd->RalinkCounters.RxCount != pAd->watchDogRxCnt) 2390 if (pAd->RalinkCounters.RxCount != pAd->watchDogRxCnt)
2437 { 2391 {
@@ -2448,8 +2402,6 @@ VOID NICUpdateRawCounters(
2448#endif // RT2870 // 2402#endif // RT2870 //
2449 2403
2450 2404
2451 //if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED) ||
2452 // (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED) && (pAd->MacTab.Size != 1)))
2453 if (!pAd->bUpdateBcnCntDone) 2405 if (!pAd->bUpdateBcnCntDone)
2454 { 2406 {
2455 // Update BEACON sent count 2407 // Update BEACON sent count
@@ -2465,21 +2417,6 @@ VOID NICUpdateRawCounters(
2465 pAd->WlanCounters.FailedCount.u.LowPart += TxStaCnt0.field.TxFailCount; 2417 pAd->WlanCounters.FailedCount.u.LowPart += TxStaCnt0.field.TxFailCount;
2466 } 2418 }
2467 2419
2468#if 0
2469 Retry = StaTx1.field.TxRetransmit;
2470 Fail = TxStaCnt0.field.TxFailCount;
2471 TxErrorRatio = 0;
2472 OneSecTransmitCount = pAd->WlanCounters.TransmittedFragmentCount.u.LowPart- pAd->WlanCounters.LastTransmittedFragmentCount.u.LowPart;
2473 if ((OneSecTransmitCount+Retry + Fail) > 0)
2474 TxErrorRatio = (( Retry + Fail) *100) / (OneSecTransmitCount+Retry + Fail);
2475
2476 if ((OneSecTransmitCount+Retry + Fail) > 0)
2477 TxErrorRatio = (( Retry + Fail) *100) / (OneSecTransmitCount+Retry + Fail);
2478 DBGPRINT(RT_DEBUG_INFO, ("TX ERROR Rate = %ld %%, Retry = %ld, Fail = %ld, Total = %ld \n",TxErrorRatio, Retry, Fail, (OneSecTransmitCount+Retry + Fail)));
2479 pAd->WlanCounters.LastTransmittedFragmentCount.u.LowPart = pAd->WlanCounters.TransmittedFragmentCount.u.LowPart;
2480#endif
2481
2482 //if (pAd->bStaFifoTest == TRUE)
2483 { 2420 {
2484 RTMP_IO_READ32(pAd, TX_AGG_CNT, &TxAggCnt.word); 2421 RTMP_IO_READ32(pAd, TX_AGG_CNT, &TxAggCnt.word);
2485 RTMP_IO_READ32(pAd, TX_AGG_CNT0, &TxAggCnt0.word); 2422 RTMP_IO_READ32(pAd, TX_AGG_CNT0, &TxAggCnt0.word);
@@ -2593,7 +2530,7 @@ VOID NICUpdateRawCounters(
2593 pDiag->TxFailCnt[ArrayCurIdx] = 0; 2530 pDiag->TxFailCnt[ArrayCurIdx] = 0;
2594 pDiag->RxDataCnt[ArrayCurIdx] = 0; 2531 pDiag->RxDataCnt[ArrayCurIdx] = 0;
2595 pDiag->RxCrcErrCnt[ArrayCurIdx] = 0; 2532 pDiag->RxCrcErrCnt[ArrayCurIdx] = 0;
2596// for (i = 9; i < 16; i++) 2533
2597 for (i = 9; i < 24; i++) // 3*3 2534 for (i = 9; i < 24; i++) // 3*3
2598 { 2535 {
2599 pDiag->TxDescCnt[ArrayCurIdx][i] = 0; 2536 pDiag->TxDescCnt[ArrayCurIdx][i] = 0;
@@ -2732,24 +2669,7 @@ NDIS_STATUS NICLoadFirmware(
2732 2669
2733#endif // RT2870 // 2670#endif // RT2870 //
2734 2671
2735#if 0
2736 /* enable Host program ram write selection */
2737 RT28XX_FIRMUD_INIT(pAd);
2738
2739 for(i=0; i<FileLength; i+=4)
2740 {
2741 firm = pFirmwareImage[i] +
2742 (pFirmwareImage[i+3] << 24) +
2743 (pFirmwareImage[i+2] << 16) +
2744 (pFirmwareImage[i+1] << 8);
2745
2746 RTMP_IO_WRITE32(pAd, FIRMWARE_IMAGE_BASE + i, firm);
2747 } /* End of for */
2748
2749 RT28XX_FIRMUD_END(pAd);
2750#else
2751 RT28XX_WRITE_FIRMWARE(pAd, pFirmwareImage, FileLength); 2672 RT28XX_WRITE_FIRMWARE(pAd, pFirmwareImage, FileLength);
2752#endif
2753 2673
2754 /* check if MCU is ready */ 2674 /* check if MCU is ready */
2755 Index = 0; 2675 Index = 0;
@@ -2769,13 +2689,9 @@ NDIS_STATUS NICLoadFirmware(
2769 DBGPRINT(RT_DEBUG_ERROR, ("NICLoadFirmware: MCU is not ready\n\n\n")); 2689 DBGPRINT(RT_DEBUG_ERROR, ("NICLoadFirmware: MCU is not ready\n\n\n"));
2770 } /* End of if */ 2690 } /* End of if */
2771 2691
2772#if 0
2773 DBGPRINT(RT_DEBUG_TRACE,
2774 ("<=== %s (src=%s, status=%d)\n", __func__, src, Status));
2775#else
2776 DBGPRINT(RT_DEBUG_TRACE, 2692 DBGPRINT(RT_DEBUG_TRACE,
2777 ("<=== %s (status=%d)\n", __func__, Status)); 2693 ("<=== %s (status=%d)\n", __func__, Status));
2778#endif 2694
2779 return Status; 2695 return Status;
2780} /* End of NICLoadFirmware */ 2696} /* End of NICLoadFirmware */
2781 2697
@@ -2804,81 +2720,6 @@ NDIS_STATUS NICLoadFirmware(
2804NDIS_STATUS NICLoadRateSwitchingParams( 2720NDIS_STATUS NICLoadRateSwitchingParams(
2805 IN PRTMP_ADAPTER pAd) 2721 IN PRTMP_ADAPTER pAd)
2806{ 2722{
2807#if 0
2808 NDIS_STATUS Status;
2809
2810 NDIS_HANDLE FileHandle;
2811 UINT FileLength = 0, i, j;
2812 PUCHAR pFirmwareImage;
2813 NDIS_STRING FileName;
2814 NDIS_PHYSICAL_ADDRESS HighestAcceptableMax = NDIS_PHYSICAL_ADDRESS_CONST(-1, -1);
2815
2816 DBGPRINT(RT_DEBUG_TRACE,("===> NICLoadRateSwitchingParams \n"));
2817 pAd->CommonCfg.TxRateTableSize = 0;
2818
2819 if ((pAd->DeviceID == NIC2860_PCI_DEVICE_ID) || (pAd->DeviceID == NIC2860_PCIe_DEVICE_ID))
2820 {
2821 NdisInitializeString(&FileName,"rate.bin");
2822 DBGPRINT(RT_DEBUG_TRACE, ("NICLoadRateSwitchingParams: load file - rate.bin for tx rate switch \n"));
2823 }
2824 else
2825 {
2826 DBGPRINT_ERR(("NICLoadRateSwitchingParams: wrong DeviceID = 0x%04x, can't find Tx rate switch parameters file\n", pAd->DeviceID));
2827 return NDIS_STATUS_SUCCESS;
2828 }
2829 NdisOpenFile(&Status, &FileHandle, &FileLength, &FileName, HighestAcceptableMax);
2830 NdisFreeString(FileName);
2831
2832 if (Status != NDIS_STATUS_SUCCESS)
2833 {
2834 DBGPRINT(RT_DEBUG_ERROR, ("NICLoadRateSwitchingParams: NdisOpenFile() failed, used RateSwitchTable instead\n"));
2835 return NDIS_STATUS_SUCCESS;
2836 }
2837
2838 if ((FileLength == 0) || (FileLength > (MAX_STEP_OF_TX_RATE_SWITCH+1)*16))
2839 {
2840 DBGPRINT(RT_DEBUG_ERROR, ("NICLoadRateSwitchingParams: file size is not reasonable, used RateSwitchTable instead\n"));
2841
2842 NdisCloseFile(FileHandle);
2843 return NDIS_STATUS_SUCCESS;
2844 }
2845 else
2846 {
2847 //
2848 // NDIS_STATUS_SUCCESS means
2849 // The handle at FileHandle is valid for a subsequent call to NdisMapFile.
2850 //
2851 NdisMapFile(&Status, &pFirmwareImage, FileHandle);
2852 DBGPRINT(RT_DEBUG_TRACE, ("NdisMapFile FileLength=%d\n", FileLength));
2853 }
2854
2855 for (i=0, j=0; i<FileLength; i++)
2856 {
2857 if ((i%16) <= 4) // trim reserved field
2858 {
2859 if (i%16 == 1) // deal with DEC and HEX, only row0 is Hex, others are Dec
2860 {
2861 RateSwitchTable[j] = *(pFirmwareImage + i);
2862 }
2863 else
2864 {
2865 RateSwitchTable[j] = (*(pFirmwareImage + i)>>4) * 10 + (*(pFirmwareImage + i) & 0x0F);
2866 }
2867
2868 j++;
2869 }
2870 }
2871
2872 pAd->CommonCfg.TxRateTableSize = RateSwitchTable[0]; // backup table size
2873
2874 if (Status == NDIS_STATUS_SUCCESS)
2875 {
2876 NdisUnmapFile(FileHandle);
2877 NdisCloseFile(FileHandle);
2878 }
2879
2880 DBGPRINT(RT_DEBUG_TRACE,("<=== NICLoadRateSwitchingParams(Valid TxRateTable item number=%d)\n", pAd->CommonCfg.TxRateTableSize));
2881#endif
2882 return NDIS_STATUS_SUCCESS; 2723 return NDIS_STATUS_SUCCESS;
2883} 2724}
2884 2725
@@ -3087,7 +2928,6 @@ VOID RTMPMoveMemory(
3087VOID UserCfgInit( 2928VOID UserCfgInit(
3088 IN PRTMP_ADAPTER pAd) 2929 IN PRTMP_ADAPTER pAd)
3089{ 2930{
3090// EDCA_PARM DefaultEdcaParm;
3091 UINT key_index, bss_index; 2931 UINT key_index, bss_index;
3092 2932
3093 DBGPRINT(RT_DEBUG_TRACE, ("--> UserCfgInit\n")); 2933 DBGPRINT(RT_DEBUG_TRACE, ("--> UserCfgInit\n"));
@@ -3331,17 +3171,11 @@ VOID UserCfgInit(
3331 pAd->Bbp94 = BBPR94_DEFAULT; 3171 pAd->Bbp94 = BBPR94_DEFAULT;
3332 pAd->BbpForCCK = FALSE; 3172 pAd->BbpForCCK = FALSE;
3333 3173
3334 // Default is FALSE for test bit 1
3335 //pAd->bTest1 = FALSE;
3336
3337 // initialize MAC table and allocate spin lock 3174 // initialize MAC table and allocate spin lock
3338 NdisZeroMemory(&pAd->MacTab, sizeof(MAC_TABLE)); 3175 NdisZeroMemory(&pAd->MacTab, sizeof(MAC_TABLE));
3339 InitializeQueueHeader(&pAd->MacTab.McastPsQueue); 3176 InitializeQueueHeader(&pAd->MacTab.McastPsQueue);
3340 NdisAllocateSpinLock(&pAd->MacTabLock); 3177 NdisAllocateSpinLock(&pAd->MacTabLock);
3341 3178
3342 //RTMPInitTimer(pAd, &pAd->RECBATimer, RECBATimerTimeout, pAd, TRUE);
3343 //RTMPSetTimer(&pAd->RECBATimer, REORDER_EXEC_INTV);
3344
3345 pAd->CommonCfg.bWiFiTest = FALSE; 3179 pAd->CommonCfg.bWiFiTest = FALSE;
3346 3180
3347 3181
@@ -3757,35 +3591,10 @@ VOID RTMPSetSignalLED(
3757VOID RTMPEnableRxTx( 3591VOID RTMPEnableRxTx(
3758 IN PRTMP_ADAPTER pAd) 3592 IN PRTMP_ADAPTER pAd)
3759{ 3593{
3760// WPDMA_GLO_CFG_STRUC GloCfg;
3761// ULONG i = 0;
3762
3763 DBGPRINT(RT_DEBUG_TRACE, ("==> RTMPEnableRxTx\n")); 3594 DBGPRINT(RT_DEBUG_TRACE, ("==> RTMPEnableRxTx\n"));
3764 3595
3765#if 0
3766 // Enable Rx DMA.
3767 RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x4);
3768 do
3769 {
3770 RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word);
3771 if ((GloCfg.field.TxDMABusy == 0) && (GloCfg.field.RxDMABusy == 0))
3772 break;
3773
3774 DBGPRINT(RT_DEBUG_TRACE, ("==> DMABusy\n"));
3775 RTMPusecDelay(1000);
3776 i++;
3777 }while ( i <200);
3778
3779 RTMPusecDelay(50);
3780 RT28XX_DMA_WRITE_INIT(GloCfg);
3781 DBGPRINT(RT_DEBUG_TRACE, ("<== WRITE DMA offset 0x208 = 0x%x\n", GloCfg.word));
3782 RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, GloCfg.word);
3783
3784 RT28XX_DMA_POST_WRITE(pAd);
3785#else
3786 // Enable Rx DMA. 3596 // Enable Rx DMA.
3787 RT28XXDMAEnable(pAd); 3597 RT28XXDMAEnable(pAd);
3788#endif
3789 3598
3790 // enable RX of MAC block 3599 // enable RX of MAC block
3791 if (pAd->OpMode == OPMODE_AP) 3600 if (pAd->OpMode == OPMODE_AP)
diff --git a/drivers/staging/rt2870/common/rtmp_tkip.c b/drivers/staging/rt2870/common/rtmp_tkip.c
index 61f4020aee88..161d203b2382 100644
--- a/drivers/staging/rt2870/common/rtmp_tkip.c
+++ b/drivers/staging/rt2870/common/rtmp_tkip.c
@@ -464,7 +464,6 @@ VOID RTMPInitTkipEngine(
464 tkipIv.IV16.field.rc2 = *pTSC; 464 tkipIv.IV16.field.rc2 = *pTSC;
465 tkipIv.IV16.field.CONTROL.field.ExtIV = 1; // 0: non-extended IV, 1: an extended IV 465 tkipIv.IV16.field.CONTROL.field.ExtIV = 1; // 0: non-extended IV, 1: an extended IV
466 tkipIv.IV16.field.CONTROL.field.KeyID = KeyId; 466 tkipIv.IV16.field.CONTROL.field.KeyID = KeyId;
467// tkipIv.IV32 = *(PULONG)(pTSC + 2);
468 NdisMoveMemory(&tkipIv.IV32, (pTSC + 2), 4); // Copy IV 467 NdisMoveMemory(&tkipIv.IV32, (pTSC + 2), 4); // Copy IV
469 468
470 *pIV16 = tkipIv.IV16.word; 469 *pIV16 = tkipIv.IV16.word;
@@ -1211,11 +1210,9 @@ BOOLEAN RTMPSoftDecryptTKIP(
1211 if (!NdisEqualMemory(MIC, TrailMIC, 8)) 1210 if (!NdisEqualMemory(MIC, TrailMIC, 8))
1212 { 1211 {
1213 DBGPRINT(RT_DEBUG_ERROR, ("RTMPSoftDecryptTKIP, WEP Data MIC Error !\n")); //MIC error. 1212 DBGPRINT(RT_DEBUG_ERROR, ("RTMPSoftDecryptTKIP, WEP Data MIC Error !\n")); //MIC error.
1214 //RTMPReportMicError(pAd, &pWpaKey[KeyID]); // marked by AlbertY @ 20060630
1215 return (FALSE); 1213 return (FALSE);
1216 } 1214 }
1217 1215
1218 //DBGPRINT(RT_DEBUG_TRACE, "RTMPSoftDecryptTKIP Decript done!!\n");
1219 return TRUE; 1216 return TRUE;
1220} 1217}
1221 1218
diff --git a/drivers/staging/rt2870/common/rtmp_wep.c b/drivers/staging/rt2870/common/rtmp_wep.c
index 7c61fbad6ebd..8e833e7011bd 100644
--- a/drivers/staging/rt2870/common/rtmp_wep.c
+++ b/drivers/staging/rt2870/common/rtmp_wep.c
@@ -106,15 +106,6 @@ UINT FCSTAB_32[256] =
106}; 106};
107 107
108/* 108/*
109UCHAR WEPKEY[] = {
110 //IV
111 0x00, 0x11, 0x22,
112 //WEP KEY
113 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC
114 };
115 */
116
117/*
118 ======================================================================== 109 ========================================================================
119 110
120 Routine Description: 111 Routine Description:
diff --git a/drivers/staging/rt2870/common/rtusb_bulk.c b/drivers/staging/rt2870/common/rtusb_bulk.c
index 91ff1747932c..de8b0849bb42 100644
--- a/drivers/staging/rt2870/common/rtusb_bulk.c
+++ b/drivers/staging/rt2870/common/rtusb_bulk.c
@@ -448,115 +448,6 @@ VOID RTUSBBulkOutDataPacket(
448 448
449VOID RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs) 449VOID RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs)
450{ 450{
451#if 0 // sample, IRQ LOCK
452 PRTMP_ADAPTER pAd;
453 POS_COOKIE pObj;
454 PHT_TX_CONTEXT pHTTXContext;
455 UCHAR BulkOutPipeId;
456 NTSTATUS Status;
457 unsigned long IrqFlags;
458
459 DBGPRINT_RAW(RT_DEBUG_INFO, ("--->RTUSBBulkOutDataPacketComplete\n"));
460
461 pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
462 pAd = pHTTXContext->pAd;
463 pObj = (POS_COOKIE) pAd->OS_Cookie;
464 Status = pUrb->status;
465
466 // Store BulkOut PipeId
467 BulkOutPipeId = pHTTXContext->BulkOutPipeId;
468 pAd->BulkOutDataOneSecCount++;
469
470 //DBGPRINT(RT_DEBUG_LOUD, ("Done-B(%d):I=0x%lx, CWPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d!\n", BulkOutPipeId, in_interrupt(), pHTTXContext->CurWritePosition,
471 // pHTTXContext->NextBulkOutPosition, pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad));
472
473 RTMP_IRQ_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
474 pAd->BulkOutPending[BulkOutPipeId] = FALSE;
475 pHTTXContext->IRPPending = FALSE;
476 RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
477
478 if (Status == USB_ST_NOERROR)
479 {
480 pAd->BulkOutComplete++;
481
482 pAd->Counters8023.GoodTransmits++;
483 //RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
484 FREE_HTTX_RING(pAd, BulkOutPipeId, pHTTXContext);
485 //RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
486
487
488 }
489 else // STATUS_OTHER
490 {
491 PUCHAR pBuf;
492
493 pAd->BulkOutCompleteOther++;
494
495 pBuf = &pHTTXContext->TransferBuffer->WirelessPacket[pHTTXContext->NextBulkOutPosition];
496
497 DBGPRINT_RAW(RT_DEBUG_ERROR, ("BulkOutDataPacket failed: ReasonCode=%d!\n", Status));
498 DBGPRINT_RAW(RT_DEBUG_ERROR, (">>BulkOut Req=0x%lx, Complete=0x%lx, Other=0x%lx\n", pAd->BulkOutReq, pAd->BulkOutComplete, pAd->BulkOutCompleteOther));
499 DBGPRINT_RAW(RT_DEBUG_ERROR, (">>BulkOut Header:%x %x %x %x %x %x %x %x\n", pBuf[0], pBuf[1], pBuf[2], pBuf[3], pBuf[4], pBuf[5], pBuf[6], pBuf[7]));
500 //DBGPRINT_RAW(RT_DEBUG_ERROR, (">>BulkOutCompleteCancel=0x%x, BulkOutCompleteOther=0x%x\n", pAd->BulkOutCompleteCancel, pAd->BulkOutCompleteOther));
501
502 if (!RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
503 fRTMP_ADAPTER_HALT_IN_PROGRESS |
504 fRTMP_ADAPTER_NIC_NOT_EXIST |
505 fRTMP_ADAPTER_BULKOUT_RESET)))
506 {
507 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
508 pAd->bulkResetPipeid = BulkOutPipeId;
509 }
510 }
511
512 //
513 // bInUse = TRUE, means some process are filling TX data, after that must turn on bWaitingBulkOut
514 // bWaitingBulkOut = TRUE, means the TX data are waiting for bulk out.
515 //
516 //RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
517 if ((pHTTXContext->ENextBulkOutPosition != pHTTXContext->CurWritePosition) &&
518 (pHTTXContext->ENextBulkOutPosition != (pHTTXContext->CurWritePosition+8)) &&
519 !RTUSB_TEST_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_FRAG << BulkOutPipeId)))
520 {
521 // Indicate There is data avaliable
522 RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
523 }
524 //RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
525
526 // Always call Bulk routine, even reset bulk.
527 // The protection of rest bulk should be in BulkOut routine
528 RTUSBKickBulkOut(pAd);
529
530
531 //DBGPRINT(RT_DEBUG_LOUD,("Done-A(%d):I=0x%lx, CWPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d\n", BulkOutPipeId, in_interrupt(),
532 // pHTTXContext->CurWritePosition, pHTTXContext->NextBulkOutPosition, pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad));
533
534 switch (BulkOutPipeId)
535 {
536 case 0:
537 pObj->ac0_dma_done_task.data = (unsigned long)pAd;
538 tasklet_hi_schedule(&pObj->ac0_dma_done_task);
539 break;
540 case 1:
541 pObj->ac1_dma_done_task.data = (unsigned long)pAd;
542 tasklet_hi_schedule(&pObj->ac1_dma_done_task);
543 break;
544 case 2:
545 pObj->ac2_dma_done_task.data = (unsigned long)pAd;
546 tasklet_hi_schedule(&pObj->ac2_dma_done_task);
547 break;
548 case 3:
549 pObj->ac3_dma_done_task.data = (unsigned long)pAd;
550 tasklet_hi_schedule(&pObj->ac3_dma_done_task);
551 break;
552 case 4:
553 pObj->hcca_dma_done_task.data = (unsigned long)pAd;
554 tasklet_hi_schedule(&pObj->hcca_dma_done_task);
555 break;
556 }
557#else
558
559{
560 PHT_TX_CONTEXT pHTTXContext; 451 PHT_TX_CONTEXT pHTTXContext;
561 PRTMP_ADAPTER pAd; 452 PRTMP_ADAPTER pAd;
562 POS_COOKIE pObj; 453 POS_COOKIE pObj;
@@ -595,10 +486,6 @@ VOID RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs)
595 break; 486 break;
596 } 487 }
597} 488}
598#endif
599
600
601}
602 489
603 490
604/* 491/*
@@ -664,9 +551,6 @@ VOID RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs)
664 PRTMP_ADAPTER pAd; 551 PRTMP_ADAPTER pAd;
665 PTX_CONTEXT pNullContext; 552 PTX_CONTEXT pNullContext;
666 NTSTATUS Status; 553 NTSTATUS Status;
667#if 0 // sample, IRQ LOCK
668 unsigned long IrqFlags;
669#endif
670 POS_COOKIE pObj; 554 POS_COOKIE pObj;
671 555
672 556
@@ -674,169 +558,10 @@ VOID RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs)
674 pAd = pNullContext->pAd; 558 pAd = pNullContext->pAd;
675 Status = pUrb->status; 559 Status = pUrb->status;
676 560
677#if 0 // sample, IRQ LOCK
678 // Reset Null frame context flags
679 pNullContext->IRPPending = FALSE;
680 pNullContext->InUse = FALSE;
681
682 if (Status == USB_ST_NOERROR)
683 {
684 // Don't worry about the queue is empty or not, this function will check itself
685 //RTMPUSBDeQueuePacket(pAd, 0);
686 RTMPDeQueuePacket(pAd, TRUE, NUM_OF_TX_RING, MAX_TX_PROCESS);
687 }
688 else // STATUS_OTHER
689 {
690 if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
691 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
692 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
693 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
694 {
695 DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out Null Frame Failed\n"));
696 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
697 RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
698 }
699 }
700
701 RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], IrqFlags);
702 pAd->BulkOutPending[0] = FALSE;
703 RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], IrqFlags);
704
705 // Always call Bulk routine, even reset bulk.
706 // The protectioon of rest bulk should be in BulkOut routine
707 RTUSBKickBulkOut(pAd);
708#else
709
710 pObj = (POS_COOKIE) pAd->OS_Cookie; 561 pObj = (POS_COOKIE) pAd->OS_Cookie;
711 pObj->null_frame_complete_task.data = (unsigned long)pUrb; 562 pObj->null_frame_complete_task.data = (unsigned long)pUrb;
712 tasklet_hi_schedule(&pObj->null_frame_complete_task); 563 tasklet_hi_schedule(&pObj->null_frame_complete_task);
713#endif
714
715}
716
717#if 0 // For RT2870, RTS frame not used now, but maybe will use it latter.
718/*
719 ========================================================================
720
721 Routine Description:
722
723 Arguments:
724
725 Return Value:
726
727 Note: RTS frame use BulkOutPipeId = 0
728
729 ========================================================================
730*/
731VOID RTUSBBulkOutRTSFrame(
732 IN PRTMP_ADAPTER pAd)
733{
734 PTX_CONTEXT pRTSContext = &(pAd->RTSContext);
735 PURB pUrb;
736 int ret = 0;
737 unsigned long IrqFlags;
738 UCHAR PipeID=0;
739
740 if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL_4))
741 PipeID= 3;
742 else if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL_3))
743 PipeID= 2;
744 else if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL_2))
745 PipeID= 1;
746 else if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL))
747 PipeID= 0;
748
749 RTMP_IRQ_LOCK(&pAd->BulkOutLock[PipeID], IrqFlags);
750 if ((pAd->BulkOutPending[PipeID] == TRUE) || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX))
751 {
752 RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[PipeID], IrqFlags);
753 return;
754 }
755 pAd->BulkOutPending[PipeID] = TRUE;
756 RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[PipeID], IrqFlags);
757
758 // Increase Total transmit byte counter
759 pAd->RalinkCounters.TransmittedByteCount += pRTSContext->BulkOutSize;
760
761 DBGPRINT_RAW(RT_DEBUG_INFO, ("--->RTUSBBulkOutRTSFrame \n"));
762
763 // Clear RTS frame bulk flag
764 RTUSB_CLEAR_BULK_FLAG(pAd, fRTUSB_BULK_OUT_RTS);
765
766 // Init Tx context descriptor
767 RTUSBInitTxDesc(pAd, pRTSContext, PipeID, (usb_complete_t)RTUSBBulkOutRTSFrameComplete);
768 pRTSContext->IRPPending = TRUE;
769
770 pUrb = pRTSContext->pUrb;
771 if((ret = RTUSB_SUBMIT_URB(pUrb))!=0)
772 {
773 DBGPRINT(RT_DEBUG_ERROR, ("RTUSBBulkOutRTSFrame: Submit Tx URB failed %d\n", ret));
774 return;
775 }
776
777 DBGPRINT_RAW(RT_DEBUG_INFO, ("<---RTUSBBulkOutRTSFrame \n"));
778
779}
780
781// RTS frame use BulkOutPipeId = 0
782VOID RTUSBBulkOutRTSFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs)
783{
784 PRTMP_ADAPTER pAd;
785 PTX_CONTEXT pRTSContext;
786 NTSTATUS Status;
787#if 0 // sample, IRQ LOCK
788 unsigned long IrqFlags;
789#endif
790 POS_COOKIE pObj;
791
792 DBGPRINT_RAW(RT_DEBUG_INFO, ("--->RTUSBBulkOutRTSFrameComplete\n"));
793
794 pRTSContext = (PTX_CONTEXT)pUrb->context;
795 pAd = pRTSContext->pAd;
796 Status = pUrb->status;
797
798#if 0 // sample, IRQ LOCK
799 // Reset RTS frame context flags
800 pRTSContext->IRPPending = FALSE;
801 pRTSContext->InUse = FALSE;
802
803 if (Status == USB_ST_NOERROR)
804 {
805 // Don't worry about the queue is empty or not, this function will check itself
806 //RTMPUSBDeQueuePacket(pAd, pRTSContext->BulkOutPipeId);
807 RTMPDeQueuePacket(pAd, TRUE, NUM_OF_TX_RING, MAX_TX_PROCESS);
808 }
809 else // STATUS_OTHER
810 {
811 if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
812 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
813 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
814 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
815 {
816 DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out RTS Frame Failed\n"));
817 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
818 RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
819 }
820 }
821
822 RTMP_IRQ_LOCK(&pAd->BulkOutLock[pRTSContext->BulkOutPipeId], IrqFlags);
823 pAd->BulkOutPending[pRTSContext->BulkOutPipeId] = FALSE;
824 RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[pRTSContext->BulkOutPipeId], IrqFlags);
825
826 // Always call Bulk routine, even reset bulk.
827 // The protectioon of rest bulk should be in BulkOut routine
828 RTUSBKickBulkOut(pAd);
829#else
830
831 pObj = (POS_COOKIE) pAd->OS_Cookie;
832 pObj->rts_frame_complete_task.data = (unsigned long)pUrb;
833 tasklet_hi_schedule(&pObj->rts_frame_complete_task);
834#endif
835
836 DBGPRINT_RAW(RT_DEBUG_INFO, ("<---RTUSBBulkOutRTSFrameComplete\n"));
837
838} 564}
839#endif
840 565
841/* 566/*
842 ======================================================================== 567 ========================================================================
@@ -895,25 +620,6 @@ VOID RTUSBBulkOutMLMEPacket(
895 // Clear MLME bulk flag 620 // Clear MLME bulk flag
896 RTUSB_CLEAR_BULK_FLAG(pAd, fRTUSB_BULK_OUT_MLME); 621 RTUSB_CLEAR_BULK_FLAG(pAd, fRTUSB_BULK_OUT_MLME);
897 622
898
899 //DBGPRINT_RAW(RT_DEBUG_INFO, ("--->RTUSBBulkOutMLMEPacket\n"));
900#if 0 // for debug
901{
902 printk("MLME-Out, C=%d!, D=%d, F=%d!\n", pAd->MgmtRing.TxCpuIdx, pAd->MgmtRing.TxDmaIdx, pAd->MgmtRing.TxSwFreeIdx);
903
904 //TODO: Need to remove it when formal release
905 PTXINFO_STRUC pTxInfo;
906
907 pTxInfo = (PTXINFO_STRUC)pMLMEContext->TransferBuffer;
908 if (pTxInfo->QSEL != FIFO_EDCA)
909 {
910 printk("%s(): ====> pTxInfo->QueueSel(%d)!= FIFO_EDCA!!!!\n", __func__, pTxInfo->QSEL);
911 printk("\tMLME_Index=%d!\n", Index);
912 hex_dump("Wrong QSel Pkt:", (PUCHAR)pMLMEContext->TransferBuffer, pTxInfo->USBDMATxPktLen);
913 }
914}
915#endif
916
917 // Init Tx context descriptor 623 // Init Tx context descriptor
918 RTUSBInitTxDesc(pAd, pMLMEContext, MGMTPIPEIDX, (usb_complete_t)RTUSBBulkOutMLMEPacketComplete); 624 RTUSBInitTxDesc(pAd, pMLMEContext, MGMTPIPEIDX, (usb_complete_t)RTUSBBulkOutMLMEPacketComplete);
919 625
@@ -947,11 +653,6 @@ VOID RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs)
947 NTSTATUS Status; 653 NTSTATUS Status;
948 POS_COOKIE pObj; 654 POS_COOKIE pObj;
949 int index; 655 int index;
950#if 0 // sample, IRQ LOCK
951 unsigned long IrqFlags;
952 PNDIS_PACKET pPacket;
953#endif
954
955 656
956 //DBGPRINT_RAW(RT_DEBUG_INFO, ("--->RTUSBBulkOutMLMEPacketComplete\n")); 657 //DBGPRINT_RAW(RT_DEBUG_INFO, ("--->RTUSBBulkOutMLMEPacketComplete\n"));
957 pMLMEContext = (PTX_CONTEXT)pUrb->context; 658 pMLMEContext = (PTX_CONTEXT)pUrb->context;
@@ -960,82 +661,8 @@ VOID RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs)
960 Status = pUrb->status; 661 Status = pUrb->status;
961 index = pMLMEContext->SelfIdx; 662 index = pMLMEContext->SelfIdx;
962 663
963
964#if 0 // sample, IRQ LOCK
965 ASSERT((pAd->MgmtRing.TxDmaIdx == index));
966 //printk("MLME-Done-B: C=%d, D=%d, F=%d, Self=%d!\n", pAd->MgmtRing.TxCpuIdx, pAd->MgmtRing.TxDmaIdx, pAd->MgmtRing.TxSwFreeIdx, pMLMEContext->SelfIdx);
967
968 RTMP_IRQ_LOCK(&pAd->BulkOutLock[MGMTPIPEIDX], IrqFlags);
969
970
971 if (Status != USB_ST_NOERROR)
972 {
973 //Bulk-Out fail status handle
974 if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
975 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
976 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
977 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
978 {
979 DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out MLME Failed, Status=%d!\n", Status));
980 // TODO: How to handle about the MLMEBulkOut failed issue. Need to resend the mgmt pkt?
981 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
982 pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
983 }
984 }
985 pAd->BulkOutPending[MGMTPIPEIDX] = FALSE;
986 RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[MGMTPIPEIDX], IrqFlags);
987
988 RTMP_IRQ_LOCK(&pAd->MLMEBulkOutLock, IrqFlags);
989 // Reset MLME context flags
990 pMLMEContext->IRPPending = FALSE;
991 pMLMEContext->InUse = FALSE;
992 pMLMEContext->bWaitingBulkOut = FALSE;
993 pMLMEContext->BulkOutSize = 0;
994
995 pPacket = pAd->MgmtRing.Cell[index].pNdisPacket;
996 pAd->MgmtRing.Cell[index].pNdisPacket = NULL;
997
998 // Increase MgmtRing Index
999 INC_RING_INDEX(pAd->MgmtRing.TxDmaIdx, MGMT_RING_SIZE);
1000 pAd->MgmtRing.TxSwFreeIdx++;
1001
1002 RTMP_IRQ_UNLOCK(&pAd->MLMEBulkOutLock, IrqFlags);
1003
1004 // No-matter success or fail, we free the mgmt packet.
1005 if (pPacket)
1006 RTMPFreeNdisPacket(pAd, pPacket);
1007
1008#if 0
1009 //Bulk-Out fail status handle
1010 if (Status != USB_ST_NOERROR)
1011 {
1012 if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
1013 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
1014 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
1015 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
1016 {
1017 DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out MLME Failed, Status=%d!\n", Status));
1018 // TODO: How to handle about the MLMEBulkOut failed issue. Need to reset the endpoint?
1019 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
1020 pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
1021 }
1022 }
1023#endif
1024
1025 //printk("MLME-Done-A: C=%d, D=%d, F=%d!\n", pAd->MgmtRing.TxCpuIdx, pAd->MgmtRing.TxDmaIdx, pAd->MgmtRing.TxSwFreeIdx);
1026
1027 pObj->mgmt_dma_done_task.data = (unsigned long)pAd;
1028 tasklet_hi_schedule(&pObj->mgmt_dma_done_task);
1029
1030 //DBGPRINT_RAW(RT_DEBUG_INFO, ("<---RTUSBBulkOutMLMEPacketComplete\n"));
1031// printk("<---RTUSBBulkOutMLMEPacketComplete, Cpu=%d, Dma=%d, SwIdx=%d!\n",
1032// pAd->MgmtRing.TxCpuIdx, pAd->MgmtRing.TxDmaIdx, pAd->MgmtRing.TxSwFreeIdx);
1033
1034#else
1035
1036 pObj->mgmt_dma_done_task.data = (unsigned long)pUrb; 664 pObj->mgmt_dma_done_task.data = (unsigned long)pUrb;
1037 tasklet_hi_schedule(&pObj->mgmt_dma_done_task); 665 tasklet_hi_schedule(&pObj->mgmt_dma_done_task);
1038#endif
1039} 666}
1040 667
1041 668
@@ -1099,9 +726,6 @@ VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb,struct pt_regs *pt_regs)
1099 PRTMP_ADAPTER pAd; 726 PRTMP_ADAPTER pAd;
1100 PTX_CONTEXT pPsPollContext; 727 PTX_CONTEXT pPsPollContext;
1101 NTSTATUS Status; 728 NTSTATUS Status;
1102#if 0 // sample, IRQ LOCK
1103 unsigned long IrqFlags;
1104#endif
1105 POS_COOKIE pObj; 729 POS_COOKIE pObj;
1106 730
1107 731
@@ -1109,251 +733,11 @@ VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb,struct pt_regs *pt_regs)
1109 pAd = pPsPollContext->pAd; 733 pAd = pPsPollContext->pAd;
1110 Status = pUrb->status; 734 Status = pUrb->status;
1111 735
1112#if 0 // sample, IRQ LOCK
1113 // Reset PsPoll context flags
1114 pPsPollContext->IRPPending = FALSE;
1115 pPsPollContext->InUse = FALSE;
1116
1117 if (Status == USB_ST_NOERROR)
1118 {
1119 // Don't worry about the queue is empty or not, this function will check itself
1120 RTMPDeQueuePacket(pAd, TRUE, NUM_OF_TX_RING, MAX_TX_PROCESS);
1121 }
1122 else // STATUS_OTHER
1123 {
1124 if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
1125 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
1126 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
1127 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
1128 {
1129 DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out PSPoll Failed\n"));
1130 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
1131 RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
1132 }
1133 }
1134
1135 RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], IrqFlags);
1136 pAd->BulkOutPending[0] = FALSE;
1137 RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], IrqFlags);
1138
1139 // Always call Bulk routine, even reset bulk.
1140 // The protectioon of rest bulk should be in BulkOut routine
1141 RTUSBKickBulkOut(pAd);
1142#else
1143
1144 pObj = (POS_COOKIE) pAd->OS_Cookie; 736 pObj = (POS_COOKIE) pAd->OS_Cookie;
1145 pObj->pspoll_frame_complete_task.data = (unsigned long)pUrb; 737 pObj->pspoll_frame_complete_task.data = (unsigned long)pUrb;
1146 tasklet_hi_schedule(&pObj->pspoll_frame_complete_task); 738 tasklet_hi_schedule(&pObj->pspoll_frame_complete_task);
1147#endif
1148} 739}
1149 740
1150
1151#if 0
1152/*
1153 ========================================================================
1154
1155 Routine Description:
1156 USB_RxPacket initializes a URB and uses the Rx IRP to submit it
1157 to USB. It checks if an Rx Descriptor is available and passes the
1158 the coresponding buffer to be filled. If no descriptor is available
1159 fails the request. When setting the completion routine we pass our
1160 Adapter Object as Context.
1161
1162 Arguments:
1163
1164 Return Value:
1165 TRUE found matched tuple cache
1166 FALSE no matched found
1167
1168 Note:
1169
1170 ========================================================================
1171*/
1172VOID RTUSBBulkReceive(
1173 IN PRTMP_ADAPTER pAd)
1174{
1175 PRX_CONTEXT pRxContext;
1176 PURB pUrb;
1177 int ret = 0;
1178 unsigned long IrqFlags;
1179
1180
1181 /* device had been closed */
1182 if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS))
1183 return;
1184
1185 RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags);
1186
1187 // Last is time point between 2 separate URB.
1188 if (pAd->NextRxBulkInPosition == 0)
1189 {
1190 //pAd->NextRxBulkInIndex = (pAd->NextRxBulkInIndex + 1) % (RX_RING_SIZE);
1191 INC_RING_INDEX(pAd->NextRxBulkInIndex, RX_RING_SIZE);
1192 }
1193 else if ((pAd->NextRxBulkInPosition&0x1ff) != 0)
1194 {
1195 //pAd->NextRxBulkInIndex = (pAd->NextRxBulkInIndex + 1) % (RX_RING_SIZE);
1196 INC_RING_INDEX(pAd->NextRxBulkInIndex, RX_RING_SIZE);
1197 DBGPRINT_RAW(RT_DEBUG_TRACE, ("pAd->NextRxBulkInPosition = 0x%lx. End of URB.\n", pAd->NextRxBulkInPosition ));
1198 pAd->NextRxBulkInPosition = 0;
1199 }
1200
1201 if (pAd->NextRxBulkInPosition == MAX_RXBULK_SIZE)
1202 pAd->NextRxBulkInPosition = 0;
1203
1204 pRxContext = &(pAd->RxContext[pAd->NextRxBulkInIndex]);
1205
1206 // TODO: Why need to check if pRxContext->InUsed == TRUE?
1207 //if ((pRxContext->InUse == TRUE) || (pRxContext->Readable == TRUE))
1208 if ((pRxContext->InUse == FALSE) && (pRxContext->Readable == TRUE))
1209 {
1210 DBGPRINT_RAW(RT_DEBUG_TRACE, ("pRxContext[%d] InUse = %d.pRxContext->Readable = %d. Return.\n", pAd->NextRxBulkInIndex,pRxContext->InUse, pRxContext->Readable ));
1211 RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
1212
1213 // read RxContext, Since not
1214 STARxDoneInterruptHandle(pAd, TRUE);
1215
1216 //return;
1217 }
1218 pRxContext->InUse = TRUE;
1219 pRxContext->IRPPending= TRUE;
1220
1221 RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
1222
1223 // Init Rx context descriptor
1224 NdisZeroMemory(pRxContext->TransferBuffer, BUFFER_SIZE);
1225 RTUSBInitRxDesc(pAd, pRxContext);
1226
1227 pUrb = pRxContext->pUrb;
1228 if ((ret = RTUSB_SUBMIT_URB(pUrb))!=0)
1229 {
1230 DBGPRINT(RT_DEBUG_ERROR, ("RTUSBBulkReceive: Submit Rx URB failed %d\n", ret));
1231 return;
1232 }
1233 else // success
1234 {
1235 NdisInterlockedIncrement(&pAd->PendingRx);
1236 pAd->BulkInReq++;
1237 }
1238
1239 // read RxContext, Since not
1240 STARxDoneInterruptHandle(pAd, FALSE);
1241}
1242
1243/*
1244 ========================================================================
1245
1246 Routine Description:
1247 This routine process Rx Irp and call rx complete function.
1248
1249 Arguments:
1250 DeviceObject Pointer to the device object for next lower
1251 device. DeviceObject passed in here belongs to
1252 the next lower driver in the stack because we
1253 were invoked via IoCallDriver in USB_RxPacket
1254 AND it is not OUR device object
1255 Irp Ptr to completed IRP
1256 Context Ptr to our Adapter object (context specified
1257 in IoSetCompletionRoutine
1258
1259 Return Value:
1260 Always returns STATUS_MORE_PROCESSING_REQUIRED
1261
1262 Note:
1263 Always returns STATUS_MORE_PROCESSING_REQUIRED
1264 ========================================================================
1265*/
1266VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs)
1267{
1268#if 0
1269 PRX_CONTEXT pRxContext;
1270 PRTMP_ADAPTER pAd;
1271 NTSTATUS Status;
1272// POS_COOKIE pObj;
1273
1274 pRxContext = (PRX_CONTEXT)pUrb->context;
1275 pAd = pRxContext->pAd;
1276// pObj = (POS_COOKIE) pAd->OS_Cookie;
1277
1278
1279 Status = pUrb->status;
1280 //pRxContext->pIrp = NULL;
1281
1282 pRxContext->InUse = FALSE;
1283 pRxContext->IRPPending = FALSE;
1284
1285 if (Status == USB_ST_NOERROR)
1286 {
1287 pAd->BulkInComplete++;
1288 pRxContext->Readable = TRUE;
1289 pAd->NextRxBulkInPosition = 0;
1290
1291 }
1292 else // STATUS_OTHER
1293 {
1294 pAd->BulkInCompleteFail++;
1295 // Still read this packet although it may comtain wrong bytes.
1296 pRxContext->Readable = FALSE;
1297 // Parsing all packets. because after reset, the index will reset to all zero.
1298
1299 if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
1300 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKIN_RESET)) &&
1301 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
1302 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
1303 {
1304
1305 DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk In Failed. Status = %d\n", Status));
1306 DBGPRINT_RAW(RT_DEBUG_ERROR, ("==>NextRxBulkInIndex=0x%x, NextRxBulkInReadIndex=0x%x, TransferBufferLength= 0x%x\n",
1307 pAd->NextRxBulkInIndex, pAd->NextRxBulkInReadIndex, pRxContext->pUrb->actual_length));
1308
1309 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKIN_RESET);
1310 RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_IN, NULL, 0);
1311 }
1312 //pUrb = NULL;
1313 }
1314
1315 if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
1316 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKIN_RESET)) &&
1317// (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)) &&
1318 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF)) &&
1319 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
1320 (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
1321 {
1322 RTUSBBulkReceive(pAd);
1323#if 0
1324#if 1
1325 STARxDoneInterruptHandle(pAd, FALSE);
1326#else
1327 pObj->rx_bh.data = (unsigned long)pUrb;
1328 tasklet_schedule(&pObj->rx_bh);
1329#endif
1330#endif
1331 }
1332
1333 // Call RxPacket to process packet and return the status
1334 NdisInterlockedDecrement(&pAd->PendingRx);
1335#else
1336
1337
1338 // use a receive tasklet to handle received packets;
1339 // or sometimes hardware IRQ will be disabled here, so we can not
1340 // use spin_lock_bh()/spin_unlock_bh() after IRQ is disabled. :<
1341 PRX_CONTEXT pRxContext;
1342 PRTMP_ADAPTER pAd;
1343 POS_COOKIE pObj;
1344
1345
1346 pRxContext = (PRX_CONTEXT)pUrb->context;
1347 pAd = pRxContext->pAd;
1348 pObj = (POS_COOKIE) pAd->OS_Cookie;
1349
1350 pObj->rx_done_task.data = (unsigned long)pUrb;
1351 tasklet_hi_schedule(&pObj->rx_done_task);
1352#endif
1353}
1354
1355#else
1356
1357VOID DoBulkIn(IN RTMP_ADAPTER *pAd) 741VOID DoBulkIn(IN RTMP_ADAPTER *pAd)
1358{ 742{
1359 PRX_CONTEXT pRxContext; 743 PRX_CONTEXT pRxContext;
@@ -1392,14 +776,6 @@ VOID DoBulkIn(IN RTMP_ADAPTER *pAd)
1392 } 776 }
1393 else 777 else
1394 { // success 778 { // success
1395#if 0
1396 RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags);
1397 pRxContext->IRPPending = TRUE;
1398 //NdisInterlockedIncrement(&pAd->PendingRx);
1399 pAd->PendingRx++;
1400 RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
1401 pAd->BulkInReq++;
1402#endif
1403 ASSERT((pRxContext->InUse == pRxContext->IRPPending)); 779 ASSERT((pRxContext->InUse == pRxContext->IRPPending));
1404 //printk("BIDone, Pend=%d,BIIdx=%d,BIRIdx=%d!\n", pAd->PendingRx, pAd->NextRxBulkInIndex, pAd->NextRxBulkInReadIndex); 780 //printk("BIDone, Pend=%d,BIIdx=%d,BIRIdx=%d!\n", pAd->PendingRx, pAd->NextRxBulkInIndex, pAd->NextRxBulkInReadIndex);
1405 } 781 }
@@ -1527,8 +903,6 @@ VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs)
1527 903
1528} 904}
1529 905
1530#endif
1531
1532 906
1533 907
1534/* 908/*
@@ -1551,46 +925,6 @@ VOID RTUSBKickBulkOut(
1551 if (!RTMP_TEST_FLAG(pAd ,fRTMP_ADAPTER_NEED_STOP_TX) 925 if (!RTMP_TEST_FLAG(pAd ,fRTMP_ADAPTER_NEED_STOP_TX)
1552 ) 926 )
1553 { 927 {
1554#if 0 // not used now in RT28xx, but may used latter.
1555 // 1. Data Fragment has highest priority
1556 if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_FRAG))
1557 {
1558 if (((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) ||
1559 (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
1560 ))
1561 {
1562 RTUSBBulkOutDataPacket(pAd, 0, pAd->NextBulkOutIndex[0]);
1563 }
1564 }
1565 if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_FRAG_2))
1566 {
1567 if (((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) ||
1568 (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
1569 ))
1570 {
1571 RTUSBBulkOutDataPacket(pAd, 1, pAd->NextBulkOutIndex[1]);
1572 }
1573 }
1574 if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_FRAG_3))
1575 {
1576 if (((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) ||
1577 (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
1578 ))
1579 {
1580 RTUSBBulkOutDataPacket(pAd, 2, pAd->NextBulkOutIndex[2]);
1581 }
1582 }
1583 if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_FRAG_4))
1584 {
1585 if (((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) ||
1586 (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
1587 ))
1588 {
1589 RTUSBBulkOutDataPacket(pAd, 3, pAd->NextBulkOutIndex[3]);
1590 }
1591 }
1592#endif
1593
1594 // 2. PS-Poll frame is next 928 // 2. PS-Poll frame is next
1595 if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_PSPOLL)) 929 if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_PSPOLL))
1596 { 930 {
@@ -1711,24 +1045,6 @@ VOID RTUSBCleanUpMLMEBulkOutQueue(
1711 IN PRTMP_ADAPTER pAd) 1045 IN PRTMP_ADAPTER pAd)
1712{ 1046{
1713 DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpMLMEBulkOutQueue\n")); 1047 DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpMLMEBulkOutQueue\n"));
1714
1715#if 0 // Do nothing!
1716 NdisAcquireSpinLock(&pAd->MLMEBulkOutLock);
1717 while (pAd->PrioRingTxCnt > 0)
1718 {
1719 pAd->MLMEContext[pAd->PrioRingFirstIndex].InUse = FALSE;
1720
1721 pAd->PrioRingFirstIndex++;
1722 if (pAd->PrioRingFirstIndex >= MGMT_RING_SIZE)
1723 {
1724 pAd->PrioRingFirstIndex = 0;
1725 }
1726
1727 pAd->PrioRingTxCnt--;
1728 }
1729 NdisReleaseSpinLock(&pAd->MLMEBulkOutLock);
1730#endif
1731
1732 DBGPRINT(RT_DEBUG_TRACE, ("<---CleanUpMLMEBulkOutQueue\n")); 1048 DBGPRINT(RT_DEBUG_TRACE, ("<---CleanUpMLMEBulkOutQueue\n"));
1733} 1049}
1734 1050
diff --git a/drivers/staging/rt2870/common/rtusb_data.c b/drivers/staging/rt2870/common/rtusb_data.c
index 5a0d78389f41..6b003f63372e 100644
--- a/drivers/staging/rt2870/common/rtusb_data.c
+++ b/drivers/staging/rt2870/common/rtusb_data.c
@@ -135,24 +135,11 @@ BOOLEAN RTUSBNeedQueueBackForAgg(
135 RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags); 135 RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
136 if ((pHTTXContext->IRPPending == TRUE) /*&& (pAd->TxSwQueue[BulkOutPipeId].Number == 0) */) 136 if ((pHTTXContext->IRPPending == TRUE) /*&& (pAd->TxSwQueue[BulkOutPipeId].Number == 0) */)
137 { 137 {
138#if 0
139 if ((pHTTXContext->CurWritePosition <= 8) &&
140 (pHTTXContext->NextBulkOutPosition > 8 && (pHTTXContext->NextBulkOutPosition+MAX_AGGREGATION_SIZE) < MAX_TXBULK_LIMIT))
141 {
142 needQueBack = TRUE;
143 }
144 else if ((pHTTXContext->CurWritePosition < pHTTXContext->NextBulkOutPosition) &&
145 ((pHTTXContext->NextBulkOutPosition + MAX_AGGREGATION_SIZE) < MAX_TXBULK_LIMIT))
146 {
147 needQueBack = TRUE;
148 }
149#else
150 if ((pHTTXContext->CurWritePosition < pHTTXContext->ENextBulkOutPosition) && 138 if ((pHTTXContext->CurWritePosition < pHTTXContext->ENextBulkOutPosition) &&
151 (((pHTTXContext->ENextBulkOutPosition+MAX_AGGREGATION_SIZE) < MAX_TXBULK_LIMIT) || (pHTTXContext->CurWritePosition > MAX_AGGREGATION_SIZE))) 139 (((pHTTXContext->ENextBulkOutPosition+MAX_AGGREGATION_SIZE) < MAX_TXBULK_LIMIT) || (pHTTXContext->CurWritePosition > MAX_AGGREGATION_SIZE)))
152 { 140 {
153 needQueBack = TRUE; 141 needQueBack = TRUE;
154 } 142 }
155#endif
156 else if ((pHTTXContext->CurWritePosition > pHTTXContext->ENextBulkOutPosition) && 143 else if ((pHTTXContext->CurWritePosition > pHTTXContext->ENextBulkOutPosition) &&
157 ((pHTTXContext->ENextBulkOutPosition + MAX_AGGREGATION_SIZE) < pHTTXContext->CurWritePosition)) 144 ((pHTTXContext->ENextBulkOutPosition + MAX_AGGREGATION_SIZE) < pHTTXContext->CurWritePosition))
158 { 145 {
diff --git a/drivers/staging/rt2870/common/rtusb_io.c b/drivers/staging/rt2870/common/rtusb_io.c
index e555d286f6d5..4a930f0050d0 100644
--- a/drivers/staging/rt2870/common/rtusb_io.c
+++ b/drivers/staging/rt2870/common/rtusb_io.c
@@ -1222,28 +1222,6 @@ NTSTATUS RTUSB_VendorRequest(
1222 if ((TransferBuffer!= NULL) && (TransferBufferLength > 0)) 1222 if ((TransferBuffer!= NULL) && (TransferBufferLength > 0))
1223 hex_dump("Failed TransferBuffer value", TransferBuffer, TransferBufferLength); 1223 hex_dump("Failed TransferBuffer value", TransferBuffer, TransferBufferLength);
1224 } 1224 }
1225
1226#if 0
1227 // retry
1228 if (ret < 0) {
1229 int temp_i=0;
1230 DBGPRINT(RT_DEBUG_ERROR, ("USBVendorRequest failed ret=%d, \n",ret));
1231 ret = 0;
1232 do
1233 {
1234 if( RequestType == DEVICE_VENDOR_REQUEST_OUT)
1235 ret=usb_control_msg(pObj->pUsb_Dev, usb_sndctrlpipe( pObj->pUsb_Dev, 0 ), Request, RequestType, Value,Index, TransferBuffer, TransferBufferLength, CONTROL_TIMEOUT_JIFFIES);
1236 else if(RequestType == DEVICE_VENDOR_REQUEST_IN)
1237 ret=usb_control_msg(pObj->pUsb_Dev, usb_rcvctrlpipe( pObj->pUsb_Dev, 0 ), Request, RequestType, Value,Index, TransferBuffer, TransferBufferLength, CONTROL_TIMEOUT_JIFFIES);
1238 temp_i++;
1239 } while( (ret < 0) && (temp_i <= 1) );
1240
1241 if( ret >= 0)
1242 return ret;
1243
1244 }
1245#endif
1246
1247 } 1225 }
1248 return ret; 1226 return ret;
1249} 1227}
@@ -1621,15 +1599,6 @@ VOID CMDHandler(
1621 } 1599 }
1622 else 1600 else
1623 { // success 1601 { // success
1624#if 0
1625 RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags);
1626 pRxContext->IRPPending = TRUE;
1627 //NdisInterlockedIncrement(&pAd->PendingRx);
1628 pAd->PendingRx++;
1629 RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
1630 pAd->BulkInReq++;
1631#endif
1632 //printk("BIDone, Pend=%d,BIIdx=%d,BIRIdx=%d!\n", pAd->PendingRx, pAd->NextRxBulkInIndex, pAd->NextRxBulkInReadIndex);
1633 DBGPRINT_RAW(RT_DEBUG_TRACE, ("CMDTHREAD_RESET_BULK_IN: Submit Rx URB Done, status=%d!\n", pUrb->status)); 1602 DBGPRINT_RAW(RT_DEBUG_TRACE, ("CMDTHREAD_RESET_BULK_IN: Submit Rx URB Done, status=%d!\n", pUrb->status));
1634 ASSERT((pRxContext->InUse == pRxContext->IRPPending)); 1603 ASSERT((pRxContext->InUse == pRxContext->IRPPending));
1635 } 1604 }
diff --git a/drivers/staging/rt2870/mlme.h b/drivers/staging/rt2870/mlme.h
index dc4297f6aede..3d1a8284fbd4 100644
--- a/drivers/staging/rt2870/mlme.h
+++ b/drivers/staging/rt2870/mlme.h
@@ -39,8 +39,6 @@
39#ifndef __MLME_H__ 39#ifndef __MLME_H__
40#define __MLME_H__ 40#define __MLME_H__
41 41
42//extern UCHAR BROADCAST_ADDR[];
43
44// maximum supported capability information - 42// maximum supported capability information -
45// ESS, IBSS, Privacy, Short Preamble, Spectrum mgmt, Short Slot 43// ESS, IBSS, Privacy, Short Preamble, Spectrum mgmt, Short Slot
46#define SUPPORTED_CAPABILITY_INFO 0x0533 44#define SUPPORTED_CAPABILITY_INFO 0x0533
@@ -51,7 +49,6 @@
51#define LEAD_TIME 5 49#define LEAD_TIME 5
52#define MLME_TASK_EXEC_MULTIPLE 10 /*5*/ // MLME_TASK_EXEC_MULTIPLE * MLME_TASK_EXEC_INTV = 1 sec 50#define MLME_TASK_EXEC_MULTIPLE 10 /*5*/ // MLME_TASK_EXEC_MULTIPLE * MLME_TASK_EXEC_INTV = 1 sec
53#define REORDER_EXEC_INTV 100 // 0.1 sec 51#define REORDER_EXEC_INTV 100 // 0.1 sec
54//#define TBTT_PRELOAD_TIME 384 // usec. LomgPreamble + 24-byte at 1Mbps
55 52
56// The definition of Radar detection duration region 53// The definition of Radar detection duration region
57#define CE 0 54#define CE 0
@@ -106,13 +103,6 @@
106#define TX_WEIGHTING 30 103#define TX_WEIGHTING 30
107#define RX_WEIGHTING 20 104#define RX_WEIGHTING 20
108 105
109//#define PEER_KEY_NOT_USED 0
110//#define PEER_KEY_64_BIT 64
111//#define PEER_KEY_128_BIT 128
112
113//#define PEER_KEY_64BIT_LEN 8
114//#define PEER_KEY_128BIT_LEN 16
115
116#define BSS_NOT_FOUND 0xFFFFFFFF 106#define BSS_NOT_FOUND 0xFFFFFFFF
117 107
118#define MAX_LEN_OF_MLME_QUEUE 40 //10 108#define MAX_LEN_OF_MLME_QUEUE 40 //10
@@ -125,7 +115,6 @@
125#define SCAN_CISCO_CHANNEL_LOAD 23 // Single channel passive scan for channel load collection 115#define SCAN_CISCO_CHANNEL_LOAD 23 // Single channel passive scan for channel load collection
126#define FAST_SCAN_ACTIVE 24 // scan with probe request, and wait beacon and probe response 116#define FAST_SCAN_ACTIVE 24 // scan with probe request, and wait beacon and probe response
127 117
128//#define BSS_TABLE_EMPTY(x) ((x).BssNr == 0)
129#define MAC_ADDR_IS_GROUP(Addr) (((Addr[0]) & 0x01)) 118#define MAC_ADDR_IS_GROUP(Addr) (((Addr[0]) & 0x01))
130#define MAC_ADDR_HASH(Addr) (Addr[0] ^ Addr[1] ^ Addr[2] ^ Addr[3] ^ Addr[4] ^ Addr[5]) 119#define MAC_ADDR_HASH(Addr) (Addr[0] ^ Addr[1] ^ Addr[2] ^ Addr[3] ^ Addr[4] ^ Addr[5])
131#define MAC_ADDR_HASH_INDEX(Addr) (MAC_ADDR_HASH(Addr) % HASH_TABLE_SIZE) 120#define MAC_ADDR_HASH_INDEX(Addr) (MAC_ADDR_HASH(Addr) % HASH_TABLE_SIZE)
@@ -157,8 +146,6 @@
157 146
158#define CAP_GENERATE(ess,ibss,priv,s_pre,s_slot,spectrum) (((ess) ? 0x0001 : 0x0000) | ((ibss) ? 0x0002 : 0x0000) | ((priv) ? 0x0010 : 0x0000) | ((s_pre) ? 0x0020 : 0x0000) | ((s_slot) ? 0x0400 : 0x0000) | ((spectrum) ? 0x0100 : 0x0000)) 147#define CAP_GENERATE(ess,ibss,priv,s_pre,s_slot,spectrum) (((ess) ? 0x0001 : 0x0000) | ((ibss) ? 0x0002 : 0x0000) | ((priv) ? 0x0010 : 0x0000) | ((s_pre) ? 0x0020 : 0x0000) | ((s_slot) ? 0x0400 : 0x0000) | ((spectrum) ? 0x0100 : 0x0000))
159 148
160//#define STA_QOS_CAPABILITY 0 // 1-byte. see 802.11e d9.0 for bit definition
161
162#define ERP_IS_NON_ERP_PRESENT(x) (((x) & 0x01) != 0) // 802.11g 149#define ERP_IS_NON_ERP_PRESENT(x) (((x) & 0x01) != 0) // 802.11g
163#define ERP_IS_USE_PROTECTION(x) (((x) & 0x02) != 0) // 802.11g 150#define ERP_IS_USE_PROTECTION(x) (((x) & 0x02) != 0) // 802.11g
164#define ERP_IS_USE_BARKER_PREAMBLE(x) (((x) & 0x04) != 0) // 802.11g 151#define ERP_IS_USE_BARKER_PREAMBLE(x) (((x) & 0x04) != 0) // 802.11g
@@ -401,12 +388,6 @@ typedef struct {
401//This structure substracts ralink supports from all 802.11n-related features. 388//This structure substracts ralink supports from all 802.11n-related features.
402//Features not listed here but contained in 802.11n spec are not supported in rt2860. 389//Features not listed here but contained in 802.11n spec are not supported in rt2860.
403typedef struct { 390typedef struct {
404#if 0 // move to
405 BOOLEAN bHtEnable; // If we should use ht rate.
406 BOOLEAN bPreNHt; // If we should use ht rate.
407 //Substract from HT Capability IE
408 UCHAR MCSSet[16]; //only supoort MCS=0-15,32 ,
409#endif
410 USHORT ChannelWidth:1; 391 USHORT ChannelWidth:1;
411 USHORT MimoPs:2;//mimo power safe MMPS_ 392 USHORT MimoPs:2;//mimo power safe MMPS_
412 USHORT GF:1; //green field 393 USHORT GF:1; //green field
@@ -1099,11 +1080,6 @@ typedef struct PACKED _RTMP_TX_RATE_SWITCH
1099#define TBTT_PRELOAD_TIME 384 // usec. LomgPreamble + 24-byte at 1Mbps 1080#define TBTT_PRELOAD_TIME 384 // usec. LomgPreamble + 24-byte at 1Mbps
1100#define DEFAULT_DTIM_PERIOD 1 1081#define DEFAULT_DTIM_PERIOD 1
1101 1082
1102// weighting factor to calculate Channel quality, total should be 100%
1103//#define RSSI_WEIGHTING 0
1104//#define TX_WEIGHTING 40
1105//#define RX_WEIGHTING 60
1106
1107#define MAC_TABLE_AGEOUT_TIME 300 // unit: sec 1083#define MAC_TABLE_AGEOUT_TIME 300 // unit: sec
1108#define MAC_TABLE_ASSOC_TIMEOUT 5 // unit: sec 1084#define MAC_TABLE_ASSOC_TIMEOUT 5 // unit: sec
1109#define MAC_TABLE_FULL(Tab) ((Tab).size == MAX_LEN_OF_MAC_TABLE) 1085#define MAC_TABLE_FULL(Tab) ((Tab).size == MAX_LEN_OF_MAC_TABLE)
diff --git a/drivers/staging/rt2870/oid.h b/drivers/staging/rt2870/oid.h
index 21c727879271..164ec5d264fb 100644
--- a/drivers/staging/rt2870/oid.h
+++ b/drivers/staging/rt2870/oid.h
@@ -585,19 +585,6 @@ typedef struct _NDIS_802_11_AUTHENTICATION_EVENT
585 NDIS_802_11_AUTHENTICATION_REQUEST Request[1]; 585 NDIS_802_11_AUTHENTICATION_REQUEST Request[1];
586} NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT; 586} NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT;
587 587
588/*
589typedef struct _NDIS_802_11_TEST
590{
591 ULONG Length;
592 ULONG Type;
593 union
594 {
595 NDIS_802_11_AUTHENTICATION_EVENT AuthenticationEvent;
596 NDIS_802_11_RSSI RssiTrigger;
597 };
598} NDIS_802_11_TEST, *PNDIS_802_11_TEST;
599 */
600
601// 802.11 Media stream constraints, associated with OID_802_11_MEDIA_STREAM_MODE 588// 802.11 Media stream constraints, associated with OID_802_11_MEDIA_STREAM_MODE
602typedef enum _NDIS_802_11_MEDIA_STREAM_MODE 589typedef enum _NDIS_802_11_MEDIA_STREAM_MODE
603{ 590{
@@ -691,7 +678,6 @@ typedef union _HTTRANSMIT_SETTING {
691 USHORT BW:1; //channel bandwidth 20MHz or 40 MHz 678 USHORT BW:1; //channel bandwidth 20MHz or 40 MHz
692 USHORT ShortGI:1; 679 USHORT ShortGI:1;
693 USHORT STBC:2; //SPACE 680 USHORT STBC:2; //SPACE
694// USHORT rsv:3;
695 USHORT rsv:2; 681 USHORT rsv:2;
696 USHORT TxBF:1; 682 USHORT TxBF:1;
697 USHORT MODE:2; // Use definition MODE_xxx. 683 USHORT MODE:2; // Use definition MODE_xxx.
@@ -779,15 +765,6 @@ typedef struct _RT_802_11_HARDWARE_REGISTER {
779 ULONG Data; // R/W data buffer 765 ULONG Data; // R/W data buffer
780} RT_802_11_HARDWARE_REGISTER, *PRT_802_11_HARDWARE_REGISTER; 766} RT_802_11_HARDWARE_REGISTER, *PRT_802_11_HARDWARE_REGISTER;
781 767
782// structure to tune BBP R17 "RX AGC VGC init"
783//typedef struct _RT_802_11_RX_AGC_VGC_TUNING {
784// UCHAR FalseCcaLowerThreshold; // 0-255, def 10
785// UCHAR FalseCcaUpperThreshold; // 0-255, def 100
786// UCHAR VgcDelta; // R17 +-= VgcDelta whenever flase CCA over UpprThreshold
787// // or lower than LowerThresholdupper threshold
788// UCHAR VgcUpperBound; // max value of R17
789//} RT_802_11_RX_AGC_VGC_TUNING, *PRT_802_11_RX_AGC_VGC_TUNING;
790
791typedef struct _RT_802_11_AP_CONFIG { 768typedef struct _RT_802_11_AP_CONFIG {
792 ULONG EnableTxBurst; // 0-disable, 1-enable 769 ULONG EnableTxBurst; // 0-disable, 1-enable
793 ULONG EnableTurboRate; // 0-disable, 1-enable 72/100mbps turbo rate 770 ULONG EnableTurboRate; // 0-disable, 1-enable 72/100mbps turbo rate
diff --git a/drivers/staging/rt2870/rt2870.h b/drivers/staging/rt2870/rt2870.h
index d6c0595423db..486c5b33fdff 100644
--- a/drivers/staging/rt2870/rt2870.h
+++ b/drivers/staging/rt2870/rt2870.h
@@ -219,19 +219,8 @@ typedef struct _MGMT_STRUC {
219 219
220 220
221/* ----------------- Frimware Related MACRO ----------------- */ 221/* ----------------- Frimware Related MACRO ----------------- */
222#if 0
223#define RT28XX_FIRMUD_INIT(pAd) \
224 { UINT32 MacReg; \
225 RTUSBReadMACRegister(pAd, MAC_CSR0, &MacReg); }
226
227#define RT28XX_FIRMUD_END(pAd) \
228 RTUSBWriteMACRegister(pAd, 0x7014, 0xffffffff); \
229 RTUSBWriteMACRegister(pAd, 0x701c, 0xffffffff); \
230 RTUSBFirmwareRun(pAd);
231#else
232#define RT28XX_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \ 222#define RT28XX_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \
233 RTUSBFirmwareWrite(_pAd, _pFwImage, _FwLen) 223 RTUSBFirmwareWrite(_pAd, _pFwImage, _FwLen)
234#endif
235 224
236/* ----------------- TX Related MACRO ----------------- */ 225/* ----------------- TX Related MACRO ----------------- */
237#define RT28XX_START_DEQUEUE(pAd, QueIdx, irqFlags) \ 226#define RT28XX_START_DEQUEUE(pAd, QueIdx, irqFlags) \
@@ -316,13 +305,6 @@ extern UCHAR EpToQueue[6];
316/* ----------------- RX Related MACRO ----------------- */ 305/* ----------------- RX Related MACRO ----------------- */
317//#define RT28XX_RX_ERROR_CHECK RTMPCheckRxWI 306//#define RT28XX_RX_ERROR_CHECK RTMPCheckRxWI
318 307
319#if 0
320#define RT28XX_RCV_INIT(pAd) \
321 pAd->TransferBufferLength = 0; \
322 pAd->ReadPosition = 0; \
323 pAd->pCurrRxContext = NULL;
324#endif
325
326#define RT28XX_RV_ALL_BUF_END(bBulkReceive) \ 308#define RT28XX_RV_ALL_BUF_END(bBulkReceive) \
327 /* We return STATUS_MORE_PROCESSING_REQUIRED so that the completion */ \ 309 /* We return STATUS_MORE_PROCESSING_REQUIRED so that the completion */ \
328 /* routine (IofCompleteRequest) will stop working on the irp. */ \ 310 /* routine (IofCompleteRequest) will stop working on the irp. */ \
@@ -330,27 +312,6 @@ extern UCHAR EpToQueue[6];
330 312
331 313
332/* ----------------- ASIC Related MACRO ----------------- */ 314/* ----------------- ASIC Related MACRO ----------------- */
333#if 0
334#define RT28XX_DMA_WRITE_INIT(GloCfg) \
335 { GloCfg.field.EnTXWriteBackDDONE = 1; \
336 GloCfg.field.EnableRxDMA = 1; \
337 GloCfg.field.EnableTxDMA = 1; }
338
339#define RT28XX_DMA_POST_WRITE(_pAd) \
340 do{ USB_DMA_CFG_STRUC UsbCfg; \
341 UsbCfg.word = 0; \
342 /* for last packet, PBF might use more than limited, so minus 2 to prevent from error */ \
343 UsbCfg.field.RxBulkAggLmt = (MAX_RXBULK_SIZE /1024)-3; \
344 UsbCfg.field.phyclear = 0; \
345 /* usb version is 1.1,do not use bulk in aggregation */ \
346 if (_pAd->BulkInMaxPacketSize == 512) \
347 UsbCfg.field.RxBulkAggEn = 1; \
348 UsbCfg.field.RxBulkEn = 1; \
349 UsbCfg.field.TxBulkEn = 1; \
350 UsbCfg.field.RxBulkAggTOut = 0x80; /* 2006-10-18 */ \
351 RTUSBWriteMACRegister(_pAd, USB_DMA_CFG, UsbCfg.word); \
352 }while(0)
353#endif
354 315
355// reset MAC of a station entry to 0xFFFFFFFFFFFF 316// reset MAC of a station entry to 0xFFFFFFFFFFFF
356#define RT28XX_STA_ENTRY_MAC_RESET(pAd, Wcid) \ 317#define RT28XX_STA_ENTRY_MAC_RESET(pAd, Wcid) \
diff --git a/drivers/staging/rt2870/rt28xx.h b/drivers/staging/rt2870/rt28xx.h
index 81130624c878..1a8a641f2d0f 100644
--- a/drivers/staging/rt2870/rt28xx.h
+++ b/drivers/staging/rt2870/rt28xx.h
@@ -963,21 +963,6 @@ typedef struct _HW_WCID_ENTRY { // 8-byte per entry
963#define HW_DEBUG_SETTING_BASE 0x77f0 // 0x77f0~0x77ff total 16 bytes 963#define HW_DEBUG_SETTING_BASE 0x77f0 // 0x77f0~0x77ff total 16 bytes
964#define HW_DEBUG_SETTING_BASE2 0x7770 // 0x77f0~0x77ff total 16 bytes 964#define HW_DEBUG_SETTING_BASE2 0x7770 // 0x77f0~0x77ff total 16 bytes
965 965
966#if 0
967// on-chip BEACON frame space - base address = 0x7800
968#define HW_BEACON_MAX_SIZE 0x0800 /* unit: byte */
969#define HW_BEACON_BASE0 0x7800
970#define HW_BEACON_BASE1 0x7900
971#define HW_BEACON_BASE2 0x7a00
972#define HW_BEACON_BASE3 0x7b00
973#define HW_BEACON_BASE4 0x7c00
974#define HW_BEACON_BASE5 0x7d00
975#define HW_BEACON_BASE6 0x7e00
976#define HW_BEACON_BASE7 0x7f00
977/* 1. HW_BEACON_OFFSET/64B must be 0;
978 2. BCN_OFFSET0 must also be changed in NICInitializeAsic();
979 3. max 0x0800 for 8 beacon frames; */
980#else
981// In order to support maximum 8 MBSS and its maximum length is 512 for each beacon 966// In order to support maximum 8 MBSS and its maximum length is 512 for each beacon
982// Three section discontinue memory segments will be used. 967// Three section discontinue memory segments will be used.
983// 1. The original region for BCN 0~3 968// 1. The original region for BCN 0~3
@@ -994,7 +979,6 @@ typedef struct _HW_WCID_ENTRY { // 8-byte per entry
994#define HW_BEACON_BASE5 0x7400 979#define HW_BEACON_BASE5 0x7400
995#define HW_BEACON_BASE6 0x5DC0 980#define HW_BEACON_BASE6 0x5DC0
996#define HW_BEACON_BASE7 0x5BC0 981#define HW_BEACON_BASE7 0x5BC0
997#endif
998 982
999#define HW_BEACON_MAX_COUNT 8 983#define HW_BEACON_MAX_COUNT 8
1000#define HW_BEACON_OFFSET 0x0200 984#define HW_BEACON_OFFSET 0x0200
@@ -1029,11 +1013,6 @@ typedef struct _HW_WCID_ENTRY { // 8-byte per entry
1029#define MAX_FIRMWARE_IMAGE_SIZE 0x1000 // 4kbyte 1013#define MAX_FIRMWARE_IMAGE_SIZE 0x1000 // 4kbyte
1030#endif // RT2870 // 1014#endif // RT2870 //
1031 1015
1032// TODO: ????? old RT2560 registers. to keep them or remove them?
1033//#define MCAST0 0x0178 // multicast filter register 0
1034//#define MCAST1 0x017c // multicast filter register 1
1035
1036
1037// ================================================================ 1016// ================================================================
1038// Tx / Rx / Mgmt ring descriptor definition 1017// Tx / Rx / Mgmt ring descriptor definition
1039// ================================================================ 1018// ================================================================
@@ -1047,18 +1026,7 @@ typedef struct _HW_WCID_ENTRY { // 8-byte per entry
1047#define PID_DATA_AMPDU 0x04 1026#define PID_DATA_AMPDU 0x04
1048#define PID_DATA_NO_ACK 0x08 1027#define PID_DATA_NO_ACK 0x08
1049#define PID_DATA_NOT_NORM_ACK 0x03 1028#define PID_DATA_NOT_NORM_ACK 0x03
1050#if 0 1029
1051#define PTYPE_DATA_REQUIRE_ACK 0x00 // b7-6:00, b5-0: 0~59 is MAC table index (AID?), 60~63 is WDS index
1052#define PTYPE_NULL_AT_HIGH_RATE 0x04 // b7-6:01, b5-0: 0~59 is MAC table index (AID?), 60~63 is WDS index
1053#define PTYPE_RESERVED 0x08 // b7-6:10
1054#define PTYPE_SPECIAL 0x0c // b7-6:11
1055
1056// when b3-2=11 (PTYPE_SPECIAL), b1-0 coube be ...
1057#define PSUBTYPE_DATA_NO_ACK 0x00
1058#define PSUBTYPE_MGMT 0x01
1059#define PSUBTYPE_OTHER_CNTL 0x02
1060#define PSUBTYPE_RTS 0x03
1061#endif
1062// value domain of pTxD->HostQId (4-bit: 0~15) 1030// value domain of pTxD->HostQId (4-bit: 0~15)
1063#define QID_AC_BK 1 // meet ACI definition in 802.11e 1031#define QID_AC_BK 1 // meet ACI definition in 802.11e
1064#define QID_AC_BE 0 // meet ACI definition in 802.11e 1032#define QID_AC_BE 0 // meet ACI definition in 802.11e
@@ -1167,11 +1135,6 @@ typedef struct _HW_WCID_ENTRY { // 8-byte per entry
1167 1135
1168#define BBPR94_DEFAULT 0x06 // Add 1 value will gain 1db 1136#define BBPR94_DEFAULT 0x06 // Add 1 value will gain 1db
1169 1137
1170//#define PHY_TR_SWITCH_TIME 5 // usec
1171
1172//#define BBP_R17_LOW_SENSIBILITY 0x50
1173//#define BBP_R17_MID_SENSIBILITY 0x41
1174//#define BBP_R17_DYNAMIC_UP_BOUND 0x40
1175#define RSSI_FOR_VERY_LOW_SENSIBILITY -35 1138#define RSSI_FOR_VERY_LOW_SENSIBILITY -35
1176#define RSSI_FOR_LOW_SENSIBILITY -58 1139#define RSSI_FOR_LOW_SENSIBILITY -58
1177#define RSSI_FOR_MID_LOW_SENSIBILITY -80 1140#define RSSI_FOR_MID_LOW_SENSIBILITY -80
@@ -1211,12 +1174,6 @@ typedef struct _HW_WCID_ENTRY { // 8-byte per entry
1211#define EEPROM_TXPOWER_BYRATE_40MHZ_5G 0x10a // 40MHZ 5G tx power. 1174#define EEPROM_TXPOWER_BYRATE_40MHZ_5G 0x10a // 40MHZ 5G tx power.
1212#define EEPROM_A_TX_PWR_OFFSET 0x78 1175#define EEPROM_A_TX_PWR_OFFSET 0x78
1213#define EEPROM_A_TX2_PWR_OFFSET 0xa6 1176#define EEPROM_A_TX2_PWR_OFFSET 0xa6
1214//#define EEPROM_Japan_TX_PWR_OFFSET 0x90 // 802.11j
1215//#define EEPROM_Japan_TX2_PWR_OFFSET 0xbe
1216//#define EEPROM_TSSI_REF_OFFSET 0x54
1217//#define EEPROM_TSSI_DELTA_OFFSET 0x24
1218//#define EEPROM_CCK_TX_PWR_OFFSET 0x62
1219//#define EEPROM_CALIBRATE_OFFSET 0x7c
1220#define EEPROM_VERSION_OFFSET 0x02 1177#define EEPROM_VERSION_OFFSET 0x02
1221#define EEPROM_FREQ_OFFSET 0x3a 1178#define EEPROM_FREQ_OFFSET 0x3a
1222#define EEPROM_TXPOWER_BYRATE 0xde // 20MHZ power. 1179#define EEPROM_TXPOWER_BYRATE 0xde // 20MHZ power.
@@ -1320,7 +1277,6 @@ typedef struct PACKED _TXWI_STRUC {
1320 UINT32 ShortGI:1; 1277 UINT32 ShortGI:1;
1321 UINT32 STBC:2; // 1: STBC support MCS =0-7, 2,3 : RESERVE 1278 UINT32 STBC:2; // 1: STBC support MCS =0-7, 2,3 : RESERVE
1322 UINT32 Ifs:1; // 1279 UINT32 Ifs:1; //
1323// UINT32 rsv2:2; //channel bandwidth 20MHz or 40 MHz
1324 UINT32 rsv2:1; 1280 UINT32 rsv2:1;
1325 UINT32 TxBF:1; // 3*3 1281 UINT32 TxBF:1; // 3*3
1326 UINT32 PHYMODE:2; 1282 UINT32 PHYMODE:2;
diff --git a/drivers/staging/rt2870/rt_linux.c b/drivers/staging/rt2870/rt_linux.c
index f7964f07ce56..855d9902cd51 100644
--- a/drivers/staging/rt2870/rt_linux.c
+++ b/drivers/staging/rt2870/rt_linux.c
@@ -30,7 +30,6 @@
30ULONG RTDebugLevel = RT_DEBUG_ERROR; 30ULONG RTDebugLevel = RT_DEBUG_ERROR;
31 31
32BUILD_TIMER_FUNCTION(MlmePeriodicExec); 32BUILD_TIMER_FUNCTION(MlmePeriodicExec);
33//BUILD_TIMER_FUNCTION(MlmeRssiReportExec);
34BUILD_TIMER_FUNCTION(AsicRxAntEvalTimeout); 33BUILD_TIMER_FUNCTION(AsicRxAntEvalTimeout);
35BUILD_TIMER_FUNCTION(APSDPeriodicExec); 34BUILD_TIMER_FUNCTION(APSDPeriodicExec);
36BUILD_TIMER_FUNCTION(AsicRfTuningExec); 35BUILD_TIMER_FUNCTION(AsicRfTuningExec);
@@ -515,17 +514,6 @@ PNDIS_PACKET DuplicatePacket(
515 pRetPacket = OSPKT_TO_RTPKT(skb); 514 pRetPacket = OSPKT_TO_RTPKT(skb);
516 } 515 }
517 516
518#if 0
519 if ((skb = __dev_alloc_skb(DataSize + 2+32, MEM_ALLOC_FLAG)) != NULL)
520 {
521 skb_reserve(skb, 2+32);
522 NdisMoveMemory(skb->tail, pData, DataSize);
523 skb_put(skb, DataSize);
524 skb->dev = get_netdev_from_bssid(pAd, FromWhichBSSID);
525 pRetPacket = OSPKT_TO_RTPKT(skb);
526 }
527#endif
528
529 return pRetPacket; 517 return pRetPacket;
530 518
531} 519}
@@ -580,31 +568,6 @@ PNDIS_PACKET duplicate_pkt_with_TKIP_MIC(
580 } 568 }
581 569
582 return OSPKT_TO_RTPKT(skb); 570 return OSPKT_TO_RTPKT(skb);
583
584#if 0
585 if ((data = skb_put(skb, TKIP_TX_MIC_SIZE)) != NULL)
586 { // If we can extend it, well, copy it first.
587 NdisMoveMemory(data, pAd->PrivateInfo.Tx.MIC, TKIP_TX_MIC_SIZE);
588 }
589 else
590 {
591 // Otherwise, copy the packet.
592 newskb = skb_copy_expand(skb, skb_headroom(skb), TKIP_TX_MIC_SIZE, GFP_ATOMIC);
593 dev_kfree_skb_any(skb);
594 if (newskb == NULL)
595 {
596 DBGPRINT(RT_DEBUG_ERROR, ("Extend Tx.MIC to packet failed!, dropping packet\n"));
597 return NULL;
598 }
599 skb = newskb;
600
601 NdisMoveMemory(skb->tail, pAd->PrivateInfo.Tx.MIC, TKIP_TX_MIC_SIZE);
602 skb_put(skb, TKIP_TX_MIC_SIZE);
603 }
604
605 return OSPKT_TO_RTPKT(skb);
606#endif
607
608} 571}
609 572
610 573
@@ -700,9 +663,6 @@ void announce_802_3_packet(
700#else 663#else
701 pRxPkt->protocol = eth_type_trans(pRxPkt, pRxPkt->dev); 664 pRxPkt->protocol = eth_type_trans(pRxPkt, pRxPkt->dev);
702 665
703//#ifdef CONFIG_5VT_ENHANCE
704// *(int*)(pRxPkt->cb) = BRIDGE_TAG;
705//#endif
706 netif_rx(pRxPkt); 666 netif_rx(pRxPkt);
707#endif // IKANOS_VX_1X0 // 667#endif // IKANOS_VX_1X0 //
708} 668}
diff --git a/drivers/staging/rt2870/rt_linux.h b/drivers/staging/rt2870/rt_linux.h
index 7e02533b89e6..728cc38c393b 100644
--- a/drivers/staging/rt2870/rt_linux.h
+++ b/drivers/staging/rt2870/rt_linux.h
@@ -200,9 +200,6 @@ typedef char NDIS_PACKET;
200typedef PNDIS_PACKET * PPNDIS_PACKET; 200typedef PNDIS_PACKET * PPNDIS_PACKET;
201typedef dma_addr_t NDIS_PHYSICAL_ADDRESS; 201typedef dma_addr_t NDIS_PHYSICAL_ADDRESS;
202typedef dma_addr_t * PNDIS_PHYSICAL_ADDRESS; 202typedef dma_addr_t * PNDIS_PHYSICAL_ADDRESS;
203//typedef struct timer_list RALINK_TIMER_STRUCT;
204//typedef struct timer_list * PRALINK_TIMER_STRUCT;
205//typedef struct os_lock NDIS_SPIN_LOCK;
206typedef spinlock_t NDIS_SPIN_LOCK; 203typedef spinlock_t NDIS_SPIN_LOCK;
207typedef struct timer_list NDIS_MINIPORT_TIMER; 204typedef struct timer_list NDIS_MINIPORT_TIMER;
208typedef void * NDIS_HANDLE; 205typedef void * NDIS_HANDLE;
@@ -300,8 +297,6 @@ typedef struct _RT2870_TIMER_ENTRY_
300typedef struct _RT2870_TIMER_QUEUE_ 297typedef struct _RT2870_TIMER_QUEUE_
301{ 298{
302 unsigned int status; 299 unsigned int status;
303 //wait_queue_head_t timerWaitQ;
304 //atomic_t count;
305 UCHAR *pTimerQPoll; 300 UCHAR *pTimerQPoll;
306 RT2870_TIMER_ENTRY *pQPollFreeList; 301 RT2870_TIMER_ENTRY *pQPollFreeList;
307 RT2870_TIMER_ENTRY *pQHead; 302 RT2870_TIMER_ENTRY *pQHead;
@@ -373,20 +368,6 @@ extern ULONG RTDebugLevel;
373 spin_unlock_bh((spinlock_t *)(__lock)); \ 368 spin_unlock_bh((spinlock_t *)(__lock)); \
374} 369}
375 370
376#if 0 // sample, IRQ LOCK
377#define RTMP_IRQ_LOCK(__lock, __irqflags) \
378{ \
379 spin_lock_irqsave((spinlock_t *)__lock, __irqflags); \
380 pAd->irq_disabled |= 1; \
381}
382
383#define RTMP_IRQ_UNLOCK(__lock, __irqflag) \
384{ \
385 pAd->irq_disabled &= 0; \
386 spin_unlock_irqrestore((spinlock_t *)(__lock), ((unsigned long)__irqflag)); \
387}
388#else
389
390// sample, use semaphore lock to replace IRQ lock, 2007/11/15 371// sample, use semaphore lock to replace IRQ lock, 2007/11/15
391#define RTMP_IRQ_LOCK(__lock, __irqflags) \ 372#define RTMP_IRQ_LOCK(__lock, __irqflags) \
392{ \ 373{ \
@@ -410,7 +391,6 @@ extern ULONG RTDebugLevel;
410{ \ 391{ \
411 spin_unlock_irqrestore((spinlock_t *)(__lock), ((unsigned long)__irqflag)); \ 392 spin_unlock_irqrestore((spinlock_t *)(__lock), ((unsigned long)__irqflag)); \
412} 393}
413#endif
414 394
415 395
416 396
@@ -598,7 +578,6 @@ void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
598// check DDK NDIS_PACKET data structure and find out only MiniportReservedEx[0..7] can be used by our driver without 578// check DDK NDIS_PACKET data structure and find out only MiniportReservedEx[0..7] can be used by our driver without
599// ambiguity. Fields after pPacket->MiniportReservedEx[8] may be used by other wrapper layer thus crashes the driver 579// ambiguity. Fields after pPacket->MiniportReservedEx[8] may be used by other wrapper layer thus crashes the driver
600// 580//
601//#define RTMP_GET_PACKET_MR(_p) (RTPKT_TO_OSPKT(_p))
602 581
603// User Priority 582// User Priority
604#define RTMP_SET_PACKET_UP(_p, _prio) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+0] = _prio) 583#define RTMP_SET_PACKET_UP(_p, _prio) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+0] = _prio)
@@ -640,16 +619,7 @@ void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
640#define RTMP_SET_PACKET_MOREDATA(_p, _morebit) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+7] = _morebit) 619#define RTMP_SET_PACKET_MOREDATA(_p, _morebit) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+7] = _morebit)
641#define RTMP_GET_PACKET_MOREDATA(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+7]) 620#define RTMP_GET_PACKET_MOREDATA(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+7])
642 621
643//#define RTMP_SET_PACKET_NET_DEVICE_MBSSID(_p, _bss) (RTPKT_TO_OSPKT(_p)->cb[8] = _bss)
644//#define RTMP_GET_PACKET_NET_DEVICE_MBSSID(_p) (RTPKT_TO_OSPKT(_p)->cb[8])
645
646
647 622
648
649#if 0
650//#define RTMP_SET_PACKET_DHCP(_p, _flg) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11] = _flg)
651//#define RTMP_GET_PACKET_DHCP(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11])
652#else
653// 623//
654// Sepcific Pakcet Type definition 624// Sepcific Pakcet Type definition
655// 625//
@@ -729,8 +699,6 @@ void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
729 699
730#define RTMP_GET_PACKET_IPV4(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11] & RTMP_PACKET_SPECIFIC_IPV4) 700#define RTMP_GET_PACKET_IPV4(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11] & RTMP_PACKET_SPECIFIC_IPV4)
731 701
732#endif
733
734 702
735// If this flag is set, it indicates that this EAPoL frame MUST be clear. 703// If this flag is set, it indicates that this EAPoL frame MUST be clear.
736#define RTMP_SET_PACKET_CLEAR_EAP_FRAME(_p, _flg) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+12] = _flg) 704#define RTMP_SET_PACKET_CLEAR_EAP_FRAME(_p, _flg) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+12] = _flg)
diff --git a/drivers/staging/rt2870/rt_main_dev.c b/drivers/staging/rt2870/rt_main_dev.c
index 669b18eaa655..919f5bc1a71a 100644
--- a/drivers/staging/rt2870/rt_main_dev.c
+++ b/drivers/staging/rt2870/rt_main_dev.c
@@ -68,7 +68,6 @@ static int rt28xx_init(IN struct net_device *net_dev);
68INT rt28xx_send_packets(IN struct sk_buff *skb_p, IN struct net_device *net_dev); 68INT rt28xx_send_packets(IN struct sk_buff *skb_p, IN struct net_device *net_dev);
69 69
70static void CfgInitHook(PRTMP_ADAPTER pAd); 70static void CfgInitHook(PRTMP_ADAPTER pAd);
71//static BOOLEAN RT28XXAvailRANameAssign(IN CHAR *name_p);
72 71
73extern const struct iw_handler_def rt28xx_iw_handler_def; 72extern const struct iw_handler_def rt28xx_iw_handler_def;
74 73
@@ -288,9 +287,6 @@ int rt28xx_close(IN PNET_DEV dev)
288 remove_wait_queue (&unlink_wakeup, &wait); 287 remove_wait_queue (&unlink_wakeup, &wait);
289#endif // RT2870 // 288#endif // RT2870 //
290 289
291 //RTUSBCleanUpMLMEWaitQueue(pAd); /*not used in RT28xx*/
292
293
294#ifdef RT2870 290#ifdef RT2870
295 // We need clear timerQ related structure before exits of the timer thread. 291 // We need clear timerQ related structure before exits of the timer thread.
296 RT2870_TimerQ_Exit(pAd); 292 RT2870_TimerQ_Exit(pAd);
@@ -400,9 +396,6 @@ static int rt28xx_init(IN struct net_device *net_dev)
400 if (Status != NDIS_STATUS_SUCCESS) 396 if (Status != NDIS_STATUS_SUCCESS)
401 goto err1; 397 goto err1;
402 398
403// COPY_MAC_ADDR(pAd->ApCfg.MBSSID[apidx].Bssid, netif->hwaddr);
404// pAd->bForcePrintTX = TRUE;
405
406 CfgInitHook(pAd); 399 CfgInitHook(pAd);
407 400
408 NdisAllocateSpinLock(&pAd->MacTabLock); 401 NdisAllocateSpinLock(&pAd->MacTabLock);
@@ -442,7 +435,6 @@ static int rt28xx_init(IN struct net_device *net_dev)
442 435
443 436
444 //Init Ba Capability parameters. 437 //Init Ba Capability parameters.
445// RT28XX_BA_INIT(pAd);
446 pAd->CommonCfg.DesiredHtPhy.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity; 438 pAd->CommonCfg.DesiredHtPhy.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity;
447 pAd->CommonCfg.DesiredHtPhy.AmsduEnable = (USHORT)pAd->CommonCfg.BACapability.field.AmsduEnable; 439 pAd->CommonCfg.DesiredHtPhy.AmsduEnable = (USHORT)pAd->CommonCfg.BACapability.field.AmsduEnable;
448 pAd->CommonCfg.DesiredHtPhy.AmsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize; 440 pAd->CommonCfg.DesiredHtPhy.AmsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize;
@@ -452,13 +444,6 @@ static int rt28xx_init(IN struct net_device *net_dev)
452 pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize; 444 pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize;
453 pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity; 445 pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity;
454 446
455 // after reading Registry, we now know if in AP mode or STA mode
456
457 // Load 8051 firmware; crash when FW image not existent
458 // Status = NICLoadFirmware(pAd);
459 // if (Status != NDIS_STATUS_SUCCESS)
460 // break;
461
462 printk("2. Phy Mode = %d\n", pAd->CommonCfg.PhyMode); 447 printk("2. Phy Mode = %d\n", pAd->CommonCfg.PhyMode);
463 448
464 // We should read EEPROM for all cases. rt2860b 449 // We should read EEPROM for all cases. rt2860b
@@ -490,15 +475,6 @@ static int rt28xx_init(IN struct net_device *net_dev)
490 NICInitRT30xxRFRegisters(pAd); 475 NICInitRT30xxRFRegisters(pAd);
491#endif // RT2870 // 476#endif // RT2870 //
492 477
493#if 0
494 // Patch cardbus controller if EEPROM said so.
495 if (pAd->bTest1 == FALSE)
496 RTMPPatchCardBus(pAd);
497#endif
498
499
500// APInitialize(pAd);
501
502#ifdef IKANOS_VX_1X0 478#ifdef IKANOS_VX_1X0
503 VR_IKANOS_FP_Init(pAd->ApCfg.BssidNum, pAd->PermanentAddress); 479 VR_IKANOS_FP_Init(pAd->ApCfg.BssidNum, pAd->PermanentAddress);
504#endif // IKANOS_VX_1X0 // 480#endif // IKANOS_VX_1X0 //
@@ -519,16 +495,13 @@ static int rt28xx_init(IN struct net_device *net_dev)
519 // 495 //
520 if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE)) 496 if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
521 { 497 {
522// NdisMDeregisterInterrupt(&pAd->Interrupt);
523 RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE); 498 RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE);
524 } 499 }
525// RTMPFreeAdapter(pAd); // we will free it in disconnect()
526 } 500 }
527 else if (pAd) 501 else if (pAd)
528 { 502 {
529 // Microsoft HCT require driver send a disconnect event after driver initialization. 503 // Microsoft HCT require driver send a disconnect event after driver initialization.
530 OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED); 504 OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
531// pAd->IndicateMediaState = NdisMediaStateDisconnected;
532 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_MEDIA_STATE_CHANGE); 505 RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_MEDIA_STATE_CHANGE);
533 506
534 DBGPRINT(RT_DEBUG_TRACE, ("NDIS_STATUS_MEDIA_DISCONNECT Event B!\n")); 507 DBGPRINT(RT_DEBUG_TRACE, ("NDIS_STATUS_MEDIA_DISCONNECT Event B!\n"));
@@ -561,7 +534,6 @@ err3:
561 MlmeHalt(pAd); 534 MlmeHalt(pAd);
562err2: 535err2:
563 RTMPFreeTxRxRingMemory(pAd); 536 RTMPFreeTxRxRingMemory(pAd);
564// RTMPFreeAdapter(pAd);
565err1: 537err1:
566 os_free_mem(pAd, pAd->mpdu_blk_pool.mem); // free BA pool 538 os_free_mem(pAd, pAd->mpdu_blk_pool.mem); // free BA pool
567 RT28XX_IRQ_RELEASE(net_dev); 539 RT28XX_IRQ_RELEASE(net_dev);
@@ -647,34 +619,6 @@ int rt28xx_open(IN PNET_DEV dev)
647 printk("0x1300 = %08x\n", reg); 619 printk("0x1300 = %08x\n", reg);
648 } 620 }
649 621
650 {
651// u32 reg;
652// u8 byte;
653// u16 tmp;
654
655// RTMP_IO_READ32(pAd, XIFS_TIME_CFG, &reg);
656
657// tmp = 0x0805;
658// reg = (reg & 0xffff0000) | tmp;
659// RTMP_IO_WRITE32(pAd, XIFS_TIME_CFG, reg);
660
661 }
662
663#if 0
664 /*
665 * debugging helper
666 * show the size of main table in Adapter structure
667 * MacTab -- 185K
668 * BATable -- 137K
669 * Total -- 385K !!!!! (5/26/2006)
670 */
671 printk("sizeof(pAd->MacTab) = %ld\n", sizeof(pAd->MacTab));
672 printk("sizeof(pAd->AccessControlList) = %ld\n", sizeof(pAd->AccessControlList));
673 printk("sizeof(pAd->ApCfg) = %ld\n", sizeof(pAd->ApCfg));
674 printk("sizeof(pAd->BATable) = %ld\n", sizeof(pAd->BATable));
675 BUG();
676#endif
677
678 return (retval); 622 return (retval);
679 623
680err: 624err:
@@ -704,10 +648,6 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p
704 CHAR slot_name[IFNAMSIZ]; 648 CHAR slot_name[IFNAMSIZ];
705 struct net_device *device; 649 struct net_device *device;
706 650
707
708 //ether_setup(dev);
709// dev->set_multicast_list = ieee80211_set_multicast_list;
710// dev->change_mtu = ieee80211_change_mtu;
711#if WIRELESS_EXT >= 12 651#if WIRELESS_EXT >= 12
712 if (pAd->OpMode == OPMODE_STA) 652 if (pAd->OpMode == OPMODE_STA)
713 { 653 {
@@ -718,8 +658,6 @@ static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER p
718#if WIRELESS_EXT < 21 658#if WIRELESS_EXT < 21
719 dev->get_wireless_stats = rt28xx_get_wireless_stats; 659 dev->get_wireless_stats = rt28xx_get_wireless_stats;
720#endif 660#endif
721// dev->uninit = ieee80211_if_reinit;
722// dev->destructor = ieee80211_if_free;
723 dev->priv_flags = INT_MAIN; 661 dev->priv_flags = INT_MAIN;
724 dev->netdev_ops = &rt2870_netdev_ops; 662 dev->netdev_ops = &rt2870_netdev_ops;
725 // find available device name 663 // find available device name
@@ -786,10 +724,6 @@ INT __devinit rt28xx_probe(
786 724
787 DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION)); 725 DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION));
788 726
789 // Check chipset vendor/product ID
790// if (RT28XXChipsetCheck(_dev_p) == FALSE)
791// goto err_out;
792
793 net_dev = alloc_etherdev(sizeof(PRTMP_ADAPTER)); 727 net_dev = alloc_etherdev(sizeof(PRTMP_ADAPTER));
794 if (net_dev == NULL) 728 if (net_dev == NULL)
795 { 729 {
@@ -798,10 +732,6 @@ INT __devinit rt28xx_probe(
798 goto err_out; 732 goto err_out;
799 } 733 }
800 734
801// sample
802// if (rt_ieee80211_if_setup(net_dev) != NDIS_STATUS_SUCCESS)
803// goto err_out;
804
805 netif_stop_queue(net_dev); 735 netif_stop_queue(net_dev);
806 736
807/* for supporting Network Manager */ 737/* for supporting Network Manager */
@@ -825,9 +755,6 @@ INT __devinit rt28xx_probe(
825 755
826 pAd->StaCfg.OriDevType = net_dev->type; 756 pAd->StaCfg.OriDevType = net_dev->type;
827 757
828 // Find and assign a free interface name, raxx
829// RT28XXAvailRANameAssign(net_dev->name);
830
831 // Post config 758 // Post config
832 if (RT28XXProbePostConfig(_dev_p, pAd, 0) == FALSE) 759 if (RT28XXProbePostConfig(_dev_p, pAd, 0) == FALSE)
833 goto err_out_unmap; 760 goto err_out_unmap;
@@ -909,16 +836,7 @@ int rt28xx_packet_xmit(struct sk_buff *skb)
909 goto done; 836 goto done;
910 } 837 }
911 838
912#if 0
913// if ((pkt->data[0] & 0x1) == 0)
914 {
915 //hex_dump(__func__, pkt->data, pkt->len);
916 printk("pPacket = %x\n", pPacket);
917 }
918#endif
919
920 RTMP_SET_PACKET_5VT(pPacket, 0); 839 RTMP_SET_PACKET_5VT(pPacket, 0);
921// MiniportMMRequest(pAd, pkt->data, pkt->len);
922#ifdef CONFIG_5VT_ENHANCE 840#ifdef CONFIG_5VT_ENHANCE
923 if (*(int*)(skb->cb) == BRIDGE_TAG) { 841 if (*(int*)(skb->cb) == BRIDGE_TAG) {
924 RTMP_SET_PACKET_5VT(pPacket, 1); 842 RTMP_SET_PACKET_5VT(pPacket, 1);
@@ -976,56 +894,6 @@ void CfgInitHook(PRTMP_ADAPTER pAd)
976 pAd->bBroadComHT = TRUE; 894 pAd->bBroadComHT = TRUE;
977} /* End of CfgInitHook */ 895} /* End of CfgInitHook */
978 896
979
980#if 0 // Not used now, should keep it in our source tree??
981/*
982========================================================================
983Routine Description:
984 Find and assign a free interface name (raxx).
985
986Arguments:
987 *name_p the interface name pointer
988
989Return Value:
990 TRUE OK
991 FALSE FAIL
992
993Note:
994========================================================================
995*/
996static BOOLEAN RT28XXAvailRANameAssign(
997 IN CHAR *name_p)
998{
999 CHAR slot_name[IFNAMSIZ];
1000 struct net_device *device;
1001 UINT32 if_id;
1002
1003
1004 for(if_id=0; if_id<8; if_id++)
1005 {
1006 sprintf(slot_name, "ra%d", if_id);
1007
1008 for(device=dev_base; device!=NULL; device=device->next)
1009 {
1010 if (strncmp(device->name, slot_name, 4) == 0)
1011 break;
1012 }
1013
1014 if (device == NULL)
1015 break;
1016 }
1017
1018 if (if_id == 8)
1019 {
1020 DBGPRINT(RT_DEBUG_ERROR, ("No available slot name\n"));
1021 return FALSE;
1022 }
1023
1024 sprintf(name_p, "ra%d", if_id);
1025 return TRUE;
1026} /* End of RT28XXAvailRANameAssign */
1027#endif
1028
1029#if WIRELESS_EXT >= 12 897#if WIRELESS_EXT >= 12
1030// This function will be called when query /proc 898// This function will be called when query /proc
1031struct iw_statistics *rt28xx_get_wireless_stats( 899struct iw_statistics *rt28xx_get_wireless_stats(
diff --git a/drivers/staging/rt2870/rt_profile.c b/drivers/staging/rt2870/rt_profile.c
index f95ef8f0384a..3496622082ed 100644
--- a/drivers/staging/rt2870/rt_profile.c
+++ b/drivers/staging/rt2870/rt_profile.c
@@ -1121,14 +1121,10 @@ NDIS_STATUS RTMPReadParametersHook(
1121 //TxBurst 1121 //TxBurst
1122 if(RTMPGetKeyParameter("TxBurst", tmpbuf, 10, buffer)) 1122 if(RTMPGetKeyParameter("TxBurst", tmpbuf, 10, buffer))
1123 { 1123 {
1124//#ifdef WIFI_TEST
1125// pAd->CommonCfg.bEnableTxBurst = FALSE;
1126//#else
1127 if(simple_strtol(tmpbuf, 0, 10) != 0) //Enable 1124 if(simple_strtol(tmpbuf, 0, 10) != 0) //Enable
1128 pAd->CommonCfg.bEnableTxBurst = TRUE; 1125 pAd->CommonCfg.bEnableTxBurst = TRUE;
1129 else //Disable 1126 else //Disable
1130 pAd->CommonCfg.bEnableTxBurst = FALSE; 1127 pAd->CommonCfg.bEnableTxBurst = FALSE;
1131//#endif
1132 DBGPRINT(RT_DEBUG_TRACE, ("TxBurst=%d\n", pAd->CommonCfg.bEnableTxBurst)); 1128 DBGPRINT(RT_DEBUG_TRACE, ("TxBurst=%d\n", pAd->CommonCfg.bEnableTxBurst));
1133 } 1129 }
1134 1130
@@ -1296,7 +1292,6 @@ NDIS_STATUS RTMPReadParametersHook(
1296 pAd->StaCfg.OrigWepStatus = pAd->StaCfg.WepStatus; 1292 pAd->StaCfg.OrigWepStatus = pAd->StaCfg.WepStatus;
1297 pAd->StaCfg.bMixCipher = FALSE; 1293 pAd->StaCfg.bMixCipher = FALSE;
1298 1294
1299 //RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, 0);
1300 DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __func__, pAd->StaCfg.WepStatus)); 1295 DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __func__, pAd->StaCfg.WepStatus));
1301 } 1296 }
1302 } 1297 }
@@ -1342,21 +1337,6 @@ NDIS_STATUS RTMPReadParametersHook(
1342 } 1337 }
1343 else if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone) 1338 else if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
1344 { 1339 {
1345 /*
1346 NdisZeroMemory(&pAd->SharedKey[BSS0][0], sizeof(CIPHER_KEY));
1347 pAd->SharedKey[BSS0][0].KeyLen = LEN_TKIP_EK;
1348 NdisMoveMemory(pAd->SharedKey[BSS0][0].Key, pAd->StaCfg.PMK, LEN_TKIP_EK);
1349 NdisMoveMemory(pAd->SharedKey[BSS0][0].RxMic, &pAd->StaCfg.PMK[16], LEN_TKIP_RXMICK);
1350 NdisMoveMemory(pAd->SharedKey[BSS0][0].TxMic, &pAd->StaCfg.PMK[16], LEN_TKIP_TXMICK);
1351
1352 // Decide its ChiperAlg
1353 if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
1354 pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_TKIP;
1355 else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
1356 pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_AES;
1357 else
1358 pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_NONE;
1359 */
1360 pAd->StaCfg.WpaState = SS_NOTUSE; 1340 pAd->StaCfg.WpaState = SS_NOTUSE;
1361 } 1341 }
1362 1342
@@ -1368,23 +1348,6 @@ NDIS_STATUS RTMPReadParametersHook(
1368 //DefaultKeyID, KeyType, KeyStr 1348 //DefaultKeyID, KeyType, KeyStr
1369 rtmp_read_key_parms_from_file(pAd, tmpbuf, buffer); 1349 rtmp_read_key_parms_from_file(pAd, tmpbuf, buffer);
1370 1350
1371
1372 //HSCounter
1373 /*if(RTMPGetKeyParameter("HSCounter", tmpbuf, 10, buffer))
1374 {
1375 switch (simple_strtol(tmpbuf, 0, 10))
1376 {
1377 case 1: //Enable
1378 pAd->CommonCfg.bEnableHSCounter = TRUE;
1379 break;
1380 case 0: //Disable
1381 default:
1382 pAd->CommonCfg.bEnableHSCounter = FALSE;
1383 break;
1384 }
1385 DBGPRINT(RT_DEBUG_TRACE, "HSCounter=%d\n", pAd->CommonCfg.bEnableHSCounter);
1386 }*/
1387
1388 HTParametersHook(pAd, tmpbuf, buffer); 1351 HTParametersHook(pAd, tmpbuf, buffer);
1389 1352
1390 { 1353 {
@@ -1489,10 +1452,6 @@ NDIS_STATUS RTMPReadParametersHook(
1489 } 1452 }
1490 1453
1491 set_fs(orgfs); 1454 set_fs(orgfs);
1492#if 0
1493 current->fsuid = orgfsuid;
1494 current->fsgid = orgfsgid;
1495#endif
1496 1455
1497 kfree(buffer); 1456 kfree(buffer);
1498 kfree(tmpbuf); 1457 kfree(tmpbuf);
@@ -1816,7 +1775,6 @@ static void HTParametersHook(
1816 { 1775 {
1817 Value = simple_strtol(pValueStr, 0, 10); 1776 Value = simple_strtol(pValueStr, 0, 10);
1818 1777
1819// if ((Value >= 0 && Value <= 15) || (Value == 32))
1820 if ((Value >= 0 && Value <= 23) || (Value == 32)) // 3*3 1778 if ((Value >= 0 && Value <= 23) || (Value == 32)) // 3*3
1821 { 1779 {
1822 pAd->StaCfg.DesiredTransmitSetting.field.MCS = Value; 1780 pAd->StaCfg.DesiredTransmitSetting.field.MCS = Value;
diff --git a/drivers/staging/rt2870/rtmp.h b/drivers/staging/rt2870/rtmp.h
index c7b74ad039b6..cfe218247829 100644
--- a/drivers/staging/rt2870/rtmp.h
+++ b/drivers/staging/rt2870/rtmp.h
@@ -45,8 +45,6 @@
45 45
46#include "aironet.h" 46#include "aironet.h"
47 47
48//#define DBG 1
49
50//#define DBG_DIAGNOSE 1 48//#define DBG_DIAGNOSE 1
51 49
52#define VIRTUAL_IF_INC(__pAd) ((__pAd)->VirtualIfCnt++) 50#define VIRTUAL_IF_INC(__pAd) ((__pAd)->VirtualIfCnt++)
@@ -142,7 +140,6 @@ typedef struct _RX_CONTEXT
142 PURB pUrb; 140 PURB pUrb;
143 //These 2 Boolean shouldn't both be 1 at the same time. 141 //These 2 Boolean shouldn't both be 1 at the same time.
144 ULONG BulkInOffset; // number of packets waiting for reordering . 142 ULONG BulkInOffset; // number of packets waiting for reordering .
145// BOOLEAN ReorderInUse; // At least one packet in this buffer are in reordering buffer and wait for receive indication
146 BOOLEAN bRxHandling; // Notify this packet is being process now. 143 BOOLEAN bRxHandling; // Notify this packet is being process now.
147 BOOLEAN InUse; // USB Hardware Occupied. Wait for USB HW to put packet. 144 BOOLEAN InUse; // USB Hardware Occupied. Wait for USB HW to put packet.
148 BOOLEAN Readable; // Receive Complete back. OK for driver to indicate receiving packet. 145 BOOLEAN Readable; // Receive Complete back. OK for driver to indicate receiving packet.
@@ -579,8 +576,6 @@ typedef struct _QUEUE_HEADER {
579// 576//
580// Common fragment list structure - Identical to the scatter gather frag list structure 577// Common fragment list structure - Identical to the scatter gather frag list structure
581// 578//
582//#define RTMP_SCATTER_GATHER_ELEMENT SCATTER_GATHER_ELEMENT
583//#define PRTMP_SCATTER_GATHER_ELEMENT PSCATTER_GATHER_ELEMENT
584#define NIC_MAX_PHYS_BUF_COUNT 8 579#define NIC_MAX_PHYS_BUF_COUNT 8
585 580
586typedef struct _RTMP_SCATTER_GATHER_ELEMENT { 581typedef struct _RTMP_SCATTER_GATHER_ELEMENT {
@@ -1290,21 +1285,14 @@ typedef struct _BA_REC_ENTRY {
1290 UCHAR Wcid; 1285 UCHAR Wcid;
1291 UCHAR TID; 1286 UCHAR TID;
1292 UCHAR BAWinSize; // 7.3.1.14. each buffer is capable of holding a max AMSDU or MSDU. 1287 UCHAR BAWinSize; // 7.3.1.14. each buffer is capable of holding a max AMSDU or MSDU.
1293 //UCHAR NumOfRxPkt;
1294 //UCHAR Curindidx; // the head in the RX reordering buffer
1295 USHORT LastIndSeq; 1288 USHORT LastIndSeq;
1296// USHORT LastIndSeqAtTimer;
1297 USHORT TimeOutValue; 1289 USHORT TimeOutValue;
1298 RALINK_TIMER_STRUCT RECBATimer; 1290 RALINK_TIMER_STRUCT RECBATimer;
1299 ULONG LastIndSeqAtTimer; 1291 ULONG LastIndSeqAtTimer;
1300 ULONG nDropPacket; 1292 ULONG nDropPacket;
1301 ULONG rcvSeq; 1293 ULONG rcvSeq;
1302 REC_BLOCKACK_STATUS REC_BA_Status; 1294 REC_BLOCKACK_STATUS REC_BA_Status;
1303// UCHAR RxBufIdxUsed;
1304 // corresponding virtual address for RX reordering packet storage.
1305 //RTMP_REORDERDMABUF MAP_RXBuf[MAX_RX_REORDERBUF];
1306 NDIS_SPIN_LOCK RxReRingLock; // Rx Ring spinlock 1295 NDIS_SPIN_LOCK RxReRingLock; // Rx Ring spinlock
1307// struct _BA_REC_ENTRY *pNext;
1308 PVOID pAdapter; 1296 PVOID pAdapter;
1309 struct reordering_list list; 1297 struct reordering_list list;
1310} BA_REC_ENTRY, *PBA_REC_ENTRY; 1298} BA_REC_ENTRY, *PBA_REC_ENTRY;
@@ -1382,8 +1370,6 @@ typedef struct _IOT_STRUC {
1382// This is the registry setting for 802.11n transmit setting. Used in advanced page. 1370// This is the registry setting for 802.11n transmit setting. Used in advanced page.
1383typedef union _REG_TRANSMIT_SETTING { 1371typedef union _REG_TRANSMIT_SETTING {
1384 struct { 1372 struct {
1385 //UINT32 PhyMode:4;
1386 //UINT32 MCS:7; // MCS
1387 UINT32 rsv0:10; 1373 UINT32 rsv0:10;
1388 UINT32 TxBF:1; 1374 UINT32 TxBF:1;
1389 UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz 1375 UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
@@ -1481,7 +1467,6 @@ typedef struct _MULTISSID_STRUCT {
1481 DESIRED_TRANSMIT_SETTING DesiredTransmitSetting; // Desired transmit setting. this is for reading registry setting only. not useful. 1467 DESIRED_TRANSMIT_SETTING DesiredTransmitSetting; // Desired transmit setting. this is for reading registry setting only. not useful.
1482 BOOLEAN bAutoTxRateSwitch; 1468 BOOLEAN bAutoTxRateSwitch;
1483 1469
1484 //CIPHER_KEY SharedKey[SHARE_KEY_NUM]; // ref pAd->SharedKey[BSS][4]
1485 UCHAR DefaultKeyId; 1470 UCHAR DefaultKeyId;
1486 1471
1487 UCHAR TxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11, ... 1472 UCHAR TxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11, ...
@@ -1489,8 +1474,6 @@ typedef struct _MULTISSID_STRUCT {
1489 UCHAR DesiredRatesIndex; 1474 UCHAR DesiredRatesIndex;
1490 UCHAR MaxTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11 1475 UCHAR MaxTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11
1491 1476
1492// ULONG TimBitmap; // bit0 for broadcast, 1 for AID1, 2 for AID2, ...so on
1493// ULONG TimBitmap2; // b0 for AID32, b1 for AID33, ... and so on
1494 UCHAR TimBitmaps[WLAN_MAX_NUM_OF_TIM]; 1477 UCHAR TimBitmaps[WLAN_MAX_NUM_OF_TIM];
1495 1478
1496 // WPA 1479 // WPA
@@ -1587,23 +1570,6 @@ typedef struct _COMMON_CONFIG {
1587 UCHAR Channel; 1570 UCHAR Channel;
1588 UCHAR CentralChannel; // Central Channel when using 40MHz is indicating. not real channel. 1571 UCHAR CentralChannel; // Central Channel when using 40MHz is indicating. not real channel.
1589 1572
1590#if 0 // move to STA_ADMIN_CONFIG
1591 UCHAR DefaultKeyId;
1592
1593 NDIS_802_11_PRIVACY_FILTER PrivacyFilter; // PrivacyFilter enum for 802.1X
1594 NDIS_802_11_AUTHENTICATION_MODE AuthMode; // This should match to whatever microsoft defined
1595 NDIS_802_11_WEP_STATUS WepStatus;
1596 NDIS_802_11_WEP_STATUS OrigWepStatus; // Original wep status set from OID
1597
1598 // Add to support different cipher suite for WPA2/WPA mode
1599 NDIS_802_11_ENCRYPTION_STATUS GroupCipher; // Multicast cipher suite
1600 NDIS_802_11_ENCRYPTION_STATUS PairCipher; // Unicast cipher suite
1601 BOOLEAN bMixCipher; // Indicate current Pair & Group use different cipher suites
1602 USHORT RsnCapability;
1603
1604 NDIS_802_11_WEP_STATUS GroupKeyWepStatus;
1605#endif
1606
1607 UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES]; 1573 UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
1608 UCHAR SupRateLen; 1574 UCHAR SupRateLen;
1609 UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES]; 1575 UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
@@ -1625,15 +1591,11 @@ typedef struct _COMMON_CONFIG {
1625 ULONG TriggerTimerCount; 1591 ULONG TriggerTimerCount;
1626 UCHAR MaxSPLength; 1592 UCHAR MaxSPLength;
1627 UCHAR BBPCurrentBW; // BW_10, BW_20, BW_40 1593 UCHAR BBPCurrentBW; // BW_10, BW_20, BW_40
1628 // move to MULTISSID_STRUCT for MBSS
1629 //HTTRANSMIT_SETTING HTPhyMode, MaxHTPhyMode, MinHTPhyMode;// For transmit phy setting in TXWI.
1630 REG_TRANSMIT_SETTING RegTransmitSetting; //registry transmit setting. this is for reading registry setting only. not useful. 1594 REG_TRANSMIT_SETTING RegTransmitSetting; //registry transmit setting. this is for reading registry setting only. not useful.
1631 //UCHAR FixedTxMode; // Fixed Tx Mode (CCK, OFDM), for HT fixed tx mode (GF, MIX) , refer to RegTransmitSetting.field.HTMode
1632 UCHAR TxRate; // Same value to fill in TXD. TxRate is 6-bit 1595 UCHAR TxRate; // Same value to fill in TXD. TxRate is 6-bit
1633 UCHAR MaxTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11 1596 UCHAR MaxTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11
1634 UCHAR TxRateIndex; // Tx rate index in RateSwitchTable 1597 UCHAR TxRateIndex; // Tx rate index in RateSwitchTable
1635 UCHAR TxRateTableSize; // Valid Tx rate table size in RateSwitchTable 1598 UCHAR TxRateTableSize; // Valid Tx rate table size in RateSwitchTable
1636 //BOOLEAN bAutoTxRateSwitch;
1637 UCHAR MinTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11 1599 UCHAR MinTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11
1638 UCHAR RtsRate; // RATE_xxx 1600 UCHAR RtsRate; // RATE_xxx
1639 HTTRANSMIT_SETTING MlmeTransmit; // MGMT frame PHY rate setting when operatin at Ht rate. 1601 HTTRANSMIT_SETTING MlmeTransmit; // MGMT frame PHY rate setting when operatin at Ht rate.
@@ -2066,7 +2028,6 @@ typedef struct _MAC_TABLE_ENTRY {
2066 UCHAR CurrTxRateIndex; 2028 UCHAR CurrTxRateIndex;
2067 // to record the each TX rate's quality. 0 is best, the bigger the worse. 2029 // to record the each TX rate's quality. 0 is best, the bigger the worse.
2068 USHORT TxQuality[MAX_STEP_OF_TX_RATE_SWITCH]; 2030 USHORT TxQuality[MAX_STEP_OF_TX_RATE_SWITCH];
2069// USHORT OneSecTxOkCount;
2070 UINT32 OneSecTxNoRetryOkCount; 2031 UINT32 OneSecTxNoRetryOkCount;
2071 UINT32 OneSecTxRetryOkCount; 2032 UINT32 OneSecTxRetryOkCount;
2072 UINT32 OneSecTxFailCount; 2033 UINT32 OneSecTxFailCount;
@@ -2235,29 +2196,20 @@ typedef struct _APCLI_STRUCT {
2235 UCHAR PSK[100]; // reserve PSK key material 2196 UCHAR PSK[100]; // reserve PSK key material
2236 UCHAR PSKLen; 2197 UCHAR PSKLen;
2237 UCHAR PMK[32]; // WPA PSK mode PMK 2198 UCHAR PMK[32]; // WPA PSK mode PMK
2238 //UCHAR PTK[64]; // WPA PSK mode PTK
2239 UCHAR GTK[32]; // GTK from authenticator 2199 UCHAR GTK[32]; // GTK from authenticator
2240 2200
2241 //CIPHER_KEY PairwiseKey;
2242 CIPHER_KEY SharedKey[SHARE_KEY_NUM]; 2201 CIPHER_KEY SharedKey[SHARE_KEY_NUM];
2243 UCHAR DefaultKeyId; 2202 UCHAR DefaultKeyId;
2244 2203
2245 // WPA 802.1x port control, WPA_802_1X_PORT_SECURED, WPA_802_1X_PORT_NOT_SECURED
2246 //UCHAR PortSecured;
2247
2248 // store RSN_IE built by driver 2204 // store RSN_IE built by driver
2249 UCHAR RSN_IE[MAX_LEN_OF_RSNIE]; // The content saved here should be convert to little-endian format. 2205 UCHAR RSN_IE[MAX_LEN_OF_RSNIE]; // The content saved here should be convert to little-endian format.
2250 UCHAR RSNIE_Len; 2206 UCHAR RSNIE_Len;
2251 2207
2252 // For WPA countermeasures 2208 // For WPA countermeasures
2253 ULONG LastMicErrorTime; // record last MIC error time 2209 ULONG LastMicErrorTime; // record last MIC error time
2254 //ULONG MicErrCnt; // Should be 0, 1, 2, then reset to zero (after disassoiciation).
2255 BOOLEAN bBlockAssoc; // Block associate attempt for 60 seconds after counter measure occurred. 2210 BOOLEAN bBlockAssoc; // Block associate attempt for 60 seconds after counter measure occurred.
2256 2211
2257 // For WPA-PSK supplicant state 2212 // For WPA-PSK supplicant state
2258 //WPA_STATE WpaState; // Default is SS_NOTUSE
2259 //UCHAR ReplayCounter[8];
2260 //UCHAR ANonce[32]; // ANonce for WPA-PSK from authenticator
2261 UCHAR SNonce[32]; // SNonce for WPA-PSK 2213 UCHAR SNonce[32]; // SNonce for WPA-PSK
2262 UCHAR GNonce[32]; // GNonce for WPA-PSK from authenticator 2214 UCHAR GNonce[32]; // GNonce for WPA-PSK from authenticator
2263 2215
@@ -2310,15 +2262,12 @@ typedef struct _RtmpDiagStrcut_
2310 // Tx Related Count 2262 // Tx Related Count
2311 USHORT TxDataCnt[DIAGNOSE_TIME]; 2263 USHORT TxDataCnt[DIAGNOSE_TIME];
2312 USHORT TxFailCnt[DIAGNOSE_TIME]; 2264 USHORT TxFailCnt[DIAGNOSE_TIME];
2313// USHORT TxDescCnt[DIAGNOSE_TIME][16]; // TxDesc queue length in scale of 0~14, >=15
2314 USHORT TxDescCnt[DIAGNOSE_TIME][24]; // 3*3 // TxDesc queue length in scale of 0~14, >=15 2265 USHORT TxDescCnt[DIAGNOSE_TIME][24]; // 3*3 // TxDesc queue length in scale of 0~14, >=15
2315// USHORT TxMcsCnt[DIAGNOSE_TIME][16]; // TxDate MCS Count in range from 0 to 15, step in 1.
2316 USHORT TxMcsCnt[DIAGNOSE_TIME][24]; // 3*3 2266 USHORT TxMcsCnt[DIAGNOSE_TIME][24]; // 3*3
2317 USHORT TxSWQueCnt[DIAGNOSE_TIME][9]; // TxSwQueue length in scale of 0, 1, 2, 3, 4, 5, 6, 7, >=8 2267 USHORT TxSWQueCnt[DIAGNOSE_TIME][9]; // TxSwQueue length in scale of 0, 1, 2, 3, 4, 5, 6, 7, >=8
2318 2268
2319 USHORT TxAggCnt[DIAGNOSE_TIME]; 2269 USHORT TxAggCnt[DIAGNOSE_TIME];
2320 USHORT TxNonAggCnt[DIAGNOSE_TIME]; 2270 USHORT TxNonAggCnt[DIAGNOSE_TIME];
2321// USHORT TxAMPDUCnt[DIAGNOSE_TIME][16]; // 10 sec, TxDMA APMDU Aggregation count in range from 0 to 15, in setp of 1.
2322 USHORT TxAMPDUCnt[DIAGNOSE_TIME][24]; // 3*3 // 10 sec, TxDMA APMDU Aggregation count in range from 0 to 15, in setp of 1. 2271 USHORT TxAMPDUCnt[DIAGNOSE_TIME][24]; // 3*3 // 10 sec, TxDMA APMDU Aggregation count in range from 0 to 15, in setp of 1.
2323 USHORT TxRalinkCnt[DIAGNOSE_TIME]; // TxRalink Aggregation Count in 1 sec scale. 2272 USHORT TxRalinkCnt[DIAGNOSE_TIME]; // TxRalink Aggregation Count in 1 sec scale.
2324 USHORT TxAMSDUCnt[DIAGNOSE_TIME]; // TxAMSUD Aggregation Count in 1 sec scale. 2273 USHORT TxAMSDUCnt[DIAGNOSE_TIME]; // TxAMSUD Aggregation Count in 1 sec scale.
@@ -2326,7 +2275,6 @@ typedef struct _RtmpDiagStrcut_
2326 // Rx Related Count 2275 // Rx Related Count
2327 USHORT RxDataCnt[DIAGNOSE_TIME]; // Rx Total Data count. 2276 USHORT RxDataCnt[DIAGNOSE_TIME]; // Rx Total Data count.
2328 USHORT RxCrcErrCnt[DIAGNOSE_TIME]; 2277 USHORT RxCrcErrCnt[DIAGNOSE_TIME];
2329// USHORT RxMcsCnt[DIAGNOSE_TIME][16]; // Rx MCS Count in range from 0 to 15, step in 1.
2330 USHORT RxMcsCnt[DIAGNOSE_TIME][24]; // 3*3 2278 USHORT RxMcsCnt[DIAGNOSE_TIME][24]; // 3*3
2331}RtmpDiagStruct; 2279}RtmpDiagStruct;
2332#endif // DBG_DIAGNOSE // 2280#endif // DBG_DIAGNOSE //
@@ -2661,7 +2609,6 @@ typedef struct _RTMP_ADAPTER
2661 // ---------------------------- 2609 // ----------------------------
2662 // DEBUG paramerts 2610 // DEBUG paramerts
2663 // ---------------------------- 2611 // ----------------------------
2664 //ULONG DebugSetting[4];
2665 BOOLEAN bBanAllBaSetup; 2612 BOOLEAN bBanAllBaSetup;
2666 BOOLEAN bPromiscuous; 2613 BOOLEAN bPromiscuous;
2667 2614
@@ -2771,7 +2718,6 @@ typedef struct _CISCO_IAPP_CONTENT_
2771 2718
2772typedef struct _RX_BLK_ 2719typedef struct _RX_BLK_
2773{ 2720{
2774// RXD_STRUC RxD; // sample
2775 RT28XX_RXD_STRUC RxD; 2721 RT28XX_RXD_STRUC RxD;
2776 PRXWI_STRUC pRxWI; 2722 PRXWI_STRUC pRxWI;
2777 PHEADER_802_11 pHeader; 2723 PHEADER_802_11 pHeader;
@@ -2859,7 +2805,6 @@ typedef struct _TX_BLK_
2859#define fTX_bAckRequired 0x0002 // the packet need ack response 2805#define fTX_bAckRequired 0x0002 // the packet need ack response
2860#define fTX_bPiggyBack 0x0004 // Legacy device use Piggback or not 2806#define fTX_bPiggyBack 0x0004 // Legacy device use Piggback or not
2861#define fTX_bHTRate 0x0008 // allow to use HT rate 2807#define fTX_bHTRate 0x0008 // allow to use HT rate
2862//#define fTX_bForceLowRate 0x0010 // force to use Low Rate
2863#define fTX_bForceNonQoS 0x0010 // force to transmit frame without WMM-QoS in HT mode 2808#define fTX_bForceNonQoS 0x0010 // force to transmit frame without WMM-QoS in HT mode
2864#define fTX_bAllowFrag 0x0020 // allow to fragment the packet, A-MPDU, A-MSDU, A-Ralink is not allowed to fragment 2809#define fTX_bAllowFrag 0x0020 // allow to fragment the packet, A-MPDU, A-MSDU, A-Ralink is not allowed to fragment
2865#define fTX_bMoreData 0x0040 // there are more data packets in PowerSave Queue 2810#define fTX_bMoreData 0x0040 // there are more data packets in PowerSave Queue
@@ -3022,13 +2967,6 @@ VOID NICUpdateFifoStaCounters(
3022VOID NICUpdateRawCounters( 2967VOID NICUpdateRawCounters(
3023 IN PRTMP_ADAPTER pAd); 2968 IN PRTMP_ADAPTER pAd);
3024 2969
3025#if 0
3026ULONG RTMPEqualMemory(
3027 IN PVOID pSrc1,
3028 IN PVOID pSrc2,
3029 IN ULONG Length);
3030#endif
3031
3032ULONG RTMPNotAllZero( 2970ULONG RTMPNotAllZero(
3033 IN PVOID pSrc1, 2971 IN PVOID pSrc1,
3034 IN ULONG Length); 2972 IN ULONG Length);
@@ -3277,12 +3215,6 @@ BOOLEAN PeerIsAggreOn(
3277 IN ULONG TxRate, 3215 IN ULONG TxRate,
3278 IN PMAC_TABLE_ENTRY pMacEntry); 3216 IN PMAC_TABLE_ENTRY pMacEntry);
3279 3217
3280#if 0 // It's not be used
3281HTTRANSMIT_SETTING *GetTxMode(
3282 IN PRTMP_ADAPTER pAd,
3283 IN TX_BLK *pTxBlk);
3284#endif
3285
3286NDIS_STATUS Sniff2BytesFromNdisBuffer( 3218NDIS_STATUS Sniff2BytesFromNdisBuffer(
3287 IN PNDIS_BUFFER pFirstBuffer, 3219 IN PNDIS_BUFFER pFirstBuffer,
3288 IN UCHAR DesiredOffset, 3220 IN UCHAR DesiredOffset,
@@ -3600,12 +3532,6 @@ VOID AsicSetBssid(
3600VOID AsicSetMcastWC( 3532VOID AsicSetMcastWC(
3601 IN PRTMP_ADAPTER pAd); 3533 IN PRTMP_ADAPTER pAd);
3602 3534
3603#if 0 // removed by AlbertY
3604VOID AsicSetBssidWC(
3605 IN PRTMP_ADAPTER pAd,
3606 IN PUCHAR pBssid);
3607#endif
3608
3609VOID AsicDelWcidTab( 3535VOID AsicDelWcidTab(
3610 IN PRTMP_ADAPTER pAd, 3536 IN PRTMP_ADAPTER pAd,
3611 IN UCHAR Wcid); 3537 IN UCHAR Wcid);
@@ -3633,17 +3559,6 @@ VOID AsicSetSlotTime(
3633 IN PRTMP_ADAPTER pAd, 3559 IN PRTMP_ADAPTER pAd,
3634 IN BOOLEAN bUseShortSlotTime); 3560 IN BOOLEAN bUseShortSlotTime);
3635 3561
3636#if 0
3637VOID AsicAddWcidCipherEntry(
3638 IN PRTMP_ADAPTER pAd,
3639 IN UCHAR WCID,
3640 IN UCHAR BssIndex,
3641 IN UCHAR KeyTable,
3642 IN UCHAR CipherAlg,
3643 IN PUCHAR pAddr,
3644 IN CIPHER_KEY *pCipherKey);
3645#endif
3646
3647VOID AsicAddSharedKeyEntry( 3562VOID AsicAddSharedKeyEntry(
3648 IN PRTMP_ADAPTER pAd, 3563 IN PRTMP_ADAPTER pAd,
3649 IN UCHAR BssIndex, 3564 IN UCHAR BssIndex,
@@ -4472,12 +4387,6 @@ UCHAR ChannelSanity(
4472NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity( 4387NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity(
4473 IN PBSS_ENTRY pBss); 4388 IN PBSS_ENTRY pBss);
4474 4389
4475#if 0 // It's omitted
4476NDIS_STATUS RTMPWepKeySanity(
4477 IN PRTMP_ADAPTER pAdapter,
4478 IN PVOID pBuf);
4479#endif
4480
4481BOOLEAN MlmeDelBAReqSanity( 4390BOOLEAN MlmeDelBAReqSanity(
4482 IN PRTMP_ADAPTER pAd, 4391 IN PRTMP_ADAPTER pAd,
4483 IN VOID *Msg, 4392 IN VOID *Msg,
@@ -4784,12 +4693,6 @@ BOOLEAN RTMPSoftDecryptAES(
4784 IN ULONG DataByteCnt, 4693 IN ULONG DataByteCnt,
4785 IN PCIPHER_KEY pWpaKey); 4694 IN PCIPHER_KEY pWpaKey);
4786 4695
4787#if 0 // removed by AlbertY
4788NDIS_STATUS RTMPWPAAddKeyProc(
4789 IN PRTMP_ADAPTER pAd,
4790 IN PVOID pBuf);
4791#endif
4792
4793// 4696//
4794// Prototypes of function definition in cmm_info.c 4697// Prototypes of function definition in cmm_info.c
4795// 4698//
@@ -5210,30 +5113,12 @@ VOID RTMPHandleSTAKey(
5210 IN MAC_TABLE_ENTRY *pEntry, 5113 IN MAC_TABLE_ENTRY *pEntry,
5211 IN MLME_QUEUE_ELEM *Elem); 5114 IN MLME_QUEUE_ELEM *Elem);
5212 5115
5213#if 0 // merge into PeerPairMsg4Action
5214VOID Wpa1PeerPairMsg4Action(
5215 IN PRTMP_ADAPTER pAd,
5216 IN MAC_TABLE_ENTRY *pEntry,
5217 IN MLME_QUEUE_ELEM *Elem);
5218
5219VOID Wpa2PeerPairMsg4Action(
5220 IN PRTMP_ADAPTER pAd,
5221 IN PMAC_TABLE_ENTRY pEntry,
5222 IN MLME_QUEUE_ELEM *Elem);
5223#endif // 0 //
5224
5225VOID PeerGroupMsg2Action( 5116VOID PeerGroupMsg2Action(
5226 IN PRTMP_ADAPTER pAd, 5117 IN PRTMP_ADAPTER pAd,
5227 IN PMAC_TABLE_ENTRY pEntry, 5118 IN PMAC_TABLE_ENTRY pEntry,
5228 IN VOID *Msg, 5119 IN VOID *Msg,
5229 IN UINT MsgLen); 5120 IN UINT MsgLen);
5230 5121
5231#if 0 // replaced by WPAStart2WayGroupHS
5232NDIS_STATUS APWpaHardTransmit(
5233 IN PRTMP_ADAPTER pAd,
5234 IN PMAC_TABLE_ENTRY pEntry);
5235#endif // 0 //
5236
5237VOID PairDisAssocAction( 5122VOID PairDisAssocAction(
5238 IN PRTMP_ADAPTER pAd, 5123 IN PRTMP_ADAPTER pAd,
5239 IN PMAC_TABLE_ENTRY pEntry, 5124 IN PMAC_TABLE_ENTRY pEntry,
@@ -5321,9 +5206,6 @@ VOID RTMPSendTriggerFrame(
5321 IN BOOLEAN bQosNull); 5206 IN BOOLEAN bQosNull);
5322 5207
5323 5208
5324//typedef void (*TIMER_FUNCTION)(unsigned long);
5325
5326
5327/* timeout -- ms */ 5209/* timeout -- ms */
5328VOID RTMP_SetPeriodicTimer( 5210VOID RTMP_SetPeriodicTimer(
5329 IN NDIS_MINIPORT_TIMER *pTimer, 5211 IN NDIS_MINIPORT_TIMER *pTimer,
@@ -6428,18 +6310,6 @@ NDIS_STATUS RTMPWPAAddKeyProc(
6428VOID AsicRxAntEvalAction( 6310VOID AsicRxAntEvalAction(
6429 IN PRTMP_ADAPTER pAd); 6311 IN PRTMP_ADAPTER pAd);
6430 6312
6431#if 0 // Mark because not used in RT28xx.
6432NTSTATUS RTUSBRxPacket(
6433 IN PRTMP_ADAPTER pAd,
6434 IN BOOLEAN bBulkReceive);
6435
6436VOID RTUSBDequeueMLMEPacket(
6437 IN PRTMP_ADAPTER pAd);
6438
6439VOID RTUSBCleanUpMLMEWaitQueue(
6440 IN PRTMP_ADAPTER pAd);
6441#endif
6442
6443void append_pkt( 6313void append_pkt(
6444 IN PRTMP_ADAPTER pAd, 6314 IN PRTMP_ADAPTER pAd,
6445 IN PUCHAR pHeader802_3, 6315 IN PUCHAR pHeader802_3,
@@ -6468,14 +6338,6 @@ VOID RTUSBMlmeHardTransmit(
6468INT MlmeThread( 6338INT MlmeThread(
6469 IN PVOID Context); 6339 IN PVOID Context);
6470 6340
6471#if 0
6472VOID RTUSBResumeMsduTransmission(
6473 IN PRTMP_ADAPTER pAd);
6474
6475VOID RTUSBSuspendMsduTransmission(
6476 IN PRTMP_ADAPTER pAd);
6477#endif
6478
6479// 6341//
6480// Function Prototype in rtusb_data.c 6342// Function Prototype in rtusb_data.c
6481// 6343//
diff --git a/drivers/staging/rt2870/rtmp_def.h b/drivers/staging/rt2870/rtmp_def.h
index e61f56f6f747..0ebb0208ba29 100644
--- a/drivers/staging/rt2870/rtmp_def.h
+++ b/drivers/staging/rt2870/rtmp_def.h
@@ -54,8 +54,6 @@
54#define NIC_TAG ((ULONG)'0682') 54#define NIC_TAG ((ULONG)'0682')
55#define NIC_DBG_STRING ("**RT28xx**") 55#define NIC_DBG_STRING ("**RT28xx**")
56 56
57//#define PACKED
58
59#define RALINK_2883_VERSION ((UINT32)0x28830300) 57#define RALINK_2883_VERSION ((UINT32)0x28830300)
60#define RALINK_2880E_VERSION ((UINT32)0x28720200) 58#define RALINK_2880E_VERSION ((UINT32)0x28720200)
61#define RALINK_3070_VERSION ((UINT32)0x30700200) 59#define RALINK_3070_VERSION ((UINT32)0x30700200)
@@ -179,16 +177,6 @@
179#define fRTMP_ADAPTER_MEDIA_STATE_CHANGE 0x20000000 177#define fRTMP_ADAPTER_MEDIA_STATE_CHANGE 0x20000000
180#define fRTMP_ADAPTER_IDLE_RADIO_OFF 0x40000000 178#define fRTMP_ADAPTER_IDLE_RADIO_OFF 0x40000000
181 179
182// Lock bit for accessing different ring buffers
183//#define fRTMP_ADAPTER_TX_RING_BUSY 0x80000000
184//#define fRTMP_ADAPTER_MGMT_RING_BUSY 0x40000000
185//#define fRTMP_ADAPTER_ATIM_RING_BUSY 0x20000000
186//#define fRTMP_ADAPTER_RX_RING_BUSY 0x10000000
187
188// Lock bit for accessing different queue
189//#define fRTMP_ADAPTER_TX_QUEUE_BUSY 0x08000000
190//#define fRTMP_ADAPTER_MGMT_QUEUE_BUSY 0x04000000
191
192// 180//
193// STA operation status flags 181// STA operation status flags
194// 182//
@@ -198,7 +186,6 @@
198#define fOP_STATUS_SHORT_SLOT_INUSED 0x00000008 186#define fOP_STATUS_SHORT_SLOT_INUSED 0x00000008
199#define fOP_STATUS_SHORT_PREAMBLE_INUSED 0x00000010 187#define fOP_STATUS_SHORT_PREAMBLE_INUSED 0x00000010
200#define fOP_STATUS_RECEIVE_DTIM 0x00000020 188#define fOP_STATUS_RECEIVE_DTIM 0x00000020
201//#define fOP_STATUS_TX_RATE_SWITCH_ENABLED 0x00000040
202#define fOP_STATUS_MEDIA_STATE_CONNECTED 0x00000080 189#define fOP_STATUS_MEDIA_STATE_CONNECTED 0x00000080
203#define fOP_STATUS_WMM_INUSED 0x00000100 190#define fOP_STATUS_WMM_INUSED 0x00000100
204#define fOP_STATUS_AGGREGATION_INUSED 0x00000200 191#define fOP_STATUS_AGGREGATION_INUSED 0x00000200
@@ -238,7 +225,6 @@
238// 225//
239// STA configuration flags 226// STA configuration flags
240// 227//
241//#define fSTA_CFG_ENABLE_TX_BURST 0x00000001
242 228
243// 802.11n Operating Mode Definition. 0-3 also used in ASICUPdateProtect switch case 229// 802.11n Operating Mode Definition. 0-3 also used in ASICUPdateProtect switch case
244#define HT_NO_PROTECT 0 230#define HT_NO_PROTECT 0
@@ -433,14 +419,10 @@
433#define PWR_ACTIVE 0 419#define PWR_ACTIVE 0
434#define PWR_SAVE 1 420#define PWR_SAVE 1
435#define PWR_MMPS 2 //MIMO power save 421#define PWR_MMPS 2 //MIMO power save
436//#define PWR_UNKNOWN 2
437 422
438// Auth and Assoc mode related definitions 423// Auth and Assoc mode related definitions
439#define AUTH_MODE_OPEN 0x00 424#define AUTH_MODE_OPEN 0x00
440#define AUTH_MODE_KEY 0x01 425#define AUTH_MODE_KEY 0x01
441//#define AUTH_MODE_AUTO_SWITCH 0x03
442//#define AUTH_MODE_DEAUTH 0x04
443//#define AUTH_MODE_UPLAYER 0x05 // reserved for 802.11i use
444 426
445// BSS Type definitions 427// BSS Type definitions
446#define BSS_ADHOC 0 // = Ndis802_11IBSS 428#define BSS_ADHOC 0 // = Ndis802_11IBSS
diff --git a/drivers/staging/rt2870/sta/connect.c b/drivers/staging/rt2870/sta/connect.c
index 76f1b98c462b..3fae7ce3f281 100644
--- a/drivers/staging/rt2870/sta/connect.c
+++ b/drivers/staging/rt2870/sta/connect.c
@@ -533,13 +533,6 @@ VOID CntlOidRTBssidProc(
533 pAd->MlmeAux.SsidBssTab.BssNr = 1; 533 pAd->MlmeAux.SsidBssTab.BssNr = 1;
534 NdisMoveMemory(&pAd->MlmeAux.SsidBssTab.BssEntry[0], &pAd->ScanTab.BssEntry[BssIdx], sizeof(BSS_ENTRY)); 534 NdisMoveMemory(&pAd->MlmeAux.SsidBssTab.BssEntry[0], &pAd->ScanTab.BssEntry[BssIdx], sizeof(BSS_ENTRY));
535 535
536 //pAd->MlmeAux.AutoReconnectSsidLen = pAd->ScanTab.BssEntry[BssIdx].SsidLen;
537 //NdisMoveMemory(pAd->MlmeAux.AutoReconnectSsid, pAd->ScanTab.BssEntry[BssIdx].Ssid, pAd->ScanTab.BssEntry[BssIdx].SsidLen);
538
539 // Add SSID into MlmeAux for site surey joining hidden SSID
540 //pAd->MlmeAux.SsidLen = pAd->ScanTab.BssEntry[BssIdx].SsidLen;
541 //NdisMoveMemory(pAd->MlmeAux.Ssid, pAd->ScanTab.BssEntry[BssIdx].Ssid, pAd->MlmeAux.SsidLen);
542
543 // 2002-11-26 skip the following checking. i.e. if user wants to re-connect to same AP 536 // 2002-11-26 skip the following checking. i.e. if user wants to re-connect to same AP
544 // we just follow normal procedure. The reason of user doing this may because he/she changed 537 // we just follow normal procedure. The reason of user doing this may because he/she changed
545 // AP to another channel, but we still received BEACON from it thus don't claim Link Down. 538 // AP to another channel, but we still received BEACON from it thus don't claim Link Down.
@@ -1917,9 +1910,6 @@ VOID LinkDown(
1917 // Update extra information to link is up 1910 // Update extra information to link is up
1918 pAd->ExtraInfo = GENERAL_LINK_DOWN; 1911 pAd->ExtraInfo = GENERAL_LINK_DOWN;
1919 1912
1920 //pAd->StaCfg.AdhocBOnlyJoined = FALSE;
1921 //pAd->StaCfg.AdhocBGJoined = FALSE;
1922 //pAd->StaCfg.Adhoc20NJoined = FALSE;
1923 pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE; 1913 pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE;
1924 1914
1925 // Reset the Current AP's IP address 1915 // Reset the Current AP's IP address
diff --git a/drivers/staging/rt2870/sta/rtmp_data.c b/drivers/staging/rt2870/sta/rtmp_data.c
index e84cb6f3a98f..d615d0ab2bbf 100644
--- a/drivers/staging/rt2870/sta/rtmp_data.c
+++ b/drivers/staging/rt2870/sta/rtmp_data.c
@@ -63,7 +63,6 @@ VOID STARxEAPOLFrameIndicate(
63 int idx = 0; 63 int idx = 0;
64 64
65 DBGPRINT_RAW(RT_DEBUG_TRACE, ("Receive EAP-SUCCESS Packet\n")); 65 DBGPRINT_RAW(RT_DEBUG_TRACE, ("Receive EAP-SUCCESS Packet\n"));
66 //pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
67 STA_PORT_SECURED(pAd); 66 STA_PORT_SECURED(pAd);
68 67
69 if (pAd->StaCfg.IEEE8021x_required_keys == FALSE) 68 if (pAd->StaCfg.IEEE8021x_required_keys == FALSE)
@@ -864,7 +863,6 @@ NDIS_STATUS STASendPacket(
864 UINT SrcBufLen; 863 UINT SrcBufLen;
865 UINT AllowFragSize; 864 UINT AllowFragSize;
866 UCHAR NumberOfFrag; 865 UCHAR NumberOfFrag;
867// UCHAR RTSRequired;
868 UCHAR QueIdx, UserPriority; 866 UCHAR QueIdx, UserPriority;
869 MAC_TABLE_ENTRY *pEntry = NULL; 867 MAC_TABLE_ENTRY *pEntry = NULL;
870 unsigned int IrqFlags; 868 unsigned int IrqFlags;
@@ -1078,7 +1076,6 @@ NDIS_STATUS STASendPacket(
1078 if ((pAd->CommonCfg.BACapability.field.AutoBA == TRUE)&& 1076 if ((pAd->CommonCfg.BACapability.field.AutoBA == TRUE)&&
1079 IS_HT_STA(pEntry)) 1077 IS_HT_STA(pEntry))
1080 { 1078 {
1081 //PMAC_TABLE_ENTRY pMacEntry = &pAd->MacTab.Content[BSSID_WCID];
1082 if (((pEntry->TXBAbitmap & (1<<UserPriority)) == 0) && 1079 if (((pEntry->TXBAbitmap & (1<<UserPriority)) == 0) &&
1083 ((pEntry->BADeclineBitmap & (1<<UserPriority)) == 0) && 1080 ((pEntry->BADeclineBitmap & (1<<UserPriority)) == 0) &&
1084 (pEntry->PortSecured == WPA_802_1X_PORT_SECURED) 1081 (pEntry->PortSecured == WPA_802_1X_PORT_SECURED)
@@ -1133,7 +1130,6 @@ NDIS_STATUS RTMPFreeTXDRequest(
1133 IN UCHAR NumberRequired, 1130 IN UCHAR NumberRequired,
1134 IN PUCHAR FreeNumberIs) 1131 IN PUCHAR FreeNumberIs)
1135{ 1132{
1136 //ULONG FreeNumber = 0;
1137 NDIS_STATUS Status = NDIS_STATUS_FAILURE; 1133 NDIS_STATUS Status = NDIS_STATUS_FAILURE;
1138 unsigned long IrqFlags; 1134 unsigned long IrqFlags;
1139 HT_TX_CONTEXT *pHTTXContext; 1135 HT_TX_CONTEXT *pHTTXContext;
diff --git a/drivers/staging/rt2870/sta/sync.c b/drivers/staging/rt2870/sta/sync.c
index 7533b9d04802..b0f9ddd1ac2f 100644
--- a/drivers/staging/rt2870/sta/sync.c
+++ b/drivers/staging/rt2870/sta/sync.c
@@ -546,7 +546,6 @@ VOID PeerBeaconAtScanAction(
546 UCHAR NewExtChannelOffset = 0xff; 546 UCHAR NewExtChannelOffset = 0xff;
547 547
548 548
549 // NdisFillMemory(Ssid, MAX_LEN_OF_SSID, 0x00);
550 pFrame = (PFRAME_802_11) Elem->Msg; 549 pFrame = (PFRAME_802_11) Elem->Msg;
551 // Init Variable IE structure 550 // Init Variable IE structure
552 pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE; 551 pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
diff --git a/drivers/staging/rt2870/sta/wpa.c b/drivers/staging/rt2870/sta/wpa.c
index 61d8cb948573..c906eea163d3 100644
--- a/drivers/staging/rt2870/sta/wpa.c
+++ b/drivers/staging/rt2870/sta/wpa.c
@@ -1214,7 +1214,6 @@ VOID Wpa2PairMsg3Action(
1214 RTMPToWirelessSta(pAd, Header802_3, LENGTH_802_3, (PUCHAR)&Packet, Packet.Body_Len[1] + 4, TRUE); 1214 RTMPToWirelessSta(pAd, Header802_3, LENGTH_802_3, (PUCHAR)&Packet, Packet.Body_Len[1] + 4, TRUE);
1215 1215
1216 // set 802.1x port control 1216 // set 802.1x port control
1217 //pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
1218 STA_PORT_SECURED(pAd); 1217 STA_PORT_SECURED(pAd);
1219 1218
1220 // Indicate Connected for GUI 1219 // Indicate Connected for GUI
@@ -1410,7 +1409,6 @@ VOID WpaGroupMsg1Action(
1410 NULL); 1409 NULL);
1411 1410
1412 // set 802.1x port control 1411 // set 802.1x port control
1413 //pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
1414 STA_PORT_SECURED(pAd); 1412 STA_PORT_SECURED(pAd);
1415 1413
1416 // Indicate Connected for GUI 1414 // Indicate Connected for GUI
@@ -1897,17 +1895,6 @@ VOID RTMPReportMicError(
1897 pAd->StaCfg.LastMicErrorTime = Now; 1895 pAd->StaCfg.LastMicErrorTime = Now;
1898 // Violate MIC error counts, MIC countermeasures kicks in 1896 // Violate MIC error counts, MIC countermeasures kicks in
1899 pAd->StaCfg.MicErrCnt++; 1897 pAd->StaCfg.MicErrCnt++;
1900 // We shall block all reception
1901 // We shall clean all Tx ring and disassoicate from AP after next EAPOL frame
1902 //
1903 // No necessary to clean all Tx ring, on RTMPHardTransmit will stop sending non-802.1X EAPOL packets
1904 // if pAd->StaCfg.MicErrCnt greater than 2.
1905 //
1906 // RTMPRingCleanUp(pAd, QID_AC_BK);
1907 // RTMPRingCleanUp(pAd, QID_AC_BE);
1908 // RTMPRingCleanUp(pAd, QID_AC_VI);
1909 // RTMPRingCleanUp(pAd, QID_AC_VO);
1910 // RTMPRingCleanUp(pAd, QID_HCCA);
1911 } 1898 }
1912 } 1899 }
1913 else 1900 else
diff --git a/drivers/staging/rt2870/sta_ioctl.c b/drivers/staging/rt2870/sta_ioctl.c
index cc13e5e40bcb..1edf33224d78 100644
--- a/drivers/staging/rt2870/sta_ioctl.c
+++ b/drivers/staging/rt2870/sta_ioctl.c
@@ -336,7 +336,6 @@ VOID RTMPAddKey(
336 if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2) 336 if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2)
337 { 337 {
338 // set 802.1x port control 338 // set 802.1x port control
339 //pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
340 STA_PORT_SECURED(pAd); 339 STA_PORT_SECURED(pAd);
341 340
342 // Indicate Connected for GUI 341 // Indicate Connected for GUI
@@ -386,7 +385,6 @@ VOID RTMPAddKey(
386 NULL); 385 NULL);
387 386
388 // set 802.1x port control 387 // set 802.1x port control
389 //pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
390 STA_PORT_SECURED(pAd); 388 STA_PORT_SECURED(pAd);
391 389
392 // Indicate Connected for GUI 390 // Indicate Connected for GUI
@@ -1608,7 +1606,6 @@ int rt_ioctl_siwencode(struct net_device *dev,
1608 else if ((erq->length == 0) && 1606 else if ((erq->length == 0) &&
1609 (erq->flags & IW_ENCODE_RESTRICTED || erq->flags & IW_ENCODE_OPEN)) 1607 (erq->flags & IW_ENCODE_RESTRICTED || erq->flags & IW_ENCODE_OPEN))
1610 { 1608 {
1611 //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
1612 STA_PORT_SECURED(pAdapter); 1609 STA_PORT_SECURED(pAdapter);
1613 pAdapter->StaCfg.PairCipher = Ndis802_11WEPEnabled; 1610 pAdapter->StaCfg.PairCipher = Ndis802_11WEPEnabled;
1614 pAdapter->StaCfg.GroupCipher = Ndis802_11WEPEnabled; 1611 pAdapter->StaCfg.GroupCipher = Ndis802_11WEPEnabled;
@@ -2234,7 +2231,6 @@ int rt_ioctl_siwauth(struct net_device *dev,
2234 } 2231 }
2235 else if (param->value == 0) 2232 else if (param->value == 0)
2236 { 2233 {
2237 //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
2238 STA_PORT_SECURED(pAdapter); 2234 STA_PORT_SECURED(pAdapter);
2239 } 2235 }
2240 DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_KEY_MGMT - param->value = %d!\n", __func__, param->value)); 2236 DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_KEY_MGMT - param->value = %d!\n", __func__, param->value));
@@ -2242,14 +2238,6 @@ int rt_ioctl_siwauth(struct net_device *dev,
2242 case IW_AUTH_RX_UNENCRYPTED_EAPOL: 2238 case IW_AUTH_RX_UNENCRYPTED_EAPOL:
2243 break; 2239 break;
2244 case IW_AUTH_PRIVACY_INVOKED: 2240 case IW_AUTH_PRIVACY_INVOKED:
2245 /*if (param->value == 0)
2246 {
2247 pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeOpen;
2248 pAdapter->StaCfg.WepStatus = Ndis802_11WEPDisabled;
2249 pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
2250 pAdapter->StaCfg.PairCipher = Ndis802_11WEPDisabled;
2251 pAdapter->StaCfg.GroupCipher = Ndis802_11WEPDisabled;
2252 }*/
2253 DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_PRIVACY_INVOKED - param->value = %d!\n", __func__, param->value)); 2241 DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_PRIVACY_INVOKED - param->value = %d!\n", __func__, param->value));
2254 break; 2242 break;
2255 case IW_AUTH_DROP_UNENCRYPTED: 2243 case IW_AUTH_DROP_UNENCRYPTED:
@@ -2257,7 +2245,6 @@ int rt_ioctl_siwauth(struct net_device *dev,
2257 pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED; 2245 pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
2258 else 2246 else
2259 { 2247 {
2260 //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
2261 STA_PORT_SECURED(pAdapter); 2248 STA_PORT_SECURED(pAdapter);
2262 } 2249 }
2263 DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_VERSION - param->value = %d!\n", __func__, param->value)); 2250 DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_VERSION - param->value = %d!\n", __func__, param->value));
@@ -2445,7 +2432,6 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
2445 fnSetCipherKey(pAdapter, keyIdx, CIPHER_TKIP, FALSE, ext); 2432 fnSetCipherKey(pAdapter, keyIdx, CIPHER_TKIP, FALSE, ext);
2446 if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2) 2433 if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2)
2447 { 2434 {
2448 //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
2449 STA_PORT_SECURED(pAdapter); 2435 STA_PORT_SECURED(pAdapter);
2450 } 2436 }
2451 } 2437 }
@@ -2454,7 +2440,6 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
2454 fnSetCipherKey(pAdapter, keyIdx, CIPHER_TKIP, TRUE, ext); 2440 fnSetCipherKey(pAdapter, keyIdx, CIPHER_TKIP, TRUE, ext);
2455 2441
2456 // set 802.1x port control 2442 // set 802.1x port control
2457 //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
2458 STA_PORT_SECURED(pAdapter); 2443 STA_PORT_SECURED(pAdapter);
2459 } 2444 }
2460 } 2445 }
@@ -2466,7 +2451,6 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
2466 { 2451 {
2467 fnSetCipherKey(pAdapter, keyIdx, CIPHER_AES, FALSE, ext); 2452 fnSetCipherKey(pAdapter, keyIdx, CIPHER_AES, FALSE, ext);
2468 if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2) 2453 if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2)
2469 //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
2470 STA_PORT_SECURED(pAdapter); 2454 STA_PORT_SECURED(pAdapter);
2471 } 2455 }
2472 else if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) 2456 else if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY)
@@ -2474,7 +2458,6 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
2474 fnSetCipherKey(pAdapter, keyIdx, CIPHER_AES, TRUE, ext); 2458 fnSetCipherKey(pAdapter, keyIdx, CIPHER_AES, TRUE, ext);
2475 2459
2476 // set 802.1x port control 2460 // set 802.1x port control
2477 //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
2478 STA_PORT_SECURED(pAdapter); 2461 STA_PORT_SECURED(pAdapter);
2479 } 2462 }
2480 break; 2463 break;
@@ -2723,7 +2706,6 @@ rt_private_ioctl_bbp(struct net_device *dev, struct iw_request_info *info,
2723 CHAR *this_char; 2706 CHAR *this_char;
2724 CHAR *value = NULL; 2707 CHAR *value = NULL;
2725 UCHAR regBBP = 0; 2708 UCHAR regBBP = 0;
2726// CHAR arg[255]={0};
2727 UINT32 bbpId; 2709 UINT32 bbpId;
2728 UINT32 bbpValue; 2710 UINT32 bbpValue;
2729 BOOLEAN bIsPrintAllBBP = FALSE; 2711 BOOLEAN bIsPrintAllBBP = FALSE;
@@ -2918,7 +2900,6 @@ int rt_ioctl_giwrate(struct net_device *dev,
2918 2900
2919 if (ht_setting.field.MODE >= MODE_HTMIX) 2901 if (ht_setting.field.MODE >= MODE_HTMIX)
2920 { 2902 {
2921// rate_index = 12 + ((UCHAR)ht_setting.field.BW *16) + ((UCHAR)ht_setting.field.ShortGI *32) + ((UCHAR)ht_setting.field.MCS);
2922 rate_index = 12 + ((UCHAR)ht_setting.field.BW *24) + ((UCHAR)ht_setting.field.ShortGI *48) + ((UCHAR)ht_setting.field.MCS); 2903 rate_index = 12 + ((UCHAR)ht_setting.field.BW *24) + ((UCHAR)ht_setting.field.ShortGI *48) + ((UCHAR)ht_setting.field.MCS);
2923 } 2904 }
2924 else 2905 else