Skip to content

Commit

Permalink
Merge branch 'for-3.1' of git://github.com/padovan/bluetooth-next
Browse files Browse the repository at this point in the history
  • Loading branch information
linvjw committed Sep 19, 2011
2 parents 2249b01 + f78b682 commit 5d59bbc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
6 changes: 6 additions & 0 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,15 @@ static struct usb_device_id btusb_table[] = {
/* Apple MacBookAir3,1, MacBookAir3,2 */
{ USB_DEVICE(0x05ac, 0x821b) },

/* Apple MacBookAir4,1 */
{ USB_DEVICE(0x05ac, 0x821f) },

/* Apple MacBookPro8,2 */
{ USB_DEVICE(0x05ac, 0x821a) },

/* Apple MacMini5,1 */
{ USB_DEVICE(0x05ac, 0x8281) },

/* AVM BlueFRITZ! USB v2.0 */
{ USB_DEVICE(0x057c, 0x3800) },

Expand Down
16 changes: 8 additions & 8 deletions drivers/bluetooth/btwilink.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ static long st_receive(void *priv_data, struct sk_buff *skb)
/* ------- Interfaces to HCI layer ------ */
/* protocol structure registered with shared transport */
static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = {
{
.chnl_id = HCI_EVENT_PKT, /* HCI Events */
.hdr_len = sizeof(struct hci_event_hdr),
.offset_len_in_hdr = offsetof(struct hci_event_hdr, plen),
.len_size = 1, /* sizeof(plen) in struct hci_event_hdr */
.reserve = 8,
},
{
.chnl_id = HCI_ACLDATA_PKT, /* ACL */
.hdr_len = sizeof(struct hci_acl_hdr),
Expand All @@ -138,13 +145,6 @@ static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = {
.len_size = 1, /* sizeof(dlen) in struct hci_sco_hdr */
.reserve = 8,
},
{
.chnl_id = HCI_EVENT_PKT, /* HCI Events */
.hdr_len = sizeof(struct hci_event_hdr),
.offset_len_in_hdr = offsetof(struct hci_event_hdr, plen),
.len_size = 1, /* sizeof(plen) in struct hci_event_hdr */
.reserve = 8,
},
};

/* Called from HCI core to initialize the device */
Expand Down Expand Up @@ -240,7 +240,7 @@ static int ti_st_close(struct hci_dev *hdev)
if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
return 0;

for (i = 0; i < MAX_BT_CHNL_IDS; i++) {
for (i = MAX_BT_CHNL_IDS-1; i >= 0; i--) {
err = st_unregister(&ti_st_proto[i]);
if (err)
BT_ERR("st_unregister(%d) failed with error %d",
Expand Down
17 changes: 8 additions & 9 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ static void hci_cc_inquiry_cancel(struct hci_dev *hdev, struct sk_buff *skb)
if (status)
return;

if (test_bit(HCI_MGMT, &hdev->flags) &&
test_and_clear_bit(HCI_INQUIRY, &hdev->flags))
if (test_and_clear_bit(HCI_INQUIRY, &hdev->flags) &&
test_bit(HCI_MGMT, &hdev->flags))
mgmt_discovering(hdev->id, 0);

hci_req_complete(hdev, HCI_OP_INQUIRY_CANCEL, status);
Expand All @@ -76,8 +76,8 @@ static void hci_cc_exit_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb)
if (status)
return;

if (test_bit(HCI_MGMT, &hdev->flags) &&
test_and_clear_bit(HCI_INQUIRY, &hdev->flags))
if (test_and_clear_bit(HCI_INQUIRY, &hdev->flags) &&
test_bit(HCI_MGMT, &hdev->flags))
mgmt_discovering(hdev->id, 0);

hci_conn_check_pending(hdev);
Expand Down Expand Up @@ -959,9 +959,8 @@ static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status)
return;
}

if (test_bit(HCI_MGMT, &hdev->flags) &&
!test_and_set_bit(HCI_INQUIRY,
&hdev->flags))
if (!test_and_set_bit(HCI_INQUIRY, &hdev->flags) &&
test_bit(HCI_MGMT, &hdev->flags))
mgmt_discovering(hdev->id, 1);
}

Expand Down Expand Up @@ -1340,8 +1339,8 @@ static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff

BT_DBG("%s status %d", hdev->name, status);

if (test_bit(HCI_MGMT, &hdev->flags) &&
test_and_clear_bit(HCI_INQUIRY, &hdev->flags))
if (test_and_clear_bit(HCI_INQUIRY, &hdev->flags) &&
test_bit(HCI_MGMT, &hdev->flags))
mgmt_discovering(hdev->id, 0);

hci_req_complete(hdev, HCI_OP_INQUIRY, status);
Expand Down

0 comments on commit 5d59bbc

Please sign in to comment.