diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2006-02-13 18:40:55 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-02-13 18:40:55 -0500 |
commit | 15c38c6ecd772ae4cc497955f916f40e803e7528 (patch) | |
tree | f3a967377a58a2e6aae2cfd7f72400deee6a2433 | |
parent | 99e382afd297d91ab150ae46c28c4585f925818c (diff) | |
parent | 9225806386e398eeba46958a7befa017bda73f58 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
-rw-r--r-- | drivers/bluetooth/bt3c_cs.c | 17 | ||||
-rw-r--r-- | include/net/bluetooth/rfcomm.h | 2 | ||||
-rw-r--r-- | net/bluetooth/hci_sock.c | 10 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 13 |
4 files changed, 22 insertions, 20 deletions
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c index e522d19ad886..7e21b1ff27c4 100644 --- a/drivers/bluetooth/bt3c_cs.c +++ b/drivers/bluetooth/bt3c_cs.c | |||
@@ -474,18 +474,6 @@ static int bt3c_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long | |||
474 | /* ======================== Card services HCI interaction ======================== */ | 474 | /* ======================== Card services HCI interaction ======================== */ |
475 | 475 | ||
476 | 476 | ||
477 | static struct device *bt3c_device(void) | ||
478 | { | ||
479 | static struct device dev = { | ||
480 | .bus_id = "pcmcia", | ||
481 | }; | ||
482 | kobject_set_name(&dev.kobj, "bt3c"); | ||
483 | kobject_init(&dev.kobj); | ||
484 | |||
485 | return &dev; | ||
486 | } | ||
487 | |||
488 | |||
489 | static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int count) | 477 | static int bt3c_load_firmware(bt3c_info_t *info, unsigned char *firmware, int count) |
490 | { | 478 | { |
491 | char *ptr = (char *) firmware; | 479 | char *ptr = (char *) firmware; |
@@ -574,6 +562,7 @@ static int bt3c_open(bt3c_info_t *info) | |||
574 | { | 562 | { |
575 | const struct firmware *firmware; | 563 | const struct firmware *firmware; |
576 | struct hci_dev *hdev; | 564 | struct hci_dev *hdev; |
565 | client_handle_t handle; | ||
577 | int err; | 566 | int err; |
578 | 567 | ||
579 | spin_lock_init(&(info->lock)); | 568 | spin_lock_init(&(info->lock)); |
@@ -605,8 +594,10 @@ static int bt3c_open(bt3c_info_t *info) | |||
605 | 594 | ||
606 | hdev->owner = THIS_MODULE; | 595 | hdev->owner = THIS_MODULE; |
607 | 596 | ||
597 | handle = info->link.handle; | ||
598 | |||
608 | /* Load firmware */ | 599 | /* Load firmware */ |
609 | err = request_firmware(&firmware, "BT3CPCC.bin", bt3c_device()); | 600 | err = request_firmware(&firmware, "BT3CPCC.bin", &handle_to_dev(handle)); |
610 | if (err < 0) { | 601 | if (err < 0) { |
611 | BT_ERR("Firmware request failed"); | 602 | BT_ERR("Firmware request failed"); |
612 | goto error; | 603 | goto error; |
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index bbfac86734ec..89d743cfdfdf 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -33,7 +33,7 @@ | |||
33 | #define RFCOMM_DEFAULT_MTU 127 | 33 | #define RFCOMM_DEFAULT_MTU 127 |
34 | #define RFCOMM_DEFAULT_CREDITS 7 | 34 | #define RFCOMM_DEFAULT_CREDITS 7 |
35 | 35 | ||
36 | #define RFCOMM_MAX_L2CAP_MTU 1024 | 36 | #define RFCOMM_MAX_L2CAP_MTU 1013 |
37 | #define RFCOMM_MAX_CREDITS 40 | 37 | #define RFCOMM_MAX_CREDITS 40 |
38 | 38 | ||
39 | #define RFCOMM_SKB_HEAD_RESERVE 8 | 39 | #define RFCOMM_SKB_HEAD_RESERVE 8 |
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index bdb6458c6bd5..97bdec73d17e 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -143,13 +143,15 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb) | |||
143 | static int hci_sock_release(struct socket *sock) | 143 | static int hci_sock_release(struct socket *sock) |
144 | { | 144 | { |
145 | struct sock *sk = sock->sk; | 145 | struct sock *sk = sock->sk; |
146 | struct hci_dev *hdev = hci_pi(sk)->hdev; | 146 | struct hci_dev *hdev; |
147 | 147 | ||
148 | BT_DBG("sock %p sk %p", sock, sk); | 148 | BT_DBG("sock %p sk %p", sock, sk); |
149 | 149 | ||
150 | if (!sk) | 150 | if (!sk) |
151 | return 0; | 151 | return 0; |
152 | 152 | ||
153 | hdev = hci_pi(sk)->hdev; | ||
154 | |||
153 | bt_sock_unlink(&hci_sk_list, sk); | 155 | bt_sock_unlink(&hci_sk_list, sk); |
154 | 156 | ||
155 | if (hdev) { | 157 | if (hdev) { |
@@ -311,14 +313,18 @@ static int hci_sock_getname(struct socket *sock, struct sockaddr *addr, int *add | |||
311 | { | 313 | { |
312 | struct sockaddr_hci *haddr = (struct sockaddr_hci *) addr; | 314 | struct sockaddr_hci *haddr = (struct sockaddr_hci *) addr; |
313 | struct sock *sk = sock->sk; | 315 | struct sock *sk = sock->sk; |
316 | struct hci_dev *hdev = hci_pi(sk)->hdev; | ||
314 | 317 | ||
315 | BT_DBG("sock %p sk %p", sock, sk); | 318 | BT_DBG("sock %p sk %p", sock, sk); |
316 | 319 | ||
320 | if (!hdev) | ||
321 | return -EBADFD; | ||
322 | |||
317 | lock_sock(sk); | 323 | lock_sock(sk); |
318 | 324 | ||
319 | *addr_len = sizeof(*haddr); | 325 | *addr_len = sizeof(*haddr); |
320 | haddr->hci_family = AF_BLUETOOTH; | 326 | haddr->hci_family = AF_BLUETOOTH; |
321 | haddr->hci_dev = hci_pi(sk)->hdev->id; | 327 | haddr->hci_dev = hdev->id; |
322 | 328 | ||
323 | release_sock(sk); | 329 | release_sock(sk); |
324 | return 0; | 330 | return 0; |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 0d89d6434136..5b4253c61f62 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -46,13 +46,15 @@ | |||
46 | #include <net/bluetooth/l2cap.h> | 46 | #include <net/bluetooth/l2cap.h> |
47 | #include <net/bluetooth/rfcomm.h> | 47 | #include <net/bluetooth/rfcomm.h> |
48 | 48 | ||
49 | #define VERSION "1.6" | ||
50 | |||
51 | #ifndef CONFIG_BT_RFCOMM_DEBUG | 49 | #ifndef CONFIG_BT_RFCOMM_DEBUG |
52 | #undef BT_DBG | 50 | #undef BT_DBG |
53 | #define BT_DBG(D...) | 51 | #define BT_DBG(D...) |
54 | #endif | 52 | #endif |
55 | 53 | ||
54 | #define VERSION "1.7" | ||
55 | |||
56 | static unsigned int l2cap_mtu = RFCOMM_MAX_L2CAP_MTU; | ||
57 | |||
56 | static struct task_struct *rfcomm_thread; | 58 | static struct task_struct *rfcomm_thread; |
57 | 59 | ||
58 | static DECLARE_MUTEX(rfcomm_sem); | 60 | static DECLARE_MUTEX(rfcomm_sem); |
@@ -623,7 +625,7 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, bdaddr_t *dst | |||
623 | /* Set L2CAP options */ | 625 | /* Set L2CAP options */ |
624 | sk = sock->sk; | 626 | sk = sock->sk; |
625 | lock_sock(sk); | 627 | lock_sock(sk); |
626 | l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU; | 628 | l2cap_pi(sk)->imtu = l2cap_mtu; |
627 | release_sock(sk); | 629 | release_sock(sk); |
628 | 630 | ||
629 | s = rfcomm_session_add(sock, BT_BOUND); | 631 | s = rfcomm_session_add(sock, BT_BOUND); |
@@ -1868,7 +1870,7 @@ static int rfcomm_add_listener(bdaddr_t *ba) | |||
1868 | /* Set L2CAP options */ | 1870 | /* Set L2CAP options */ |
1869 | sk = sock->sk; | 1871 | sk = sock->sk; |
1870 | lock_sock(sk); | 1872 | lock_sock(sk); |
1871 | l2cap_pi(sk)->imtu = RFCOMM_MAX_L2CAP_MTU; | 1873 | l2cap_pi(sk)->imtu = l2cap_mtu; |
1872 | release_sock(sk); | 1874 | release_sock(sk); |
1873 | 1875 | ||
1874 | /* Start listening on the socket */ | 1876 | /* Start listening on the socket */ |
@@ -2070,6 +2072,9 @@ static void __exit rfcomm_exit(void) | |||
2070 | module_init(rfcomm_init); | 2072 | module_init(rfcomm_init); |
2071 | module_exit(rfcomm_exit); | 2073 | module_exit(rfcomm_exit); |
2072 | 2074 | ||
2075 | module_param(l2cap_mtu, uint, 0644); | ||
2076 | MODULE_PARM_DESC(l2cap_mtu, "Default MTU for the L2CAP connection"); | ||
2077 | |||
2073 | MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>"); | 2078 | MODULE_AUTHOR("Maxim Krasnyansky <maxk@qualcomm.com>, Marcel Holtmann <marcel@holtmann.org>"); |
2074 | MODULE_DESCRIPTION("Bluetooth RFCOMM ver " VERSION); | 2079 | MODULE_DESCRIPTION("Bluetooth RFCOMM ver " VERSION); |
2075 | MODULE_VERSION(VERSION); | 2080 | MODULE_VERSION(VERSION); |