Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103673
b: refs/heads/master
c: 7d0db0a
h: refs/heads/master
i:
  103671: d5f3bbb
v: v3
  • Loading branch information
Marcel Holtmann committed Jul 14, 2008
1 parent d3daced commit 704c76d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 43cbeee9f9b26300275e4e2d55ed1607f8c5f760
refs/heads/master: 7d0db0a373195385a2e0b19d1f5e4b186fdcffac
8 changes: 5 additions & 3 deletions trunk/net/bluetooth/hci_conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,6 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst)
if (hdev->notify)
hdev->notify(hdev, HCI_NOTIFY_CONN_ADD);

hci_conn_add_sysfs(conn);

tasklet_enable(&hdev->tx_task);

return conn;
Expand Down Expand Up @@ -278,12 +276,14 @@ int hci_conn_del(struct hci_conn *conn)
}

tasklet_disable(&hdev->tx_task);

hci_conn_hash_del(hdev, conn);
if (hdev->notify)
hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);

tasklet_enable(&hdev->tx_task);

skb_queue_purge(&conn->data_q);
hci_conn_del_sysfs(conn);

return 0;
}
Expand Down Expand Up @@ -532,6 +532,8 @@ void hci_conn_hash_flush(struct hci_dev *hdev)

c->state = BT_CLOSED;

hci_conn_del_sysfs(c);

hci_proto_disconn_ind(c, 0x16);
hci_conn_del(c);
}
Expand Down
7 changes: 7 additions & 0 deletions trunk/net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,8 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
} else
conn->state = BT_CONNECTED;

hci_conn_add_sysfs(conn);

if (test_bit(HCI_AUTH, &hdev->flags))
conn->link_mode |= HCI_LM_AUTH;

Expand Down Expand Up @@ -1011,6 +1013,9 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
if (conn) {
conn->state = BT_CLOSED;

hci_conn_del_sysfs(conn);

hci_proto_disconn_ind(conn, ev->reason);
hci_conn_del(conn);
}
Expand Down Expand Up @@ -1643,6 +1648,8 @@ static inline void hci_sync_conn_complete_evt(struct hci_dev *hdev, struct sk_bu
if (!ev->status) {
conn->handle = __le16_to_cpu(ev->handle);
conn->state = BT_CONNECTED;

hci_conn_add_sysfs(conn);
} else
conn->state = BT_CLOSED;

Expand Down
8 changes: 2 additions & 6 deletions trunk/net/bluetooth/hci_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ static void add_conn(struct work_struct *work)
void hci_conn_add_sysfs(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;
bdaddr_t *ba = &conn->dst;

BT_DBG("conn %p", conn);

Expand All @@ -320,11 +319,8 @@ void hci_conn_add_sysfs(struct hci_conn *conn)

conn->dev.release = bt_release;

snprintf(conn->dev.bus_id, BUS_ID_SIZE,
"%s%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X",
conn->type == ACL_LINK ? "acl" : "sco",
ba->b[5], ba->b[4], ba->b[3],
ba->b[2], ba->b[1], ba->b[0]);
snprintf(conn->dev.bus_id, BUS_ID_SIZE, "%s:%d",
hdev->name, conn->handle);

dev_set_drvdata(&conn->dev, conn);

Expand Down

0 comments on commit 704c76d

Please sign in to comment.