All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] Bluetooth: btusb: Add setup callback for chip init on USB
@ 2015-02-15 23:06 Kim, Ben Young Tae
  2015-02-22 23:55 ` Kim, Ben Young Tae
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Kim, Ben Young Tae @ 2015-02-15 23:06 UTC (permalink / raw)
  To: Marcel Holtmann, linux-bluetooth

Some of chipset does not allow to send a patch or config files through
HCI VS channel at early stage as well as they don't support to send
USB patch files to other channel except USB bulk path.

New callback added is for initialization of BT controller through USB

Signed-off-by: Ben Young Tae Kim <ytkim@qca.qualcomm.com>
---
 drivers/bluetooth/btusb.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 3ca2e1b..73e1066 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -337,6 +337,8 @@ struct btusb_data {
 
 	int (*recv_event)(struct hci_dev *hdev, struct sk_buff *skb);
 	int (*recv_bulk)(struct btusb_data *data, void *buffer, int count);
+
+	int (*setup_on_usb)(struct hci_dev *hdev);
 };
 
 static inline void btusb_free_frags(struct btusb_data *data)
@@ -878,6 +880,15 @@ static int btusb_open(struct hci_dev *hdev)
 
 	BT_DBG("%s", hdev->name);
 
+	/* Patching USB firmware files prior to starting any URBs of HCI path
+	 * It is more safe to use USB bulk channel for downloading USB patch
+	 */
+	if (data->setup_on_usb) {
+		err = data->setup_on_usb(hdev);
+		if (err <0)
+			return err;
+	}
+
 	err = usb_autopm_get_interface(data->intf);
 	if (err < 0)
 		return err;
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] Bluetooth: btusb: Add setup callback for chip init on USB
  2015-02-15 23:06 [PATCH v2 1/2] Bluetooth: btusb: Add setup callback for chip init on USB Kim, Ben Young Tae
@ 2015-02-22 23:55 ` Kim, Ben Young Tae
  2015-02-23  2:36 ` Marcel Holtmann
  2015-03-03  1:10 ` Marcel Holtmann
  2 siblings, 0 replies; 5+ messages in thread
From: Kim, Ben Young Tae @ 2015-02-22 23:55 UTC (permalink / raw)
  To: Marcel Holtmann, linux-bluetooth

Hi Marcel,

On Feb 15, 2015, at 3:06 PM, Kim, Ben Young Tae <ytkim@qca.qualcomm.com> wr=
ote:

> Some of chipset does not allow to send a patch or config files through
> HCI VS channel at early stage as well as they don't support to send
> USB patch files to other channel except USB bulk path.
>=20
> New callback added is for initialization of BT controller through USB
>=20
> Signed-off-by: Ben Young Tae Kim <ytkim@qca.qualcomm.com>
> ---
> drivers/bluetooth/btusb.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>=20
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 3ca2e1b..73e1066 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -337,6 +337,8 @@ struct btusb_data {
>=20
> 	int (*recv_event)(struct hci_dev *hdev, struct sk_buff *skb);
> 	int (*recv_bulk)(struct btusb_data *data, void *buffer, int count);
> +
> +	int (*setup_on_usb)(struct hci_dev *hdev);
> };
>=20
> static inline void btusb_free_frags(struct btusb_data *data)
> @@ -878,6 +880,15 @@ static int btusb_open(struct hci_dev *hdev)
>=20
> 	BT_DBG("%s", hdev->name);
>=20
> +	/* Patching USB firmware files prior to starting any URBs of HCI path
> +	 * It is more safe to use USB bulk channel for downloading USB patch
> +	 */
> +	if (data->setup_on_usb) {
> +		err =3D data->setup_on_usb(hdev);
> +		if (err <0)
> +			return err;
> +	}
> +
> 	err =3D usb_autopm_get_interface(data->intf);
> 	if (err < 0)
> 		return err;
> --=20
> 1.8.1.5
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth=
" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

PING=85

Thanks
=97 Ben Kim=

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] Bluetooth: btusb: Add setup callback for chip init on USB
  2015-02-15 23:06 [PATCH v2 1/2] Bluetooth: btusb: Add setup callback for chip init on USB Kim, Ben Young Tae
  2015-02-22 23:55 ` Kim, Ben Young Tae
@ 2015-02-23  2:36 ` Marcel Holtmann
  2015-02-23  2:56   ` Kim, Ben Young Tae
  2015-03-03  1:10 ` Marcel Holtmann
  2 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2015-02-23  2:36 UTC (permalink / raw)
  To: Kim, Ben Young Tae; +Cc: linux-bluetooth

Hi Ben,

> Some of chipset does not allow to send a patch or config files through
> HCI VS channel at early stage as well as they don't support to send
> USB patch files to other channel except USB bulk path.
> 
> New callback added is for initialization of BT controller through USB
> 
> Signed-off-by: Ben Young Tae Kim <ytkim@qca.qualcomm.com>
> ---
> drivers/bluetooth/btusb.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 3ca2e1b..73e1066 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -337,6 +337,8 @@ struct btusb_data {
> 
> 	int (*recv_event)(struct hci_dev *hdev, struct sk_buff *skb);
> 	int (*recv_bulk)(struct btusb_data *data, void *buffer, int count);
> +
> +	int (*setup_on_usb)(struct hci_dev *hdev);

I am trying to come up with a better callback name here. _on_usb is kind of a duplicate information. Since it is a USB driver. My problem is that I have not come up with a great name for the callback yet.

> };
> 
> static inline void btusb_free_frags(struct btusb_data *data)
> @@ -878,6 +880,15 @@ static int btusb_open(struct hci_dev *hdev)
> 
> 	BT_DBG("%s", hdev->name);
> 
> +	/* Patching USB firmware files prior to starting any URBs of HCI path
> +	 * It is more safe to use USB bulk channel for downloading USB patch
> +	 */

While you would be using it for firmware patching, it is a bit more generic. So the comment should be a bit more generic as well.

> +	if (data->setup_on_usb) {
> +		err = data->setup_on_usb(hdev);
> +		if (err <0)
> +			return err;
> +	}
> +

Regards

Marcel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] Bluetooth: btusb: Add setup callback for chip init on USB
  2015-02-23  2:36 ` Marcel Holtmann
@ 2015-02-23  2:56   ` Kim, Ben Young Tae
  0 siblings, 0 replies; 5+ messages in thread
From: Kim, Ben Young Tae @ 2015-02-23  2:56 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth, Thangella, Pruthvidhar, marcin.kraglak

Hi Marcel,

> On Feb 23, 2015, at 11:36 AM, Marcel Holtmann <marcel@holtmann.org> wrote=
:
>=20
> Hi Ben,
>=20
>> Some of chipset does not allow to send a patch or config files through
>> HCI VS channel at early stage as well as they don't support to send
>> USB patch files to other channel except USB bulk path.
>>=20
>> New callback added is for initialization of BT controller through USB
>>=20
>> Signed-off-by: Ben Young Tae Kim <ytkim@qca.qualcomm.com>
>> ---
>> drivers/bluetooth/btusb.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>=20
>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
>> index 3ca2e1b..73e1066 100644
>> --- a/drivers/bluetooth/btusb.c
>> +++ b/drivers/bluetooth/btusb.c
>> @@ -337,6 +337,8 @@ struct btusb_data {
>>=20
>>    int (*recv_event)(struct hci_dev *hdev, struct sk_buff *skb);
>>    int (*recv_bulk)(struct btusb_data *data, void *buffer, int count);
>> +
>> +    int (*setup_on_usb)(struct hci_dev *hdev);
>=20
> I am trying to come up with a better callback name here. _on_usb is kind =
of a duplicate information. Since it is a USB driver. My problem is that I =
have not come up with a great name for the callback yet.
>> };
>>=20
>> static inline void btusb_free_frags(struct btusb_data *data)
>> @@ -878,6 +880,15 @@ static int btusb_open(struct hci_dev *hdev)
>>=20
>>    BT_DBG("%s", hdev->name);
>>=20
>> +    /* Patching USB firmware files prior to starting any URBs of HCI pa=
th
>> +     * It is more safe to use USB bulk channel for downloading USB patc=
h
>> +     */
>=20
> While you would be using it for firmware patching, it is a bit more gener=
ic. So the comment should be a bit more generic as well.
>=20

I'm okay to change better callback name here and update comments with more =
general. It would be appreciated let us know once merging changes.

>> +    if (data->setup_on_usb) {
>> +        err =3D data->setup_on_usb(hdev);
>> +        if (err <0)
>> +            return err;
>> +    }
>> +
>=20
> Regards
>=20
> Marcel
>=20

Thanks
Ben Kim=

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] Bluetooth: btusb: Add setup callback for chip init on USB
  2015-02-15 23:06 [PATCH v2 1/2] Bluetooth: btusb: Add setup callback for chip init on USB Kim, Ben Young Tae
  2015-02-22 23:55 ` Kim, Ben Young Tae
  2015-02-23  2:36 ` Marcel Holtmann
@ 2015-03-03  1:10 ` Marcel Holtmann
  2 siblings, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2015-03-03  1:10 UTC (permalink / raw)
  To: Kim, Ben Young Tae; +Cc: linux-bluetooth

Hi Ben,

> Some of chipset does not allow to send a patch or config files through
> HCI VS channel at early stage as well as they don't support to send
> USB patch files to other channel except USB bulk path.
> 
> New callback added is for initialization of BT controller through USB
> 
> Signed-off-by: Ben Young Tae Kim <ytkim@qca.qualcomm.com>
> ---
> drivers/bluetooth/btusb.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 3ca2e1b..73e1066 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -337,6 +337,8 @@ struct btusb_data {
> 
> 	int (*recv_event)(struct hci_dev *hdev, struct sk_buff *skb);
> 	int (*recv_bulk)(struct btusb_data *data, void *buffer, int count);
> +
> +	int (*setup_on_usb)(struct hci_dev *hdev);
> };

I am still not really comfortable with the name setup_on_usb, but I also failed to come up with anything better in the last two weeks. So I decided to merge this to give the patch larger exposure. My failure to figure out a better consistent naming should not stand in the way of supporting your devices.

Patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-03-03  1:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-15 23:06 [PATCH v2 1/2] Bluetooth: btusb: Add setup callback for chip init on USB Kim, Ben Young Tae
2015-02-22 23:55 ` Kim, Ben Young Tae
2015-02-23  2:36 ` Marcel Holtmann
2015-02-23  2:56   ` Kim, Ben Young Tae
2015-03-03  1:10 ` Marcel Holtmann

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.