bluetooth: add btmrvl driver to support Marvell bluetooth devices
Subsystems (2)
PATCH v2 1/4 bluetooth: add btmrvl driver to support Marvell bluetooth devices
This driver provides basic definitions and library functions to support Marvell Bluetooth enabled devices, such as 88W8688 WLAN/BT combo chip.
This patch incorporates a lot of comments given by Nicolas Pitre <[email protected]>. Many thanks to Nicolas Pitre.
--- drivers/bluetooth/Kconfig | 12 + drivers/bluetooth/Makefile | 3 + drivers/bluetooth/btmrvl_drv.h | 138 ++++++++ drivers/bluetooth/btmrvl_main.c | 711 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 864 insertions(+), 0 deletions(-) create mode 100644 drivers/bluetooth/btmrvl_drv.h create mode 100644 drivers/bluetooth/btmrvl_main.c
drivers/bluetooth/Kconfig +12 -0
@@ -170,5 +170,17 @@ config BT_HCIVHCI Say Y here to compile support for virtual HCI devices into the kernel or say M to compile it as module (hci_vhci). +config BT_MRVL + tristate "Marvell Bluetooth driver support" + select FW_LOADER + help + The core driver to support Marvell Bluetooth devices. + + This driver is required if you want to support + Marvell Bluetooth devices, such as 8688. + + Say Y here to compile Marvell Bluetooth driver + into the kernel or say M to compile it as module. + endmenu
drivers/bluetooth/Makefile +3 -0
@@ -15,6 +15,9 @@ obj-$(CONFIG_BT_HCIBTUART) += btuart_cs.o obj-$(CONFIG_BT_HCIBTUSB) += btusb.o obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o +btmrvl-objs := btmrvl_main.o +obj-$(CONFIG_BT_MRVL) += btmrvl.o + hci_uart-y := hci_ldisc.o hci_uart-$(CONFIG_BT_HCIUART_H4) += hci_h4.o hci_uart-$(CONFIG_BT_HCIUART_BCSP) += hci_bcsp.o
drivers/bluetooth/btmrvl_drv.h new file +138 -0
138 lines not on this page · raw message
drivers/bluetooth/btmrvl_main.c new file +711 -0
711 lines not on this page · raw message
Signature · 1 line
1.5.3.6
PATCH v2 2/4 bluetooth: btmrvl_sdio: Marvell BT-over-SDIO driver
This driver supports Marvell Bluetooth enabled devices with SDIO interface. Currently only SD8688 chip is supported.
The helper/firmware images of SD8688 can be downloaded from this tree:git://git.infradead.org/users/dwmw2/linux-firmware.git
This patch incorporates a lot of comments given by Nicolas Pitre <[email protected]>. Many thanks to Nicolas Pitre.
--- drivers/bluetooth/Kconfig | 13 + drivers/bluetooth/Makefile | 1 + drivers/bluetooth/btmrvl_sdio.c | 1124 +++++++++++++++++++++++++++++++++++++++ drivers/bluetooth/btmrvl_sdio.h | 113 ++++ 4 files changed, 1251 insertions(+), 0 deletions(-) create mode 100644 drivers/bluetooth/btmrvl_sdio.c create mode 100644 drivers/bluetooth/btmrvl_sdio.h
drivers/bluetooth/Kconfig +13 -0
@@ -182,5 +182,18 @@ config BT_MRVL Say Y here to compile Marvell Bluetooth driver into the kernel or say M to compile it as module. +config BT_MRVL_SDIO + tristate "Marvell BT-over-SDIO driver" + depends on BT_MRVL && MMC + help + The driver for Marvell Bluetooth chipsets with SDIO interface. + + This driver is required if you want to use Marvell Bluetooth + devices with SDIO interface. Currently only SD8688 chipset is + supported. + + Say Y here to compile support for Marvell BT-over-SDIO driver + into the kernel or say M to compile it as module. + endmenu
drivers/bluetooth/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o btmrvl-objs := btmrvl_main.o obj-$(CONFIG_BT_MRVL) += btmrvl.o +obj-$(CONFIG_BT_MRVL_SDIO) += btmrvl_sdio.o hci_uart-y := hci_ldisc.o hci_uart-$(CONFIG_BT_HCIUART_H4) += hci_h4.o
drivers/bluetooth/btmrvl_sdio.c new file +1124 -0
1,124 lines not on this page · raw message
drivers/bluetooth/btmrvl_sdio.h new file +113 -0
113 lines not on this page · raw message
Signature · 1 line
1.5.3.6
PATCH v2 3/4 bluetooth: Add debugfs support to btmrvl driver
In reply to Bing Zhao/debug/btmrvl/config/
/debug/btmrvl/status/
See Documentation/btmrvl.txt for details.
This patch incorporates a lot of comments given by Nicolas Pitre <[email protected]>. Many thanks to Nicolas Pitre.
--- drivers/bluetooth/Kconfig | 1 + drivers/bluetooth/Makefile | 2 +- drivers/bluetooth/btmrvl_debugfs.c | 445 ++++++++++++++++++++++++++++++++++++ drivers/bluetooth/btmrvl_drv.h | 8 + drivers/bluetooth/btmrvl_main.c | 8 + 5 files changed, 463 insertions(+), 1 deletions(-) create mode 100644 drivers/bluetooth/btmrvl_debugfs.c
drivers/bluetooth/Kconfig +1 -0
@@ -173,6 +173,7 @@ config BT_HCIVHCI config BT_MRVL tristate "Marvell Bluetooth driver support" select FW_LOADER + select DEBUG_FS help The core driver to support Marvell Bluetooth devices.
drivers/bluetooth/Makefile +1 -1
@@ -15,7 +15,7 @@ obj-$(CONFIG_BT_HCIBTUART) += btuart_cs.o obj-$(CONFIG_BT_HCIBTUSB) += btusb.o obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o -btmrvl-objs := btmrvl_main.o +btmrvl-objs := btmrvl_main.o btmrvl_debugfs.o obj-$(CONFIG_BT_MRVL) += btmrvl.o obj-$(CONFIG_BT_MRVL_SDIO) += btmrvl_sdio.o
drivers/bluetooth/btmrvl_debugfs.c new file +445 -0
445 lines not on this page · raw message
drivers/bluetooth/btmrvl_drv.h +8 -0
@@ -79,6 +79,9 @@ struct btm_private { u8 *payload, u16 nb);int (*hw_wakeup_firmware) (struct btm_private *priv);spinlock_t driver_lock;/* spinlock used by driver */ +#ifdef CONFIG_DEBUG_FS +void *debugfs_data; +#endif };#define MRVL_VENDOR_PKT 0xFE
@@ -135,4 +138,9 @@ int btm_process_event(struct btm_private *priv, struct sk_buff *skb);int btm_send_module_cfg_cmd (struct btm_private *priv,int subcmd);int btm_prepare_command (struct btm_private *priv); +#ifdef CONFIG_DEBUG_FS +void btm_debugfs_init (struct hci_dev *hdev); +void btm_debugfs_remove (struct hci_dev *hdev); +#endif +#endif /* _BTMRVL_DRV_H_ */
drivers/bluetooth/btmrvl_main.c +8 -0
@@ -655,6 +655,10 @@ struct btm_private *btm_add_card(void *card) goto err_hci_register_dev; } +#ifdef CONFIG_DEBUG_FS +btm_debugfs_init (hdev); +#endif +BT_DBG ("Leave" );return priv;
@@ -689,6 +693,10 @@ int btm_remove_card(struct btm_private *priv)kthread_stop (priv->main_thread.task); +#ifdef CONFIG_DEBUG_FS +btm_debugfs_remove (hdev); +#endif +hci_unregister_dev (hdev);hci_free_dev (hdev);
Signature · 1 line
1.5.3.6
PATCH v2 4/4 bluetooth: Documentation for Marvell Bluetooth driver
In reply to Bing Zhaoadd btmrvl.txt to Documentation/
This patch incorporates a lot of comments given by Nicolas Pitre <[email protected]>. Many thanks to Nicolas Pitre.
--- Documentation/00-INDEX | 3 +- Documentation/btmrvl.txt | 119 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+), 1 deletions(-) create mode 100644 Documentation/btmrvl.txt
Documentation/00-INDEX +2 -1
@@ -14,7 +14,6 @@ Following translations are available on the WWW: - this file. ABI/ - info on kernel <-> userspace ABI and relative interface stability. - BUG-HUNTING - brute force method of doing binary search of patches to find bug. Changes
@@ -82,6 +81,8 @@ block/ - info on the Block I/O (BIO) layer. blockdev/ - info on block devices & drivers +btmrvl.txt + - info on Marvell Bluetooth driver usage. cachetlb.txt - describes the cache/TLB flushing interfaces Linux uses. cdrom/
Documentation/btmrvl.txt new file +119 -0
119 lines not on this page · raw message
Signature · 1 line
1.5.3.6
Marcel Holtmann
maintainerHi Bing,
Quoted 3 lines
This driver provides basic definitions and library functions to support Marvell Bluetooth enabled devices, such as 88W8688 WLAN/BT combo chip.
we still have to talk about the handling of vendor commands. Handling these inside the driver is a bad idea. We can just let the core forward them to you if you are interested. I have to think about it a little bit.
drivers/bluetooth/btmrvl_drv.h line 42
Quoted 5 lines
drivers/bluetooth/btmrvl_drv.h new file +5
-0+struct btm_thread { +struct task_struct *task; +wait_queue_head_t wait_q; +void *priv; +};
Please prefix everything with btmrvl_* for cleaner namespace. Especially for the exported symbol it is important that you have a clean namespace.
Regards
Marcel
Hi Marcel,
Thanks for reviewing our patches.
Quoted 10 lines
Hi Bing,
=20Quoted 3 lines
This driver provides basic definitions and library functions to support Marvell Bluetooth enabled devices, such as 88W8688 WLAN/BT combo chip.
=20
we still have to talk about the handling of vendor commands. Handling these inside the driver is a bad idea. We can just let the core forward them to you if you are interested. I have to think about it a little bit.
I don't know how the vendor specific commands can be handled outside of btm= rvl.ko driver.
Please share with me once you have any idea on the handling of the vendor c= ommands.
=20
Quoted 8 lines
drivers/bluetooth/btmrvl_drv.h line 42
Quoted 5 lines
drivers/bluetooth/btmrvl_drv.h new file +5
-0+struct btm_thread { +struct task_struct *task; +wait_queue_head_t wait_q; +void *priv; +};=20
Please prefix everything with btmrvl_* for cleaner namespace. Especially for the exported symbol it is important that you have a clean namespace.
I've made this change. Do you want me to resend the new patch now, or wait = a while for more feedbacks?
Quoted 5 lines
=20
Regards
=20
Marcel
=20
Thanks,
Bing
Marcel Holtmann
maintainerHi Bing,
Quoted 11 lines
Quoted 8 lines
Quoted 3 lines
This driver provides basic definitions and library functions to support Marvell Bluetooth enabled devices, such as 88W8688 WLAN/BT combo chip.
we still have to talk about the handling of vendor commands. Handling these inside the driver is a bad idea. We can just let the core forward them to you if you are interested. I have to think about it a little bit.
I don't know how the vendor specific commands can be handled outside of btmrvl.ko driver. Please share with me once you have any idea on the handling of the vendor commands.
the Bluetooth core parses the commands and events anyway. So we just need a hook in the hci_dev structure to allow to be called when a vendor command arrives. And there needs to be an easy way to send such vendor specific commands from within the driver. Handling it inside the driver is wrong since you are messing with the flow control handling and that should be done by the Bluetooth core.
Quoted 10 lines
Quoted 8 lines
drivers/bluetooth/btmrvl_drv.h line 42
Quoted 5 lines
drivers/bluetooth/btmrvl_drv.h new file +5
-0+struct btm_thread { +struct task_struct *task; +wait_queue_head_t wait_q; +void *priv; +};Please prefix everything with btmrvl_* for cleaner namespace. Especially for the exported symbol it is important that you have a clean namespace.
I've made this change. Do you want me to resend the new patch now, or wait a while for more feedbacks?
Please re-send them. Then I can add them to bluetooth-testing to see how far we get. The vendor command handling should not stop us from merging the driver, but it will be todo item that needs fixing from your side.
I also wanna coordinate with John on how we get the rmmod thing done in a better way. What you are doing right now is messy and ugly.
Regards
Marcel