diff options
| author | John W. Linville <linville@tuxdriver.com> | 2011-12-06 14:59:32 -0500 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2011-12-06 14:59:32 -0500 |
| commit | facda29d75a30a8ff4f1f23a48a368d167563843 (patch) | |
| tree | 3f0b8e77cb826cd24e9f0b760b27467eda76907a | |
| parent | 9995ffe5f5fdddcc73e4465cc3f8b38714df8108 (diff) | |
| parent | 33cb722c22f28964a501a56cc76397834c221c7a (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth
| -rw-r--r-- | drivers/bluetooth/Kconfig | 6 | ||||
| -rw-r--r-- | drivers/bluetooth/btmrvl_sdio.c | 15 | ||||
| -rw-r--r-- | drivers/bluetooth/btusb.c | 3 | ||||
| -rw-r--r-- | net/bluetooth/bnep/core.c | 8 | ||||
| -rw-r--r-- | net/bluetooth/cmtp/core.c | 5 | ||||
| -rw-r--r-- | net/bluetooth/hci_event.c | 2 |
6 files changed, 24 insertions, 15 deletions
diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig index 11b41fd40c27..5ccf142ef0b8 100644 --- a/drivers/bluetooth/Kconfig +++ b/drivers/bluetooth/Kconfig | |||
| @@ -188,7 +188,7 @@ config BT_MRVL | |||
| 188 | The core driver to support Marvell Bluetooth devices. | 188 | The core driver to support Marvell Bluetooth devices. |
| 189 | 189 | ||
| 190 | This driver is required if you want to support | 190 | This driver is required if you want to support |
| 191 | Marvell Bluetooth devices, such as 8688/8787. | 191 | Marvell Bluetooth devices, such as 8688/8787/8797. |
| 192 | 192 | ||
| 193 | Say Y here to compile Marvell Bluetooth driver | 193 | Say Y here to compile Marvell Bluetooth driver |
| 194 | into the kernel or say M to compile it as module. | 194 | into the kernel or say M to compile it as module. |
| @@ -201,8 +201,8 @@ config BT_MRVL_SDIO | |||
| 201 | The driver for Marvell Bluetooth chipsets with SDIO interface. | 201 | The driver for Marvell Bluetooth chipsets with SDIO interface. |
| 202 | 202 | ||
| 203 | This driver is required if you want to use Marvell Bluetooth | 203 | This driver is required if you want to use Marvell Bluetooth |
| 204 | devices with SDIO interface. Currently SD8688/SD8787 chipsets are | 204 | devices with SDIO interface. Currently SD8688/SD8787/SD8797 |
| 205 | supported. | 205 | chipsets are supported. |
| 206 | 206 | ||
| 207 | Say Y here to compile support for Marvell BT-over-SDIO driver | 207 | Say Y here to compile support for Marvell BT-over-SDIO driver |
| 208 | into the kernel or say M to compile it as module. | 208 | into the kernel or say M to compile it as module. |
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c index c827d737ccee..37b56398c8a6 100644 --- a/drivers/bluetooth/btmrvl_sdio.c +++ b/drivers/bluetooth/btmrvl_sdio.c | |||
| @@ -64,7 +64,7 @@ static const struct btmrvl_sdio_card_reg btmrvl_reg_8688 = { | |||
| 64 | .io_port_1 = 0x01, | 64 | .io_port_1 = 0x01, |
| 65 | .io_port_2 = 0x02, | 65 | .io_port_2 = 0x02, |
| 66 | }; | 66 | }; |
| 67 | static const struct btmrvl_sdio_card_reg btmrvl_reg_8787 = { | 67 | static const struct btmrvl_sdio_card_reg btmrvl_reg_87xx = { |
| 68 | .cfg = 0x00, | 68 | .cfg = 0x00, |
| 69 | .host_int_mask = 0x02, | 69 | .host_int_mask = 0x02, |
| 70 | .host_intstatus = 0x03, | 70 | .host_intstatus = 0x03, |
| @@ -91,7 +91,14 @@ static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = { | |||
| 91 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = { | 91 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8787 = { |
| 92 | .helper = NULL, | 92 | .helper = NULL, |
| 93 | .firmware = "mrvl/sd8787_uapsta.bin", | 93 | .firmware = "mrvl/sd8787_uapsta.bin", |
| 94 | .reg = &btmrvl_reg_8787, | 94 | .reg = &btmrvl_reg_87xx, |
| 95 | .sd_blksz_fw_dl = 256, | ||
| 96 | }; | ||
| 97 | |||
| 98 | static const struct btmrvl_sdio_device btmrvl_sdio_sd8797 = { | ||
| 99 | .helper = NULL, | ||
| 100 | .firmware = "mrvl/sd8797_uapsta.bin", | ||
| 101 | .reg = &btmrvl_reg_87xx, | ||
| 95 | .sd_blksz_fw_dl = 256, | 102 | .sd_blksz_fw_dl = 256, |
| 96 | }; | 103 | }; |
| 97 | 104 | ||
| @@ -102,6 +109,9 @@ static const struct sdio_device_id btmrvl_sdio_ids[] = { | |||
| 102 | /* Marvell SD8787 Bluetooth device */ | 109 | /* Marvell SD8787 Bluetooth device */ |
| 103 | { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x911A), | 110 | { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x911A), |
| 104 | .driver_data = (unsigned long) &btmrvl_sdio_sd8787 }, | 111 | .driver_data = (unsigned long) &btmrvl_sdio_sd8787 }, |
| 112 | /* Marvell SD8797 Bluetooth device */ | ||
| 113 | { SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, 0x912A), | ||
| 114 | .driver_data = (unsigned long) &btmrvl_sdio_sd8797 }, | ||
| 105 | 115 | ||
| 106 | { } /* Terminating entry */ | 116 | { } /* Terminating entry */ |
| 107 | }; | 117 | }; |
| @@ -1075,3 +1085,4 @@ MODULE_LICENSE("GPL v2"); | |||
| 1075 | MODULE_FIRMWARE("sd8688_helper.bin"); | 1085 | MODULE_FIRMWARE("sd8688_helper.bin"); |
| 1076 | MODULE_FIRMWARE("sd8688.bin"); | 1086 | MODULE_FIRMWARE("sd8688.bin"); |
| 1077 | MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin"); | 1087 | MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin"); |
| 1088 | MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin"); | ||
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index fe4ebc375b3d..eabc437ce500 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
| @@ -777,9 +777,8 @@ skip_waking: | |||
| 777 | usb_mark_last_busy(data->udev); | 777 | usb_mark_last_busy(data->udev); |
| 778 | } | 778 | } |
| 779 | 779 | ||
| 780 | usb_free_urb(urb); | ||
| 781 | |||
| 782 | done: | 780 | done: |
| 781 | usb_free_urb(urb); | ||
| 783 | return err; | 782 | return err; |
| 784 | } | 783 | } |
| 785 | 784 | ||
diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index 91bcd3a961ec..1eea8208b2cc 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c | |||
| @@ -79,17 +79,12 @@ static struct bnep_session *__bnep_get_session(u8 *dst) | |||
| 79 | 79 | ||
| 80 | static void __bnep_link_session(struct bnep_session *s) | 80 | static void __bnep_link_session(struct bnep_session *s) |
| 81 | { | 81 | { |
| 82 | /* It's safe to call __module_get() here because sessions are added | ||
| 83 | by the socket layer which has to hold the reference to this module. | ||
| 84 | */ | ||
| 85 | __module_get(THIS_MODULE); | ||
| 86 | list_add(&s->list, &bnep_session_list); | 82 | list_add(&s->list, &bnep_session_list); |
| 87 | } | 83 | } |
| 88 | 84 | ||
| 89 | static void __bnep_unlink_session(struct bnep_session *s) | 85 | static void __bnep_unlink_session(struct bnep_session *s) |
| 90 | { | 86 | { |
| 91 | list_del(&s->list); | 87 | list_del(&s->list); |
| 92 | module_put(THIS_MODULE); | ||
| 93 | } | 88 | } |
| 94 | 89 | ||
| 95 | static int bnep_send(struct bnep_session *s, void *data, size_t len) | 90 | static int bnep_send(struct bnep_session *s, void *data, size_t len) |
| @@ -530,6 +525,7 @@ static int bnep_session(void *arg) | |||
| 530 | 525 | ||
| 531 | up_write(&bnep_session_sem); | 526 | up_write(&bnep_session_sem); |
| 532 | free_netdev(dev); | 527 | free_netdev(dev); |
| 528 | module_put_and_exit(0); | ||
| 533 | return 0; | 529 | return 0; |
| 534 | } | 530 | } |
| 535 | 531 | ||
| @@ -616,9 +612,11 @@ int bnep_add_connection(struct bnep_connadd_req *req, struct socket *sock) | |||
| 616 | 612 | ||
| 617 | __bnep_link_session(s); | 613 | __bnep_link_session(s); |
| 618 | 614 | ||
| 615 | __module_get(THIS_MODULE); | ||
| 619 | s->task = kthread_run(bnep_session, s, "kbnepd %s", dev->name); | 616 | s->task = kthread_run(bnep_session, s, "kbnepd %s", dev->name); |
| 620 | if (IS_ERR(s->task)) { | 617 | if (IS_ERR(s->task)) { |
| 621 | /* Session thread start failed, gotta cleanup. */ | 618 | /* Session thread start failed, gotta cleanup. */ |
| 619 | module_put(THIS_MODULE); | ||
| 622 | unregister_netdev(dev); | 620 | unregister_netdev(dev); |
| 623 | __bnep_unlink_session(s); | 621 | __bnep_unlink_session(s); |
| 624 | err = PTR_ERR(s->task); | 622 | err = PTR_ERR(s->task); |
diff --git a/net/bluetooth/cmtp/core.c b/net/bluetooth/cmtp/core.c index 7d00ddf9e9dc..5a6e634f7fca 100644 --- a/net/bluetooth/cmtp/core.c +++ b/net/bluetooth/cmtp/core.c | |||
| @@ -67,14 +67,12 @@ static struct cmtp_session *__cmtp_get_session(bdaddr_t *bdaddr) | |||
| 67 | 67 | ||
| 68 | static void __cmtp_link_session(struct cmtp_session *session) | 68 | static void __cmtp_link_session(struct cmtp_session *session) |
| 69 | { | 69 | { |
| 70 | __module_get(THIS_MODULE); | ||
| 71 | list_add(&session->list, &cmtp_session_list); | 70 | list_add(&session->list, &cmtp_session_list); |
| 72 | } | 71 | } |
| 73 | 72 | ||
| 74 | static void __cmtp_unlink_session(struct cmtp_session *session) | 73 | static void __cmtp_unlink_session(struct cmtp_session *session) |
| 75 | { | 74 | { |
| 76 | list_del(&session->list); | 75 | list_del(&session->list); |
| 77 | module_put(THIS_MODULE); | ||
| 78 | } | 76 | } |
| 79 | 77 | ||
| 80 | static void __cmtp_copy_session(struct cmtp_session *session, struct cmtp_conninfo *ci) | 78 | static void __cmtp_copy_session(struct cmtp_session *session, struct cmtp_conninfo *ci) |
| @@ -327,6 +325,7 @@ static int cmtp_session(void *arg) | |||
| 327 | up_write(&cmtp_session_sem); | 325 | up_write(&cmtp_session_sem); |
| 328 | 326 | ||
| 329 | kfree(session); | 327 | kfree(session); |
| 328 | module_put_and_exit(0); | ||
| 330 | return 0; | 329 | return 0; |
| 331 | } | 330 | } |
| 332 | 331 | ||
| @@ -376,9 +375,11 @@ int cmtp_add_connection(struct cmtp_connadd_req *req, struct socket *sock) | |||
| 376 | 375 | ||
| 377 | __cmtp_link_session(session); | 376 | __cmtp_link_session(session); |
| 378 | 377 | ||
| 378 | __module_get(THIS_MODULE); | ||
| 379 | session->task = kthread_run(cmtp_session, session, "kcmtpd_ctr_%d", | 379 | session->task = kthread_run(cmtp_session, session, "kcmtpd_ctr_%d", |
| 380 | session->num); | 380 | session->num); |
| 381 | if (IS_ERR(session->task)) { | 381 | if (IS_ERR(session->task)) { |
| 382 | module_put(THIS_MODULE); | ||
| 382 | err = PTR_ERR(session->task); | 383 | err = PTR_ERR(session->task); |
| 383 | goto unlink; | 384 | goto unlink; |
| 384 | } | 385 | } |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index d7d96b6b1f0d..643a41b76e2e 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
| @@ -545,7 +545,7 @@ static void hci_setup(struct hci_dev *hdev) | |||
| 545 | { | 545 | { |
| 546 | hci_setup_event_mask(hdev); | 546 | hci_setup_event_mask(hdev); |
| 547 | 547 | ||
| 548 | if (hdev->lmp_ver > 1) | 548 | if (hdev->hci_ver > 1) |
| 549 | hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); | 549 | hci_send_cmd(hdev, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); |
| 550 | 550 | ||
| 551 | if (hdev->features[6] & LMP_SIMPLE_PAIR) { | 551 | if (hdev->features[6] & LMP_SIMPLE_PAIR) { |
