aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-11-08 12:57:21 -0500
committerDavid S. Miller <davem@davemloft.net>2005-11-08 12:57:21 -0500
commit1ebb92521d0bc2d4ef772730d29333c06b807191 (patch)
treed480ca68fd4c7f1185e189942feef8d85edbb659 /include/net/bluetooth
parent7ef934b3b73f74aea23aa0e98affe86d7ea816a3 (diff)
[Bluetooth]: Add endian annotations to the core
This patch adds the endian annotations to the Bluetooth core. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r--include/net/bluetooth/hci.h116
-rw-r--r--include/net/bluetooth/hci_core.h2
2 files changed, 59 insertions, 59 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index fa2d12b0579b..b06a2d2f63d2 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -184,10 +184,10 @@ enum {
184struct hci_rp_read_loc_version { 184struct hci_rp_read_loc_version {
185 __u8 status; 185 __u8 status;
186 __u8 hci_ver; 186 __u8 hci_ver;
187 __u16 hci_rev; 187 __le16 hci_rev;
188 __u8 lmp_ver; 188 __u8 lmp_ver;
189 __u16 manufacturer; 189 __le16 manufacturer;
190 __u16 lmp_subver; 190 __le16 lmp_subver;
191} __attribute__ ((packed)); 191} __attribute__ ((packed));
192 192
193#define OCF_READ_LOCAL_FEATURES 0x0003 193#define OCF_READ_LOCAL_FEATURES 0x0003
@@ -199,10 +199,10 @@ struct hci_rp_read_loc_features {
199#define OCF_READ_BUFFER_SIZE 0x0005 199#define OCF_READ_BUFFER_SIZE 0x0005
200struct hci_rp_read_buffer_size { 200struct hci_rp_read_buffer_size {
201 __u8 status; 201 __u8 status;
202 __u16 acl_mtu; 202 __le16 acl_mtu;
203 __u8 sco_mtu; 203 __u8 sco_mtu;
204 __u16 acl_max_pkt; 204 __le16 acl_max_pkt;
205 __u16 sco_max_pkt; 205 __le16 sco_max_pkt;
206} __attribute__ ((packed)); 206} __attribute__ ((packed));
207 207
208#define OCF_READ_BD_ADDR 0x0009 208#define OCF_READ_BD_ADDR 0x0009
@@ -267,21 +267,21 @@ struct hci_cp_write_dev_class {
267 267
268#define OCF_READ_VOICE_SETTING 0x0025 268#define OCF_READ_VOICE_SETTING 0x0025
269struct hci_rp_read_voice_setting { 269struct hci_rp_read_voice_setting {
270 __u8 status; 270 __u8 status;
271 __u16 voice_setting; 271 __le16 voice_setting;
272} __attribute__ ((packed)); 272} __attribute__ ((packed));
273 273
274#define OCF_WRITE_VOICE_SETTING 0x0026 274#define OCF_WRITE_VOICE_SETTING 0x0026
275struct hci_cp_write_voice_setting { 275struct hci_cp_write_voice_setting {
276 __u16 voice_setting; 276 __le16 voice_setting;
277} __attribute__ ((packed)); 277} __attribute__ ((packed));
278 278
279#define OCF_HOST_BUFFER_SIZE 0x0033 279#define OCF_HOST_BUFFER_SIZE 0x0033
280struct hci_cp_host_buffer_size { 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; 283 __le16 acl_max_pkt;
284 __u16 sco_max_pkt; 284 __le16 sco_max_pkt;
285} __attribute__ ((packed)); 285} __attribute__ ((packed));
286 286
287/* Link Control */ 287/* Link Control */
@@ -289,10 +289,10 @@ struct hci_cp_host_buffer_size {
289#define OCF_CREATE_CONN 0x0005 289#define OCF_CREATE_CONN 0x0005
290struct hci_cp_create_conn { 290struct hci_cp_create_conn {
291 bdaddr_t bdaddr; 291 bdaddr_t bdaddr;
292 __u16 pkt_type; 292 __le16 pkt_type;
293 __u8 pscan_rep_mode; 293 __u8 pscan_rep_mode;
294 __u8 pscan_mode; 294 __u8 pscan_mode;
295 __u16 clock_offset; 295 __le16 clock_offset;
296 __u8 role_switch; 296 __u8 role_switch;
297} __attribute__ ((packed)); 297} __attribute__ ((packed));
298 298
@@ -310,14 +310,14 @@ struct hci_cp_reject_conn_req {
310 310
311#define OCF_DISCONNECT 0x0006 311#define OCF_DISCONNECT 0x0006
312struct hci_cp_disconnect { 312struct hci_cp_disconnect {
313 __u16 handle; 313 __le16 handle;
314 __u8 reason; 314 __u8 reason;
315} __attribute__ ((packed)); 315} __attribute__ ((packed));
316 316
317#define OCF_ADD_SCO 0x0007 317#define OCF_ADD_SCO 0x0007
318struct hci_cp_add_sco { 318struct hci_cp_add_sco {
319 __u16 handle; 319 __le16 handle;
320 __u16 pkt_type; 320 __le16 pkt_type;
321} __attribute__ ((packed)); 321} __attribute__ ((packed));
322 322
323#define OCF_INQUIRY 0x0001 323#define OCF_INQUIRY 0x0001
@@ -354,56 +354,56 @@ struct hci_cp_pin_code_neg_reply {
354 354
355#define OCF_CHANGE_CONN_PTYPE 0x000F 355#define OCF_CHANGE_CONN_PTYPE 0x000F
356struct hci_cp_change_conn_ptype { 356struct hci_cp_change_conn_ptype {
357 __u16 handle; 357 __le16 handle;
358 __u16 pkt_type; 358 __le16 pkt_type;
359} __attribute__ ((packed)); 359} __attribute__ ((packed));
360 360
361#define OCF_AUTH_REQUESTED 0x0011 361#define OCF_AUTH_REQUESTED 0x0011
362struct hci_cp_auth_requested { 362struct hci_cp_auth_requested {
363 __u16 handle; 363 __le16 handle;
364} __attribute__ ((packed)); 364} __attribute__ ((packed));
365 365
366#define OCF_SET_CONN_ENCRYPT 0x0013 366#define OCF_SET_CONN_ENCRYPT 0x0013
367struct hci_cp_set_conn_encrypt { 367struct hci_cp_set_conn_encrypt {
368 __u16 handle; 368 __le16 handle;
369 __u8 encrypt; 369 __u8 encrypt;
370} __attribute__ ((packed)); 370} __attribute__ ((packed));
371 371
372#define OCF_CHANGE_CONN_LINK_KEY 0x0015 372#define OCF_CHANGE_CONN_LINK_KEY 0x0015
373struct hci_cp_change_conn_link_key { 373struct hci_cp_change_conn_link_key {
374 __u16 handle; 374 __le16 handle;
375} __attribute__ ((packed)); 375} __attribute__ ((packed));
376 376
377#define OCF_READ_REMOTE_FEATURES 0x001B 377#define OCF_READ_REMOTE_FEATURES 0x001B
378struct hci_cp_read_rmt_features { 378struct hci_cp_read_rmt_features {
379 __u16 handle; 379 __le16 handle;
380} __attribute__ ((packed)); 380} __attribute__ ((packed));
381 381
382#define OCF_READ_REMOTE_VERSION 0x001D 382#define OCF_READ_REMOTE_VERSION 0x001D
383struct hci_cp_read_rmt_version { 383struct hci_cp_read_rmt_version {
384 __u16 handle; 384 __le16 handle;
385} __attribute__ ((packed)); 385} __attribute__ ((packed));
386 386
387/* Link Policy */ 387/* Link Policy */
388#define OGF_LINK_POLICY 0x02 388#define OGF_LINK_POLICY 0x02
389#define OCF_ROLE_DISCOVERY 0x0009 389#define OCF_ROLE_DISCOVERY 0x0009
390struct hci_cp_role_discovery { 390struct hci_cp_role_discovery {
391 __u16 handle; 391 __le16 handle;
392} __attribute__ ((packed)); 392} __attribute__ ((packed));
393struct hci_rp_role_discovery { 393struct hci_rp_role_discovery {
394 __u8 status; 394 __u8 status;
395 __u16 handle; 395 __le16 handle;
396 __u8 role; 396 __u8 role;
397} __attribute__ ((packed)); 397} __attribute__ ((packed));
398 398
399#define OCF_READ_LINK_POLICY 0x000C 399#define OCF_READ_LINK_POLICY 0x000C
400struct hci_cp_read_link_policy { 400struct hci_cp_read_link_policy {
401 __u16 handle; 401 __le16 handle;
402} __attribute__ ((packed)); 402} __attribute__ ((packed));
403struct hci_rp_read_link_policy { 403struct hci_rp_read_link_policy {
404 __u8 status; 404 __u8 status;
405 __u16 handle; 405 __le16 handle;
406 __u16 policy; 406 __le16 policy;
407} __attribute__ ((packed)); 407} __attribute__ ((packed));
408 408
409#define OCF_SWITCH_ROLE 0x000B 409#define OCF_SWITCH_ROLE 0x000B
@@ -414,12 +414,12 @@ struct hci_cp_switch_role {
414 414
415#define OCF_WRITE_LINK_POLICY 0x000D 415#define OCF_WRITE_LINK_POLICY 0x000D
416struct hci_cp_write_link_policy { 416struct hci_cp_write_link_policy {
417 __u16 handle; 417 __le16 handle;
418 __u16 policy; 418 __le16 policy;
419} __attribute__ ((packed)); 419} __attribute__ ((packed));
420struct hci_rp_write_link_policy { 420struct hci_rp_write_link_policy {
421 __u8 status; 421 __u8 status;
422 __u16 handle; 422 __le16 handle;
423} __attribute__ ((packed)); 423} __attribute__ ((packed));
424 424
425/* Status params */ 425/* Status params */
@@ -441,7 +441,7 @@ struct inquiry_info {
441 __u8 pscan_period_mode; 441 __u8 pscan_period_mode;
442 __u8 pscan_mode; 442 __u8 pscan_mode;
443 __u8 dev_class[3]; 443 __u8 dev_class[3];
444 __u16 clock_offset; 444 __le16 clock_offset;
445} __attribute__ ((packed)); 445} __attribute__ ((packed));
446 446
447#define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22 447#define HCI_EV_INQUIRY_RESULT_WITH_RSSI 0x22
@@ -450,7 +450,7 @@ struct inquiry_info_with_rssi {
450 __u8 pscan_rep_mode; 450 __u8 pscan_rep_mode;
451 __u8 pscan_period_mode; 451 __u8 pscan_period_mode;
452 __u8 dev_class[3]; 452 __u8 dev_class[3];
453 __u16 clock_offset; 453 __le16 clock_offset;
454 __s8 rssi; 454 __s8 rssi;
455} __attribute__ ((packed)); 455} __attribute__ ((packed));
456struct inquiry_info_with_rssi_and_pscan_mode { 456struct inquiry_info_with_rssi_and_pscan_mode {
@@ -459,7 +459,7 @@ struct inquiry_info_with_rssi_and_pscan_mode {
459 __u8 pscan_period_mode; 459 __u8 pscan_period_mode;
460 __u8 pscan_mode; 460 __u8 pscan_mode;
461 __u8 dev_class[3]; 461 __u8 dev_class[3];
462 __u16 clock_offset; 462 __le16 clock_offset;
463 __s8 rssi; 463 __s8 rssi;
464} __attribute__ ((packed)); 464} __attribute__ ((packed));
465 465
@@ -469,7 +469,7 @@ struct extended_inquiry_info {
469 __u8 pscan_rep_mode; 469 __u8 pscan_rep_mode;
470 __u8 pscan_period_mode; 470 __u8 pscan_period_mode;
471 __u8 dev_class[3]; 471 __u8 dev_class[3];
472 __u16 clock_offset; 472 __le16 clock_offset;
473 __s8 rssi; 473 __s8 rssi;
474 __u8 data[240]; 474 __u8 data[240];
475} __attribute__ ((packed)); 475} __attribute__ ((packed));
@@ -477,7 +477,7 @@ struct extended_inquiry_info {
477#define HCI_EV_CONN_COMPLETE 0x03 477#define HCI_EV_CONN_COMPLETE 0x03
478struct hci_ev_conn_complete { 478struct hci_ev_conn_complete {
479 __u8 status; 479 __u8 status;
480 __u16 handle; 480 __le16 handle;
481 bdaddr_t bdaddr; 481 bdaddr_t bdaddr;
482 __u8 link_type; 482 __u8 link_type;
483 __u8 encr_mode; 483 __u8 encr_mode;
@@ -493,27 +493,27 @@ struct hci_ev_conn_request {
493#define HCI_EV_DISCONN_COMPLETE 0x05 493#define HCI_EV_DISCONN_COMPLETE 0x05
494struct hci_ev_disconn_complete { 494struct hci_ev_disconn_complete {
495 __u8 status; 495 __u8 status;
496 __u16 handle; 496 __le16 handle;
497 __u8 reason; 497 __u8 reason;
498} __attribute__ ((packed)); 498} __attribute__ ((packed));
499 499
500#define HCI_EV_AUTH_COMPLETE 0x06 500#define HCI_EV_AUTH_COMPLETE 0x06
501struct hci_ev_auth_complete { 501struct hci_ev_auth_complete {
502 __u8 status; 502 __u8 status;
503 __u16 handle; 503 __le16 handle;
504} __attribute__ ((packed)); 504} __attribute__ ((packed));
505 505
506#define HCI_EV_ENCRYPT_CHANGE 0x08 506#define HCI_EV_ENCRYPT_CHANGE 0x08
507struct hci_ev_encrypt_change { 507struct hci_ev_encrypt_change {
508 __u8 status; 508 __u8 status;
509 __u16 handle; 509 __le16 handle;
510 __u8 encrypt; 510 __u8 encrypt;
511} __attribute__ ((packed)); 511} __attribute__ ((packed));
512 512
513#define HCI_EV_CHANGE_CONN_LINK_KEY_COMPLETE 0x09 513#define HCI_EV_CHANGE_CONN_LINK_KEY_COMPLETE 0x09
514struct hci_ev_change_conn_link_key_complete { 514struct hci_ev_change_conn_link_key_complete {
515 __u8 status; 515 __u8 status;
516 __u16 handle; 516 __le16 handle;
517} __attribute__ ((packed)); 517} __attribute__ ((packed));
518 518
519#define HCI_EV_QOS_SETUP_COMPLETE 0x0D 519#define HCI_EV_QOS_SETUP_COMPLETE 0x0D
@@ -526,21 +526,21 @@ struct hci_qos {
526} __attribute__ ((packed)); 526} __attribute__ ((packed));
527struct hci_ev_qos_setup_complete { 527struct hci_ev_qos_setup_complete {
528 __u8 status; 528 __u8 status;
529 __u16 handle; 529 __le16 handle;
530 struct hci_qos qos; 530 struct hci_qos qos;
531} __attribute__ ((packed)); 531} __attribute__ ((packed));
532 532
533#define HCI_EV_CMD_COMPLETE 0x0E 533#define HCI_EV_CMD_COMPLETE 0x0E
534struct hci_ev_cmd_complete { 534struct hci_ev_cmd_complete {
535 __u8 ncmd; 535 __u8 ncmd;
536 __u16 opcode; 536 __le16 opcode;
537} __attribute__ ((packed)); 537} __attribute__ ((packed));
538 538
539#define HCI_EV_CMD_STATUS 0x0F 539#define HCI_EV_CMD_STATUS 0x0F
540struct hci_ev_cmd_status { 540struct hci_ev_cmd_status {
541 __u8 status; 541 __u8 status;
542 __u8 ncmd; 542 __u8 ncmd;
543 __u16 opcode; 543 __le16 opcode;
544} __attribute__ ((packed)); 544} __attribute__ ((packed));
545 545
546#define HCI_EV_NUM_COMP_PKTS 0x13 546#define HCI_EV_NUM_COMP_PKTS 0x13
@@ -559,9 +559,9 @@ struct hci_ev_role_change {
559#define HCI_EV_MODE_CHANGE 0x14 559#define HCI_EV_MODE_CHANGE 0x14
560struct hci_ev_mode_change { 560struct hci_ev_mode_change {
561 __u8 status; 561 __u8 status;
562 __u16 handle; 562 __le16 handle;
563 __u8 mode; 563 __u8 mode;
564 __u16 interval; 564 __le16 interval;
565} __attribute__ ((packed)); 565} __attribute__ ((packed));
566 566
567#define HCI_EV_PIN_CODE_REQ 0x16 567#define HCI_EV_PIN_CODE_REQ 0x16
@@ -584,24 +584,24 @@ struct hci_ev_link_key_notify {
584#define HCI_EV_RMT_FEATURES 0x0B 584#define HCI_EV_RMT_FEATURES 0x0B
585struct hci_ev_rmt_features { 585struct hci_ev_rmt_features {
586 __u8 status; 586 __u8 status;
587 __u16 handle; 587 __le16 handle;
588 __u8 features[8]; 588 __u8 features[8];
589} __attribute__ ((packed)); 589} __attribute__ ((packed));
590 590
591#define HCI_EV_RMT_VERSION 0x0C 591#define HCI_EV_RMT_VERSION 0x0C
592struct hci_ev_rmt_version { 592struct hci_ev_rmt_version {
593 __u8 status; 593 __u8 status;
594 __u16 handle; 594 __le16 handle;
595 __u8 lmp_ver; 595 __u8 lmp_ver;
596 __u16 manufacturer; 596 __le16 manufacturer;
597 __u16 lmp_subver; 597 __le16 lmp_subver;
598} __attribute__ ((packed)); 598} __attribute__ ((packed));
599 599
600#define HCI_EV_CLOCK_OFFSET 0x01C 600#define HCI_EV_CLOCK_OFFSET 0x01C
601struct hci_ev_clock_offset { 601struct hci_ev_clock_offset {
602 __u8 status; 602 __u8 status;
603 __u16 handle; 603 __le16 handle;
604 __u16 clock_offset; 604 __le16 clock_offset;
605} __attribute__ ((packed)); 605} __attribute__ ((packed));
606 606
607#define HCI_EV_PSCAN_REP_MODE 0x20 607#define HCI_EV_PSCAN_REP_MODE 0x20
@@ -638,7 +638,7 @@ struct hci_ev_si_security {
638#define HCI_SCO_HDR_SIZE 3 638#define HCI_SCO_HDR_SIZE 3
639 639
640struct hci_command_hdr { 640struct hci_command_hdr {
641 __u16 opcode; /* OCF & OGF */ 641 __le16 opcode; /* OCF & OGF */
642 __u8 plen; 642 __u8 plen;
643} __attribute__ ((packed)); 643} __attribute__ ((packed));
644 644
@@ -648,22 +648,22 @@ struct hci_event_hdr {
648} __attribute__ ((packed)); 648} __attribute__ ((packed));
649 649
650struct hci_acl_hdr { 650struct hci_acl_hdr {
651 __u16 handle; /* Handle & Flags(PB, BC) */ 651 __le16 handle; /* Handle & Flags(PB, BC) */
652 __u16 dlen; 652 __le16 dlen;
653} __attribute__ ((packed)); 653} __attribute__ ((packed));
654 654
655struct hci_sco_hdr { 655struct hci_sco_hdr {
656 __u16 handle; 656 __le16 handle;
657 __u8 dlen; 657 __u8 dlen;
658} __attribute__ ((packed)); 658} __attribute__ ((packed));
659 659
660/* Command opcode pack/unpack */ 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) 662#define hci_opcode_ogf(op) (op >> 10)
663#define hci_opcode_ocf(op) (op & 0x03ff) 663#define hci_opcode_ocf(op) (op & 0x03ff)
664 664
665/* ACL handle and flags pack/unpack */ 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) 667#define hci_handle(h) (h & 0x0fff)
668#define hci_flags(h) (h >> 12) 668#define hci_flags(h) (h >> 12)
669 669
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 7f933f302078..adb94508259b 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -44,7 +44,7 @@ struct inquiry_data {
44 __u8 pscan_period_mode; 44 __u8 pscan_period_mode;
45 __u8 pscan_mode; 45 __u8 pscan_mode;
46 __u8 dev_class[3]; 46 __u8 dev_class[3];
47 __u16 clock_offset; 47 __le16 clock_offset;
48 __s8 rssi; 48 __s8 rssi;
49}; 49};
50 50