Skip to contentSkip to conversation

Bluetooth: bpa10x: Use h4_recv_buf helper for frame reassembly

PATCH Applied Marcel Holtmann 3 participants 4 messages Oct 8, 2015 Bluetooth drivers

lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: bpa10x: Use h4_recv_buf helper for frame reassembly

The manually coded frame reassembly is actually broken. The h4_recv_buf helper from the UART driver is a perfect fit for frame reassembly for this driver. So just export that function and use it here as well.

---
 drivers/bluetooth/Kconfig  |   1 +
 drivers/bluetooth/bpa10x.c | 136 +++++++++------------------------------------
 drivers/bluetooth/hci_h4.c |   1 +
 3 files changed, 29 insertions(+), 109 deletions(-)
drivers/bluetooth/Kconfig +1 -0
index 62999546a301..c9c5dd0bad36 100644
@@ -184,6 +184,7 @@ config BT_HCIBCM203X
 config BT_HCIBPA10X
 	tristate "HCI BPA10x USB driver"
 	depends on USB
+	select BT_HCIUART_H4
 	help
 	  Bluetooth HCI BPA10x USB driver.
 	  This driver provides support for the Digianswer BPA 100/105 Bluetooth
drivers/bluetooth/bpa10x.c +27 -109

163 lines not on this page · raw message

drivers/bluetooth/hci_h4.c +1 -0
index eec3f28e4bb9..a6fce48da0fb 100644
@@ -266,3 +266,4 @@ struct sk_buff *h4_recv_buf(struct hci_dev *hdev, struct sk_buff *skb,
 
 	return skb;
 }
+EXPORT_SYMBOL_GPL(h4_recv_buf);
Signature · 1 line
2.4.3
#1 lore raw
config: i386-allmodconfig (attached as .config) reproduce:

Hi Marcel,

[auto build test ERROR on v4.3-rc4 -- if it's inappropriate base, please ignore]

config: i386-allmodconfig (attached as .config)
reproduce:

        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

>> drivers/bluetooth/bpa10x.c:96:29: error: 'hci_recv_diag' undeclared here (not in a function)

{ HCI_RECV_VENDOR, .recv = hci_recv_diag },
^

vim +/hci_recv_diag +96 drivers/bluetooth/bpa10x.c

    90		.maxlen = HCI_MAX_FRAME_SIZE
    91	
    92	static const struct h4_recv_pkt bpa10x_recv_pkts[] = {
    93		{ H4_RECV_ACL,     .recv = hci_recv_frame },
    94		{ H4_RECV_SCO,     .recv = hci_recv_frame },
    95		{ H4_RECV_EVENT,   .recv = hci_recv_frame },
  > 96		{ HCI_RECV_VENDOR, .recv = hci_recv_diag  },
    97	};
    98	
    99	static void bpa10x_rx_complete(struct urb *urb)

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#2 lore raw
In reply to Marcel Holtmann
config: x86_64-randconfig-x006-201540 (attached as .config) reproduce:

Hi Marcel,

[auto build test WARNING on v4.3-rc4 -- if it's inappropriate base, please ignore]

config: x86_64-randconfig-x006-201540 (attached as .config) reproduce:

        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

warning: (BT_HCIBPA10X) selects BT_HCIUART_H4 which has unmet direct dependencies (NET && BT && BT_HCIUART)

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#3 lore raw
In reply to Marcel Holtmann

Hi Marcel,

Quoted 10 lines · Marcel Holtmann

The manually coded frame reassembly is actually broken. The h4_recv_buf helper from the UART driver is a perfect fit for frame reassembly for this driver. So just export that function and use it here as well.

---
 drivers/bluetooth/Kconfig  |   1 +
 drivers/bluetooth/bpa10x.c | 136 +++++++++------------------------------------
 drivers/bluetooth/hci_h4.c |   1 +
 3 files changed, 29 insertions(+), 109 deletions(-)

Applied to bluetooth-next. Thanks.

Johan