mib.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. /*
  2. * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
  3. * All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along
  16. * with this program; if not, write to the Free Software Foundation, Inc.,
  17. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  18. *
  19. * File: mib.c
  20. *
  21. * Purpose: Implement MIB Data Structure
  22. *
  23. * Author: Tevin Chen
  24. *
  25. * Date: May 21, 1996
  26. *
  27. * Functions:
  28. * STAvClearAllCounter - Clear All MIB Counter
  29. * STAvUpdateIstStatCounter - Update ISR statistic counter
  30. * STAvUpdateRDStatCounter - Update Rx statistic counter
  31. * STAvUpdateRDStatCounterEx - Update Rx statistic counter and copy rcv data
  32. * STAvUpdateTDStatCounter - Update Tx statistic counter
  33. * STAvUpdateTDStatCounterEx - Update Tx statistic counter and copy tx data
  34. * STAvUpdate802_11Counter - Update 802.11 mib counter
  35. *
  36. * Revision History:
  37. *
  38. */
  39. #include "upc.h"
  40. #include "mac.h"
  41. #include "tether.h"
  42. #include "mib.h"
  43. #include "wctl.h"
  44. #include "baseband.h"
  45. /*--------------------- Static Definitions -------------------------*/
  46. static int msglevel =MSG_LEVEL_INFO;
  47. /*--------------------- Static Classes ----------------------------*/
  48. /*--------------------- Static Variables --------------------------*/
  49. /*--------------------- Static Functions --------------------------*/
  50. /*--------------------- Export Variables --------------------------*/
  51. /*--------------------- Export Functions --------------------------*/
  52. /*
  53. * Description: Clear All Statistic Counter
  54. *
  55. * Parameters:
  56. * In:
  57. * pStatistic - Pointer to Statistic Counter Data Structure
  58. * Out:
  59. * none
  60. *
  61. * Return Value: none
  62. *
  63. */
  64. void STAvClearAllCounter (PSStatCounter pStatistic)
  65. {
  66. // set memory to zero
  67. memset(pStatistic, 0, sizeof(SStatCounter));
  68. }
  69. /*
  70. * Description: Update Isr Statistic Counter
  71. *
  72. * Parameters:
  73. * In:
  74. * pStatistic - Pointer to Statistic Counter Data Structure
  75. * wisr - Interrupt status
  76. * Out:
  77. * none
  78. *
  79. * Return Value: none
  80. *
  81. */
  82. void STAvUpdateIsrStatCounter (PSStatCounter pStatistic, BYTE byIsr0, BYTE byIsr1)
  83. {
  84. /**********************/
  85. /* ABNORMAL interrupt */
  86. /**********************/
  87. // not any IMR bit invoke irq
  88. if (byIsr0 == 0) {
  89. pStatistic->ISRStat.dwIsrUnknown++;
  90. return;
  91. }
  92. if (byIsr0 & ISR_ACTX) // ISR, bit0
  93. pStatistic->ISRStat.dwIsrTx0OK++; // TXDMA0 successful
  94. if (byIsr0 & ISR_BNTX) // ISR, bit2
  95. pStatistic->ISRStat.dwIsrBeaconTxOK++; // BeaconTx successful
  96. if (byIsr0 & ISR_RXDMA0) // ISR, bit3
  97. pStatistic->ISRStat.dwIsrRx0OK++; // Rx0 successful
  98. if (byIsr0 & ISR_TBTT) // ISR, bit4
  99. pStatistic->ISRStat.dwIsrTBTTInt++; // TBTT successful
  100. if (byIsr0 & ISR_SOFTTIMER) // ISR, bit6
  101. pStatistic->ISRStat.dwIsrSTIMERInt++;
  102. if (byIsr0 & ISR_WATCHDOG) // ISR, bit7
  103. pStatistic->ISRStat.dwIsrWatchDog++;
  104. if (byIsr1 & ISR_FETALERR) // ISR, bit8
  105. pStatistic->ISRStat.dwIsrUnrecoverableError++;
  106. if (byIsr1 & ISR_SOFTINT) // ISR, bit9
  107. pStatistic->ISRStat.dwIsrSoftInterrupt++; // software interrupt
  108. if (byIsr1 & ISR_MIBNEARFULL) // ISR, bit10
  109. pStatistic->ISRStat.dwIsrMIBNearfull++;
  110. if (byIsr1 & ISR_RXNOBUF) // ISR, bit11
  111. pStatistic->ISRStat.dwIsrRxNoBuf++; // Rx No Buff
  112. }
  113. /*
  114. * Description: Update Rx Statistic Counter
  115. *
  116. * Parameters:
  117. * In:
  118. * pStatistic - Pointer to Statistic Counter Data Structure
  119. * byRSR - Rx Status
  120. * byNewRSR - Rx Status
  121. * pbyBuffer - Rx Buffer
  122. * cbFrameLength - Rx Length
  123. * Out:
  124. * none
  125. *
  126. * Return Value: none
  127. *
  128. */
  129. void STAvUpdateRDStatCounter(PSStatCounter pStatistic,
  130. BYTE byRSR, BYTE byNewRSR,
  131. BYTE byRxSts, BYTE byRxRate,
  132. PBYTE pbyBuffer, unsigned int cbFrameLength)
  133. {
  134. /* need change */
  135. PS802_11Header pHeader = (PS802_11Header)pbyBuffer;
  136. if (byRSR & RSR_ADDROK)
  137. pStatistic->dwRsrADDROk++;
  138. if (byRSR & RSR_CRCOK) {
  139. pStatistic->dwRsrCRCOk++;
  140. pStatistic->ullRsrOK++;
  141. if (cbFrameLength >= ETH_ALEN) {
  142. /* update counters in case of successful transmission */
  143. if (byRSR & RSR_ADDRBROAD) {
  144. pStatistic->ullRxBroadcastFrames++;
  145. pStatistic->ullRxBroadcastBytes +=
  146. (unsigned long long) cbFrameLength;
  147. }
  148. else if (byRSR & RSR_ADDRMULTI) {
  149. pStatistic->ullRxMulticastFrames++;
  150. pStatistic->ullRxMulticastBytes +=
  151. (unsigned long long) cbFrameLength;
  152. }
  153. else {
  154. pStatistic->ullRxDirectedFrames++;
  155. pStatistic->ullRxDirectedBytes +=
  156. (unsigned long long) cbFrameLength;
  157. }
  158. }
  159. }
  160. if(byRxRate==22) {
  161. pStatistic->CustomStat.ullRsr11M++;
  162. if(byRSR & RSR_CRCOK) {
  163. pStatistic->CustomStat.ullRsr11MCRCOk++;
  164. }
  165. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "11M: ALL[%d], OK[%d]:[%02x]\n",
  166. (signed int) pStatistic->CustomStat.ullRsr11M,
  167. (signed int) pStatistic->CustomStat.ullRsr11MCRCOk, byRSR);
  168. }
  169. else if(byRxRate==11) {
  170. pStatistic->CustomStat.ullRsr5M++;
  171. if(byRSR & RSR_CRCOK) {
  172. pStatistic->CustomStat.ullRsr5MCRCOk++;
  173. }
  174. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 5M: ALL[%d], OK[%d]:[%02x]\n",
  175. (signed int) pStatistic->CustomStat.ullRsr5M,
  176. (signed int) pStatistic->CustomStat.ullRsr5MCRCOk, byRSR);
  177. }
  178. else if(byRxRate==4) {
  179. pStatistic->CustomStat.ullRsr2M++;
  180. if(byRSR & RSR_CRCOK) {
  181. pStatistic->CustomStat.ullRsr2MCRCOk++;
  182. }
  183. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 2M: ALL[%d], OK[%d]:[%02x]\n",
  184. (signed int) pStatistic->CustomStat.ullRsr2M,
  185. (signed int) pStatistic->CustomStat.ullRsr2MCRCOk, byRSR);
  186. }
  187. else if(byRxRate==2){
  188. pStatistic->CustomStat.ullRsr1M++;
  189. if(byRSR & RSR_CRCOK) {
  190. pStatistic->CustomStat.ullRsr1MCRCOk++;
  191. }
  192. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 1M: ALL[%d], OK[%d]:[%02x]\n",
  193. (signed int) pStatistic->CustomStat.ullRsr1M,
  194. (signed int) pStatistic->CustomStat.ullRsr1MCRCOk, byRSR);
  195. }
  196. else if(byRxRate==12){
  197. pStatistic->CustomStat.ullRsr6M++;
  198. if(byRSR & RSR_CRCOK) {
  199. pStatistic->CustomStat.ullRsr6MCRCOk++;
  200. }
  201. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 6M: ALL[%d], OK[%d]\n",
  202. (signed int) pStatistic->CustomStat.ullRsr6M,
  203. (signed int) pStatistic->CustomStat.ullRsr6MCRCOk);
  204. }
  205. else if(byRxRate==18){
  206. pStatistic->CustomStat.ullRsr9M++;
  207. if(byRSR & RSR_CRCOK) {
  208. pStatistic->CustomStat.ullRsr9MCRCOk++;
  209. }
  210. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " 9M: ALL[%d], OK[%d]\n",
  211. (signed int) pStatistic->CustomStat.ullRsr9M,
  212. (signed int) pStatistic->CustomStat.ullRsr9MCRCOk);
  213. }
  214. else if(byRxRate==24){
  215. pStatistic->CustomStat.ullRsr12M++;
  216. if(byRSR & RSR_CRCOK) {
  217. pStatistic->CustomStat.ullRsr12MCRCOk++;
  218. }
  219. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "12M: ALL[%d], OK[%d]\n",
  220. (signed int) pStatistic->CustomStat.ullRsr12M,
  221. (signed int) pStatistic->CustomStat.ullRsr12MCRCOk);
  222. }
  223. else if(byRxRate==36){
  224. pStatistic->CustomStat.ullRsr18M++;
  225. if(byRSR & RSR_CRCOK) {
  226. pStatistic->CustomStat.ullRsr18MCRCOk++;
  227. }
  228. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "18M: ALL[%d], OK[%d]\n",
  229. (signed int) pStatistic->CustomStat.ullRsr18M,
  230. (signed int) pStatistic->CustomStat.ullRsr18MCRCOk);
  231. }
  232. else if(byRxRate==48){
  233. pStatistic->CustomStat.ullRsr24M++;
  234. if(byRSR & RSR_CRCOK) {
  235. pStatistic->CustomStat.ullRsr24MCRCOk++;
  236. }
  237. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "24M: ALL[%d], OK[%d]\n",
  238. (signed int) pStatistic->CustomStat.ullRsr24M,
  239. (signed int) pStatistic->CustomStat.ullRsr24MCRCOk);
  240. }
  241. else if(byRxRate==72){
  242. pStatistic->CustomStat.ullRsr36M++;
  243. if(byRSR & RSR_CRCOK) {
  244. pStatistic->CustomStat.ullRsr36MCRCOk++;
  245. }
  246. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "36M: ALL[%d], OK[%d]\n",
  247. (signed int) pStatistic->CustomStat.ullRsr36M,
  248. (signed int) pStatistic->CustomStat.ullRsr36MCRCOk);
  249. }
  250. else if(byRxRate==96){
  251. pStatistic->CustomStat.ullRsr48M++;
  252. if(byRSR & RSR_CRCOK) {
  253. pStatistic->CustomStat.ullRsr48MCRCOk++;
  254. }
  255. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "48M: ALL[%d], OK[%d]\n",
  256. (signed int) pStatistic->CustomStat.ullRsr48M,
  257. (signed int) pStatistic->CustomStat.ullRsr48MCRCOk);
  258. }
  259. else if(byRxRate==108){
  260. pStatistic->CustomStat.ullRsr54M++;
  261. if(byRSR & RSR_CRCOK) {
  262. pStatistic->CustomStat.ullRsr54MCRCOk++;
  263. }
  264. DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "54M: ALL[%d], OK[%d]\n",
  265. (signed int) pStatistic->CustomStat.ullRsr54M,
  266. (signed int) pStatistic->CustomStat.ullRsr54MCRCOk);
  267. }
  268. else {
  269. DBG_PRT(MSG_LEVEL_DEBUG,
  270. KERN_INFO "Unknown: Total[%d], CRCOK[%d]\n",
  271. (signed int) pStatistic->dwRsrRxPacket+1,
  272. (signed int)pStatistic->dwRsrCRCOk);
  273. }
  274. if (byRSR & RSR_BSSIDOK)
  275. pStatistic->dwRsrBSSIDOk++;
  276. if (byRSR & RSR_BCNSSIDOK)
  277. pStatistic->dwRsrBCNSSIDOk++;
  278. if (byRSR & RSR_IVLDLEN) //invalid len (> 2312 byte)
  279. pStatistic->dwRsrLENErr++;
  280. if (byRSR & RSR_IVLDTYP) //invalid packet type
  281. pStatistic->dwRsrTYPErr++;
  282. if ((byRSR & (RSR_IVLDTYP | RSR_IVLDLEN)) || !(byRSR & RSR_CRCOK))
  283. pStatistic->dwRsrErr++;
  284. if (byNewRSR & NEWRSR_DECRYPTOK)
  285. pStatistic->dwNewRsrDECRYPTOK++;
  286. if (byNewRSR & NEWRSR_CFPIND)
  287. pStatistic->dwNewRsrCFP++;
  288. if (byNewRSR & NEWRSR_HWUTSF)
  289. pStatistic->dwNewRsrUTSF++;
  290. if (byNewRSR & NEWRSR_BCNHITAID)
  291. pStatistic->dwNewRsrHITAID++;
  292. if (byNewRSR & NEWRSR_BCNHITAID0)
  293. pStatistic->dwNewRsrHITAID0++;
  294. // increase rx packet count
  295. pStatistic->dwRsrRxPacket++;
  296. pStatistic->dwRsrRxOctet += cbFrameLength;
  297. if (IS_TYPE_DATA(pbyBuffer)) {
  298. pStatistic->dwRsrRxData++;
  299. } else if (IS_TYPE_MGMT(pbyBuffer)){
  300. pStatistic->dwRsrRxManage++;
  301. } else if (IS_TYPE_CONTROL(pbyBuffer)){
  302. pStatistic->dwRsrRxControl++;
  303. }
  304. if (byRSR & RSR_ADDRBROAD)
  305. pStatistic->dwRsrBroadcast++;
  306. else if (byRSR & RSR_ADDRMULTI)
  307. pStatistic->dwRsrMulticast++;
  308. else
  309. pStatistic->dwRsrDirected++;
  310. if (WLAN_GET_FC_MOREFRAG(pHeader->wFrameCtl))
  311. pStatistic->dwRsrRxFragment++;
  312. if (cbFrameLength < ETH_ZLEN + 4) {
  313. pStatistic->dwRsrRunt++;
  314. } else if (cbFrameLength == ETH_ZLEN + 4) {
  315. pStatistic->dwRsrRxFrmLen64++;
  316. }
  317. else if ((65 <= cbFrameLength) && (cbFrameLength <= 127)) {
  318. pStatistic->dwRsrRxFrmLen65_127++;
  319. }
  320. else if ((128 <= cbFrameLength) && (cbFrameLength <= 255)) {
  321. pStatistic->dwRsrRxFrmLen128_255++;
  322. }
  323. else if ((256 <= cbFrameLength) && (cbFrameLength <= 511)) {
  324. pStatistic->dwRsrRxFrmLen256_511++;
  325. }
  326. else if ((512 <= cbFrameLength) && (cbFrameLength <= 1023)) {
  327. pStatistic->dwRsrRxFrmLen512_1023++;
  328. } else if ((1024 <= cbFrameLength) &&
  329. (cbFrameLength <= ETH_FRAME_LEN + 4)) {
  330. pStatistic->dwRsrRxFrmLen1024_1518++;
  331. } else if (cbFrameLength > ETH_FRAME_LEN + 4) {
  332. pStatistic->dwRsrLong++;
  333. }
  334. }
  335. /*
  336. * Description: Update Rx Statistic Counter and copy Rx buffer
  337. *
  338. * Parameters:
  339. * In:
  340. * pStatistic - Pointer to Statistic Counter Data Structure
  341. * byRSR - Rx Status
  342. * byNewRSR - Rx Status
  343. * pbyBuffer - Rx Buffer
  344. * cbFrameLength - Rx Length
  345. * Out:
  346. * none
  347. *
  348. * Return Value: none
  349. *
  350. */
  351. void
  352. STAvUpdateRDStatCounterEx (
  353. PSStatCounter pStatistic,
  354. BYTE byRSR,
  355. BYTE byNewRSR,
  356. BYTE byRxSts,
  357. BYTE byRxRate,
  358. PBYTE pbyBuffer,
  359. unsigned int cbFrameLength
  360. )
  361. {
  362. STAvUpdateRDStatCounter(
  363. pStatistic,
  364. byRSR,
  365. byNewRSR,
  366. byRxSts,
  367. byRxRate,
  368. pbyBuffer,
  369. cbFrameLength
  370. );
  371. // rx length
  372. pStatistic->dwCntRxFrmLength = cbFrameLength;
  373. // rx pattern, we just see 10 bytes for sample
  374. memcpy(pStatistic->abyCntRxPattern, (PBYTE)pbyBuffer, 10);
  375. }
  376. /*
  377. * Description: Update Tx Statistic Counter
  378. *
  379. * Parameters:
  380. * In:
  381. * pStatistic - Pointer to Statistic Counter Data Structure
  382. * byTSR0 - Tx Status
  383. * byTSR1 - Tx Status
  384. * pbyBuffer - Tx Buffer
  385. * cbFrameLength - Tx Length
  386. * uIdx - Index of Tx DMA
  387. * Out:
  388. * none
  389. *
  390. * Return Value: none
  391. *
  392. */
  393. void
  394. STAvUpdateTDStatCounter (
  395. PSStatCounter pStatistic,
  396. BYTE byPktNum,
  397. BYTE byRate,
  398. BYTE byTSR
  399. )
  400. {
  401. BYTE byRetyCnt;
  402. // increase tx packet count
  403. pStatistic->dwTsrTxPacket++;
  404. byRetyCnt = (byTSR & 0xF0) >> 4;
  405. if (byRetyCnt != 0) {
  406. pStatistic->dwTsrRetry++;
  407. pStatistic->dwTsrTotalRetry += byRetyCnt;
  408. pStatistic->dwTxFail[byRate]+= byRetyCnt;
  409. pStatistic->dwTxFail[MAX_RATE] += byRetyCnt;
  410. if ( byRetyCnt == 0x1)
  411. pStatistic->dwTsrOnceRetry++;
  412. else
  413. pStatistic->dwTsrMoreThanOnceRetry++;
  414. if (byRetyCnt <= 8)
  415. pStatistic->dwTxRetryCount[byRetyCnt-1]++;
  416. }
  417. if ( !(byTSR & (TSR_TMO | TSR_RETRYTMO))) {
  418. if (byRetyCnt < 2)
  419. pStatistic->TxNoRetryOkCount ++;
  420. else
  421. pStatistic->TxRetryOkCount ++;
  422. pStatistic->ullTsrOK++;
  423. pStatistic->CustomStat.ullTsrAllOK++;
  424. // update counters in case that successful transmit
  425. pStatistic->dwTxOk[byRate]++;
  426. pStatistic->dwTxOk[MAX_RATE]++;
  427. if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_BROAD ) {
  428. pStatistic->ullTxBroadcastFrames++;
  429. pStatistic->ullTxBroadcastBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;
  430. } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_MULTI ) {
  431. pStatistic->ullTxMulticastFrames++;
  432. pStatistic->ullTxMulticastBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;
  433. } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_UNI ) {
  434. pStatistic->ullTxDirectedFrames++;
  435. pStatistic->ullTxDirectedBytes += pStatistic->abyTxPktInfo[byPktNum].wLength;
  436. }
  437. }
  438. else {
  439. pStatistic->TxFailCount ++;
  440. pStatistic->dwTsrErr++;
  441. if (byTSR & TSR_RETRYTMO)
  442. pStatistic->dwTsrRetryTimeout++;
  443. if (byTSR & TSR_TMO)
  444. pStatistic->dwTsrTransmitTimeout++;
  445. }
  446. if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_BROAD ) {
  447. pStatistic->dwTsrBroadcast++;
  448. } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_MULTI ) {
  449. pStatistic->dwTsrMulticast++;
  450. } else if ( pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni == TX_PKT_UNI ) {
  451. pStatistic->dwTsrDirected++;
  452. }
  453. }
  454. /*
  455. * Description: Update 802.11 mib counter
  456. *
  457. * Parameters:
  458. * In:
  459. * p802_11Counter - Pointer to 802.11 mib counter
  460. * pStatistic - Pointer to Statistic Counter Data Structure
  461. * dwCounter - hardware counter for 802.11 mib
  462. * Out:
  463. * none
  464. *
  465. * Return Value: none
  466. *
  467. */
  468. void
  469. STAvUpdate802_11Counter(
  470. PSDot11Counters p802_11Counter,
  471. PSStatCounter pStatistic,
  472. BYTE byRTSSuccess,
  473. BYTE byRTSFail,
  474. BYTE byACKFail,
  475. BYTE byFCSErr
  476. )
  477. {
  478. //p802_11Counter->TransmittedFragmentCount
  479. p802_11Counter->MulticastTransmittedFrameCount =
  480. (unsigned long long) (pStatistic->dwTsrBroadcast +
  481. pStatistic->dwTsrMulticast);
  482. p802_11Counter->FailedCount = (unsigned long long) (pStatistic->dwTsrErr);
  483. p802_11Counter->RetryCount = (unsigned long long) (pStatistic->dwTsrRetry);
  484. p802_11Counter->MultipleRetryCount =
  485. (unsigned long long) (pStatistic->dwTsrMoreThanOnceRetry);
  486. //p802_11Counter->FrameDuplicateCount
  487. p802_11Counter->RTSSuccessCount += (unsigned long long) byRTSSuccess;
  488. p802_11Counter->RTSFailureCount += (unsigned long long) byRTSFail;
  489. p802_11Counter->ACKFailureCount += (unsigned long long) byACKFail;
  490. p802_11Counter->FCSErrorCount += (unsigned long long) byFCSErr;
  491. //p802_11Counter->ReceivedFragmentCount
  492. p802_11Counter->MulticastReceivedFrameCount =
  493. (unsigned long long) (pStatistic->dwRsrBroadcast +
  494. pStatistic->dwRsrMulticast);
  495. }
  496. /*
  497. * Description: Clear 802.11 mib counter
  498. *
  499. * Parameters:
  500. * In:
  501. * p802_11Counter - Pointer to 802.11 mib counter
  502. * Out:
  503. * none
  504. *
  505. * Return Value: none
  506. *
  507. */
  508. void
  509. STAvClear802_11Counter(PSDot11Counters p802_11Counter)
  510. {
  511. // set memory to zero
  512. memset(p802_11Counter, 0, sizeof(SDot11Counters));
  513. }
  514. /*
  515. * Description: Clear 802.11 mib counter
  516. *
  517. * Parameters:
  518. * In:
  519. * pUsbCounter - Pointer to USB mib counter
  520. * ntStatus - URB status
  521. * Out:
  522. * none
  523. *
  524. * Return Value: none
  525. *
  526. */
  527. void STAvUpdateUSBCounter(PSUSBCounter pUsbCounter, int ntStatus)
  528. {
  529. // if ( ntStatus == USBD_STATUS_CRC ) {
  530. pUsbCounter->dwCrc++;
  531. // }
  532. }