bow.h 10 KB

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