aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-19 10:52:45 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-19 10:52:45 -0500
commit07ce198a1eb3431d04a6d59ea9fb7b71f21e33b1 (patch)
treefe6e6208bdcdfb7bbb0c81923efcb75bf73a299b /net/bluetooth
parent4bc87e62775052aac0be7574d5f84ff06f61c6b4 (diff)
parenta442585952f137bd4cdb1f2f3166e4157d383b82 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (60 commits) [NIU]: Bump driver version and release date. [NIU]: Fix BMAC alternate MAC address indexing. net: fix kernel-doc warnings in header files [IPV6]: Use BUG_ON instead of if + BUG in fib6_del_route. [IPV6]: dst_entry leak in ip4ip6_err. (resend) bluetooth: do not move child device other than rfcomm bluetooth: put hci dev after del conn [NET]: Elminate spurious print_mac() calls. [BLUETOOTH] hci_sysfs.c: Kill build warning. [NET]: Remove MAC_FMT net/8021q/vlan_dev.c: Use print_mac. [XFRM]: Fix ordering issue in xfrm_dst_hash_transfer(). [BLUETOOTH] net/bluetooth/hci_core.c: Use time_* macros [IPV6]: Fix hardcoded removing of old module code [NETLABEL]: Move some initialization code into __init section. [NETLABEL]: Shrink the genl-ops registration code. [AX25] ax25_out: check skb for NULL in ax25_kick() [TCP]: Fix tcp_v4_send_synack() comment [IPV4]: fix alignment of IP-Config output Documentation: fix tcp.txt ...
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_conn.c1
-rw-r--r--net/bluetooth/hci_core.c5
-rw-r--r--net/bluetooth/hci_sysfs.c24
3 files changed, 18 insertions, 12 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 5fc7be206f62..f8880261da0e 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -260,7 +260,6 @@ int hci_conn_del(struct hci_conn *conn)
260 tasklet_enable(&hdev->tx_task); 260 tasklet_enable(&hdev->tx_task);
261 skb_queue_purge(&conn->data_q); 261 skb_queue_purge(&conn->data_q);
262 hci_conn_del_sysfs(conn); 262 hci_conn_del_sysfs(conn);
263 hci_dev_put(hdev);
264 263
265 return 0; 264 return 0;
266} 265}
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 372b0d3b75a8..930b58e7149a 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -24,6 +24,7 @@
24 24
25/* Bluetooth HCI core. */ 25/* Bluetooth HCI core. */
26 26
27#include <linux/jiffies.h>
27#include <linux/module.h> 28#include <linux/module.h>
28#include <linux/kmod.h> 29#include <linux/kmod.h>
29 30
@@ -1321,7 +1322,7 @@ static inline void hci_sched_acl(struct hci_dev *hdev)
1321 if (!test_bit(HCI_RAW, &hdev->flags)) { 1322 if (!test_bit(HCI_RAW, &hdev->flags)) {
1322 /* ACL tx timeout must be longer than maximum 1323 /* ACL tx timeout must be longer than maximum
1323 * link supervision timeout (40.9 seconds) */ 1324 * link supervision timeout (40.9 seconds) */
1324 if (!hdev->acl_cnt && (jiffies - hdev->acl_last_tx) > (HZ * 45)) 1325 if (!hdev->acl_cnt && time_after(jiffies, hdev->acl_last_tx + HZ * 45))
1325 hci_acl_tx_to(hdev); 1326 hci_acl_tx_to(hdev);
1326 } 1327 }
1327 1328
@@ -1543,7 +1544,7 @@ static void hci_cmd_task(unsigned long arg)
1543 1544
1544 BT_DBG("%s cmd %d", hdev->name, atomic_read(&hdev->cmd_cnt)); 1545 BT_DBG("%s cmd %d", hdev->name, atomic_read(&hdev->cmd_cnt));
1545 1546
1546 if (!atomic_read(&hdev->cmd_cnt) && (jiffies - hdev->cmd_last_tx) > HZ) { 1547 if (!atomic_read(&hdev->cmd_cnt) && time_after(jiffies, hdev->cmd_last_tx + HZ)) {
1547 BT_ERR("%s command tx timeout", hdev->name); 1548 BT_ERR("%s command tx timeout", hdev->name);
1548 atomic_set(&hdev->cmd_cnt, 1); 1549 atomic_set(&hdev->cmd_cnt, 1);
1549 } 1550 }
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index e13cf5ef144c..84360c117d4e 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -320,28 +320,34 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
320 queue_work(btaddconn, &conn->work); 320 queue_work(btaddconn, &conn->work);
321} 321}
322 322
323/*
324 * The rfcomm tty device will possibly retain even when conn
325 * is down, and sysfs doesn't support move zombie device,
326 * so we should move the device before conn device is destroyed.
327 */
323static int __match_tty(struct device *dev, void *data) 328static int __match_tty(struct device *dev, void *data)
324{ 329{
325 /* The rfcomm tty device will possibly retain even when conn 330 return !strncmp(dev->bus_id, "rfcomm", 6);
326 * is down, and sysfs doesn't support move zombie device,
327 * so we should move the device before conn device is destroyed.
328 * Due to the only child device of hci_conn dev is rfcomm
329 * tty_dev, here just return 1
330 */
331 return 1;
332} 331}
333 332
334static void del_conn(struct work_struct *work) 333static void del_conn(struct work_struct *work)
335{ 334{
336 struct device *dev;
337 struct hci_conn *conn = container_of(work, struct hci_conn, work); 335 struct hci_conn *conn = container_of(work, struct hci_conn, work);
336 struct hci_dev *hdev = conn->hdev;
337
338 while (1) {
339 struct device *dev;
338 340
339 while (dev = device_find_child(&conn->dev, NULL, __match_tty)) { 341 dev = device_find_child(&conn->dev, NULL, __match_tty);
342 if (!dev)
343 break;
340 device_move(dev, NULL); 344 device_move(dev, NULL);
341 put_device(dev); 345 put_device(dev);
342 } 346 }
347
343 device_del(&conn->dev); 348 device_del(&conn->dev);
344 put_device(&conn->dev); 349 put_device(&conn->dev);
350 hci_dev_put(hdev);
345} 351}
346 352
347void hci_conn_del_sysfs(struct hci_conn *conn) 353void hci_conn_del_sysfs(struct hci_conn *conn)