rtl8723a_bt-coexist.h 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. *
  19. ******************************************************************************/
  20. #ifndef __RTL8723A_BT_COEXIST_H__
  21. #define __RTL8723A_BT_COEXIST_H__
  22. #include <drv_types.h>
  23. #include "../hal/OUTSRC/odm_precomp.h"
  24. #define __BT_C__ 1
  25. #define __BT_HANDLEPACKET_C__ 1
  26. #define __BT_HCI_C__ 1
  27. #define __HALBTC87231ANT_C__ 1
  28. #define __HALBTC87232ANT_C__ 1
  29. #define __HALBTC8723_C__ 1
  30. #define __HALBTCCSR1ANT_C__ 1
  31. #define __HALBTCCSR2ANT_C__ 1
  32. #define __HALBTCOEXIST_C__ 1
  33. #define __HALBT_C__ 1
  34. #ifdef __BT_C__ // COMMON/BT.h
  35. // ===== Below this line is sync from SD7 driver COMMON/BT.h =====
  36. #define BT_TMP_BUF_SIZE 100
  37. void BT_SignalCompensation(PADAPTER padapter, u8 *rssi_wifi, u8 *rssi_bt);
  38. void BT_WifiScanNotify(PADAPTER padapter, u8 scanType);
  39. void BT_WifiAssociateNotify(PADAPTER padapter, u8 action);
  40. void BT_WifiMediaStatusNotify(PADAPTER padapter, RT_MEDIA_STATUS mstatus);
  41. void BT_SpecialPacketNotify(PADAPTER padapter);
  42. void BT_HaltProcess(PADAPTER padapter);
  43. void BT_LpsLeave(PADAPTER padapter);
  44. #define BT_HsConnectionEstablished(Adapter) _FALSE
  45. // ===== End of sync from SD7 driver COMMON/BT.h =====
  46. #endif // __BT_C__
  47. #ifdef __BT_HCI_C__ // COMMON/bt_hci.h
  48. // HEADER/SecurityType.h
  49. #define TKIP_ENC_KEY_POS 32 //(KEK_LEN+KEK_LEN)
  50. #define MAXRSNIELEN 256
  51. // HEADER/QoSType.h
  52. #if 0
  53. //
  54. // BSS QOS data.
  55. // Ref: BssDscr in 8185 code. [def. in BssDscr.h]
  56. //
  57. typedef struct _BSS_QOS
  58. {
  59. // Part 0. Ref. 8185 QoS code (From Emily)
  60. QOS_MODE bdQoSMode;
  61. u8 bdWMMIEBuf[MAX_WMMELE_LENGTH];
  62. OCTET_STRING bdWMMIE;
  63. QOS_ELE_SUBTYPE EleSubType;
  64. // Part 2. EDCA Parameter (perAC)
  65. u8 *pWMMInfoEle;
  66. u8 *pWMMParamEle;
  67. // QBSS Load.
  68. u8 QBssLoad[QBSS_LOAD_SIZE];
  69. u8 bQBssLoadValid;
  70. } BSS_QOS, *PBSS_QOS;
  71. #endif
  72. // COMMON/Protocol802_11.h
  73. //----------------------------------------------------------------------------
  74. // 802.11 Management frame Status Code field
  75. //----------------------------------------------------------------------------
  76. typedef struct _OCTET_STRING{
  77. u8 *Octet;
  78. u16 Length;
  79. } OCTET_STRING, *POCTET_STRING;
  80. //======================================================================================
  81. // AES_CCMP specific
  82. //======================================================================================
  83. enum
  84. {
  85. AESCCMP_BLK_SIZE = 16, // # octets in an AES block
  86. AESCCMP_MAX_PACKET = 4*512, // largest packet size
  87. AESCCMP_N_RESERVED = 0, // reserved nonce octet value
  88. AESCCMP_A_DATA = 0x40, // the Adata bit in the flags
  89. AESCCMP_M_SHIFT = 3, // how much to shift the 3-bit M field
  90. AESCCMP_L_SHIFT = 0, // how much to shift the 3-bit L field
  91. AESCCMP_L_SIZE = 2, // size of the l(m) length field (in octets)
  92. AESCCMP_OFFSET_SC = 22,
  93. AESCCMP_OFFSET_DURATION = 4,
  94. AESCCMP_OFFSET_A2 = 10,
  95. AESCCMP_OFFSET_A4 = 24,
  96. AESCCMP_QC_TID_MASK = 0x0f,
  97. AESCCMP_BLK_SIZE_TOTAL = 16*16, // Added by Annie for CKIP AES MIC BSOD, 2006-08-17.
  98. // 16*8 < 4*60 Resove to 16*16
  99. };
  100. //
  101. // Key Length
  102. //
  103. #define PMK_LEN 32
  104. #define PTK_LEN_TKIP 64
  105. #define GTK_LEN 32
  106. #define KEY_NONCE_LEN 32
  107. // COMMON/Dot11d.h
  108. typedef struct _CHNL_TXPOWER_TRIPLE
  109. {
  110. u8 FirstChnl;
  111. u8 NumChnls;
  112. s8 MaxTxPowerInDbm;
  113. } CHNL_TXPOWER_TRIPLE, *PCHNL_TXPOWER_TRIPLE;
  114. // ===== Below this line is sync from SD7 driver COMMON/bt_hci.h =====
  115. #define BT_THREAD 0
  116. #if(BT_THREAD == 1)
  117. #define SENDTXMEHTOD 2
  118. #else
  119. #define SENDTXMEHTOD 1 // 0=workitem, 1= SendDirectily, 2=thread
  120. #endif
  121. //=============================================
  122. // The following is for BT 3.0 + HS HCI COMMAND ERRORS CODES
  123. //=============================================
  124. #define Max80211PALPDUSize 1492
  125. #define Max80211AMPASSOCLen 672
  126. #define MinGUserPrio 4
  127. #define MaxGUserPrio 7
  128. #define BEUserPrio0 0
  129. #define BEUserPrio1 3
  130. #define Max80211BeaconPeriod 2000
  131. #define ShortRangeModePowerMax 4
  132. #define BT_Default_Chnl 10
  133. #define ACLDataHeaderLen 4
  134. #define BTTotalDataBlockNum 0x100
  135. #define BTLocalBufNum 0x200
  136. #define BTMaxDataBlockLen 0x800
  137. #define BTTOTALBANDWIDTH 0x7530
  138. #define BTMAXBANDGUBANDWIDTH 0x4e20
  139. #define TmpLocalBufSize 0x100
  140. #define BTSynDataPacketLength 0xff
  141. //=============================================
  142. #define BTMaxAuthCount 5
  143. #define BTMaxAsocCount 5
  144. #define MAX_LOGICAL_LINK_NUM 2 //temporarily define
  145. #define MAX_BT_ASOC_ENTRY_NUM 2 //temporarily define
  146. #define INVALID_PL_HANDLE 0xff
  147. #define INVALID_ENTRY_NUM 0xff
  148. //=============================================
  149. #define CAM_BT_START_INDEX (HALF_CAM_ENTRY - 4) // MAX_BT_ASOC_ENTRY_NUM : 4 !!!
  150. #define BT_HWCAM_STAR CAM_BT_START_INDEX // We used HALF_CAM_ENTRY ~ HALF_CAM_ENTRY -MAX_BT_ASOC_ENTRY_NUM
  151. typedef enum _HCI_STATUS
  152. {
  153. HCI_STATUS_SUCCESS =0x00, //Success
  154. HCI_STATUS_UNKNOW_HCI_CMD =0x01, //Unknown HCI Command
  155. HCI_STATUS_UNKNOW_CONNECT_ID =0X02, //Unknown Connection Identifier
  156. HCI_STATUS_HW_FAIL =0X03, //Hardware Failure
  157. HCI_STATUS_PAGE_TIMEOUT =0X04, //Page Timeout
  158. HCI_STATUS_AUTH_FAIL =0X05, //Authentication Failure
  159. HCI_STATUS_PIN_OR_KEY_MISSING =0X06, //PIN or Key Missing
  160. HCI_STATUS_MEM_CAP_EXCEED =0X07, //Memory Capacity Exceeded
  161. HCI_STATUS_CONNECT_TIMEOUT =0X08, //Connection Timeout
  162. HCI_STATUS_CONNECT_LIMIT =0X09, //Connection Limit Exceeded
  163. HCI_STATUS_SYN_CONNECT_LIMIT =0X0a, //Synchronous Connection Limit To A Device Exceeded
  164. HCI_STATUS_ACL_CONNECT_EXISTS =0X0b, //ACL Connection Already Exists
  165. HCI_STATUS_CMD_DISALLOW =0X0c, //Command Disallowed
  166. HCI_STATUS_CONNECT_RJT_LIMIT_RESOURCE =0X0d, //Connection Rejected due to Limited Resources
  167. HCI_STATUS_CONNECT_RJT_SEC_REASON =0X0e, //Connection Rejected Due To Security Reasons
  168. HCI_STATUS_CONNECT_RJT_UNACCEPT_BD_ADDR =0X0f, //Connection Rejected due to Unacceptable BD_ADDR
  169. HCI_STATUS_CONNECT_ACCEPT_TIMEOUT =0X10, //Connection Accept Timeout Exceeded
  170. HCI_STATUS_UNSUPPORT_FEATURE_PARA_VALUE =0X11, //Unsupported Feature or Parameter Value
  171. HCI_STATUS_INVALID_HCI_CMD_PARA_VALUE =0X12, //Invalid HCI Command Parameters
  172. HCI_STATUS_REMOTE_USER_TERMINATE_CONNECT =0X13, //Remote User Terminated Connection
  173. HCI_STATUS_REMOTE_DEV_TERMINATE_LOW_RESOURCE =0X14, //Remote Device Terminated Connection due to Low Resources
  174. HCI_STATUS_REMOTE_DEV_TERMINATE_CONNECT_POWER_OFF =0X15, //Remote Device Terminated Connection due to Power Off
  175. HCI_STATUS_CONNECT_TERMINATE_LOCAL_HOST =0X16, //Connection Terminated By Local Host
  176. HCI_STATUS_REPEATE_ATTEMPT =0X17, //Repeated Attempts
  177. HCI_STATUS_PAIR_NOT_ALLOW =0X18, //Pairing Not Allowed
  178. HCI_STATUS_UNKNOW_LMP_PDU =0X19, //Unknown LMP PDU
  179. HCI_STATUS_UNSUPPORT_REMOTE_LMP_FEATURE =0X1a, //Unsupported Remote Feature / Unsupported LMP Feature
  180. HCI_STATUS_SOC_OFFSET_REJECT =0X1b, //SCO Offset Rejected
  181. HCI_STATUS_SOC_INTERVAL_REJECT =0X1c, //SCO Interval Rejected
  182. HCI_STATUS_SOC_AIR_MODE_REJECT =0X1d,//SCO Air Mode Rejected
  183. HCI_STATUS_INVALID_LMP_PARA =0X1e, //Invalid LMP Parameters
  184. HCI_STATUS_UNSPECIFIC_ERROR =0X1f, //Unspecified Error
  185. HCI_STATUS_UNSUPPORT_LMP_PARA_VALUE =0X20, //Unsupported LMP Parameter Value
  186. HCI_STATUS_ROLE_CHANGE_NOT_ALLOW =0X21, //Role Change Not Allowed
  187. HCI_STATUS_LMP_RESPONSE_TIMEOUT =0X22, //LMP Response Timeout
  188. HCI_STATUS_LMP_ERROR_TRANSACTION_COLLISION =0X23, //LMP Error Transaction Collision
  189. HCI_STATUS_LMP_PDU_NOT_ALLOW =0X24, //LMP PDU Not Allowed
  190. HCI_STATUS_ENCRYPTION_MODE_NOT_ALLOW =0X25, //Encryption Mode Not Acceptable
  191. HCI_STATUS_LINK_KEY_CAN_NOT_CHANGE =0X26, //Link Key Can Not be Changed
  192. HCI_STATUS_REQUEST_QOS_NOT_SUPPORT =0X27, //Requested QoS Not Supported
  193. HCI_STATUS_INSTANT_PASSED =0X28, //Instant Passed
  194. HCI_STATUS_PAIRING_UNIT_KEY_NOT_SUPPORT =0X29, //Pairing With Unit Key Not Supported
  195. HCI_STATUS_DIFFERENT_TRANSACTION_COLLISION =0X2a, //Different Transaction Collision
  196. HCI_STATUS_RESERVE_1 =0X2b, //Reserved
  197. HCI_STATUS_QOS_UNACCEPT_PARA =0X2c, //QoS Unacceptable Parameter
  198. HCI_STATUS_QOS_REJECT =0X2d, //QoS Rejected
  199. HCI_STATUS_CHNL_CLASSIFICATION_NOT_SUPPORT =0X2e, //Channel Classification Not Supported
  200. HCI_STATUS_INSUFFICIENT_SECURITY =0X2f, //Insufficient Security
  201. HCI_STATUS_PARA_OUT_OF_RANGE =0x30, //Parameter Out Of Mandatory Range
  202. HCI_STATUS_RESERVE_2 =0X31, //Reserved
  203. HCI_STATUS_ROLE_SWITCH_PENDING =0X32, //Role Switch Pending
  204. HCI_STATUS_RESERVE_3 =0X33, //Reserved
  205. HCI_STATUS_RESERVE_SOLT_VIOLATION =0X34, //Reserved Slot Violation
  206. HCI_STATUS_ROLE_SWITCH_FAIL =0X35, //Role Switch Failed
  207. HCI_STATUS_EXTEND_INQUIRY_RSP_TOO_LARGE =0X36, //Extended Inquiry Response Too Large
  208. HCI_STATUS_SEC_SIMPLE_PAIRING_NOT_SUPPORT =0X37, //Secure Simple Pairing Not Supported By Host.
  209. HCI_STATUS_HOST_BUSY_PAIRING =0X38, //Host Busy - Pairing
  210. HCI_STATUS_CONNECT_REJ_NOT_SUIT_CHNL_FOUND =0X39, //Connection Rejected due to No Suitable Channel Found
  211. HCI_STATUS_CONTROLLER_BUSY =0X3a //CONTROLLER BUSY
  212. } HCI_STATUS,*PHCI_STATUS;
  213. //=============================================
  214. // The following is for BT 3.0 + HS HCI COMMAND
  215. //=============================================
  216. //bit 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  217. // | OCF | OGF |
  218. //
  219. //OGF 0x01
  220. #define OGF_LINK_CONTROL_COMMANDS 0x01
  221. typedef enum _LINK_CONTROL_COMMANDS
  222. {
  223. HCI_INQUIRY =0x0001,
  224. HCI_INQUIRY_CANCEL =0x0002,
  225. HCI_PERIODIC_INQUIRY_MODE =0x0003,
  226. HCI_EXIT_PERIODIC_INQUIRY_MODE =0x0004,
  227. HCI_CREATE_CONNECTION =0x0005,
  228. HCI_DISCONNECT =0x0006,
  229. HCI_CREATE_CONNECTION_CANCEL =0x0008,
  230. HCI_ACCEPT_CONNECTIONREQUEST =0x0009,
  231. HCI_REJECT_CONNECTION_REQUEST =0x000a,
  232. HCI_LINK_KEY_REQUEST_REPLY =0x000b,
  233. HCI_LINK_KEY_REQUEST_NEGATIVE_REPLY =0x000c,
  234. HCI_PIN_CODE_REQUEST_REPLY =0x000d,
  235. HCI_PIN_CODE_REQUEST_NEGATIVE_REPLY =0x000e,
  236. HCI_CHANGE_CONNECTION_PACKET_TYPE =0x000f,
  237. HCI_AUTHENTICATION_REQUESTED =0x0011,
  238. HCI_SET_CONNECTION_ENCRYPTION =0x0013,
  239. HCI_CHANGE_CONNECTION_LINK_KEY =0x0015,
  240. HCI_MASTER_LINK_KEY =0x0017,
  241. HCI_REMOTE_NAME_REQUEST =0x0019,
  242. HCI_REMOTE_NAME_REQUEST_CANCEL =0x001a,
  243. HCI_READ_REMOTE_SUPPORTED_FEATURES =0x001b,
  244. HCI_READ_REMOTE_EXTENDED_FEATURES =0x001c,
  245. HCI_READ_REMOTE_VERSION_INFORMATION =0x001d,
  246. HCI_READ_CLOCK_OFFSET =0x001f,
  247. HCI_READ_LMP_HANDLE =0x0020,
  248. HCI_SETUP_SYNCHRONOUS_CONNECTION =0x0028,
  249. HCI_ACCEPT_SYNCHRONOUS_CONNECTION_REQUEST =0x0029,
  250. HCI_REJECT_SYNCHRONOUS_CONNECTION_REQUEST =0x002a,
  251. HCI_IO_CAPABILITY_REQUEST_REPLY =0x002b,
  252. HCI_USER_CONFIRMATION_REQUEST_REPLY =0x002c,
  253. HCI_USER_CONFIRMATION_REQUEST_NEGATIVE_REPLY =0x002d,
  254. HCI_USER_PASSKEY_REQUEST_REPLY =0x002e,
  255. HCI_USER_PASSKEY_REQUESTNEGATIVE_REPLY =0x002f,
  256. HCI_REMOTE_OOB_DATA_REQUEST_REPLY =0x0030,
  257. HCI_REMOTE_OOB_DATA_REQUEST_NEGATIVE_REPLY =0x0033,
  258. HCI_IO_CAPABILITY_REQUEST_NEGATIVE_REPLY =0x0034,
  259. HCI_CREATE_PHYSICAL_LINK =0x0035,
  260. HCI_ACCEPT_PHYSICAL_LINK =0x0036,
  261. HCI_DISCONNECT_PHYSICAL_LINK =0x0037,
  262. HCI_CREATE_LOGICAL_LINK =0x0038,
  263. HCI_ACCEPT_LOGICAL_LINK =0x0039,
  264. HCI_DISCONNECT_LOGICAL_LINK =0x003a,
  265. HCI_LOGICAL_LINK_CANCEL =0x003b,
  266. HCI_FLOW_SPEC_MODIFY =0x003c
  267. } LINK_CONTROL_COMMANDS,*PLINK_CONTROL_COMMANDS;
  268. //OGF 0x02
  269. #define OGF_HOLD_MODE_COMMAND 0x02
  270. typedef enum _HOLD_MODE_COMMAND
  271. {
  272. HCI_HOLD_MODE =0x0001,
  273. HCI_SNIFF_MODE =0x0002,
  274. HCI_EXIT_SNIFF_MODE =0x0003,
  275. HCI_PARK_STATE =0x0005,
  276. HCI_EXIT_PARK_STATE =0x0006,
  277. HCI_QOS_SETUP =0x0007,
  278. HCI_ROLE_DISCOVERY =0x0009,
  279. HCI_SWITCH_ROLE =0x000b,
  280. HCI_READ_LINK_POLICY_SETTINGS =0x000c,
  281. HCI_WRITE_LINK_POLICY_SETTINGS =0x000d,
  282. HCI_READ_DEFAULT_LINK_POLICY_SETTINGS =0x000e,
  283. HCI_WRITE_DEFAULT_LINK_POLICY_SETTINGS =0x000f,
  284. HCI_FLOW_SPECIFICATION =0x0010,
  285. HCI_SNIFF_SUBRATING =0x0011
  286. } HOLD_MODE_COMMAND,*PHOLD_MODE_COMMAND;
  287. //OGF 0x03
  288. #define OGF_SET_EVENT_MASK_COMMAND 0x03
  289. typedef enum _SET_EVENT_MASK_COMMAND
  290. {
  291. HCI_SET_EVENT_MASK =0x0001,
  292. HCI_RESET =0x0003,
  293. HCI_SET_EVENT_FILTER =0x0005,
  294. HCI_FLUSH =0x0008,
  295. HCI_READ_PIN_TYPE =0x0009,
  296. HCI_WRITE_PIN_TYPE =0x000a,
  297. HCI_CREATE_NEW_UNIT_KEY =0x000b,
  298. HCI_READ_STORED_LINK_KEY =0x000d,
  299. HCI_WRITE_STORED_LINK_KEY =0x0011,
  300. HCI_DELETE_STORED_LINK_KEY =0x0012,
  301. HCI_WRITE_LOCAL_NAME =0x0013,
  302. HCI_READ_LOCAL_NAME =0x0014,
  303. HCI_READ_CONNECTION_ACCEPT_TIMEOUT =0x0015,
  304. HCI_WRITE_CONNECTION_ACCEPT_TIMEOUT =0x0016,
  305. HCI_READ_PAGE_TIMEOUT =0x0017,
  306. HCI_WRITE_PAGE_TIMEOUT =0x0018,
  307. HCI_READ_SCAN_ENABLE =0x0019,
  308. HCI_WRITE_SCAN_ENABLE =0x001a,
  309. HCI_READ_PAGE_SCAN_ACTIVITY =0x001b,
  310. HCI_WRITE_PAGE_SCAN_ACTIVITY =0x001c,
  311. HCI_READ_INQUIRY_SCAN_ACTIVITY =0x001d,
  312. HCI_WRITE_INQUIRY_SCAN_ACTIVITY =0x001e,
  313. HCI_READ_AUTHENTICATION_ENABLE =0x001f,
  314. HCI_WRITE_AUTHENTICATION_ENABLE =0x0020,
  315. HCI_READ_CLASS_OF_DEVICE =0x0023,
  316. HCI_WRITE_CLASS_OF_DEVICE =0x0024,
  317. HCI_READ_VOICE_SETTING =0x0025,
  318. HCI_WRITE_VOICE_SETTING =0x0026,
  319. HCI_READ_AUTOMATIC_FLUSH_TIMEOUT =0x0027,
  320. HCI_WRITE_AUTOMATIC_FLUSH_TIMEOUT =0x0028,
  321. HCI_READ_NUM_BROADCAST_RETRANSMISSIONS =0x0029,
  322. HCI_WRITE_NUM_BROADCAST_RETRANSMISSIONS =0x002a,
  323. HCI_READ_HOLD_MODE_ACTIVITY =0x002b,
  324. HCI_WRITE_HOLD_MODE_ACTIVITY =0x002c,
  325. HCI_READ_SYNCHRONOUS_FLOW_CONTROL_ENABLE =0x002e,
  326. HCI_WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE =0x002f,
  327. HCI_SET_CONTROLLER_TO_HOST_FLOW_CONTROL =0x0031,
  328. HCI_HOST_BUFFER_SIZE =0x0033,
  329. HCI_HOST_NUMBER_OF_COMPLETED_PACKETS =0x0035,
  330. HCI_READ_LINK_SUPERVISION_TIMEOUT =0x0036,
  331. HCI_WRITE_LINK_SUPERVISION_TIMEOUT =0x0037,
  332. HCI_READ_NUMBER_OF_SUPPORTED_IAC =0x0038,
  333. HCI_READ_CURRENT_IAC_LAP =0x0039,
  334. HCI_WRITE_CURRENT_IAC_LAP =0x003a,
  335. HCI_READ_PAGE_SCAN_MODE =0x003d,
  336. HCI_WRITE_PAGE_SCAN_MODE =0x003e,
  337. HCI_SET_AFH_HOST_CHANNEL_CLASSIFICATION =0x003f,
  338. HCI_READ_INQUIRY_SCAN_TYPE =0x0042,
  339. HCI_WRITE_INQUIRY_SCAN_TYPE =0x0043,
  340. HCI_READ_INQUIRY_MODE =0x0044,
  341. HCI_WRITE_INQUIRY_MODE =0x0045,
  342. HCI_READ_PAGE_SCAN_TYPE =0x0046,
  343. HCI_WRITE_PAGE_SCAN_TYPE =0x0047,
  344. HCI_READ_AFH_CHANNEL_ASSESSMENT_MODE =0x0048,
  345. HCI_WRITE_AFH_CHANNEL_ASSESSMENT_MODE =0x0049,
  346. HCI_READ_EXTENDED_INQUIRY_RESPONSE =0x0051,
  347. HCI_WRITE_EXTENDED_INQUIRY_RESPONSE =0x0052,
  348. HCI_REFRESH_ENCRYPTION_KEY =0x0053,
  349. HCI_READ_SIMPLE_PAIRING_MODE =0x0055,
  350. HCI_WRITE_SIMPLE_PAIRING_MODE =0x0056,
  351. HCI_READ_LOCAL_OOB_DATA =0x0057,
  352. HCI_READ_INQUIRY_RESPONSE_TRANSMIT_POWER_LEVEL =0x0058,
  353. HCI_WRITE_INQUIRY_TRANSMIT_POWER_LEVEL =0x0059,
  354. HCI_READ_DEFAULT_ERRONEOUS_DATA_REPORTING =0x005a,
  355. HCI_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING =0x005b,
  356. HCI_ENHANCED_FLUSH =0x005f,
  357. HCI_SEND_KEYPRESS_NOTIFICATION =0x0060,
  358. HCI_READ_LOGICAL_LINK_ACCEPT_TIMEOUT =0x0061,
  359. HCI_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT =0x0062,
  360. HCI_SET_EVENT_MASK_PAGE_2 =0x0063,
  361. HCI_READ_LOCATION_DATA =0x0064,
  362. HCI_WRITE_LOCATION_DATA =0x0065,
  363. HCI_READ_FLOW_CONTROL_MODE =0x0066,
  364. HCI_WRITE_FLOW_CONTROL_MODE =0x0067,
  365. HCI_READ_ENHANCE_TRANSMIT_POWER_LEVEL =0x0068,
  366. HCI_READ_BEST_EFFORT_FLUSH_TIMEOUT =0x0069,
  367. HCI_WRITE_BEST_EFFORT_FLUSH_TIMEOUT =0x006a,
  368. HCI_SHORT_RANGE_MODE =0x006b
  369. }SET_EVENT_MASK_COMMAND,*PSET_EVENT_MASK_COMMAND;
  370. //OGF 0x04
  371. #define OGF_INFORMATIONAL_PARAMETERS 0x04
  372. typedef enum _INFORMATIONAL_PARAMETERS
  373. {
  374. HCI_READ_LOCAL_VERSION_INFORMATION =0x0001,
  375. HCI_READ_LOCAL_SUPPORTED_COMMANDS =0x0002,
  376. HCI_READ_LOCAL_SUPPORTED_FEATURES =0x0003,
  377. HCI_READ_LOCAL_EXTENDED_FEATURES =0x0004,
  378. HCI_READ_BUFFER_SIZE =0x0005,
  379. HCI_READ_BD_ADDR =0x0009,
  380. HCI_READ_DATA_BLOCK_SIZE =0x000a
  381. } INFORMATIONAL_PARAMETERS,*PINFORMATIONAL_PARAMETERS;
  382. //OGF 0x05
  383. #define OGF_STATUS_PARAMETERS 0x05
  384. typedef enum _STATUS_PARAMETERS
  385. {
  386. HCI_READ_FAILED_CONTACT_COUNTER =0x0001,
  387. HCI_RESET_FAILED_CONTACT_COUNTER =0x0002,
  388. HCI_READ_LINK_QUALITY =0x0003,
  389. HCI_READ_RSSI =0x0005,
  390. HCI_READ_AFH_CHANNEL_MAP =0x0006,
  391. HCI_READ_CLOCK =0x0007,
  392. HCI_READ_ENCRYPTION_KEY_SIZE =0x0008,
  393. HCI_READ_LOCAL_AMP_INFO =0x0009,
  394. HCI_READ_LOCAL_AMP_ASSOC =0x000a,
  395. HCI_WRITE_REMOTE_AMP_ASSOC =0x000b
  396. } STATUS_PARAMETERS,*PSTATUS_PARAMETERS;
  397. //OGF 0x06
  398. #define OGF_TESTING_COMMANDS 0x06
  399. typedef enum _TESTING_COMMANDS
  400. {
  401. HCI_READ_LOOPBACK_MODE =0x0001,
  402. HCI_WRITE_LOOPBACK_MODE =0x0002,
  403. HCI_ENABLE_DEVICE_UNDER_TEST_MODE =0x0003,
  404. HCI_WRITE_SIMPLE_PAIRING_DEBUG_MODE =0x0004,
  405. HCI_ENABLE_AMP_RECEIVER_REPORTS =0x0007,
  406. HCI_AMP_TEST_END =0x0008,
  407. HCI_AMP_TEST_COMMAND =0x0009
  408. } TESTING_COMMANDS,*PTESTING_COMMANDS;
  409. //OGF 0x3f
  410. #define OGF_EXTENSION 0X3f
  411. typedef enum _HCI_EXTENSION_COMMANDS
  412. {
  413. HCI_SET_ACL_LINK_DATA_FLOW_MODE =0x0010,
  414. HCI_SET_ACL_LINK_STATUS =0x0020,
  415. HCI_SET_SCO_LINK_STATUS =0x0030,
  416. HCI_SET_RSSI_VALUE =0x0040,
  417. HCI_SET_CURRENT_BLUETOOTH_STATUS =0x0041,
  418. //The following is for RTK8723
  419. HCI_EXTENSION_VERSION_NOTIFY =0x0100,
  420. HCI_LINK_STATUS_NOTIFY =0x0101,
  421. HCI_BT_OPERATION_NOTIFY =0x0102,
  422. HCI_ENABLE_WIFI_SCAN_NOTIFY =0x0103,
  423. //The following is for IVT
  424. HCI_WIFI_CURRENT_CHANNEL =0x0300,
  425. HCI_WIFI_CURRENT_BANDWIDTH =0x0301,
  426. HCI_WIFI_CONNECTION_STATUS =0x0302,
  427. } HCI_EXTENSION_COMMANDS,*PHCI_EXTENSION_COMMANDS;
  428. typedef enum _BT_SPEC
  429. {
  430. BT_SPEC_1_0_b =0x00,
  431. BT_SPEC_1_1 =0x01,
  432. BT_SPEC_1_2 =0x02,
  433. BT_SPEC_2_0_EDR =0x03,
  434. BT_SPEC_2_1_EDR =0x04,
  435. BT_SPEC_3_0_HS =0x05,
  436. BT_SPEC_4_0 =0x06
  437. } BT_SPEC,*PBT_SPEC;
  438. //=============================================
  439. // The following is for BT 3.0 + HS EVENTS
  440. //=============================================
  441. typedef enum _HCI_EVENT
  442. {
  443. HCI_EVENT_INQUIRY_COMPLETE =0x01,
  444. HCI_EVENT_INQUIRY_RESULT =0x02,
  445. HCI_EVENT_CONNECTION_COMPLETE =0x03,
  446. HCI_EVENT_CONNECTION_REQUEST =0x04,
  447. HCI_EVENT_DISCONNECTION_COMPLETE =0x05,
  448. HCI_EVENT_AUTHENTICATION_COMPLETE =0x06,
  449. HCI_EVENT_REMOTE_NAME_REQUEST_COMPLETE =0x07,
  450. HCI_EVENT_ENCRYPTION_CHANGE =0x08,
  451. HCI_EVENT_CHANGE_LINK_KEY_COMPLETE =0x09,
  452. HCI_EVENT_MASTER_LINK_KEY_COMPLETE =0x0a,
  453. HCI_EVENT_READ_REMOTE_SUPPORT_FEATURES_COMPLETE =0x0b,
  454. HCI_EVENT_READ_REMOTE_VER_INFO_COMPLETE =0x0c,
  455. HCI_EVENT_QOS_SETUP_COMPLETE =0x0d,
  456. HCI_EVENT_COMMAND_COMPLETE =0x0e,
  457. HCI_EVENT_COMMAND_STATUS =0x0f,
  458. HCI_EVENT_HARDWARE_ERROR =0x10,
  459. HCI_EVENT_FLUSH_OCCRUED =0x11,
  460. HCI_EVENT_ROLE_CHANGE =0x12,
  461. HCI_EVENT_NUMBER_OF_COMPLETE_PACKETS =0x13,
  462. HCI_EVENT_MODE_CHANGE =0x14,
  463. HCI_EVENT_RETURN_LINK_KEYS =0x15,
  464. HCI_EVENT_PIN_CODE_REQUEST =0x16,
  465. HCI_EVENT_LINK_KEY_REQUEST =0x17,
  466. HCI_EVENT_LINK_KEY_NOTIFICATION =0x18,
  467. HCI_EVENT_LOOPBACK_COMMAND =0x19,
  468. HCI_EVENT_DATA_BUFFER_OVERFLOW =0x1a,
  469. HCI_EVENT_MAX_SLOTS_CHANGE =0x1b,
  470. HCI_EVENT_READ_CLOCK_OFFSET_COMPLETE =0x1c,
  471. HCI_EVENT_CONNECT_PACKET_TYPE_CHANGE =0x1d,
  472. HCI_EVENT_QOS_VIOLATION =0x1e,
  473. HCI_EVENT_PAGE_SCAN_REPETITION_MODE_CHANGE =0x20,
  474. HCI_EVENT_FLOW_SEPC_COMPLETE =0x21,
  475. HCI_EVENT_INQUIRY_RESULT_WITH_RSSI =0x22,
  476. HCI_EVENT_READ_REMOTE_EXT_FEATURES_COMPLETE =0x23,
  477. HCI_EVENT_SYNC_CONNECT_COMPLETE =0x2c,
  478. HCI_EVENT_SYNC_CONNECT_CHANGE =0x2d,
  479. HCI_EVENT_SNIFFER_SUBRATING =0x2e,
  480. HCI_EVENT_EXTENTED_INQUIRY_RESULT =0x2f,
  481. HCI_EVENT_ENCRYPTION_KEY_REFLASH_COMPLETE =0x30,
  482. HCI_EVENT_IO_CAPIBILITY_COMPLETE =0x31,
  483. HCI_EVENT_IO_CAPIBILITY_RESPONSE =0x32,
  484. HCI_EVENT_USER_CONFIRMTION_REQUEST =0x33,
  485. HCI_EVENT_USER_PASSKEY_REQUEST =0x34,
  486. HCI_EVENT_REMOTE_OOB_DATA_REQUEST =0x35,
  487. HCI_EVENT_SIMPLE_PAIRING_COMPLETE =0x36,
  488. HCI_EVENT_LINK_SUPERVISION_TIMEOUT_CHANGE =0x38,
  489. HCI_EVENT_ENHANCED_FLUSH_COMPLETE =0x39,
  490. HCI_EVENT_USER_PASSKEY_NOTIFICATION =0x3b,
  491. HCI_EVENT_KEYPRESS_NOTIFICATION =0x3c,
  492. HCI_EVENT_REMOTE_HOST_SUPPORT_FEATURES_NOTIFICATION =0x3d,
  493. HCI_EVENT_PHY_LINK_COMPLETE =0x40,
  494. HCI_EVENT_CHANNEL_SELECT =0x41,
  495. HCI_EVENT_DISCONNECT_PHY_LINK_COMPLETE =0x42,
  496. HCI_EVENT_PHY_LINK_LOSS_EARLY_WARNING =0x43,
  497. HCI_EVENT_PHY_LINK_RECOVER =0x44,
  498. HCI_EVENT_LOGICAL_LINK_COMPLETE =0x45,
  499. HCI_EVENT_DISCONNECT_LOGICAL_LINK_COMPLETE =0x46,
  500. HCI_EVENT_FLOW_SPEC_MODIFY_COMPLETE =0x47,
  501. HCI_EVENT_NUM_OF_COMPLETE_DATA_BLOCKS =0x48,
  502. HCI_EVENT_AMP_START_TEST =0x49,
  503. HCI_EVENT_AMP_TEST_END =0x4a,
  504. HCI_EVENT_AMP_RECEIVER_REPORT =0x4b,
  505. HCI_EVENT_SHORT_RANGE_MODE_CHANGE_COMPLETE =0x4c,
  506. HCI_EVENT_AMP_STATUS_CHANGE =0x4d,
  507. HCI_EVENT_EXTENSION_RTK =0xfe,
  508. HCI_EVENT_EXTENSION_MOTO =0xff,
  509. }HCI_EVENT, *PHCI_EVENT;
  510. typedef enum _HCI_EXTENSION_EVENT_MOTO
  511. {
  512. HCI_EVENT_GET_BT_RSSI =0x01,
  513. } HCI_EXTENSION_EVENT_MOTO, *PHCI_EXTENSION_EVENT_MOTO;
  514. typedef enum _HCI_EXTENSION_EVENT_RTK
  515. {
  516. HCI_EVENT_EXT_WIFI_SCAN_NOTIFY =0x01,
  517. } HCI_EXTENSION_EVENT_RTK, *PHCI_EXTENSION_EVENT_RTK;
  518. typedef enum _HCI_EVENT_MASK_PAGE_2
  519. {
  520. EMP2_HCI_EVENT_PHY_LINK_COMPLETE =0x0000000000000001,
  521. EMP2_HCI_EVENT_CHANNEL_SELECT =0x0000000000000002,
  522. EMP2_HCI_EVENT_DISCONNECT_PHY_LINK_COMPLETE =0x0000000000000004,
  523. EMP2_HCI_EVENT_PHY_LINK_LOSS_EARLY_WARNING =0x0000000000000008,
  524. EMP2_HCI_EVENT_PHY_LINK_RECOVER =0x0000000000000010,
  525. EMP2_HCI_EVENT_LOGICAL_LINK_COMPLETE =0x0000000000000020,
  526. EMP2_HCI_EVENT_DISCONNECT_LOGICAL_LINK_COMPLETE =0x0000000000000040,
  527. EMP2_HCI_EVENT_FLOW_SPEC_MODIFY_COMPLETE =0x0000000000000080,
  528. EMP2_HCI_EVENT_NUM_OF_COMPLETE_DATA_BLOCKS =0x0000000000000100,
  529. EMP2_HCI_EVENT_AMP_START_TEST =0x0000000000000200,
  530. EMP2_HCI_EVENT_AMP_TEST_END =0x0000000000000400,
  531. EMP2_HCI_EVENT_AMP_RECEIVER_REPORT =0x0000000000000800,
  532. EMP2_HCI_EVENT_SHORT_RANGE_MODE_CHANGE_COMPLETE =0x0000000000001000,
  533. EMP2_HCI_EVENT_AMP_STATUS_CHANGE =0x0000000000002000,
  534. } HCI_EVENT_MASK_PAGE_2, *PHCI_EVENT_MASK_PAGE_2;
  535. typedef enum _HCI_STATE_MACHINE
  536. {
  537. HCI_STATE_STARTING =0x01,
  538. HCI_STATE_CONNECTING =0x02,
  539. HCI_STATE_AUTHENTICATING =0x04,
  540. HCI_STATE_CONNECTED =0x08,
  541. HCI_STATE_DISCONNECTING =0x10,
  542. HCI_STATE_DISCONNECTED =0x20
  543. } HCI_STATE_MACHINE, *PHCI_STATE_MACHINE;
  544. typedef enum _AMP_ASSOC_STRUCTURE_TYPE
  545. {
  546. AMP_MAC_ADDR =0x01,
  547. AMP_PREFERRED_CHANNEL_LIST =0x02,
  548. AMP_CONNECTED_CHANNEL =0x03,
  549. AMP_80211_PAL_CAP_LIST =0x04,
  550. AMP_80211_PAL_VISION =0x05,
  551. AMP_RESERVED_FOR_TESTING =0x33
  552. } AMP_ASSOC_STRUCTURE_TYPE, *PAMP_ASSOC_STRUCTURE_TYPE;
  553. typedef enum _AMP_BTAP_TYPE
  554. {
  555. AMP_BTAP_NONE,
  556. AMP_BTAP_CREATOR,
  557. AMP_BTAP_JOINER
  558. } AMP_BTAP_TYPE, *PAMP_BTAP_TYPE;
  559. typedef enum _HCI_STATE_WITH_CMD
  560. {
  561. STATE_CMD_CREATE_PHY_LINK,
  562. STATE_CMD_ACCEPT_PHY_LINK,
  563. STATE_CMD_DISCONNECT_PHY_LINK,
  564. STATE_CMD_CONNECT_ACCEPT_TIMEOUT,
  565. STATE_CMD_MAC_START_COMPLETE,
  566. STATE_CMD_MAC_START_FAILED,
  567. STATE_CMD_MAC_CONNECT_COMPLETE,
  568. STATE_CMD_MAC_CONNECT_FAILED,
  569. STATE_CMD_MAC_DISCONNECT_INDICATE,
  570. STATE_CMD_MAC_CONNECT_CANCEL_INDICATE,
  571. STATE_CMD_4WAY_FAILED,
  572. STATE_CMD_4WAY_SUCCESSED,
  573. STATE_CMD_ENTER_STATE,
  574. STATE_CMD_NO_SUCH_CMD,
  575. } HCI_STATE_WITH_CMD, *PHCI_STATE_WITH_CMD;
  576. typedef enum _HCI_SERVICE_TYPE
  577. {
  578. SERVICE_NO_TRAFFIC,
  579. SERVICE_BEST_EFFORT,
  580. SERVICE_GUARANTEE
  581. } HCI_SERVICE_TYPE, *PHCI_SERVICE_TYPE;
  582. typedef enum _HCI_TRAFFIC_MODE
  583. {
  584. TRAFFIC_MODE_BEST_EFFORT =0x00,
  585. TRAFFIC_MODE_GUARANTEED_LATENCY =0x01,
  586. TRAFFIC_MODE_GUARANTEED_BANDWIDTH =0x02,
  587. TRAFFIC_MODE_GUARANTEED_LATENCY_AND_BANDWIDTH =0x03
  588. } HCI_TRAFFIC_MODE, *PHCI_TRAFFIC_MODE;
  589. #define HCIOPCODE(_OCF, _OGF) (_OGF<<10|_OCF)
  590. #define HCIOPCODELOW(_OCF, _OGF) (u8)(HCIOPCODE(_OCF, _OGF)&0x00ff)
  591. #define HCIOPCODEHIGHT(_OCF, _OGF) (u8)(HCIOPCODE(_OCF, _OGF)>>8)
  592. #define TWOBYTE_HIGHTBYTE(_DATA) (u8)(_DATA>>8)
  593. #define TWOBYTE_LOWBYTE(_DATA) (u8)(_DATA)
  594. typedef enum _AMP_STATUS
  595. {
  596. AMP_STATUS_AVA_PHY_PWR_DWN = 0x0,
  597. AMP_STATUS_BT_USE_ONLY = 0x1,
  598. AMP_STATUS_NO_CAPACITY_FOR_BT = 0x2,
  599. AMP_STATUS_LOW_CAPACITY_FOR_BT = 0x3,
  600. AMP_STATUS_MEDIUM_CAPACITY_FOR_BT = 0x4,
  601. AMP_STATUS_HIGH_CAPACITY_FOR_BT = 0x5,
  602. AMP_STATUS_FULL_CAPACITY_FOR_BT = 0x6
  603. } AMP_STATUS, *PAMP_STATUS;
  604. typedef enum
  605. {
  606. Type_BT_4way1st = 0,
  607. Type_BT_4way2nd = 1,
  608. Type_BT_4way3rd = 2,
  609. Type_BT_4way4th = 3,
  610. Type_BT_unknow = 4
  611. } BT_WPAMsgType;
  612. typedef enum _BT_CONNECT_TYPE
  613. {
  614. BT_CONNECT_AUTH_REQ =0x00,
  615. BT_CONNECT_AUTH_RSP =0x01,
  616. BT_CONNECT_ASOC_REQ =0x02,
  617. BT_CONNECT_ASOC_RSP =0x03,
  618. BT_DISCONNECT =0x04
  619. } BT_CONNECT_TYPE, *PBT_CONNECT_TYPE;
  620. typedef enum _BT_LL_SERVICE_TYPE
  621. {
  622. BT_LL_BE = 0x01,
  623. BT_LL_GU = 0x02
  624. } BT_LL_SERVICE_TYPE;
  625. typedef enum _BT_LL_FLOWSPEC
  626. {
  627. BT_TX_BE_FS, //TX best effort flowspec
  628. BT_RX_BE_FS, //RX best effort flowspec
  629. BT_TX_GU_FS, //TX guaranteed latency flowspec
  630. BT_RX_GU_FS, //RX guaranteed latency flowspec
  631. BT_TX_BE_AGG_FS, //TX aggregated best effort flowspec
  632. BT_RX_BE_AGG_FS, //RX aggregated best effort flowspec
  633. BT_TX_GU_BW_FS, //TX guaranteed bandwidth flowspec
  634. BT_RX_GU_BW_FS, //RX guaranteed bandwidth flowspec
  635. BT_TX_GU_LARGE_FS, //TX guaranteed latency flowspec, for testing only
  636. BT_RX_GU_LARGE_FS, //RX guaranteed latency flowspec, for testing only
  637. } BT_LL_FLOWSPEC;
  638. typedef enum _BT_TRAFFIC_MODE
  639. {
  640. BT_MOTOR_EXT_BE = 0x00, //Best Effort. Default. for HCRP, PAN, SDP, RFCOMM-based profiles like FTP,OPP, SPP, DUN, etc.
  641. BT_MOTOR_EXT_GUL = 0x01, //Guaranteed Latency. This type of traffic is used e.g. for HID and AVRCP.
  642. BT_MOTOR_EXT_GUB = 0X02, //Guaranteed Bandwidth.
  643. BT_MOTOR_EXT_GULB = 0X03 //Guaranteed Latency and Bandwidth. for A2DP and VDP.
  644. } BT_TRAFFIC_MODE;
  645. typedef enum _BT_TRAFFIC_MODE_PROFILE
  646. {
  647. BT_PROFILE_NONE,
  648. BT_PROFILE_A2DP,
  649. BT_PROFILE_PAN,
  650. BT_PROFILE_HID,
  651. BT_PROFILE_SCO
  652. } BT_TRAFFIC_MODE_PROFILE;
  653. typedef enum _BT_LINK_ROLE
  654. {
  655. BT_LINK_MASTER = 0,
  656. BT_LINK_SLAVE = 1
  657. } BT_LINK_ROLE;
  658. typedef enum _BT_STATE_WPA_AUTH
  659. {
  660. STATE_WPA_AUTH_UNINITIALIZED,
  661. STATE_WPA_AUTH_WAIT_PACKET_1, // Join
  662. STATE_WPA_AUTH_WAIT_PACKET_2, // Creat
  663. STATE_WPA_AUTH_WAIT_PACKET_3,
  664. STATE_WPA_AUTH_WAIT_PACKET_4,
  665. STATE_WPA_AUTH_SUCCESSED
  666. } BT_STATE_WPA_AUTH, *PBT_STATE_WPA_AUTH;
  667. #define BT_WPA_AUTH_TIMEOUT_PERIOD 1000
  668. #define BTMaxWPAAuthReTransmitCoun 5
  669. #define MAX_AMP_ASSOC_FRAG_LEN 248
  670. #define TOTAL_ALLOCIATE_ASSOC_LEN 1000
  671. typedef struct _HCI_FLOW_SPEC
  672. {
  673. u8 Identifier;
  674. u8 ServiceType;
  675. u16 MaximumSDUSize;
  676. u32 SDUInterArrivalTime;
  677. u32 AccessLatency;
  678. u32 FlushTimeout;
  679. } HCI_FLOW_SPEC, *PHCI_FLOW_SPEC;
  680. typedef struct _HCI_LOG_LINK_CMD_DATA
  681. {
  682. u8 BtPhyLinkhandle;
  683. u16 BtLogLinkhandle;
  684. u8 BtTxFlowSpecID;
  685. HCI_FLOW_SPEC Tx_Flow_Spec;
  686. HCI_FLOW_SPEC Rx_Flow_Spec;
  687. u32 TxPacketCount;
  688. u32 BestEffortFlushTimeout;
  689. u8 bLLCompleteEventIsSet;
  690. u8 bLLCancelCMDIsSetandComplete;
  691. } HCI_LOG_LINK_CMD_DATA, *PHCI_LOG_LINK_CMD_DATA;
  692. typedef struct _HCI_PHY_LINK_CMD_DATA
  693. {
  694. //Physical_Link_Handle
  695. u8 BtPhyLinkhandle;
  696. u16 LinkSuperversionTimeout;
  697. //u16 SuperTimeOutCnt;
  698. //Dedicated_AMP_Key_Length
  699. u8 BtAMPKeyLen;
  700. //Dedicated_AMP_Key_Type
  701. u8 BtAMPKeyType;
  702. //Dedicated_AMP_Key
  703. u8 BtAMPKey[PMK_LEN];
  704. } HCI_PHY_LINK_CMD_DATA, *PHCI_PHY_LINK_CMD_DATA;
  705. typedef struct _AMP_ASSOC_STRUCTURE
  706. {
  707. //TYPE ID
  708. u8 TypeID;
  709. //Length
  710. u16 Length;
  711. //Value
  712. u8 Data[1];
  713. } AMP_ASSOC_STRUCTURE, *PAMP_ASSOC_STRUCTURE;
  714. typedef struct _AMP_PREF_CHNL_REGULATORY
  715. {
  716. u8 reXId;
  717. u8 regulatoryClass;
  718. u8 coverageClass;
  719. } AMP_PREF_CHNL_REGULATORY, *PAMP_PREF_CHNL_REGULATORY;
  720. typedef struct _AMP_ASSOC_CMD_DATA
  721. {
  722. //Physical_Link_Handle
  723. u8 BtPhyLinkhandle;
  724. //Length_So_Far
  725. u16 LenSoFar;
  726. u16 MaxRemoteASSOCLen;
  727. //AMP_ASSOC_Remaining_Length
  728. u16 AMPAssocRemLen;
  729. //AMP_ASSOC_fragment
  730. void *AMPAssocfragment;
  731. } AMP_ASSOC_CMD_DATA, *PAMP_ASSOC_CMD_DATA;
  732. typedef struct _HCI_LINK_INFO
  733. {
  734. u16 ConnectHandle;
  735. u8 IncomingTrafficMode;
  736. u8 OutgoingTrafficMode;
  737. u8 BTProfile;
  738. u8 BTCoreSpec;
  739. s8 BT_RSSI;
  740. u8 TrafficProfile;
  741. u8 linkRole;
  742. } HCI_LINK_INFO, *PHCI_LINK_INFO;
  743. typedef struct _HCI_EXT_CONFIG
  744. {
  745. HCI_LINK_INFO linkInfo[MAX_BT_ASOC_ENTRY_NUM];
  746. u8 btOperationCode;
  747. u16 CurrentConnectHandle;
  748. u8 CurrentIncomingTrafficMode;
  749. u8 CurrentOutgoingTrafficMode;
  750. s8 MIN_BT_RSSI;
  751. u8 NumberOfHandle;
  752. u8 NumberOfSCO;
  753. u8 CurrentBTStatus;
  754. u16 HCIExtensionVer;
  755. //Bt coexist related
  756. u8 btProfileCase;
  757. u8 btProfileAction;
  758. u8 bManualControl;
  759. u8 bBTBusy;
  760. u8 bBTA2DPBusy;
  761. u8 bEnableWifiScanNotify;
  762. u8 bHoldForBtOperation;
  763. u32 bHoldPeriodCnt;
  764. }HCI_EXT_CONFIG, *PHCI_EXT_CONFIG;
  765. typedef struct _HCI_ACL_PACKET_DATA
  766. {
  767. u16 ACLDataPacketLen;
  768. u8 SyncDataPacketLen;
  769. u16 TotalNumACLDataPackets;
  770. u16 TotalSyncNumDataPackets;
  771. } HCI_ACL_PACKET_DATA, *PHCI_ACL_PACKET_DATA;
  772. typedef struct _HCI_PHY_LINK_BSS_INFO
  773. {
  774. u16 bdCap; // capability information
  775. // Qos related. Added by Annie, 2005-11-01.
  776. // BSS_QOS BssQos; // not implement yet
  777. } HCI_PHY_LINK_BSS_INFO, *PHCI_PHY_LINK_BSS_INFO;
  778. typedef struct _PACKET_IRP_HCICMD_DATA
  779. {
  780. u16 OCF:10;
  781. u16 OGF:6;
  782. u8 Length;
  783. u8 Data[1];
  784. } PACKET_IRP_HCICMD_DATA, *PPACKET_IRP_HCICMD_DATA;
  785. typedef struct _BT_ASOC_ENTRY
  786. {
  787. u8 bUsed;
  788. u8 mAssoc;
  789. u8 b4waySuccess;
  790. u8 Bssid[6];
  791. HCI_PHY_LINK_CMD_DATA PhyLinkCmdData;
  792. HCI_LOG_LINK_CMD_DATA LogLinkCmdData[MAX_LOGICAL_LINK_NUM];
  793. HCI_ACL_PACKET_DATA ACLPacketsData;
  794. AMP_ASSOC_CMD_DATA AmpAsocCmdData;
  795. OCTET_STRING BTSsid;
  796. u8 BTSsidBuf[33];
  797. HCI_STATUS PhyLinkDisconnectReason;
  798. u8 bSendSupervisionPacket;
  799. //u8 CurrentSuervisionPacketSendNum;
  800. //u8 LastSuervisionPacketSendNum;
  801. u32 NoRxPktCnt;
  802. //Is Creator or Joiner
  803. AMP_BTAP_TYPE AMPRole;
  804. //BT current state
  805. u8 BtCurrentState;
  806. //BT next state
  807. u8 BtNextState;
  808. u8 bNeedPhysLinkCompleteEvent;
  809. HCI_STATUS PhysLinkCompleteStatus;
  810. u8 BTRemoteMACAddr[6];
  811. u32 BTCapability;
  812. u8 SyncDataPacketLen;
  813. u16 TotalSyncNumDataPackets;
  814. u16 TotalNumACLDataPackets;
  815. u8 ShortRangeMode;
  816. u8 PTK[PTK_LEN_TKIP];
  817. u8 GTK[GTK_LEN];
  818. u8 ANonce[KEY_NONCE_LEN];
  819. u8 SNonce[KEY_NONCE_LEN];
  820. u64 KeyReplayCounter;
  821. u8 WPAAuthReplayCount;
  822. u8 AESKeyBuf[AESCCMP_BLK_SIZE_TOTAL];
  823. u8 PMK[PMK_LEN];
  824. BT_STATE_WPA_AUTH BTWPAAuthState;
  825. s32 UndecoratedSmoothedPWDB;
  826. // Add for HW security !!
  827. u8 HwCAMIndex; // Cam index
  828. u8 bPeerQosSta;
  829. u32 rxSuvpPktCnt;
  830. }BT_ASOC_ENTRY, *PBT_ASOC_ENTRY;
  831. typedef struct _BT_TRAFFIC_STATISTICS
  832. {
  833. u8 bTxBusyTraffic;
  834. u8 bRxBusyTraffic;
  835. u8 bIdle;
  836. u32 TxPktCntInPeriod;
  837. u32 RxPktCntInPeriod;
  838. u64 TxPktLenInPeriod;
  839. u64 RxPktLenInPeriod;
  840. } BT_TRAFFIC_STATISTICS, *PBT_TRAFFIC_STATISTICS;
  841. typedef struct _BT_MGNT
  842. {
  843. u8 bBTConnectInProgress;
  844. u8 bLogLinkInProgress;
  845. u8 bPhyLinkInProgress;
  846. u8 bPhyLinkInProgressStartLL;
  847. u8 BtCurrentPhyLinkhandle;
  848. u16 BtCurrentLogLinkhandle;
  849. u8 CurrentConnectEntryNum;
  850. u8 DisconnectEntryNum;
  851. u8 CurrentBTConnectionCnt;
  852. BT_CONNECT_TYPE BTCurrentConnectType;
  853. BT_CONNECT_TYPE BTReceiveConnectPkt;
  854. u8 BTAuthCount;
  855. u8 BTAsocCount;
  856. u8 bStartSendSupervisionPkt;
  857. u8 BtOperationOn;
  858. u8 BTNeedAMPStatusChg;
  859. u8 JoinerNeedSendAuth;
  860. HCI_PHY_LINK_BSS_INFO bssDesc;
  861. HCI_EXT_CONFIG ExtConfig;
  862. u8 bNeedNotifyAMPNoCap;
  863. u8 bCreateSpportQos;
  864. u8 bSupportProfile;
  865. u8 BTChannel;
  866. u8 CheckChnlIsSuit;
  867. u8 bBtScan;
  868. u8 btLogoTest;
  869. } BT_MGNT, *PBT_MGNT;
  870. typedef struct _BT_HCI_DBG_INFO
  871. {
  872. u32 hciCmdCnt;
  873. u32 hciCmdCntUnknown;
  874. u32 hciCmdCntCreatePhyLink;
  875. u32 hciCmdCntAcceptPhyLink;
  876. u32 hciCmdCntDisconnectPhyLink;
  877. u32 hciCmdPhyLinkStatus;
  878. u32 hciCmdCntCreateLogLink;
  879. u32 hciCmdCntAcceptLogLink;
  880. u32 hciCmdCntDisconnectLogLink;
  881. u32 hciCmdCntReadLocalAmpAssoc;
  882. u32 hciCmdCntWriteRemoteAmpAssoc;
  883. u32 hciCmdCntSetAclLinkStatus;
  884. u32 hciCmdCntSetScoLinkStatus;
  885. u32 hciCmdCntExtensionVersionNotify;
  886. u32 hciCmdCntLinkStatusNotify;
  887. } BT_HCI_DBG_INFO, *PBT_HCI_DBG_INFO;
  888. typedef struct _BT_IRP_DBG_INFO
  889. {
  890. u32 irpMJCreate;
  891. // Io Control
  892. u32 irpIoControl;
  893. u32 irpIoCtrlHciCmd;
  894. u32 irpIoCtrlHciEvent;
  895. u32 irpIoCtrlHciTxData;
  896. u32 irpIoCtrlHciRxData;
  897. u32 irpIoCtrlUnknown;
  898. u32 irpIoCtrlHciTxData1s;
  899. } BT_IRP_DBG_INFO, *PBT_IRP_DBG_INFO;
  900. typedef struct _BT_PACKET_DBG_INFO
  901. {
  902. u32 btPktTxProbReq;
  903. u32 btPktRxProbReq;
  904. u32 btPktRxProbReqFail;
  905. u32 btPktTxProbRsp;
  906. u32 btPktRxProbRsp;
  907. u32 btPktTxAuth;
  908. u32 btPktRxAuth;
  909. u32 btPktRxAuthButDrop;
  910. u32 btPktTxAssocReq;
  911. u32 btPktRxAssocReq;
  912. u32 btPktRxAssocReqButDrop;
  913. u32 btPktTxAssocRsp;
  914. u32 btPktRxAssocRsp;
  915. u32 btPktTxDisassoc;
  916. u32 btPktRxDisassoc;
  917. u32 btPktRxDeauth;
  918. u32 btPktTx4way1st;
  919. u32 btPktRx4way1st;
  920. u32 btPktTx4way2nd;
  921. u32 btPktRx4way2nd;
  922. u32 btPktTx4way3rd;
  923. u32 btPktRx4way3rd;
  924. u32 btPktTx4way4th;
  925. u32 btPktRx4way4th;
  926. u32 btPktTxLinkSuperReq;
  927. u32 btPktRxLinkSuperReq;
  928. u32 btPktTxLinkSuperRsp;
  929. u32 btPktRxLinkSuperRsp;
  930. u32 btPktTxData;
  931. u32 btPktRxData;
  932. } BT_PACKET_DBG_INFO, *PBT_PACKET_DBG_INFO;
  933. typedef struct _BT_DBG
  934. {
  935. u8 dbgCtrl;
  936. u32 dbgProfile;
  937. BT_HCI_DBG_INFO dbgHciInfo;
  938. BT_IRP_DBG_INFO dbgIrpInfo;
  939. BT_PACKET_DBG_INFO dbgBtPkt;
  940. } BT_DBG, *PBT_DBG;
  941. typedef struct _BT_HCI_INFO
  942. {
  943. //802.11 Pal version specifier
  944. u8 BTPalVersion;
  945. u16 BTPalCompanyID;
  946. u16 BTPalsubversion;
  947. //Connected channel list
  948. u16 BTConnectChnlListLen;
  949. u8 BTConnectChnllist[64];
  950. //Fail contact counter
  951. u16 FailContactCount;
  952. //Event mask
  953. u64 BTEventMask;
  954. u64 BTEventMaskPage2;
  955. //timeout var
  956. u16 ConnAcceptTimeout;
  957. u16 LogicalAcceptTimeout;
  958. u16 PageTimeout;
  959. u8 LocationDomainAware;
  960. u16 LocationDomain;
  961. u8 LocationDomainOptions;
  962. u8 LocationOptions;
  963. u8 FlowControlMode;
  964. //Preferred channel list
  965. u16 BtPreChnlListLen;
  966. u8 BTPreChnllist[64];
  967. u16 enFlush_LLH; //enhanced flush handle
  968. u16 FLTO_LLH; //enhanced flush handle
  969. //==========================================
  970. //Test command only.
  971. u8 bInTestMode;
  972. u8 bTestIsEnd;
  973. u8 bTestNeedReport;
  974. u8 TestScenario;
  975. u8 TestReportInterval;
  976. u8 TestCtrType;
  977. u32 TestEventType;
  978. u16 TestNumOfFrame;
  979. u16 TestNumOfErrFrame;
  980. u16 TestNumOfBits;
  981. u16 TestNumOfErrBits;
  982. //==========================================
  983. } BT_HCI_INFO, *PBT_HCI_INFO;
  984. typedef struct _BT_TRAFFIC
  985. {
  986. // Add for check replay data
  987. u8 LastRxUniFragNum;
  988. u16 LastRxUniSeqNum;
  989. //s32 EntryMaxUndecoratedSmoothedPWDB;
  990. //s32 EntryMinUndecoratedSmoothedPWDB;
  991. BT_TRAFFIC_STATISTICS Bt30TrafficStatistics;
  992. } BT_TRAFFIC, *PBT_TRAFFIC;
  993. #define RT_WORK_ITEM _workitem
  994. #define RT_THREAD _thread_hdl_
  995. typedef struct _BT_SECURITY
  996. {
  997. // WPA auth state
  998. // May need to remove to BTSecInfo ...
  999. //BT_STATE_WPA_AUTH BTWPAAuthState;
  1000. //u8 PMK[PMK_LEN];
  1001. RT_TIMER BTWPAAuthTimer;
  1002. OCTET_STRING RSNIE;
  1003. u8 RSNIEBuf[MAXRSNIELEN];
  1004. u8 bRegNoEncrypt;
  1005. u8 bUsedHwEncrypt; // It is define by OS version !!
  1006. } BT_SECURITY, *PBT_SECURITY;
  1007. typedef struct _BT30Info
  1008. {
  1009. PADAPTER padapter;
  1010. BT_ASOC_ENTRY BtAsocEntry[MAX_BT_ASOC_ENTRY_NUM];
  1011. BT_MGNT BtMgnt;
  1012. BT_DBG BtDbg;
  1013. BT_HCI_INFO BtHciInfo;
  1014. BT_TRAFFIC BtTraffic;
  1015. BT_SECURITY BtSec;
  1016. #if(BT_THREAD == 0)
  1017. RT_WORK_ITEM HCICmdWorkItem;
  1018. RT_TIMER BTHCICmdTimer;
  1019. #endif
  1020. #if (SENDTXMEHTOD==0)
  1021. RT_WORK_ITEM HCISendACLDataWorkItem;
  1022. RT_TIMER BTHCISendAclDataTimer;
  1023. #elif(SENDTXMEHTOD==2)
  1024. RT_THREAD BTTxThread;
  1025. #endif
  1026. RT_WORK_ITEM BTPsDisableWorkItem;
  1027. RT_WORK_ITEM BTConnectWorkItem;
  1028. RT_TIMER BTHCIDiscardAclDataTimer;
  1029. RT_TIMER BTHCIJoinTimeoutTimer;
  1030. RT_TIMER BTTestSendPacketTimer;
  1031. RT_TIMER BTSupervisionPktTimer;
  1032. RT_TIMER BTDisconnectPhyLinkTimer;
  1033. RT_TIMER BTBeaconTimer;
  1034. u8 BTBeaconTmrOn;
  1035. RT_TIMER BTPsDisableTimer;
  1036. RT_TIMER BTAuthTimeoutTimer;
  1037. RT_TIMER BTAsocTimeoutTimer;
  1038. PVOID pBtChnlList;
  1039. }BT30Info, *PBT30Info;
  1040. typedef struct _PACKET_IRP_ACL_DATA
  1041. {
  1042. u16 Handle:12;
  1043. u16 PB_Flag:2;
  1044. u16 BC_Flag:2;
  1045. u16 Length;
  1046. u8 Data[1];
  1047. } PACKET_IRP_ACL_DATA, *PPACKET_IRP_ACL_DATA;
  1048. typedef struct _PACKET_IRP_HCIEVENT_DATA
  1049. {
  1050. u8 EventCode;
  1051. u8 Length;
  1052. u8 Data[1];
  1053. } PACKET_IRP_HCIEVENT_DATA, *PPACKET_IRP_HCIEVENT_DATA;
  1054. typedef struct _COMMON_TRIPLE
  1055. {
  1056. u8 byte_1st;
  1057. u8 byte_2nd;
  1058. u8 byte_3rd;
  1059. } COMMON_TRIPLE, *PCOMMON_TRIPLE;
  1060. #define COUNTRY_STR_LEN 3 // country string len=3
  1061. #define LOCAL_PMK 0
  1062. typedef enum _HCI_WIFI_CONNECT_STATUS
  1063. {
  1064. HCI_WIFI_NOT_CONNECTED =0x0,
  1065. HCI_WIFI_CONNECTED =0x1,
  1066. HCI_WIFI_CONNECT_IN_PROGRESS =0x2,
  1067. } HCI_WIFI_CONNECT_STATUS, *PHCI_WIFI_CONNECT_STATUS;
  1068. typedef enum _HCI_EXT_BT_OPERATION
  1069. {
  1070. HCI_BT_OP_NONE = 0x0,
  1071. HCI_BT_OP_INQUIRY_START = 0x1,
  1072. HCI_BT_OP_INQUIRY_FINISH = 0x2,
  1073. HCI_BT_OP_PAGING_START = 0x3,
  1074. HCI_BT_OP_PAGING_SUCCESS = 0x4,
  1075. HCI_BT_OP_PAGING_UNSUCCESS = 0x5,
  1076. HCI_BT_OP_PAIRING_START = 0x6,
  1077. HCI_BT_OP_PAIRING_FINISH = 0x7,
  1078. HCI_BT_OP_BT_DEV_ENABLE = 0x8,
  1079. HCI_BT_OP_BT_DEV_DISABLE = 0x9,
  1080. HCI_BT_OP_MAX
  1081. } HCI_EXT_BT_OPERATION, *PHCI_EXT_BT_OPERATION;
  1082. //======================================
  1083. // Function proto type
  1084. //======================================
  1085. #define RT_LIST_ENTRY _list
  1086. typedef struct _BTData_ENTRY
  1087. {
  1088. RT_LIST_ENTRY List;
  1089. void *pDataBlock;
  1090. } BTData_ENTRY, *PBTData_ENTRY;
  1091. #define BTHCI_SM_WITH_INFO(_Adapter, _StateToEnter, _StateCmd, _EntryNum) \
  1092. { \
  1093. RTPRINT(FIOCTL, IOCTL_STATE, ("[BT state change] caused by ""%s"", line=%d\n", __FUNCTION__, __LINE__)); \
  1094. BTHCI_StateMachine(_Adapter, _StateToEnter, _StateCmd, _EntryNum);\
  1095. }
  1096. void BTHCI_EventParse(PADAPTER padapter, void *pEvntData, u32 dataLen);
  1097. #define BT_EventParse BTHCI_EventParse
  1098. u8 BTHCI_HsConnectionEstablished(PADAPTER padapter);
  1099. void BTHCI_UpdateBTProfileRTKToMoto(PADAPTER padapter);
  1100. void BTHCI_WifiScanNotify(PADAPTER padapter, u8 scanType);
  1101. void BTHCI_StateMachine(PADAPTER padapter, u8 StateToEnter, HCI_STATE_WITH_CMD StateCmd, u8 EntryNum);
  1102. void BTHCI_DisconnectPeer(PADAPTER padapter, u8 EntryNum);
  1103. void BTHCI_EventNumOfCompletedDataBlocks(PADAPTER padapter);
  1104. void BTHCI_EventAMPStatusChange(PADAPTER padapter, u8 AMP_Status);
  1105. void BTHCI_DisconnectAll(PADAPTER padapter);
  1106. HCI_STATUS BTHCI_HandleHCICMD(PADAPTER padapter, PPACKET_IRP_HCICMD_DATA pHciCmd);
  1107. // ===== End of sync from SD7 driver COMMON/bt_hci.h =====
  1108. #endif // __BT_HCI_C__
  1109. #ifdef __HALBTC87231ANT_C__ // HAL/BTCoexist/HalBtc87231Ant.h
  1110. // ===== Below this line is sync from SD7 driver HAL/BTCoexist/HalBtc87231Ant.h =====
  1111. #define BTC_FOR_SCAN_START 1
  1112. #define BTC_FOR_SCAN_FINISH 0
  1113. #define BT_TXRX_CNT_THRES_1 1200
  1114. #define BT_TXRX_CNT_THRES_2 1400
  1115. #define BT_TXRX_CNT_THRES_3 3000
  1116. #define BT_TXRX_CNT_LEVEL_0 0 // < 1200
  1117. #define BT_TXRX_CNT_LEVEL_1 1 // >= 1200 && < 1400
  1118. #define BT_TXRX_CNT_LEVEL_2 2 // >= 1400
  1119. #define BT_TXRX_CNT_LEVEL_3 3 // >= 3000
  1120. typedef enum _BT_STATE_1ANT{
  1121. BT_INFO_STATE_DISABLED = 0,
  1122. BT_INFO_STATE_NO_CONNECTION = 1,
  1123. BT_INFO_STATE_CONNECT_IDLE = 2,
  1124. BT_INFO_STATE_INQ_OR_PAG = 3,
  1125. BT_INFO_STATE_ACL_ONLY_BUSY = 4,
  1126. BT_INFO_STATE_SCO_ONLY_BUSY = 5,
  1127. BT_INFO_STATE_ACL_SCO_BUSY = 6,
  1128. BT_INFO_STATE_ACL_INQ_OR_PAG = 7,
  1129. BT_INFO_STATE_MAX = 8
  1130. } BT_STATE_1ANT, *PBT_STATE_1ANT;
  1131. typedef struct _BTDM_8723A_1ANT
  1132. {
  1133. u8 prePsTdma;
  1134. u8 curPsTdma;
  1135. u8 psTdmaDuAdjType;
  1136. u8 bPrePsTdmaOn;
  1137. u8 bCurPsTdmaOn;
  1138. u8 preWifiPara;
  1139. u8 curWifiPara;
  1140. u8 preCoexWifiCon;
  1141. u8 curCoexWifiCon;
  1142. u8 wifiRssiThresh;
  1143. u32 psTdmaMonitorCnt;
  1144. u32 psTdmaGlobalCnt;
  1145. //DurationAdjust For SCO
  1146. u32 psTdmaMonitorCntForSCO;
  1147. u8 psTdmaDuAdjTypeForSCO;
  1148. u8 RSSI_WiFi_Last;
  1149. u8 RSSI_BT_Last;
  1150. u8 bWiFiHalt;
  1151. u8 bRAChanged;
  1152. } BTDM_8723A_1ANT, *PBTDM_8723A_1ANT;
  1153. void BTDM_1AntSignalCompensation(PADAPTER padapter, u8 *rssi_wifi, u8 *rssi_bt);
  1154. void BTDM_1AntForDhcp(PADAPTER padapter);
  1155. void BTDM_1AntBtCoexist8723A(PADAPTER padapter);
  1156. // ===== End of sync from SD7 driver HAL/BTCoexist/HalBtc87231Ant.h =====
  1157. #endif // __HALBTC87231ANT_C__
  1158. #ifdef __HALBTC87232ANT_C__ // HAL/BTCoexist/HalBtc87232Ant.h
  1159. // ===== Below this line is sync from SD7 driver HAL/BTCoexist/HalBtc87232Ant.h =====
  1160. typedef enum _BT_2ANT_BT_STATUS{
  1161. BT_2ANT_BT_STATUS_IDLE = 0x0,
  1162. BT_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
  1163. BT_2ANT_BT_STATUS_NON_IDLE = 0x2,
  1164. BT_2ANT_BT_STATUS_MAX
  1165. }BT_2ANT_BT_STATUS,*PBT_2ANT_BT_STATUS;
  1166. typedef enum _BT_2ANT_COEX_ALGO{
  1167. BT_2ANT_COEX_ALGO_UNDEFINED = 0x0,
  1168. BT_2ANT_COEX_ALGO_SCO = 0x1,
  1169. BT_2ANT_COEX_ALGO_HID = 0x2,
  1170. BT_2ANT_COEX_ALGO_A2DP = 0x3,
  1171. BT_2ANT_COEX_ALGO_PANEDR = 0x4,
  1172. BT_2ANT_COEX_ALGO_PANHS = 0x5,
  1173. BT_2ANT_COEX_ALGO_PANEDR_A2DP = 0x6,
  1174. BT_2ANT_COEX_ALGO_PANEDR_HID = 0x7,
  1175. BT_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x8,
  1176. BT_2ANT_COEX_ALGO_HID_A2DP = 0x9,
  1177. BT_2ANT_COEX_ALGO_HID_A2DP_PANHS = 0xA,
  1178. BT_2ANT_COEX_ALGO_MAX = 0xB,
  1179. }BT_2ANT_COEX_ALGO,*PBT_2ANT_COEX_ALGO;
  1180. typedef struct _BTDM_8723A_2ANT
  1181. {
  1182. u8 bPreDecBtPwr;
  1183. u8 bCurDecBtPwr;
  1184. u8 preWlanActHi;
  1185. u8 curWlanActHi;
  1186. u8 preWlanActLo;
  1187. u8 curWlanActLo;
  1188. u8 preFwDacSwingLvl;
  1189. u8 curFwDacSwingLvl;
  1190. u8 bPreRfRxLpfShrink;
  1191. u8 bCurRfRxLpfShrink;
  1192. u8 bPreLowPenaltyRa;
  1193. u8 bCurLowPenaltyRa;
  1194. u8 preBtRetryIndex;
  1195. u8 curBtRetryIndex;
  1196. u8 bPreDacSwingOn;
  1197. u32 preDacSwingLvl;
  1198. u8 bCurDacSwingOn;
  1199. u32 curDacSwingLvl;
  1200. u8 bPreAdcBackOff;
  1201. u8 bCurAdcBackOff;
  1202. u8 bPreAgcTableEn;
  1203. u8 bCurAgcTableEn;
  1204. u32 preVal0x6c0;
  1205. u32 curVal0x6c0;
  1206. u32 preVal0x6c8;
  1207. u32 curVal0x6c8;
  1208. u8 preVal0x6cc;
  1209. u8 curVal0x6cc;
  1210. u8 bCurIgnoreWlanAct;
  1211. u8 bPreIgnoreWlanAct;
  1212. u8 prePsTdma;
  1213. u8 curPsTdma;
  1214. u8 psTdmaDuAdjType;
  1215. u8 bPrePsTdmaOn;
  1216. u8 bCurPsTdmaOn;
  1217. u8 preAlgorithm;
  1218. u8 curAlgorithm;
  1219. u8 bResetTdmaAdjust;
  1220. u8 btStatus;
  1221. } BTDM_8723A_2ANT, *PBTDM_8723A_2ANT;
  1222. void BTDM_2AntBtCoexist8723A(PADAPTER padapter);
  1223. // ===== End of sync from SD7 driver HAL/BTCoexist/HalBtc87232Ant.h =====
  1224. #endif // __HALBTC87232ANT_C__
  1225. #ifdef __HALBTC8723_C__ // HAL/BTCoexist/HalBtc8723.h
  1226. // ===== Below this line is sync from SD7 driver HAL/BTCoexist/HalBtc8723.h =====
  1227. #define BT_Q_PKT_OFF 0
  1228. #define BT_Q_PKT_ON 1
  1229. #define BT_TX_PWR_OFF 0
  1230. #define BT_TX_PWR_ON 1
  1231. // TDMA mode definition
  1232. #define TDMA_2ANT 0
  1233. #define TDMA_1ANT 1
  1234. #define TDMA_NAV_OFF 0
  1235. #define TDMA_NAV_ON 1
  1236. #define TDMA_DAC_SWING_OFF 0
  1237. #define TDMA_DAC_SWING_ON 1
  1238. #define BT_RSSI_LEVEL_H 0
  1239. #define BT_RSSI_LEVEL_M 1
  1240. #define BT_RSSI_LEVEL_L 2
  1241. // PTA mode related definition
  1242. #define BT_PTA_MODE_OFF 0
  1243. #define BT_PTA_MODE_ON 1
  1244. // Penalty Tx Rate Adaptive
  1245. #define BT_TX_RATE_ADAPTIVE_NORMAL 0
  1246. #define BT_TX_RATE_ADAPTIVE_LOW_PENALTY 1
  1247. // RF Corner
  1248. #define BT_RF_RX_LPF_CORNER_RESUME 0
  1249. #define BT_RF_RX_LPF_CORNER_SHRINK 1
  1250. #define BT_INFO_ACL BIT(0)
  1251. #define BT_INFO_SCO BIT(1)
  1252. #define BT_INFO_INQ_PAG BIT(2)
  1253. #define BT_INFO_ACL_BUSY BIT(3)
  1254. #define BT_INFO_SCO_BUSY BIT(4)
  1255. #define BT_INFO_HID BIT(5)
  1256. #define BT_INFO_A2DP BIT(6)
  1257. #define BT_INFO_FTP BIT(7)
  1258. typedef struct _BT_COEXIST_8723A
  1259. {
  1260. u32 highPriorityTx;
  1261. u32 highPriorityRx;
  1262. u32 lowPriorityTx;
  1263. u32 lowPriorityRx;
  1264. u8 btRssi;
  1265. u8 TotalAntNum;
  1266. u8 bC2hBtInfoSupport;
  1267. u8 c2hBtInfo;
  1268. u8 c2hBtInfoOriginal;
  1269. u8 prec2hBtInfo; // for 1Ant
  1270. u8 bC2hBtInquiryPage;
  1271. u64 btInqPageStartTime; // for 2Ant
  1272. u8 c2hBtProfile; // for 1Ant
  1273. u8 btRetryCnt;
  1274. u8 btInfoExt;
  1275. u8 bC2hBtInfoReqSent;
  1276. u8 bForceFwBtInfo;
  1277. u8 bForceA2dpSink;
  1278. // u8 bForceLps;
  1279. // u8 bBtPwrSaveMode;
  1280. BTDM_8723A_2ANT btdm2Ant;
  1281. BTDM_8723A_1ANT btdm1Ant;
  1282. } BT_COEXIST_8723A, *PBT_COEXIST_8723A;
  1283. void BTDM_SetFwChnlInfo(PADAPTER padapter, RT_MEDIA_STATUS mstatus);
  1284. u8 BTDM_IsWifiConnectionExist(PADAPTER padapter);
  1285. void BTDM_SetFw3a(PADAPTER padapter, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5);
  1286. void BTDM_QueryBtInformation(PADAPTER padapter);
  1287. void BTDM_SetSwRfRxLpfCorner(PADAPTER padapter, u8 type);
  1288. void BTDM_SetSwPenaltyTxRateAdaptive(PADAPTER padapter, u8 raType);
  1289. void BTDM_SetFwDecBtPwr(PADAPTER padapter, u8 bDecBtPwr);
  1290. u8 BTDM_BtProfileSupport(PADAPTER padapter);
  1291. void BTDM_LpsLeave(PADAPTER padapter);
  1292. u8 BTDM_1Ant8723A(PADAPTER padapter);
  1293. #define BT_1Ant BTDM_1Ant8723A
  1294. // ===== End of sync from SD7 driver HAL/BTCoexist/HalBtc8723.h =====
  1295. #endif // __HALBTC8723_C__
  1296. #ifdef __HALBTCCSR1ANT_C__ // HAL/BTCoexist/HalBtcCsr1Ant.h
  1297. // ===== Below this line is sync from SD7 driver HAL/BTCoexist/HalBtcCsr1Ant.h =====
  1298. enum BT_A2DP_INDEX{
  1299. BT_A2DP_INDEX0 =0, // 32,12; the most critical for BT
  1300. BT_A2DP_INDEX1, // 12,24
  1301. BT_A2DP_INDEX2, // 0,0
  1302. BT_A2DP_INDEX_MAX
  1303. };
  1304. #define BT_A2DP_STATE_NOT_ENTERED 0
  1305. #define BT_A2DP_STATE_DETECTING 1
  1306. #define BT_A2DP_STATE_DETECTED 2
  1307. #define BTDM_ANT_BT_IDLE 0
  1308. #define BTDM_ANT_WIFI 1
  1309. #define BTDM_ANT_BT 2
  1310. void BTDM_SingleAnt(PADAPTER padapter, u8 bSingleAntOn, u8 bInterruptOn, u8 bMultiNAVOn);
  1311. void BTDM_CheckBTIdleChange1Ant(PADAPTER padapter);
  1312. // ===== End of sync from SD7 driver HAL/BTCoexist/HalBtcCsr1Ant.h =====
  1313. #endif // __HALBTCCSR1ANT_C__
  1314. #ifdef __HALBTCCSR2ANT_C__ // HAL/BTCoexist/HalBtcCsr2Ant.h
  1315. // ===== Below this line is sync from SD7 driver HAL/BTCoexist/HalBtcCsr2Ant.h =====
  1316. //===========================================
  1317. // For old core stack before v251
  1318. //===========================================
  1319. #define BT_RSSI_STATE_NORMAL_POWER BIT0
  1320. #define BT_RSSI_STATE_AMDPU_OFF BIT1
  1321. #define BT_RSSI_STATE_SPECIAL_LOW BIT2
  1322. #define BT_RSSI_STATE_BG_EDCA_LOW BIT3
  1323. #define BT_RSSI_STATE_TXPOWER_LOW BIT4
  1324. #define BT_DACSWING_OFF 0
  1325. #define BT_DACSWING_M4 1
  1326. #define BT_DACSWING_M7 2
  1327. #define BT_DACSWING_M10 3
  1328. void BTDM_DiminishWiFi(PADAPTER Adapter, u8 bDACOn, u8 bInterruptOn, u8 DACSwingLevel, u8 bNAVOn);
  1329. // ===== End of sync from SD7 driver HAL/BTCoexist/HalBtcCsr2Ant.h =====
  1330. #endif // __HALBTCCSR2ANT_C__
  1331. #ifdef __HALBTCOEXIST_C__ // HAL/BTCoexist/HalBtCoexist.h
  1332. // HEADER/TypeDef.h
  1333. #define MAX_FW_SUPPORT_MACID_NUM 64
  1334. // ===== Below this line is sync from SD7 driver HAL/BTCoexist/HalBtCoexist.h =====
  1335. #define FW_VER_BT_REG 62
  1336. #define FW_VER_BT_REG1 74
  1337. #define REG_BT_ACTIVE 0x444
  1338. #define REG_BT_STATE 0x448
  1339. #define REG_BT_POLLING1 0x44c
  1340. #define REG_BT_POLLING 0x700
  1341. #define REG_BT_ACTIVE_OLD 0x488
  1342. #define REG_BT_STATE_OLD 0x48c
  1343. #define REG_BT_POLLING_OLD 0x490
  1344. // The reg define is for 8723
  1345. #define REG_HIGH_PRIORITY_TXRX 0x770
  1346. #define REG_LOW_PRIORITY_TXRX 0x774
  1347. #define BT_FW_COEX_THRESH_TOL 6
  1348. #define BT_FW_COEX_THRESH_20 20
  1349. #define BT_FW_COEX_THRESH_23 23
  1350. #define BT_FW_COEX_THRESH_25 25
  1351. #define BT_FW_COEX_THRESH_30 30
  1352. #define BT_FW_COEX_THRESH_35 35
  1353. #define BT_FW_COEX_THRESH_40 40
  1354. #define BT_FW_COEX_THRESH_45 45
  1355. #define BT_FW_COEX_THRESH_47 47
  1356. #define BT_FW_COEX_THRESH_50 50
  1357. #define BT_FW_COEX_THRESH_55 55
  1358. #define BT_FW_COEX_THRESH_65 65
  1359. #define BT_COEX_STATE_BT30 BIT(0)
  1360. #define BT_COEX_STATE_WIFI_HT20 BIT(1)
  1361. #define BT_COEX_STATE_WIFI_HT40 BIT(2)
  1362. #define BT_COEX_STATE_WIFI_LEGACY BIT(3)
  1363. #define BT_COEX_STATE_WIFI_RSSI_LOW BIT(4)
  1364. #define BT_COEX_STATE_WIFI_RSSI_MEDIUM BIT(5)
  1365. #define BT_COEX_STATE_WIFI_RSSI_HIGH BIT(6)
  1366. #define BT_COEX_STATE_DEC_BT_POWER BIT(7)
  1367. #define BT_COEX_STATE_WIFI_IDLE BIT(8)
  1368. #define BT_COEX_STATE_WIFI_UPLINK BIT(9)
  1369. #define BT_COEX_STATE_WIFI_DOWNLINK BIT(10)
  1370. #define BT_COEX_STATE_BT_INQ_PAGE BIT(11)
  1371. #define BT_COEX_STATE_BT_IDLE BIT(12)
  1372. #define BT_COEX_STATE_BT_UPLINK BIT(13)
  1373. #define BT_COEX_STATE_BT_DOWNLINK BIT(14)
  1374. //===========================================
  1375. // Todo: Remove these definitions
  1376. #define BT_COEX_STATE_BT_PAN_IDLE BIT(15)
  1377. #define BT_COEX_STATE_BT_PAN_UPLINK BIT(16)
  1378. #define BT_COEX_STATE_BT_PAN_DOWNLINK BIT(17)
  1379. #define BT_COEX_STATE_BT_A2DP_IDLE BIT(18)
  1380. //===========================================
  1381. #define BT_COEX_STATE_BT_RSSI_LOW BIT(19)
  1382. #define BT_COEX_STATE_PROFILE_HID BIT(20)
  1383. #define BT_COEX_STATE_PROFILE_A2DP BIT(21)
  1384. #define BT_COEX_STATE_PROFILE_PAN BIT(22)
  1385. #define BT_COEX_STATE_PROFILE_SCO BIT(23)
  1386. #define BT_COEX_STATE_WIFI_RSSI_1_LOW BIT(24)
  1387. #define BT_COEX_STATE_WIFI_RSSI_1_MEDIUM BIT(25)
  1388. #define BT_COEX_STATE_WIFI_RSSI_1_HIGH BIT(26)
  1389. #define BT_COEX_STATE_WIFI_RSSI_BEACON_LOW BIT(27)
  1390. #define BT_COEX_STATE_WIFI_RSSI_BEACON_MEDIUM BIT(28)
  1391. #define BT_COEX_STATE_WIFI_RSSI_BEACON_HIGH BIT(29)
  1392. #define BT_COEX_STATE_BTINFO_COMMON BIT30
  1393. #define BT_COEX_STATE_BTINFO_B_HID_SCOESCO BIT31
  1394. #define BT_COEX_STATE_BTINFO_B_FTP_A2DP BIT32
  1395. #define BT_COEX_STATE_BT_CNT_LEVEL_0 BIT33
  1396. #define BT_COEX_STATE_BT_CNT_LEVEL_1 BIT34
  1397. #define BT_COEX_STATE_BT_CNT_LEVEL_2 BIT35
  1398. #define BT_COEX_STATE_BT_CNT_LEVEL_3 BIT36
  1399. #define BT_RSSI_STATE_HIGH 0
  1400. #define BT_RSSI_STATE_MEDIUM 1
  1401. #define BT_RSSI_STATE_LOW 2
  1402. #define BT_RSSI_STATE_STAY_HIGH 3
  1403. #define BT_RSSI_STATE_STAY_MEDIUM 4
  1404. #define BT_RSSI_STATE_STAY_LOW 5
  1405. #define BT_AGCTABLE_OFF 0
  1406. #define BT_AGCTABLE_ON 1
  1407. #define BT_BB_BACKOFF_OFF 0
  1408. #define BT_BB_BACKOFF_ON 1
  1409. #define BT_FW_NAV_OFF 0
  1410. #define BT_FW_NAV_ON 1
  1411. #define BT_COEX_MECH_NONE 0
  1412. #define BT_COEX_MECH_SCO 1
  1413. #define BT_COEX_MECH_HID 2
  1414. #define BT_COEX_MECH_A2DP 3
  1415. #define BT_COEX_MECH_PAN 4
  1416. #define BT_COEX_MECH_HID_A2DP 5
  1417. #define BT_COEX_MECH_HID_PAN 6
  1418. #define BT_COEX_MECH_PAN_A2DP 7
  1419. #define BT_COEX_MECH_HID_SCO_ESCO 8
  1420. #define BT_COEX_MECH_FTP_A2DP 9
  1421. #define BT_COEX_MECH_COMMON 10
  1422. #define BT_COEX_MECH_MAX 11
  1423. //===========================================
  1424. // BT Dbg Ctrl
  1425. //===========================================
  1426. #define BT_DBG_PROFILE_NONE 0
  1427. #define BT_DBG_PROFILE_SCO 1
  1428. #define BT_DBG_PROFILE_HID 2
  1429. #define BT_DBG_PROFILE_A2DP 3
  1430. #define BT_DBG_PROFILE_PAN 4
  1431. #define BT_DBG_PROFILE_HID_A2DP 5
  1432. #define BT_DBG_PROFILE_HID_PAN 6
  1433. #define BT_DBG_PROFILE_PAN_A2DP 7
  1434. #define BT_DBG_PROFILE_MAX 9
  1435. //===========================================
  1436. typedef struct _BT_COEXIST_STR
  1437. {
  1438. u8 BluetoothCoexist;
  1439. u8 BT_Ant_Num;
  1440. u8 BT_CoexistType;
  1441. u8 BT_Ant_isolation; //0:good, 1:bad
  1442. u8 BT_RadioSharedType;
  1443. u32 Ratio_Tx;
  1444. u32 Ratio_PRI;
  1445. u8 bInitlized;
  1446. u32 BtRfRegOrigin1E;
  1447. u32 BtRfRegOrigin1F;
  1448. u8 bBTBusyTraffic;
  1449. u8 bBTTrafficModeSet;
  1450. u8 bBTNonTrafficModeSet;
  1451. BT_TRAFFIC_STATISTICS BT21TrafficStatistics;
  1452. u64 CurrentState;
  1453. u64 PreviousState;
  1454. u8 preRssiState;
  1455. u8 preRssiState1;
  1456. u8 preRssiStateBeacon;
  1457. u8 bFWCoexistAllOff;
  1458. u8 bSWCoexistAllOff;
  1459. u8 bHWCoexistAllOff;
  1460. u8 bBalanceOn;
  1461. u8 bSingleAntOn;
  1462. u8 bInterruptOn;
  1463. u8 bMultiNAVOn;
  1464. u8 PreWLANActH;
  1465. u8 PreWLANActL;
  1466. u8 WLANActH;
  1467. u8 WLANActL;
  1468. u8 A2DPState;
  1469. u8 AntennaState;
  1470. u32 lastBtEdca;
  1471. u16 last_aggr_num;
  1472. u8 bEDCAInitialized;
  1473. u8 exec_cnt;
  1474. u8 b8723aAgcTableOn;
  1475. u8 b92DAgcTableOn;
  1476. BT_COEXIST_8723A halCoex8723;
  1477. u8 btActiveZeroCnt;
  1478. u8 bCurBtDisabled;
  1479. u8 bPreBtDisabled;
  1480. u8 bNeedToRoamForBtDisableEnable;
  1481. u8 fw3aVal[5];
  1482. }BT_COEXIST_STR, *PBT_COEXIST_STR;
  1483. void BTDM_CheckAntSelMode(PADAPTER padapter);
  1484. void BTDM_FwC2hBtRssi(PADAPTER padapter, u8 *tmpBuf);
  1485. #define BT_FwC2hBtRssi BTDM_FwC2hBtRssi
  1486. void BTDM_FwC2hBtInfo(PADAPTER padapter, u8 *tmpBuf, u8 length);
  1487. #define BT_FwC2hBtInfo BTDM_FwC2hBtInfo
  1488. void BTDM_DisplayBtCoexInfo(PADAPTER padapter);
  1489. #define BT_DisplayBtCoexInfo BTDM_DisplayBtCoexInfo
  1490. void BTDM_RejectAPAggregatedPacket(PADAPTER padapter, u8 bReject);
  1491. u8 BTDM_IsHT40(PADAPTER padapter);
  1492. u8 BTDM_Legacy(PADAPTER padapter);
  1493. void BTDM_CheckWiFiState(PADAPTER padapter);
  1494. s32 BTDM_GetRxSS(PADAPTER padapter);
  1495. u8 BTDM_CheckCoexBcnRssiState(PADAPTER padapter, u8 levelNum, u8 RssiThresh, u8 RssiThresh1);
  1496. u8 BTDM_CheckCoexRSSIState1(PADAPTER padapter, u8 levelNum, u8 RssiThresh, u8 RssiThresh1);
  1497. u8 BTDM_CheckCoexRSSIState(PADAPTER padapter, u8 levelNum, u8 RssiThresh, u8 RssiThresh1);
  1498. u8 BTDM_DisableEDCATurbo(PADAPTER padapter);
  1499. #define BT_DisableEDCATurbo BTDM_DisableEDCATurbo
  1500. void BTDM_Balance(PADAPTER padapter, u8 bBalanceOn, u8 ms0, u8 ms1);
  1501. void BTDM_AGCTable(PADAPTER padapter, u8 type);
  1502. void BTDM_BBBackOffLevel(PADAPTER padapter, u8 type);
  1503. void BTDM_FWCoexAllOff(PADAPTER padapter);
  1504. void BTDM_SWCoexAllOff(PADAPTER padapter);
  1505. void BTDM_HWCoexAllOff(PADAPTER padapter);
  1506. void BTDM_CoexAllOff(PADAPTER padapter);
  1507. void BTDM_TurnOffBtCoexistBeforeEnterIPS(PADAPTER padapter);
  1508. void BTDM_SignalCompensation(PADAPTER padapter, u8 *rssi_wifi, u8 *rssi_bt);
  1509. void BTDM_Coexist(PADAPTER padapter);
  1510. #define BT_CoexistMechanism BTDM_Coexist
  1511. void BTDM_UpdateCoexState(PADAPTER padapter);
  1512. u8 BTDM_IsSameCoexistState(PADAPTER padapter);
  1513. void BTDM_PWDBMonitor(PADAPTER padapter);
  1514. u8 BTDM_IsBTBusy(PADAPTER padapter);
  1515. #define BT_IsBtBusy BTDM_IsBTBusy
  1516. u8 BTDM_IsWifiBusy(PADAPTER padapter);
  1517. u8 BTDM_IsCoexistStateChanged(PADAPTER padapter);
  1518. u8 BTDM_IsWifiUplink(PADAPTER padapter);
  1519. u8 BTDM_IsWifiDownlink(PADAPTER padapter);
  1520. u8 BTDM_IsBTHSMode(PADAPTER padapter);
  1521. u8 BTDM_IsBTUplink(PADAPTER padapter);
  1522. u8 BTDM_IsBTDownlink(PADAPTER padapter);
  1523. void BTDM_AdjustForBtOperation(PADAPTER padapter);
  1524. void BTDM_ForHalt(PADAPTER padapter);
  1525. void BTDM_WifiScanNotify(PADAPTER padapter, u8 scanType);
  1526. void BTDM_WifiAssociateNotify(PADAPTER padapter, u8 action);
  1527. void BTDM_MediaStatusNotify(PADAPTER padapter, RT_MEDIA_STATUS mstatus);
  1528. void BTDM_ForDhcp(PADAPTER padapter);
  1529. void BTDM_ResetActionProfileState(PADAPTER padapter);
  1530. void BTDM_SetBtCoexCurrAntNum(PADAPTER padapter, u8 antNum);
  1531. #define BT_SetBtCoexCurrAntNum BTDM_SetBtCoexCurrAntNum
  1532. u8 BTDM_IsActionSCO(PADAPTER padapter);
  1533. u8 BTDM_IsActionHID(PADAPTER padapter);
  1534. u8 BTDM_IsActionA2DP(PADAPTER padapter);
  1535. u8 BTDM_IsActionPAN(PADAPTER padapter);
  1536. u8 BTDM_IsActionHIDA2DP(PADAPTER padapter);
  1537. u8 BTDM_IsActionHIDPAN(PADAPTER padapter);
  1538. u8 BTDM_IsActionPANA2DP(PADAPTER padapter);
  1539. u8 BTDM_IsBtDisabled(PADAPTER padapter);
  1540. #define BT_IsBtDisabled BTDM_IsBtDisabled
  1541. u32 BTDM_BtTxRxCounterH(PADAPTER padapter);
  1542. u32 BTDM_BtTxRxCounterL(PADAPTER padapter);
  1543. // ===== End of sync from SD7 driver HAL/BTCoexist/HalBtCoexist.h =====
  1544. #endif // __HALBTCOEXIST_C__
  1545. #ifdef __HALBT_C__ // HAL/HalBT.h
  1546. // ===== Below this line is sync from SD7 driver HAL/HalBT.h =====
  1547. #define RTS_CTS_NO_LEN_LIMIT 0
  1548. u8 HALBT_GetPGAntNum(PADAPTER padapter);
  1549. #define BT_GetPGAntNum HALBT_GetPGAntNum
  1550. void HALBT_SetKey(PADAPTER padapter, u8 EntryNum);
  1551. void HALBT_RemoveKey(PADAPTER padapter, u8 EntryNum);
  1552. void HALBT_InitBTVars8723A(PADAPTER padapter);
  1553. #define HALBT_InitHalVars HALBT_InitBTVars8723A
  1554. #define BT_InitHalVars HALBT_InitHalVars
  1555. u8 HALBT_IsBTExist(PADAPTER padapter);
  1556. #define BT_IsBtExist HALBT_IsBTExist
  1557. u8 HALBT_BTChipType(PADAPTER padapter);
  1558. void HALBT_InitHwConfig(PADAPTER padapter);
  1559. #define BT_InitHwConfig HALBT_InitHwConfig
  1560. void HALBT_SetRtsCtsNoLenLimit(PADAPTER padapter);
  1561. // ===== End of sync from SD7 driver HAL/HalBT.c =====
  1562. #endif // __HALBT_C__
  1563. #define _bt_dbg_off_ 0
  1564. #define _bt_dbg_on_ 1
  1565. extern u32 BTCoexDbgLevel;
  1566. #endif // __RTL8723A_BT_COEXIST_H__