Skip to contentSkip to conversation

Bluetooth: Make l2cap_recv_acldata() and sco_recv_scodata() return void

PATCH In review Arron Wang 2 participants 4 messages Jun 9, 2015

Subsystems (2)
lore
Share & tools
lore

Arron Wang

author
#0 lore raw

PATCH v3 1/2 Bluetooth: Make l2cap_recv_acldata() and sco_recv_scodata() return void

The return value of l2cap_recv_acldata() and sco_recv_scodata() are not used, then change it to return void

---
 include/net/bluetooth/hci_core.h |    4 ++--
 net/bluetooth/l2cap_core.c       |    5 ++---
 net/bluetooth/sco.c              |    5 ++---
 3 files changed, 6 insertions(+), 8 deletions(-)
include/net/bluetooth/hci_core.h +2 -2
index a056c2b..eb34737 100644
@@ -530,10 +530,10 @@ extern struct mutex hci_cb_list_lock;
 /* ----- HCI interface to upper protocols ----- */
 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);
+void l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags);
 
 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);
 
 /* ----- Inquiry cache ----- */
 #define INQUIRY_CACHE_AGE_MAX   (HZ*30)   /* 30 seconds */
net/bluetooth/l2cap_core.c +2 -3
index dad4197..07bd316 100644
@@ -7442,7 +7442,7 @@ static void l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
 	mutex_unlock(&conn->chan_lock);
 }
 
-int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
+void l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
 {
 	struct l2cap_conn *conn = hcon->l2cap_data;
 	struct l2cap_hdr *hdr;
@@ -7485,7 +7485,7 @@ int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
 		if (len == skb->len) {
 			/* Complete frame received */
 			l2cap_recv_frame(conn, skb);
-			return 0;
+			return;
 		}
 
 		BT_DBG("Start: total len %d, frag len %d", len, skb->len);
@@ -7544,7 +7544,6 @@ int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)
 
 drop:
 	kfree_skb(skb);
-	return 0;
 }
 
 static struct hci_cb l2cap_cb = {
net/bluetooth/sco.c +2 -3
index 4322c83..f348383 100644
@@ -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
author
#1 lore raw

PATCH v3 2/2 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  |   12 ++++++++++++
 net/bluetooth/Makefile            |    3 ++-
 3 files changed, 25 insertions(+), 1 deletion(-)
include/net/bluetooth/bluetooth.h +11 -0
index 7dba805..38d8a34 100644
@@ -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 +12 -0
index eb34737..fe4edc7 100644
@@ -532,8 +532,20 @@ int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr);
 int l2cap_disconn_ind(struct hci_conn *hcon);
 void 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);
 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
index 9a8ea23..29c12ae 100644
@@ -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
 
Signature · 1 line
1.7.9.5
maintainer
#2 lore raw

Re: [PATCH v3 2/2] Bluetooth: Move SCO support under BT_BREDR config option

Hi Arron,

Quoted 9 lines

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  |   12 ++++++++++++
net/bluetooth/Makefile            |    3 ++-
3 files changed, 25 insertions(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel

maintainer
#3 lore raw
In reply to Arron Wang

Hi Arron,

Quoted 9 lines

The return value of l2cap_recv_acldata() and sco_recv_scodata() are not used, then change it to return void

---

include/net/bluetooth/hci_core.h |    4 ++--
net/bluetooth/l2cap_core.c       |    5 ++---
net/bluetooth/sco.c              |    5 ++---
3 files changed, 6 insertions(+), 8 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel