aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2012-05-29 06:59:09 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2012-06-04 23:34:12 -0400
commit8598d064cbf22b2d84c7cd8a9fcb97138baffe3f (patch)
tree4ac83c774867460958b74416144b44004bfd05c1 /include
parent21dbd2ce35f6d2b4aa5363be6c839cdb50644e11 (diff)
Bluetooth: A2MP: Process A2MP Discover Request
Adds helper functions to count HCI devs and process A2MP Discover Request, code makes sure that first controller in the list is BREDR one. Trace is shown below: ... > ACL data: handle 11 flags 0x02 dlen 16 A2MP: Discover req: mtu/mps 670 mask: 0x0000 < ACL data: handle 11 flags 0x00 dlen 22 A2MP: Discover rsp: mtu/mps 670 mask: 0x0000 Controller list: id 0 type 0 (BR-EDR) status 0x01 (Bluetooth only) id 1 type 1 (802.11 AMP) status 0x01 (Bluetooth only) ... Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/a2mp.h2
-rw-r--r--include/net/bluetooth/hci.h3
-rw-r--r--include/net/bluetooth/hci_core.h13
3 files changed, 18 insertions, 0 deletions
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h
index 391acd7a67d4..96f9cc2cf59b 100644
--- a/include/net/bluetooth/a2mp.h
+++ b/include/net/bluetooth/a2mp.h
@@ -15,6 +15,8 @@
15#ifndef __A2MP_H 15#ifndef __A2MP_H
16#define __A2MP_H 16#define __A2MP_H
17 17
18#define A2MP_FEAT_EXT 0x8000
19
18struct amp_mgr { 20struct amp_mgr {
19 struct l2cap_conn *l2cap_conn; 21 struct l2cap_conn *l2cap_conn;
20 struct l2cap_chan *a2mp_chan; 22 struct l2cap_chan *a2mp_chan;
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index de09a26e4223..66af2c6193d5 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -59,6 +59,9 @@
59#define HCI_BREDR 0x00 59#define HCI_BREDR 0x00
60#define HCI_AMP 0x01 60#define HCI_AMP 0x01
61 61
62/* First BR/EDR Controller shall have ID = 0 */
63#define HCI_BREDR_ID 0
64
62/* HCI device quirks */ 65/* HCI device quirks */
63enum { 66enum {
64 HCI_QUIRK_RESET_ON_CLOSE, 67 HCI_QUIRK_RESET_ON_CLOSE,
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 6e64b76e30aa..20fd57367ddc 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -641,6 +641,19 @@ static inline void hci_set_drvdata(struct hci_dev *hdev, void *data)
641 dev_set_drvdata(&hdev->dev, data); 641 dev_set_drvdata(&hdev->dev, data);
642} 642}
643 643
644/* hci_dev_list shall be locked */
645static inline uint8_t __hci_num_ctrl(void)
646{
647 uint8_t count = 0;
648 struct list_head *p;
649
650 list_for_each(p, &hci_dev_list) {
651 count++;
652 }
653
654 return count;
655}
656
644struct hci_dev *hci_dev_get(int index); 657struct hci_dev *hci_dev_get(int index);
645struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); 658struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst);
646 659