diff options
author | Arron Wang <arron.wang@intel.com> | 2015-07-24 05:12:55 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-07-30 07:31:59 -0400 |
commit | 244bc377591c3882f454882357bc730c90cbedb5 (patch) | |
tree | 644a5bd5aa8275c597f0a0d72488c6b5c9201fad | |
parent | 4a546ec364633fcbe5709811230d7e0580c9dc1d (diff) |
Bluetooth: Add BT_HS config option
Move A2MP Module under BT_HS config option and allow
the user have flexible option to choose the feature only
they need
a2mp_discover_amp() & a2mp_channel_create() are a2mp module
entry point for master and slave, and this is dynamic
invoked depends on the userspace or remote request, then
we defined their implementation depends on BT_HS config
Signed-off-by: Arron Wang <arron.wang@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r-- | net/bluetooth/Kconfig | 5 | ||||
-rw-r--r-- | net/bluetooth/Makefile | 3 | ||||
-rw-r--r-- | net/bluetooth/a2mp.h | 19 | ||||
-rw-r--r-- | net/bluetooth/amp.h | 14 |
4 files changed, 40 insertions, 1 deletions
diff --git a/net/bluetooth/Kconfig b/net/bluetooth/Kconfig index b8c794b87523..95d1a66ba03a 100644 --- a/net/bluetooth/Kconfig +++ b/net/bluetooth/Kconfig | |||
@@ -53,6 +53,11 @@ source "net/bluetooth/cmtp/Kconfig" | |||
53 | 53 | ||
54 | source "net/bluetooth/hidp/Kconfig" | 54 | source "net/bluetooth/hidp/Kconfig" |
55 | 55 | ||
56 | config BT_HS | ||
57 | bool "Bluetooth High Speed (HS) features" | ||
58 | depends on BT_BREDR | ||
59 | default y | ||
60 | |||
56 | config BT_LE | 61 | config BT_LE |
57 | bool "Bluetooth Low Energy (LE) features" | 62 | bool "Bluetooth Low Energy (LE) features" |
58 | depends on BT | 63 | depends on BT |
diff --git a/net/bluetooth/Makefile b/net/bluetooth/Makefile index 29c12ae72a66..2b15ae8c1def 100644 --- a/net/bluetooth/Makefile +++ b/net/bluetooth/Makefile | |||
@@ -13,9 +13,10 @@ bluetooth_6lowpan-y := 6lowpan.o | |||
13 | 13 | ||
14 | bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ | 14 | bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ |
15 | hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o lib.o \ | 15 | hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o lib.o \ |
16 | a2mp.o amp.o ecc.o hci_request.o mgmt_util.o | 16 | ecc.o hci_request.o mgmt_util.o |
17 | 17 | ||
18 | bluetooth-$(CONFIG_BT_BREDR) += sco.o | 18 | bluetooth-$(CONFIG_BT_BREDR) += sco.o |
19 | bluetooth-$(CONFIG_BT_HS) += a2mp.o amp.o | ||
19 | bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o | 20 | bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o |
20 | bluetooth-$(CONFIG_BT_SELFTEST) += selftest.o | 21 | bluetooth-$(CONFIG_BT_SELFTEST) += selftest.o |
21 | 22 | ||
diff --git a/net/bluetooth/a2mp.h b/net/bluetooth/a2mp.h index 296f665adb09..a4ff3ea9b38a 100644 --- a/net/bluetooth/a2mp.h +++ b/net/bluetooth/a2mp.h | |||
@@ -130,10 +130,29 @@ struct a2mp_physlink_rsp { | |||
130 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 | 130 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 |
131 | 131 | ||
132 | struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr); | 132 | struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr); |
133 | |||
134 | #if IS_ENABLED(CONFIG_BT_HS) | ||
133 | int amp_mgr_put(struct amp_mgr *mgr); | 135 | int amp_mgr_put(struct amp_mgr *mgr); |
134 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | 136 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, |
135 | struct sk_buff *skb); | 137 | struct sk_buff *skb); |
136 | void a2mp_discover_amp(struct l2cap_chan *chan); | 138 | void a2mp_discover_amp(struct l2cap_chan *chan); |
139 | #else | ||
140 | static inline int amp_mgr_put(struct amp_mgr *mgr) | ||
141 | { | ||
142 | return 0; | ||
143 | } | ||
144 | |||
145 | static inline struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | ||
146 | struct sk_buff *skb) | ||
147 | { | ||
148 | return NULL; | ||
149 | } | ||
150 | |||
151 | static inline void a2mp_discover_amp(struct l2cap_chan *chan) | ||
152 | { | ||
153 | } | ||
154 | #endif | ||
155 | |||
137 | void a2mp_send_getinfo_rsp(struct hci_dev *hdev); | 156 | void a2mp_send_getinfo_rsp(struct hci_dev *hdev); |
138 | void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); | 157 | void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); |
139 | void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); | 158 | void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); |
diff --git a/net/bluetooth/amp.h b/net/bluetooth/amp.h index 7ea3db77ba89..8848f8158ae4 100644 --- a/net/bluetooth/amp.h +++ b/net/bluetooth/amp.h | |||
@@ -44,6 +44,20 @@ void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | |||
44 | struct hci_conn *hcon); | 44 | struct hci_conn *hcon); |
45 | void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | 45 | void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, |
46 | struct hci_conn *hcon); | 46 | struct hci_conn *hcon); |
47 | |||
48 | #if IS_ENABLED(CONFIG_BT_HS) | ||
49 | void amp_create_logical_link(struct l2cap_chan *chan); | ||
50 | void amp_disconnect_logical_link(struct hci_chan *hchan); | ||
51 | #else | ||
52 | static inline void amp_create_logical_link(struct l2cap_chan *chan) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | static inline void amp_disconnect_logical_link(struct hci_chan *hchan) | ||
57 | { | ||
58 | } | ||
59 | #endif | ||
60 | |||
47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); | 61 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); |
48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); | 62 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); |
49 | void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon); | 63 | void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon); |