rtl8723b_bt-coexist.h 56 KB

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