aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorVille Tervo <ville.tervo@nokia.com>2011-02-10 20:38:47 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-16 14:32:45 -0500
commitfcd89c09a59a054fb986861e0862aa2fff7d7c40 (patch)
tree115d525a9789e974b0a118d9cc22b792370f40f7 /include/net
parent63185f64ef06464706b32c9a301f71f68cd93e52 (diff)
Bluetooth: Add LE connect support
Bluetooth V4.0 adds support for Low Energy (LE) connections. Specification introduces new set of hci commands to control LE connection. This patch adds logic to create, cancel and disconnect LE connections. Signed-off-by: Ville Tervo <ville.tervo@nokia.com> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/hci.h2
-rw-r--r--include/net/bluetooth/hci_core.h25
2 files changed, 23 insertions, 4 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 802d2505f138..e756f82a29e5 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -168,6 +168,8 @@ enum {
168#define SCO_LINK 0x00 168#define SCO_LINK 0x00
169#define ACL_LINK 0x01 169#define ACL_LINK 0x01
170#define ESCO_LINK 0x02 170#define ESCO_LINK 0x02
171/* Low Energy links do not have defined link type. Use invented one */
172#define LE_LINK 0x80
171 173
172/* LMP features */ 174/* LMP features */
173#define LMP_3SLOT 0x01 175#define LMP_3SLOT 0x01
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 6163bff6fa91..f434e96ce020 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -60,6 +60,7 @@ struct hci_conn_hash {
60 spinlock_t lock; 60 spinlock_t lock;
61 unsigned int acl_num; 61 unsigned int acl_num;
62 unsigned int sco_num; 62 unsigned int sco_num;
63 unsigned int le_num;
63}; 64};
64 65
65struct bdaddr_list { 66struct bdaddr_list {
@@ -309,20 +310,36 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
309{ 310{
310 struct hci_conn_hash *h = &hdev->conn_hash; 311 struct hci_conn_hash *h = &hdev->conn_hash;
311 list_add(&c->list, &h->list); 312 list_add(&c->list, &h->list);
312 if (c->type == ACL_LINK) 313 switch (c->type) {
314 case ACL_LINK:
313 h->acl_num++; 315 h->acl_num++;
314 else 316 break;
317 case LE_LINK:
318 h->le_num++;
319 break;
320 case SCO_LINK:
321 case ESCO_LINK:
315 h->sco_num++; 322 h->sco_num++;
323 break;
324 }
316} 325}
317 326
318static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c) 327static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
319{ 328{
320 struct hci_conn_hash *h = &hdev->conn_hash; 329 struct hci_conn_hash *h = &hdev->conn_hash;
321 list_del(&c->list); 330 list_del(&c->list);
322 if (c->type == ACL_LINK) 331 switch (c->type) {
332 case ACL_LINK:
323 h->acl_num--; 333 h->acl_num--;
324 else 334 break;
335 case LE_LINK:
336 h->le_num--;
337 break;
338 case SCO_LINK:
339 case ESCO_LINK:
325 h->sco_num--; 340 h->sco_num--;
341 break;
342 }
326} 343}
327 344
328static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev, 345static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev,