diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-11-14 14:51:06 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-11-14 14:51:06 -0500 |
commit | b7fd76d114568d0b1e0d443049ed597b3a55f9c6 (patch) | |
tree | f78ffffe96d4ad4c1405f48c34c344db48b4139f /include | |
parent | 38141fcfaad34a388e61a7a7e98d521330e049d6 (diff) | |
parent | 0c0afedf55ff409be9db0b0aeeaa1c6fe0f3cd3c (diff) |
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Diffstat (limited to 'include')
-rw-r--r-- | include/net/bluetooth/amp.h | 4 | ||||
-rw-r--r-- | include/net/bluetooth/hci.h | 7 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 44 | ||||
-rw-r--r-- | include/net/bluetooth/l2cap.h | 38 |
4 files changed, 74 insertions, 19 deletions
diff --git a/include/net/bluetooth/amp.h b/include/net/bluetooth/amp.h index 2e7c79ea0463..7ea3db77ba89 100644 --- a/include/net/bluetooth/amp.h +++ b/include/net/bluetooth/amp.h | |||
@@ -46,5 +46,9 @@ void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | |||
46 | struct hci_conn *hcon); | 46 | struct hci_conn *hcon); |
47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); | 47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); |
48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); | 48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); |
49 | void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon); | ||
50 | void amp_create_logical_link(struct l2cap_chan *chan); | ||
51 | void amp_disconnect_logical_link(struct hci_chan *hchan); | ||
52 | void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason); | ||
49 | 53 | ||
50 | #endif /* __AMP_H */ | 54 | #endif /* __AMP_H */ |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 88cbbda61027..6c414f4302fe 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -115,6 +115,7 @@ enum { | |||
115 | HCI_SSP_ENABLED, | 115 | HCI_SSP_ENABLED, |
116 | HCI_HS_ENABLED, | 116 | HCI_HS_ENABLED, |
117 | HCI_LE_ENABLED, | 117 | HCI_LE_ENABLED, |
118 | HCI_LE_PERIPHERAL, | ||
118 | HCI_CONNECTABLE, | 119 | HCI_CONNECTABLE, |
119 | HCI_DISCOVERABLE, | 120 | HCI_DISCOVERABLE, |
120 | HCI_LINK_SECURITY, | 121 | HCI_LINK_SECURITY, |
@@ -932,6 +933,12 @@ struct hci_rp_le_read_buffer_size { | |||
932 | __u8 le_max_pkt; | 933 | __u8 le_max_pkt; |
933 | } __packed; | 934 | } __packed; |
934 | 935 | ||
936 | #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 | ||
937 | struct hci_rp_le_read_adv_tx_power { | ||
938 | __u8 status; | ||
939 | __s8 tx_power; | ||
940 | } __packed; | ||
941 | |||
935 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b | 942 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b |
936 | struct hci_cp_le_set_scan_param { | 943 | struct hci_cp_le_set_scan_param { |
937 | __u8 type; | 944 | __u8 type; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 9fe8e2dec870..ce6dbeb6dfb6 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -278,6 +278,8 @@ struct hci_dev { | |||
278 | struct work_struct le_scan; | 278 | struct work_struct le_scan; |
279 | struct le_scan_params le_scan_params; | 279 | struct le_scan_params le_scan_params; |
280 | 280 | ||
281 | __s8 adv_tx_power; | ||
282 | |||
281 | int (*open)(struct hci_dev *hdev); | 283 | int (*open)(struct hci_dev *hdev); |
282 | int (*close)(struct hci_dev *hdev); | 284 | int (*close)(struct hci_dev *hdev); |
283 | int (*flush)(struct hci_dev *hdev); | 285 | int (*flush)(struct hci_dev *hdev); |
@@ -355,6 +357,7 @@ struct hci_chan { | |||
355 | struct hci_conn *conn; | 357 | struct hci_conn *conn; |
356 | struct sk_buff_head data_q; | 358 | struct sk_buff_head data_q; |
357 | unsigned int sent; | 359 | unsigned int sent; |
360 | __u8 state; | ||
358 | }; | 361 | }; |
359 | 362 | ||
360 | extern struct list_head hci_dev_list; | 363 | extern struct list_head hci_dev_list; |
@@ -682,7 +685,7 @@ static inline uint8_t __hci_num_ctrl(void) | |||
682 | } | 685 | } |
683 | 686 | ||
684 | struct hci_dev *hci_dev_get(int index); | 687 | struct hci_dev *hci_dev_get(int index); |
685 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); | 688 | struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src); |
686 | 689 | ||
687 | struct hci_dev *hci_alloc_dev(void); | 690 | struct hci_dev *hci_alloc_dev(void); |
688 | void hci_free_dev(struct hci_dev *hdev); | 691 | void hci_free_dev(struct hci_dev *hdev); |
@@ -747,18 +750,29 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
747 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) | 750 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) |
748 | 751 | ||
749 | /* ----- LMP capabilities ----- */ | 752 | /* ----- LMP capabilities ----- */ |
750 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | ||
751 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) | 753 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) |
754 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | ||
755 | #define lmp_hold_capable(dev) ((dev)->features[0] & LMP_HOLD) | ||
752 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) | 756 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) |
753 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | 757 | #define lmp_park_capable(dev) ((dev)->features[1] & LMP_PARK) |
758 | #define lmp_inq_rssi_capable(dev) ((dev)->features[3] & LMP_RSSI_INQ) | ||
754 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) | 759 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) |
760 | #define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) | ||
761 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | ||
762 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | ||
763 | #define lmp_pause_enc_capable(dev) ((dev)->features[5] & LMP_PAUSE_ENC) | ||
764 | #define lmp_ext_inq_capable(dev) ((dev)->features[6] & LMP_EXT_INQ) | ||
765 | #define lmp_le_br_capable(dev) ((dev)->features[6] & LMP_SIMUL_LE_BR) | ||
755 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) | 766 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) |
756 | #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) | 767 | #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) |
757 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | 768 | #define lmp_lsto_capable(dev) ((dev)->features[7] & LMP_LSTO) |
758 | #define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) | 769 | #define lmp_inq_tx_pwr_capable(dev) ((dev)->features[7] & LMP_INQ_TX_PWR) |
770 | #define lmp_ext_feat_capable(dev) ((dev)->features[7] & LMP_EXTFEATURES) | ||
759 | 771 | ||
760 | /* ----- Extended LMP capabilities ----- */ | 772 | /* ----- Extended LMP capabilities ----- */ |
773 | #define lmp_host_ssp_capable(dev) ((dev)->host_features[0] & LMP_HOST_SSP) | ||
761 | #define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) | 774 | #define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) |
775 | #define lmp_host_le_br_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE_BREDR) | ||
762 | 776 | ||
763 | /* ----- HCI protocols ----- */ | 777 | /* ----- HCI protocols ----- */ |
764 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, | 778 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, |
@@ -877,7 +891,7 @@ struct hci_cb { | |||
877 | 891 | ||
878 | static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | 892 | static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) |
879 | { | 893 | { |
880 | struct list_head *p; | 894 | struct hci_cb *cb; |
881 | __u8 encrypt; | 895 | __u8 encrypt; |
882 | 896 | ||
883 | hci_proto_auth_cfm(conn, status); | 897 | hci_proto_auth_cfm(conn, status); |
@@ -888,8 +902,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
888 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; | 902 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; |
889 | 903 | ||
890 | read_lock(&hci_cb_list_lock); | 904 | read_lock(&hci_cb_list_lock); |
891 | list_for_each(p, &hci_cb_list) { | 905 | list_for_each_entry(cb, &hci_cb_list, list) { |
892 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
893 | if (cb->security_cfm) | 906 | if (cb->security_cfm) |
894 | cb->security_cfm(conn, status, encrypt); | 907 | cb->security_cfm(conn, status, encrypt); |
895 | } | 908 | } |
@@ -899,7 +912,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
899 | static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | 912 | static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, |
900 | __u8 encrypt) | 913 | __u8 encrypt) |
901 | { | 914 | { |
902 | struct list_head *p; | 915 | struct hci_cb *cb; |
903 | 916 | ||
904 | if (conn->sec_level == BT_SECURITY_SDP) | 917 | if (conn->sec_level == BT_SECURITY_SDP) |
905 | conn->sec_level = BT_SECURITY_LOW; | 918 | conn->sec_level = BT_SECURITY_LOW; |
@@ -910,8 +923,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
910 | hci_proto_encrypt_cfm(conn, status, encrypt); | 923 | hci_proto_encrypt_cfm(conn, status, encrypt); |
911 | 924 | ||
912 | read_lock(&hci_cb_list_lock); | 925 | read_lock(&hci_cb_list_lock); |
913 | list_for_each(p, &hci_cb_list) { | 926 | list_for_each_entry(cb, &hci_cb_list, list) { |
914 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
915 | if (cb->security_cfm) | 927 | if (cb->security_cfm) |
916 | cb->security_cfm(conn, status, encrypt); | 928 | cb->security_cfm(conn, status, encrypt); |
917 | } | 929 | } |
@@ -920,11 +932,10 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
920 | 932 | ||
921 | static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) | 933 | static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) |
922 | { | 934 | { |
923 | struct list_head *p; | 935 | struct hci_cb *cb; |
924 | 936 | ||
925 | read_lock(&hci_cb_list_lock); | 937 | read_lock(&hci_cb_list_lock); |
926 | list_for_each(p, &hci_cb_list) { | 938 | list_for_each_entry(cb, &hci_cb_list, list) { |
927 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
928 | if (cb->key_change_cfm) | 939 | if (cb->key_change_cfm) |
929 | cb->key_change_cfm(conn, status); | 940 | cb->key_change_cfm(conn, status); |
930 | } | 941 | } |
@@ -934,11 +945,10 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) | |||
934 | static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, | 945 | static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, |
935 | __u8 role) | 946 | __u8 role) |
936 | { | 947 | { |
937 | struct list_head *p; | 948 | struct hci_cb *cb; |
938 | 949 | ||
939 | read_lock(&hci_cb_list_lock); | 950 | read_lock(&hci_cb_list_lock); |
940 | list_for_each(p, &hci_cb_list) { | 951 | list_for_each_entry(cb, &hci_cb_list, list) { |
941 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
942 | if (cb->role_switch_cfm) | 952 | if (cb->role_switch_cfm) |
943 | cb->role_switch_cfm(conn, status, role); | 953 | cb->role_switch_cfm(conn, status, role); |
944 | } | 954 | } |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 6e23afdf65c1..d65db459c843 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -52,6 +52,8 @@ | |||
52 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) | 52 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) |
53 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) | 53 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) |
54 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) | 54 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) |
55 | #define L2CAP_MOVE_TIMEOUT msecs_to_jiffies(4000) | ||
56 | #define L2CAP_MOVE_ERTX_TIMEOUT msecs_to_jiffies(60000) | ||
55 | 57 | ||
56 | #define L2CAP_A2MP_DEFAULT_MTU 670 | 58 | #define L2CAP_A2MP_DEFAULT_MTU 670 |
57 | 59 | ||
@@ -434,6 +436,8 @@ struct l2cap_chan { | |||
434 | struct sock *sk; | 436 | struct sock *sk; |
435 | 437 | ||
436 | struct l2cap_conn *conn; | 438 | struct l2cap_conn *conn; |
439 | struct hci_conn *hs_hcon; | ||
440 | struct hci_chan *hs_hchan; | ||
437 | struct kref kref; | 441 | struct kref kref; |
438 | 442 | ||
439 | __u8 state; | 443 | __u8 state; |
@@ -477,6 +481,12 @@ struct l2cap_chan { | |||
477 | unsigned long conn_state; | 481 | unsigned long conn_state; |
478 | unsigned long flags; | 482 | unsigned long flags; |
479 | 483 | ||
484 | __u8 remote_amp_id; | ||
485 | __u8 local_amp_id; | ||
486 | __u8 move_id; | ||
487 | __u8 move_state; | ||
488 | __u8 move_role; | ||
489 | |||
480 | __u16 next_tx_seq; | 490 | __u16 next_tx_seq; |
481 | __u16 expected_ack_seq; | 491 | __u16 expected_ack_seq; |
482 | __u16 expected_tx_seq; | 492 | __u16 expected_tx_seq; |
@@ -509,8 +519,6 @@ struct l2cap_chan { | |||
509 | __u32 remote_acc_lat; | 519 | __u32 remote_acc_lat; |
510 | __u32 remote_flush_to; | 520 | __u32 remote_flush_to; |
511 | 521 | ||
512 | __u8 ctrl_id; | ||
513 | |||
514 | struct delayed_work chan_timer; | 522 | struct delayed_work chan_timer; |
515 | struct delayed_work retrans_timer; | 523 | struct delayed_work retrans_timer; |
516 | struct delayed_work monitor_timer; | 524 | struct delayed_work monitor_timer; |
@@ -644,6 +652,9 @@ enum { | |||
644 | enum { | 652 | enum { |
645 | L2CAP_RX_STATE_RECV, | 653 | L2CAP_RX_STATE_RECV, |
646 | L2CAP_RX_STATE_SREJ_SENT, | 654 | L2CAP_RX_STATE_SREJ_SENT, |
655 | L2CAP_RX_STATE_MOVE, | ||
656 | L2CAP_RX_STATE_WAIT_P, | ||
657 | L2CAP_RX_STATE_WAIT_F, | ||
647 | }; | 658 | }; |
648 | 659 | ||
649 | enum { | 660 | enum { |
@@ -674,6 +685,25 @@ enum { | |||
674 | L2CAP_EV_RECV_FRAME, | 685 | L2CAP_EV_RECV_FRAME, |
675 | }; | 686 | }; |
676 | 687 | ||
688 | enum { | ||
689 | L2CAP_MOVE_ROLE_NONE, | ||
690 | L2CAP_MOVE_ROLE_INITIATOR, | ||
691 | L2CAP_MOVE_ROLE_RESPONDER, | ||
692 | }; | ||
693 | |||
694 | enum { | ||
695 | L2CAP_MOVE_STABLE, | ||
696 | L2CAP_MOVE_WAIT_REQ, | ||
697 | L2CAP_MOVE_WAIT_RSP, | ||
698 | L2CAP_MOVE_WAIT_RSP_SUCCESS, | ||
699 | L2CAP_MOVE_WAIT_CONFIRM, | ||
700 | L2CAP_MOVE_WAIT_CONFIRM_RSP, | ||
701 | L2CAP_MOVE_WAIT_LOGICAL_COMP, | ||
702 | L2CAP_MOVE_WAIT_LOGICAL_CFM, | ||
703 | L2CAP_MOVE_WAIT_LOCAL_BUSY, | ||
704 | L2CAP_MOVE_WAIT_PREPARE, | ||
705 | }; | ||
706 | |||
677 | void l2cap_chan_hold(struct l2cap_chan *c); | 707 | void l2cap_chan_hold(struct l2cap_chan *c); |
678 | void l2cap_chan_put(struct l2cap_chan *c); | 708 | void l2cap_chan_put(struct l2cap_chan *c); |
679 | 709 | ||
@@ -778,5 +808,9 @@ void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | |||
778 | void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | 808 | void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); |
779 | void l2cap_chan_del(struct l2cap_chan *chan, int err); | 809 | void l2cap_chan_del(struct l2cap_chan *chan, int err); |
780 | void l2cap_send_conn_req(struct l2cap_chan *chan); | 810 | void l2cap_send_conn_req(struct l2cap_chan *chan); |
811 | void l2cap_move_start(struct l2cap_chan *chan); | ||
812 | void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, | ||
813 | u8 status); | ||
814 | void l2cap_physical_cfm(struct l2cap_chan *chan, int result); | ||
781 | 815 | ||
782 | #endif /* __L2CAP_H */ | 816 | #endif /* __L2CAP_H */ |