summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2015-07-24 05:12:55 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-07-30 07:31:59 -0400
commit244bc377591c3882f454882357bc730c90cbedb5 (patch)
tree644a5bd5aa8275c597f0a0d72488c6b5c9201fad
parent4a546ec364633fcbe5709811230d7e0580c9dc1d (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/Kconfig5
-rw-r--r--net/bluetooth/Makefile3
-rw-r--r--net/bluetooth/a2mp.h19
-rw-r--r--net/bluetooth/amp.h14
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
54source "net/bluetooth/hidp/Kconfig" 54source "net/bluetooth/hidp/Kconfig"
55 55
56config BT_HS
57 bool "Bluetooth High Speed (HS) features"
58 depends on BT_BREDR
59 default y
60
56config BT_LE 61config 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
14bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ 14bluetooth-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
18bluetooth-$(CONFIG_BT_BREDR) += sco.o 18bluetooth-$(CONFIG_BT_BREDR) += sco.o
19bluetooth-$(CONFIG_BT_HS) += a2mp.o amp.o
19bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o 20bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o
20bluetooth-$(CONFIG_BT_SELFTEST) += selftest.o 21bluetooth-$(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
132struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr); 132struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr);
133
134#if IS_ENABLED(CONFIG_BT_HS)
133int amp_mgr_put(struct amp_mgr *mgr); 135int amp_mgr_put(struct amp_mgr *mgr);
134struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, 136struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn,
135 struct sk_buff *skb); 137 struct sk_buff *skb);
136void a2mp_discover_amp(struct l2cap_chan *chan); 138void a2mp_discover_amp(struct l2cap_chan *chan);
139#else
140static inline int amp_mgr_put(struct amp_mgr *mgr)
141{
142 return 0;
143}
144
145static inline struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn,
146 struct sk_buff *skb)
147{
148 return NULL;
149}
150
151static inline void a2mp_discover_amp(struct l2cap_chan *chan)
152{
153}
154#endif
155
137void a2mp_send_getinfo_rsp(struct hci_dev *hdev); 156void a2mp_send_getinfo_rsp(struct hci_dev *hdev);
138void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); 157void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status);
139void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); 158void 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);
45void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, 45void 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)
49void amp_create_logical_link(struct l2cap_chan *chan);
50void amp_disconnect_logical_link(struct hci_chan *hchan);
51#else
52static inline void amp_create_logical_link(struct l2cap_chan *chan)
53{
54}
55
56static inline void amp_disconnect_logical_link(struct hci_chan *hchan)
57{
58}
59#endif
60
47void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); 61void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle);
48void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); 62void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle);
49void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon); 63void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon);