diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2011-11-02 09:52:01 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-11-07 14:24:56 -0500 |
commit | 73d80deb7bdf0171f22e76dc2429c1f99eff90e2 (patch) | |
tree | 17a65f2bf28e1e5a107503f361a7fb061e2ad2f4 /include/net/bluetooth/hci_core.h | |
parent | 3c32fa93e5a54cd54e52541892857b0c7164a61e (diff) |
Bluetooth: prioritizing data over HCI
This implement priority based scheduler using skbuffer priority set via
SO_PRIORITY socket option.
It introduces hci_chan_hash (list of HCI Channel/hci_chan) per connection,
each item in this list refer to a L2CAP connection and it is used to
queue the data for transmission.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net/bluetooth/hci_core.h')
-rw-r--r-- | include/net/bluetooth/hci_core.h | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 5a9db9a4b439..f97792c972f3 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -67,6 +67,12 @@ struct hci_conn_hash { | |||
67 | unsigned int le_num; | 67 | unsigned int le_num; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | struct hci_chan_hash { | ||
71 | struct list_head list; | ||
72 | spinlock_t lock; | ||
73 | unsigned int num; | ||
74 | }; | ||
75 | |||
70 | struct bdaddr_list { | 76 | struct bdaddr_list { |
71 | struct list_head list; | 77 | struct list_head list; |
72 | bdaddr_t bdaddr; | 78 | bdaddr_t bdaddr; |
@@ -287,6 +293,7 @@ struct hci_conn { | |||
287 | unsigned int sent; | 293 | unsigned int sent; |
288 | 294 | ||
289 | struct sk_buff_head data_q; | 295 | struct sk_buff_head data_q; |
296 | struct hci_chan_hash chan_hash; | ||
290 | 297 | ||
291 | struct timer_list disc_timer; | 298 | struct timer_list disc_timer; |
292 | struct timer_list idle_timer; | 299 | struct timer_list idle_timer; |
@@ -309,6 +316,14 @@ struct hci_conn { | |||
309 | void (*disconn_cfm_cb) (struct hci_conn *conn, u8 reason); | 316 | void (*disconn_cfm_cb) (struct hci_conn *conn, u8 reason); |
310 | }; | 317 | }; |
311 | 318 | ||
319 | struct hci_chan { | ||
320 | struct list_head list; | ||
321 | |||
322 | struct hci_conn *conn; | ||
323 | struct sk_buff_head data_q; | ||
324 | unsigned int sent; | ||
325 | }; | ||
326 | |||
312 | extern struct hci_proto *hci_proto[]; | 327 | extern struct hci_proto *hci_proto[]; |
313 | extern struct list_head hci_dev_list; | 328 | extern struct list_head hci_dev_list; |
314 | extern struct list_head hci_cb_list; | 329 | extern struct list_head hci_cb_list; |
@@ -469,6 +484,28 @@ static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev, | |||
469 | return NULL; | 484 | return NULL; |
470 | } | 485 | } |
471 | 486 | ||
487 | static inline void hci_chan_hash_init(struct hci_conn *c) | ||
488 | { | ||
489 | struct hci_chan_hash *h = &c->chan_hash; | ||
490 | INIT_LIST_HEAD(&h->list); | ||
491 | spin_lock_init(&h->lock); | ||
492 | h->num = 0; | ||
493 | } | ||
494 | |||
495 | static inline void hci_chan_hash_add(struct hci_conn *c, struct hci_chan *chan) | ||
496 | { | ||
497 | struct hci_chan_hash *h = &c->chan_hash; | ||
498 | list_add(&chan->list, &h->list); | ||
499 | h->num++; | ||
500 | } | ||
501 | |||
502 | static inline void hci_chan_hash_del(struct hci_conn *c, struct hci_chan *chan) | ||
503 | { | ||
504 | struct hci_chan_hash *h = &c->chan_hash; | ||
505 | list_del(&chan->list); | ||
506 | h->num--; | ||
507 | } | ||
508 | |||
472 | void hci_acl_connect(struct hci_conn *conn); | 509 | void hci_acl_connect(struct hci_conn *conn); |
473 | void hci_acl_disconn(struct hci_conn *conn, __u8 reason); | 510 | void hci_acl_disconn(struct hci_conn *conn, __u8 reason); |
474 | void hci_add_sco(struct hci_conn *conn, __u16 handle); | 511 | void hci_add_sco(struct hci_conn *conn, __u16 handle); |
@@ -480,6 +517,10 @@ int hci_conn_del(struct hci_conn *conn); | |||
480 | void hci_conn_hash_flush(struct hci_dev *hdev); | 517 | void hci_conn_hash_flush(struct hci_dev *hdev); |
481 | void hci_conn_check_pending(struct hci_dev *hdev); | 518 | void hci_conn_check_pending(struct hci_dev *hdev); |
482 | 519 | ||
520 | struct hci_chan *hci_chan_create(struct hci_conn *conn); | ||
521 | int hci_chan_del(struct hci_chan *chan); | ||
522 | void hci_chan_hash_flush(struct hci_conn *conn); | ||
523 | |||
483 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, | 524 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, |
484 | __u8 sec_level, __u8 auth_type); | 525 | __u8 sec_level, __u8 auth_type); |
485 | int hci_conn_check_link_mode(struct hci_conn *conn); | 526 | int hci_conn_check_link_mode(struct hci_conn *conn); |
@@ -849,7 +890,7 @@ int hci_register_notifier(struct notifier_block *nb); | |||
849 | int hci_unregister_notifier(struct notifier_block *nb); | 890 | int hci_unregister_notifier(struct notifier_block *nb); |
850 | 891 | ||
851 | int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param); | 892 | int hci_send_cmd(struct hci_dev *hdev, __u16 opcode, __u32 plen, void *param); |
852 | void hci_send_acl(struct hci_conn *conn, struct sk_buff *skb, __u16 flags); | 893 | void hci_send_acl(struct hci_chan *chan, struct sk_buff *skb, __u16 flags); |
853 | void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb); | 894 | void hci_send_sco(struct hci_conn *conn, struct sk_buff *skb); |
854 | 895 | ||
855 | void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode); | 896 | void *hci_sent_cmd_data(struct hci_dev *hdev, __u16 opcode); |