diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-14 10:02:51 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-12-16 15:16:14 -0500 |
commit | 2c33c06a8fd2f784ca763ad150d5d63c3c49946e (patch) | |
tree | c8ccf68c9df1f1d8cdc7ef8da2a182b25f584a8a /net | |
parent | 5a13b09531420d230616bd524b68a5b0c23cd487 (diff) |
Bluetooth: remove struct hci_chan_hash
Only the list member of the struct was used, so we now fold it into
hci_conn.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_conn.c | 13 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 9 |
2 files changed, 8 insertions, 14 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index b328ac611ccd..1a076941829b 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c | |||
@@ -374,7 +374,7 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst) | |||
374 | 374 | ||
375 | skb_queue_head_init(&conn->data_q); | 375 | skb_queue_head_init(&conn->data_q); |
376 | 376 | ||
377 | hci_chan_hash_init(conn); | 377 | INIT_LIST_HEAD(&conn->chan_list);; |
378 | 378 | ||
379 | setup_timer(&conn->disc_timer, hci_conn_timeout, (unsigned long)conn); | 379 | setup_timer(&conn->disc_timer, hci_conn_timeout, (unsigned long)conn); |
380 | setup_timer(&conn->idle_timer, hci_conn_idle, (unsigned long)conn); | 380 | setup_timer(&conn->idle_timer, hci_conn_idle, (unsigned long)conn); |
@@ -434,7 +434,7 @@ int hci_conn_del(struct hci_conn *conn) | |||
434 | 434 | ||
435 | tasklet_disable(&hdev->tx_task); | 435 | tasklet_disable(&hdev->tx_task); |
436 | 436 | ||
437 | hci_chan_hash_flush(conn); | 437 | hci_chan_list_flush(conn); |
438 | 438 | ||
439 | hci_conn_hash_del(hdev, conn); | 439 | hci_conn_hash_del(hdev, conn); |
440 | if (hdev->notify) | 440 | if (hdev->notify) |
@@ -970,7 +970,7 @@ struct hci_chan *hci_chan_create(struct hci_conn *conn) | |||
970 | skb_queue_head_init(&chan->data_q); | 970 | skb_queue_head_init(&chan->data_q); |
971 | 971 | ||
972 | tasklet_disable(&hdev->tx_task); | 972 | tasklet_disable(&hdev->tx_task); |
973 | hci_chan_hash_add(conn, chan); | 973 | list_add(&conn->chan_list, &chan->list); |
974 | tasklet_enable(&hdev->tx_task); | 974 | tasklet_enable(&hdev->tx_task); |
975 | 975 | ||
976 | return chan; | 976 | return chan; |
@@ -984,7 +984,7 @@ int hci_chan_del(struct hci_chan *chan) | |||
984 | BT_DBG("%s conn %p chan %p", hdev->name, conn, chan); | 984 | BT_DBG("%s conn %p chan %p", hdev->name, conn, chan); |
985 | 985 | ||
986 | tasklet_disable(&hdev->tx_task); | 986 | tasklet_disable(&hdev->tx_task); |
987 | hci_chan_hash_del(conn, chan); | 987 | list_del(&chan->list); |
988 | tasklet_enable(&hdev->tx_task); | 988 | tasklet_enable(&hdev->tx_task); |
989 | 989 | ||
990 | skb_queue_purge(&chan->data_q); | 990 | skb_queue_purge(&chan->data_q); |
@@ -993,13 +993,12 @@ int hci_chan_del(struct hci_chan *chan) | |||
993 | return 0; | 993 | return 0; |
994 | } | 994 | } |
995 | 995 | ||
996 | void hci_chan_hash_flush(struct hci_conn *conn) | 996 | void hci_chan_list_flush(struct hci_conn *conn) |
997 | { | 997 | { |
998 | struct hci_chan_hash *h = &conn->chan_hash; | ||
999 | struct hci_chan *chan, *tmp; | 998 | struct hci_chan *chan, *tmp; |
1000 | 999 | ||
1001 | BT_DBG("conn %p", conn); | 1000 | BT_DBG("conn %p", conn); |
1002 | 1001 | ||
1003 | list_for_each_entry_safe(chan, tmp, &h->list, list) | 1002 | list_for_each_entry_safe(chan, tmp, &conn->chan_list, list) |
1004 | hci_chan_del(chan); | 1003 | hci_chan_del(chan); |
1005 | } | 1004 | } |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index ce3727ecc0c4..700d0abdf2b1 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -2125,7 +2125,6 @@ static inline struct hci_chan *hci_chan_sent(struct hci_dev *hdev, __u8 type, | |||
2125 | BT_DBG("%s", hdev->name); | 2125 | BT_DBG("%s", hdev->name); |
2126 | 2126 | ||
2127 | list_for_each_entry(conn, &h->list, list) { | 2127 | list_for_each_entry(conn, &h->list, list) { |
2128 | struct hci_chan_hash *ch; | ||
2129 | struct hci_chan *tmp; | 2128 | struct hci_chan *tmp; |
2130 | 2129 | ||
2131 | if (conn->type != type) | 2130 | if (conn->type != type) |
@@ -2136,9 +2135,7 @@ static inline struct hci_chan *hci_chan_sent(struct hci_dev *hdev, __u8 type, | |||
2136 | 2135 | ||
2137 | conn_num++; | 2136 | conn_num++; |
2138 | 2137 | ||
2139 | ch = &conn->chan_hash; | 2138 | list_for_each_entry(tmp, &conn->chan_list, list) { |
2140 | |||
2141 | list_for_each_entry(tmp, &ch->list, list) { | ||
2142 | struct sk_buff *skb; | 2139 | struct sk_buff *skb; |
2143 | 2140 | ||
2144 | if (skb_queue_empty(&tmp->data_q)) | 2141 | if (skb_queue_empty(&tmp->data_q)) |
@@ -2200,7 +2197,6 @@ static void hci_prio_recalculate(struct hci_dev *hdev, __u8 type) | |||
2200 | BT_DBG("%s", hdev->name); | 2197 | BT_DBG("%s", hdev->name); |
2201 | 2198 | ||
2202 | list_for_each_entry(conn, &h->list, list) { | 2199 | list_for_each_entry(conn, &h->list, list) { |
2203 | struct hci_chan_hash *ch; | ||
2204 | struct hci_chan *chan; | 2200 | struct hci_chan *chan; |
2205 | 2201 | ||
2206 | if (conn->type != type) | 2202 | if (conn->type != type) |
@@ -2211,8 +2207,7 @@ static void hci_prio_recalculate(struct hci_dev *hdev, __u8 type) | |||
2211 | 2207 | ||
2212 | num++; | 2208 | num++; |
2213 | 2209 | ||
2214 | ch = &conn->chan_hash; | 2210 | list_for_each_entry(chan, &conn->chan_list, list) { |
2215 | list_for_each_entry(chan, &ch->list, list) { | ||
2216 | struct sk_buff *skb; | 2211 | struct sk_buff *skb; |
2217 | 2212 | ||
2218 | if (chan->sent) { | 2213 | if (chan->sent) { |