aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-02-27 01:46:54 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-27 01:46:54 -0500
commit63748aa8cd20a6bfb4a8ef3be9b51bec5e38ab72 (patch)
tree380eb052c1b93ce11535ffab7f29c4e3d02a7697 /drivers
parent43be63662db56de3f87cb4a86bfe062a9797be65 (diff)
parentb1fb06830dc870d862f7f80e276130c0ab84d59f (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-next-2.6
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bluetooth/bfusb.c3
-rw-r--r--drivers/bluetooth/bt3c_cs.c4
-rw-r--r--drivers/bluetooth/btusb.c40
-rw-r--r--drivers/bluetooth/hci_h4.c3
-rw-r--r--drivers/bluetooth/hci_ll.c3
5 files changed, 28 insertions, 25 deletions
diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c
index d3f14bee0f19..2a00707aba3b 100644
--- a/drivers/bluetooth/bfusb.c
+++ b/drivers/bluetooth/bfusb.c
@@ -257,8 +257,7 @@ static inline int bfusb_recv_block(struct bfusb_data *data, int hdr, unsigned ch
257 257
258 if (hdr & 0x10) { 258 if (hdr & 0x10) {
259 BT_ERR("%s error in block", data->hdev->name); 259 BT_ERR("%s error in block", data->hdev->name);
260 if (data->reassembly) 260 kfree_skb(data->reassembly);
261 kfree_skb(data->reassembly);
262 data->reassembly = NULL; 261 data->reassembly = NULL;
263 return -EIO; 262 return -EIO;
264 } 263 }
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index ff195c230825..d58e22b9f06a 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -359,9 +359,9 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)
359 BT_ERR("Very strange (stat=0x%04x)", stat); 359 BT_ERR("Very strange (stat=0x%04x)", stat);
360 } else if ((stat & 0xff) != 0xff) { 360 } else if ((stat & 0xff) != 0xff) {
361 if (stat & 0x0020) { 361 if (stat & 0x0020) {
362 int stat = bt3c_read(iobase, 0x7002) & 0x10; 362 int status = bt3c_read(iobase, 0x7002) & 0x10;
363 BT_INFO("%s: Antenna %s", info->hdev->name, 363 BT_INFO("%s: Antenna %s", info->hdev->name,
364 stat ? "out" : "in"); 364 status ? "out" : "in");
365 } 365 }
366 if (stat & 0x0001) 366 if (stat & 0x0001)
367 bt3c_receive(info); 367 bt3c_receive(info);
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index b5fbda6d490a..e70c57ee4221 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -35,7 +35,7 @@
35#include <net/bluetooth/bluetooth.h> 35#include <net/bluetooth/bluetooth.h>
36#include <net/bluetooth/hci_core.h> 36#include <net/bluetooth/hci_core.h>
37 37
38#define VERSION "0.4" 38#define VERSION "0.5"
39 39
40static int ignore_dga; 40static int ignore_dga;
41static int ignore_csr; 41static int ignore_csr;
@@ -171,6 +171,7 @@ struct btusb_data {
171 171
172 __u8 cmdreq_type; 172 __u8 cmdreq_type;
173 173
174 unsigned int sco_num;
174 int isoc_altsetting; 175 int isoc_altsetting;
175 int suspend_count; 176 int suspend_count;
176}; 177};
@@ -496,11 +497,23 @@ static int btusb_open(struct hci_dev *hdev)
496 return 0; 497 return 0;
497 498
498 err = btusb_submit_intr_urb(hdev, GFP_KERNEL); 499 err = btusb_submit_intr_urb(hdev, GFP_KERNEL);
500 if (err < 0)
501 goto failed;
502
503 err = btusb_submit_bulk_urb(hdev, GFP_KERNEL);
499 if (err < 0) { 504 if (err < 0) {
500 clear_bit(BTUSB_INTR_RUNNING, &data->flags); 505 usb_kill_anchored_urbs(&data->intr_anchor);
501 clear_bit(HCI_RUNNING, &hdev->flags); 506 goto failed;
502 } 507 }
503 508
509 set_bit(BTUSB_BULK_RUNNING, &data->flags);
510 btusb_submit_bulk_urb(hdev, GFP_KERNEL);
511
512 return 0;
513
514failed:
515 clear_bit(BTUSB_INTR_RUNNING, &data->flags);
516 clear_bit(HCI_RUNNING, &hdev->flags);
504 return err; 517 return err;
505} 518}
506 519
@@ -655,19 +668,10 @@ static void btusb_notify(struct hci_dev *hdev, unsigned int evt)
655 668
656 BT_DBG("%s evt %d", hdev->name, evt); 669 BT_DBG("%s evt %d", hdev->name, evt);
657 670
658 if (hdev->conn_hash.acl_num > 0) { 671 if (hdev->conn_hash.sco_num != data->sco_num) {
659 if (!test_and_set_bit(BTUSB_BULK_RUNNING, &data->flags)) { 672 data->sco_num = hdev->conn_hash.sco_num;
660 if (btusb_submit_bulk_urb(hdev, GFP_ATOMIC) < 0) 673 schedule_work(&data->work);
661 clear_bit(BTUSB_BULK_RUNNING, &data->flags);
662 else
663 btusb_submit_bulk_urb(hdev, GFP_ATOMIC);
664 }
665 } else {
666 clear_bit(BTUSB_BULK_RUNNING, &data->flags);
667 usb_unlink_anchored_urbs(&data->bulk_anchor);
668 } 674 }
669
670 schedule_work(&data->work);
671} 675}
672 676
673static int inline __set_isoc_interface(struct hci_dev *hdev, int altsetting) 677static int inline __set_isoc_interface(struct hci_dev *hdev, int altsetting)
@@ -982,9 +986,11 @@ static int btusb_resume(struct usb_interface *intf)
982 } 986 }
983 987
984 if (test_bit(BTUSB_BULK_RUNNING, &data->flags)) { 988 if (test_bit(BTUSB_BULK_RUNNING, &data->flags)) {
985 if (btusb_submit_bulk_urb(hdev, GFP_NOIO) < 0) 989 err = btusb_submit_bulk_urb(hdev, GFP_NOIO);
990 if (err < 0) {
986 clear_bit(BTUSB_BULK_RUNNING, &data->flags); 991 clear_bit(BTUSB_BULK_RUNNING, &data->flags);
987 else 992 return err;
993 } else
988 btusb_submit_bulk_urb(hdev, GFP_NOIO); 994 btusb_submit_bulk_urb(hdev, GFP_NOIO);
989 } 995 }
990 996
diff --git a/drivers/bluetooth/hci_h4.c b/drivers/bluetooth/hci_h4.c
index b0fafb055996..c0ce8134814e 100644
--- a/drivers/bluetooth/hci_h4.c
+++ b/drivers/bluetooth/hci_h4.c
@@ -102,8 +102,7 @@ static int h4_close(struct hci_uart *hu)
102 102
103 skb_queue_purge(&h4->txq); 103 skb_queue_purge(&h4->txq);
104 104
105 if (h4->rx_skb) 105 kfree_skb(h4->rx_skb);
106 kfree_skb(h4->rx_skb);
107 106
108 hu->priv = NULL; 107 hu->priv = NULL;
109 kfree(h4); 108 kfree(h4);
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index b91d45a41b2f..5c65014635be 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -163,8 +163,7 @@ static int ll_close(struct hci_uart *hu)
163 skb_queue_purge(&ll->tx_wait_q); 163 skb_queue_purge(&ll->tx_wait_q);
164 skb_queue_purge(&ll->txq); 164 skb_queue_purge(&ll->txq);
165 165
166 if (ll->rx_skb) 166 kfree_skb(ll->rx_skb);
167 kfree_skb(ll->rx_skb);
168 167
169 hu->priv = NULL; 168 hu->priv = NULL;
170 169