hci.h (2fc2991175bf77395e6b15fe6b2304d3bf72da40) hci.h (1ebb92521d0bc2d4ef772730d29333c06b807191)
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated
4
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as

--- 170 unchanged lines hidden (view full) ---

179
180/* Informational Parameters */
181#define OGF_INFO_PARAM 0x04
182
183#define OCF_READ_LOCAL_VERSION 0x0001
184struct hci_rp_read_loc_version {
185 __u8 status;
186 __u8 hci_ver;
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2000-2001 Qualcomm Incorporated
4
5 Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as

--- 170 unchanged lines hidden (view full) ---

179
180/* Informational Parameters */
181#define OGF_INFO_PARAM 0x04
182
183#define OCF_READ_LOCAL_VERSION 0x0001
184struct hci_rp_read_loc_version {
185 __u8 status;
186 __u8 hci_ver;
187 __u16 hci_rev;
187 __le16 hci_rev;
188 __u8 lmp_ver;
188 __u8 lmp_ver;
189 __u16 manufacturer;
190 __u16 lmp_subver;
189 __le16 manufacturer;
190 __le16 lmp_subver;
191} __attribute__ ((packed));
192
193#define OCF_READ_LOCAL_FEATURES 0x0003
194struct hci_rp_read_loc_features {
195 __u8 status;
196 __u8 features[8];
197} __attribute__ ((packed));
198
199#define OCF_READ_BUFFER_SIZE 0x0005
200struct hci_rp_read_buffer_size {
201 __u8 status;
191} __attribute__ ((packed));
192
193#define OCF_READ_LOCAL_FEATURES 0x0003
194struct hci_rp_read_loc_features {
195 __u8 status;
196 __u8 features[8];
197} __attribute__ ((packed));
198
199#define OCF_READ_BUFFER_SIZE 0x0005
200struct hci_rp_read_buffer_size {
201 __u8 status;
202 __u16 acl_mtu;
202 __le16 acl_mtu;
203 __u8 sco_mtu;
203 __u8 sco_mtu;
204 __u16 acl_max_pkt;
205 __u16 sco_max_pkt;
204 __le16 acl_max_pkt;
205 __le16 sco_max_pkt;
206} __attribute__ ((packed));
207
208#define OCF_READ_BD_ADDR 0x0009
209struct hci_rp_read_bd_addr {
210 __u8 status;
211 bdaddr_t bdaddr;
212} __attribute__ ((packed));
213

--- 48 unchanged lines hidden (view full) ---

262
263#define OCF_WRITE_CLASS_OF_DEV 0x0024
264struct hci_cp_write_dev_class {
265 __u8 dev_class[3];
266} __attribute__ ((packed));
267
268#define OCF_READ_VOICE_SETTING 0x0025
269struct hci_rp_read_voice_setting {
206} __attribute__ ((packed));
207
208#define OCF_READ_BD_ADDR 0x0009
209struct hci_rp_read_bd_addr {
210 __u8 status;
211 bdaddr_t bdaddr;
212} __attribute__ ((packed));
213

--- 48 unchanged lines hidden (view full) ---

262
263#define OCF_WRITE_CLASS_OF_DEV 0x0024
264struct hci_cp_write_dev_class {
265 __u8 dev_class[3];
266} __attribute__ ((packed));
267
268#define OCF_READ_VOICE_SETTING 0x0025
269struct hci_rp_read_voice_setting {
270 __u8 status;
271 __u16 voice_setting;
270 __u8 status;
271 __le16 voice_setting;
272} __attribute__ ((packed));
273
274#define OCF_WRITE_VOICE_SETTING 0x0026
275struct hci_cp_write_voice_setting {
272} __attribute__ ((packed));
273
274#define OCF_WRITE_VOICE_SETTING 0x0026
275struct hci_cp_write_voice_setting {
276 __u16 voice_setting;
276 __le16 voice_setting;
277} __attribute__ ((packed));
278
279#define OCF_HOST_BUFFER_SIZE 0x0033
280struct hci_cp_host_buffer_size {
277} __attribute__ ((packed));
278
279#define OCF_HOST_BUFFER_SIZE 0x0033
280struct hci_cp_host_buffer_size {
281 __u16 acl_mtu;
281 __le16 acl_mtu;
282 __u8 sco_mtu;
282 __u8 sco_mtu;
283 __u16 acl_max_pkt;
284 __u16 sco_max_pkt;
283 __le16 acl_max_pkt;
284 __le16 sco_max_pkt;
285} __attribute__ ((packed));
286
287/* Link Control */
288#define OGF_LINK_CTL 0x01
289#define OCF_CREATE_CONN 0x0005
290struct hci_cp_create_conn {
291 bdaddr_t bdaddr;
285} __attribute__ ((packed));
286
287/* Link Control */
288#define OGF_LINK_CTL 0x01
289#define OCF_CREATE_CONN 0x0005
290struct hci_cp_create_conn {
291 bdaddr_t bdaddr;
292 __u16 pkt_type;
292 __le16 pkt_type;
293 __u8 pscan_rep_mode;
294 __u8 pscan_mode;
293 __u8 pscan_rep_mode;
294 __u8 pscan_mode;
295 __u16 clock_offset;
295 __le16 clock_offset;
296 __u8 role_switch;
297} __attribute__ ((packed));
298
299#define OCF_ACCEPT_CONN_REQ 0x0009
300struct hci_cp_accept_conn_req {
301 bdaddr_t bdaddr;
302 __u8 role;
303} __attribute__ ((packed));
304
305#define OCF_REJECT_CONN_REQ 0x000a
306struct hci_cp_reject_conn_req {
307 bdaddr_t bdaddr;
308 __u8 reason;
309} __attribute__ ((packed));
310
311#define OCF_DISCONNECT 0x0006
312struct hci_cp_disconnect {
296 __u8 role_switch;
297} __attribute__ ((packed));
298
299#define OCF_ACCEPT_CONN_REQ 0x0009
300struct hci_cp_accept_conn_req {
301 bdaddr_t bdaddr;
302 __u8 role;
303} __attribute__ ((packed));
304
305#define OCF_REJECT_CONN_REQ 0x000a
306struct hci_cp_reject_conn_req {
307 bdaddr_t bdaddr;
308 __u8 reason;
309} __attribute__ ((packed));
310
311#define OCF_DISCONNECT 0x0006
312struct hci_cp_disconnect {
313 __u16 handle;
313 __le16 handle;
314 __u8 reason;
315} __attribute__ ((packed));
316
317#define OCF_ADD_SCO 0x0007
318struct hci_cp_add_sco {
314 __u8 reason;
315} __attribute__ ((packed));
316
317#define OCF_ADD_SCO 0x0007
318struct hci_cp_add_sco {
319 __u16 handle;
320 __u16 pkt_type;
319 __le16 handle;
320 __le16 pkt_type;
321} __attribute__ ((packed));
322
323#define OCF_INQUIRY 0x0001
324struct hci_cp_inquiry {
325 __u8 lap[3];
326 __u8 length;
327 __u8 num_rsp;
328} __attribute__ ((packed));

--- 20 unchanged lines hidden (view full) ---

349
350#define OCF_PIN_CODE_NEG_REPLY 0x000E
351struct hci_cp_pin_code_neg_reply {
352 bdaddr_t bdaddr;
353} __attribute__ ((packed));
354
355#define OCF_CHANGE_CONN_PTYPE 0x000F
356struct hci_cp_change_conn_ptype {
321} __attribute__ ((packed));
322
323#define OCF_INQUIRY 0x0001
324struct hci_cp_inquiry {
325 __u8 lap[3];
326 __u8 length;
327 __u8 num_rsp;
328} __attribute__ ((packed));

--- 20 unchanged lines hidden (view full) ---

349
350#define OCF_PIN_CODE_NEG_REPLY 0x000E
351struct hci_cp_pin_code_neg_reply {
352 bdaddr_t bdaddr;
353} __attribute__ ((packed));
354
355#define OCF_CHANGE_CONN_PTYPE 0x000F
356struct hci_cp_change_conn_ptype {
357 __u16 handle;
358 __u16 pkt_type;
357 __le16 handle;
358 __le16 pkt_type;
359} __attribute__ ((packed));
360
361#define OCF_AUTH_REQUESTED 0x0011
362struct hci_cp_auth_requested {
359} __attribute__ ((packed));
360
361#define OCF_AUTH_REQUESTED 0x0011
362struct hci_cp_auth_requested {
363 __u16 handle;
363 __le16 handle;
364} __attribute__ ((packed));
365
366#define OCF_SET_CONN_ENCRYPT 0x0013
367struct hci_cp_set_conn_encrypt {
364} __attribute__ ((packed));
365
366#define OCF_SET_CONN_ENCRYPT 0x0013
367struct hci_cp_set_conn_encrypt {
368 __u16 handle;
368 __le16 handle;
369 __u8 encrypt;
370} __attribute__ ((packed));
371
372#define OCF_CHANGE_CONN_LINK_KEY 0x0015
373struct hci_cp_change_conn_link_key {
369 __u8 encrypt;
370} __attribute__ ((packed));
371
372#define OCF_CHANGE_CONN_LINK_KEY 0x0015
373struct hci_cp_change_conn_link_key {
374 __u16 handle;
374 __le16 handle;
375} __attribute__ ((packed));
376
377#define OCF_READ_REMOTE_FEATURES 0x001B
378struct hci_cp_read_rmt_features {
375} __attribute__ ((packed));
376
377#define OCF_READ_REMOTE_FEATURES 0x001B
378struct hci_cp_read_rmt_features {
379 __u16 handle;
379 __le16 handle;
380} __attribute__ ((packed));
381
382#define OCF_READ_REMOTE_VERSION 0x001D
383struct hci_cp_read_rmt_version {
380} __attribute__ ((packed));
381
382#define OCF_READ_REMOTE_VERSION 0x001D
383struct hci_cp_read_rmt_version {
384 __u16 handle;
384 __le16 handle;
385} __attribute__ ((packed));
386
387/* Link Policy */
388#define OGF_LINK_POLICY 0x02
389#define OCF_ROLE_DISCOVERY 0x0009
390struct hci_cp_role_discovery {
385} __attribute__ ((packed));
386
387/* Link Policy */
388#define OGF_LINK_POLICY 0x02
389#define OCF_ROLE_DISCOVERY 0x0009
390struct hci_cp_role_discovery {
391 __u16 handle;
391 __le16 handle;
392} __attribute__ ((packed));
393struct hci_rp_role_discovery {
394 __u8 status;
392} __attribute__ ((packed));
393struct hci_rp_role_discovery {
394 __u8 status;
395 __u16 handle;
395 __le16 handle;
396 __u8 role;
397} __attribute__ ((packed));
398
399#define OCF_READ_LINK_POLICY 0x000C
400struct hci_cp_read_link_policy {
396 __u8 role;
397} __attribute__ ((packed));
398
399#define OCF_READ_LINK_POLICY 0x000C
400struct hci_cp_read_link_policy {
401 __u16 handle;
401 __le16 handle;
402} __attribute__ ((packed));
403struct hci_rp_read_link_policy {
404 __u8 status;
402} __attribute__ ((packed));
403struct hci_rp_read_link_policy {
404 __u8 status;
405 __u16 handle;
406 __u16 policy;
405 __le16 handle;
406 __le16 policy;
407} __attribute__ ((packed));
408
409#define OCF_SWITCH_ROLE 0x000B
410struct hci_cp_switch_role {
411 bdaddr_t bdaddr;
412 __u8 role;
413} __attribute__ ((packed));
414
415#define OCF_WRITE_LINK_POLICY 0x000D
416struct hci_cp_write_link_policy {
407} __attribute__ ((packed));
408
409#define OCF_SWITCH_ROLE 0x000B
410struct hci_cp_switch_role {
411 bdaddr_t bdaddr;
412 __u8 role;
413} __attribute__ ((packed));
414
415#define OCF_WRITE_LINK_POLICY 0x000D
416struct hci_cp_write_link_policy {
417 __u16 handle;
418 __u16 policy;
417 __le16 handle;
418 __le16 policy;
419} __attribute__ ((packed));
420struct hci_rp_write_link_policy {
421 __u8 status;
419} __attribute__ ((packed));
420struct hci_rp_write_link_policy {
421 __u8 status;
422 __u16 handle;
422 __le16 handle;
423} __attribute__ ((packed));
424
425/* Status params */
426#define OGF_STATUS_PARAM 0x05
427
428/* Testing commands */
429#define OGF_TESTING_CMD 0x3E
430

--- 5 unchanged lines hidden (view full) ---

436
437#define HCI_EV_INQUIRY_RESULT 0x02
438struct inquiry_info {
439 bdaddr_t bdaddr;
440 __u8 pscan_rep_mode;
441 __u8 pscan_period_mode;
442 __u8 pscan_mode;
443 __u8 dev_class[3];
423} __attribute__ ((packed));
424
425/* Status params */
426#define OGF_STATUS_PARAM 0x05
427
428/* Testing commands */
429#define OGF_TESTING_CMD 0x3E
430

--- 5 unchanged lines hidden (view full) ---

436
437#define HCI_EV_INQUIRY_RESULT 0x02
438struct inquiry_info {
439 bdaddr_t bdaddr;
440 __u8 pscan_rep_mode;
441 __u8 pscan_period_mode;
442 __u8 pscan_mode;
443 __u8 dev_class[3];
444 __u16 clock_offset;
444 __le16 clock_offset;
445} __attribute__ ((packed));
446
447#define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22
448struct inquiry_info_with_rssi {
449 bdaddr_t bdaddr;
450 __u8 pscan_rep_mode;
451 __u8 pscan_period_mode;
452 __u8 dev_class[3];
445} __attribute__ ((packed));
446
447#define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22
448struct inquiry_info_with_rssi {
449 bdaddr_t bdaddr;
450 __u8 pscan_rep_mode;
451 __u8 pscan_period_mode;
452 __u8 dev_class[3];
453 __u16 clock_offset;
453 __le16 clock_offset;
454 __s8 rssi;
455} __attribute__ ((packed));
456struct inquiry_info_with_rssi_and_pscan_mode {
457 bdaddr_t bdaddr;
458 __u8 pscan_rep_mode;
459 __u8 pscan_period_mode;
460 __u8 pscan_mode;
461 __u8 dev_class[3];
454 __s8 rssi;
455} __attribute__ ((packed));
456struct inquiry_info_with_rssi_and_pscan_mode {
457 bdaddr_t bdaddr;
458 __u8 pscan_rep_mode;
459 __u8 pscan_period_mode;
460 __u8 pscan_mode;
461 __u8 dev_class[3];
462 __u16 clock_offset;
462 __le16 clock_offset;
463 __s8 rssi;
464} __attribute__ ((packed));
465
466#define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2F
467struct extended_inquiry_info {
468 bdaddr_t bdaddr;
469 __u8 pscan_rep_mode;
470 __u8 pscan_period_mode;
471 __u8 dev_class[3];
463 __s8 rssi;
464} __attribute__ ((packed));
465
466#define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2F
467struct extended_inquiry_info {
468 bdaddr_t bdaddr;
469 __u8 pscan_rep_mode;
470 __u8 pscan_period_mode;
471 __u8 dev_class[3];
472 __u16 clock_offset;
472 __le16 clock_offset;
473 __s8 rssi;
474 __u8 data[240];
475} __attribute__ ((packed));
476
477#define HCI_EV_CONN_COMPLETE 0x03
478struct hci_ev_conn_complete {
479 __u8 status;
473 __s8 rssi;
474 __u8 data[240];
475} __attribute__ ((packed));
476
477#define HCI_EV_CONN_COMPLETE 0x03
478struct hci_ev_conn_complete {
479 __u8 status;
480 __u16 handle;
480 __le16 handle;
481 bdaddr_t bdaddr;
482 __u8 link_type;
483 __u8 encr_mode;
484} __attribute__ ((packed));
485
486#define HCI_EV_CONN_REQUEST 0x04
487struct hci_ev_conn_request {
488 bdaddr_t bdaddr;
489 __u8 dev_class[3];
490 __u8 link_type;
491} __attribute__ ((packed));
492
493#define HCI_EV_DISCONN_COMPLETE 0x05
494struct hci_ev_disconn_complete {
495 __u8 status;
481 bdaddr_t bdaddr;
482 __u8 link_type;
483 __u8 encr_mode;
484} __attribute__ ((packed));
485
486#define HCI_EV_CONN_REQUEST 0x04
487struct hci_ev_conn_request {
488 bdaddr_t bdaddr;
489 __u8 dev_class[3];
490 __u8 link_type;
491} __attribute__ ((packed));
492
493#define HCI_EV_DISCONN_COMPLETE 0x05
494struct hci_ev_disconn_complete {
495 __u8 status;
496 __u16 handle;
496 __le16 handle;
497 __u8 reason;
498} __attribute__ ((packed));
499
500#define HCI_EV_AUTH_COMPLETE 0x06
501struct hci_ev_auth_complete {
502 __u8 status;
497 __u8 reason;
498} __attribute__ ((packed));
499
500#define HCI_EV_AUTH_COMPLETE 0x06
501struct hci_ev_auth_complete {
502 __u8 status;
503 __u16 handle;
503 __le16 handle;
504} __attribute__ ((packed));
505
506#define HCI_EV_ENCRYPT_CHANGE 0x08
507struct hci_ev_encrypt_change {
508 __u8 status;
504} __attribute__ ((packed));
505
506#define HCI_EV_ENCRYPT_CHANGE 0x08
507struct hci_ev_encrypt_change {
508 __u8 status;
509 __u16 handle;
509 __le16 handle;
510 __u8 encrypt;
511} __attribute__ ((packed));
512
513#define HCI_EV_CHANGE_CONN_LINK_KEY_COMPLETE 0x09
514struct hci_ev_change_conn_link_key_complete {
515 __u8 status;
510 __u8 encrypt;
511} __attribute__ ((packed));
512
513#define HCI_EV_CHANGE_CONN_LINK_KEY_COMPLETE 0x09
514struct hci_ev_change_conn_link_key_complete {
515 __u8 status;
516 __u16 handle;
516 __le16 handle;
517} __attribute__ ((packed));
518
519#define HCI_EV_QOS_SETUP_COMPLETE 0x0D
520struct hci_qos {
521 __u8 service_type;
522 __u32 token_rate;
523 __u32 peak_bandwidth;
524 __u32 latency;
525 __u32 delay_variation;
526} __attribute__ ((packed));
527struct hci_ev_qos_setup_complete {
528 __u8 status;
517} __attribute__ ((packed));
518
519#define HCI_EV_QOS_SETUP_COMPLETE 0x0D
520struct hci_qos {
521 __u8 service_type;
522 __u32 token_rate;
523 __u32 peak_bandwidth;
524 __u32 latency;
525 __u32 delay_variation;
526} __attribute__ ((packed));
527struct hci_ev_qos_setup_complete {
528 __u8 status;
529 __u16 handle;
529 __le16 handle;
530 struct hci_qos qos;
531} __attribute__ ((packed));
532
533#define HCI_EV_CMD_COMPLETE 0x0E
534struct hci_ev_cmd_complete {
535 __u8 ncmd;
530 struct hci_qos qos;
531} __attribute__ ((packed));
532
533#define HCI_EV_CMD_COMPLETE 0x0E
534struct hci_ev_cmd_complete {
535 __u8 ncmd;
536 __u16 opcode;
536 __le16 opcode;
537} __attribute__ ((packed));
538
539#define HCI_EV_CMD_STATUS 0x0F
540struct hci_ev_cmd_status {
541 __u8 status;
542 __u8 ncmd;
537} __attribute__ ((packed));
538
539#define HCI_EV_CMD_STATUS 0x0F
540struct hci_ev_cmd_status {
541 __u8 status;
542 __u8 ncmd;
543 __u16 opcode;
543 __le16 opcode;
544} __attribute__ ((packed));
545
546#define HCI_EV_NUM_COMP_PKTS 0x13
547struct hci_ev_num_comp_pkts {
548 __u8 num_hndl;
549 /* variable length part */
550} __attribute__ ((packed));
551
552#define HCI_EV_ROLE_CHANGE 0x12
553struct hci_ev_role_change {
554 __u8 status;
555 bdaddr_t bdaddr;
556 __u8 role;
557} __attribute__ ((packed));
558
559#define HCI_EV_MODE_CHANGE 0x14
560struct hci_ev_mode_change {
561 __u8 status;
544} __attribute__ ((packed));
545
546#define HCI_EV_NUM_COMP_PKTS 0x13
547struct hci_ev_num_comp_pkts {
548 __u8 num_hndl;
549 /* variable length part */
550} __attribute__ ((packed));
551
552#define HCI_EV_ROLE_CHANGE 0x12
553struct hci_ev_role_change {
554 __u8 status;
555 bdaddr_t bdaddr;
556 __u8 role;
557} __attribute__ ((packed));
558
559#define HCI_EV_MODE_CHANGE 0x14
560struct hci_ev_mode_change {
561 __u8 status;
562 __u16 handle;
562 __le16 handle;
563 __u8 mode;
563 __u8 mode;
564 __u16 interval;
564 __le16 interval;
565} __attribute__ ((packed));
566
567#define HCI_EV_PIN_CODE_REQ 0x16
568struct hci_ev_pin_code_req {
569 bdaddr_t bdaddr;
570} __attribute__ ((packed));
571
572#define HCI_EV_LINK_KEY_REQ 0x17

--- 6 unchanged lines hidden (view full) ---

579 bdaddr_t bdaddr;
580 __u8 link_key[16];
581 __u8 key_type;
582} __attribute__ ((packed));
583
584#define HCI_EV_RMT_FEATURES 0x0B
585struct hci_ev_rmt_features {
586 __u8 status;
565} __attribute__ ((packed));
566
567#define HCI_EV_PIN_CODE_REQ 0x16
568struct hci_ev_pin_code_req {
569 bdaddr_t bdaddr;
570} __attribute__ ((packed));
571
572#define HCI_EV_LINK_KEY_REQ 0x17

--- 6 unchanged lines hidden (view full) ---

579 bdaddr_t bdaddr;
580 __u8 link_key[16];
581 __u8 key_type;
582} __attribute__ ((packed));
583
584#define HCI_EV_RMT_FEATURES 0x0B
585struct hci_ev_rmt_features {
586 __u8 status;
587 __u16 handle;
587 __le16 handle;
588 __u8 features[8];
589} __attribute__ ((packed));
590
591#define HCI_EV_RMT_VERSION 0x0C
592struct hci_ev_rmt_version {
593 __u8 status;
588 __u8 features[8];
589} __attribute__ ((packed));
590
591#define HCI_EV_RMT_VERSION 0x0C
592struct hci_ev_rmt_version {
593 __u8 status;
594 __u16 handle;
594 __le16 handle;
595 __u8 lmp_ver;
595 __u8 lmp_ver;
596 __u16 manufacturer;
597 __u16 lmp_subver;
596 __le16 manufacturer;
597 __le16 lmp_subver;
598} __attribute__ ((packed));
599
600#define HCI_EV_CLOCK_OFFSET 0x01C
601struct hci_ev_clock_offset {
602 __u8 status;
598} __attribute__ ((packed));
599
600#define HCI_EV_CLOCK_OFFSET 0x01C
601struct hci_ev_clock_offset {
602 __u8 status;
603 __u16 handle;
604 __u16 clock_offset;
603 __le16 handle;
604 __le16 clock_offset;
605} __attribute__ ((packed));
606
607#define HCI_EV_PSCAN_REP_MODE 0x20
608struct hci_ev_pscan_rep_mode {
609 bdaddr_t bdaddr;
610 __u8 pscan_rep_mode;
611} __attribute__ ((packed));
612

--- 20 unchanged lines hidden (view full) ---

633
634/* ---- HCI Packet structures ---- */
635#define HCI_COMMAND_HDR_SIZE 3
636#define HCI_EVENT_HDR_SIZE 2
637#define HCI_ACL_HDR_SIZE 4
638#define HCI_SCO_HDR_SIZE 3
639
640struct hci_command_hdr {
605} __attribute__ ((packed));
606
607#define HCI_EV_PSCAN_REP_MODE 0x20
608struct hci_ev_pscan_rep_mode {
609 bdaddr_t bdaddr;
610 __u8 pscan_rep_mode;
611} __attribute__ ((packed));
612

--- 20 unchanged lines hidden (view full) ---

633
634/* ---- HCI Packet structures ---- */
635#define HCI_COMMAND_HDR_SIZE 3
636#define HCI_EVENT_HDR_SIZE 2
637#define HCI_ACL_HDR_SIZE 4
638#define HCI_SCO_HDR_SIZE 3
639
640struct hci_command_hdr {
641 __u16 opcode; /* OCF & OGF */
641 __le16 opcode; /* OCF & OGF */
642 __u8 plen;
643} __attribute__ ((packed));
644
645struct hci_event_hdr {
646 __u8 evt;
647 __u8 plen;
648} __attribute__ ((packed));
649
650struct hci_acl_hdr {
642 __u8 plen;
643} __attribute__ ((packed));
644
645struct hci_event_hdr {
646 __u8 evt;
647 __u8 plen;
648} __attribute__ ((packed));
649
650struct hci_acl_hdr {
651 __u16 handle; /* Handle & Flags(PB, BC) */
652 __u16 dlen;
651 __le16 handle; /* Handle & Flags(PB, BC) */
652 __le16 dlen;
653} __attribute__ ((packed));
654
655struct hci_sco_hdr {
653} __attribute__ ((packed));
654
655struct hci_sco_hdr {
656 __u16 handle;
656 __le16 handle;
657 __u8 dlen;
658} __attribute__ ((packed));
659
660/* Command opcode pack/unpack */
657 __u8 dlen;
658} __attribute__ ((packed));
659
660/* Command opcode pack/unpack */
661#define hci_opcode_pack(ogf, ocf) (__u16)((ocf & 0x03ff)|(ogf << 10))
661#define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10))
662#define hci_opcode_ogf(op) (op >> 10)
663#define hci_opcode_ocf(op) (op & 0x03ff)
664
665/* ACL handle and flags pack/unpack */
662#define hci_opcode_ogf(op) (op >> 10)
663#define hci_opcode_ocf(op) (op & 0x03ff)
664
665/* ACL handle and flags pack/unpack */
666#define hci_handle_pack(h, f) (__u16)((h & 0x0fff)|(f << 12))
666#define hci_handle_pack(h, f) (__u16) ((h & 0x0fff)|(f << 12))
667#define hci_handle(h) (h & 0x0fff)
668#define hci_flags(h) (h >> 12)
669
670/* ---- HCI Sockets ---- */
671
672/* Socket options */
673#define HCI_DATA_DIR 1
674#define HCI_FILTER 2

--- 107 unchanged lines hidden ---
667#define hci_handle(h) (h & 0x0fff)
668#define hci_flags(h) (h >> 12)
669
670/* ---- HCI Sockets ---- */
671
672/* Socket options */
673#define HCI_DATA_DIR 1
674#define HCI_FILTER 2

--- 107 unchanged lines hidden ---