Skip to contentSkip to conversation

Bluetooth: btqca: Introduce generic QCA ROME support

PATCH Superseded Ben Young Tae Kim 2 participants 3 messages Jul 30, 2015

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Bluetooth: btqca: Introduce generic QCA ROME support

This is for supporting BT for QCA ROME with specific vendor specific HCI commands and initialization. This will have USB/UART implementation both, but for now, adding UART vendor specific commands to patch downloading and set BDaddress using VS command.

---
 drivers/bluetooth/Kconfig  |   4 +
 drivers/bluetooth/Makefile |   1 +
 drivers/bluetooth/btqca.c  | 523 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/bluetooth/btqca.h  | 156 ++++++++++++++
 4 files changed, 684 insertions(+)
 create mode 100644 drivers/bluetooth/btqca.c
 create mode 100644 drivers/bluetooth/btqca.h
drivers/bluetooth/Kconfig +4 -0
index 79e8234..f580334 100644
@@ -13,6 +13,10 @@ config BT_RTL
     tristate
     select FW_LOADER
 
+config BT_QCA
+    tristate
+    select FW_LOADER
+
 config BT_HCIBTUSB
     tristate "HCI USB driver"
     depends on USB
drivers/bluetooth/Makefile +1 -0
index f40e194..15a0d1d 100644
@@ -22,6 +22,7 @@ obj-$(CONFIG_BT_MRVL_SDIO)    += btmrvl_sdio.o
 obj-$(CONFIG_BT_WILINK)        += btwilink.o
 obj-$(CONFIG_BT_BCM)        += btbcm.o
 obj-$(CONFIG_BT_RTL)        += btrtl.o
+obj-$(CONFIG_BT_QCA)        += btqca.o
 
 btmrvl-y            := btmrvl_main.o
 btmrvl-$(CONFIG_DEBUG_FS)    += btmrvl_debugfs.o
drivers/bluetooth/btqca.c new file +523 -0

523 lines not on this page · raw message

drivers/bluetooth/btqca.h new file +156 -0

156 lines not on this page · raw message

Signature · 1 line
2.0.5
maintainer
#1 lore raw

Hi Ben,

Quoted 48 lines

This is for supporting BT for QCA ROME with specific vendor specific HCI commands and initialization. This will have USB/UART implementation both, but for now, adding UART vendor specific commands to patch downloading and set BDaddress using VS command.

---

drivers/bluetooth/Kconfig  |   4 +
drivers/bluetooth/Makefile |   1 +
drivers/bluetooth/btqca.c  | 523 +++++++++++++++++++++++++++++++++++++++++++++
drivers/bluetooth/btqca.h  | 156 ++++++++++++++
4 files changed, 684 insertions(+)

create mode 100644 drivers/bluetooth/btqca.c
create mode 100644 drivers/bluetooth/btqca.h

drivers/bluetooth/Kconfig +4 -0
index 79e8234..f580334 100644
@@ -13,6 +13,10 @@ config BT_RTL
    tristate
    select FW_LOADER
 
+config BT_QCA
+    tristate
+    select FW_LOADER
+

config BT_HCIBTUSB
tristate "HCI USB driver"
depends on USB

drivers/bluetooth/Makefile +0 -0
index f40e194..15a0d1d 100644
@@ -22,6 +22,7 @@ obj-$(CONFIG_BT_MRVL_SDIO)    += btmrvl_sdio.o

obj-$(CONFIG_BT_WILINK) += btwilink.o
obj-$(CONFIG_BT_BCM) += btbcm.o
obj-$(CONFIG_BT_RTL) += btrtl.o
+obj-$(CONFIG_BT_QCA) += btqca.o

btmrvl-y := btmrvl_main.o
btmrvl-$(CONFIG_DEBUG_FS) += btmrvl_debugfs.o

drivers/bluetooth/btqca.c new file +0 -0
new file mode 100644
index 0000000..9c1ae6b

drivers/bluetooth/btqca.c line 4

Quoted 4 lines
drivers/bluetooth/btqca.c new file +4 -0
@@ -0,0 +1,523 @@
+/*
+ *  Bluetooth supports for Qualcomm Atheros chips
+ *
+ *  Copyright (c) 2015 The Linux Foundation. All rights reserved.

copyright assigned to Linux Foundation is intentional?

Quoted 9 lines
drivers/bluetooth/btqca.c new file +9 -0
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.

drivers/bluetooth/btqca.c line 23

Quoted 10 lines
drivers/bluetooth/btqca.c new file +10 -0
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+#include <linux/module.h>
+#include <linux/firmware.h>
+#include <asm/unaligned.h>
+#include <stdbool.h>

Why would you include stdbool.h here. That was never needed.

drivers/bluetooth/btqca.c line 28

Quoted 5 lines
drivers/bluetooth/btqca.c new file +5 -0
+
+#include <net/bluetooth/bluetooth.h>
+#include <net/bluetooth/hci_core.h>
+
+#include "hci_uart.h"

You should not need this include. Please do not include driver header files in the common modules.

drivers/bluetooth/btqca.c line 33

Quoted 5 lines
drivers/bluetooth/btqca.c new file +5 -0
+#include "btqca.h"
+
+#define VERSION "0.1"
+
+static uint8_t g_qca_user_baud_rate = QCA_BAUDRATE_115200;

Please stop with the g_ for global variable. I am not even sure how this one would be useful anyway.

drivers/bluetooth/btqca.c line 41

Quoted 8 lines
drivers/bluetooth/btqca.c new file +8 -0
+
+static int rome_patch_ver_req(struct hci_dev *hdev, u32 *rome_version)
+{
+    struct sk_buff *skb;
+    struct edl_event_hdr *edl;
+    struct rome_version *ver;
+    char cmd;
+    int ret = 0;

Since the tabs vs spaces is completely messed up, I stopped going through the patch. Please make sure you do this correctly and that your email client/server does not mess this up.

Regards

Marcel

#2 lore raw

Hi Marcel,

Quoted 42 lines · Marcel Holtmann

Hi Ben,

Quoted 40 lines

This is for supporting BT for QCA ROME with specific vendor specific HCI commands and initialization. This will have USB/UART implementation both, but for now, adding UART vendor specific commands to patch downloading and set BDaddress using VS command.

---

drivers/bluetooth/Kconfig  |   4 +
drivers/bluetooth/Makefile |   1 +
drivers/bluetooth/btqca.c  | 523 +++++++++++++++++++++++++++++++++++++++++++++
drivers/bluetooth/btqca.h  | 156 ++++++++++++++
4 files changed, 684 insertions(+)

create mode 100644 drivers/bluetooth/btqca.c
create mode 100644 drivers/bluetooth/btqca.h

drivers/bluetooth/Kconfig +4 -0
index 79e8234..f580334 100644
@@ -13,6 +13,10 @@ config BT_RTL
    tristate
    select FW_LOADER
 
+config BT_QCA
+    tristate
+    select FW_LOADER
+

config BT_HCIBTUSB
tristate "HCI USB driver"
depends on USB

drivers/bluetooth/Makefile +0 -0
index f40e194..15a0d1d 100644
@@ -22,6 +22,7 @@ obj-$(CONFIG_BT_MRVL_SDIO)    += btmrvl_sdio.o

obj-$(CONFIG_BT_WILINK) += btwilink.o
obj-$(CONFIG_BT_BCM) += btbcm.o
obj-$(CONFIG_BT_RTL) += btrtl.o
+obj-$(CONFIG_BT_QCA) += btqca.o

Quoted 13 lines

drivers/bluetooth/btqca.c line 4

Quoted 12 lines

btmrvl-y := btmrvl_main.o
btmrvl-$(CONFIG_DEBUG_FS) += btmrvl_debugfs.o

drivers/bluetooth/btqca.c new file +4 -0
new file mode 100644
index 0000000..9c1ae6b
@@ -0,0 +1,523 @@
+/*
+ *  Bluetooth supports for Qualcomm Atheros chips
+ *
+ *  Copyright (c) 2015 The Linux Foundation. All rights reserved.

copyright assigned to Linux Foundation is intentional?

Yes

Quoted 35 lines
Quoted 9 lines
drivers/bluetooth/btqca.c new file +9 -0
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2
+ *  as published by the Free Software Foundation
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.

drivers/bluetooth/btqca.c line 23

Quoted 10 lines
drivers/bluetooth/btqca.c new file +10 -0
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+#include <linux/module.h>
+#include <linux/firmware.h>
+#include <asm/unaligned.h>
+#include <stdbool.h>

Why would you include stdbool.h here. That was never needed.

drivers/bluetooth/btqca.c line 28

Quoted 5 lines
drivers/bluetooth/btqca.c new file +5 -0
+
+#include <net/bluetooth/bluetooth.h>
+#include <net/bluetooth/hci_core.h>
+
+#include "hci_uart.h"

You should not need this include. Please do not include driver header files in the common modules.

drivers/bluetooth/btqca.c line 33

Quoted 5 lines
drivers/bluetooth/btqca.c new file +5 -0
+#include "btqca.h"
+
+#define VERSION "0.1"
+
+static uint8_t g_qca_user_baud_rate = QCA_BAUDRATE_115200;

Please stop with the g_ for global variable. I am not even sure how this one would be useful anyway.

Quoted 9 lines

drivers/bluetooth/btqca.c line 41

Quoted 8 lines
drivers/bluetooth/btqca.c new file +8 -0
+
+static int rome_patch_ver_req(struct hci_dev *hdev, u32 *rome_version)
+{
+    struct sk_buff *skb;
+    struct edl_event_hdr *edl;
+    struct rome_version *ver;
+    char cmd;
+    int ret = 0;

Since the tabs vs spaces is completely messed up, I stopped going through the patch. Please make sure you do this correctly and that your email client/server does not mess this up.

Sorry, I didn't realize all tabs were converted to spaces accidentally on my email client. I'll send you next version to fix all review comments on my patch. Thanks for your review comments.

Quoted 4 lines

Regards

Marcel

Thanks
-- Ben Kim