diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-02-20 06:26:23 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-02-20 12:20:17 -0500 |
commit | 7129069e84056ba28954550beb208b2645863299 (patch) | |
tree | 3bf41a250b80155985f14a8d6b8f00543cdf7464 /net/bluetooth | |
parent | 39e3e74423a35bfc95b077fb65acaa00d1d39d64 (diff) |
Bluetooth: Rename hci_send_to_control to hci_send_to_channel
The hci_send_to_control() can be made more general purpose with a small
change of passing the desired HCI channel as a parameter to it. This
allows using it for the monitor channel as well as e.g. 6lowpan in the
future.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r-- | net/bluetooth/hci_sock.c | 9 | ||||
-rw-r--r-- | net/bluetooth/mgmt.c | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 1d65c5be7c82..ba5d45f8aac1 100644 --- a/net/bluetooth/hci_sock.c +++ b/net/bluetooth/hci_sock.c | |||
@@ -183,12 +183,13 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb) | |||
183 | kfree_skb(skb_copy); | 183 | kfree_skb(skb_copy); |
184 | } | 184 | } |
185 | 185 | ||
186 | /* Send frame to control socket */ | 186 | /* Send frame to sockets with specific channel */ |
187 | void hci_send_to_control(struct sk_buff *skb, struct sock *skip_sk) | 187 | void hci_send_to_channel(unsigned short channel, struct sk_buff *skb, |
188 | struct sock *skip_sk) | ||
188 | { | 189 | { |
189 | struct sock *sk; | 190 | struct sock *sk; |
190 | 191 | ||
191 | BT_DBG("len %d", skb->len); | 192 | BT_DBG("channel %u len %d", channel, skb->len); |
192 | 193 | ||
193 | read_lock(&hci_sk_list.lock); | 194 | read_lock(&hci_sk_list.lock); |
194 | 195 | ||
@@ -202,7 +203,7 @@ void hci_send_to_control(struct sk_buff *skb, struct sock *skip_sk) | |||
202 | if (sk->sk_state != BT_BOUND) | 203 | if (sk->sk_state != BT_BOUND) |
203 | continue; | 204 | continue; |
204 | 205 | ||
205 | if (hci_pi(sk)->channel != HCI_CHANNEL_CONTROL) | 206 | if (hci_pi(sk)->channel != channel) |
206 | continue; | 207 | continue; |
207 | 208 | ||
208 | nskb = skb_clone(skb, GFP_ATOMIC); | 209 | nskb = skb_clone(skb, GFP_ATOMIC); |
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 3a1b537c9aa6..d5d46e7676f1 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #include <net/bluetooth/bluetooth.h> | 30 | #include <net/bluetooth/bluetooth.h> |
31 | #include <net/bluetooth/hci_core.h> | 31 | #include <net/bluetooth/hci_core.h> |
32 | #include <net/bluetooth/hci_sock.h> | ||
32 | #include <net/bluetooth/l2cap.h> | 33 | #include <net/bluetooth/l2cap.h> |
33 | #include <net/bluetooth/mgmt.h> | 34 | #include <net/bluetooth/mgmt.h> |
34 | 35 | ||
@@ -242,7 +243,7 @@ static int mgmt_event(u16 event, struct hci_dev *hdev, void *data, u16 data_len, | |||
242 | /* Time stamp */ | 243 | /* Time stamp */ |
243 | __net_timestamp(skb); | 244 | __net_timestamp(skb); |
244 | 245 | ||
245 | hci_send_to_control(skb, skip_sk); | 246 | hci_send_to_channel(HCI_CHANNEL_CONTROL, skb, skip_sk); |
246 | kfree_skb(skb); | 247 | kfree_skb(skb); |
247 | 248 | ||
248 | return 0; | 249 | return 0; |