bss.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. /*
  2. ** Id: @(#) bss.h
  3. */
  4. /*! \file "bss.h"
  5. \brief In this file we define the function prototype used in BSS/IBSS.
  6. The file contains the function declarations and defines for used in BSS/IBSS.
  7. */
  8. /*
  9. ** Log: bss.h
  10. **
  11. ** 02 19 2013 cm.chang
  12. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  13. ** Add new definiton of MAX_BSS_INDEX
  14. **
  15. ** 02 18 2013 cp.wu
  16. ** [BORA00002253] [MT6630 Wi-Fi][Driver][Firmware] Add NLO and timeout mechanism to SCN module
  17. ** modify bssClearClientList() to bssInitializeClientList()
  18. **
  19. ** 01 21 2013 cm.chang
  20. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  21. ** 1. Create rP2pDevInfo structure
  22. ** 2. Support 80/160 MHz channel bandwidth for channel privilege
  23. **
  24. ** 01 17 2013 cm.chang
  25. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  26. ** Use ucBssIndex to replace eNetworkTypeIndex
  27. **
  28. ** 09 17 2012 cm.chang
  29. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  30. ** Duplicate source from MT6620 v2.3 driver branch
  31. ** (Davinci label: MT6620_WIFI_Driver_V2_3_120913_1942_As_MT6630_Base)
  32. *
  33. * 07 17 2012 yuche.tsai
  34. * NULL
  35. * Let netdev bring up.
  36. *
  37. * 07 17 2012 yuche.tsai
  38. * NULL
  39. * Compile no error before trial run.
  40. *
  41. * 03 02 2012 terry.wu
  42. * NULL
  43. * Sync CFG80211 modification from branch 2,2.
  44. *
  45. * 09 14 2011 yuche.tsai
  46. * NULL
  47. * Add P2P IE in assoc response.
  48. *
  49. * 03 19 2011 yuche.tsai
  50. * [WCXRP00000581] [Volunteer Patch][MT6620][Driver] P2P IE in Assoc Req Issue
  51. * Make assoc req to append P2P IE if wifi direct is enabled.
  52. *
  53. * 03 02 2011 wh.su
  54. * [WCXRP00000448] [MT6620 Wi-Fi][Driver] Fixed WSC IE not send out at probe request
  55. * Add code to send beacon and probe response WSC IE at Auto GO.
  56. *
  57. * 02 23 2011 eddie.chen
  58. * [WCXRP00000463] [MT6620 Wi-Fi][FW/Driver][Hotspot] Cannot update WMM PS STA's partital bitmap
  59. * Fix parsing WMM INFO and bmp delivery bitmap definition.
  60. *
  61. * 01 31 2011 george.huang
  62. * [WCXRP00000333] [MT5931][FW] support SRAM power control drivers
  63. * Extend TIM PVB, from 2 to 3 octets.
  64. *
  65. * 11 29 2010 cp.wu
  66. * [WCXRP00000210] [MT6620 Wi-Fi][Driver][FW] Set RCPI value in STA_REC for
  67. * initial TX rate selection of auto-rate algorithm
  68. * update ucRcpi of STA_RECORD_T for AIS when
  69. * 1) Beacons for IBSS merge is received
  70. * 2) Associate Response for a connecting peer is received
  71. *
  72. * 09 03 2010 kevin.huang
  73. * NULL
  74. * Refine #include sequence and solve recursive/nested #include issue
  75. *
  76. * 08 12 2010 kevin.huang
  77. * NULL
  78. * Update bssProcessProbeRequest() and bssSendBeaconProbeResponse() declarations
  79. *
  80. * 07 19 2010 cp.wu
  81. *
  82. * [WPD00003833] [MT6620 and MT5931] Driver migration.
  83. * when IBSS is being merged-in, send command packet to PM for connected indication
  84. *
  85. * 07 08 2010 cp.wu
  86. *
  87. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  88. *
  89. * 06 25 2010 george.huang
  90. * [WPD00001556]Basic power managemenet function
  91. * Create beacon update path, with expose bssUpdateBeaconContent()
  92. *
  93. * 06 17 2010 yuche.tsai
  94. * [WPD00003839][MT6620 5931][P2P] Feature migration
  95. * Add CTRL FLAGS for Probe Response.
  96. *
  97. * 06 09 2010 cp.wu
  98. * [WPD00003833][MT6620 and MT5931] Driver migration
  99. * add necessary changes to driver data paths.
  100. *
  101. * 06 07 2010 cp.wu
  102. * [WPD00003833][MT6620 and MT5931] Driver migration
  103. * add aa_fsm.h, ais_fsm.h, bss.h, mib.h and scan.h.
  104. *
  105. * 06 04 2010 george.huang
  106. * [BORA00000678][MT6620]WiFi LP integration
  107. * [PM] Support U-APSD for STA mode
  108. *
  109. * 05 28 2010 kevin.huang
  110. * [BORA00000794][WIFISYS][New Feature]Power Management Support
  111. * Add ClientList handling API - bssClearClientList, bssAddStaRecToClientList
  112. *
  113. * 05 14 2010 kevin.huang
  114. * [BORA00000794][WIFISYS][New Feature]Power Management Support
  115. * Remove unused typedef.
  116. *
  117. * 05 12 2010 kevin.huang
  118. * [BORA00000794][WIFISYS][New Feature]Power Management Support
  119. * Fix file merge error
  120. *
  121. * 05 12 2010 kevin.huang
  122. * [BORA00000794][WIFISYS][New Feature]Power Management Support
  123. * Add Power Management - Legacy PS-POLL support.
  124. *
  125. * 04 19 2010 kevin.huang
  126. * [BORA00000714][WIFISYS][New Feature]Beacon Timeout Support
  127. * Add Beacon Timeout Support
  128. * * * and will send Null frame to diagnose connection
  129. *
  130. * 03 16 2010 kevin.huang
  131. * [BORA00000663][WIFISYS][New Feature] AdHoc Mode Support
  132. * Add AdHoc Mode
  133. *
  134. * 02 23 2010 kevin.huang
  135. * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
  136. * Add DTIM count update while TX Beacon
  137. *
  138. * 02 04 2010 kevin.huang
  139. * [BORA00000603][WIFISYS] [New Feature] AAA Module Support
  140. * Add AAA Module Support, Revise Net Type to Net Type Index for array lookup
  141. */
  142. #ifndef _BSS_H
  143. #define _BSS_H
  144. /*******************************************************************************
  145. * C O M P I L E R F L A G S
  146. ********************************************************************************
  147. */
  148. /*******************************************************************************
  149. * E X T E R N A L R E F E R E N C E S
  150. ********************************************************************************
  151. */
  152. #include "wlan_def.h"
  153. extern const PUINT_8 apucNetworkType[NETWORK_TYPE_NUM];
  154. /*******************************************************************************
  155. * C O N S T A N T S
  156. ********************************************************************************
  157. */
  158. /* Fixed value=4 for MT6630.
  159. * It is the biggest index of this pointer array prAdapter->aprBssInfo[].
  160. */
  161. #define MAX_BSS_INDEX HW_BSSID_NUM
  162. #define P2P_DEV_BSS_INDEX MAX_BSS_INDEX
  163. /* Define how many concurrent operation networks. */
  164. #define BSS_INFO_NUM KAL_BSS_NUM
  165. #define BSS_P2P_NUM KAL_P2P_NUM
  166. #if (KAL_BSS_NUM > HW_BSSID_NUM) || (KAL_P2P_NUM > KAL_BSS_NUM)
  167. #error Exceed HW capability (KAL_BSS_NUM or KAL_P2P_NUM)!!
  168. #endif
  169. /* NOTE(Kevin): change define for george */
  170. /* #define MAX_LEN_TIM_PARTIAL_BMP (((MAX_ASSOC_ID + 1) + 7) / 8) */ /* Required bits = (MAX_ASSOC_ID + 1) */
  171. #define MAX_LEN_TIM_PARTIAL_BMP ((CFG_STA_REC_NUM + 7) / 8)
  172. /* reserve length greater than maximum size of STA_REC */ /* obsoleted: Assume we only use AID:1~15 */
  173. /* CTRL FLAGS for Probe Response */
  174. #define BSS_PROBE_RESP_USE_P2P_DEV_ADDR BIT(0)
  175. #define BSS_PROBE_RESP_INCLUDE_P2P_IE BIT(1)
  176. /*******************************************************************************
  177. * D A T A T Y P E S
  178. ********************************************************************************
  179. */
  180. /*******************************************************************************
  181. * P U B L I C D A T A
  182. ********************************************************************************
  183. */
  184. /*******************************************************************************
  185. * P R I V A T E D A T A
  186. ********************************************************************************
  187. */
  188. /*******************************************************************************
  189. * M A C R O S
  190. ********************************************************************************
  191. */
  192. #define IS_BSS_INDEX_VALID(_ucBssIndex) ((_ucBssIndex) <= P2P_DEV_BSS_INDEX)
  193. #define GET_BSS_INFO_BY_INDEX(_prAdapter, _ucBssIndex) \
  194. ((_prAdapter)->aprBssInfo[(_ucBssIndex)])
  195. #define bssAssignAssocID(_prStaRec) ((_prStaRec)->ucIndex + 1)
  196. /*******************************************************************************
  197. * F U N C T I O N D E C L A R A T I O N S
  198. ********************************************************************************
  199. */
  200. /*----------------------------------------------------------------------------*/
  201. /* Routines for all Operation Modes */
  202. /*----------------------------------------------------------------------------*/
  203. P_STA_RECORD_T
  204. bssCreateStaRecFromBssDesc(IN P_ADAPTER_T prAdapter,
  205. IN ENUM_STA_TYPE_T eStaType, IN UINT_8 uBssIndex, IN P_BSS_DESC_T prBssDesc);
  206. VOID bssComposeNullFrame(IN P_ADAPTER_T prAdapter, IN PUINT_8 pucBuffer, IN P_STA_RECORD_T prStaRec);
  207. VOID
  208. bssComposeQoSNullFrame(IN P_ADAPTER_T prAdapter,
  209. IN PUINT_8 pucBuffer, IN P_STA_RECORD_T prStaRec, IN UINT_8 ucUP, IN BOOLEAN fgSetEOSP);
  210. WLAN_STATUS
  211. bssSendNullFrame(IN P_ADAPTER_T prAdapter, IN P_STA_RECORD_T prStaRec, IN PFN_TX_DONE_HANDLER pfTxDoneHandler);
  212. WLAN_STATUS
  213. bssSendQoSNullFrame(IN P_ADAPTER_T prAdapter,
  214. IN P_STA_RECORD_T prStaRec, IN UINT_8 ucUP, IN PFN_TX_DONE_HANDLER pfTxDoneHandler);
  215. VOID bssDumpBssInfo(IN P_ADAPTER_T prAdapter, IN UINT_8 ucBssIndex);
  216. VOID bssDetermineApBssInfoPhyTypeSet(IN P_ADAPTER_T prAdapter, IN BOOLEAN fgIsPureAp, OUT P_BSS_INFO_T prBssInfo);
  217. /*----------------------------------------------------------------------------*/
  218. /* Routines for both IBSS(AdHoc) and BSS(AP) */
  219. /*----------------------------------------------------------------------------*/
  220. VOID bssGenerateExtSuppRate_IE(IN P_ADAPTER_T prAdapter, IN P_MSDU_INFO_T prMsduInfo);
  221. VOID
  222. bssBuildBeaconProbeRespFrameCommonIEs(IN P_MSDU_INFO_T prMsduInfo, IN P_BSS_INFO_T prBssInfo, IN PUINT_8 pucDestAddr);
  223. VOID
  224. bssComposeBeaconProbeRespFrameHeaderAndFF(IN PUINT_8 pucBuffer,
  225. IN PUINT_8 pucDestAddr,
  226. IN PUINT_8 pucOwnMACAddress,
  227. IN PUINT_8 pucBSSID, IN UINT_16 u2BeaconInterval, IN UINT_16 u2CapInfo);
  228. WLAN_STATUS
  229. bssSendBeaconProbeResponse(IN P_ADAPTER_T prAdapter,
  230. IN UINT_8 uBssIndex, IN PUINT_8 pucDestAddr, IN UINT_32 u4ControlFlags);
  231. WLAN_STATUS bssProcessProbeRequest(IN P_ADAPTER_T prAdapter, IN P_SW_RFB_T prSwRfb);
  232. VOID bssInitializeClientList(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo);
  233. VOID bssAddClient(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN P_STA_RECORD_T prStaRec);
  234. BOOLEAN bssRemoveClient(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN P_STA_RECORD_T prStaRec);
  235. P_STA_RECORD_T bssRemoveClientByMac(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN PUINT_8 pucMac);
  236. P_STA_RECORD_T bssRemoveHeadClient(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo);
  237. UINT_32 bssGetClientCount(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo);
  238. VOID bssDumpClientList(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo);
  239. VOID bssCheckClientList(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo);
  240. /*----------------------------------------------------------------------------*/
  241. /* Routines for IBSS(AdHoc) only */
  242. /*----------------------------------------------------------------------------*/
  243. VOID
  244. ibssProcessMatchedBeacon(IN P_ADAPTER_T prAdapter,
  245. IN P_BSS_INFO_T prBssInfo, IN P_BSS_DESC_T prBssDesc, IN UINT_8 ucRCPI);
  246. WLAN_STATUS ibssCheckCapabilityForAdHocMode(IN P_ADAPTER_T prAdapter, IN P_BSS_DESC_T prBssDesc);
  247. VOID ibssInitForAdHoc(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo);
  248. WLAN_STATUS bssUpdateBeaconContent(IN P_ADAPTER_T prAdapter, IN UINT_8 uBssIndex);
  249. /*----------------------------------------------------------------------------*/
  250. /* Routines for BSS(AP) only */
  251. /*----------------------------------------------------------------------------*/
  252. VOID bssInitForAP(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN BOOLEAN fgIsRateUpdate);
  253. VOID bssUpdateDTIMCount(IN P_ADAPTER_T prAdapter, IN UINT_8 uBssIndex);
  254. VOID bssSetTIMBitmap(IN P_ADAPTER_T prAdapter, IN P_BSS_INFO_T prBssInfo, IN UINT_16 u2AssocId);
  255. /*link function to p2p module for txBcnIETable*/
  256. /* WMM-2.2.2 WMM ACI to AC coding */
  257. typedef enum _ENUM_ACI_T {
  258. ACI_BE = 0,
  259. ACI_BK = 1,
  260. ACI_VI = 2,
  261. ACI_VO = 3,
  262. ACI_NUM
  263. } ENUM_ACI_T, *P_ENUM_ACI_T;
  264. typedef enum _ENUM_AC_PRIORITY_T {
  265. AC_BK_PRIORITY = 0,
  266. AC_BE_PRIORITY,
  267. AC_VI_PRIORITY,
  268. AC_VO_PRIORITY
  269. } ENUM_AC_PRIORITY_T, *P_ENUM_AC_PRIORITY_T;
  270. #endif /* _BSS_H */