Bluetooth: Move SCO support under BT_BREDR config option
Subsystems (2)
PATCH v2 1/1 Bluetooth: Move SCO support under BT_BREDR config option
SCO/eSCO link is supported by BR/EDR controller, it is suitable to move them under BT_BREDR config option
--- include/net/bluetooth/bluetooth.h | 11 +++++++++++ include/net/bluetooth/hci_core.h | 14 +++++++++++++- net/bluetooth/Makefile | 3 ++- net/bluetooth/sco.c | 5 ++--- 4 files changed, 28 insertions(+), 5 deletions(-)
include/net/bluetooth/bluetooth.h +11 -0
@@ -365,8 +365,19 @@ extern struct dentry *bt_debugfs;int l2cap_init (void );void l2cap_exit (void ); +#if IS_ENABLED (CONFIG_BT_BREDR )int sco_init (void );void sco_exit (void ); +#else +static inline int sco_init (void ) +{ +return 0 ; +} + +static inline void sco_exit (void ) +{ +} +#endif int mgmt_init (void );void mgmt_exit (void );
include/net/bluetooth/hci_core.h +13 -1
@@ -532,8 +532,20 @@ int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr);int l2cap_disconn_ind (struct hci_conn *hcon);int l2cap_recv_acldata (struct hci_conn *hcon,struct sk_buff *skb,u16 flags); +#if IS_ENABLED (CONFIG_BT_BREDR )int sco_connect_ind (struct hci_dev *hdev,bdaddr_t *bdaddr,__u8 *flags); -int sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb); +void sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb); +#else +static inline int sco_connect_ind (struct hci_dev *hdev,bdaddr_t *bdaddr, +__u8 *flags) +{ +return 0 ; +} + +static inline void sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb) +{ +} +#endif /* ----- Inquiry cache ----- */ #define INQUIRY_CACHE_AGE_MAX (HZ*30)/* 30 seconds */
net/bluetooth/Makefile +2 -1
@@ -12,9 +12,10 @@ obj-$(CONFIG_BT_6LOWPAN) += bluetooth_6lowpan.o bluetooth_6lowpan-y := 6lowpan.o bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \ - hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \ + hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o lib.o \ a2mp.o amp.o ecc.o hci_request.o mgmt_util.o +bluetooth-$(CONFIG_BT_BREDR) += sco.o bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o bluetooth-$(CONFIG_BT_SELFTEST) += selftest.o
net/bluetooth/sco.c +2 -3
@@ -1110,7 +1110,7 @@ static void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason)sco_conn_del (hcon,bt_to_errno (reason)); } -int sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb) +void sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb) {struct sco_conn *conn = hcon->sco_data;
@@ -1121,12 +1121,11 @@ int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb)if (skb->len) {sco_recv_frame (conn, skb); -return 0 ; +return ; } drop:kfree_skb (skb); -return 0 ; }static struct hci_cb sco_cb = {
Signature · 1 line
1.7.9.5
Marcel Holtmann
maintainerHi Arron,
Quoted 82 lines
SCO/eSCO link is supported by BR/EDR controller, it is suitable to move them under
BT_BREDRconfig optionSigned-off-by Arron Wang <[email protected]>---
include/net/bluetooth/bluetooth.h | 11 +++++++++++ include/net/bluetooth/hci_core.h | 14 +++++++++++++- net/bluetooth/Makefile | 3 ++- net/bluetooth/sco.c | 5 ++--- 4 files changed, 28 insertions(+), 5 deletions(-)include/net/bluetooth/bluetooth.h +11
-0@@ -365,8 +365,19 @@ extern struct dentry *bt_debugfs;int l2cap_init (void );void l2cap_exit (void ); +#if IS_ENABLED (CONFIG_BT_BREDR )int sco_init (void );void sco_exit (void ); +#else +static inline int sco_init (void ) +{ +return 0 ; +} + +static inline void sco_exit (void ) +{ +} +#endif int mgmt_init (void );void mgmt_exit (void );include/net/bluetooth/hci_core.h +13
-1@@ -532,8 +532,20 @@ int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr);int l2cap_disconn_ind (struct hci_conn *hcon);int l2cap_recv_acldata (struct hci_conn *hcon,struct sk_buff *skb,u16 flags); +#if IS_ENABLED (CONFIG_BT_BREDR )int sco_connect_ind (struct hci_dev *hdev,bdaddr_t *bdaddr,__u8 *flags); -int sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb); +void sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb); +#else +static inline int sco_connect_ind (struct hci_dev *hdev,bdaddr_t *bdaddr, +__u8 *flags) +{ +return 0 ; +} + +static inline void sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb) +{ +} +#endif /* ----- Inquiry cache ----- */ #define INQUIRY_CACHE_AGE_MAX (HZ*30)/* 30 seconds */ net/bluetooth/Makefile +0
-0@@ -12,9 +12,10 @@ obj-$(CONFIG_BT_6LOWPAN) += bluetooth_6lowpan.obluetooth_6lowpan-y := 6lowpan.o
bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \
net/bluetooth/Makefile +1
-1- hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \ + hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o lib.o \a2mp.o amp.o ecc.o hci_request.o mgmt_util.o
+bluetooth-$(CONFIG_BT_BREDR) += sco.o
bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o
bluetooth-$(CONFIG_BT_SELFTEST) += selftest.onet/bluetooth/sco.c +0
-0
net/bluetooth/sco.c static void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason) · line 1114
Quoted 6 lines
net/bluetooth/sco.c +1
-1@@ -1110,7 +1110,7 @@ static void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason)sco_conn_del (hcon,bt_to_errno (reason)); } -int sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb) +void sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb) {
I prefer that we do this change in a separate patch and do it for sco_recv_scodata and also l2cap_recv_acldata. Since both are in the same boat here and should be just fixed first.
Regards
Marcel
Hi Marcel,
Quoted 94 lines
-----Original Message-----
From: Marcel Holtmann [mailto:[email protected]]
Sent: Saturday, June 6, 2015 12:54 PM
To: Wang, Arron
Cc: [email protected]
Subject: Re: [PATCHv2] Bluetooth: Move SCO support underBT_BREDRconfig optionHi Arron,
net/bluetooth/sco.c static void sco_disconn_cfm(struct hci_conn *hcon,
Quoted 83 lines
SCO/eSCO link is supported by BR/EDR controller, it is suitable to move them under
BT_BREDRconfig optionSigned-off-by Arron Wang <[email protected]>---
include/net/bluetooth/bluetooth.h | 11 +++++++++++ include/net/bluetooth/hci_core.h | 14 +++++++++++++- net/bluetooth/Makefile | 3 ++- net/bluetooth/sco.c | 5 ++--- 4 files changed, 28 insertions(+), 5 deletions(-)include/net/bluetooth/bluetooth.h +11
-0@@ -365,8 +365,19 @@ extern struct dentry *bt_debugfs; intl2cap_init (void);void l2cap_exit (void ); +#if IS_ENABLED (CONFIG_BT_BREDR )int sco_init (void );void sco_exit (void ); +#else +static inline int sco_init (void ) +{ +return 0 ; +} + +static inline void sco_exit (void ) +{ +} +#endif int mgmt_init (void );void mgmt_exit (void );include/net/bluetooth/hci_core.h +0
-0@@ -532,8 +532,20 @@ int l2cap_connect_ind(struct hci_dev *hdev,
bdaddr_t*bdaddr); intl2cap_disconn_ind(struct hci_conn *hcon); intl2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags);+#if
IS_ENABLED(CONFIG_BT_BREDR)
intsco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags); -intsco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb);include/net/bluetooth/hci_core.h +10
-0+void sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb); +#else static inline int sco_connect_ind (struct hci_dev *hdev, +bdaddr_t *bdaddr, +__u8 *flags) +{ +return 0 ; +} + +static inline void sco_recv_scodata (struct hci_conn *hcon,struct +sk_buff *skb) { }#endif /* ----- Inquiry cache ----- */
#defineINQUIRY_CACHE_AGE_MAX(HZ*30) /* 30 seconds */net/bluetooth/Makefile index renamed from net/bluetooth/Makefile +0
-09a8ea23..29c12ae 100644
net/bluetooth/Makefile +0
-0@@ -12,9 +12,10 @@ obj-$(CONFIG_BT_6LOWPAN) += bluetooth_6lowpan.obluetooth_6lowpan-y := 6lowpan.o
bluetooth-y := af_bluetooth.o hci_core.o hci_conn.o hci_event.o mgmt.o \
net/bluetooth/Makefile +1
-1- hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o sco.o lib.o \ + hci_sock.o hci_sysfs.o l2cap_core.o l2cap_sock.o smp.o lib.o \a2mp.o amp.o ecc.o hci_request.o mgmt_util.o
+bluetooth-$(CONFIG_BT_BREDR) += sco.o
bluetooth-$(CONFIG_BT_DEBUGFS) += hci_debugfs.o
bluetooth-$(CONFIG_BT_SELFTEST) += selftest.onet/bluetooth/sco.c index renamed from net/bluetooth/sco.c +0
-04322c83..f348383 100644
net/bluetooth/sco.c +0
-0@@ -1110,7 +1110,7 @@ static void sco_disconn_cfm(struct hci_conn *hcon,
__u8reason)
Quoted 7 lines
net/bluetooth/sco.c static void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason) · line 1114
Quoted 5 lines
net/bluetooth/sco.c +1
-1sco_conn_del (hcon,bt_to_errno (reason)); } -int sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb) +void sco_recv_scodata (struct hci_conn *hcon,struct sk_buff *skb) {I prefer that we do this change in a separate patch and do it for
sco_recv_scodata
Quoted 1 line
and also
l2cap_recv_acldata. Since both are in the same boat here and
should be
Quoted 1 line
just fixed first.
Ok, I'll submit new patches for them.
Thanks
Arron