bt.h 99 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076
  1. /* SPDX-License-Identifier: LGPL-2.1-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2011-2014 Intel Corporation
  7. * Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
  8. *
  9. *
  10. */
  11. #include <stdint.h>
  12. #define BT_HCI_CMD_BIT(_byte, _bit) ((8 * _byte) + _bit)
  13. struct bt_ll_hdr {
  14. uint8_t preamble;
  15. uint32_t access_addr;
  16. } __attribute__ ((packed));
  17. #define BT_LL_CONN_UPDATE_REQ 0x00
  18. struct bt_ll_conn_update_req {
  19. uint8_t win_size;
  20. uint16_t win_offset;
  21. uint16_t interval;
  22. uint16_t latency;
  23. uint16_t timeout;
  24. uint16_t instant;
  25. } __attribute__ ((packed));
  26. #define BT_LL_CHANNEL_MAP_REQ 0x01
  27. struct bt_ll_channel_map_req {
  28. uint8_t map[5];
  29. uint16_t instant;
  30. } __attribute__ ((packed));
  31. #define BT_LL_TERMINATE_IND 0x02
  32. struct bt_ll_terminate_ind {
  33. uint8_t error;
  34. } __attribute__ ((packed));
  35. #define BT_LL_ENC_REQ 0x03
  36. struct bt_ll_enc_req {
  37. uint64_t rand;
  38. uint16_t ediv;
  39. uint64_t skd;
  40. uint32_t iv;
  41. } __attribute__ ((packed));
  42. #define BT_LL_ENC_RSP 0x04
  43. struct bt_ll_enc_rsp {
  44. uint64_t skd;
  45. uint32_t iv;
  46. } __attribute__ ((packed));
  47. #define BT_LL_START_ENC_REQ 0x05
  48. #define BT_LL_START_ENC_RSP 0x06
  49. #define BT_LL_UNKNOWN_RSP 0x07
  50. struct bt_ll_unknown_rsp {
  51. uint8_t type;
  52. } __attribute__ ((packed));
  53. #define BT_LL_FEATURE_REQ 0x08
  54. struct bt_ll_feature_req {
  55. uint8_t features[8];
  56. } __attribute__ ((packed));
  57. #define BT_LL_FEATURE_RSP 0x09
  58. struct bt_ll_feature_rsp {
  59. uint8_t features[8];
  60. } __attribute__ ((packed));
  61. #define BT_LL_PAUSE_ENC_REQ 0x0a
  62. #define BT_LL_PAUSE_ENC_RSP 0x0b
  63. #define BT_LL_VERSION_IND 0x0c
  64. struct bt_ll_version_ind {
  65. uint8_t version;
  66. uint16_t company;
  67. uint16_t subversion;
  68. } __attribute__ ((packed));
  69. #define BT_LL_REJECT_IND 0x0d
  70. struct bt_ll_reject_ind {
  71. uint8_t error;
  72. } __attribute__ ((packed));
  73. #define BT_LL_PERIPHERAL_FEATURE_REQ 0x0e
  74. struct bt_ll_peripheral_feature_req {
  75. uint8_t features[8];
  76. } __attribute__ ((packed));
  77. #define BT_LL_CONN_PARAM_REQ 0x0f
  78. #define BT_LL_CONN_PARAM_RSP 0x10
  79. #define BT_LL_REJECT_IND_EXT 0x11
  80. struct bt_ll_reject_ind_ext {
  81. uint8_t opcode;
  82. uint8_t error;
  83. } __attribute__ ((packed));
  84. #define BT_LL_PING_REQ 0x12
  85. #define BT_LL_PING_RSP 0x13
  86. #define BT_LL_LENGTH_REQ 0x14
  87. struct bt_ll_length {
  88. uint16_t rx_len;
  89. uint16_t rx_time;
  90. uint16_t tx_len;
  91. uint16_t tx_time;
  92. } __attribute__ ((packed));
  93. #define BT_LL_LENGTH_RSP 0x15
  94. #define BT_LL_PHY_REQ 0x16
  95. struct bt_ll_phy {
  96. uint8_t tx_phys;
  97. uint8_t rx_phys;
  98. } __attribute__ ((packed));
  99. #define BT_LL_PHY_RSP 0x17
  100. #define BT_LL_PHY_UPDATE_IND 0x18
  101. struct bt_ll_phy_update_ind {
  102. uint8_t c_phy;
  103. uint8_t p_phy;
  104. uint16_t instant;
  105. } __attribute__ ((packed));
  106. #define BT_LL_MIN_USED_CHANNELS 0x19
  107. struct bt_ll_min_used_channels {
  108. uint8_t phys;
  109. uint8_t min_channels;
  110. } __attribute__ ((packed));
  111. #define BT_LL_CTE_REQ 0x1a
  112. struct bt_ll_cte_req {
  113. uint8_t cte;
  114. } __attribute__ ((packed));
  115. #define BT_LL_CTE_RSP 0x1b
  116. #define BT_LL_PERIODIC_SYNC_IND 0x1c
  117. struct bt_ll_periodic_sync_ind {
  118. uint16_t id;
  119. uint8_t info[18];
  120. uint16_t event_count;
  121. uint16_t last_counter;
  122. uint8_t adv_info;
  123. uint8_t phy;
  124. uint8_t adv_addr[6];
  125. uint16_t sync_counter;
  126. } __attribute__ ((packed));
  127. #define BT_LL_CLOCK_ACCURACY_REQ 0x1d
  128. struct bt_ll_clock_acc {
  129. uint8_t sca;
  130. } __attribute__ ((packed));
  131. #define BT_LL_CLOCK_ACCURACY_RSP 0x1e
  132. #define BT_LL_CIS_REQ 0x1f
  133. struct bt_ll_cis_req {
  134. uint8_t cig;
  135. uint8_t cis;
  136. uint8_t c_phy;
  137. uint8_t p_phy;
  138. uint16_t c_sdu;
  139. uint16_t p_sdu;
  140. uint8_t c_interval[3];
  141. uint8_t p_interval[3];
  142. uint8_t c_pdu;
  143. uint8_t p_pdu;
  144. uint8_t nse;
  145. uint8_t sub_interval[3];
  146. uint8_t bn;
  147. uint8_t c_ft;
  148. uint8_t p_ft;
  149. uint16_t iso_interval;
  150. uint8_t offset_min[3];
  151. uint8_t offset_max[3];
  152. uint16_t conn_event_count;
  153. } __attribute__ ((packed));
  154. #define BT_LL_CIS_RSP 0x20
  155. struct bt_ll_cis_rsp {
  156. uint8_t offset_min[3];
  157. uint8_t offset_max[3];
  158. uint16_t conn_event_count;
  159. } __attribute__ ((packed));
  160. #define BT_LL_CIS_IND 0x21
  161. struct bt_ll_cis_ind {
  162. uint32_t addr;
  163. uint8_t cis_offset[3];
  164. uint8_t cig_sync_delay[3];
  165. uint8_t cis_sync_delay[3];
  166. uint16_t conn_event_count;
  167. } __attribute__ ((packed));
  168. #define BT_LL_CIS_TERMINATE_IND 0x22
  169. struct bt_ll_cis_term_ind {
  170. uint8_t cig;
  171. uint8_t cis;
  172. uint8_t reason;
  173. } __attribute__ ((packed));
  174. #define LMP_ESC4(x) ((127 << 8) | (x))
  175. #define BT_LMP_NAME_REQ 1
  176. struct bt_lmp_name_req {
  177. uint8_t offset;
  178. } __attribute__ ((packed));
  179. #define BT_LMP_NAME_RSP 2
  180. struct bt_lmp_name_rsp {
  181. uint8_t offset;
  182. uint8_t length;
  183. uint8_t fragment[14];
  184. } __attribute__ ((packed));
  185. #define BT_LMP_ACCEPTED 3
  186. struct bt_lmp_accepted {
  187. uint8_t opcode;
  188. } __attribute__ ((packed));
  189. #define BT_LMP_NOT_ACCEPTED 4
  190. struct bt_lmp_not_accepted {
  191. uint8_t opcode;
  192. uint8_t error;
  193. } __attribute__ ((packed));
  194. #define BT_LMP_CLKOFFSET_REQ 5
  195. #define BT_LMP_CLKOFFSET_RSP 6
  196. struct bt_lmp_clkoffset_rsp {
  197. uint16_t offset;
  198. } __attribute__ ((packed));
  199. #define BT_LMP_DETACH 7
  200. struct bt_lmp_detach {
  201. uint8_t error;
  202. } __attribute__ ((packed));
  203. #define BT_LMP_AU_RAND 11
  204. struct bt_lmp_au_rand {
  205. uint8_t number[16];
  206. } __attribute__ ((packed));
  207. #define BT_LMP_SRES 12
  208. struct bt_lmp_sres {
  209. uint8_t response[4];
  210. } __attribute__ ((packed));
  211. #define BT_LMP_ENCRYPTION_MODE_REQ 15
  212. struct bt_lmp_encryption_mode_req {
  213. uint8_t mode;
  214. } __attribute__ ((packed));
  215. #define BT_LMP_ENCRYPTION_KEY_SIZE_REQ 16
  216. struct bt_lmp_encryption_key_size_req {
  217. uint8_t key_size;
  218. } __attribute__ ((packed));
  219. #define BT_LMP_START_ENCRYPTION_REQ 17
  220. struct bt_lmp_start_encryption_req {
  221. uint8_t number[16];
  222. } __attribute__ ((packed));
  223. #define BT_LMP_STOP_ENCRYPTION_REQ 18
  224. #define BT_LMP_SWITCH_REQ 19
  225. struct bt_lmp_switch_req {
  226. uint32_t instant;
  227. } __attribute__ ((packed));
  228. #define BT_LMP_UNSNIFF_REQ 24
  229. #define BT_LMP_MAX_POWER 33
  230. #define BT_LMP_MIN_POWER 34
  231. #define BT_LMP_AUTO_RATE 35
  232. #define BT_LMP_PREFERRED_RATE 36
  233. struct bt_lmp_preferred_rate {
  234. uint8_t rate;
  235. } __attribute__ ((packed));
  236. #define BT_LMP_VERSION_REQ 37
  237. struct bt_lmp_version_req {
  238. uint8_t version;
  239. uint16_t company;
  240. uint16_t subversion;
  241. } __attribute__ ((packed));
  242. #define BT_LMP_VERSION_RES 38
  243. struct bt_lmp_version_res {
  244. uint8_t version;
  245. uint16_t company;
  246. uint16_t subversion;
  247. } __attribute__ ((packed));
  248. #define BT_LMP_FEATURES_REQ 39
  249. struct bt_lmp_features_req {
  250. uint8_t features[8];
  251. } __attribute__ ((packed));
  252. #define BT_LMP_FEATURES_RES 40
  253. struct bt_lmp_features_res {
  254. uint8_t features[8];
  255. } __attribute__ ((packed));
  256. #define BT_LMP_MAX_SLOT 45
  257. struct bt_lmp_max_slot {
  258. uint8_t slots;
  259. } __attribute__ ((packed));
  260. #define BT_LMP_MAX_SLOT_REQ 46
  261. struct bt_lmp_max_slot_req {
  262. uint8_t slots;
  263. } __attribute__ ((packed));
  264. #define BT_LMP_TIMING_ACCURACY_REQ 47
  265. #define BT_LMP_TIMING_ACCURACY_RES 48
  266. struct bt_lmp_timing_accuracy_res {
  267. uint8_t drift;
  268. uint8_t jitter;
  269. } __attribute__ ((packed));
  270. #define BT_LMP_SETUP_COMPLETE 49
  271. #define BT_LMP_USE_SEMI_PERMANENT_KEY 50
  272. #define BT_LMP_HOST_CONNECTION_REQ 51
  273. #define BT_LMP_SLOT_OFFSET 52
  274. struct bt_lmp_slot_offset {
  275. uint16_t offset;
  276. uint8_t bdaddr[6];
  277. } __attribute__ ((packed));
  278. #define BT_LMP_PAGE_SCAN_MODE_REQ 54
  279. struct bt_lmp_page_scan_mode_req {
  280. uint8_t scheme;
  281. uint8_t settings;
  282. } __attribute__ ((packed));
  283. #define BT_LMP_TEST_ACTIVATE 56
  284. #define BT_LMP_ENCRYPTION_KEY_SIZE_MASK_REQ 58
  285. #define BT_LMP_SET_AFH 60
  286. struct bt_lmp_set_afh {
  287. uint32_t instant;
  288. uint8_t mode;
  289. uint8_t map[10];
  290. } __attribute__ ((packed));
  291. #define BT_LMP_ENCAPSULATED_HEADER 61
  292. struct bt_lmp_encapsulated_header {
  293. uint8_t major;
  294. uint8_t minor;
  295. uint8_t length;
  296. } __attribute__ ((packed));
  297. #define BT_LMP_ENCAPSULATED_PAYLOAD 62
  298. struct bt_lmp_encapsulated_payload {
  299. uint8_t data[16];
  300. } __attribute__ ((packed));
  301. #define BT_LMP_SIMPLE_PAIRING_CONFIRM 63
  302. struct bt_lmp_simple_pairing_confirm {
  303. uint8_t value[16];
  304. } __attribute__ ((packed));
  305. #define BT_LMP_SIMPLE_PAIRING_NUMBER 64
  306. struct bt_lmp_simple_pairing_number {
  307. uint8_t value[16];
  308. } __attribute__ ((packed));
  309. #define BT_LMP_DHKEY_CHECK 65
  310. struct bt_lmp_dhkey_check {
  311. uint8_t value[16];
  312. } __attribute__ ((packed));
  313. #define BT_LMP_PAUSE_ENCRYPTION_AES_REQ 66
  314. #define BT_LMP_ACCEPTED_EXT LMP_ESC4(1)
  315. struct bt_lmp_accepted_ext {
  316. uint8_t escape;
  317. uint8_t opcode;
  318. } __attribute__ ((packed));
  319. #define BT_LMP_NOT_ACCEPTED_EXT LMP_ESC4(2)
  320. struct bt_lmp_not_accepted_ext {
  321. uint8_t escape;
  322. uint8_t opcode;
  323. uint8_t error;
  324. } __attribute__ ((packed));
  325. #define BT_LMP_FEATURES_REQ_EXT LMP_ESC4(3)
  326. struct bt_lmp_features_req_ext {
  327. uint8_t page;
  328. uint8_t max_page;
  329. uint8_t features[8];
  330. } __attribute__ ((packed));
  331. #define BT_LMP_FEATURES_RES_EXT LMP_ESC4(4)
  332. struct bt_lmp_features_res_ext {
  333. uint8_t page;
  334. uint8_t max_page;
  335. uint8_t features[8];
  336. } __attribute__ ((packed));
  337. #define BT_LMP_PACKET_TYPE_TABLE_REQ LMP_ESC4(11)
  338. struct bt_lmp_packet_type_table_req {
  339. uint8_t table;
  340. } __attribute__ ((packed));
  341. #define BT_LMP_CHANNEL_CLASSIFICATION_REQ LMP_ESC4(16)
  342. struct bt_lmp_channel_classification_req {
  343. uint8_t mode;
  344. uint16_t min_interval;
  345. uint16_t max_interval;
  346. } __attribute__ ((packed));
  347. #define BT_LMP_CHANNEL_CLASSIFICATION LMP_ESC4(17)
  348. struct bt_lmp_channel_classification {
  349. uint8_t classification[10];
  350. } __attribute__ ((packed));
  351. #define BT_LMP_PAUSE_ENCRYPTION_REQ LMP_ESC4(23)
  352. #define BT_LMP_RESUME_ENCRYPTION_REQ LMP_ESC4(24)
  353. #define BT_LMP_IO_CAPABILITY_REQ LMP_ESC4(25)
  354. struct bt_lmp_io_capability_req {
  355. uint8_t capability;
  356. uint8_t oob_data;
  357. uint8_t authentication;
  358. } __attribute__ ((packed));
  359. #define BT_LMP_IO_CAPABILITY_RES LMP_ESC4(26)
  360. struct bt_lmp_io_capability_res {
  361. uint8_t capability;
  362. uint8_t oob_data;
  363. uint8_t authentication;
  364. } __attribute__ ((packed));
  365. #define BT_LMP_NUMERIC_COMPARISON_FAILED LMP_ESC(27)
  366. #define BT_LMP_PASSKEY_FAILED LMP_ESC4(28)
  367. #define BT_LMP_OOB_FAILED LMP_ESC(29)
  368. #define BT_LMP_POWER_CONTROL_REQ LMP_ESC4(31)
  369. struct bt_lmp_power_control_req {
  370. uint8_t request;
  371. } __attribute__ ((packed));
  372. #define BT_LMP_POWER_CONTROL_RES LMP_ESC4(32)
  373. struct bt_lmp_power_control_res {
  374. uint8_t response;
  375. } __attribute__ ((packed));
  376. #define BT_LMP_PING_REQ LMP_ESC4(33)
  377. #define BT_LMP_PING_RES LMP_ESC4(34)
  378. #define BT_H4_CMD_PKT 0x01
  379. #define BT_H4_ACL_PKT 0x02
  380. #define BT_H4_SCO_PKT 0x03
  381. #define BT_H4_EVT_PKT 0x04
  382. #define BT_H4_ISO_PKT 0x05
  383. struct bt_hci_cmd_hdr {
  384. uint16_t opcode;
  385. uint8_t plen;
  386. } __attribute__ ((packed));
  387. struct bt_hci_acl_hdr {
  388. uint16_t handle;
  389. uint16_t dlen;
  390. } __attribute__ ((packed));
  391. struct bt_hci_sco_hdr {
  392. uint16_t handle;
  393. uint8_t dlen;
  394. } __attribute__ ((packed));
  395. struct bt_hci_iso_hdr {
  396. uint16_t handle;
  397. uint16_t dlen;
  398. } __attribute__ ((packed));
  399. struct bt_hci_iso_data_start {
  400. uint16_t sn;
  401. uint16_t slen;
  402. } __attribute__ ((packed));
  403. struct bt_hci_evt_hdr {
  404. uint8_t evt;
  405. uint8_t plen;
  406. } __attribute__ ((packed));
  407. #define BT_HCI_CMD_NOP 0x0000
  408. #define BT_HCI_CMD_INQUIRY 0x0401
  409. struct bt_hci_cmd_inquiry {
  410. uint8_t lap[3];
  411. uint8_t length;
  412. uint8_t num_resp;
  413. } __attribute__ ((packed));
  414. #define BT_HCI_CMD_INQUIRY_CANCEL 0x0402
  415. #define BT_HCI_CMD_PERIODIC_INQUIRY 0x0403
  416. struct bt_hci_cmd_periodic_inquiry {
  417. uint16_t max_period;
  418. uint16_t min_period;
  419. uint8_t lap[3];
  420. uint8_t length;
  421. uint8_t num_resp;
  422. } __attribute__ ((packed));
  423. #define BT_HCI_CMD_EXIT_PERIODIC_INQUIRY 0x0404
  424. #define BT_HCI_CMD_CREATE_CONN 0x0405
  425. struct bt_hci_cmd_create_conn {
  426. uint8_t bdaddr[6];
  427. uint16_t pkt_type;
  428. uint8_t pscan_rep_mode;
  429. uint8_t pscan_mode;
  430. uint16_t clock_offset;
  431. uint8_t role_switch;
  432. } __attribute__ ((packed));
  433. #define BT_HCI_CMD_DISCONNECT 0x0406
  434. struct bt_hci_cmd_disconnect {
  435. uint16_t handle;
  436. uint8_t reason;
  437. } __attribute__ ((packed));
  438. #define BT_HCI_CMD_ADD_SCO_CONN 0x0407
  439. struct bt_hci_cmd_add_sco_conn {
  440. uint16_t handle;
  441. uint16_t pkt_type;
  442. } __attribute__ ((packed));
  443. #define BT_HCI_CMD_CREATE_CONN_CANCEL 0x0408
  444. struct bt_hci_cmd_create_conn_cancel {
  445. uint8_t bdaddr[6];
  446. } __attribute__ ((packed));
  447. #define BT_HCI_CMD_ACCEPT_CONN_REQUEST 0x0409
  448. struct bt_hci_cmd_accept_conn_request {
  449. uint8_t bdaddr[6];
  450. uint8_t role;
  451. } __attribute__ ((packed));
  452. #define BT_HCI_CMD_REJECT_CONN_REQUEST 0x040a
  453. struct bt_hci_cmd_reject_conn_request {
  454. uint8_t bdaddr[6];
  455. uint8_t reason;
  456. } __attribute__ ((packed));
  457. #define BT_HCI_CMD_LINK_KEY_REQUEST_REPLY 0x040b
  458. struct bt_hci_cmd_link_key_request_reply {
  459. uint8_t bdaddr[6];
  460. uint8_t link_key[16];
  461. } __attribute__ ((packed));
  462. struct bt_hci_rsp_link_key_request_reply {
  463. uint8_t status;
  464. uint8_t bdaddr[6];
  465. } __attribute__ ((packed));
  466. #define BT_HCI_CMD_LINK_KEY_REQUEST_NEG_REPLY 0x040c
  467. struct bt_hci_cmd_link_key_request_neg_reply {
  468. uint8_t bdaddr[6];
  469. } __attribute__ ((packed));
  470. struct bt_hci_rsp_link_key_request_neg_reply {
  471. uint8_t status;
  472. uint8_t bdaddr[6];
  473. } __attribute__ ((packed));
  474. #define BT_HCI_CMD_PIN_CODE_REQUEST_REPLY 0x040d
  475. struct bt_hci_cmd_pin_code_request_reply {
  476. uint8_t bdaddr[6];
  477. uint8_t pin_len;
  478. uint8_t pin_code[16];
  479. } __attribute__ ((packed));
  480. #define BT_HCI_CMD_PIN_CODE_REQUEST_NEG_REPLY 0x040e
  481. struct bt_hci_cmd_pin_code_request_neg_reply {
  482. uint8_t bdaddr[6];
  483. } __attribute__ ((packed));
  484. struct bt_hci_rsp_pin_code_request_neg_reply {
  485. uint8_t status;
  486. uint8_t bdaddr[6];
  487. } __attribute__ ((packed));
  488. #define BT_HCI_CMD_CHANGE_CONN_PKT_TYPE 0x040f
  489. struct bt_hci_cmd_change_conn_pkt_type {
  490. uint16_t handle;
  491. uint16_t pkt_type;
  492. } __attribute__ ((packed));
  493. #define BT_HCI_CMD_AUTH_REQUESTED 0x0411
  494. struct bt_hci_cmd_auth_requested {
  495. uint16_t handle;
  496. } __attribute__ ((packed));
  497. #define BT_HCI_CMD_SET_CONN_ENCRYPT 0x0413
  498. struct bt_hci_cmd_set_conn_encrypt {
  499. uint16_t handle;
  500. uint8_t encr_mode;
  501. } __attribute__ ((packed));
  502. #define BT_HCI_CMD_CHANGE_CONN_LINK_KEY 0x0415
  503. struct bt_hci_cmd_change_conn_link_key {
  504. uint16_t handle;
  505. } __attribute__ ((packed));
  506. #define BT_HCI_CMD_LINK_KEY_SELECTION 0x0417
  507. struct bt_hci_cmd_link_key_selection {
  508. uint8_t key_flag;
  509. } __attribute__ ((packed));
  510. #define BT_HCI_CMD_REMOTE_NAME_REQUEST 0x0419
  511. struct bt_hci_cmd_remote_name_request {
  512. uint8_t bdaddr[6];
  513. uint8_t pscan_rep_mode;
  514. uint8_t pscan_mode;
  515. uint16_t clock_offset;
  516. } __attribute__ ((packed));
  517. #define BT_HCI_CMD_REMOTE_NAME_REQUEST_CANCEL 0x041a
  518. struct bt_hci_cmd_remote_name_request_cancel {
  519. uint8_t bdaddr[6];
  520. } __attribute__ ((packed));
  521. struct bt_hci_rsp_remote_name_request_cancel {
  522. uint8_t status;
  523. uint8_t bdaddr[6];
  524. } __attribute__ ((packed));
  525. #define BT_HCI_CMD_READ_REMOTE_FEATURES 0x041b
  526. struct bt_hci_cmd_read_remote_features {
  527. uint16_t handle;
  528. } __attribute__ ((packed));
  529. #define BT_HCI_CMD_READ_REMOTE_EXT_FEATURES 0x041c
  530. struct bt_hci_cmd_read_remote_ext_features {
  531. uint16_t handle;
  532. uint8_t page;
  533. } __attribute__ ((packed));
  534. #define BT_HCI_CMD_READ_REMOTE_VERSION 0x041d
  535. struct bt_hci_cmd_read_remote_version {
  536. uint16_t handle;
  537. } __attribute__ ((packed));
  538. #define BT_HCI_CMD_READ_CLOCK_OFFSET 0x041f
  539. struct bt_hci_cmd_read_clock_offset {
  540. uint16_t handle;
  541. } __attribute__ ((packed));
  542. #define BT_HCI_CMD_READ_LMP_HANDLE 0x0420
  543. struct bt_hci_cmd_read_lmp_handle {
  544. uint16_t handle;
  545. } __attribute__ ((packed));
  546. struct bt_hci_rsp_read_lmp_handle {
  547. uint8_t status;
  548. uint16_t handle;
  549. uint8_t lmp_handle;
  550. uint32_t reserved;
  551. } __attribute__ ((packed));
  552. #define BT_HCI_CMD_SETUP_SYNC_CONN 0x0428
  553. struct bt_hci_cmd_setup_sync_conn {
  554. uint16_t handle;
  555. uint32_t tx_bandwidth;
  556. uint32_t rx_bandwidth;
  557. uint16_t max_latency;
  558. uint16_t voice_setting;
  559. uint8_t retrans_effort;
  560. uint16_t pkt_type;
  561. } __attribute__ ((packed));
  562. #define BT_HCI_CMD_ACCEPT_SYNC_CONN_REQUEST 0x0429
  563. struct bt_hci_cmd_accept_sync_conn_request {
  564. uint8_t bdaddr[6];
  565. uint32_t tx_bandwidth;
  566. uint32_t rx_bandwidth;
  567. uint16_t max_latency;
  568. uint16_t voice_setting;
  569. uint8_t retrans_effort;
  570. uint16_t pkt_type;
  571. } __attribute__ ((packed));
  572. #define BT_HCI_CMD_REJECT_SYNC_CONN_REQUEST 0x042a
  573. struct bt_hci_cmd_reject_sync_conn_request {
  574. uint8_t bdaddr[6];
  575. uint8_t reason;
  576. } __attribute__ ((packed));
  577. #define BT_HCI_CMD_IO_CAPABILITY_REQUEST_REPLY 0x042b
  578. struct bt_hci_cmd_io_capability_request_reply {
  579. uint8_t bdaddr[6];
  580. uint8_t capability;
  581. uint8_t oob_data;
  582. uint8_t authentication;
  583. } __attribute__ ((packed));
  584. struct bt_hci_rsp_io_capability_request_reply {
  585. uint8_t status;
  586. uint8_t bdaddr[6];
  587. } __attribute__ ((packed));
  588. #define BT_HCI_CMD_USER_CONFIRM_REQUEST_REPLY 0x042c
  589. struct bt_hci_cmd_user_confirm_request_reply {
  590. uint8_t bdaddr[6];
  591. } __attribute__ ((packed));
  592. struct bt_hci_rsp_user_confirm_request_reply {
  593. uint8_t status;
  594. uint8_t bdaddr[6];
  595. } __attribute__ ((packed));
  596. #define BT_HCI_CMD_USER_CONFIRM_REQUEST_NEG_REPLY 0x042d
  597. struct bt_hci_cmd_user_confirm_request_neg_reply {
  598. uint8_t bdaddr[6];
  599. } __attribute__ ((packed));
  600. struct bt_hci_rsp_user_confirm_request_neg_reply {
  601. uint8_t status;
  602. uint8_t bdaddr[6];
  603. } __attribute__ ((packed));
  604. #define BT_HCI_CMD_USER_PASSKEY_REQUEST_REPLY 0x042e
  605. struct bt_hci_cmd_user_passkey_request_reply {
  606. uint8_t bdaddr[6];
  607. uint32_t passkey;
  608. } __attribute__ ((packed));
  609. #define BT_HCI_CMD_USER_PASSKEY_REQUEST_NEG_REPLY 0x042f
  610. struct bt_hci_cmd_user_passkey_request_neg_reply {
  611. uint8_t bdaddr[6];
  612. } __attribute__ ((packed));
  613. #define BT_HCI_CMD_REMOTE_OOB_DATA_REQUEST_REPLY 0x0430
  614. struct bt_hci_cmd_remote_oob_data_request_reply {
  615. uint8_t bdaddr[6];
  616. uint8_t hash[16];
  617. uint8_t randomizer[16];
  618. } __attribute__ ((packed));
  619. #define BT_HCI_CMD_REMOTE_OOB_DATA_REQUEST_NEG_REPLY 0x0433
  620. struct bt_hci_cmd_remote_oob_data_request_neg_reply {
  621. uint8_t bdaddr[6];
  622. } __attribute__ ((packed));
  623. #define BT_HCI_CMD_IO_CAPABILITY_REQUEST_NEG_REPLY 0x0434
  624. struct bt_hci_cmd_io_capability_request_neg_reply {
  625. uint8_t bdaddr[6];
  626. uint8_t reason;
  627. } __attribute__ ((packed));
  628. struct bt_hci_rsp_io_capability_request_neg_reply {
  629. uint8_t status;
  630. uint8_t bdaddr[6];
  631. } __attribute__ ((packed));
  632. #define BT_HCI_CMD_CREATE_PHY_LINK 0x0435
  633. struct bt_hci_cmd_create_phy_link {
  634. uint8_t phy_handle;
  635. uint8_t key_len;
  636. uint8_t key_type;
  637. } __attribute__ ((packed));
  638. #define BT_HCI_CMD_ACCEPT_PHY_LINK 0x0436
  639. struct bt_hci_cmd_accept_phy_link {
  640. uint8_t phy_handle;
  641. uint8_t key_len;
  642. uint8_t key_type;
  643. } __attribute__ ((packed));
  644. #define BT_HCI_CMD_DISCONN_PHY_LINK 0x0437
  645. struct bt_hci_cmd_disconn_phy_link {
  646. uint8_t phy_handle;
  647. uint8_t reason;
  648. } __attribute__ ((packed));
  649. #define BT_HCI_CMD_CREATE_LOGIC_LINK 0x0438
  650. struct bt_hci_cmd_create_logic_link {
  651. uint8_t phy_handle;
  652. uint8_t tx_flow_spec[16];
  653. uint8_t rx_flow_spec[16];
  654. } __attribute__ ((packed));
  655. #define BT_HCI_CMD_ACCEPT_LOGIC_LINK 0x0439
  656. struct bt_hci_cmd_accept_logic_link {
  657. uint8_t phy_handle;
  658. uint8_t tx_flow_spec[16];
  659. uint8_t rx_flow_spec[16];
  660. } __attribute__ ((packed));
  661. #define BT_HCI_CMD_DISCONN_LOGIC_LINK 0x043a
  662. struct bt_hci_cmd_disconn_logic_link {
  663. uint16_t handle;
  664. } __attribute__ ((packed));
  665. #define BT_HCI_CMD_LOGIC_LINK_CANCEL 0x043b
  666. struct bt_hci_cmd_logic_link_cancel {
  667. uint8_t phy_handle;
  668. uint8_t flow_spec;
  669. } __attribute__ ((packed));
  670. struct bt_hci_rsp_logic_link_cancel {
  671. uint8_t status;
  672. uint8_t phy_handle;
  673. uint8_t flow_spec;
  674. } __attribute__ ((packed));
  675. #define BT_HCI_CMD_FLOW_SPEC_MODIFY 0x043c
  676. struct bt_hci_cmd_flow_spec_modify {
  677. uint16_t handle;
  678. uint8_t tx_flow_spec[16];
  679. uint8_t rx_flow_spec[16];
  680. } __attribute__ ((packed));
  681. #define BT_HCI_CMD_ENHANCED_SETUP_SYNC_CONN 0x043d
  682. struct bt_hci_cmd_enhanced_setup_sync_conn {
  683. uint16_t handle;
  684. uint32_t tx_bandwidth;
  685. uint32_t rx_bandwidth;
  686. uint8_t tx_coding_format[5];
  687. uint8_t rx_coding_format[5];
  688. uint16_t tx_codec_frame_size;
  689. uint16_t rx_codec_frame_size;
  690. uint32_t input_bandwidth;
  691. uint32_t output_bandwidth;
  692. uint8_t input_coding_format[5];
  693. uint8_t output_coding_format[5];
  694. uint16_t input_coded_data_size;
  695. uint16_t output_coded_data_size;
  696. uint8_t input_pcm_data_format;
  697. uint8_t output_pcm_data_format;
  698. uint8_t input_pcm_msb_position;
  699. uint8_t output_pcm_msb_position;
  700. uint8_t input_data_path;
  701. uint8_t output_data_path;
  702. uint8_t input_unit_size;
  703. uint8_t output_unit_size;
  704. uint16_t max_latency;
  705. uint16_t pkt_type;
  706. uint8_t retrans_effort;
  707. } __attribute__ ((packed));
  708. #define BT_HCI_CMD_ENHANCED_ACCEPT_SYNC_CONN_REQUEST 0x043e
  709. struct bt_hci_cmd_enhanced_accept_sync_conn_request {
  710. uint8_t bdaddr[6];
  711. uint32_t tx_bandwidth;
  712. uint32_t rx_bandwidth;
  713. uint8_t tx_coding_format[5];
  714. uint8_t rx_coding_format[5];
  715. uint16_t tx_codec_frame_size;
  716. uint16_t rx_codec_frame_size;
  717. uint32_t input_bandwidth;
  718. uint32_t output_bandwidth;
  719. uint8_t input_coding_format[5];
  720. uint8_t output_coding_format[5];
  721. uint16_t input_coded_data_size;
  722. uint16_t output_coded_data_size;
  723. uint8_t input_pcm_data_format;
  724. uint8_t output_pcm_data_format;
  725. uint8_t input_pcm_msb_position;
  726. uint8_t output_pcm_msb_position;
  727. uint8_t input_data_path;
  728. uint8_t output_data_path;
  729. uint8_t input_unit_size;
  730. uint8_t output_unit_size;
  731. uint16_t max_latency;
  732. uint16_t pkt_type;
  733. uint8_t retrans_effort;
  734. } __attribute__ ((packed));
  735. #define BT_HCI_CMD_TRUNCATED_PAGE 0x043f
  736. struct bt_hci_cmd_truncated_page {
  737. uint8_t bdaddr[6];
  738. uint8_t pscan_rep_mode;
  739. uint16_t clock_offset;
  740. } __attribute__ ((packed));
  741. #define BT_HCI_CMD_TRUNCATED_PAGE_CANCEL 0x0440
  742. struct bt_hci_cmd_truncated_page_cancel {
  743. uint8_t bdaddr[6];
  744. } __attribute__ ((packed));
  745. #define BT_HCI_CMD_SET_PERIPHERAL_BROADCAST 0x0441
  746. struct bt_hci_cmd_set_peripheral_broadcast {
  747. uint8_t enable;
  748. uint8_t lt_addr;
  749. uint8_t lpo_allowed;
  750. uint16_t pkt_type;
  751. uint16_t min_interval;
  752. uint16_t max_interval;
  753. uint16_t timeout;
  754. } __attribute__ ((packed));
  755. struct bt_hci_rsp_set_peripheral_broadcast {
  756. uint8_t status;
  757. uint8_t lt_addr;
  758. uint16_t interval;
  759. } __attribute__ ((packed));
  760. #define BT_HCI_CMD_SET_PERIPHERAL_BROADCAST_RECEIVE 0x0442
  761. struct bt_hci_cmd_set_peripheral_broadcast_receive {
  762. uint8_t enable;
  763. uint8_t bdaddr[6];
  764. uint8_t lt_addr;
  765. uint16_t interval;
  766. uint32_t offset;
  767. uint32_t instant;
  768. uint16_t timeout;
  769. uint8_t accuracy;
  770. uint8_t skip;
  771. uint16_t pkt_type;
  772. uint8_t map[10];
  773. } __attribute__ ((packed));
  774. struct bt_hci_rsp_set_peripheral_broadcast_receive {
  775. uint8_t status;
  776. uint8_t bdaddr[6];
  777. uint8_t lt_addr;
  778. } __attribute__ ((packed));
  779. #define BT_HCI_CMD_START_SYNC_TRAIN 0x0443
  780. #define BT_HCI_CMD_RECEIVE_SYNC_TRAIN 0x0444
  781. struct bt_hci_cmd_receive_sync_train {
  782. uint8_t bdaddr[6];
  783. uint16_t timeout;
  784. uint16_t window;
  785. uint16_t interval;
  786. } __attribute__ ((packed));
  787. #define BT_HCI_CMD_REMOTE_OOB_EXT_DATA_REQUEST_REPLY 0x0445
  788. struct bt_hci_cmd_remote_oob_ext_data_request_reply {
  789. uint8_t bdaddr[6];
  790. uint8_t hash192[16];
  791. uint8_t randomizer192[16];
  792. uint8_t hash256[16];
  793. uint8_t randomizer256[16];
  794. } __attribute__ ((packed));
  795. #define BT_HCI_CMD_HOLD_MODE 0x0801
  796. struct bt_hci_cmd_hold_mode {
  797. uint16_t handle;
  798. uint16_t max_interval;
  799. uint16_t min_interval;
  800. } __attribute__ ((packed));
  801. #define BT_HCI_CMD_SNIFF_MODE 0x0803
  802. struct bt_hci_cmd_sniff_mode {
  803. uint16_t handle;
  804. uint16_t max_interval;
  805. uint16_t min_interval;
  806. uint16_t attempt;
  807. uint16_t timeout;
  808. } __attribute__ ((packed));
  809. #define BT_HCI_CMD_EXIT_SNIFF_MODE 0x0804
  810. struct bt_hci_cmd_exit_sniff_mode {
  811. uint16_t handle;
  812. } __attribute__ ((packed));
  813. #define BT_HCI_CMD_PARK_STATE 0x0805
  814. struct bt_hci_cmd_park_state {
  815. uint16_t handle;
  816. uint16_t max_interval;
  817. uint16_t min_interval;
  818. } __attribute__ ((packed));
  819. #define BT_HCI_CMD_EXIT_PARK_STATE 0x0806
  820. struct bt_hci_cmd_exit_park_state {
  821. uint16_t handle;
  822. } __attribute__ ((packed));
  823. #define BT_HCI_CMD_QOS_SETUP 0x0807
  824. struct bt_hci_cmd_qos_setup {
  825. uint16_t handle;
  826. uint8_t flags;
  827. uint8_t service_type;
  828. uint32_t token_rate;
  829. uint32_t peak_bandwidth;
  830. uint32_t latency;
  831. uint32_t delay_variation;
  832. } __attribute__ ((packed));
  833. #define BT_HCI_CMD_ROLE_DISCOVERY 0x0809
  834. struct bt_hci_cmd_role_discovery {
  835. uint16_t handle;
  836. } __attribute__ ((packed));
  837. struct bt_hci_rsp_role_discovery {
  838. uint8_t status;
  839. uint16_t handle;
  840. uint8_t role;
  841. } __attribute__ ((packed));
  842. #define BT_HCI_CMD_SWITCH_ROLE 0x080b
  843. struct bt_hci_cmd_switch_role {
  844. uint8_t bdaddr[6];
  845. uint8_t role;
  846. } __attribute__ ((packed));
  847. #define BT_HCI_CMD_READ_LINK_POLICY 0x080c
  848. struct bt_hci_cmd_read_link_policy {
  849. uint16_t handle;
  850. } __attribute__ ((packed));
  851. struct bt_hci_rsp_read_link_policy {
  852. uint8_t status;
  853. uint16_t handle;
  854. uint16_t policy;
  855. } __attribute__ ((packed));
  856. #define BT_HCI_CMD_WRITE_LINK_POLICY 0x080d
  857. struct bt_hci_cmd_write_link_policy {
  858. uint16_t handle;
  859. uint16_t policy;
  860. } __attribute__ ((packed));
  861. struct bt_hci_rsp_write_link_policy {
  862. uint8_t status;
  863. uint16_t handle;
  864. } __attribute__ ((packed));
  865. #define BT_HCI_CMD_READ_DEFAULT_LINK_POLICY 0x080e
  866. struct bt_hci_rsp_read_default_link_policy {
  867. uint8_t status;
  868. uint16_t policy;
  869. } __attribute__ ((packed));
  870. #define BT_HCI_CMD_WRITE_DEFAULT_LINK_POLICY 0x080f
  871. struct bt_hci_cmd_write_default_link_policy {
  872. uint16_t policy;
  873. } __attribute__ ((packed));
  874. #define BT_HCI_CMD_FLOW_SPEC 0x0810
  875. struct bt_hci_cmd_flow_spec {
  876. uint16_t handle;
  877. uint8_t flags;
  878. uint8_t direction;
  879. uint8_t service_type;
  880. uint32_t token_rate;
  881. uint32_t token_bucket_size;
  882. uint32_t peak_bandwidth;
  883. uint32_t access_latency;
  884. } __attribute__ ((packed));
  885. #define BT_HCI_CMD_SNIFF_SUBRATING 0x0811
  886. struct bt_hci_cmd_sniff_subrating {
  887. uint16_t handle;
  888. uint16_t max_latency;
  889. uint16_t min_remote_timeout;
  890. uint16_t min_local_timeout;
  891. } __attribute__ ((packed));
  892. struct bt_hci_rsp_sniff_subrating {
  893. uint8_t status;
  894. uint16_t handle;
  895. } __attribute__ ((packed));
  896. #define BT_HCI_CMD_SET_EVENT_MASK 0x0c01
  897. struct bt_hci_cmd_set_event_mask {
  898. uint8_t mask[8];
  899. } __attribute__ ((packed));
  900. #define BT_HCI_CMD_RESET 0x0c03
  901. #define BT_HCI_CMD_SET_EVENT_FILTER 0x0c05
  902. struct bt_hci_cmd_set_event_filter {
  903. uint8_t type;
  904. uint8_t cond_type;
  905. uint8_t cond[0];
  906. } __attribute__ ((packed));
  907. #define BT_HCI_CMD_FLUSH 0x0c08
  908. struct bt_hci_cmd_flush {
  909. uint16_t handle;
  910. } __attribute__ ((packed));
  911. struct bt_hci_rsp_flush {
  912. uint8_t status;
  913. uint16_t handle;
  914. } __attribute__ ((packed));
  915. #define BT_HCI_CMD_READ_PIN_TYPE 0x0c09
  916. struct bt_hci_rsp_read_pin_type {
  917. uint8_t status;
  918. uint8_t pin_type;
  919. } __attribute__ ((packed));
  920. #define BT_HCI_CMD_WRITE_PIN_TYPE 0x0c0a
  921. struct bt_hci_cmd_write_pin_type {
  922. uint8_t pin_type;
  923. } __attribute__ ((packed));
  924. #define BT_HCI_CMD_CREATE_NEW_UNIT_KEY 0x0c0b
  925. #define BT_HCI_CMD_READ_STORED_LINK_KEY 0x0c0d
  926. struct bt_hci_cmd_read_stored_link_key {
  927. uint8_t bdaddr[6];
  928. uint8_t read_all;
  929. } __attribute__ ((packed));
  930. struct bt_hci_rsp_read_stored_link_key {
  931. uint8_t status;
  932. uint16_t max_num_keys;
  933. uint16_t num_keys;
  934. } __attribute__ ((packed));
  935. #define BT_HCI_CMD_WRITE_STORED_LINK_KEY 0x0c11
  936. struct bt_hci_cmd_write_stored_link_key {
  937. uint8_t num_keys;
  938. } __attribute__ ((packed));
  939. struct bt_hci_rsp_write_stored_link_key {
  940. uint8_t status;
  941. uint8_t num_keys;
  942. } __attribute__ ((packed));
  943. #define BT_HCI_CMD_DELETE_STORED_LINK_KEY 0x0c12
  944. struct bt_hci_cmd_delete_stored_link_key {
  945. uint8_t bdaddr[6];
  946. uint8_t delete_all;
  947. } __attribute__ ((packed));
  948. struct bt_hci_rsp_delete_stored_link_key {
  949. uint8_t status;
  950. uint16_t num_keys;
  951. } __attribute__ ((packed));
  952. #define BT_HCI_CMD_WRITE_LOCAL_NAME 0x0c13
  953. struct bt_hci_cmd_write_local_name {
  954. uint8_t name[248];
  955. } __attribute__ ((packed));
  956. #define BT_HCI_CMD_READ_LOCAL_NAME 0x0c14
  957. struct bt_hci_rsp_read_local_name {
  958. uint8_t status;
  959. uint8_t name[248];
  960. } __attribute__ ((packed));
  961. #define BT_HCI_CMD_READ_CONN_ACCEPT_TIMEOUT 0x0c15
  962. struct bt_hci_rsp_read_conn_accept_timeout {
  963. uint8_t status;
  964. uint16_t timeout;
  965. } __attribute__ ((packed));
  966. #define BT_HCI_CMD_WRITE_CONN_ACCEPT_TIMEOUT 0x0c16
  967. struct bt_hci_cmd_write_conn_accept_timeout {
  968. uint16_t timeout;
  969. } __attribute__ ((packed));
  970. #define BT_HCI_CMD_READ_PAGE_TIMEOUT 0x0c17
  971. struct bt_hci_rsp_read_page_timeout {
  972. uint8_t status;
  973. uint16_t timeout;
  974. } __attribute__ ((packed));
  975. #define BT_HCI_CMD_WRITE_PAGE_TIMEOUT 0x0c18
  976. struct bt_hci_cmd_write_page_timeout {
  977. uint16_t timeout;
  978. } __attribute__ ((packed));
  979. #define BT_HCI_CMD_READ_SCAN_ENABLE 0x0c19
  980. struct bt_hci_rsp_read_scan_enable {
  981. uint8_t status;
  982. uint8_t enable;
  983. } __attribute__ ((packed));
  984. #define BT_HCI_CMD_WRITE_SCAN_ENABLE 0x0c1a
  985. struct bt_hci_cmd_write_scan_enable {
  986. uint8_t enable;
  987. } __attribute__ ((packed));
  988. #define BT_HCI_CMD_READ_PAGE_SCAN_ACTIVITY 0x0c1b
  989. struct bt_hci_rsp_read_page_scan_activity {
  990. uint8_t status;
  991. uint16_t interval;
  992. uint16_t window;
  993. } __attribute__ ((packed));
  994. #define BT_HCI_CMD_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c
  995. struct bt_hci_cmd_write_page_scan_activity {
  996. uint16_t interval;
  997. uint16_t window;
  998. } __attribute__ ((packed));
  999. #define BT_HCI_CMD_READ_INQUIRY_SCAN_ACTIVITY 0x0c1d
  1000. struct bt_hci_rsp_read_inquiry_scan_activity {
  1001. uint8_t status;
  1002. uint16_t interval;
  1003. uint16_t window;
  1004. } __attribute__ ((packed));
  1005. #define BT_HCI_CMD_WRITE_INQUIRY_SCAN_ACTIVITY 0x0c1e
  1006. struct bt_hci_cmd_write_inquiry_scan_activity {
  1007. uint16_t interval;
  1008. uint16_t window;
  1009. } __attribute__ ((packed));
  1010. #define BT_HCI_CMD_READ_AUTH_ENABLE 0x0c1f
  1011. struct bt_hci_rsp_read_auth_enable {
  1012. uint8_t status;
  1013. uint8_t enable;
  1014. } __attribute__ ((packed));
  1015. #define BT_HCI_CMD_WRITE_AUTH_ENABLE 0x0c20
  1016. struct bt_hci_cmd_write_auth_enable {
  1017. uint8_t enable;
  1018. } __attribute__ ((packed));
  1019. #define BT_HCI_CMD_READ_ENCRYPT_MODE 0x0c21
  1020. struct bt_hci_rsp_read_encrypt_mode {
  1021. uint8_t status;
  1022. uint8_t mode;
  1023. } __attribute__ ((packed));
  1024. #define BT_HCI_CMD_WRITE_ENCRYPT_MODE 0x0c22
  1025. struct bt_hci_cmd_write_encrypt_mode {
  1026. uint8_t mode;
  1027. } __attribute__ ((packed));
  1028. #define BT_HCI_CMD_READ_CLASS_OF_DEV 0x0c23
  1029. struct bt_hci_rsp_read_class_of_dev {
  1030. uint8_t status;
  1031. uint8_t dev_class[3];
  1032. } __attribute__ ((packed));
  1033. #define BT_HCI_CMD_WRITE_CLASS_OF_DEV 0x0c24
  1034. struct bt_hci_cmd_write_class_of_dev {
  1035. uint8_t dev_class[3];
  1036. } __attribute__ ((packed));
  1037. #define BT_HCI_CMD_READ_VOICE_SETTING 0x0c25
  1038. struct bt_hci_rsp_read_voice_setting {
  1039. uint8_t status;
  1040. uint16_t setting;
  1041. } __attribute__ ((packed));
  1042. #define BT_HCI_CMD_WRITE_VOICE_SETTING 0x0c26
  1043. struct bt_hci_cmd_write_voice_setting {
  1044. uint16_t setting;
  1045. } __attribute__ ((packed));
  1046. #define BT_HCI_CMD_READ_AUTO_FLUSH_TIMEOUT 0x0c27
  1047. struct bt_hci_cmd_read_auto_flush_timeout {
  1048. uint16_t handle;
  1049. } __attribute__ ((packed));
  1050. struct bt_hci_rsp_read_auto_flush_timeout {
  1051. uint8_t status;
  1052. uint16_t handle;
  1053. uint16_t timeout;
  1054. } __attribute__ ((packed));
  1055. #define BT_HCI_CMD_WRITE_AUTO_FLUSH_TIMEOUT 0x0c28
  1056. struct bt_hci_cmd_write_auto_flush_timeout {
  1057. uint16_t handle;
  1058. uint16_t timeout;
  1059. } __attribute__ ((packed));
  1060. struct bt_hci_rsp_write_auto_flush_timeout {
  1061. uint8_t status;
  1062. uint16_t handle;
  1063. } __attribute__ ((packed));
  1064. #define BT_HCI_CMD_READ_NUM_BROADCAST_RETRANS 0x0c29
  1065. struct bt_hci_rsp_read_num_broadcast_retrans {
  1066. uint8_t status;
  1067. uint8_t num_retrans;
  1068. } __attribute__ ((packed));
  1069. #define BT_HCI_CMD_WRITE_NUM_BROADCAST_RETRANS 0x0c2a
  1070. struct bt_hci_cmd_write_num_broadcast_retrans {
  1071. uint8_t num_retrans;
  1072. } __attribute__ ((packed));
  1073. #define BT_HCI_CMD_READ_HOLD_MODE_ACTIVITY 0x0c2b
  1074. struct bt_hci_rsp_read_hold_mode_activity {
  1075. uint8_t status;
  1076. uint8_t activity;
  1077. } __attribute__ ((packed));
  1078. #define BT_HCI_CMD_WRITE_HOLD_MODE_ACTIVITY 0x0c2c
  1079. struct bt_hci_cmd_write_hold_mode_activity {
  1080. uint8_t activity;
  1081. } __attribute__ ((packed));
  1082. #define BT_HCI_CMD_READ_TX_POWER 0x0c2d
  1083. struct bt_hci_cmd_read_tx_power {
  1084. uint16_t handle;
  1085. uint8_t type;
  1086. } __attribute__ ((packed));
  1087. struct bt_hci_rsp_read_tx_power {
  1088. uint8_t status;
  1089. uint16_t handle;
  1090. int8_t level;
  1091. } __attribute__ ((packed));
  1092. #define BT_HCI_CMD_READ_SYNC_FLOW_CONTROL 0x0c2e
  1093. struct bt_hci_rsp_read_sync_flow_control {
  1094. uint8_t status;
  1095. uint8_t enable;
  1096. } __attribute__ ((packed));
  1097. #define BT_HCI_CMD_WRITE_SYNC_FLOW_CONTROL 0x0c2f
  1098. struct bt_hci_cmd_write_sync_flow_control {
  1099. uint8_t enable;
  1100. } __attribute__ ((packed));
  1101. #define BT_HCI_CMD_SET_HOST_FLOW_CONTROL 0x0c31
  1102. struct bt_hci_cmd_set_host_flow_control {
  1103. uint8_t enable;
  1104. } __attribute__ ((packed));
  1105. #define BT_HCI_CMD_HOST_BUFFER_SIZE 0x0c33
  1106. struct bt_hci_cmd_host_buffer_size {
  1107. uint16_t acl_mtu;
  1108. uint8_t sco_mtu;
  1109. uint16_t acl_max_pkt;
  1110. uint16_t sco_max_pkt;
  1111. } __attribute__ ((packed));
  1112. #define BT_HCI_CMD_HOST_NUM_COMPLETED_PACKETS 0x0c35
  1113. struct bt_hci_cmd_host_num_completed_packets {
  1114. uint8_t num_handles;
  1115. uint16_t handle;
  1116. uint16_t count;
  1117. } __attribute__ ((packed));
  1118. #define BT_HCI_CMD_READ_LINK_SUPV_TIMEOUT 0x0c36
  1119. struct bt_hci_cmd_read_link_supv_timeout {
  1120. uint16_t handle;
  1121. } __attribute__ ((packed));
  1122. struct bt_hci_rsp_read_link_supv_timeout {
  1123. uint8_t status;
  1124. uint16_t handle;
  1125. uint16_t timeout;
  1126. } __attribute__ ((packed));
  1127. #define BT_HCI_CMD_WRITE_LINK_SUPV_TIMEOUT 0x0c37
  1128. struct bt_hci_cmd_write_link_supv_timeout {
  1129. uint16_t handle;
  1130. uint16_t timeout;
  1131. } __attribute__ ((packed));
  1132. struct bt_hci_rsp_write_link_supv_timeout {
  1133. uint8_t status;
  1134. uint16_t handle;
  1135. } __attribute__ ((packed));
  1136. #define BT_HCI_CMD_READ_NUM_SUPPORTED_IAC 0x0c38
  1137. struct bt_hci_rsp_read_num_supported_iac {
  1138. uint8_t status;
  1139. uint8_t num_iac;
  1140. } __attribute__ ((packed));
  1141. #define BT_HCI_CMD_READ_CURRENT_IAC_LAP 0x0c39
  1142. struct bt_hci_rsp_read_current_iac_lap {
  1143. uint8_t status;
  1144. uint8_t num_iac;
  1145. uint8_t iac_lap[0];
  1146. } __attribute__ ((packed));
  1147. #define BT_HCI_CMD_WRITE_CURRENT_IAC_LAP 0x0c3a
  1148. struct bt_hci_cmd_write_current_iac_lap {
  1149. uint8_t num_iac;
  1150. uint8_t iac_lap[0];
  1151. } __attribute__ ((packed));
  1152. #define BT_HCI_CMD_READ_PAGE_SCAN_PERIOD_MODE 0x0c3b
  1153. struct bt_hci_rsp_read_page_scan_period_mode {
  1154. uint8_t status;
  1155. uint8_t mode;
  1156. } __attribute__ ((packed));
  1157. #define BT_HCI_CMD_WRITE_PAGE_SCAN_PERIOD_MODE 0x0c3c
  1158. struct bt_hci_cmd_write_page_scan_period_mode {
  1159. uint8_t mode;
  1160. } __attribute__ ((packed));
  1161. #define BT_HCI_CMD_READ_PAGE_SCAN_MODE 0x0c3d
  1162. struct bt_hci_rsp_read_page_scan_mode {
  1163. uint8_t status;
  1164. uint8_t mode;
  1165. } __attribute__ ((packed));
  1166. #define BT_HCI_CMD_WRITE_PAGE_SCAN_MODE 0x0c3e
  1167. struct bt_hci_cmd_write_page_scan_mode {
  1168. uint8_t mode;
  1169. } __attribute__ ((packed));
  1170. #define BT_HCI_CMD_SET_AFH_HOST_CLASSIFICATION 0x0c3f
  1171. struct bt_hci_cmd_set_afh_host_classification {
  1172. uint8_t map[10];
  1173. } __attribute__ ((packed));
  1174. #define BT_HCI_CMD_READ_INQUIRY_SCAN_TYPE 0x0c42
  1175. struct bt_hci_rsp_read_inquiry_scan_type {
  1176. uint8_t status;
  1177. uint8_t type;
  1178. } __attribute__ ((packed));
  1179. #define BT_HCI_CMD_WRITE_INQUIRY_SCAN_TYPE 0x0c43
  1180. struct bt_hci_cmd_write_inquiry_scan_type {
  1181. uint8_t type;
  1182. } __attribute__ ((packed));
  1183. #define BT_HCI_CMD_READ_INQUIRY_MODE 0x0c44
  1184. struct bt_hci_rsp_read_inquiry_mode {
  1185. uint8_t status;
  1186. uint8_t mode;
  1187. } __attribute__ ((packed));
  1188. #define BT_HCI_CMD_WRITE_INQUIRY_MODE 0x0c45
  1189. struct bt_hci_cmd_write_inquiry_mode {
  1190. uint8_t mode;
  1191. } __attribute__ ((packed));
  1192. #define BT_HCI_CMD_READ_PAGE_SCAN_TYPE 0x0c46
  1193. struct bt_hci_rsp_read_page_scan_type {
  1194. uint8_t status;
  1195. uint8_t type;
  1196. } __attribute__ ((packed));
  1197. #define BT_HCI_CMD_WRITE_PAGE_SCAN_TYPE 0x0c47
  1198. struct bt_hci_cmd_write_page_scan_type {
  1199. uint8_t type;
  1200. } __attribute__ ((packed));
  1201. #define BT_HCI_CMD_READ_AFH_ASSESSMENT_MODE 0x0c48
  1202. struct bt_hci_rsp_read_afh_assessment_mode {
  1203. uint8_t status;
  1204. uint8_t mode;
  1205. } __attribute__ ((packed));
  1206. #define BT_HCI_CMD_WRITE_AFH_ASSESSMENT_MODE 0x0c49
  1207. struct bt_hci_cmd_write_afh_assessment_mode {
  1208. uint8_t mode;
  1209. } __attribute__ ((packed));
  1210. #define BT_HCI_CMD_READ_EXT_INQUIRY_RESPONSE 0x0c51
  1211. struct bt_hci_rsp_read_ext_inquiry_response {
  1212. uint8_t status;
  1213. uint8_t fec;
  1214. uint8_t data[240];
  1215. } __attribute__ ((packed));
  1216. #define BT_HCI_CMD_WRITE_EXT_INQUIRY_RESPONSE 0x0c52
  1217. struct bt_hci_cmd_write_ext_inquiry_response {
  1218. uint8_t fec;
  1219. uint8_t data[240];
  1220. } __attribute__ ((packed));
  1221. #define BT_HCI_CMD_REFRESH_ENCRYPT_KEY 0x0c53
  1222. struct bt_hci_cmd_refresh_encrypt_key {
  1223. uint16_t handle;
  1224. } __attribute__ ((packed));
  1225. #define BT_HCI_CMD_READ_SIMPLE_PAIRING_MODE 0x0c55
  1226. struct bt_hci_rsp_read_simple_pairing_mode {
  1227. uint8_t status;
  1228. uint8_t mode;
  1229. } __attribute__ ((packed));
  1230. #define BT_HCI_CMD_WRITE_SIMPLE_PAIRING_MODE 0x0c56
  1231. struct bt_hci_cmd_write_simple_pairing_mode {
  1232. uint8_t mode;
  1233. } __attribute__ ((packed));
  1234. #define BT_HCI_CMD_READ_LOCAL_OOB_DATA 0x0c57
  1235. struct bt_hci_rsp_read_local_oob_data {
  1236. uint8_t status;
  1237. uint8_t hash[16];
  1238. uint8_t randomizer[16];
  1239. } __attribute__ ((packed));
  1240. #define BT_HCI_CMD_READ_INQUIRY_RESP_TX_POWER 0x0c58
  1241. struct bt_hci_rsp_read_inquiry_resp_tx_power {
  1242. uint8_t status;
  1243. int8_t level;
  1244. } __attribute__ ((packed));
  1245. #define BT_HCI_CMD_WRITE_INQUIRY_TX_POWER 0x0c59
  1246. struct bt_hci_cmd_write_inquiry_tx_power {
  1247. int8_t level;
  1248. } __attribute__ ((packed));
  1249. #define BT_HCI_CMD_READ_ERRONEOUS_REPORTING 0x0c5a
  1250. struct bt_hci_rsp_read_erroneous_reporting {
  1251. uint8_t status;
  1252. uint8_t mode;
  1253. } __attribute__ ((packed));
  1254. #define BT_HCI_CMD_WRITE_ERRONEOUS_REPORTING 0x0c5b
  1255. struct bt_hci_cmd_write_erroneous_reporting {
  1256. uint8_t mode;
  1257. } __attribute__ ((packed));
  1258. #define BT_HCI_CMD_ENHANCED_FLUSH 0x0c5f
  1259. struct bt_hci_cmd_enhanced_flush {
  1260. uint16_t handle;
  1261. uint8_t type;
  1262. } __attribute__ ((packed));
  1263. #define BT_HCI_CMD_SEND_KEYPRESS_NOTIFY 0x0c60
  1264. struct bt_hci_cmd_send_keypress_notify {
  1265. uint8_t bdaddr[6];
  1266. uint8_t type;
  1267. } __attribute__ ((packed));
  1268. struct bt_hci_rsp_send_keypress_notify {
  1269. uint8_t status;
  1270. uint8_t bdaddr[6];
  1271. } __attribute__ ((packed));
  1272. #define BT_HCI_CMD_SET_EVENT_MASK_PAGE2 0x0c63
  1273. struct bt_hci_cmd_set_event_mask_page2 {
  1274. uint8_t mask[8];
  1275. } __attribute__ ((packed));
  1276. #define BT_HCI_CMD_READ_LOCATION_DATA 0x0c64
  1277. struct bt_hci_rsp_read_location_data {
  1278. uint8_t status;
  1279. uint8_t domain_aware;
  1280. uint8_t domain[2];
  1281. uint8_t domain_options;
  1282. uint8_t options;
  1283. } __attribute__ ((packed));
  1284. #define BT_HCI_CMD_WRITE_LOCATION_DATA 0x0c65
  1285. struct bt_hci_cmd_write_location_data {
  1286. uint8_t domain_aware;
  1287. uint8_t domain[2];
  1288. uint8_t domain_options;
  1289. uint8_t options;
  1290. } __attribute__ ((packed));
  1291. #define BT_HCI_CMD_READ_FLOW_CONTROL_MODE 0x0c66
  1292. struct bt_hci_rsp_read_flow_control_mode {
  1293. uint8_t status;
  1294. uint8_t mode;
  1295. } __attribute__ ((packed));
  1296. #define BT_HCI_CMD_WRITE_FLOW_CONTROL_MODE 0x0c67
  1297. struct bt_hci_cmd_write_flow_control_mode {
  1298. uint8_t mode;
  1299. } __attribute__ ((packed));
  1300. #define BT_HCI_CMD_READ_ENHANCED_TX_POWER 0x0c68
  1301. struct bt_hci_cmd_read_enhanced_tx_power {
  1302. uint16_t handle;
  1303. uint8_t type;
  1304. } __attribute__ ((packed));
  1305. struct bt_hci_rsp_read_enhanced_tx_power {
  1306. uint8_t status;
  1307. uint16_t handle;
  1308. int8_t level_gfsk;
  1309. int8_t level_dqpsk;
  1310. int8_t level_8dpsk;
  1311. } __attribute__ ((packed));
  1312. #define BT_HCI_CMD_SHORT_RANGE_MODE 0x0c6b
  1313. struct bt_hci_cmd_short_range_mode {
  1314. uint8_t phy_handle;
  1315. uint8_t mode;
  1316. } __attribute__ ((packed));
  1317. #define BT_HCI_CMD_READ_LE_HOST_SUPPORTED 0x0c6c
  1318. struct bt_hci_rsp_read_le_host_supported {
  1319. uint8_t status;
  1320. uint8_t supported;
  1321. uint8_t simultaneous;
  1322. } __attribute__ ((packed));
  1323. #define BT_HCI_CMD_WRITE_LE_HOST_SUPPORTED 0x0c6d
  1324. struct bt_hci_cmd_write_le_host_supported {
  1325. uint8_t supported;
  1326. uint8_t simultaneous;
  1327. } __attribute__ ((packed));
  1328. #define BT_HCI_CMD_SET_RESERVED_LT_ADDR 0x0c74
  1329. struct bt_hci_cmd_set_reserved_lt_addr {
  1330. uint8_t lt_addr;
  1331. } __attribute__ ((packed));
  1332. struct bt_hci_rsp_set_reserved_lt_addr {
  1333. uint8_t status;
  1334. uint8_t lt_addr;
  1335. } __attribute__ ((packed));
  1336. #define BT_HCI_CMD_DELETE_RESERVED_LT_ADDR 0x0c75
  1337. struct bt_hci_cmd_delete_reserved_lt_addr {
  1338. uint8_t lt_addr;
  1339. } __attribute__ ((packed));
  1340. struct bt_hci_rsp_delete_reserved_lt_addr {
  1341. uint8_t status;
  1342. uint8_t lt_addr;
  1343. } __attribute__ ((packed));
  1344. #define BT_HCI_CMD_SET_PERIPHERAL_BROADCAST_DATA 0x0c76
  1345. struct bt_hci_cmd_set_peripheral_broadcast_data {
  1346. uint8_t lt_addr;
  1347. uint8_t fragment;
  1348. uint8_t length;
  1349. } __attribute__ ((packed));
  1350. struct bt_hci_rsp_set_peripheral_broadcast_data {
  1351. uint8_t status;
  1352. uint8_t lt_addr;
  1353. } __attribute__ ((packed));
  1354. #define BT_HCI_CMD_READ_SYNC_TRAIN_PARAMS 0x0c77
  1355. struct bt_hci_rsp_read_sync_train_params {
  1356. uint8_t status;
  1357. uint16_t interval;
  1358. uint32_t timeout;
  1359. uint8_t service_data;
  1360. } __attribute__ ((packed));
  1361. #define BT_HCI_CMD_WRITE_SYNC_TRAIN_PARAMS 0x0c78
  1362. struct bt_hci_cmd_write_sync_train_params {
  1363. uint16_t min_interval;
  1364. uint16_t max_interval;
  1365. uint32_t timeout;
  1366. uint8_t service_data;
  1367. } __attribute__ ((packed));
  1368. struct bt_hci_rsp_write_sync_train_params {
  1369. uint8_t status;
  1370. uint16_t interval;
  1371. } __attribute__ ((packed));
  1372. #define BT_HCI_CMD_READ_SECURE_CONN_SUPPORT 0x0c79
  1373. struct bt_hci_rsp_read_secure_conn_support {
  1374. uint8_t status;
  1375. uint8_t support;
  1376. } __attribute__ ((packed));
  1377. #define BT_HCI_CMD_WRITE_SECURE_CONN_SUPPORT 0x0c7a
  1378. struct bt_hci_cmd_write_secure_conn_support {
  1379. uint8_t support;
  1380. } __attribute__ ((packed));
  1381. #define BT_HCI_CMD_READ_AUTH_PAYLOAD_TIMEOUT 0x0c7b
  1382. struct bt_hci_cmd_read_auth_payload_timeout {
  1383. uint16_t handle;
  1384. } __attribute__ ((packed));
  1385. struct bt_hci_rsp_read_auth_payload_timeout {
  1386. uint8_t status;
  1387. uint16_t handle;
  1388. uint16_t timeout;
  1389. } __attribute__ ((packed));
  1390. #define BT_HCI_CMD_WRITE_AUTH_PAYLOAD_TIMEOUT 0x0c7c
  1391. struct bt_hci_cmd_write_auth_payload_timeout {
  1392. uint16_t handle;
  1393. uint16_t timeout;
  1394. } __attribute__ ((packed));
  1395. struct bt_hci_rsp_write_auth_payload_timeout {
  1396. uint8_t status;
  1397. uint16_t handle;
  1398. } __attribute__ ((packed));
  1399. #define BT_HCI_CMD_READ_LOCAL_OOB_EXT_DATA 0x0c7d
  1400. struct bt_hci_rsp_read_local_oob_ext_data {
  1401. uint8_t status;
  1402. uint8_t hash192[16];
  1403. uint8_t randomizer192[16];
  1404. uint8_t hash256[16];
  1405. uint8_t randomizer256[16];
  1406. } __attribute__ ((packed));
  1407. #define BT_HCI_CMD_READ_EXT_PAGE_TIMEOUT 0x0c7e
  1408. struct bt_hci_rsp_read_ext_page_timeout {
  1409. uint8_t status;
  1410. uint16_t timeout;
  1411. } __attribute__ ((packed));
  1412. #define BT_HCI_CMD_WRITE_EXT_PAGE_TIMEOUT 0x0c7f
  1413. struct bt_hci_cmd_write_ext_page_timeout {
  1414. uint16_t timeout;
  1415. } __attribute__ ((packed));
  1416. #define BT_HCI_CMD_READ_EXT_INQUIRY_LENGTH 0x0c80
  1417. struct bt_hci_rsp_read_ext_inquiry_length {
  1418. uint8_t status;
  1419. uint16_t interval;
  1420. } __attribute__ ((packed));
  1421. #define BT_HCI_CMD_WRITE_EXT_INQUIRY_LENGTH 0x0c81
  1422. struct bt_hci_cmd_write_ext_inquiry_length {
  1423. uint16_t interval;
  1424. } __attribute__ ((packed));
  1425. #define BT_HCI_CMD_CONFIG_DATA_PATH 0x0c83
  1426. #define BT_HCI_BIT_CONFIG_DATA_PATH BT_HCI_CMD_BIT(45, 5)
  1427. struct bt_hci_cmd_config_data_path {
  1428. uint8_t dir;
  1429. uint8_t id;
  1430. uint8_t vnd_config_len;
  1431. uint8_t vnd_config[0];
  1432. } __attribute__ ((packed));
  1433. #define BT_HCI_CMD_READ_LOCAL_VERSION 0x1001
  1434. struct bt_hci_rsp_read_local_version {
  1435. uint8_t status;
  1436. uint8_t hci_ver;
  1437. uint16_t hci_rev;
  1438. uint8_t lmp_ver;
  1439. uint16_t manufacturer;
  1440. uint16_t lmp_subver;
  1441. } __attribute__ ((packed));
  1442. #define BT_HCI_CMD_READ_LOCAL_COMMANDS 0x1002
  1443. struct bt_hci_rsp_read_local_commands {
  1444. uint8_t status;
  1445. uint8_t commands[64];
  1446. } __attribute__ ((packed));
  1447. #define BT_HCI_CMD_READ_LOCAL_FEATURES 0x1003
  1448. struct bt_hci_rsp_read_local_features {
  1449. uint8_t status;
  1450. uint8_t features[8];
  1451. } __attribute__ ((packed));
  1452. #define BT_HCI_CMD_READ_LOCAL_EXT_FEATURES 0x1004
  1453. struct bt_hci_cmd_read_local_ext_features {
  1454. uint8_t page;
  1455. } __attribute__ ((packed));
  1456. struct bt_hci_rsp_read_local_ext_features {
  1457. uint8_t status;
  1458. uint8_t page;
  1459. uint8_t max_page;
  1460. uint8_t features[8];
  1461. } __attribute__ ((packed));
  1462. #define BT_HCI_CMD_READ_BUFFER_SIZE 0x1005
  1463. struct bt_hci_rsp_read_buffer_size {
  1464. uint8_t status;
  1465. uint16_t acl_mtu;
  1466. uint8_t sco_mtu;
  1467. uint16_t acl_max_pkt;
  1468. uint16_t sco_max_pkt;
  1469. } __attribute__ ((packed));
  1470. #define BT_HCI_CMD_READ_COUNTRY_CODE 0x1007
  1471. struct bt_hci_rsp_read_country_code {
  1472. uint8_t status;
  1473. uint8_t code;
  1474. } __attribute__ ((packed));
  1475. #define BT_HCI_CMD_READ_BD_ADDR 0x1009
  1476. struct bt_hci_rsp_read_bd_addr {
  1477. uint8_t status;
  1478. uint8_t bdaddr[6];
  1479. } __attribute__ ((packed));
  1480. #define BT_HCI_CMD_READ_DATA_BLOCK_SIZE 0x100a
  1481. struct bt_hci_rsp_read_data_block_size {
  1482. uint8_t status;
  1483. uint16_t max_acl_len;
  1484. uint16_t block_len;
  1485. uint16_t num_blocks;
  1486. } __attribute__ ((packed));
  1487. #define BT_HCI_CMD_READ_LOCAL_CODECS 0x100b
  1488. struct bt_hci_rsp_read_local_codecs {
  1489. uint8_t status;
  1490. uint8_t num_codecs;
  1491. uint8_t codec[0];
  1492. } __attribute__ ((packed));
  1493. #define BT_HCI_CMD_READ_LOCAL_PAIRING_OPTIONS 0x100c
  1494. struct bt_hci_rsp_read_local_pairing_options {
  1495. uint8_t status;
  1496. uint8_t pairing_options;
  1497. uint8_t max_key_size;
  1498. } __attribute__ ((packed));
  1499. #define BT_HCI_CMD_READ_LOCAL_CODECS_V2 0x100d
  1500. #define BT_HCI_BIT_READ_LOCAL_CODECS_V2 BT_HCI_CMD_BIT(45, 2)
  1501. #define BT_HCI_LOCAL_CODEC_BREDR_ACL BIT(0)
  1502. #define BT_HCI_LOCAL_CODEC_BREDR_SCO BIT(1)
  1503. #define BT_HCI_LOCAL_CODEC_LE_CIS BIT(2)
  1504. #define BT_HCI_LOCAL_CODEC_LE_BIS BIT(3)
  1505. struct bt_hci_vnd_codec {
  1506. uint8_t id;
  1507. uint16_t cid;
  1508. uint16_t vid;
  1509. uint8_t transport;
  1510. } __attribute__ ((packed));
  1511. struct bt_hci_codec {
  1512. uint8_t id;
  1513. uint8_t transport;
  1514. } __attribute__ ((packed));
  1515. struct bt_hci_rsp_read_local_codecs_v2 {
  1516. uint8_t status;
  1517. uint8_t num_codecs;
  1518. struct bt_hci_codec codec[0];
  1519. } __attribute__ ((packed));
  1520. #define BT_HCI_CMD_READ_LOCAL_CODEC_CAPS 0x100e
  1521. #define BT_HCI_BIT_READ_LOCAL_CODEC_CAPS BT_HCI_CMD_BIT(45, 3)
  1522. struct bt_hci_cmd_read_local_codec_caps {
  1523. struct bt_hci_vnd_codec codec;
  1524. uint8_t dir;
  1525. } __attribute__ ((packed));
  1526. struct bt_hci_codec_caps {
  1527. uint8_t len;
  1528. uint8_t data[0];
  1529. } __attribute__ ((packed));
  1530. struct bt_hci_rsp_read_local_codec_caps {
  1531. uint8_t status;
  1532. uint8_t num;
  1533. struct bt_hci_codec_caps caps[0];
  1534. } __attribute__ ((packed));
  1535. #define BT_HCI_CMD_READ_LOCAL_CTRL_DELAY 0x100f
  1536. #define BT_HCI_BIT_READ_LOCAL_CTRL_DELAY BT_HCI_CMD_BIT(45, 4)
  1537. struct bt_hci_cmd_read_local_ctrl_delay {
  1538. struct bt_hci_vnd_codec codec;
  1539. uint8_t dir;
  1540. uint8_t codec_cfg_len;
  1541. uint8_t codec_cfg[0];
  1542. } __attribute__ ((packed));
  1543. struct bt_hci_rsp_read_local_ctrl_delay {
  1544. uint8_t status;
  1545. uint8_t min_delay[3];
  1546. uint8_t max_delay[3];
  1547. } __attribute__ ((packed));
  1548. #define BT_HCI_CMD_READ_FAILED_CONTACT_COUNTER 0x1401
  1549. struct bt_hci_cmd_read_failed_contact_counter {
  1550. uint16_t handle;
  1551. } __attribute__ ((packed));
  1552. struct bt_hci_rsp_read_failed_contact_counter {
  1553. uint8_t status;
  1554. uint16_t handle;
  1555. uint16_t counter;
  1556. } __attribute__ ((packed));
  1557. #define BT_HCI_CMD_RESET_FAILED_CONTACT_COUNTER 0x1402
  1558. struct bt_hci_cmd_reset_failed_contact_counter {
  1559. uint16_t handle;
  1560. } __attribute__ ((packed));
  1561. struct bt_hci_rsp_reset_failed_contact_counter {
  1562. uint8_t status;
  1563. uint16_t handle;
  1564. } __attribute__ ((packed));
  1565. #define BT_HCI_CMD_READ_LINK_QUALITY 0x1403
  1566. struct bt_hci_cmd_read_link_quality {
  1567. uint16_t handle;
  1568. } __attribute__ ((packed));
  1569. struct bt_hci_rsp_read_link_quality {
  1570. uint8_t status;
  1571. uint16_t handle;
  1572. uint8_t link_quality;
  1573. } __attribute__ ((packed));
  1574. #define BT_HCI_CMD_READ_RSSI 0x1405
  1575. struct bt_hci_cmd_read_rssi {
  1576. uint16_t handle;
  1577. } __attribute__ ((packed));
  1578. struct bt_hci_rsp_read_rssi {
  1579. uint8_t status;
  1580. uint16_t handle;
  1581. int8_t rssi;
  1582. } __attribute__ ((packed));
  1583. #define BT_HCI_CMD_READ_AFH_CHANNEL_MAP 0x1406
  1584. struct bt_hci_cmd_read_afh_channel_map {
  1585. uint16_t handle;
  1586. } __attribute__ ((packed));
  1587. struct bt_hci_rsp_read_afh_channel_map {
  1588. uint8_t status;
  1589. uint16_t handle;
  1590. uint8_t mode;
  1591. uint8_t map[10];
  1592. } __attribute__ ((packed));
  1593. #define BT_HCI_CMD_READ_CLOCK 0x1407
  1594. struct bt_hci_cmd_read_clock {
  1595. uint16_t handle;
  1596. uint8_t type;
  1597. } __attribute__ ((packed));
  1598. struct bt_hci_rsp_read_clock {
  1599. uint8_t status;
  1600. uint16_t handle;
  1601. uint32_t clock;
  1602. uint16_t accuracy;
  1603. } __attribute__ ((packed));
  1604. #define BT_HCI_CMD_READ_ENCRYPT_KEY_SIZE 0x1408
  1605. struct bt_hci_cmd_read_encrypt_key_size {
  1606. uint16_t handle;
  1607. } __attribute__ ((packed));
  1608. struct bt_hci_rsp_read_encrypt_key_size {
  1609. uint8_t status;
  1610. uint16_t handle;
  1611. uint8_t key_size;
  1612. } __attribute__ ((packed));
  1613. #define BT_HCI_CMD_READ_LOCAL_AMP_INFO 0x1409
  1614. struct bt_hci_rsp_read_local_amp_info {
  1615. uint8_t status;
  1616. uint8_t amp_status;
  1617. uint32_t total_bw;
  1618. uint32_t max_bw;
  1619. uint32_t min_latency;
  1620. uint32_t max_pdu;
  1621. uint8_t amp_type;
  1622. uint16_t pal_cap;
  1623. uint16_t max_assoc_len;
  1624. uint32_t max_flush_to;
  1625. uint32_t be_flush_to;
  1626. } __attribute__ ((packed));
  1627. #define BT_HCI_CMD_READ_LOCAL_AMP_ASSOC 0x140a
  1628. struct bt_hci_cmd_read_local_amp_assoc {
  1629. uint8_t phy_handle;
  1630. uint16_t len_so_far;
  1631. uint16_t max_assoc_len;
  1632. } __attribute__ ((packed));
  1633. struct bt_hci_rsp_read_local_amp_assoc {
  1634. uint8_t status;
  1635. uint8_t phy_handle;
  1636. uint16_t remain_assoc_len;
  1637. uint8_t assoc_fragment[248];
  1638. } __attribute__ ((packed));
  1639. #define BT_HCI_CMD_WRITE_REMOTE_AMP_ASSOC 0x140b
  1640. struct bt_hci_cmd_write_remote_amp_assoc {
  1641. uint8_t phy_handle;
  1642. uint16_t len_so_far;
  1643. uint16_t remain_assoc_len;
  1644. uint8_t assoc_fragment[248];
  1645. } __attribute__ ((packed));
  1646. struct bt_hci_rsp_write_remote_amp_assoc {
  1647. uint8_t status;
  1648. uint8_t phy_handle;
  1649. } __attribute__ ((packed));
  1650. #define BT_HCI_CMD_GET_MWS_TRANSPORT_CONFIG 0x140c
  1651. struct bt_hci_rsp_get_mws_transport_config {
  1652. uint8_t status;
  1653. uint8_t num_transports;
  1654. uint8_t transport[0];
  1655. } __attribute__ ((packed));
  1656. #define BT_HCI_CMD_SET_TRIGGERED_CLOCK_CAPTURE 0x140d
  1657. struct bt_hci_cmd_set_triggered_clock_capture {
  1658. uint16_t handle;
  1659. uint8_t enable;
  1660. uint8_t type;
  1661. uint8_t lpo_allowed;
  1662. uint8_t num_filter;
  1663. } __attribute__ ((packed));
  1664. #define BT_HCI_CMD_READ_LOOPBACK_MODE 0x1801
  1665. struct bt_hci_rsp_read_loopback_mode {
  1666. uint8_t status;
  1667. uint8_t mode;
  1668. } __attribute__ ((packed));
  1669. #define BT_HCI_CMD_WRITE_LOOPBACK_MODE 0x1802
  1670. struct bt_hci_cmd_write_loopback_mode {
  1671. uint8_t mode;
  1672. } __attribute__ ((packed));
  1673. #define BT_HCI_CMD_ENABLE_DUT_MODE 0x1803
  1674. #define BT_HCI_CMD_WRITE_SSP_DEBUG_MODE 0x1804
  1675. struct bt_hci_cmd_write_ssp_debug_mode {
  1676. uint8_t mode;
  1677. } __attribute__ ((packed));
  1678. #define BT_HCI_CMD_LE_SET_EVENT_MASK 0x2001
  1679. struct bt_hci_cmd_le_set_event_mask {
  1680. uint8_t mask[8];
  1681. } __attribute__ ((packed));
  1682. #define BT_HCI_CMD_LE_READ_BUFFER_SIZE 0x2002
  1683. struct bt_hci_rsp_le_read_buffer_size {
  1684. uint8_t status;
  1685. uint16_t le_mtu;
  1686. uint8_t le_max_pkt;
  1687. } __attribute__ ((packed));
  1688. #define BT_HCI_CMD_LE_READ_LOCAL_FEATURES 0x2003
  1689. struct bt_hci_rsp_le_read_local_features {
  1690. uint8_t status;
  1691. uint8_t features[8];
  1692. } __attribute__ ((packed));
  1693. #define BT_HCI_CMD_LE_SET_RANDOM_ADDRESS 0x2005
  1694. struct bt_hci_cmd_le_set_random_address {
  1695. uint8_t addr[6];
  1696. } __attribute__ ((packed));
  1697. #define BT_HCI_CMD_LE_SET_ADV_PARAMETERS 0x2006
  1698. struct bt_hci_cmd_le_set_adv_parameters {
  1699. uint16_t min_interval;
  1700. uint16_t max_interval;
  1701. uint8_t type;
  1702. uint8_t own_addr_type;
  1703. uint8_t direct_addr_type;
  1704. uint8_t direct_addr[6];
  1705. uint8_t channel_map;
  1706. uint8_t filter_policy;
  1707. } __attribute__ ((packed));
  1708. #define BT_HCI_CMD_LE_READ_ADV_TX_POWER 0x2007
  1709. struct bt_hci_rsp_le_read_adv_tx_power {
  1710. uint8_t status;
  1711. int8_t level;
  1712. } __attribute__ ((packed));
  1713. #define BT_HCI_CMD_LE_SET_ADV_DATA 0x2008
  1714. struct bt_hci_cmd_le_set_adv_data {
  1715. uint8_t len;
  1716. uint8_t data[31];
  1717. } __attribute__ ((packed));
  1718. #define BT_HCI_CMD_LE_SET_SCAN_RSP_DATA 0x2009
  1719. struct bt_hci_cmd_le_set_scan_rsp_data {
  1720. uint8_t len;
  1721. uint8_t data[31];
  1722. } __attribute__ ((packed));
  1723. #define BT_HCI_CMD_LE_SET_ADV_ENABLE 0x200a
  1724. struct bt_hci_cmd_le_set_adv_enable {
  1725. uint8_t enable;
  1726. } __attribute__ ((packed));
  1727. #define BT_HCI_CMD_LE_SET_SCAN_PARAMETERS 0x200b
  1728. struct bt_hci_cmd_le_set_scan_parameters {
  1729. uint8_t type;
  1730. uint16_t interval;
  1731. uint16_t window;
  1732. uint8_t own_addr_type;
  1733. uint8_t filter_policy;
  1734. } __attribute__ ((packed));
  1735. #define BT_HCI_CMD_LE_SET_SCAN_ENABLE 0x200c
  1736. struct bt_hci_cmd_le_set_scan_enable {
  1737. uint8_t enable;
  1738. uint8_t filter_dup;
  1739. } __attribute__ ((packed));
  1740. #define BT_HCI_CMD_LE_CREATE_CONN 0x200d
  1741. struct bt_hci_cmd_le_create_conn {
  1742. uint16_t scan_interval;
  1743. uint16_t scan_window;
  1744. uint8_t filter_policy;
  1745. uint8_t peer_addr_type;
  1746. uint8_t peer_addr[6];
  1747. uint8_t own_addr_type;
  1748. uint16_t min_interval;
  1749. uint16_t max_interval;
  1750. uint16_t latency;
  1751. uint16_t supv_timeout;
  1752. uint16_t min_length;
  1753. uint16_t max_length;
  1754. } __attribute__ ((packed));
  1755. #define BT_HCI_CMD_LE_CREATE_CONN_CANCEL 0x200e
  1756. #define BT_HCI_CMD_LE_READ_ACCEPT_LIST_SIZE 0x200f
  1757. struct bt_hci_rsp_le_read_accept_list_size {
  1758. uint8_t status;
  1759. uint8_t size;
  1760. } __attribute__ ((packed));
  1761. #define BT_HCI_CMD_LE_CLEAR_ACCEPT_LIST 0x2010
  1762. #define BT_HCI_CMD_LE_ADD_TO_ACCEPT_LIST 0x2011
  1763. struct bt_hci_cmd_le_add_to_accept_list {
  1764. uint8_t addr_type;
  1765. uint8_t addr[6];
  1766. } __attribute__ ((packed));
  1767. #define BT_HCI_CMD_LE_REMOVE_FROM_ACCEPT_LIST 0x2012
  1768. struct bt_hci_cmd_le_remove_from_accept_list {
  1769. uint8_t addr_type;
  1770. uint8_t addr[6];
  1771. } __attribute__ ((packed));
  1772. #define BT_HCI_CMD_LE_CONN_UPDATE 0x2013
  1773. struct bt_hci_cmd_le_conn_update {
  1774. uint16_t handle;
  1775. uint16_t min_interval;
  1776. uint16_t max_interval;
  1777. uint16_t latency;
  1778. uint16_t supv_timeout;
  1779. uint16_t min_length;
  1780. uint16_t max_length;
  1781. } __attribute__ ((packed));
  1782. #define BT_HCI_CMD_LE_SET_HOST_CLASSIFICATION 0x2014
  1783. struct bt_hci_cmd_le_set_host_classification {
  1784. uint8_t map[5];
  1785. } __attribute__ ((packed));
  1786. #define BT_HCI_CMD_LE_READ_CHANNEL_MAP 0x2015
  1787. struct bt_hci_cmd_le_read_channel_map {
  1788. uint16_t handle;
  1789. } __attribute__ ((packed));
  1790. struct bt_hci_rsp_le_read_channel_map {
  1791. uint8_t status;
  1792. uint16_t handle;
  1793. uint8_t map[5];
  1794. } __attribute__ ((packed));
  1795. #define BT_HCI_CMD_LE_READ_REMOTE_FEATURES 0x2016
  1796. struct bt_hci_cmd_le_read_remote_features {
  1797. uint16_t handle;
  1798. } __attribute__ ((packed));
  1799. #define BT_HCI_CMD_LE_ENCRYPT 0x2017
  1800. struct bt_hci_cmd_le_encrypt {
  1801. uint8_t key[16];
  1802. uint8_t plaintext[16];
  1803. } __attribute__ ((packed));
  1804. struct bt_hci_rsp_le_encrypt {
  1805. uint8_t status;
  1806. uint8_t data[16];
  1807. } __attribute__ ((packed));
  1808. #define BT_HCI_CMD_LE_RAND 0x2018
  1809. struct bt_hci_rsp_le_rand {
  1810. uint8_t status;
  1811. uint64_t number;
  1812. } __attribute__ ((packed));
  1813. #define BT_HCI_CMD_LE_START_ENCRYPT 0x2019
  1814. struct bt_hci_cmd_le_start_encrypt {
  1815. uint16_t handle;
  1816. uint64_t rand;
  1817. uint16_t ediv;
  1818. uint8_t ltk[16];
  1819. } __attribute__ ((packed));
  1820. #define BT_HCI_CMD_LE_LTK_REQ_REPLY 0x201a
  1821. struct bt_hci_cmd_le_ltk_req_reply {
  1822. uint16_t handle;
  1823. uint8_t ltk[16];
  1824. } __attribute__ ((packed));
  1825. struct bt_hci_rsp_le_ltk_req_reply {
  1826. uint8_t status;
  1827. uint16_t handle;
  1828. } __attribute__ ((packed));
  1829. #define BT_HCI_CMD_LE_LTK_REQ_NEG_REPLY 0x201b
  1830. struct bt_hci_cmd_le_ltk_req_neg_reply {
  1831. uint16_t handle;
  1832. } __attribute__ ((packed));
  1833. struct bt_hci_rsp_le_ltk_req_neg_reply {
  1834. uint8_t status;
  1835. uint16_t handle;
  1836. } __attribute__ ((packed));
  1837. #define BT_HCI_CMD_LE_READ_SUPPORTED_STATES 0x201c
  1838. struct bt_hci_rsp_le_read_supported_states {
  1839. uint8_t status;
  1840. uint8_t states[8];
  1841. } __attribute__ ((packed));
  1842. #define BT_HCI_CMD_LE_RECEIVER_TEST 0x201d
  1843. struct bt_hci_cmd_le_receiver_test {
  1844. uint8_t frequency;
  1845. } __attribute__ ((packed));
  1846. #define BT_HCI_CMD_LE_TRANSMITTER_TEST 0x201e
  1847. struct bt_hci_cmd_le_transmitter_test {
  1848. uint8_t frequency;
  1849. uint8_t data_len;
  1850. uint8_t payload;
  1851. } __attribute__ ((packed));
  1852. #define BT_HCI_CMD_LE_TEST_END 0x201f
  1853. struct bt_hci_rsp_le_test_end {
  1854. uint8_t status;
  1855. uint16_t num_packets;
  1856. } __attribute__ ((packed));
  1857. #define BT_HCI_CMD_LE_CONN_PARAM_REQ_REPLY 0x2020
  1858. struct bt_hci_cmd_le_conn_param_req_reply {
  1859. uint16_t handle;
  1860. uint16_t min_interval;
  1861. uint16_t max_interval;
  1862. uint16_t latency;
  1863. uint16_t supv_timeout;
  1864. uint16_t min_length;
  1865. uint16_t max_length;
  1866. } __attribute__ ((packed));
  1867. struct bt_hci_rsp_le_conn_param_req_reply {
  1868. uint8_t status;
  1869. uint16_t handle;
  1870. } __attribute__ ((packed));
  1871. #define BT_HCI_CMD_LE_CONN_PARAM_REQ_NEG_REPLY 0x2021
  1872. struct bt_hci_cmd_le_conn_param_req_neg_reply {
  1873. uint16_t handle;
  1874. uint8_t reason;
  1875. } __attribute__ ((packed));
  1876. struct bt_hci_rsp_le_conn_param_req_neg_reply {
  1877. uint8_t status;
  1878. uint16_t handle;
  1879. } __attribute__ ((packed));
  1880. #define BT_HCI_CMD_LE_SET_DATA_LENGTH 0x2022
  1881. struct bt_hci_cmd_le_set_data_length {
  1882. uint16_t handle;
  1883. uint16_t tx_len;
  1884. uint16_t tx_time;
  1885. } __attribute__ ((packed));
  1886. struct bt_hci_rsp_le_set_data_length {
  1887. uint8_t status;
  1888. uint16_t handle;
  1889. } __attribute__ ((packed));
  1890. #define BT_HCI_CMD_LE_READ_DEFAULT_DATA_LENGTH 0x2023
  1891. struct bt_hci_rsp_le_read_default_data_length {
  1892. uint8_t status;
  1893. uint16_t tx_len;
  1894. uint16_t tx_time;
  1895. } __attribute__ ((packed));
  1896. #define BT_HCI_CMD_LE_WRITE_DEFAULT_DATA_LENGTH 0x2024
  1897. struct bt_hci_cmd_le_write_default_data_length {
  1898. uint16_t tx_len;
  1899. uint16_t tx_time;
  1900. } __attribute__ ((packed));
  1901. #define BT_HCI_CMD_LE_READ_LOCAL_PK256 0x2025
  1902. #define BT_HCI_CMD_LE_GENERATE_DHKEY 0x2026
  1903. struct bt_hci_cmd_le_generate_dhkey {
  1904. uint8_t remote_pk256[64];
  1905. } __attribute__ ((packed));
  1906. #define BT_HCI_CMD_LE_ADD_TO_RESOLV_LIST 0x2027
  1907. struct bt_hci_cmd_le_add_to_resolv_list {
  1908. uint8_t addr_type;
  1909. uint8_t addr[6];
  1910. uint8_t peer_irk[16];
  1911. uint8_t local_irk[16];
  1912. } __attribute__ ((packed));
  1913. #define BT_HCI_CMD_LE_REMOVE_FROM_RESOLV_LIST 0x2028
  1914. struct bt_hci_cmd_le_remove_from_resolv_list {
  1915. uint8_t addr_type;
  1916. uint8_t addr[6];
  1917. } __attribute__ ((packed));
  1918. #define BT_HCI_CMD_LE_CLEAR_RESOLV_LIST 0x2029
  1919. #define BT_HCI_CMD_LE_READ_RESOLV_LIST_SIZE 0x202a
  1920. struct bt_hci_rsp_le_read_resolv_list_size {
  1921. uint8_t status;
  1922. uint8_t size;
  1923. } __attribute__ ((packed));
  1924. #define BT_HCI_CMD_LE_READ_PEER_RESOLV_ADDR 0x202b
  1925. struct bt_hci_cmd_le_read_peer_resolv_addr {
  1926. uint8_t addr_type;
  1927. uint8_t addr[6];
  1928. } __attribute__ ((packed));
  1929. struct bt_hci_rsp_le_read_peer_resolv_addr {
  1930. uint8_t status;
  1931. uint8_t addr[6];
  1932. } __attribute__ ((packed));
  1933. #define BT_HCI_CMD_LE_READ_LOCAL_RESOLV_ADDR 0x202c
  1934. struct bt_hci_cmd_le_read_local_resolv_addr {
  1935. uint8_t addr_type;
  1936. uint8_t addr[6];
  1937. } __attribute__ ((packed));
  1938. struct bt_hci_rsp_le_read_local_resolv_addr {
  1939. uint8_t status;
  1940. uint8_t addr[6];
  1941. } __attribute__ ((packed));
  1942. #define BT_HCI_CMD_LE_SET_RESOLV_ENABLE 0x202d
  1943. struct bt_hci_cmd_le_set_resolv_enable {
  1944. uint8_t enable;
  1945. } __attribute__ ((packed));
  1946. #define BT_HCI_CMD_LE_SET_RESOLV_TIMEOUT 0x202e
  1947. struct bt_hci_cmd_le_set_resolv_timeout {
  1948. uint16_t timeout;
  1949. } __attribute__ ((packed));
  1950. #define BT_HCI_CMD_LE_READ_MAX_DATA_LENGTH 0x202f
  1951. struct bt_hci_rsp_le_read_max_data_length {
  1952. uint8_t status;
  1953. uint16_t max_tx_len;
  1954. uint16_t max_tx_time;
  1955. uint16_t max_rx_len;
  1956. uint16_t max_rx_time;
  1957. } __attribute__ ((packed));
  1958. #define BT_HCI_CMD_LE_READ_PHY 0x2030
  1959. struct bt_hci_cmd_le_read_phy {
  1960. uint16_t handle;
  1961. } __attribute__((packed));
  1962. struct bt_hci_rsp_le_read_phy {
  1963. uint8_t status;
  1964. uint16_t handle;
  1965. uint8_t tx_phy;
  1966. uint8_t rx_phy;
  1967. } __attribute__((packed));
  1968. #define BT_HCI_CMD_LE_SET_DEFAULT_PHY 0x2031
  1969. struct bt_hci_cmd_le_set_default_phy {
  1970. uint8_t all_phys;
  1971. uint8_t tx_phys;
  1972. uint8_t rx_phys;
  1973. } __attribute__((packed));
  1974. #define BT_HCI_CMD_LE_SET_PHY 0x2032
  1975. struct bt_hci_cmd_le_set_phy {
  1976. uint16_t handle;
  1977. uint8_t all_phys;
  1978. uint8_t tx_phys;
  1979. uint8_t rx_phys;
  1980. uint16_t phy_opts;
  1981. } __attribute__((packed));
  1982. #define BT_HCI_CMD_LE_ENHANCED_RECEIVER_TEST 0x2033
  1983. struct bt_hci_cmd_le_enhanced_receiver_test {
  1984. uint8_t rx_channel;
  1985. uint8_t phy;
  1986. uint8_t modulation_index;
  1987. } __attribute__((packed));
  1988. #define BT_HCI_CMD_LE_ENHANCED_TRANSMITTER_TEST 0x2034
  1989. struct bt_hci_cmd_le_enhanced_transmitter_test {
  1990. uint8_t tx_channel;
  1991. uint8_t data_len;
  1992. uint8_t payload;
  1993. uint8_t phy;
  1994. } __attribute__((packed));
  1995. #define BT_HCI_CMD_LE_SET_ADV_SET_RAND_ADDR 0x2035
  1996. struct bt_hci_cmd_le_set_adv_set_rand_addr {
  1997. uint8_t handle;
  1998. uint8_t bdaddr[6];
  1999. } __attribute__ ((packed));
  2000. #define BT_HCI_CMD_LE_SET_EXT_ADV_PARAMS 0x2036
  2001. struct bt_hci_cmd_le_set_ext_adv_params {
  2002. uint8_t handle;
  2003. uint16_t evt_properties;
  2004. uint8_t min_interval[3];
  2005. uint8_t max_interval[3];
  2006. uint8_t channel_map;
  2007. uint8_t own_addr_type;
  2008. uint8_t peer_addr_type;
  2009. uint8_t peer_addr[6];
  2010. uint8_t filter_policy;
  2011. uint8_t tx_power;
  2012. uint8_t primary_phy;
  2013. uint8_t secondary_max_skip;
  2014. uint8_t secondary_phy;
  2015. uint8_t sid;
  2016. uint8_t notif_enable;
  2017. } __attribute__ ((packed));
  2018. struct bt_hci_rsp_le_set_ext_adv_params {
  2019. uint8_t status;
  2020. uint8_t tx_power;
  2021. } __attribute__ ((packed));
  2022. #define BT_HCI_CMD_LE_SET_EXT_ADV_DATA 0x2037
  2023. struct bt_hci_cmd_le_set_ext_adv_data {
  2024. uint8_t handle;
  2025. uint8_t operation;
  2026. uint8_t fragment_preference;
  2027. uint8_t data_len;
  2028. uint8_t data[0];
  2029. } __attribute__ ((packed));
  2030. #define BT_HCI_CMD_LE_SET_EXT_SCAN_RSP_DATA 0x2038
  2031. struct bt_hci_cmd_le_set_ext_scan_rsp_data {
  2032. uint8_t handle;
  2033. uint8_t operation;
  2034. uint8_t fragment_preference;
  2035. uint8_t data_len;
  2036. uint8_t data[0];
  2037. } __attribute__ ((packed));
  2038. #define BT_HCI_CMD_LE_SET_EXT_ADV_ENABLE 0x2039
  2039. struct bt_hci_cmd_le_set_ext_adv_enable {
  2040. uint8_t enable;
  2041. uint8_t num_of_sets;
  2042. } __attribute__ ((packed));
  2043. struct bt_hci_cmd_ext_adv_set {
  2044. uint8_t handle;
  2045. uint16_t duration;
  2046. uint8_t max_events;
  2047. } __attribute__ ((packed));
  2048. #define BT_HCI_CMD_LE_READ_MAX_ADV_DATA_LEN 0x203a
  2049. struct bt_hci_rsp_le_read_max_adv_data_len {
  2050. uint8_t status;
  2051. uint16_t max_len;
  2052. } __attribute__ ((packed));
  2053. #define BT_HCI_CMD_LE_READ_NUM_SUPPORTED_ADV_SETS 0x203b
  2054. struct bt_hci_rsp_le_read_num_supported_adv_sets {
  2055. uint8_t status;
  2056. uint8_t num_of_sets;
  2057. } __attribute__ ((packed));
  2058. #define BT_HCI_CMD_LE_REMOVE_ADV_SET 0x203c
  2059. struct bt_hci_cmd_le_remove_adv_set {
  2060. uint8_t handle;
  2061. } __attribute__ ((packed));
  2062. #define BT_HCI_CMD_LE_CLEAR_ADV_SETS 0x203d
  2063. #define BT_HCI_CMD_LE_SET_PERIODIC_ADV_PARAMS 0x203e
  2064. struct bt_hci_cmd_le_set_periodic_adv_params {
  2065. uint8_t handle;
  2066. uint16_t min_interval;
  2067. uint16_t max_interval;
  2068. uint16_t properties;
  2069. } __attribute__ ((packed));
  2070. #define BT_HCI_CMD_LE_SET_PERIODIC_ADV_DATA 0x203f
  2071. struct bt_hci_cmd_le_set_periodic_adv_data {
  2072. uint8_t handle;
  2073. uint8_t operation;
  2074. uint8_t data_len;
  2075. uint8_t data[0];
  2076. } __attribute__ ((packed));
  2077. #define BT_HCI_CMD_LE_SET_PERIODIC_ADV_ENABLE 0x2040
  2078. struct bt_hci_cmd_le_set_periodic_adv_enable {
  2079. uint8_t enable;
  2080. uint8_t handle;
  2081. } __attribute__ ((packed));
  2082. #define BT_HCI_CMD_LE_SET_EXT_SCAN_PARAMS 0x2041
  2083. struct bt_hci_cmd_le_set_ext_scan_params {
  2084. uint8_t own_addr_type;
  2085. uint8_t filter_policy;
  2086. uint8_t num_phys;
  2087. uint8_t data[0];
  2088. } __attribute__ ((packed));
  2089. struct bt_hci_le_scan_phy {
  2090. uint8_t type;
  2091. uint16_t interval;
  2092. uint16_t window;
  2093. } __attribute__ ((packed));
  2094. #define BT_HCI_CMD_LE_SET_EXT_SCAN_ENABLE 0x2042
  2095. struct bt_hci_cmd_le_set_ext_scan_enable {
  2096. uint8_t enable;
  2097. uint8_t filter_dup;
  2098. uint16_t duration;
  2099. uint16_t period;
  2100. } __attribute__ ((packed));
  2101. #define BT_HCI_CMD_LE_EXT_CREATE_CONN 0x2043
  2102. struct bt_hci_cmd_le_ext_create_conn {
  2103. uint8_t filter_policy;
  2104. uint8_t own_addr_type;
  2105. uint8_t peer_addr_type;
  2106. uint8_t peer_addr[6];
  2107. uint8_t phys;
  2108. uint8_t data[0];
  2109. } __attribute__ ((packed));
  2110. struct bt_hci_le_ext_create_conn {
  2111. uint16_t scan_interval;
  2112. uint16_t scan_window;
  2113. uint16_t min_interval;
  2114. uint16_t max_interval;
  2115. uint16_t latency;
  2116. uint16_t supv_timeout;
  2117. uint16_t min_length;
  2118. uint16_t max_length;
  2119. } __attribute__ ((packed));
  2120. #define BT_HCI_CMD_LE_PERIODIC_ADV_CREATE_SYNC 0x2044
  2121. struct bt_hci_cmd_le_periodic_adv_create_sync {
  2122. uint8_t options;
  2123. uint8_t sid;
  2124. uint8_t addr_type;
  2125. uint8_t addr[6];
  2126. uint16_t skip;
  2127. uint16_t sync_timeout;
  2128. uint8_t sync_cte_type;
  2129. } __attribute__ ((packed));
  2130. #define BT_HCI_CMD_LE_PERIODIC_ADV_CREATE_SYNC_CANCEL 0x2045
  2131. #define BT_HCI_CMD_LE_PERIODIC_ADV_TERM_SYNC 0x2046
  2132. struct bt_hci_cmd_le_periodic_adv_term_sync {
  2133. uint16_t sync_handle;
  2134. } __attribute__ ((packed));
  2135. #define BT_HCI_CMD_LE_ADD_DEV_PERIODIC_ADV_LIST 0x2047
  2136. struct bt_hci_cmd_le_add_dev_periodic_adv_list {
  2137. uint8_t addr_type;
  2138. uint8_t addr[6];
  2139. uint8_t sid;
  2140. } __attribute__ ((packed));
  2141. #define BT_HCI_CMD_LE_REMOVE_DEV_PERIODIC_ADV_LIST 0x2048
  2142. struct bt_hci_cmd_le_remove_dev_periodic_adv_list {
  2143. uint8_t addr_type;
  2144. uint8_t addr[6];
  2145. uint8_t sid;
  2146. } __attribute__ ((packed));
  2147. #define BT_HCI_CMD_LE_CLEAR_PERIODIC_ADV_LIST 0x2049
  2148. #define BT_HCI_CMD_LE_READ_PERIODIC_ADV_LIST_SIZE 0x204a
  2149. struct bt_hci_rsp_le_read_dev_periodic_adv_list_size {
  2150. uint8_t status;
  2151. uint8_t list_size;
  2152. } __attribute__ ((packed));
  2153. #define BT_HCI_CMD_LE_READ_TX_POWER 0x204b
  2154. struct bt_hci_rsp_le_read_tx_power {
  2155. uint8_t status;
  2156. int8_t min_tx_power;
  2157. int8_t max_tx_power;
  2158. } __attribute__ ((packed));
  2159. #define BT_HCI_CMD_LE_READ_RF_PATH_COMPENSATION 0x204c
  2160. struct bt_hci_rsp_le_read_rf_path_comp {
  2161. uint8_t status;
  2162. uint16_t rf_tx_path_comp;
  2163. uint16_t rf_rx_path_comp;
  2164. } __attribute__ ((packed));
  2165. #define BT_HCI_CMD_LE_WRITE_RF_PATH_COMPENSATION 0x204d
  2166. struct bt_hci_cmd_le_write_rf_path_comp {
  2167. uint16_t rf_tx_path_comp;
  2168. uint16_t rf_rx_path_comp;
  2169. } __attribute__ ((packed));
  2170. #define BT_HCI_CMD_LE_SET_PRIV_MODE 0x204e
  2171. struct bt_hci_cmd_le_set_priv_mode {
  2172. uint8_t peer_id_addr_type;
  2173. uint8_t peer_id_addr[6];
  2174. uint8_t priv_mode;
  2175. } __attribute__ ((packed));
  2176. #define BT_HCI_CMD_LE_RECEIVER_TEST_V3 0x204f
  2177. struct bt_hci_cmd_le_receiver_test_v3 {
  2178. uint8_t rx_chan;
  2179. uint8_t phy;
  2180. uint8_t mod_index;
  2181. uint8_t cte_len;
  2182. uint8_t cte_type;
  2183. uint8_t duration;
  2184. uint8_t num_antenna_id;
  2185. uint8_t antenna_ids[0];
  2186. } __attribute__ ((packed));
  2187. #define BT_HCI_CMD_LE_TX_TEST_V3 0x2050
  2188. struct bt_hci_cmd_le_tx_test_v3 {
  2189. uint8_t chan;
  2190. uint8_t data_len;
  2191. uint8_t payload;
  2192. uint8_t phy;
  2193. uint8_t cte_len;
  2194. uint8_t cte_type;
  2195. uint8_t duration;
  2196. uint8_t num_antenna_id;
  2197. uint8_t antenna_ids[0];
  2198. } __attribute__ ((packed));
  2199. #define BT_HCI_CMD_SET_PERIODIC_ADV_REC_ENABLE 0x2059
  2200. struct bt_hci_cmd_set_periodic_adv_rec_enable {
  2201. uint16_t sync_handle;
  2202. uint8_t enable;
  2203. } __attribute__ ((packed));
  2204. #define BT_HCI_CMD_PERIODIC_SYNC_TRANS 0x205a
  2205. struct bt_hci_cmd_periodic_sync_trans {
  2206. uint16_t handle;
  2207. uint16_t service_data;
  2208. uint16_t sync_handle;
  2209. } __attribute__ ((packed));
  2210. #define BT_HCI_CMD_PERIODIC_ADV_SET_INFO_TRANS 0x205b
  2211. struct bt_hci_cmd_periodic_adv_set_info_trans {
  2212. uint16_t handle;
  2213. uint16_t service_data;
  2214. uint16_t adv_handle;
  2215. } __attribute__ ((packed));
  2216. #define BT_HCI_CMD_PERIODIC_ADV_SYNC_TRANS_PARAMS 0x205c
  2217. struct bt_hci_cmd_periodic_adv_sync_trans_params {
  2218. uint16_t handle;
  2219. uint8_t mode;
  2220. uint16_t skip;
  2221. uint16_t sync_timeout;
  2222. uint8_t cte_type;
  2223. } __attribute__ ((packed));
  2224. #define BT_HCI_CMD_DEFAULT_PERIODIC_ADV_SYNC_TRANS_PARAMS 0x205d
  2225. struct bt_hci_cmd_default_periodic_adv_sync_trans_params {
  2226. uint8_t mode;
  2227. uint16_t skip;
  2228. uint16_t sync_timeout;
  2229. uint8_t cte_type;
  2230. } __attribute__ ((packed));
  2231. #define BT_HCI_CMD_LE_READ_BUFFER_SIZE_V2 0x2060
  2232. #define BT_HCI_BIT_LE_READ_BUFFER_SIZE_V2 BT_HCI_CMD_BIT(41, 5)
  2233. struct bt_hci_rsp_le_read_buffer_size_v2 {
  2234. uint8_t status;
  2235. uint16_t acl_mtu;
  2236. uint8_t acl_max_pkt;
  2237. uint16_t iso_mtu;
  2238. uint8_t iso_max_pkt;
  2239. } __attribute__ ((packed));
  2240. #define BT_HCI_CMD_LE_READ_ISO_TX_SYNC 0x2061
  2241. #define BT_HCI_BIT_LE_READ_ISO_TX_SYNC BT_HCI_CMD_BIT(41, 6)
  2242. struct bt_hci_cmd_le_read_iso_tx_sync {
  2243. uint16_t handle;
  2244. } __attribute__ ((packed));
  2245. struct bt_hci_rsp_le_read_iso_tx_sync {
  2246. uint8_t status;
  2247. uint16_t handle;
  2248. uint16_t seq;
  2249. uint32_t timestamp;
  2250. uint8_t offset[3];
  2251. } __attribute__ ((packed));
  2252. #define BT_HCI_CMD_LE_SET_CIG_PARAMS 0x2062
  2253. #define BT_HCI_BIT_LE_SET_CIG_PARAMS BT_HCI_CMD_BIT(41, 7)
  2254. struct bt_hci_cis_params {
  2255. uint8_t cis_id;
  2256. uint16_t c_sdu;
  2257. uint16_t p_sdu;
  2258. uint8_t c_phy;
  2259. uint8_t p_phy;
  2260. uint8_t c_rtn;
  2261. uint8_t p_rtn;
  2262. } __attribute__ ((packed));
  2263. struct bt_hci_cmd_le_set_cig_params {
  2264. uint8_t cig_id;
  2265. uint8_t c_interval[3];
  2266. uint8_t p_interval[3];
  2267. uint8_t sca;
  2268. uint8_t packing;
  2269. uint8_t framing;
  2270. uint16_t c_latency;
  2271. uint16_t p_latency;
  2272. uint8_t num_cis;
  2273. struct bt_hci_cis_params cis[0];
  2274. } __attribute__ ((packed));
  2275. struct bt_hci_rsp_le_set_cig_params {
  2276. uint8_t status;
  2277. uint8_t cig_id;
  2278. uint8_t num_handles;
  2279. uint16_t handle[0];
  2280. } __attribute__ ((packed));
  2281. #define BT_HCI_CMD_LE_SET_CIG_PARAMS_TEST 0x2063
  2282. #define BT_HCI_BIT_LE_SET_CIG_PARAMS_TEST BT_HCI_CMD_BIT(42, 0)
  2283. struct bt_hci_cis_params_test {
  2284. uint8_t cis_id;
  2285. uint8_t nse;
  2286. uint16_t c_sdu;
  2287. uint16_t p_sdu;
  2288. uint16_t c_pdu;
  2289. uint16_t p_pdu;
  2290. uint8_t c_phy;
  2291. uint8_t p_phy;
  2292. uint8_t c_bn;
  2293. uint8_t p_bn;
  2294. } __attribute__ ((packed));
  2295. struct bt_hci_cmd_le_set_cig_params_test {
  2296. uint8_t cig_id;
  2297. uint8_t c_interval[3];
  2298. uint8_t p_interval[3];
  2299. uint8_t c_ft;
  2300. uint8_t p_ft;
  2301. uint16_t iso_interval;
  2302. uint8_t sca;
  2303. uint8_t packing;
  2304. uint8_t framing;
  2305. uint8_t num_cis;
  2306. struct bt_hci_cis_params_test cis[0];
  2307. } __attribute__ ((packed));
  2308. #define BT_HCI_CMD_LE_CREATE_CIS 0x2064
  2309. #define BT_HCI_BIT_LE_CREATE_CIS BT_HCI_CMD_BIT(42, 1)
  2310. struct bt_hci_cis {
  2311. uint16_t cis_handle;
  2312. uint16_t acl_handle;
  2313. } __attribute__ ((packed));
  2314. struct bt_hci_cmd_le_create_cis {
  2315. uint8_t num_cis;
  2316. struct bt_hci_cis cis[0];
  2317. } __attribute__ ((packed));
  2318. #define BT_HCI_CMD_LE_REMOVE_CIG 0x2065
  2319. #define BT_HCI_BIT_LE_REMOVE_CIG BT_HCI_CMD_BIT(42, 2)
  2320. struct bt_hci_cmd_le_remove_cig {
  2321. uint8_t cig_id;
  2322. } __attribute__ ((packed));
  2323. struct bt_hci_rsp_le_remove_cig {
  2324. uint8_t status;
  2325. uint8_t cig_id;
  2326. } __attribute__ ((packed));
  2327. #define BT_HCI_CMD_LE_ACCEPT_CIS 0x2066
  2328. #define BT_HCI_BIT_LE_ACCEPT_CIS BT_HCI_CMD_BIT(42, 3)
  2329. struct bt_hci_cmd_le_accept_cis {
  2330. uint16_t handle;
  2331. } __attribute__ ((packed));
  2332. #define BT_HCI_CMD_LE_REJECT_CIS 0x2067
  2333. #define BT_HCI_BIT_LE_REJECT_CIS BT_HCI_CMD_BIT(42, 4)
  2334. struct bt_hci_cmd_le_reject_cis {
  2335. uint16_t handle;
  2336. uint8_t reason;
  2337. } __attribute__ ((packed));
  2338. #define BT_HCI_CMD_LE_CREATE_BIG 0x2068
  2339. #define BT_HCI_BIT_LE_CREATE_BIG BT_HCI_CMD_BIT(42, 5)
  2340. struct bt_hci_bis {
  2341. uint8_t sdu_interval[3];
  2342. uint16_t sdu;
  2343. uint16_t latency;
  2344. uint8_t rtn;
  2345. uint8_t phy;
  2346. uint8_t packing;
  2347. uint8_t framing;
  2348. uint8_t encryption;
  2349. uint8_t bcode[16];
  2350. } __attribute__ ((packed));
  2351. struct bt_hci_cmd_le_create_big {
  2352. uint8_t handle;
  2353. uint8_t adv_handle;
  2354. uint8_t num_bis;
  2355. struct bt_hci_bis bis[0];
  2356. } __attribute__ ((packed));
  2357. #define BT_HCI_CMD_LE_CREATE_BIG_TEST 0x2069
  2358. #define BT_HCI_BIT_LE_CREATE_BIG_TEST BT_HCI_CMD_BIT(42, 6)
  2359. struct bt_hci_bis_test {
  2360. uint8_t sdu_interval[3];
  2361. uint16_t iso_interval;
  2362. uint8_t nse;
  2363. uint16_t sdu;
  2364. uint8_t pdu;
  2365. uint8_t phy;
  2366. uint8_t packing;
  2367. uint8_t framing;
  2368. uint8_t bn;
  2369. uint8_t irc;
  2370. uint8_t pto;
  2371. uint8_t adv_handle;
  2372. uint8_t encryption;
  2373. uint8_t bcode[16];
  2374. } __attribute__ ((packed));
  2375. struct bt_hci_cmd_le_create_big_test {
  2376. uint8_t big_id;
  2377. uint8_t adv_handle;
  2378. uint8_t num_bis;
  2379. struct bt_hci_bis_test bis[0];
  2380. } __attribute__ ((packed));
  2381. #define BT_HCI_CMD_LE_TERM_BIG 0x206a
  2382. #define BT_HCI_BIT_LE_TERM_BIG BT_HCI_CMD_BIT(42, 7)
  2383. struct bt_hci_cmd_le_term_big {
  2384. uint8_t handle;
  2385. uint8_t reason;
  2386. } __attribute__ ((packed));
  2387. #define BT_HCI_CMD_LE_BIG_CREATE_SYNC 0x206b
  2388. #define BT_HCI_BIT_LE_BIG_CREATE_SYNC BT_HCI_CMD_BIT(43, 0)
  2389. struct bt_hci_bis_sync {
  2390. } __attribute__ ((packed));
  2391. struct bt_hci_cmd_le_big_create_sync {
  2392. uint8_t handle;
  2393. uint16_t sync_handle;
  2394. uint8_t encryption;
  2395. uint8_t bcode[16];
  2396. uint8_t mse;
  2397. uint16_t timeout;
  2398. uint8_t num_bis;
  2399. struct bt_hci_bis_sync bis[0];
  2400. } __attribute__ ((packed));
  2401. #define BT_HCI_CMD_LE_BIG_TERM_SYNC 0x206c
  2402. #define BT_HCI_BIT_LE_BIG_TERM_SYNC BT_HCI_CMD_BIT(43, 1)
  2403. struct bt_hci_cmd_le_big_term_sync {
  2404. uint8_t handle;
  2405. } __attribute__ ((packed));
  2406. #define BT_HCI_CMD_LE_REQ_PEER_SCA 0x206d
  2407. #define BT_HCI_BIT_LE_REQ_PEER_SCA BT_HCI_CMD_BIT(43, 2)
  2408. struct bt_hci_cmd_le_req_peer_sca {
  2409. uint16_t handle;
  2410. } __attribute__ ((packed));
  2411. #define BT_HCI_CMD_LE_SETUP_ISO_PATH 0x206e
  2412. #define BT_HCI_BIT_LE_SETUP_ISO_PATH BT_HCI_CMD_BIT(43, 3)
  2413. struct bt_hci_cmd_le_setup_iso_path {
  2414. uint16_t handle;
  2415. uint8_t direction;
  2416. uint8_t path;
  2417. uint8_t codec;
  2418. uint16_t codec_cid;
  2419. uint16_t codec_vid;
  2420. uint8_t delay[3];
  2421. uint8_t codec_cfg_len;
  2422. uint8_t codec_cfg[0];
  2423. } __attribute__ ((packed));
  2424. struct bt_hci_rsp_le_setup_iso_path {
  2425. uint8_t status;
  2426. uint16_t handle;
  2427. } __attribute__ ((packed));
  2428. #define BT_HCI_CMD_LE_REMOVE_ISO_PATH 0x206f
  2429. #define BT_HCI_BIT_LE_REMOVE_ISO_PATH BT_HCI_CMD_BIT(43, 4)
  2430. struct bt_hci_cmd_le_remove_iso_path {
  2431. uint16_t handle;
  2432. uint8_t direction;
  2433. } __attribute__ ((packed));
  2434. #define BT_HCI_CMD_LE_ISO_TX_TEST 0x2070
  2435. #define BT_HCI_BIT_LE_ISO_TX_TEST BT_HCI_CMD_BIT(43, 5)
  2436. #define BT_HCI_CMD_LE_ISO_RX_TEST 0x2071
  2437. #define BT_HCI_BIT_LE_ISO_RX_TEST BT_HCI_CMD_BIT(43, 6)
  2438. #define BT_HCI_CMD_LE_ISO_READ_TEST_COUNTER 0x2072
  2439. #define BT_HCI_BIT_LE_ISO_READ_TEST_COUNTER BT_HCI_CMD_BIT(43, 7)
  2440. #define BT_HCI_CMD_LE_ISO_TEST_END 0x2073
  2441. #define BT_HCI_BIT_LE_ISO_TEST_END BT_HCI_CMD_BIT(44, 0)
  2442. #define BT_HCI_CMD_LE_SET_HOST_FEATURE 0x2074
  2443. #define BT_HCI_BIT_LE_SET_HOST_FEATURE BT_HCI_CMD_BIT(44, 1)
  2444. struct bt_hci_cmd_le_set_host_feature {
  2445. uint8_t bit_number;
  2446. uint8_t bit_value;
  2447. } __attribute__ ((packed));
  2448. #define BT_HCI_EVT_INQUIRY_COMPLETE 0x01
  2449. struct bt_hci_evt_inquiry_complete {
  2450. uint8_t status;
  2451. } __attribute__ ((packed));
  2452. #define BT_HCI_EVT_INQUIRY_RESULT 0x02
  2453. struct bt_hci_evt_inquiry_result {
  2454. uint8_t num_resp;
  2455. uint8_t bdaddr[6];
  2456. uint8_t pscan_rep_mode;
  2457. uint8_t pscan_period_mode;
  2458. uint8_t pscan_mode;
  2459. uint8_t dev_class[3];
  2460. uint16_t clock_offset;
  2461. } __attribute__ ((packed));
  2462. #define BT_HCI_EVT_CONN_COMPLETE 0x03
  2463. struct bt_hci_evt_conn_complete {
  2464. uint8_t status;
  2465. uint16_t handle;
  2466. uint8_t bdaddr[6];
  2467. uint8_t link_type;
  2468. uint8_t encr_mode;
  2469. } __attribute__ ((packed));
  2470. #define BT_HCI_EVT_CONN_REQUEST 0x04
  2471. struct bt_hci_evt_conn_request {
  2472. uint8_t bdaddr[6];
  2473. uint8_t dev_class[3];
  2474. uint8_t link_type;
  2475. } __attribute__ ((packed));
  2476. #define BT_HCI_EVT_DISCONNECT_COMPLETE 0x05
  2477. struct bt_hci_evt_disconnect_complete {
  2478. uint8_t status;
  2479. uint16_t handle;
  2480. uint8_t reason;
  2481. } __attribute__ ((packed));
  2482. #define BT_HCI_EVT_AUTH_COMPLETE 0x06
  2483. struct bt_hci_evt_auth_complete {
  2484. uint8_t status;
  2485. uint16_t handle;
  2486. } __attribute__ ((packed));
  2487. #define BT_HCI_EVT_REMOTE_NAME_REQUEST_COMPLETE 0x07
  2488. struct bt_hci_evt_remote_name_request_complete {
  2489. uint8_t status;
  2490. uint8_t bdaddr[6];
  2491. uint8_t name[248];
  2492. } __attribute__ ((packed));
  2493. #define BT_HCI_EVT_ENCRYPT_CHANGE 0x08
  2494. struct bt_hci_evt_encrypt_change {
  2495. uint8_t status;
  2496. uint16_t handle;
  2497. uint8_t encr_mode;
  2498. } __attribute__ ((packed));
  2499. #define BT_HCI_EVT_CHANGE_CONN_LINK_KEY_COMPLETE 0x09
  2500. struct bt_hci_evt_change_conn_link_key_complete {
  2501. uint8_t status;
  2502. uint16_t handle;
  2503. } __attribute__ ((packed));
  2504. #define BT_HCI_EVT_LINK_KEY_TYPE_CHANGED 0x0a
  2505. struct bt_hci_evt_link_key_type_changed {
  2506. uint8_t status;
  2507. uint16_t handle;
  2508. uint8_t key_flag;
  2509. } __attribute__ ((packed));
  2510. #define BT_HCI_EVT_REMOTE_FEATURES_COMPLETE 0x0b
  2511. struct bt_hci_evt_remote_features_complete {
  2512. uint8_t status;
  2513. uint16_t handle;
  2514. uint8_t features[8];
  2515. } __attribute__ ((packed));
  2516. #define BT_HCI_EVT_REMOTE_VERSION_COMPLETE 0x0c
  2517. struct bt_hci_evt_remote_version_complete {
  2518. uint8_t status;
  2519. uint16_t handle;
  2520. uint8_t lmp_ver;
  2521. uint16_t manufacturer;
  2522. uint16_t lmp_subver;
  2523. } __attribute__ ((packed));
  2524. #define BT_HCI_EVT_QOS_SETUP_COMPLETE 0x0d
  2525. struct bt_hci_evt_qos_setup_complete {
  2526. uint8_t status;
  2527. uint16_t handle;
  2528. uint8_t flags;
  2529. uint8_t service_type;
  2530. uint32_t token_rate;
  2531. uint32_t peak_bandwidth;
  2532. uint32_t latency;
  2533. uint32_t delay_variation;
  2534. } __attribute__ ((packed));
  2535. #define BT_HCI_EVT_CMD_COMPLETE 0x0e
  2536. struct bt_hci_evt_cmd_complete {
  2537. uint8_t ncmd;
  2538. uint16_t opcode;
  2539. } __attribute__ ((packed));
  2540. #define BT_HCI_EVT_CMD_STATUS 0x0f
  2541. struct bt_hci_evt_cmd_status {
  2542. uint8_t status;
  2543. uint8_t ncmd;
  2544. uint16_t opcode;
  2545. } __attribute__ ((packed));
  2546. #define BT_HCI_EVT_HARDWARE_ERROR 0x10
  2547. struct bt_hci_evt_hardware_error {
  2548. uint8_t code;
  2549. } __attribute__ ((packed));
  2550. #define BT_HCI_EVT_FLUSH_OCCURRED 0x11
  2551. struct bt_hci_evt_flush_occurred {
  2552. uint16_t handle;
  2553. } __attribute__ ((packed));
  2554. #define BT_HCI_EVT_ROLE_CHANGE 0x12
  2555. struct bt_hci_evt_role_change {
  2556. uint8_t status;
  2557. uint8_t bdaddr[6];
  2558. uint8_t role;
  2559. } __attribute__ ((packed));
  2560. #define BT_HCI_EVT_NUM_COMPLETED_PACKETS 0x13
  2561. struct bt_hci_evt_num_completed_packets {
  2562. uint8_t num_handles;
  2563. uint16_t handle;
  2564. uint16_t count;
  2565. } __attribute__ ((packed));
  2566. #define BT_HCI_EVT_MODE_CHANGE 0x14
  2567. struct bt_hci_evt_mode_change {
  2568. uint8_t status;
  2569. uint16_t handle;
  2570. uint8_t mode;
  2571. uint16_t interval;
  2572. } __attribute__ ((packed));
  2573. #define BT_HCI_EVT_RETURN_LINK_KEYS 0x15
  2574. struct bt_hci_evt_return_link_keys {
  2575. uint8_t num_keys;
  2576. uint8_t keys[0];
  2577. } __attribute__ ((packed));
  2578. #define BT_HCI_EVT_PIN_CODE_REQUEST 0x16
  2579. struct bt_hci_evt_pin_code_request {
  2580. uint8_t bdaddr[6];
  2581. } __attribute__ ((packed));
  2582. #define BT_HCI_EVT_LINK_KEY_REQUEST 0x17
  2583. struct bt_hci_evt_link_key_request {
  2584. uint8_t bdaddr[6];
  2585. } __attribute__ ((packed));
  2586. #define BT_HCI_EVT_LINK_KEY_NOTIFY 0x18
  2587. struct bt_hci_evt_link_key_notify {
  2588. uint8_t bdaddr[6];
  2589. uint8_t link_key[16];
  2590. uint8_t key_type;
  2591. } __attribute__ ((packed));
  2592. #define BT_HCI_EVT_LOOPBACK_COMMAND 0x19
  2593. #define BT_HCI_EVT_DATA_BUFFER_OVERFLOW 0x1a
  2594. struct bt_hci_evt_data_buffer_overflow {
  2595. uint8_t link_type;
  2596. } __attribute__ ((packed));
  2597. #define BT_HCI_EVT_MAX_SLOTS_CHANGE 0x1b
  2598. struct bt_hci_evt_max_slots_change {
  2599. uint16_t handle;
  2600. uint8_t max_slots;
  2601. } __attribute__ ((packed));
  2602. #define BT_HCI_EVT_CLOCK_OFFSET_COMPLETE 0x1c
  2603. struct bt_hci_evt_clock_offset_complete {
  2604. uint8_t status;
  2605. uint16_t handle;
  2606. uint16_t clock_offset;
  2607. } __attribute__ ((packed));
  2608. #define BT_HCI_EVT_CONN_PKT_TYPE_CHANGED 0x1d
  2609. struct bt_hci_evt_conn_pkt_type_changed {
  2610. uint8_t status;
  2611. uint16_t handle;
  2612. uint16_t pkt_type;
  2613. } __attribute__ ((packed));
  2614. #define BT_HCI_EVT_QOS_VIOLATION 0x1e
  2615. struct bt_hci_evt_qos_violation {
  2616. uint16_t handle;
  2617. } __attribute__ ((packed));
  2618. #define BT_HCI_EVT_PSCAN_MODE_CHANGE 0x1f
  2619. struct bt_hci_evt_pscan_mode_change {
  2620. uint8_t bdaddr[6];
  2621. uint8_t pscan_mode;
  2622. } __attribute__ ((packed));
  2623. #define BT_HCI_EVT_PSCAN_REP_MODE_CHANGE 0x20
  2624. struct bt_hci_evt_pscan_rep_mode_change {
  2625. uint8_t bdaddr[6];
  2626. uint8_t pscan_rep_mode;
  2627. } __attribute__ ((packed));
  2628. #define BT_HCI_EVT_FLOW_SPEC_COMPLETE 0x21
  2629. struct bt_hci_evt_flow_spec_complete {
  2630. uint8_t status;
  2631. uint16_t handle;
  2632. uint8_t flags;
  2633. uint8_t direction;
  2634. uint8_t service_type;
  2635. uint32_t token_rate;
  2636. uint32_t token_bucket_size;
  2637. uint32_t peak_bandwidth;
  2638. uint32_t access_latency;
  2639. } __attribute__ ((packed));
  2640. #define BT_HCI_EVT_INQUIRY_RESULT_WITH_RSSI 0x22
  2641. struct bt_hci_evt_inquiry_result_with_rssi {
  2642. uint8_t num_resp;
  2643. uint8_t bdaddr[6];
  2644. uint8_t pscan_rep_mode;
  2645. uint8_t pscan_period_mode;
  2646. uint8_t dev_class[3];
  2647. uint16_t clock_offset;
  2648. int8_t rssi;
  2649. } __attribute__ ((packed));
  2650. #define BT_HCI_EVT_REMOTE_EXT_FEATURES_COMPLETE 0x23
  2651. struct bt_hci_evt_remote_ext_features_complete {
  2652. uint8_t status;
  2653. uint16_t handle;
  2654. uint8_t page;
  2655. uint8_t max_page;
  2656. uint8_t features[8];
  2657. } __attribute__ ((packed));
  2658. #define BT_HCI_EVT_SYNC_CONN_COMPLETE 0x2c
  2659. struct bt_hci_evt_sync_conn_complete {
  2660. uint8_t status;
  2661. uint16_t handle;
  2662. uint8_t bdaddr[6];
  2663. uint8_t link_type;
  2664. uint8_t tx_interval;
  2665. uint8_t retrans_window;
  2666. uint16_t rx_pkt_len;
  2667. uint16_t tx_pkt_len;
  2668. uint8_t air_mode;
  2669. } __attribute__ ((packed));
  2670. #define BT_HCI_EVT_SYNC_CONN_CHANGED 0x2d
  2671. struct bt_hci_evt_sync_conn_changed {
  2672. uint8_t status;
  2673. uint16_t handle;
  2674. uint8_t tx_interval;
  2675. uint8_t retrans_window;
  2676. uint16_t rx_pkt_len;
  2677. uint16_t tx_pkt_len;
  2678. } __attribute__ ((packed));
  2679. #define BT_HCI_EVT_SNIFF_SUBRATING 0x2e
  2680. struct bt_hci_evt_sniff_subrating {
  2681. uint8_t status;
  2682. uint16_t handle;
  2683. uint16_t max_tx_latency;
  2684. uint16_t max_rx_latency;
  2685. uint16_t min_remote_timeout;
  2686. uint16_t min_local_timeout;
  2687. } __attribute__ ((packed));
  2688. #define BT_HCI_EVT_EXT_INQUIRY_RESULT 0x2f
  2689. struct bt_hci_evt_ext_inquiry_result {
  2690. uint8_t num_resp;
  2691. uint8_t bdaddr[6];
  2692. uint8_t pscan_rep_mode;
  2693. uint8_t pscan_period_mode;
  2694. uint8_t dev_class[3];
  2695. uint16_t clock_offset;
  2696. int8_t rssi;
  2697. uint8_t data[240];
  2698. } __attribute__ ((packed));
  2699. #define BT_HCI_EVT_ENCRYPT_KEY_REFRESH_COMPLETE 0x30
  2700. struct bt_hci_evt_encrypt_key_refresh_complete {
  2701. uint8_t status;
  2702. uint16_t handle;
  2703. } __attribute__ ((packed));
  2704. #define BT_HCI_EVT_IO_CAPABILITY_REQUEST 0x31
  2705. struct bt_hci_evt_io_capability_request {
  2706. uint8_t bdaddr[6];
  2707. } __attribute__ ((packed));
  2708. #define BT_HCI_EVT_IO_CAPABILITY_RESPONSE 0x32
  2709. struct bt_hci_evt_io_capability_response {
  2710. uint8_t bdaddr[6];
  2711. uint8_t capability;
  2712. uint8_t oob_data;
  2713. uint8_t authentication;
  2714. } __attribute__ ((packed));
  2715. #define BT_HCI_EVT_USER_CONFIRM_REQUEST 0x33
  2716. struct bt_hci_evt_user_confirm_request {
  2717. uint8_t bdaddr[6];
  2718. uint32_t passkey;
  2719. } __attribute__ ((packed));
  2720. #define BT_HCI_EVT_USER_PASSKEY_REQUEST 0x34
  2721. struct bt_hci_evt_user_passkey_request {
  2722. uint8_t bdaddr[6];
  2723. } __attribute__ ((packed));
  2724. #define BT_HCI_EVT_REMOTE_OOB_DATA_REQUEST 0x35
  2725. struct bt_hci_evt_remote_oob_data_request {
  2726. uint8_t bdaddr[6];
  2727. } __attribute__ ((packed));
  2728. #define BT_HCI_EVT_SIMPLE_PAIRING_COMPLETE 0x36
  2729. struct bt_hci_evt_simple_pairing_complete {
  2730. uint8_t status;
  2731. uint8_t bdaddr[6];
  2732. } __attribute__ ((packed));
  2733. #define BT_HCI_EVT_LINK_SUPV_TIMEOUT_CHANGED 0x38
  2734. struct bt_hci_evt_link_supv_timeout_changed {
  2735. uint16_t handle;
  2736. uint16_t timeout;
  2737. } __attribute__ ((packed));
  2738. #define BT_HCI_EVT_ENHANCED_FLUSH_COMPLETE 0x39
  2739. struct bt_hci_evt_enhanced_flush_complete {
  2740. uint16_t handle;
  2741. } __attribute__ ((packed));
  2742. #define BT_HCI_EVT_USER_PASSKEY_NOTIFY 0x3b
  2743. struct bt_hci_evt_user_passkey_notify {
  2744. uint8_t bdaddr[6];
  2745. uint32_t passkey;
  2746. } __attribute__ ((packed));
  2747. #define BT_HCI_EVT_KEYPRESS_NOTIFY 0x3c
  2748. struct bt_hci_evt_keypress_notify {
  2749. uint8_t bdaddr[6];
  2750. uint8_t type;
  2751. } __attribute__ ((packed));
  2752. #define BT_HCI_EVT_REMOTE_HOST_FEATURES_NOTIFY 0x3d
  2753. struct bt_hci_evt_remote_host_features_notify {
  2754. uint8_t bdaddr[6];
  2755. uint8_t features[8];
  2756. } __attribute__ ((packed));
  2757. #define BT_HCI_EVT_LE_META_EVENT 0x3e
  2758. #define BT_HCI_EVT_PHY_LINK_COMPLETE 0x40
  2759. struct bt_hci_evt_phy_link_complete {
  2760. uint8_t status;
  2761. uint8_t phy_handle;
  2762. } __attribute__ ((packed));
  2763. #define BT_HCI_EVT_CHANNEL_SELECTED 0x41
  2764. struct bt_hci_evt_channel_selected {
  2765. uint8_t phy_handle;
  2766. } __attribute__ ((packed));
  2767. #define BT_HCI_EVT_DISCONN_PHY_LINK_COMPLETE 0x42
  2768. struct bt_hci_evt_disconn_phy_link_complete {
  2769. uint8_t status;
  2770. uint8_t phy_handle;
  2771. uint8_t reason;
  2772. } __attribute__ ((packed));
  2773. #define BT_HCI_EVT_PHY_LINK_LOSS_EARLY_WARNING 0x43
  2774. struct bt_hci_evt_phy_link_loss_early_warning {
  2775. uint8_t phy_handle;
  2776. uint8_t reason;
  2777. } __attribute__ ((packed));
  2778. #define BT_HCI_EVT_PHY_LINK_RECOVERY 0x44
  2779. struct bt_hci_evt_phy_link_recovery {
  2780. uint8_t phy_handle;
  2781. } __attribute__ ((packed));
  2782. #define BT_HCI_EVT_LOGIC_LINK_COMPLETE 0x45
  2783. struct bt_hci_evt_logic_link_complete {
  2784. uint8_t status;
  2785. uint16_t handle;
  2786. uint8_t phy_handle;
  2787. uint8_t flow_spec;
  2788. } __attribute__ ((packed));
  2789. #define BT_HCI_EVT_DISCONN_LOGIC_LINK_COMPLETE 0x46
  2790. struct bt_hci_evt_disconn_logic_link_complete {
  2791. uint8_t status;
  2792. uint16_t handle;
  2793. uint8_t reason;
  2794. } __attribute__ ((packed));
  2795. #define BT_HCI_EVT_FLOW_SPEC_MODIFY_COMPLETE 0x47
  2796. struct bt_hci_evt_flow_spec_modify_complete {
  2797. uint8_t status;
  2798. uint16_t handle;
  2799. } __attribute__ ((packed));
  2800. #define BT_HCI_EVT_NUM_COMPLETED_DATA_BLOCKS 0x48
  2801. struct bt_hci_evt_num_completed_data_blocks {
  2802. uint16_t total_num_blocks;
  2803. uint8_t num_handles;
  2804. uint16_t handle;
  2805. uint16_t num_packets;
  2806. uint16_t num_blocks;
  2807. } __attribute__ ((packed));
  2808. #define BT_HCI_EVT_SHORT_RANGE_MODE_CHANGE 0x4c
  2809. struct bt_hci_evt_short_range_mode_change {
  2810. uint8_t status;
  2811. uint8_t phy_handle;
  2812. uint8_t mode;
  2813. } __attribute__ ((packed));
  2814. #define BT_HCI_EVT_AMP_STATUS_CHANGE 0x4d
  2815. struct bt_hci_evt_amp_status_change {
  2816. uint8_t status;
  2817. uint8_t amp_status;
  2818. } __attribute__ ((packed));
  2819. #define BT_HCI_EVT_TRIGGERED_CLOCK_CAPTURE 0x4e
  2820. struct bt_hci_evt_triggered_clock_capture {
  2821. uint16_t handle;
  2822. uint8_t type;
  2823. uint32_t clock;
  2824. uint16_t clock_offset;
  2825. } __attribute__ ((packed));
  2826. #define BT_HCI_EVT_SYNC_TRAIN_COMPLETE 0x4f
  2827. struct bt_hci_evt_sync_train_complete {
  2828. uint8_t status;
  2829. } __attribute__ ((packed));
  2830. #define BT_HCI_EVT_SYNC_TRAIN_RECEIVED 0x50
  2831. struct bt_hci_evt_sync_train_received {
  2832. uint8_t status;
  2833. uint8_t bdaddr[6];
  2834. uint32_t offset;
  2835. uint8_t map[10];
  2836. uint8_t lt_addr;
  2837. uint32_t instant;
  2838. uint16_t interval;
  2839. uint8_t service_data;
  2840. } __attribute__ ((packed));
  2841. #define BT_HCI_EVT_PERIPHERAL_BROADCAST_RECEIVE 0x51
  2842. struct bt_hci_evt_peripheral_broadcast_receive {
  2843. uint8_t bdaddr[6];
  2844. uint8_t lt_addr;
  2845. uint32_t clock;
  2846. uint32_t offset;
  2847. uint8_t status;
  2848. uint8_t fragment;
  2849. uint8_t length;
  2850. } __attribute__ ((packed));
  2851. #define BT_HCI_EVT_PERIPHERAL_BROADCAST_TIMEOUT 0x52
  2852. struct bt_hci_evt_peripheral_broadcast_timeout {
  2853. uint8_t bdaddr[6];
  2854. uint8_t lt_addr;
  2855. } __attribute__ ((packed));
  2856. #define BT_HCI_EVT_TRUNCATED_PAGE_COMPLETE 0x53
  2857. struct bt_hci_evt_truncated_page_complete {
  2858. uint8_t status;
  2859. uint8_t bdaddr[6];
  2860. } __attribute__ ((packed));
  2861. #define BT_HCI_EVT_PERIPHERAL_PAGE_RESPONSE_TIMEOUT 0x54
  2862. #define BT_HCI_EVT_PERIPHERAL_BROADCAST_CHANNEL_MAP_CHANGE 0x55
  2863. struct bt_hci_evt_channel_map_change {
  2864. uint8_t map[10];
  2865. } __attribute__ ((packed));
  2866. #define BT_HCI_EVT_INQUIRY_RESPONSE_NOTIFY 0x56
  2867. struct bt_hci_evt_inquiry_response_notify {
  2868. uint8_t lap[3];
  2869. int8_t rssi;
  2870. } __attribute__ ((packed));
  2871. #define BT_HCI_EVT_AUTH_PAYLOAD_TIMEOUT_EXPIRED 0x57
  2872. struct bt_hci_evt_auth_payload_timeout_expired {
  2873. uint16_t handle;
  2874. } __attribute__ ((packed));
  2875. #define BT_HCI_EVT_LE_CONN_COMPLETE 0x01
  2876. struct bt_hci_evt_le_conn_complete {
  2877. uint8_t status;
  2878. uint16_t handle;
  2879. uint8_t role;
  2880. uint8_t peer_addr_type;
  2881. uint8_t peer_addr[6];
  2882. uint16_t interval;
  2883. uint16_t latency;
  2884. uint16_t supv_timeout;
  2885. uint8_t clock_accuracy;
  2886. } __attribute__ ((packed));
  2887. #define BT_HCI_EVT_LE_ADV_REPORT 0x02
  2888. struct bt_hci_evt_le_adv_report {
  2889. uint8_t num_reports;
  2890. uint8_t event_type;
  2891. uint8_t addr_type;
  2892. uint8_t addr[6];
  2893. uint8_t data_len;
  2894. uint8_t data[0];
  2895. } __attribute__ ((packed));
  2896. #define BT_HCI_EVT_LE_CONN_UPDATE_COMPLETE 0x03
  2897. struct bt_hci_evt_le_conn_update_complete {
  2898. uint8_t status;
  2899. uint16_t handle;
  2900. uint16_t interval;
  2901. uint16_t latency;
  2902. uint16_t supv_timeout;
  2903. } __attribute__ ((packed));
  2904. #define BT_HCI_EVT_LE_REMOTE_FEATURES_COMPLETE 0x04
  2905. struct bt_hci_evt_le_remote_features_complete {
  2906. uint8_t status;
  2907. uint16_t handle;
  2908. uint8_t features[8];
  2909. } __attribute__ ((packed));
  2910. #define BT_HCI_EVT_LE_LONG_TERM_KEY_REQUEST 0x05
  2911. struct bt_hci_evt_le_long_term_key_request {
  2912. uint16_t handle;
  2913. uint64_t rand;
  2914. uint16_t ediv;
  2915. } __attribute__ ((packed));
  2916. #define BT_HCI_EVT_LE_CONN_PARAM_REQUEST 0x06
  2917. struct bt_hci_evt_le_conn_param_request {
  2918. uint16_t handle;
  2919. uint16_t min_interval;
  2920. uint16_t max_interval;
  2921. uint16_t latency;
  2922. uint16_t supv_timeout;
  2923. } __attribute__ ((packed));
  2924. #define BT_HCI_EVT_LE_DATA_LENGTH_CHANGE 0x07
  2925. struct bt_hci_evt_le_data_length_change {
  2926. uint16_t handle;
  2927. uint16_t max_tx_len;
  2928. uint16_t max_tx_time;
  2929. uint16_t max_rx_len;
  2930. uint16_t max_rx_time;
  2931. } __attribute__ ((packed));
  2932. #define BT_HCI_EVT_LE_READ_LOCAL_PK256_COMPLETE 0x08
  2933. struct bt_hci_evt_le_read_local_pk256_complete {
  2934. uint8_t status;
  2935. uint8_t local_pk256[64];
  2936. } __attribute__ ((packed));
  2937. #define BT_HCI_EVT_LE_GENERATE_DHKEY_COMPLETE 0x09
  2938. struct bt_hci_evt_le_generate_dhkey_complete {
  2939. uint8_t status;
  2940. uint8_t dhkey[32];
  2941. } __attribute__ ((packed));
  2942. #define BT_HCI_EVT_LE_ENHANCED_CONN_COMPLETE 0x0a
  2943. struct bt_hci_evt_le_enhanced_conn_complete {
  2944. uint8_t status;
  2945. uint16_t handle;
  2946. uint8_t role;
  2947. uint8_t peer_addr_type;
  2948. uint8_t peer_addr[6];
  2949. uint8_t local_rpa[6];
  2950. uint8_t peer_rpa[6];
  2951. uint16_t interval;
  2952. uint16_t latency;
  2953. uint16_t supv_timeout;
  2954. uint8_t clock_accuracy;
  2955. } __attribute__ ((packed));
  2956. #define BT_HCI_EVT_LE_DIRECT_ADV_REPORT 0x0b
  2957. struct bt_hci_evt_le_direct_adv_report {
  2958. uint8_t num_reports;
  2959. uint8_t event_type;
  2960. uint8_t addr_type;
  2961. uint8_t addr[6];
  2962. uint8_t direct_addr_type;
  2963. uint8_t direct_addr[6];
  2964. int8_t rssi;
  2965. } __attribute__ ((packed));
  2966. #define BT_HCI_EVT_LE_PHY_UPDATE_COMPLETE 0x0c
  2967. struct bt_hci_evt_le_phy_update_complete {
  2968. uint8_t status;
  2969. uint16_t handle;
  2970. uint8_t tx_phy;
  2971. uint8_t rx_phy;
  2972. } __attribute__ ((packed));
  2973. #define BT_HCI_EVT_LE_EXT_ADV_REPORT 0x0d
  2974. struct bt_hci_evt_le_ext_adv_report {
  2975. uint8_t num_reports;
  2976. } __attribute__ ((packed));
  2977. struct bt_hci_le_ext_adv_report {
  2978. uint16_t event_type;
  2979. uint8_t addr_type;
  2980. uint8_t addr[6];
  2981. uint8_t primary_phy;
  2982. uint8_t secondary_phy;
  2983. uint8_t sid;
  2984. uint8_t tx_power;
  2985. int8_t rssi;
  2986. uint16_t interval;
  2987. uint8_t direct_addr_type;
  2988. uint8_t direct_addr[6];
  2989. uint8_t data_len;
  2990. uint8_t data[0];
  2991. } __attribute__ ((packed));
  2992. #define BT_HCI_EVT_LE_PER_SYNC_ESTABLISHED 0x0e
  2993. struct bt_hci_evt_le_per_sync_established {
  2994. uint8_t status;
  2995. uint16_t handle;
  2996. uint8_t sid;
  2997. uint8_t addr_type;
  2998. uint8_t addr[6];
  2999. uint8_t phy;
  3000. uint16_t interval;
  3001. uint8_t clock_accuracy;
  3002. } __attribute__ ((packed));
  3003. #define BT_HCI_EVT_LE_PER_ADV_REPORT 0x0f
  3004. struct bt_hci_le_per_adv_report {
  3005. uint16_t handle;
  3006. uint8_t tx_power;
  3007. int8_t rssi;
  3008. uint8_t cte_type;
  3009. uint8_t data_status;
  3010. uint8_t data_len;
  3011. uint8_t data[0];
  3012. } __attribute__ ((packed));
  3013. #define BT_HCI_EVT_LE_PER_SYNC_LOST 0x10
  3014. struct bt_hci_evt_le_per_sync_lost {
  3015. uint16_t handle;
  3016. } __attribute__ ((packed));
  3017. #define BT_HCI_EVT_LE_ADV_SET_TERM 0x12
  3018. struct bt_hci_evt_le_adv_set_term {
  3019. uint8_t status;
  3020. uint8_t handle;
  3021. uint16_t conn_handle;
  3022. uint8_t num_evts;
  3023. } __attribute__ ((packed));
  3024. #define BT_HCI_EVT_LE_SCAN_REQ_RECEIVED 0x13
  3025. struct bt_hci_evt_le_scan_req_received {
  3026. uint8_t handle;
  3027. uint8_t scanner_addr_type;
  3028. uint8_t scanner_addr[6];
  3029. } __attribute__ ((packed));
  3030. #define BT_HCI_EVT_LE_CHAN_SELECT_ALG 0x14
  3031. struct bt_hci_evt_le_chan_select_alg {
  3032. uint16_t handle;
  3033. uint8_t algorithm;
  3034. } __attribute__ ((packed));
  3035. #define BT_HCI_EVT_LE_CTE_REQUEST_FAILED 0x17
  3036. struct bt_hci_evt_le_cte_request_failed {
  3037. uint8_t status;
  3038. uint16_t handle;
  3039. } __attribute__ ((packed));
  3040. #define BT_HCI_EVT_LE_PER_ADV_SYNC_TRANS_REC 0x18
  3041. struct bt_hci_evt_le_per_adv_sync_trans_rec {
  3042. uint8_t status;
  3043. uint16_t handle;
  3044. uint16_t service_data;
  3045. uint16_t sync_handle;
  3046. uint8_t sid;
  3047. uint8_t addr_type;
  3048. uint8_t addr[6];
  3049. uint8_t phy;
  3050. uint16_t interval;
  3051. uint8_t clock_accuracy;
  3052. } __attribute__ ((packed));
  3053. #define BT_HCI_EVT_LE_CIS_ESTABLISHED 0x19
  3054. struct bt_hci_evt_le_cis_established {
  3055. uint8_t status;
  3056. uint16_t conn_handle;
  3057. uint8_t cig_sync_delay[3];
  3058. uint8_t cis_sync_delay[3];
  3059. uint8_t c_latency[3];
  3060. uint8_t p_latency[3];
  3061. uint8_t c_phy;
  3062. uint8_t p_phy;
  3063. uint8_t nse;
  3064. uint8_t c_bn;
  3065. uint8_t p_bn;
  3066. uint8_t c_ft;
  3067. uint8_t p_ft;
  3068. uint16_t c_mtu;
  3069. uint16_t p_mtu;
  3070. uint16_t interval;
  3071. } __attribute__ ((packed));
  3072. #define BT_HCI_EVT_LE_CIS_REQ 0x1a
  3073. struct bt_hci_evt_le_cis_req {
  3074. uint16_t acl_handle;
  3075. uint16_t cis_handle;
  3076. uint8_t cig_id;
  3077. uint8_t cis_id;
  3078. } __attribute__ ((packed));
  3079. #define BT_HCI_EVT_LE_BIG_COMPLETE 0x1b
  3080. struct bt_hci_evt_le_big_complete {
  3081. uint8_t status;
  3082. uint8_t handle;
  3083. uint8_t sync_delay[3];
  3084. uint8_t latency[3];
  3085. uint8_t phy;
  3086. uint8_t nse;
  3087. uint8_t bn;
  3088. uint8_t pto;
  3089. uint8_t irc;
  3090. uint16_t max_pdu;
  3091. uint16_t interval;
  3092. uint8_t num_bis;
  3093. uint16_t bis_handle[0];
  3094. } __attribute__ ((packed));
  3095. #define BT_HCI_EVT_LE_BIG_TERMINATE 0x1c
  3096. struct bt_hci_evt_le_big_terminate {
  3097. uint8_t reason;
  3098. uint8_t handle;
  3099. } __attribute__ ((packed));
  3100. #define BT_HCI_EVT_LE_BIG_SYNC_ESTABILISHED 0x1d
  3101. struct bt_hci_evt_le_big_sync_estabilished {
  3102. uint8_t status;
  3103. uint8_t handle;
  3104. uint8_t latency[3];
  3105. uint8_t nse;
  3106. uint8_t bn;
  3107. uint8_t pto;
  3108. uint8_t irc;
  3109. uint16_t max_pdu;
  3110. uint16_t interval;
  3111. uint8_t num_bis;
  3112. uint16_t bis[0];
  3113. } __attribute__ ((packed));
  3114. #define BT_HCI_EVT_LE_BIG_SYNC_LOST 0x1e
  3115. struct bt_hci_evt_le_big_sync_lost {
  3116. uint8_t big_id;
  3117. uint8_t reason;
  3118. } __attribute__ ((packed));
  3119. #define BT_HCI_EVT_LE_REQ_PEER_SCA_COMPLETE 0x1f
  3120. struct bt_hci_evt_le_req_peer_sca_complete {
  3121. uint8_t status;
  3122. uint16_t handle;
  3123. uint8_t sca;
  3124. } __attribute__ ((packed));
  3125. #define BT_HCI_ERR_SUCCESS 0x00
  3126. #define BT_HCI_ERR_UNKNOWN_COMMAND 0x01
  3127. #define BT_HCI_ERR_UNKNOWN_CONN_ID 0x02
  3128. #define BT_HCI_ERR_HARDWARE_FAILURE 0x03
  3129. #define BT_HCI_ERR_PAGE_TIMEOUT 0x04
  3130. #define BT_HCI_ERR_AUTH_FAILURE 0x05
  3131. #define BT_HCI_ERR_PIN_OR_KEY_MISSING 0x06
  3132. #define BT_HCI_ERR_MEM_CAPACITY_EXCEEDED 0x07
  3133. #define BT_HCI_ERR_COMMAND_DISALLOWED 0x0c
  3134. #define BT_HCI_ERR_UNSUPPORTED_FEATURE 0x11
  3135. #define BT_HCI_ERR_INVALID_PARAMETERS 0x12
  3136. #define BT_HCI_ERR_UNSPECIFIED_ERROR 0x1f
  3137. #define BT_HCI_ERR_ADV_TIMEOUT 0x3c
  3138. #define BT_HCI_ERR_CONN_FAILED_TO_ESTABLISH 0x3e
  3139. #define BT_HCI_ERR_UNKNOWN_ADVERTISING_ID 0x42
  3140. struct bt_l2cap_hdr {
  3141. uint16_t len;
  3142. uint16_t cid;
  3143. } __attribute__ ((packed));
  3144. struct bt_l2cap_hdr_sig {
  3145. uint8_t code;
  3146. uint8_t ident;
  3147. uint16_t len;
  3148. } __attribute__ ((packed));
  3149. #define BT_L2CAP_PDU_CMD_REJECT 0x01
  3150. struct bt_l2cap_pdu_cmd_reject {
  3151. uint16_t reason;
  3152. } __attribute__ ((packed));
  3153. #define BT_L2CAP_PDU_CONN_REQ 0x02
  3154. struct bt_l2cap_pdu_conn_req {
  3155. uint16_t psm;
  3156. uint16_t scid;
  3157. } __attribute__ ((packed));
  3158. #define BT_L2CAP_PDU_CONN_RSP 0x03
  3159. struct bt_l2cap_pdu_conn_rsp {
  3160. uint16_t dcid;
  3161. uint16_t scid;
  3162. uint16_t result;
  3163. uint16_t status;
  3164. } __attribute__ ((packed));
  3165. #define BT_L2CAP_PDU_CONFIG_REQ 0x04
  3166. struct bt_l2cap_pdu_config_req {
  3167. uint16_t dcid;
  3168. uint16_t flags;
  3169. } __attribute__ ((packed));
  3170. #define BT_L2CAP_PDU_CONFIG_RSP 0x05
  3171. struct bt_l2cap_pdu_config_rsp {
  3172. uint16_t scid;
  3173. uint16_t flags;
  3174. uint16_t result;
  3175. } __attribute__ ((packed));
  3176. #define BT_L2CAP_PDU_DISCONN_REQ 0x06
  3177. struct bt_l2cap_pdu_disconn_req {
  3178. uint16_t dcid;
  3179. uint16_t scid;
  3180. } __attribute__ ((packed));
  3181. #define BT_L2CAP_PDU_DISCONN_RSP 0x07
  3182. struct bt_l2cap_pdu_disconn_rsp {
  3183. uint16_t dcid;
  3184. uint16_t scid;
  3185. } __attribute__ ((packed));
  3186. #define BT_L2CAP_PDU_ECHO_REQ 0x08
  3187. #define BT_L2CAP_PDU_ECHO_RSP 0x09
  3188. #define BT_L2CAP_PDU_INFO_REQ 0x0a
  3189. struct bt_l2cap_pdu_info_req {
  3190. uint16_t type;
  3191. } __attribute__ ((packed));
  3192. #define BT_L2CAP_PDU_INFO_RSP 0x0b
  3193. struct bt_l2cap_pdu_info_rsp {
  3194. uint16_t type;
  3195. uint16_t result;
  3196. uint8_t data[0];
  3197. } __attribute__ ((packed));
  3198. #define BT_L2CAP_PDU_CREATE_CHAN_REQ 0x0c
  3199. struct bt_l2cap_pdu_create_chan_req {
  3200. uint16_t psm;
  3201. uint16_t scid;
  3202. uint8_t ctrlid;
  3203. } __attribute__ ((packed));
  3204. #define BT_L2CAP_PDU_CREATE_CHAN_RSP 0x0d
  3205. struct bt_l2cap_pdu_create_chan_rsp {
  3206. uint16_t dcid;
  3207. uint16_t scid;
  3208. uint16_t result;
  3209. uint16_t status;
  3210. } __attribute__ ((packed));
  3211. #define BT_L2CAP_PDU_MOVE_CHAN_REQ 0x0e
  3212. struct bt_l2cap_pdu_move_chan_req {
  3213. uint16_t icid;
  3214. uint8_t ctrlid;
  3215. } __attribute__ ((packed));
  3216. #define BT_L2CAP_PDU_MOVE_CHAN_RSP 0x0f
  3217. struct bt_l2cap_pdu_move_chan_rsp {
  3218. uint16_t icid;
  3219. uint16_t result;
  3220. } __attribute__ ((packed));
  3221. #define BT_L2CAP_PDU_MOVE_CHAN_CFM 0x10
  3222. struct bt_l2cap_pdu_move_chan_cfm {
  3223. uint16_t icid;
  3224. uint16_t result;
  3225. } __attribute__ ((packed));
  3226. #define BT_L2CAP_PDU_MOVE_CHAN_CFM_RSP 0x11
  3227. struct bt_l2cap_pdu_move_chan_cfm_rsp {
  3228. uint16_t icid;
  3229. } __attribute__ ((packed));
  3230. #define BT_L2CAP_PDU_CONN_PARAM_REQ 0x12
  3231. struct bt_l2cap_pdu_conn_param_req {
  3232. uint16_t min_interval;
  3233. uint16_t max_interval;
  3234. uint16_t latency;
  3235. uint16_t timeout;
  3236. } __attribute__ ((packed));
  3237. #define BT_L2CAP_PDU_CONN_PARAM_RSP 0x13
  3238. struct bt_l2cap_pdu_conn_param_rsp {
  3239. uint16_t result;
  3240. } __attribute__ ((packed));
  3241. #define BT_L2CAP_PDU_LE_CONN_REQ 0x14
  3242. struct bt_l2cap_pdu_le_conn_req {
  3243. uint16_t psm;
  3244. uint16_t scid;
  3245. uint16_t mtu;
  3246. uint16_t mps;
  3247. uint16_t credits;
  3248. } __attribute__ ((packed));
  3249. #define BT_L2CAP_PDU_LE_CONN_RSP 0x15
  3250. struct bt_l2cap_pdu_le_conn_rsp {
  3251. uint16_t dcid;
  3252. uint16_t mtu;
  3253. uint16_t mps;
  3254. uint16_t credits;
  3255. uint16_t result;
  3256. } __attribute__ ((packed));
  3257. #define BT_L2CAP_PDU_LE_FLOWCTL_CREDS 0x16
  3258. struct bt_l2cap_pdu_le_flowctl_creds {
  3259. uint16_t cid;
  3260. uint16_t credits;
  3261. } __attribute__ ((packed));
  3262. #define BT_L2CAP_PDU_ECRED_CONN_REQ 0x17
  3263. struct bt_l2cap_pdu_ecred_conn_req {
  3264. uint16_t psm;
  3265. uint16_t mtu;
  3266. uint16_t mps;
  3267. uint16_t credits;
  3268. uint16_t scid[0];
  3269. } __attribute__ ((packed));
  3270. #define BT_L2CAP_PDU_ECRED_CONN_RSP 0x18
  3271. struct bt_l2cap_pdu_ecred_conn_rsp {
  3272. uint16_t mtu;
  3273. uint16_t mps;
  3274. uint16_t credits;
  3275. uint16_t result;
  3276. uint16_t dcid[0];
  3277. } __attribute__ ((packed));
  3278. #define BT_L2CAP_PDU_ECRED_RECONF_REQ 0x19
  3279. struct bt_l2cap_pdu_ecred_reconf_req {
  3280. uint16_t mtu;
  3281. uint16_t mps;
  3282. uint16_t scid[0];
  3283. } __attribute__ ((packed));
  3284. #define BT_L2CAP_PDU_ECRED_RECONF_RSP 0x1a
  3285. struct bt_l2cap_pdu_ecred_reconf_rsp {
  3286. uint16_t result;
  3287. } __attribute__ ((packed));
  3288. struct bt_l2cap_hdr_connless {
  3289. uint16_t psm;
  3290. } __attribute__ ((packed));
  3291. struct bt_l2cap_hdr_amp {
  3292. uint8_t code;
  3293. uint8_t ident;
  3294. uint16_t len;
  3295. } __attribute__ ((packed));
  3296. #define BT_L2CAP_AMP_CMD_REJECT 0x01
  3297. struct bt_l2cap_amp_cmd_reject {
  3298. uint16_t reason;
  3299. } __attribute__ ((packed));
  3300. #define BT_L2CAP_AMP_DISCOVER_REQ 0x02
  3301. struct bt_l2cap_amp_discover_req {
  3302. uint16_t size;
  3303. uint16_t features;
  3304. } __attribute__ ((packed));
  3305. #define BT_L2CAP_AMP_DISCOVER_RSP 0x03
  3306. struct bt_l2cap_amp_discover_rsp {
  3307. uint16_t size;
  3308. uint16_t features;
  3309. } __attribute__ ((packed));
  3310. #define BT_L2CAP_AMP_CHANGE_NOTIFY 0x04
  3311. #define BT_L2CAP_AMP_CHANGE_RESPONSE 0x05
  3312. #define BT_L2CAP_AMP_GET_INFO_REQ 0x06
  3313. struct bt_l2cap_amp_get_info_req {
  3314. uint8_t ctrlid;
  3315. } __attribute__ ((packed));
  3316. #define BT_L2CAP_AMP_GET_INFO_RSP 0x07
  3317. struct bt_l2cap_amp_get_info_rsp {
  3318. uint8_t ctrlid;
  3319. uint8_t status;
  3320. uint32_t total_bw;
  3321. uint32_t max_bw;
  3322. uint32_t min_latency;
  3323. uint16_t pal_cap;
  3324. uint16_t max_assoc_len;
  3325. } __attribute__ ((packed));
  3326. #define BT_L2CAP_AMP_GET_ASSOC_REQ 0x08
  3327. struct bt_l2cap_amp_get_assoc_req {
  3328. uint8_t ctrlid;
  3329. } __attribute__ ((packed));
  3330. #define BT_L2CAP_AMP_GET_ASSOC_RSP 0x09
  3331. struct bt_l2cap_amp_get_assoc_rsp {
  3332. uint8_t ctrlid;
  3333. uint8_t status;
  3334. } __attribute__ ((packed));
  3335. #define BT_L2CAP_AMP_CREATE_PHY_LINK_REQ 0x0a
  3336. struct bt_l2cap_amp_create_phy_link_req {
  3337. uint8_t local_ctrlid;
  3338. uint8_t remote_ctrlid;
  3339. } __attribute__ ((packed));
  3340. #define BT_L2CAP_AMP_CREATE_PHY_LINK_RSP 0x0b
  3341. struct bt_l2cap_amp_create_phy_link_rsp {
  3342. uint8_t local_ctrlid;
  3343. uint8_t remote_ctrlid;
  3344. uint8_t status;
  3345. } __attribute__ ((packed));
  3346. #define BT_L2CAP_AMP_DISCONN_PHY_LINK_REQ 0x0c
  3347. struct bt_l2cap_amp_disconn_phy_link_req {
  3348. uint8_t local_ctrlid;
  3349. uint8_t remote_ctrlid;
  3350. } __attribute__ ((packed));
  3351. #define BT_L2CAP_AMP_DISCONN_PHY_LINK_RSP 0x0d
  3352. struct bt_l2cap_amp_disconn_phy_link_rsp {
  3353. uint8_t local_ctrlid;
  3354. uint8_t remote_ctrlid;
  3355. uint8_t status;
  3356. } __attribute__ ((packed));
  3357. struct bt_l2cap_hdr_att {
  3358. uint8_t code;
  3359. } __attribute__ ((packed));
  3360. #define BT_L2CAP_ATT_ERROR_RESPONSE 0x01
  3361. struct bt_l2cap_att_error_response {
  3362. uint8_t request;
  3363. uint16_t handle;
  3364. uint8_t error;
  3365. } __attribute__ ((packed));
  3366. #define BT_L2CAP_ATT_EXCHANGE_MTU_REQ 0x02
  3367. struct bt_l2cap_att_exchange_mtu_req {
  3368. uint16_t mtu;
  3369. } __attribute__ ((packed));
  3370. #define BT_L2CAP_ATT_EXCHANGE_MTU_RSP 0x03
  3371. struct bt_l2cap_att_exchange_mtu_rsp {
  3372. uint16_t mtu;
  3373. } __attribute__ ((packed));
  3374. #define BT_L2CAP_ATT_READ_TYPE_REQ 0x08
  3375. struct bt_l2cap_att_read_type_req {
  3376. uint16_t start_handle;
  3377. uint16_t end_handle;
  3378. } __attribute__ ((packed));
  3379. #define BT_L2CAP_ATT_READ_TYPE_RSP 0x09
  3380. struct bt_l2cap_att_read_type_rsp {
  3381. uint8_t length;
  3382. } __attribute__ ((packed));
  3383. #define BT_L2CAP_ATT_READ_REQ 0x0a
  3384. struct bt_l2cap_att_read_req {
  3385. uint16_t handle;
  3386. } __attribute__ ((packed));
  3387. #define BT_L2CAP_ATT_READ_RSP 0x0b
  3388. #define BT_L2CAP_ATT_READ_GROUP_TYPE_REQ 0x10
  3389. struct bt_l2cap_att_read_group_type_req {
  3390. uint16_t start_handle;
  3391. uint16_t end_handle;
  3392. } __attribute__ ((packed));
  3393. #define BT_L2CAP_ATT_READ_GROUP_TYPE_RSP 0x11
  3394. struct bt_l2cap_att_read_group_type_rsp {
  3395. uint8_t length;
  3396. } __attribute__ ((packed));
  3397. #define BT_L2CAP_ATT_HANDLE_VALUE_NOTIFY 0x1b
  3398. struct bt_l2cap_att_handle_value_notify {
  3399. uint16_t handle;
  3400. } __attribute__ ((packed));
  3401. #define BT_L2CAP_ATT_HANDLE_VALUE_IND 0x1d
  3402. struct bt_l2cap_att_handle_value_ind {
  3403. uint16_t handle;
  3404. } __attribute__ ((packed));
  3405. #define BT_L2CAP_ATT_HANDLE_VALUE_CONF 0x1e
  3406. struct bt_l2cap_hdr_smp {
  3407. uint8_t code;
  3408. } __attribute__ ((packed));
  3409. #define BT_L2CAP_SMP_PAIRING_REQUEST 0x01
  3410. struct bt_l2cap_smp_pairing_request {
  3411. uint8_t io_capa;
  3412. uint8_t oob_data;
  3413. uint8_t auth_req;
  3414. uint8_t max_key_size;
  3415. uint8_t init_key_dist;
  3416. uint8_t resp_key_dist;
  3417. } __attribute__ ((packed));
  3418. #define BT_L2CAP_SMP_PAIRING_RESPONSE 0x02
  3419. struct bt_l2cap_smp_pairing_response {
  3420. uint8_t io_capa;
  3421. uint8_t oob_data;
  3422. uint8_t auth_req;
  3423. uint8_t max_key_size;
  3424. uint8_t init_key_dist;
  3425. uint8_t resp_key_dist;
  3426. } __attribute__ ((packed));
  3427. #define BT_L2CAP_SMP_PAIRING_CONFIRM 0x03
  3428. struct bt_l2cap_smp_pairing_confirm {
  3429. uint8_t value[16];
  3430. } __attribute__ ((packed));
  3431. #define BT_L2CAP_SMP_PAIRING_RANDOM 0x04
  3432. struct bt_l2cap_smp_pairing_random {
  3433. uint8_t value[16];
  3434. } __attribute__ ((packed));
  3435. #define BT_L2CAP_SMP_PAIRING_FAILED 0x05
  3436. struct bt_l2cap_smp_pairing_failed {
  3437. uint8_t reason;
  3438. } __attribute__ ((packed));
  3439. #define BT_L2CAP_SMP_ENCRYPT_INFO 0x06
  3440. struct bt_l2cap_smp_encrypt_info {
  3441. uint8_t ltk[16];
  3442. } __attribute__ ((packed));
  3443. #define BT_L2CAP_SMP_CENTRAL_IDENT 0x07
  3444. struct bt_l2cap_smp_central_ident {
  3445. uint16_t ediv;
  3446. uint64_t rand;
  3447. } __attribute__ ((packed));
  3448. #define BT_L2CAP_SMP_IDENT_INFO 0x08
  3449. struct bt_l2cap_smp_ident_info {
  3450. uint8_t irk[16];
  3451. } __attribute__ ((packed));
  3452. #define BT_L2CAP_SMP_IDENT_ADDR_INFO 0x09
  3453. struct bt_l2cap_smp_ident_addr_info {
  3454. uint8_t addr_type;
  3455. uint8_t addr[6];
  3456. } __attribute__ ((packed));
  3457. #define BT_L2CAP_SMP_SIGNING_INFO 0x0a
  3458. struct bt_l2cap_smp_signing_info {
  3459. uint8_t csrk[16];
  3460. } __attribute__ ((packed));
  3461. #define BT_L2CAP_SMP_SECURITY_REQUEST 0x0b
  3462. struct bt_l2cap_smp_security_request {
  3463. uint8_t auth_req;
  3464. } __attribute__ ((packed));
  3465. #define BT_L2CAP_SMP_PUBLIC_KEY 0x0c
  3466. struct bt_l2cap_smp_public_key {
  3467. uint8_t x[32];
  3468. uint8_t y[32];
  3469. } __attribute__ ((packed));
  3470. #define BT_L2CAP_SMP_DHKEY_CHECK 0x0d
  3471. struct bt_l2cap_smp_dhkey_check {
  3472. uint8_t e[16];
  3473. } __attribute__ ((packed));
  3474. #define BT_L2CAP_SMP_KEYPRESS_NOTIFY 0x0e
  3475. struct bt_l2cap_smp_keypress_notify {
  3476. uint8_t type;
  3477. } __attribute__ ((packed));
  3478. struct bt_sdp_hdr {
  3479. uint8_t pdu;
  3480. uint16_t tid;
  3481. uint16_t plen;
  3482. } __attribute__ ((packed));