PageRenderTime 1891ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/staging/rtl8192e/ieee80211/rtl819x_HTProc.c

https://github.com/Mengqi/linux-2.6
C | 1489 lines | 886 code | 214 blank | 389 comment | 182 complexity | 8d86086e2bc39a0437f21fc27adc8934 MD5 | raw file
  1. //As this function is mainly ported from Windows driver, so leave the name little changed. If any confusion caused, tell me. Created by WB. 2008.05.08
  2. #include "ieee80211.h"
  3. #include "rtl819x_HT.h"
  4. u8 MCS_FILTER_ALL[16] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  5. u8 MCS_FILTER_1SS[16] = {0xff, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  6. u16 MCS_DATA_RATE[2][2][77] =
  7. { { {13, 26, 39, 52, 78, 104, 117, 130, 26, 52, 78 ,104, 156, 208, 234, 260,
  8. 39, 78, 117, 234, 312, 351, 390, 52, 104, 156, 208, 312, 416, 468, 520,
  9. 0, 78, 104, 130, 117, 156, 195, 104, 130, 130, 156, 182, 182, 208, 156, 195,
  10. 195, 234, 273, 273, 312, 130, 156, 181, 156, 181, 208, 234, 208, 234, 260, 260,
  11. 286, 195, 234, 273, 234, 273, 312, 351, 312, 351, 390, 390, 429}, // Long GI, 20MHz
  12. {14, 29, 43, 58, 87, 116, 130, 144, 29, 58, 87, 116, 173, 231, 260, 289,
  13. 43, 87, 130, 173, 260, 347, 390, 433, 58, 116, 173, 231, 347, 462, 520, 578,
  14. 0, 87, 116, 144, 130, 173, 217, 116, 144, 144, 173, 202, 202, 231, 173, 217,
  15. 217, 260, 303, 303, 347, 144, 173, 202, 173, 202, 231, 260, 231, 260, 289, 289,
  16. 318, 217, 260, 303, 260, 303, 347, 390, 347, 390, 433, 433, 477} }, // Short GI, 20MHz
  17. { {27, 54, 81, 108, 162, 216, 243, 270, 54, 108, 162, 216, 324, 432, 486, 540,
  18. 81, 162, 243, 324, 486, 648, 729, 810, 108, 216, 324, 432, 648, 864, 972, 1080,
  19. 12, 162, 216, 270, 243, 324, 405, 216, 270, 270, 324, 378, 378, 432, 324, 405,
  20. 405, 486, 567, 567, 648, 270, 324, 378, 324, 378, 432, 486, 432, 486, 540, 540,
  21. 594, 405, 486, 567, 486, 567, 648, 729, 648, 729, 810, 810, 891}, // Long GI, 40MHz
  22. {30, 60, 90, 120, 180, 240, 270, 300, 60, 120, 180, 240, 360, 480, 540, 600,
  23. 90, 180, 270, 360, 540, 720, 810, 900, 120, 240, 360, 480, 720, 960, 1080, 1200,
  24. 13, 180, 240, 300, 270, 360, 450, 240, 300, 300, 360, 420, 420, 480, 360, 450,
  25. 450, 540, 630, 630, 720, 300, 360, 420, 360, 420, 480, 540, 480, 540, 600, 600,
  26. 660, 450, 540, 630, 540, 630, 720, 810, 720, 810, 900, 900, 990} } // Short GI, 40MHz
  27. };
  28. static const u8 UNKNOWN_BORADCOM[3] = {0x00, 0x14, 0xbf};
  29. static const u8 LINKSYSWRT330_LINKSYSWRT300_BROADCOM[3] = {0x00, 0x1a, 0x70};
  30. static const u8 LINKSYSWRT350_LINKSYSWRT150_BROADCOM[3] = {0x00, 0x1d, 0x7e};
  31. //static u8 NETGEAR834Bv2_BROADCOM[3] = {0x00, 0x1b, 0x2f};
  32. static const u8 BELKINF5D8233V1_RALINK[3] = {0x00, 0x17, 0x3f};
  33. static const u8 BELKINF5D82334V3_RALINK[3] = {0x00, 0x1c, 0xdf};
  34. static const u8 PCI_RALINK[3] = {0x00, 0x90, 0xcc};
  35. static const u8 EDIMAX_RALINK[3] = {0x00, 0x0e, 0x2e};
  36. static const u8 AIRLINK_RALINK[3] = {0x00, 0x18, 0x02};
  37. static const u8 DLINK_ATHEROS[3] = {0x00, 0x1c, 0xf0};
  38. static const u8 CISCO_BROADCOM[3] = {0x00, 0x17, 0x94};
  39. static const u8 LINKSYS_MARVELL_4400N[3] = {0x00, 0x14, 0xa4};
  40. // 2008/04/01 MH For Cisco G mode RX TP We need to change FW duration. Should we put the
  41. // code in other place??
  42. //static u8 WIFI_CISCO_G_AP[3] = {0x00, 0x40, 0x96};
  43. /********************************************************************************************************************
  44. *function: This function update default settings in pHTInfo structure
  45. * input: PRT_HIGH_THROUGHPUT pHTInfo
  46. * output: none
  47. * return: none
  48. * notice: These value need be modified if any changes.
  49. * *****************************************************************************************************************/
  50. void HTUpdateDefaultSetting(struct ieee80211_device* ieee)
  51. {
  52. PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
  53. // ShortGI support
  54. pHTInfo->bRegShortGI20MHz= 1;
  55. pHTInfo->bRegShortGI40MHz= 1;
  56. // 40MHz channel support
  57. pHTInfo->bRegBW40MHz = 1;
  58. // CCK rate support in 40MHz channel
  59. if(pHTInfo->bRegBW40MHz)
  60. pHTInfo->bRegSuppCCK = 1;
  61. else
  62. pHTInfo->bRegSuppCCK = true;
  63. // AMSDU related
  64. pHTInfo->nAMSDU_MaxSize = 7935UL;
  65. pHTInfo->bAMSDU_Support = 0;
  66. // AMPDU related
  67. pHTInfo->bAMPDUEnable = 1;
  68. pHTInfo->AMPDU_Factor = 2; //// 0: 2n13(8K), 1:2n14(16K), 2:2n15(32K), 3:2n16(64k)
  69. pHTInfo->MPDU_Density = 0;// 0: No restriction, 1: 1/8usec, 2: 1/4usec, 3: 1/2usec, 4: 1usec, 5: 2usec, 6: 4usec, 7:8usec
  70. // MIMO Power Save
  71. pHTInfo->SelfMimoPs = 3;// 0: Static Mimo Ps, 1: Dynamic Mimo Ps, 3: No Limitation, 2: Reserved(Set to 3 automatically.)
  72. if(pHTInfo->SelfMimoPs == 2)
  73. pHTInfo->SelfMimoPs = 3;
  74. // 8190 only. Assign rate operation mode to firmware
  75. ieee->bTxDisableRateFallBack = 0;
  76. ieee->bTxUseDriverAssingedRate = 0;
  77. #ifdef TO_DO_LIST
  78. // 8190 only. Assign duration operation mode to firmware
  79. pMgntInfo->bTxEnableFwCalcDur = (BOOLEAN)pNdisCommon->bRegTxEnableFwCalcDur;
  80. #endif
  81. // 8190 only, Realtek proprietary aggregation mode
  82. // Set MPDUDensity=2, 1: Set MPDUDensity=2(32k) for Realtek AP and set MPDUDensity=0(8k) for others
  83. pHTInfo->bRegRT2RTAggregation = 1;//0: Set MPDUDensity=2, 1: Set MPDUDensity=2(32k) for Realtek AP and set MPDUDensity=0(8k) for others
  84. // For Rx Reorder Control
  85. pHTInfo->bRegRxReorderEnable = 1;
  86. pHTInfo->RxReorderWinSize = 64;
  87. pHTInfo->RxReorderPendingTime = 30;
  88. #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
  89. pHTInfo->UsbTxAggrNum = 4;
  90. #endif
  91. #ifdef USB_RX_AGGREGATION_SUPPORT
  92. pHTInfo->UsbRxFwAggrEn = 1;
  93. pHTInfo->UsbRxFwAggrPageNum = 24;
  94. pHTInfo->UsbRxFwAggrPacketNum = 8;
  95. pHTInfo->UsbRxFwAggrTimeout = 16; ////usb rx FW aggregation timeout threshold.It's in units of 64us
  96. #endif
  97. }
  98. /********************************************************************************************************************
  99. *function: This function print out each field on HT capability IE mainly from (Beacon/ProbeRsp/AssocReq)
  100. * input: u8* CapIE //Capability IE to be printed out
  101. * u8* TitleString //mainly print out caller function
  102. * output: none
  103. * return: none
  104. * notice: Driver should not print out this message by default.
  105. * *****************************************************************************************************************/
  106. void HTDebugHTCapability(u8* CapIE, u8* TitleString )
  107. {
  108. static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; // For 11n EWC definition, 2007.07.17, by Emily
  109. PHT_CAPABILITY_ELE pCapELE;
  110. if(!memcmp(CapIE, EWC11NHTCap, sizeof(EWC11NHTCap)))
  111. {
  112. //EWC IE
  113. IEEE80211_DEBUG(IEEE80211_DL_HT, "EWC IE in %s()\n", __FUNCTION__);
  114. pCapELE = (PHT_CAPABILITY_ELE)(&CapIE[4]);
  115. }else
  116. pCapELE = (PHT_CAPABILITY_ELE)(&CapIE[0]);
  117. IEEE80211_DEBUG(IEEE80211_DL_HT, "<Log HT Capability>. Called by %s\n", TitleString );
  118. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupported Channel Width = %s\n", (pCapELE->ChlWidth)?"20MHz": "20/40MHz");
  119. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 20M = %s\n", (pCapELE->ShortGI20Mhz)?"YES": "NO");
  120. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport Short GI for 40M = %s\n", (pCapELE->ShortGI40Mhz)?"YES": "NO");
  121. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport TX STBC = %s\n", (pCapELE->TxSTBC)?"YES": "NO");
  122. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMSDU Size = %s\n", (pCapELE->MaxAMSDUSize)?"3839": "7935");
  123. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSupport CCK in 20/40 mode = %s\n", (pCapELE->DssCCk)?"YES": "NO");
  124. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMax AMPDU Factor = %d\n", pCapELE->MaxRxAMPDUFactor);
  125. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMPDU Density = %d\n", pCapELE->MPDUDensity);
  126. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tMCS Rate Set = [%x][%x][%x][%x][%x]\n", pCapELE->MCS[0],\
  127. pCapELE->MCS[1], pCapELE->MCS[2], pCapELE->MCS[3], pCapELE->MCS[4]);
  128. }
  129. /********************************************************************************************************************
  130. *function: This function print out each field on HT Information IE mainly from (Beacon/ProbeRsp)
  131. * input: u8* InfoIE //Capability IE to be printed out
  132. * u8* TitleString //mainly print out caller function
  133. * output: none
  134. * return: none
  135. * notice: Driver should not print out this message by default.
  136. * *****************************************************************************************************************/
  137. void HTDebugHTInfo(u8* InfoIE, u8* TitleString)
  138. {
  139. static u8 EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34}; // For 11n EWC definition, 2007.07.17, by Emily
  140. PHT_INFORMATION_ELE pHTInfoEle;
  141. if(!memcmp(InfoIE, EWC11NHTInfo, sizeof(EWC11NHTInfo)))
  142. {
  143. // Not EWC IE
  144. IEEE80211_DEBUG(IEEE80211_DL_HT, "EWC IE in %s()\n", __FUNCTION__);
  145. pHTInfoEle = (PHT_INFORMATION_ELE)(&InfoIE[4]);
  146. }else
  147. pHTInfoEle = (PHT_INFORMATION_ELE)(&InfoIE[0]);
  148. IEEE80211_DEBUG(IEEE80211_DL_HT, "<Log HT Information Element>. Called by %s\n", TitleString);
  149. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tPrimary channel = %d\n", pHTInfoEle->ControlChl);
  150. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tSenondary channel =");
  151. switch(pHTInfoEle->ExtChlOffset)
  152. {
  153. case 0:
  154. IEEE80211_DEBUG(IEEE80211_DL_HT, "Not Present\n");
  155. break;
  156. case 1:
  157. IEEE80211_DEBUG(IEEE80211_DL_HT, "Upper channel\n");
  158. break;
  159. case 2:
  160. IEEE80211_DEBUG(IEEE80211_DL_HT, "Reserved. Eooro!!!\n");
  161. break;
  162. case 3:
  163. IEEE80211_DEBUG(IEEE80211_DL_HT, "Lower Channel\n");
  164. break;
  165. }
  166. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tRecommended channel width = %s\n", (pHTInfoEle->RecommemdedTxWidth)?"20Mhz": "40Mhz");
  167. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tOperation mode for protection = ");
  168. switch(pHTInfoEle->OptMode)
  169. {
  170. case 0:
  171. IEEE80211_DEBUG(IEEE80211_DL_HT, "No Protection\n");
  172. break;
  173. case 1:
  174. IEEE80211_DEBUG(IEEE80211_DL_HT, "HT non-member protection mode\n");
  175. break;
  176. case 2:
  177. IEEE80211_DEBUG(IEEE80211_DL_HT, "Suggest to open protection\n");
  178. break;
  179. case 3:
  180. IEEE80211_DEBUG(IEEE80211_DL_HT, "HT mixed mode\n");
  181. break;
  182. }
  183. IEEE80211_DEBUG(IEEE80211_DL_HT, "\tBasic MCS Rate Set = [%x][%x][%x][%x][%x]\n", pHTInfoEle->BasicMSC[0],\
  184. pHTInfoEle->BasicMSC[1], pHTInfoEle->BasicMSC[2], pHTInfoEle->BasicMSC[3], pHTInfoEle->BasicMSC[4]);
  185. }
  186. /*
  187. * Return: true if station in half n mode and AP supports 40 bw
  188. */
  189. bool IsHTHalfNmode40Bandwidth(struct ieee80211_device* ieee)
  190. {
  191. bool retValue = false;
  192. PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
  193. if(pHTInfo->bCurrentHTSupport == false ) // wireless is n mode
  194. retValue = false;
  195. else if(pHTInfo->bRegBW40MHz == false) // station supports 40 bw
  196. retValue = false;
  197. else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee)) // station in half n mode
  198. retValue = false;
  199. else if(((PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf))->ChlWidth) // ap support 40 bw
  200. retValue = true;
  201. else
  202. retValue = false;
  203. return retValue;
  204. }
  205. bool IsHTHalfNmodeSGI(struct ieee80211_device* ieee, bool is40MHz)
  206. {
  207. bool retValue = false;
  208. PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
  209. if(pHTInfo->bCurrentHTSupport == false ) // wireless is n mode
  210. retValue = false;
  211. else if (!ieee->GetHalfNmodeSupportByAPsHandler(ieee)) // station in half n mode
  212. retValue = false;
  213. else if(is40MHz) // ap support 40 bw
  214. {
  215. if(((PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf))->ShortGI40Mhz) // ap support 40 bw short GI
  216. retValue = true;
  217. else
  218. retValue = false;
  219. }
  220. else
  221. {
  222. if(((PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf))->ShortGI20Mhz) // ap support 40 bw short GI
  223. retValue = true;
  224. else
  225. retValue = false;
  226. }
  227. return retValue;
  228. }
  229. u16 HTHalfMcsToDataRate(struct ieee80211_device* ieee, u8 nMcsRate)
  230. {
  231. u8 is40MHz;
  232. u8 isShortGI;
  233. is40MHz = (IsHTHalfNmode40Bandwidth(ieee))?1:0;
  234. isShortGI = (IsHTHalfNmodeSGI(ieee, is40MHz))? 1:0;
  235. return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate&0x7f)];
  236. }
  237. u16 HTMcsToDataRate( struct ieee80211_device* ieee, u8 nMcsRate)
  238. {
  239. PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
  240. u8 is40MHz = (pHTInfo->bCurBW40MHz)?1:0;
  241. u8 isShortGI = (pHTInfo->bCurBW40MHz)?
  242. ((pHTInfo->bCurShortGI40MHz)?1:0):
  243. ((pHTInfo->bCurShortGI20MHz)?1:0);
  244. return MCS_DATA_RATE[is40MHz][isShortGI][(nMcsRate&0x7f)];
  245. }
  246. /********************************************************************************************************************
  247. *function: This function returns current datarate.
  248. * input: struct ieee80211_device* ieee
  249. * u8 nDataRate
  250. * output: none
  251. * return: tx rate
  252. * notice: quite unsure about how to use this function //wb
  253. * *****************************************************************************************************************/
  254. u16 TxCountToDataRate( struct ieee80211_device* ieee, u8 nDataRate)
  255. {
  256. //PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
  257. u16 CCKOFDMRate[12] = {0x02 , 0x04 , 0x0b , 0x16 , 0x0c , 0x12 , 0x18 , 0x24 , 0x30 , 0x48 , 0x60 , 0x6c};
  258. u8 is40MHz = 0;
  259. u8 isShortGI = 0;
  260. if(nDataRate < 12)
  261. {
  262. return CCKOFDMRate[nDataRate];
  263. }
  264. else
  265. {
  266. if (nDataRate >= 0x10 && nDataRate <= 0x1f)//if(nDataRate > 11 && nDataRate < 28 )
  267. {
  268. is40MHz = 0;
  269. isShortGI = 0;
  270. // nDataRate = nDataRate - 12;
  271. }
  272. else if(nDataRate >=0x20 && nDataRate <= 0x2f ) //(27, 44)
  273. {
  274. is40MHz = 1;
  275. isShortGI = 0;
  276. //nDataRate = nDataRate - 28;
  277. }
  278. else if(nDataRate >= 0x30 && nDataRate <= 0x3f ) //(43, 60)
  279. {
  280. is40MHz = 0;
  281. isShortGI = 1;
  282. //nDataRate = nDataRate - 44;
  283. }
  284. else if(nDataRate >= 0x40 && nDataRate <= 0x4f ) //(59, 76)
  285. {
  286. is40MHz = 1;
  287. isShortGI = 1;
  288. //nDataRate = nDataRate - 60;
  289. }
  290. return MCS_DATA_RATE[is40MHz][isShortGI][nDataRate&0xf];
  291. }
  292. }
  293. bool IsHTHalfNmodeAPs(struct ieee80211_device* ieee)
  294. {
  295. bool retValue = false;
  296. struct ieee80211_network* net = &ieee->current_network;
  297. #if 0
  298. if(ieee->bHalfNMode == false)
  299. retValue = false;
  300. else
  301. #endif
  302. if((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3)==0) ||
  303. (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3)==0) ||
  304. (memcmp(net->bssid, PCI_RALINK, 3)==0) ||
  305. (memcmp(net->bssid, EDIMAX_RALINK, 3)==0) ||
  306. (memcmp(net->bssid, AIRLINK_RALINK, 3)==0) ||
  307. (net->ralink_cap_exist))
  308. retValue = true;
  309. else if((memcmp(net->bssid, UNKNOWN_BORADCOM, 3)==0) ||
  310. (memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)||
  311. (memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)||
  312. //(memcmp(net->bssid, NETGEAR834Bv2_BROADCOM, 3)==0) ||
  313. (net->broadcom_cap_exist))
  314. retValue = true;
  315. else if(net->bssht.bdRT2RTAggregation)
  316. retValue = true;
  317. else
  318. retValue = false;
  319. return retValue;
  320. }
  321. /********************************************************************************************************************
  322. *function: This function returns peer IOT.
  323. * input: struct ieee80211_device* ieee
  324. * output: none
  325. * return:
  326. * notice:
  327. * *****************************************************************************************************************/
  328. void HTIOTPeerDetermine(struct ieee80211_device* ieee)
  329. {
  330. PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
  331. struct ieee80211_network* net = &ieee->current_network;
  332. if(net->bssht.bdRT2RTAggregation)
  333. pHTInfo->IOTPeer = HT_IOT_PEER_REALTEK;
  334. else if(net->broadcom_cap_exist){
  335. pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
  336. }
  337. else if((memcmp(net->bssid, UNKNOWN_BORADCOM, 3)==0) ||
  338. (memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)||
  339. (memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)){//||
  340. //(memcmp(net->bssid, NETGEAR834Bv2_BROADCOM, 3)==0) ){
  341. pHTInfo->IOTPeer = HT_IOT_PEER_BROADCOM;
  342. }
  343. else if((memcmp(net->bssid, BELKINF5D8233V1_RALINK, 3)==0) ||
  344. (memcmp(net->bssid, BELKINF5D82334V3_RALINK, 3)==0) ||
  345. (memcmp(net->bssid, PCI_RALINK, 3)==0) ||
  346. (memcmp(net->bssid, EDIMAX_RALINK, 3)==0) ||
  347. (memcmp(net->bssid, AIRLINK_RALINK, 3)==0) ||
  348. net->ralink_cap_exist)
  349. pHTInfo->IOTPeer = HT_IOT_PEER_RALINK;
  350. else if((net->atheros_cap_exist )|| (memcmp(net->bssid, DLINK_ATHEROS, 3) == 0))
  351. pHTInfo->IOTPeer = HT_IOT_PEER_ATHEROS;
  352. else if(memcmp(net->bssid, CISCO_BROADCOM, 3)==0)
  353. pHTInfo->IOTPeer = HT_IOT_PEER_CISCO;
  354. else if ((memcmp(net->bssid, LINKSYS_MARVELL_4400N, 3) == 0) ||
  355. net->marvell_cap_exist){
  356. pHTInfo->IOTPeer = HT_IOT_PEER_MARVELL;
  357. }
  358. else
  359. pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN;
  360. IEEE80211_DEBUG(IEEE80211_DL_IOT, "Joseph debug!! IOTPEER: %x\n", pHTInfo->IOTPeer);
  361. }
  362. /********************************************************************************************************************
  363. *function: Check whether driver should declare received rate up to MCS13 only since some chipset is not good
  364. * at receiving MCS14~15 frame from some AP.
  365. * input: struct ieee80211_device* ieee
  366. * u8 * PeerMacAddr
  367. * output: none
  368. * return: return 1 if driver should declare MCS13 only(otherwise return 0)
  369. * *****************************************************************************************************************/
  370. u8 HTIOTActIsDisableMCS14(struct ieee80211_device* ieee, u8* PeerMacAddr)
  371. {
  372. u8 ret = 0;
  373. #if 0
  374. // Apply for 819u only
  375. #if (HAL_CODE_BASE==RTL8192 && DEV_BUS_TYPE==USB_INTERFACE)
  376. if((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) ||
  377. (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)
  378. )
  379. {
  380. ret = 1;
  381. }
  382. if(pHTInfo->bCurrentRT2RTAggregation)
  383. {
  384. // The parameter of pHTInfo->bCurrentRT2RTAggregation must be decided previously
  385. ret = 1;
  386. }
  387. #endif
  388. #endif
  389. return ret;
  390. }
  391. u8 HTIOTActIsForcedCTS2Self(struct ieee80211_device *ieee, struct ieee80211_network *network)
  392. {
  393. u8 retValue = 0;
  394. //if(network->marvell_cap_exist)
  395. if(ieee->pHTInfo->IOTPeer == HT_IOT_PEER_MARVELL)
  396. {
  397. retValue = 1;
  398. }
  399. return retValue;
  400. }
  401. /**
  402. * Function: HTIOTActIsDisableMCS15
  403. *
  404. * Overview: Check whether driver should declare capability of receiving MCS15
  405. *
  406. * Input:
  407. * PADAPTER Adapter,
  408. *
  409. * Output: None
  410. * Return: true if driver should disable MCS15
  411. * 2008.04.15 Emily
  412. */
  413. bool HTIOTActIsDisableMCS15(struct ieee80211_device* ieee)
  414. {
  415. bool retValue = false;
  416. #ifdef TODO
  417. // Apply for 819u only
  418. #if (HAL_CODE_BASE==RTL8192)
  419. #if (DEV_BUS_TYPE == USB_INTERFACE)
  420. // Alway disable MCS15 by Jerry Chang's request.by Emily, 2008.04.15
  421. retValue = true;
  422. #elif (DEV_BUS_TYPE == PCI_INTERFACE)
  423. // Enable MCS15 if the peer is Cisco AP. by Emily, 2008.05.12
  424. // if(pBssDesc->bCiscoCapExist)
  425. // retValue = false;
  426. // else
  427. retValue = false;
  428. #endif
  429. #endif
  430. #endif
  431. // Jerry Chang suggest that 8190 1x2 does not need to disable MCS15
  432. return retValue;
  433. }
  434. /**
  435. * Function: HTIOTActIsDisableMCSTwoSpatialStream
  436. *
  437. * Overview: Check whether driver should declare capability of receiving All 2 ss packets
  438. *
  439. * Input:
  440. * PADAPTER Adapter,
  441. *
  442. * Output: None
  443. * Return: true if driver should disable all two spatial stream packet
  444. * 2008.04.21 Emily
  445. */
  446. bool HTIOTActIsDisableMCSTwoSpatialStream(struct ieee80211_device* ieee, u8 *PeerMacAddr)
  447. {
  448. bool retValue = false;
  449. #ifdef TODO
  450. // Apply for 819u only
  451. //#if (HAL_CODE_BASE==RTL8192)
  452. //This rule only apply to Belkin(Ralink) AP
  453. if(IS_UNDER_11N_AES_MODE(Adapter))
  454. {
  455. if((PlatformCompareMemory(PeerMacAddr, BELKINF5D8233V1_RALINK, 3)==0) ||
  456. (PlatformCompareMemory(PeerMacAddr, PCI_RALINK, 3)==0) ||
  457. (PlatformCompareMemory(PeerMacAddr, EDIMAX_RALINK, 3)==0))
  458. {
  459. //Set True to disable this function. Disable by default, Emily, 2008.04.23
  460. retValue = false;
  461. }
  462. }
  463. //#endif
  464. #endif
  465. return retValue;
  466. }
  467. /********************************************************************************************************************
  468. *function: Check whether driver should disable EDCA turbo mode
  469. * input: struct ieee80211_device* ieee
  470. * u8* PeerMacAddr
  471. * output: none
  472. * return: return 1 if driver should disable EDCA turbo mode(otherwise return 0)
  473. * *****************************************************************************************************************/
  474. u8 HTIOTActIsDisableEDCATurbo(struct ieee80211_device* ieee, u8* PeerMacAddr)
  475. {
  476. u8 retValue = false; // default enable EDCA Turbo mode.
  477. // Set specific EDCA parameter for different AP in DM handler.
  478. return retValue;
  479. #if 0
  480. if((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0)||
  481. (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)||
  482. (memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)||
  483. (memcmp(PeerMacAddr, NETGEAR834Bv2_BROADCOM, 3)==0))
  484. {
  485. retValue = 1; //Linksys disable EDCA turbo mode
  486. }
  487. return retValue;
  488. #endif
  489. }
  490. /********************************************************************************************************************
  491. *function: Check whether we need to use OFDM to sned MGNT frame for broadcom AP
  492. * input: struct ieee80211_network *network //current network we live
  493. * output: none
  494. * return: return 1 if true
  495. * *****************************************************************************************************************/
  496. u8 HTIOTActIsMgntUseCCK6M(struct ieee80211_network *network)
  497. {
  498. u8 retValue = 0;
  499. // 2008/01/25 MH Judeg if we need to use OFDM to sned MGNT frame for broadcom AP.
  500. // 2008/01/28 MH We must prevent that we select null bssid to link.
  501. if(network->broadcom_cap_exist)
  502. {
  503. retValue = 1;
  504. }
  505. return retValue;
  506. }
  507. u8 HTIOTActIsCCDFsync(u8* PeerMacAddr)
  508. {
  509. u8 retValue = 0;
  510. if( (memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) ||
  511. (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) ||
  512. (memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ==0))
  513. {
  514. retValue = 1;
  515. }
  516. return retValue;
  517. }
  518. //
  519. // Send null data for to tell AP that we are awake.
  520. //
  521. bool
  522. HTIOTActIsNullDataPowerSaving(struct ieee80211_device* ieee,struct ieee80211_network *network)
  523. {
  524. bool retValue = false;
  525. PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
  526. {
  527. if(pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) // ||(pBssDesc->Vender == HT_IOT_PEER_ATHEROS && pBssDesc->SubTypeOfVender == HT_IOT_PEER_ATHEROS_DIR635))
  528. return true;
  529. }
  530. return retValue;
  531. }
  532. void HTResetIOTSetting(
  533. PRT_HIGH_THROUGHPUT pHTInfo
  534. )
  535. {
  536. pHTInfo->IOTAction = 0;
  537. pHTInfo->IOTPeer = HT_IOT_PEER_UNKNOWN;
  538. }
  539. /********************************************************************************************************************
  540. *function: Construct Capablility Element in Beacon... if HTEnable is turned on
  541. * input: struct ieee80211_device* ieee
  542. * u8* posHTCap //pointer to store Capability Ele
  543. * u8* len //store length of CE
  544. * u8 IsEncrypt //whether encrypt, needed further
  545. * output: none
  546. * return: none
  547. * notice: posHTCap can't be null and should be initialized before.
  548. * *****************************************************************************************************************/
  549. void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u8* len, u8 IsEncrypt)
  550. {
  551. PRT_HIGH_THROUGHPUT pHT = ieee->pHTInfo;
  552. PHT_CAPABILITY_ELE pCapELE = NULL;
  553. //u8 bIsDeclareMCS13;
  554. if ((posHTCap == NULL) || (pHT == NULL))
  555. {
  556. IEEE80211_DEBUG(IEEE80211_DL_ERR, "posHTCap or pHTInfo can't be null in HTConstructCapabilityElement()\n");
  557. return;
  558. }
  559. memset(posHTCap, 0, *len);
  560. if(pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC)
  561. {
  562. u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; // For 11n EWC definition, 2007.07.17, by Emily
  563. memcpy(posHTCap, EWC11NHTCap, sizeof(EWC11NHTCap));
  564. pCapELE = (PHT_CAPABILITY_ELE)&(posHTCap[4]);
  565. }else
  566. {
  567. pCapELE = (PHT_CAPABILITY_ELE)posHTCap;
  568. }
  569. //HT capability info
  570. pCapELE->AdvCoding = 0; // This feature is not supported now!!
  571. if (ieee->GetHalfNmodeSupportByAPsHandler(ieee))
  572. {
  573. pCapELE->ChlWidth = 0;
  574. }
  575. else
  576. {
  577. pCapELE->ChlWidth = (pHT->bRegBW40MHz?1:0);
  578. }
  579. // pCapELE->ChlWidth = (pHT->bRegBW40MHz?1:0);
  580. pCapELE->MimoPwrSave = pHT->SelfMimoPs;
  581. pCapELE->GreenField = 0; // This feature is not supported now!!
  582. pCapELE->ShortGI20Mhz = 1; // We can receive Short GI!!
  583. pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!!
  584. //DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r",
  585. //pCapELE->ChlWidth, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz);
  586. pCapELE->TxSTBC = 1;
  587. pCapELE->RxSTBC = 0;
  588. pCapELE->DelayBA = 0; // Do not support now!!
  589. pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE>=7935)?1:0;
  590. pCapELE->DssCCk = ((pHT->bRegBW40MHz)?(pHT->bRegSuppCCK?1:0):0);
  591. pCapELE->PSMP = 0; // Do not support now!!
  592. pCapELE->LSigTxopProtect = 0; // Do not support now!!
  593. //MAC HT parameters info
  594. // TODO: Nedd to take care of this part
  595. IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d MaxAMSDUSize:%d DssCCk:%d\n", pCapELE->ChlWidth, pCapELE->MaxAMSDUSize, pCapELE->DssCCk);
  596. if( IsEncrypt)
  597. {
  598. pCapELE->MPDUDensity = 7; // 8us
  599. pCapELE->MaxRxAMPDUFactor = 2; // 2 is for 32 K and 3 is 64K
  600. }
  601. else
  602. {
  603. pCapELE->MaxRxAMPDUFactor = 3; // 2 is for 32 K and 3 is 64K
  604. pCapELE->MPDUDensity = 0; // no density
  605. }
  606. //Supported MCS set
  607. memcpy(pCapELE->MCS, ieee->Regdot11HTOperationalRateSet, 16);
  608. if(pHT->IOTAction & HT_IOT_ACT_DISABLE_MCS15)
  609. pCapELE->MCS[1] &= 0x7f;
  610. if(pHT->IOTAction & HT_IOT_ACT_DISABLE_MCS14)
  611. pCapELE->MCS[1] &= 0xbf;
  612. if(pHT->IOTAction & HT_IOT_ACT_DISABLE_ALL_2SS)
  613. pCapELE->MCS[1] &= 0x00;
  614. // 2008.06.12
  615. // For RTL819X, if pairwisekey = wep/tkip, ap is ralink, we support only MCS0~7.
  616. if (ieee->GetHalfNmodeSupportByAPsHandler(ieee))
  617. {
  618. int i;
  619. for(i = 1; i< 16; i++)
  620. pCapELE->MCS[i] = 0;
  621. }
  622. //Extended HT Capability Info
  623. memset(&pCapELE->ExtHTCapInfo, 0, 2);
  624. //TXBF Capabilities
  625. memset(pCapELE->TxBFCap, 0, 4);
  626. //Antenna Selection Capabilities
  627. pCapELE->ASCap = 0;
  628. //add 2 to give space for element ID and len when construct frames
  629. if(pHT->ePeerHTSpecVer == HT_SPEC_VER_EWC)
  630. *len = 30 + 2;
  631. else
  632. *len = 26 + 2;
  633. }
  634. /********************************************************************************************************************
  635. *function: Construct Information Element in Beacon... if HTEnable is turned on
  636. * input: struct ieee80211_device* ieee
  637. * u8* posHTCap //pointer to store Information Ele
  638. * u8* len //store len of
  639. * u8 IsEncrypt //whether encrypt, needed further
  640. * output: none
  641. * return: none
  642. * notice: posHTCap can't be null and be initialized before. only AP and IBSS sta should do this
  643. * *****************************************************************************************************************/
  644. void HTConstructInfoElement(struct ieee80211_device* ieee, u8* posHTInfo, u8* len, u8 IsEncrypt)
  645. {
  646. PRT_HIGH_THROUGHPUT pHT = ieee->pHTInfo;
  647. PHT_INFORMATION_ELE pHTInfoEle = (PHT_INFORMATION_ELE)posHTInfo;
  648. if ((posHTInfo == NULL) || (pHTInfoEle == NULL))
  649. {
  650. IEEE80211_DEBUG(IEEE80211_DL_ERR, "posHTInfo or pHTInfoEle can't be null in HTConstructInfoElement()\n");
  651. return;
  652. }
  653. memset(posHTInfo, 0, *len);
  654. if ( (ieee->iw_mode == IW_MODE_ADHOC) || (ieee->iw_mode == IW_MODE_MASTER)) //ap mode is not currently supported
  655. {
  656. pHTInfoEle->ControlChl = ieee->current_network.channel;
  657. pHTInfoEle->ExtChlOffset = ((pHT->bRegBW40MHz == false)?HT_EXTCHNL_OFFSET_NO_EXT:
  658. (ieee->current_network.channel<=6)?
  659. HT_EXTCHNL_OFFSET_UPPER:HT_EXTCHNL_OFFSET_LOWER);
  660. pHTInfoEle->RecommemdedTxWidth = pHT->bRegBW40MHz;
  661. pHTInfoEle->RIFS = 0;
  662. pHTInfoEle->PSMPAccessOnly = 0;
  663. pHTInfoEle->SrvIntGranularity = 0;
  664. pHTInfoEle->OptMode = pHT->CurrentOpMode;
  665. pHTInfoEle->NonGFDevPresent = 0;
  666. pHTInfoEle->DualBeacon = 0;
  667. pHTInfoEle->SecondaryBeacon = 0;
  668. pHTInfoEle->LSigTxopProtectFull = 0;
  669. pHTInfoEle->PcoActive = 0;
  670. pHTInfoEle->PcoPhase = 0;
  671. memset(pHTInfoEle->BasicMSC, 0, 16);
  672. *len = 22 + 2; //same above
  673. }
  674. else
  675. {
  676. //STA should not generate High Throughput Information Element
  677. *len = 0;
  678. }
  679. }
  680. /*
  681. * According to experiment, Realtek AP to STA (based on rtl8190) may achieve best performance
  682. * if both STA and AP set limitation of aggregation size to 32K, that is, set AMPDU density to 2
  683. * (Ref: IEEE 11n specification). However, if Realtek STA associates to other AP, STA should set
  684. * limitation of aggregation size to 8K, otherwise, performance of traffic stream from STA to AP
  685. * will be much less than the traffic stream from AP to STA if both of the stream runs concurrently
  686. * at the same time.
  687. *
  688. * Frame Format
  689. * Element ID Length OUI Type1 Reserved
  690. * 1 byte 1 byte 3 bytes 1 byte 1 byte
  691. *
  692. * OUI = 0x00, 0xe0, 0x4c,
  693. * Type = 0x02
  694. * Reserved = 0x00
  695. *
  696. * 2007.8.21 by Emily
  697. */
  698. /********************************************************************************************************************
  699. *function: Construct Information Element in Beacon... in RT2RT condition
  700. * input: struct ieee80211_device* ieee
  701. * u8* posRT2RTAgg //pointer to store Information Ele
  702. * u8* len //store len
  703. * output: none
  704. * return: none
  705. * notice:
  706. * *****************************************************************************************************************/
  707. void HTConstructRT2RTAggElement(struct ieee80211_device* ieee, u8* posRT2RTAgg, u8* len)
  708. {
  709. if (posRT2RTAgg == NULL) {
  710. IEEE80211_DEBUG(IEEE80211_DL_ERR, "posRT2RTAgg can't be null in HTConstructRT2RTAggElement()\n");
  711. return;
  712. }
  713. memset(posRT2RTAgg, 0, *len);
  714. *posRT2RTAgg++ = 0x00;
  715. *posRT2RTAgg++ = 0xe0;
  716. *posRT2RTAgg++ = 0x4c;
  717. *posRT2RTAgg++ = 0x02;
  718. *posRT2RTAgg++ = 0x01;
  719. *posRT2RTAgg = 0x10;//*posRT2RTAgg = 0x02;
  720. if(ieee->bSupportRemoteWakeUp) {
  721. *posRT2RTAgg |= 0x08;//RT_HT_CAP_USE_WOW;
  722. }
  723. *len = 6 + 2;
  724. return;
  725. #ifdef TODO
  726. #if(HAL_CODE_BASE == RTL8192 && DEV_BUS_TYPE == USB_INTERFACE)
  727. /*
  728. //Emily. If it is required to Ask Realtek AP to send AMPDU during AES mode, enable this
  729. section of code.
  730. if(IS_UNDER_11N_AES_MODE(Adapter))
  731. {
  732. posRT2RTAgg->Octet[5] |=RT_HT_CAP_USE_AMPDU;
  733. }else
  734. {
  735. posRT2RTAgg->Octet[5] &= 0xfb;
  736. }
  737. */
  738. #else
  739. // Do Nothing
  740. #endif
  741. posRT2RTAgg->Length = 6;
  742. #endif
  743. }
  744. /********************************************************************************************************************
  745. *function: Pick the right Rate Adaptive table to use
  746. * input: struct ieee80211_device* ieee
  747. * u8* pOperateMCS //A pointer to MCS rate bitmap
  748. * return: always we return true
  749. * notice:
  750. * *****************************************************************************************************************/
  751. u8 HT_PickMCSRate(struct ieee80211_device* ieee, u8* pOperateMCS)
  752. {
  753. u8 i;
  754. if (pOperateMCS == NULL)
  755. {
  756. IEEE80211_DEBUG(IEEE80211_DL_ERR, "pOperateMCS can't be null in HT_PickMCSRate()\n");
  757. return false;
  758. }
  759. switch(ieee->mode)
  760. {
  761. case IEEE_A:
  762. case IEEE_B:
  763. case IEEE_G:
  764. //legacy rate routine handled at selectedrate
  765. //no MCS rate
  766. for(i=0;i<=15;i++){
  767. pOperateMCS[i] = 0;
  768. }
  769. break;
  770. case IEEE_N_24G: //assume CCK rate ok
  771. case IEEE_N_5G:
  772. // Legacy part we only use 6, 5.5,2,1 for N_24G and 6 for N_5G.
  773. // Legacy part shall be handled at SelectRateSet().
  774. //HT part
  775. // TODO: may be different if we have different number of antenna
  776. pOperateMCS[0] &=RATE_ADPT_1SS_MASK; //support MCS 0~7
  777. pOperateMCS[1] &=RATE_ADPT_2SS_MASK;
  778. pOperateMCS[3] &=RATE_ADPT_MCS32_MASK;
  779. break;
  780. //should never reach here
  781. default:
  782. break;
  783. }
  784. return true;
  785. }
  786. /*
  787. * Description:
  788. * This function will get the highest speed rate in input MCS set.
  789. *
  790. * /param Adapter Pionter to Adapter entity
  791. * pMCSRateSet Pointer to MCS rate bitmap
  792. * pMCSFilter Pointer to MCS rate filter
  793. *
  794. * /return Highest MCS rate included in pMCSRateSet and filtered by pMCSFilter.
  795. *
  796. */
  797. /********************************************************************************************************************
  798. *function: This function will get the highest speed rate in input MCS set.
  799. * input: struct ieee80211_device* ieee
  800. * u8* pMCSRateSet //Pointer to MCS rate bitmap
  801. * u8* pMCSFilter //Pointer to MCS rate filter
  802. * return: Highest MCS rate included in pMCSRateSet and filtered by pMCSFilter
  803. * notice:
  804. * *****************************************************************************************************************/
  805. u8 HTGetHighestMCSRate(struct ieee80211_device* ieee, u8* pMCSRateSet, u8* pMCSFilter)
  806. {
  807. u8 i, j;
  808. u8 bitMap;
  809. u8 mcsRate = 0;
  810. u8 availableMcsRate[16];
  811. if (pMCSRateSet == NULL || pMCSFilter == NULL)
  812. {
  813. IEEE80211_DEBUG(IEEE80211_DL_ERR, "pMCSRateSet or pMCSFilter can't be null in HTGetHighestMCSRate()\n");
  814. return false;
  815. }
  816. for(i=0; i<16; i++)
  817. availableMcsRate[i] = pMCSRateSet[i] & pMCSFilter[i];
  818. for(i = 0; i < 16; i++)
  819. {
  820. if(availableMcsRate[i] != 0)
  821. break;
  822. }
  823. if(i == 16)
  824. return false;
  825. for(i = 0; i < 16; i++)
  826. {
  827. if(availableMcsRate[i] != 0)
  828. {
  829. bitMap = availableMcsRate[i];
  830. for(j = 0; j < 8; j++)
  831. {
  832. if((bitMap%2) != 0)
  833. {
  834. if(HTMcsToDataRate(ieee, (8*i+j)) > HTMcsToDataRate(ieee, mcsRate))
  835. mcsRate = (8*i+j);
  836. }
  837. bitMap = bitMap>>1;
  838. }
  839. }
  840. }
  841. return (mcsRate|0x80);
  842. }
  843. /*
  844. **
  845. **1.Filter our operation rate set with AP's rate set
  846. **2.shall reference channel bandwidth, STBC, Antenna number
  847. **3.generate rate adative table for firmware
  848. **David 20060906
  849. **
  850. ** \pHTSupportedCap: the connected STA's supported rate Capability element
  851. */
  852. u8 HTFilterMCSRate( struct ieee80211_device* ieee, u8* pSupportMCS, u8* pOperateMCS)
  853. {
  854. u8 i=0;
  855. // filter out operational rate set not supported by AP, the lenth of it is 16
  856. for(i=0;i<=15;i++){
  857. pOperateMCS[i] = ieee->Regdot11HTOperationalRateSet[i]&pSupportMCS[i];
  858. }
  859. // TODO: adjust our operational rate set according to our channel bandwidth, STBC and Antenna number
  860. // TODO: fill suggested rate adaptive rate index and give firmware info using Tx command packet
  861. // we also shall suggested the first start rate set according to our singal strength
  862. HT_PickMCSRate(ieee, pOperateMCS);
  863. // For RTL819X, if pairwisekey = wep/tkip, we support only MCS0~7.
  864. if (ieee->GetHalfNmodeSupportByAPsHandler(ieee))
  865. pOperateMCS[1] = 0;
  866. //
  867. // For RTL819X, we support only MCS0~15.
  868. // And also, we do not know how to use MCS32 now.
  869. //
  870. for(i=2; i<=15; i++)
  871. pOperateMCS[i] = 0;
  872. return true;
  873. }
  874. void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidth, HT_EXTCHNL_OFFSET Offset);
  875. void HTOnAssocRsp(struct ieee80211_device *ieee)
  876. {
  877. PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
  878. PHT_CAPABILITY_ELE pPeerHTCap = NULL;
  879. PHT_INFORMATION_ELE pPeerHTInfo = NULL;
  880. u16 nMaxAMSDUSize = 0;
  881. u8* pMcsFilter = NULL;
  882. static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; // For 11n EWC definition, 2007.07.17, by Emily
  883. static u8 EWC11NHTInfo[] = {0x00, 0x90, 0x4c, 0x34}; // For 11n EWC definition, 2007.07.17, by Emily
  884. if( pHTInfo->bCurrentHTSupport == false )
  885. {
  886. IEEE80211_DEBUG(IEEE80211_DL_ERR, "<=== HTOnAssocRsp(): HT_DISABLE\n");
  887. return;
  888. }
  889. IEEE80211_DEBUG(IEEE80211_DL_HT, "===> HTOnAssocRsp_wq(): HT_ENABLE\n");
  890. // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, pHTInfo->PeerHTCapBuf, sizeof(HT_CAPABILITY_ELE));
  891. // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, pHTInfo->PeerHTInfoBuf, sizeof(HT_INFORMATION_ELE));
  892. // HTDebugHTCapability(pHTInfo->PeerHTCapBuf,"HTOnAssocRsp_wq");
  893. // HTDebugHTInfo(pHTInfo->PeerHTInfoBuf,"HTOnAssocRsp_wq");
  894. //
  895. if(!memcmp(pHTInfo->PeerHTCapBuf,EWC11NHTCap, sizeof(EWC11NHTCap)))
  896. pPeerHTCap = (PHT_CAPABILITY_ELE)(&pHTInfo->PeerHTCapBuf[4]);
  897. else
  898. pPeerHTCap = (PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf);
  899. if(!memcmp(pHTInfo->PeerHTInfoBuf, EWC11NHTInfo, sizeof(EWC11NHTInfo)))
  900. pPeerHTInfo = (PHT_INFORMATION_ELE)(&pHTInfo->PeerHTInfoBuf[4]);
  901. else
  902. pPeerHTInfo = (PHT_INFORMATION_ELE)(pHTInfo->PeerHTInfoBuf);
  903. ////////////////////////////////////////////////////////
  904. // Configurations:
  905. ////////////////////////////////////////////////////////
  906. IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_HT, pPeerHTCap, sizeof(HT_CAPABILITY_ELE));
  907. // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_HT, pPeerHTInfo, sizeof(HT_INFORMATION_ELE));
  908. // Config Supported Channel Width setting
  909. //
  910. HTSetConnectBwMode(ieee, (HT_CHANNEL_WIDTH)(pPeerHTCap->ChlWidth), (HT_EXTCHNL_OFFSET)(pPeerHTInfo->ExtChlOffset));
  911. // if(pHTInfo->bCurBW40MHz == true)
  912. pHTInfo->bCurTxBW40MHz = ((pPeerHTInfo->RecommemdedTxWidth == 1)?true:false);
  913. //
  914. // Update short GI/ long GI setting
  915. //
  916. // TODO:
  917. pHTInfo->bCurShortGI20MHz=
  918. ((pHTInfo->bRegShortGI20MHz)?((pPeerHTCap->ShortGI20Mhz==1)?true:false):false);
  919. pHTInfo->bCurShortGI40MHz=
  920. ((pHTInfo->bRegShortGI40MHz)?((pPeerHTCap->ShortGI40Mhz==1)?true:false):false);
  921. //
  922. // Config TX STBC setting
  923. //
  924. // TODO:
  925. //
  926. // Config DSSS/CCK mode in 40MHz mode
  927. //
  928. // TODO:
  929. pHTInfo->bCurSuppCCK =
  930. ((pHTInfo->bRegSuppCCK)?((pPeerHTCap->DssCCk==1)?true:false):false);
  931. //
  932. // Config and configure A-MSDU setting
  933. //
  934. pHTInfo->bCurrent_AMSDU_Support = pHTInfo->bAMSDU_Support;
  935. if (ieee->rtllib_ap_sec_type &&
  936. (ieee->rtllib_ap_sec_type(ieee)&(SEC_ALG_WEP|SEC_ALG_TKIP))){
  937. if( (pHTInfo->IOTPeer== HT_IOT_PEER_ATHEROS) ||
  938. (pHTInfo->IOTPeer == HT_IOT_PEER_UNKNOWN) )
  939. pHTInfo->bCurrentAMPDUEnable = false;
  940. }
  941. nMaxAMSDUSize = (pPeerHTCap->MaxAMSDUSize==0)?3839:7935;
  942. if(pHTInfo->nAMSDU_MaxSize > nMaxAMSDUSize )
  943. pHTInfo->nCurrent_AMSDU_MaxSize = nMaxAMSDUSize;
  944. else
  945. pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize;
  946. //
  947. // Config A-MPDU setting
  948. //
  949. pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable;
  950. // <1> Decide AMPDU Factor
  951. // By Emily
  952. if(!pHTInfo->bRegRT2RTAggregation)
  953. {
  954. // Decide AMPDU Factor according to protocol handshake
  955. if(pHTInfo->AMPDU_Factor > pPeerHTCap->MaxRxAMPDUFactor)
  956. pHTInfo->CurrentAMPDUFactor = pPeerHTCap->MaxRxAMPDUFactor;
  957. else
  958. pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor;
  959. }else
  960. {
  961. // Set MPDU density to 2 to Realtek AP, and set it to 0 for others
  962. // Replace MPDU factor declared in original association response frame format. 2007.08.20 by Emily
  963. #if 0
  964. osTmp= PacketGetElement( asocpdu, EID_Vendor, OUI_SUB_REALTEK_AGG, OUI_SUBTYPE_DONT_CARE);
  965. if(osTmp.Length >= 5) //00:e0:4c:02:00
  966. #endif
  967. if (ieee->current_network.bssht.bdRT2RTAggregation)
  968. {
  969. if( ieee->pairwise_key_type != KEY_TYPE_NA)
  970. // Realtek may set 32k in security mode and 64k for others
  971. pHTInfo->CurrentAMPDUFactor = pPeerHTCap->MaxRxAMPDUFactor;
  972. else
  973. pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_64K;
  974. }else
  975. {
  976. if(pPeerHTCap->MaxRxAMPDUFactor < HT_AGG_SIZE_32K)
  977. pHTInfo->CurrentAMPDUFactor = pPeerHTCap->MaxRxAMPDUFactor;
  978. else
  979. pHTInfo->CurrentAMPDUFactor = HT_AGG_SIZE_32K;
  980. }
  981. }
  982. // <2> Set AMPDU Minimum MPDU Start Spacing
  983. // 802.11n 3.0 section 9.7d.3
  984. #if 1
  985. if(pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity)
  986. pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density;
  987. else
  988. pHTInfo->CurrentMPDUDensity = pPeerHTCap->MPDUDensity;
  989. if(ieee->pairwise_key_type != KEY_TYPE_NA )
  990. pHTInfo->CurrentMPDUDensity = 7; // 8us
  991. #else
  992. if(pHTInfo->MPDU_Density > pPeerHTCap->MPDUDensity)
  993. pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density;
  994. else
  995. pHTInfo->CurrentMPDUDensity = pPeerHTCap->MPDUDensity;
  996. #endif
  997. // Force TX AMSDU
  998. // Lanhsin: mark for tmp to avoid deauth by ap from s3
  999. //if(memcmp(pMgntInfo->Bssid, NETGEAR834Bv2_BROADCOM, 3)==0)
  1000. if(0)
  1001. {
  1002. pHTInfo->bCurrentAMPDUEnable = false;
  1003. pHTInfo->ForcedAMSDUMode = HT_AGG_FORCE_ENABLE;
  1004. pHTInfo->ForcedAMSDUMaxSize = 7935;
  1005. pHTInfo->IOTAction |= HT_IOT_ACT_TX_USE_AMSDU_8K;
  1006. }
  1007. // Rx Reorder Setting
  1008. pHTInfo->bCurRxReorderEnable = pHTInfo->bRegRxReorderEnable;
  1009. //
  1010. // Filter out unsupported HT rate for this AP
  1011. // Update RATR table
  1012. // This is only for 8190 ,8192 or later product which using firmware to handle rate adaptive mechanism.
  1013. //
  1014. // Handle Ralink AP bad MCS rate set condition. Joseph.
  1015. // This fix the bug of Ralink AP. This may be removed in the future.
  1016. if(pPeerHTCap->MCS[0] == 0)
  1017. pPeerHTCap->MCS[0] = 0xff;
  1018. HTFilterMCSRate(ieee, pPeerHTCap->MCS, ieee->dot11HTOperationalRateSet);
  1019. //
  1020. // Config MIMO Power Save setting
  1021. //
  1022. pHTInfo->PeerMimoPs = pPeerHTCap->MimoPwrSave;
  1023. if(pHTInfo->PeerMimoPs == MIMO_PS_STATIC)
  1024. pMcsFilter = MCS_FILTER_1SS;
  1025. else
  1026. pMcsFilter = MCS_FILTER_ALL;
  1027. //WB add for MCS8 bug
  1028. // pMcsFilter = MCS_FILTER_1SS;
  1029. ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee, ieee->dot11HTOperationalRateSet, pMcsFilter);
  1030. ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate;
  1031. //
  1032. // Config current operation mode.
  1033. //
  1034. pHTInfo->CurrentOpMode = pPeerHTInfo->OptMode;
  1035. }
  1036. void HTSetConnectBwModeCallback(struct ieee80211_device* ieee);
  1037. /********************************************************************************************************************
  1038. *function: initialize HT info(struct PRT_HIGH_THROUGHPUT)
  1039. * input: struct ieee80211_device* ieee
  1040. * output: none
  1041. * return: none
  1042. * notice: This function is called when * (1) MPInitialization Phase * (2) Receiving of Deauthentication from AP
  1043. ********************************************************************************************************************/
  1044. // TODO: Should this funciton be called when receiving of Disassociation?
  1045. void HTInitializeHTInfo(struct ieee80211_device* ieee)
  1046. {
  1047. PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
  1048. //
  1049. // These parameters will be reset when receiving deauthentication packet
  1050. //
  1051. IEEE80211_DEBUG(IEEE80211_DL_HT, "===========>%s()\n", __FUNCTION__);
  1052. pHTInfo->bCurrentHTSupport = false;
  1053. // 40MHz channel support
  1054. pHTInfo->bCurBW40MHz = false;
  1055. pHTInfo->bCurTxBW40MHz = false;
  1056. // Short GI support
  1057. pHTInfo->bCurShortGI20MHz = false;
  1058. pHTInfo->bCurShortGI40MHz = false;
  1059. pHTInfo->bForcedShortGI = false;
  1060. // CCK rate support
  1061. // This flag is set to true to support CCK rate by default.
  1062. // It will be affected by "pHTInfo->bRegSuppCCK" and AP capabilities only when associate to
  1063. // 11N BSS.
  1064. pHTInfo->bCurSuppCCK = true;
  1065. // AMSDU related
  1066. pHTInfo->bCurrent_AMSDU_Support = false;
  1067. pHTInfo->nCurrent_AMSDU_MaxSize = pHTInfo->nAMSDU_MaxSize;
  1068. // AMPUD related
  1069. pHTInfo->CurrentMPDUDensity = pHTInfo->MPDU_Density;
  1070. pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor;
  1071. // Initialize all of the parameters related to 11n
  1072. memset((void*)(&(pHTInfo->SelfHTCap)), 0, sizeof(pHTInfo->SelfHTCap));
  1073. memset((void*)(&(pHTInfo->SelfHTInfo)), 0, sizeof(pHTInfo->SelfHTInfo));
  1074. memset((void*)(&(pHTInfo->PeerHTCapBuf)), 0, sizeof(pHTInfo->PeerHTCapBuf));
  1075. memset((void*)(&(pHTInfo->PeerHTInfoBuf)), 0, sizeof(pHTInfo->PeerHTInfoBuf));
  1076. pHTInfo->bSwBwInProgress = false;
  1077. pHTInfo->ChnlOp = CHNLOP_NONE;
  1078. // Set default IEEE spec for Draft N
  1079. pHTInfo->ePeerHTSpecVer = HT_SPEC_VER_IEEE;
  1080. // Realtek proprietary aggregation mode
  1081. pHTInfo->bCurrentRT2RTAggregation = false;
  1082. pHTInfo->bCurrentRT2RTLongSlotTime = false;
  1083. pHTInfo->IOTPeer = 0;
  1084. pHTInfo->IOTAction = 0;
  1085. //MCS rate initialized here
  1086. {
  1087. u8* RegHTSuppRateSets = &(ieee->RegHTSuppRateSet[0]);
  1088. RegHTSuppRateSets[0] = 0xFF; //support MCS 0~7
  1089. RegHTSuppRateSets[1] = 0xFF; //support MCS 8~15
  1090. RegHTSuppRateSets[4] = 0x01; //support MCS 32
  1091. }
  1092. }
  1093. /********************************************************************************************************************
  1094. *function: initialize Bss HT structure(struct PBSS_HT)
  1095. * input: PBSS_HT pBssHT //to be initialized
  1096. * output: none
  1097. * return: none
  1098. * notice: This function is called when initialize network structure
  1099. ********************************************************************************************************************/
  1100. void HTInitializeBssDesc(PBSS_HT pBssHT)
  1101. {
  1102. pBssHT->bdSupportHT = false;
  1103. memset(pBssHT->bdHTCapBuf, 0, sizeof(pBssHT->bdHTCapBuf));
  1104. pBssHT->bdHTCapLen = 0;
  1105. memset(pBssHT->bdHTInfoBuf, 0, sizeof(pBssHT->bdHTInfoBuf));
  1106. pBssHT->bdHTInfoLen = 0;
  1107. pBssHT->bdHTSpecVer= HT_SPEC_VER_IEEE;
  1108. pBssHT->bdRT2RTAggregation = false;
  1109. pBssHT->bdRT2RTLongSlotTime = false;
  1110. }
  1111. #if 0
  1112. //below function has merged into ieee80211_network_init() in ieee80211_rx.c
  1113. void
  1114. HTParsingHTCapElement(
  1115. IN PADAPTER Adapter,
  1116. IN OCTET_STRING HTCapIE,
  1117. OUT PRT_WLAN_BSS pBssDesc
  1118. )
  1119. {
  1120. PMGNT_INFO pMgntInfo = &Adapter->MgntInfo;
  1121. if( HTCapIE.Length > sizeof(pBssDesc->BssHT.bdHTCapBuf) )
  1122. {
  1123. RT_TRACE( COMP_HT, DBG_LOUD, ("HTParsingHTCapElement(): HT Capability Element length is too long!\n") );
  1124. return;
  1125. }
  1126. // TODO: Check the correctness of HT Cap
  1127. //Print each field in detail. Driver should not print out this message by default
  1128. if(!pMgntInfo->mActingAsAp && !pMgntInfo->mAssoc)
  1129. HTDebugHTCapability(DBG_TRACE, Adapter, &HTCapIE, (pu8)"HTParsingHTCapElement()");
  1130. HTCapIE.Length = HTCapIE.Length > sizeof(pBssDesc->BssHT.bdHTCapBuf)?\
  1131. sizeof(pBssDesc->BssHT.bdHTCapBuf):HTCapIE.Length; //prevent from overflow
  1132. CopyMem(pBssDesc->BssHT.bdHTCapBuf, HTCapIE.Octet, HTCapIE.Length);
  1133. pBssDesc->BssHT.bdHTCapLen = HTCapIE.Length;
  1134. }
  1135. void
  1136. HTParsingHTInfoElement(
  1137. PADAPTER Adapter,
  1138. OCTET_STRING HTInfoIE,
  1139. PRT_WLAN_BSS pBssDesc
  1140. )
  1141. {
  1142. PMGNT_INFO pMgntInfo = &Adapter->MgntInfo;
  1143. if( HTInfoIE.Length > sizeof(pBssDesc->BssHT.bdHTInfoBuf))
  1144. {
  1145. RT_TRACE( COMP_HT, DBG_LOUD, ("HTParsingHTInfoElement(): HT Information Element length is too long!\n") );
  1146. return;
  1147. }
  1148. // TODO: Check the correctness of HT Info
  1149. //Print each field in detail. Driver should not print out this message by default
  1150. if(!pMgntInfo->mActingAsAp && !pMgntInfo->mAssoc)
  1151. HTDebugHTInfo(DBG_TRACE, Adapter, &HTInfoIE, (pu8)"HTParsingHTInfoElement()");
  1152. HTInfoIE.Length = HTInfoIE.Length > sizeof(pBssDesc->BssHT.bdHTInfoBuf)?\
  1153. sizeof(pBssDesc->BssHT.bdHTInfoBuf):HTInfoIE.Length; //prevent from overflow
  1154. CopyMem( pBssDesc->BssHT.bdHTInfoBuf, HTInfoIE.Octet, HTInfoIE.Length);
  1155. pBssDesc->BssHT.bdHTInfoLen = HTInfoIE.Length;
  1156. }
  1157. /*
  1158. * Get HT related information from beacon and save it in BssDesc
  1159. *
  1160. * (1) Parse HTCap, and HTInfo, and record whether it is 11n AP
  1161. * (2) If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT()
  1162. * (3) Check whether peer is Realtek AP (for Realtek proprietary aggregation mode).
  1163. * Input:
  1164. * PADAPTER Adapter
  1165. *
  1166. * Output:
  1167. * PRT_TCB BssDesc
  1168. *
  1169. */
  1170. void HTGetValueFromBeaconOrProbeRsp(
  1171. PADAPTER Adapter,
  1172. POCTET_STRING pSRCmmpdu,
  1173. PRT_WLAN_BSS bssDesc
  1174. )
  1175. {
  1176. PMGNT_INFO pMgntInfo = &Adapter->MgntInfo;
  1177. PRT_HIGH_THROUGHPUT pHTInfo = GET_HT_INFO(pMgntInfo);
  1178. OCTET_STRING HTCapIE, HTInfoIE, HTRealtekAgg, mmpdu;
  1179. OCTET_STRING BroadcomElement, CiscoElement;
  1180. mmpdu.Octet = pSRCmmpdu->Octet;
  1181. mmpdu.Length = pSRCmmpdu->Length;
  1182. //2Note:
  1183. // Mark for IOT testing using Linksys WRT350N, This AP does not contain WMM IE when
  1184. // it is configured at pure-N mode.
  1185. // if(bssDesc->BssQos.bdQoSMode & QOS_WMM)
  1186. //
  1187. HTInitializeBssDesc (&bssDesc->BssHT);
  1188. //2<1> Parse HTCap, and HTInfo
  1189. // Get HT Capability IE: (1) Get IEEE Draft N IE or (2) Get EWC IE
  1190. HTCapIE = PacketGetElement(mmpdu, EID_HTCapability, OUI_SUB_DONT_CARE, OUI_SUBTYPE_DONT_CARE);
  1191. if(HTCapIE.Length == 0)
  1192. {
  1193. HTCapIE = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_11N_EWC_HT_CAP, OUI_SUBTYPE_DONT_CARE);
  1194. if(HTCapIE.Length != 0)
  1195. bssDesc->BssHT.bdHTSpecVer= HT_SPEC_VER_EWC;
  1196. }
  1197. if(HTCapIE.Length != 0)
  1198. HTParsingHTCapElement(Adapter, HTCapIE, bssDesc);
  1199. // Get HT Information IE: (1) Get IEEE Draft N IE or (2) Get EWC IE
  1200. HTInfoIE = PacketGetElement(mmpdu, EID_HTInfo, OUI_SUB_DONT_CARE, OUI_SUBTYPE_DONT_CARE);
  1201. if(HTInfoIE.Length == 0)
  1202. {
  1203. HTInfoIE = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_11N_EWC_HT_INFO, OUI_SUBTYPE_DONT_CARE);
  1204. if(HTInfoIE.Length != 0)
  1205. bssDesc->BssHT.bdHTSpecVer = HT_SPEC_VER_EWC;
  1206. }
  1207. if(HTInfoIE.Length != 0)
  1208. HTParsingHTInfoElement(Adapter, HTInfoIE, bssDesc);
  1209. //2<2>If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT()
  1210. if(HTCapIE.Length != 0)
  1211. {
  1212. bssDesc->BssHT.bdSupportHT = true;
  1213. if(bssDesc->BssQos.bdQoSMode == QOS_DISABLE)
  1214. QosSetLegacyWMMParamWithHT(Adapter, bssDesc);
  1215. }
  1216. else
  1217. {
  1218. bssDesc->BssHT.bdSupportHT = false;
  1219. }
  1220. //2<3>Check whether the peer is Realtek AP/STA
  1221. if(pHTInfo->bRegRT2RTAggregation)
  1222. {
  1223. if(bssDesc->BssHT.bdSupportHT)
  1224. {
  1225. HTRealtekAgg = PacketGetElement(mmpdu, EID_Vendor, OUI_SUB_REALTEK_AGG, OUI_SUBTYPE_DONT_CARE);
  1226. if(HTRealtekAgg.Length >=5 )
  1227. {
  1228. bssDesc->BssHT.bdRT2RTAggregation = true;
  1229. if((HTRealtekAgg.Octet[4]==1) && (HTRealtekAgg.Octet[5] & 0x02))
  1230. bssDesc->BssHT.bdRT2RTLongSlotTime = true;
  1231. }
  1232. }
  1233. }
  1234. //
  1235. // 2008/01/25 MH Get Broadcom AP IE for manamgent frame CCK rate problem.
  1236. // AP can not receive CCK managemtn from from 92E.
  1237. //
  1238. // Initialize every new bss broadcom cap exist as false..
  1239. bssDesc->bBroadcomCapExist= false;
  1240. if(HTCapIE.Length != 0 || HTInfoIE.Length != 0)
  1241. {
  1242. u4Byte Length = 0;
  1243. FillOctetString(BroadcomElement, NULL, 0);
  1244. BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_1, OUI_SUBTYPE_DONT_CARE);
  1245. Length += BroadcomElement.Length;
  1246. BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_2, OUI_SUBTYPE_DONT_CARE);
  1247. Length += BroadcomElement.Length;
  1248. BroadcomElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_BROADCOM_IE_3, OUI_SUBTYPE_DONT_CARE);
  1249. Length += BroadcomElement.Length;
  1250. if(Length > 0)
  1251. bssDesc->bBroadcomCapExist = true;
  1252. }
  1253. // For Cisco IOT issue
  1254. CiscoElement = PacketGetElement( mmpdu, EID_Vendor, OUI_SUB_CISCO_IE, OUI_SUBTYPE_DONT_CARE);
  1255. if(CiscoElement.Length != 0){ // 3: 0x00, 0x40, 0x96 ....
  1256. bssDesc->bCiscoCapExist = true;
  1257. }else{
  1258. bssDesc->bCiscoCapExist = false;
  1259. }
  1260. }
  1261. #endif
  1262. /********************************************************************************************************************
  1263. *function: initialize Bss HT structure(struct PBSS_HT)
  1264. * input: struct ieee80211_device *ieee
  1265. * struct ieee80211_network *pNetwork //usually current network we are live in
  1266. * output: none
  1267. * return: none
  1268. * notice: This function should ONLY be called before association
  1269. ********************************************************************************************************************/
  1270. void HTResetSelfAndSavePeerSetting(struct ieee80211_device* ieee, struct ieee80211_network * pNetwork)
  1271. {
  1272. PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo;
  1273. // u16 nMaxAMSDUSize;
  1274. // PHT_CAPABILITY_ELE pPeerHTCap = (PHT_CAPABILITY_ELE)pNetwork->bssht.bdHTCapBuf;
  1275. // PHT_INFORMATION_ELE pPeerHTInfo = (PHT_INFOR