bow.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. /*
  2. ** Id: //Department/DaVinci/BRANCHES/MT6620_WIFI_DRIVER_V2_3/include/nic/bow.h#1
  3. */
  4. /*
  5. ** Log: bow.h
  6. **
  7. ** 09 17 2012 cm.chang
  8. ** [BORA00002149] [MT6630 Wi-Fi] Initial software development
  9. ** Duplicate source from MT6620 v2.3 driver branch
  10. ** (Davinci label: MT6620_WIFI_Driver_V2_3_120913_1942_As_MT6630_Base)
  11. *
  12. * 01 16 2012 chinghwa.yu
  13. * [WCXRP00000065] Update BoW design and settings
  14. * Support BOW for 5GHz band.
  15. *
  16. * 05 25 2011 terry.wu
  17. * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment
  18. * Add BoW Cancel Scan Request and Turn On deactive network function.
  19. *
  20. * 05 22 2011 terry.wu
  21. * [WCXRP00000735] [MT6620 Wi-Fi][BoW][FW/Driver] Protect BoW connection establishment
  22. * Submit missing BoW header files.
  23. *
  24. * 03 27 2011 chinghwa.yu
  25. * [WCXRP00000065] Update BoW design and settings
  26. * Support multiple physical link.
  27. *
  28. * 03 06 2011 chinghwa.yu
  29. * [WCXRP00000065] Update BoW design and settings
  30. * Sync BOW Driver to latest person development branch version..
  31. *
  32. * 02 10 2011 chinghwa.yu
  33. * [WCXRP00000065] Update BoW design and settings
  34. * Fix kernel API change issue.
  35. * Before ALPS 2.2 (2.2 included), kfifo_alloc() is
  36. * struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask, spinlock_t *lock);
  37. * After ALPS 2.3, kfifo_alloc() is changed to
  38. * int kfifo_alloc(struct kfifo *fifo, unsigned int size, gfp_t gfp_mask);
  39. *
  40. * 02 10 2011 chinghwa.yu
  41. * [WCXRP00000065] Update BoW design and settings
  42. * Update BOW structure.
  43. *
  44. * 02 09 2011 cp.wu
  45. * [WCXRP00000430] [MT6620 Wi-Fi][Firmware][Driver] Create V1.2 branch for MT6620E1 and MT6620E3
  46. * create V1.2 driver branch based on label MT6620_WIFI_DRIVER_V1_2_110209_1031
  47. * with BOW and P2P enabled as default
  48. *
  49. * 02 08 2011 chinghwa.yu
  50. * [WCXRP00000065] Update BoW design and settings
  51. * Replace kfifo_get and kfifo_put with kfifo_out and kfifo_in.
  52. * Update BOW get MAC status, remove returning event for AIS network type.
  53. *
  54. * 01 11 2011 chinghwa.yu
  55. * [WCXRP00000065] Update BoW design and settings
  56. * Add Activity Report definition.
  57. *
  58. * 10 18 2010 chinghwa.yu
  59. * [WCXRP00000110] [MT6620 Wi-Fi] [Driver] Fix BoW Connected event size
  60. * Fix wrong BoW event size.
  61. *
  62. * 07 15 2010 cp.wu
  63. *
  64. * sync. bluetooth-over-Wi-Fi interface to driver interface document v0.2.6.
  65. *
  66. * 07 08 2010 cp.wu
  67. *
  68. * [WPD00003833] [MT6620 and MT5931] Driver migration - move to new repository.
  69. *
  70. * 06 06 2010 kevin.huang
  71. * [WPD00003832][MT6620 5931] Create driver base
  72. * [MT6620 5931] Create driver base
  73. *
  74. * 05 13 2010 cp.wu
  75. * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
  76. * 1) all BT physical handles shares the same RSSI/Link Quality.
  77. * 2) simplify BT command composing
  78. *
  79. * 04 28 2010 cp.wu
  80. * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
  81. * change prefix for data structure used to communicate with 802.11 PAL
  82. * to avoid ambiguous naming with firmware interface
  83. *
  84. * 04 27 2010 cp.wu
  85. * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
  86. * basic implementation for EVENT_BT_OVER_WIFI
  87. *
  88. * 04 13 2010 cp.wu
  89. * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
  90. * add framework for BT-over-Wi-Fi support.
  91. * * * * * * * 1) prPendingCmdInfo is replaced by queue for multiple handler capability
  92. * * * * * * * 2) command sequence number is now increased atomically
  93. * * * * * * * 3) private data could be hold and taken use for other purpose
  94. *
  95. * 04 09 2010 cp.wu
  96. * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
  97. * sync. with design document for interface change.
  98. *
  99. * 04 02 2010 cp.wu
  100. * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
  101. * Wi-Fi driver no longer needs to implement 802.11 PAL, thus replaced by wrapping command/event definitions
  102. *
  103. * 03 16 2010 cp.wu
  104. * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
  105. * correct typo.
  106. *
  107. * 03 16 2010 cp.wu
  108. * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
  109. * update for all command/event needed to be supported by 802.11 PAL.
  110. *
  111. * 03 16 2010 cp.wu
  112. * [WPD00003823][MT6620 Wi-Fi] Add Bluetooth-over-Wi-Fi support
  113. * build up basic data structure and definitions to support BT-over-WiFi
  114. *
  115. */
  116. #ifndef _BOW_H_
  117. #define _BOW_H_
  118. /*******************************************************************************
  119. * C O M P I L E R F L A G S
  120. ********************************************************************************
  121. */
  122. /*******************************************************************************
  123. * E X T E R N A L R E F E R E N C E S
  124. ********************************************************************************
  125. */
  126. /*******************************************************************************
  127. * C O N S T A N T S
  128. ********************************************************************************
  129. */
  130. #define BOWDEVNAME "bow0"
  131. #define MAX_BOW_NUMBER_OF_CHANNEL_2G4 14
  132. #define MAX_BOW_NUMBER_OF_CHANNEL_5G 4
  133. /* (MAX_BOW_NUMBER_OF_CHANNEL_2G4 + MAX_BOW_NUMBER_OF_CHANNEL_5G) */
  134. #define MAX_BOW_NUMBER_OF_CHANNEL 18
  135. #define MAX_ACTIVITY_REPORT 2
  136. #define MAX_ACTIVITY_REPROT_TIME 660
  137. #define ACTIVITY_REPORT_STATUS_SUCCESS 0
  138. #define ACTIVITY_REPORT_STATUS_FAILURE 1
  139. #define ACTIVITY_REPORT_STATUS_TIME_INVALID 2
  140. #define ACTIVITY_REPORT_STATUS_OTHERS 3
  141. #define ACTIVITY_REPORT_SCHEDULE_UNKNOWN 0 /* Does not know the schedule of the interference */
  142. #define ACTIVITY_REPORT_SCHEDULE_KNOWN 1
  143. /*******************************************************************************
  144. * M A C R O S
  145. ********************************************************************************
  146. */
  147. /*******************************************************************************
  148. * D A T A T Y P E S
  149. ********************************************************************************
  150. */
  151. typedef struct _BT_OVER_WIFI_COMMAND_HEADER_T {
  152. UINT_8 ucCommandId;
  153. UINT_8 ucSeqNumber;
  154. UINT_16 u2PayloadLength;
  155. } AMPC_COMMAND_HEADER_T, *P_AMPC_COMMAND_HEADER_T;
  156. typedef struct _BT_OVER_WIFI_COMMAND {
  157. AMPC_COMMAND_HEADER_T rHeader;
  158. UINT_8 aucPayload[0];
  159. } AMPC_COMMAND, *P_AMPC_COMMAND;
  160. typedef struct _BT_OVER_WIFI_EVENT_HEADER_T {
  161. UINT_8 ucEventId;
  162. UINT_8 ucSeqNumber;
  163. UINT_16 u2PayloadLength;
  164. } AMPC_EVENT_HEADER_T, *P_AMPC_EVENT_HEADER_T;
  165. typedef struct _BT_OVER_WIFI_EVENT {
  166. AMPC_EVENT_HEADER_T rHeader;
  167. UINT_8 aucPayload[0];
  168. } AMPC_EVENT, *P_AMPC_EVENT;
  169. typedef struct _CHANNEL_DESC_T {
  170. UINT_8 ucChannelBand;
  171. UINT_8 ucChannelNum;
  172. } CHANNEL_DESC, P_CHANNEL_DESC;
  173. /* Command Structures */
  174. typedef struct _BOW_SETUP_CONNECTION {
  175. /* Fixed to 2.4G */
  176. UINT_8 ucChannelNum;
  177. UINT_8 ucReserved1;
  178. UINT_8 aucPeerAddress[6];
  179. UINT_16 u2BeaconInterval;
  180. UINT_8 ucTimeoutDiscovery;
  181. UINT_8 ucTimeoutInactivity;
  182. UINT_8 ucRole;
  183. UINT_8 ucPAL_Capabilities;
  184. INT_8 cMaxTxPower;
  185. UINT_8 ucReserved2;
  186. /* Pending, for future BOW 5G supporting. */
  187. /* UINT_8 aucPeerAddress[6];
  188. UINT_16 u2BeaconInterval;
  189. UINT_8 ucTimeoutDiscovery;
  190. UINT_8 ucTimeoutInactivity;
  191. UINT_8 ucRole;
  192. UINT_8 ucPAL_Capabilities;
  193. INT_8 cMaxTxPower;
  194. UINT_8 ucChannelListNum;
  195. CHANNEL_DESC arChannelList[1];
  196. */
  197. } BOW_SETUP_CONNECTION, *P_BOW_SETUP_CONNECTION;
  198. typedef struct _BOW_DESTROY_CONNECTION {
  199. UINT_8 aucPeerAddress[6];
  200. UINT_8 aucReserved[2];
  201. } BOW_DESTROY_CONNECTION, *P_BOW_DESTROY_CONNECTION;
  202. typedef struct _BOW_SET_PTK {
  203. UINT_8 aucPeerAddress[6];
  204. UINT_8 aucReserved[2];
  205. UINT_8 aucTemporalKey[16];
  206. } BOW_SET_PTK, *P_BOW_SET_PTK;
  207. typedef struct _BOW_READ_RSSI {
  208. UINT_8 aucPeerAddress[6];
  209. UINT_8 aucReserved[2];
  210. } BOW_READ_RSSI, *P_BOW_READ_RSSI;
  211. typedef struct _BOW_READ_LINK_QUALITY {
  212. UINT_8 aucPeerAddress[6];
  213. UINT_8 aucReserved[2];
  214. } BOW_READ_LINK_QUALITY, *P_BOW_READ_LINK_QUALITY;
  215. typedef struct _BOW_SHORT_RANGE_MODE {
  216. UINT_8 aucPeerAddress[6];
  217. INT_8 cTxPower;
  218. UINT_8 ucReserved;
  219. } BOW_SHORT_RANGE_MODE, *P_BOW_SHORT_RANGE_MODE;
  220. /* Event Structures */
  221. typedef struct _BOW_COMMAND_STATUS {
  222. UINT_8 ucStatus;
  223. UINT_8 ucReserved[3];
  224. } BOW_COMMAND_STATUS, *P_BOW_COMMAND_STATUS;
  225. typedef struct _BOW_MAC_STATUS {
  226. UINT_8 aucMacAddr[6];
  227. UINT_8 ucAvailability;
  228. UINT_8 ucNumOfChannel;
  229. CHANNEL_DESC arChannelList[MAX_BOW_NUMBER_OF_CHANNEL];
  230. } BOW_MAC_STATUS, *P_BOW_MAC_STATUS;
  231. typedef struct _BOW_LINK_CONNECTED {
  232. CHANNEL_DESC rChannel;
  233. UINT_8 aucReserved;
  234. UINT_8 aucPeerAddress[6];
  235. } BOW_LINK_CONNECTED, *P_BOW_LINK_CONNECTED;
  236. typedef struct _BOW_LINK_DISCONNECTED {
  237. UINT_8 ucReason;
  238. UINT_8 aucReserved;
  239. UINT_8 aucPeerAddress[6];
  240. } BOW_LINK_DISCONNECTED, *P_BOW_LINK_DISCONNECTED;
  241. typedef struct _BOW_RSSI {
  242. INT_8 cRssi;
  243. UINT_8 aucReserved[3];
  244. } BOW_RSSI, *P_BOW_RSSI;
  245. typedef struct _BOW_LINK_QUALITY {
  246. UINT_8 ucLinkQuality;
  247. UINT_8 aucReserved[3];
  248. } BOW_LINK_QUALITY, *P_BOW_LINK_QUALITY;
  249. typedef enum _ENUM_BOW_CMD_ID_T {
  250. BOW_CMD_ID_GET_MAC_STATUS = 1,
  251. BOW_CMD_ID_SETUP_CONNECTION,
  252. BOW_CMD_ID_DESTROY_CONNECTION,
  253. BOW_CMD_ID_SET_PTK,
  254. BOW_CMD_ID_READ_RSSI,
  255. BOW_CMD_ID_READ_LINK_QUALITY,
  256. BOW_CMD_ID_SHORT_RANGE_MODE,
  257. BOW_CMD_ID_GET_CHANNEL_LIST,
  258. } ENUM_BOW_CMD_ID_T, *P_ENUM_BOW_CMD_ID_T;
  259. typedef enum _ENUM_BOW_EVENT_ID_T {
  260. BOW_EVENT_ID_COMMAND_STATUS = 1,
  261. BOW_EVENT_ID_MAC_STATUS,
  262. BOW_EVENT_ID_LINK_CONNECTED,
  263. BOW_EVENT_ID_LINK_DISCONNECTED,
  264. BOW_EVENT_ID_RSSI,
  265. BOW_EVENT_ID_LINK_QUALITY,
  266. BOW_EVENT_ID_CHANNEL_LIST,
  267. BOW_EVENT_ID_CHANNEL_SELECTED,
  268. } ENUM_BOW_EVENT_ID_T, *P_ENUM_BOW_EVENT_ID_T;
  269. typedef enum _ENUM_BOW_DEVICE_STATE {
  270. BOW_DEVICE_STATE_DISCONNECTED = 0,
  271. BOW_DEVICE_STATE_DISCONNECTING,
  272. BOW_DEVICE_STATE_ACQUIRING_CHANNEL,
  273. BOW_DEVICE_STATE_STARTING,
  274. BOW_DEVICE_STATE_SCANNING,
  275. BOW_DEVICE_STATE_CONNECTING,
  276. BOW_DEVICE_STATE_CONNECTED,
  277. BOW_DEVICE_STATE_NUM
  278. } ENUM_BOW_DEVICE_STATE, *P_ENUM_BOW_DEVICE_STATE;
  279. /*******************************************************************************
  280. * P U B L I C D A T A
  281. ********************************************************************************
  282. */
  283. /*******************************************************************************
  284. * P R I V A T E D A T A
  285. ********************************************************************************
  286. */
  287. /*******************************************************************************
  288. * F U N C T I O N D E C L A R A T I O N S
  289. ********************************************************************************
  290. */
  291. #endif /*_BOW_H */