bss.h 9.7 KB

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