diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-09-19 14:47:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-19 14:47:29 -0400 |
commit | 5d59bbce3d5fba0c612e830f919e003d3da90d70 (patch) | |
tree | 88ff63fb1c462021992f196fefec5ea459291d9c | |
parent | 2249b011432ca3dcce112f0f71e0f531b4bb9347 (diff) | |
parent | f78b68261e80899f81a21dfdf91e2a1456ea8175 (diff) |
Merge branch 'for-3.1' of git://github.com/padovan/bluetooth-next
-rw-r--r-- | drivers/bluetooth/btusb.c | 6 | ||||
-rw-r--r-- | drivers/bluetooth/btwilink.c | 16 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 17 |
3 files changed, 22 insertions, 17 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 3ef476070baf..9cbac6b445e1 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -72,9 +72,15 @@ static struct usb_device_id btusb_table[] = { | |||
72 | /* Apple MacBookAir3,1, MacBookAir3,2 */ | 72 | /* Apple MacBookAir3,1, MacBookAir3,2 */ |
73 | { USB_DEVICE(0x05ac, 0x821b) }, | 73 | { USB_DEVICE(0x05ac, 0x821b) }, |
74 | 74 | ||
75 | /* Apple MacBookAir4,1 */ | ||
76 | { USB_DEVICE(0x05ac, 0x821f) }, | ||
77 | |||
75 | /* Apple MacBookPro8,2 */ | 78 | /* Apple MacBookPro8,2 */ |
76 | { USB_DEVICE(0x05ac, 0x821a) }, | 79 | { USB_DEVICE(0x05ac, 0x821a) }, |
77 | 80 | ||
81 | /* Apple MacMini5,1 */ | ||
82 | { USB_DEVICE(0x05ac, 0x8281) }, | ||
83 | |||
78 | /* AVM BlueFRITZ! USB v2.0 */ | 84 | /* AVM BlueFRITZ! USB v2.0 */ |
79 | { USB_DEVICE(0x057c, 0x3800) }, | 85 | { USB_DEVICE(0x057c, 0x3800) }, |
80 | 86 | ||
diff --git a/drivers/bluetooth/btwilink.c b/drivers/bluetooth/btwilink.c index 65d27aff553a..04d353f58d71 100644 --- a/drivers/bluetooth/btwilink.c +++ b/drivers/bluetooth/btwilink.c | |||
@@ -125,6 +125,13 @@ static long st_receive(void *priv_data, struct sk_buff *skb) | |||
125 | /* protocol structure registered with shared transport */ | 125 | /* protocol structure registered with shared transport */ |
126 | static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = { | 126 | static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = { |
127 | { | 127 | { |
128 | .chnl_id = HCI_EVENT_PKT, /* HCI Events */ | ||
129 | .hdr_len = sizeof(struct hci_event_hdr), | ||
130 | .offset_len_in_hdr = offsetof(struct hci_event_hdr, plen), | ||
131 | .len_size = 1, /* sizeof(plen) in struct hci_event_hdr */ | ||
132 | .reserve = 8, | ||
133 | }, | ||
134 | { | ||
128 | .chnl_id = HCI_ACLDATA_PKT, /* ACL */ | 135 | .chnl_id = HCI_ACLDATA_PKT, /* ACL */ |
129 | .hdr_len = sizeof(struct hci_acl_hdr), | 136 | .hdr_len = sizeof(struct hci_acl_hdr), |
130 | .offset_len_in_hdr = offsetof(struct hci_acl_hdr, dlen), | 137 | .offset_len_in_hdr = offsetof(struct hci_acl_hdr, dlen), |
@@ -138,13 +145,6 @@ static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = { | |||
138 | .len_size = 1, /* sizeof(dlen) in struct hci_sco_hdr */ | 145 | .len_size = 1, /* sizeof(dlen) in struct hci_sco_hdr */ |
139 | .reserve = 8, | 146 | .reserve = 8, |
140 | }, | 147 | }, |
141 | { | ||
142 | .chnl_id = HCI_EVENT_PKT, /* HCI Events */ | ||
143 | .hdr_len = sizeof(struct hci_event_hdr), | ||
144 | .offset_len_in_hdr = offsetof(struct hci_event_hdr, plen), | ||
145 | .len_size = 1, /* sizeof(plen) in struct hci_event_hdr */ | ||
146 | .reserve = 8, | ||
147 | }, | ||
148 | }; | 148 | }; |
149 | 149 | ||
150 | /* Called from HCI core to initialize the device */ | 150 | /* Called from HCI core to initialize the device */ |
@@ -240,7 +240,7 @@ static int ti_st_close(struct hci_dev *hdev) | |||
240 | if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags)) | 240 | if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags)) |
241 | return 0; | 241 | return 0; |
242 | 242 | ||
243 | for (i = 0; i < MAX_BT_CHNL_IDS; i++) { | 243 | for (i = MAX_BT_CHNL_IDS-1; i >= 0; i--) { |
244 | err = st_unregister(&ti_st_proto[i]); | 244 | err = st_unregister(&ti_st_proto[i]); |
245 | if (err) | 245 | if (err) |
246 | BT_ERR("st_unregister(%d) failed with error %d", | 246 | BT_ERR("st_unregister(%d) failed with error %d", |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index a40170e022e8..7ef4eb4435fb 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -58,8 +58,8 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb) | |||
58 | if (status) | 58 | if (status) |
59 | return; | 59 | return; |
60 | 60 | ||
61 | if (test_bit(HCI_MGMT, &hdev->flags) && | 61 | if (test_and_clear_bit(HCI_INQUIRY, &hdev->flags) && |
62 | test_and_clear_bit(HCI_INQUIRY, &hdev->flags)) | 62 | test_bit(HCI_MGMT, &hdev->flags)) |
63 | mgmt_discovering(hdev->id, 0); | 63 | mgmt_discovering(hdev->id, 0); |
64 | 64 | ||
65 | hci_req_complete(hdev, HCI_OP_INQUIRY_CANCEL, status); | 65 | hci_req_complete(hdev, HCI_OP_INQUIRY_CANCEL, status); |
@@ -76,8 +76,8 @@ static void hci_cc_exit_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb) | |||
76 | if (status) | 76 | if (status) |
77 | return; | 77 | return; |
78 | 78 | ||
79 | if (test_bit(HCI_MGMT, &hdev->flags) && | 79 | if (test_and_clear_bit(HCI_INQUIRY, &hdev->flags) && |
80 | test_and_clear_bit(HCI_INQUIRY, &hdev->flags)) | 80 | test_bit(HCI_MGMT, &hdev->flags)) |
81 | mgmt_discovering(hdev->id, 0); | 81 | mgmt_discovering(hdev->id, 0); |
82 | 82 | ||
83 | hci_conn_check_pending(hdev); | 83 | hci_conn_check_pending(hdev); |
@@ -959,9 +959,8 @@ static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status) | |||
959 | return; | 959 | return; |
960 | } | 960 | } |
961 | 961 | ||
962 | if (test_bit(HCI_MGMT, &hdev->flags) && | 962 | if (!test_and_set_bit(HCI_INQUIRY, &hdev->flags) && |
963 | !test_and_set_bit(HCI_INQUIRY, | 963 | test_bit(HCI_MGMT, &hdev->flags)) |
964 | &hdev->flags)) | ||
965 | mgmt_discovering(hdev->id, 1); | 964 | mgmt_discovering(hdev->id, 1); |
966 | } | 965 | } |
967 | 966 | ||
@@ -1340,8 +1339,8 @@ static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff | |||
1340 | 1339 | ||
1341 | BT_DBG("%s status %d", hdev->name, status); | 1340 | BT_DBG("%s status %d", hdev->name, status); |
1342 | 1341 | ||
1343 | if (test_bit(HCI_MGMT, &hdev->flags) && | 1342 | if (test_and_clear_bit(HCI_INQUIRY, &hdev->flags) && |
1344 | test_and_clear_bit(HCI_INQUIRY, &hdev->flags)) | 1343 | test_bit(HCI_MGMT, &hdev->flags)) |
1345 | mgmt_discovering(hdev->id, 0); | 1344 | mgmt_discovering(hdev->id, 0); |
1346 | 1345 | ||
1347 | hci_req_complete(hdev, HCI_OP_INQUIRY, status); | 1346 | hci_req_complete(hdev, HCI_OP_INQUIRY, status); |