All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Rocky Liao <rjliao@codeaurora.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>,
	open list <linux-kernel@vger.kernel.org>,
	linux-bluetooth <linux-bluetooth@vger.kernel.org>,
	MSM <linux-arm-msm@vger.kernel.org>,
	Balakrishna Godavarthi <bgodavar@codeaurora.org>,
	c-hbandi@codeaurora.org, Hemantg <hemantg@codeaurora.org>,
	mka@chromium.org, linux-bluetooth-owner@vger.kernel.org
Subject: Re: [PATCH v1] Bluetooth: btusb: Add Qualcomm Bluetooth SoC WCN6855 support
Date: Mon, 14 Sep 2020 15:25:47 +0200	[thread overview]
Message-ID: <0C779191-3BD1-40BF-83E6-733F9C78EA03@holtmann.org> (raw)
In-Reply-To: <c177f408186da437db722d855a01c846@codeaurora.org>

Hi Rocky,

>>> This patch add support for WCN6855 i.e. patch and nvm download
>>> support.
>>> Signed-off-by: Rocky Liao <rjliao@codeaurora.org>
>>> ---
>>> drivers/bluetooth/btusb.c | 42 +++++++++++++++++++++++++++++++++++----
>>> 1 file changed, 38 insertions(+), 4 deletions(-)
>>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>>> index fe80588c7bd3..e51e754ca9b8 100644
>>> --- a/drivers/bluetooth/btusb.c
>>> +++ b/drivers/bluetooth/btusb.c
>>> @@ -59,6 +59,7 @@ static struct usb_driver btusb_driver;
>>> #define BTUSB_MEDIATEK		0x200000
>>> #define BTUSB_WIDEBAND_SPEECH	0x400000
>>> #define BTUSB_VALID_LE_STATES   0x800000
>>> +#define BTUSB_QCA_WCN6855	0x1000000
>>> static const struct usb_device_id btusb_table[] = {
>>> 	/* Generic Bluetooth USB device */
>>> @@ -273,6 +274,10 @@ static const struct usb_device_id blacklist_table[] = {
>>> 	{ USB_DEVICE(0x13d3, 0x3496), .driver_info = BTUSB_QCA_ROME },
>>> 	{ USB_DEVICE(0x13d3, 0x3501), .driver_info = BTUSB_QCA_ROME },
>>> +	/* QCA WCN6855 chipset */
>>> +	{ USB_DEVICE(0x0cf3, 0xe600), .driver_info = BTUSB_QCA_WCN6855 |
>>> +						     BTUSB_WIDEBAND_SPEECH },
>>> +
>>> 	/* Broadcom BCM2035 */
>>> 	{ USB_DEVICE(0x0a5c, 0x2009), .driver_info = BTUSB_BCM92035 },
>>> 	{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU },
>>> @@ -3391,6 +3396,26 @@ static int btusb_set_bdaddr_ath3012(struct hci_dev *hdev,
>>> 	return 0;
>>> }
>>> +static int btusb_set_bdaddr_wcn6855(struct hci_dev *hdev,
>>> +				const bdaddr_t *bdaddr)
>>> +{
>>> +	struct sk_buff *skb;
>>> +	u8 buf[6];
>>> +	long ret;
>>> +
>>> +	memcpy(buf, bdaddr, sizeof(bdaddr_t));
>>> +
>>> +	skb = __hci_cmd_sync(hdev, 0xfc14, sizeof(buf), buf, HCI_INIT_TIMEOUT);
>>> +	if (IS_ERR(skb)) {
>>> +		ret = PTR_ERR(skb);
>>> +		bt_dev_err(hdev, "Change address command failed (%ld)", ret);
>>> +		return ret;
>>> +	}
>>> +	kfree_skb(skb);
>>> +
>>> +	return 0;
>>> +}
>> What is wrong with using qca_set_bdaddr() function.
> WCN6855 is using different VSC to set the bt addr

int qca_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)                 
{                                                                                
        struct sk_buff *skb;                                                     
        int err;                                                                 
                                                                                 
        skb = __hci_cmd_sync_ev(hdev, EDL_WRITE_BD_ADDR_OPCODE, 6, bdaddr,       
                                HCI_EV_VENDOR, HCI_INIT_TIMEOUT);                
        if (IS_ERR(skb)) {                                                       
                err = PTR_ERR(skb);                                              
                bt_dev_err(hdev, "QCA Change address cmd failed (%d)", err);     
                return err;                                                      
        }                                                                        
                                                                                 
        kfree_skb(skb);                                                          
                                                                                 
        return 0;                                                                
}                                                                                
EXPORT_SYMBOL_GPL(qca_set_bdaddr);

I see that the other command is using HCI_EV_VENDOR, but is that on purpose or an accident? Might want to confirm with the btmon trace.

Regards

Marcel


  reply	other threads:[~2020-09-14 14:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0101017457c6b810-cb8b79ae-4663-436b-83d0-4c70c245bd25-000000@us-west-2.amazonses.com>
2020-09-11  6:56 ` [PATCH v1] Bluetooth: btusb: Add Qualcomm Bluetooth SoC WCN6855 support Marcel Holtmann
2020-09-14  9:20   ` Rocky Liao
2020-09-14 13:25     ` Marcel Holtmann [this message]
2020-09-25  9:00       ` Rocky Liao
2020-09-04  6:21 Rocky Liao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0C779191-3BD1-40BF-83E6-733F9C78EA03@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=bgodavar@codeaurora.org \
    --cc=c-hbandi@codeaurora.org \
    --cc=hemantg@codeaurora.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-bluetooth-owner@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=rjliao@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.