diff options
-rw-r--r-- | drivers/bluetooth/bpa10x.c | 4 | ||||
-rw-r--r-- | include/net/bluetooth/hci.h | 116 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 2 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 2 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 6 | ||||
-rw-r--r-- | net/bluetooth/hci_sock.c | 2 |
6 files changed, 66 insertions, 66 deletions
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c index ecbeb7eaba8e..394796315adc 100644 --- a/drivers/bluetooth/bpa10x.c +++ b/drivers/bluetooth/bpa10x.c | |||
@@ -84,8 +84,8 @@ struct bpa10x_data { | |||
84 | 84 | ||
85 | struct hci_vendor_hdr { | 85 | struct hci_vendor_hdr { |
86 | __u8 type; | 86 | __u8 type; |
87 | __u16 snum; | 87 | __le16 snum; |
88 | __u16 dlen; | 88 | __le16 dlen; |
89 | } __attribute__ ((packed)); | 89 | } __attribute__ ((packed)); |
90 | 90 | ||
91 | static void bpa10x_recv_bulk(struct bpa10x_data *data, unsigned char *buf, int count) | 91 | static void bpa10x_recv_bulk(struct bpa10x_data *data, unsigned char *buf, int count) |
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 { | |||
184 | struct hci_rp_read_loc_version { | 184 | struct 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 |
200 | struct hci_rp_read_buffer_size { | 200 | struct 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 |
269 | struct hci_rp_read_voice_setting { | 269 | struct 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 |
275 | struct hci_cp_write_voice_setting { | 275 | struct 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 |
280 | struct hci_cp_host_buffer_size { | 280 | struct 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 |
290 | struct hci_cp_create_conn { | 290 | struct 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 |
312 | struct hci_cp_disconnect { | 312 | struct 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 |
318 | struct hci_cp_add_sco { | 318 | struct 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 |
356 | struct hci_cp_change_conn_ptype { | 356 | struct 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 |
362 | struct hci_cp_auth_requested { | 362 | struct 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 |
367 | struct hci_cp_set_conn_encrypt { | 367 | struct 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 |
373 | struct hci_cp_change_conn_link_key { | 373 | struct 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 |
378 | struct hci_cp_read_rmt_features { | 378 | struct 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 |
383 | struct hci_cp_read_rmt_version { | 383 | struct 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 |
390 | struct hci_cp_role_discovery { | 390 | struct hci_cp_role_discovery { |
391 | __u16 handle; | 391 | __le16 handle; |
392 | } __attribute__ ((packed)); | 392 | } __attribute__ ((packed)); |
393 | struct hci_rp_role_discovery { | 393 | struct 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 |
400 | struct hci_cp_read_link_policy { | 400 | struct hci_cp_read_link_policy { |
401 | __u16 handle; | 401 | __le16 handle; |
402 | } __attribute__ ((packed)); | 402 | } __attribute__ ((packed)); |
403 | struct hci_rp_read_link_policy { | 403 | struct 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 |
416 | struct hci_cp_write_link_policy { | 416 | struct hci_cp_write_link_policy { |
417 | __u16 handle; | 417 | __le16 handle; |
418 | __u16 policy; | 418 | __le16 policy; |
419 | } __attribute__ ((packed)); | 419 | } __attribute__ ((packed)); |
420 | struct hci_rp_write_link_policy { | 420 | struct 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)); |
456 | struct inquiry_info_with_rssi_and_pscan_mode { | 456 | struct 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 |
478 | struct hci_ev_conn_complete { | 478 | struct 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 |
494 | struct hci_ev_disconn_complete { | 494 | struct 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 |
501 | struct hci_ev_auth_complete { | 501 | struct 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 |
507 | struct hci_ev_encrypt_change { | 507 | struct 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 |
514 | struct hci_ev_change_conn_link_key_complete { | 514 | struct 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)); |
527 | struct hci_ev_qos_setup_complete { | 527 | struct 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 |
534 | struct hci_ev_cmd_complete { | 534 | struct 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 |
540 | struct hci_ev_cmd_status { | 540 | struct 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 |
560 | struct hci_ev_mode_change { | 560 | struct 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 |
585 | struct hci_ev_rmt_features { | 585 | struct 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 |
592 | struct hci_ev_rmt_version { | 592 | struct 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 |
601 | struct hci_ev_clock_offset { | 601 | struct 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 | ||
640 | struct hci_command_hdr { | 640 | struct 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 | ||
650 | struct hci_acl_hdr { | 650 | struct 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 | ||
655 | struct hci_sco_hdr { | 655 | struct 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 | ||
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index cf0df1c8c933..9106354c781e 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -183,7 +183,7 @@ static void hci_reset_req(struct hci_dev *hdev, unsigned long opt) | |||
183 | static void hci_init_req(struct hci_dev *hdev, unsigned long opt) | 183 | static void hci_init_req(struct hci_dev *hdev, unsigned long opt) |
184 | { | 184 | { |
185 | struct sk_buff *skb; | 185 | struct sk_buff *skb; |
186 | __u16 param; | 186 | __le16 param; |
187 | 187 | ||
188 | BT_DBG("%s %ld", hdev->name, opt); | 188 | BT_DBG("%s %ld", hdev->name, opt); |
189 | 189 | ||
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index b61b4e8e36fd..eb64555d1fb3 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -242,7 +242,7 @@ static void hci_cc_host_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb | |||
242 | break; | 242 | break; |
243 | 243 | ||
244 | status = *((__u8 *) skb->data); | 244 | status = *((__u8 *) skb->data); |
245 | setting = __le16_to_cpu(get_unaligned((__u16 *) sent)); | 245 | setting = __le16_to_cpu(get_unaligned((__le16 *) sent)); |
246 | 246 | ||
247 | if (!status && hdev->voice_setting != setting) { | 247 | if (!status && hdev->voice_setting != setting) { |
248 | hdev->voice_setting = setting; | 248 | hdev->voice_setting = setting; |
@@ -728,7 +728,7 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff | |||
728 | static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *skb) | 728 | static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *skb) |
729 | { | 729 | { |
730 | struct hci_ev_num_comp_pkts *ev = (struct hci_ev_num_comp_pkts *) skb->data; | 730 | struct hci_ev_num_comp_pkts *ev = (struct hci_ev_num_comp_pkts *) skb->data; |
731 | __u16 *ptr; | 731 | __le16 *ptr; |
732 | int i; | 732 | int i; |
733 | 733 | ||
734 | skb_pull(skb, sizeof(*ev)); | 734 | skb_pull(skb, sizeof(*ev)); |
@@ -742,7 +742,7 @@ static inline void hci_num_comp_pkts_evt(struct hci_dev *hdev, struct sk_buff *s | |||
742 | 742 | ||
743 | tasklet_disable(&hdev->tx_task); | 743 | tasklet_disable(&hdev->tx_task); |
744 | 744 | ||
745 | for (i = 0, ptr = (__u16 *) skb->data; i < ev->num_hndl; i++) { | 745 | for (i = 0, ptr = (__le16 *) skb->data; i < ev->num_hndl; i++) { |
746 | struct hci_conn *conn; | 746 | struct hci_conn *conn; |
747 | __u16 handle, count; | 747 | __u16 handle, count; |
748 | 748 | ||
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 799e448750ad..1d6d0a15c099 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -416,7 +416,7 @@ static int hci_sock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
416 | skb->dev = (void *) hdev; | 416 | skb->dev = (void *) hdev; |
417 | 417 | ||
418 | if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) { | 418 | if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) { |
419 | u16 opcode = __le16_to_cpu(get_unaligned((u16 *)skb->data)); | 419 | u16 opcode = __le16_to_cpu(get_unaligned((__le16 *) skb->data)); |
420 | u16 ogf = hci_opcode_ogf(opcode); | 420 | u16 ogf = hci_opcode_ogf(opcode); |
421 | u16 ocf = hci_opcode_ocf(opcode); | 421 | u16 ocf = hci_opcode_ocf(opcode); |
422 | 422 | ||