* [PATCH] Bluetooth: Support for new firmware for ath3k USB Bluetooth device
@ 2010-10-05 6:17 Suraj Sumangala
2010-10-05 7:01 ` David Vrabel
0 siblings, 1 reply; 3+ messages in thread
From: Suraj Sumangala @ 2010-10-05 6:17 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jothikumar.Mothilal, Suraj Sumangala
This patch add support for new ath3k USB Bluetooth device firmare.
The firmware implements shared antenna support and
fixes few critical bugs.
Signed-off-by: Suraj Sumangala <suraj@atheros.com>
---
drivers/bluetooth/ath3k.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index 128cae4..eb79a8f 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -103,6 +103,9 @@ error:
return err;
}
+#define FW_COUNT 2
+#define FW_PREFIX "ath3k-"
+#define MAXPATHLEN 30
static int ath3k_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
@@ -110,6 +113,8 @@ static int ath3k_probe(struct usb_interface *intf,
struct usb_device *udev = interface_to_usbdev(intf);
struct ath3k_data *data;
int size;
+ int i;
+ char fw_file[MAXPATHLEN];
BT_DBG("intf %p id %p", intf, id);
@@ -122,7 +127,16 @@ static int ath3k_probe(struct usb_interface *intf,
data->udev = udev;
- if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
+ for (i = FW_COUNT; i > 0; i--) {
+ snprintf(fw_file, MAXPATHLEN - 1, "%s%d.fw", FW_PREFIX, i);
+
+ if (request_firmware(&firmware, fw_file,
+ &udev->dev) >= 0)
+ break;
+
+ }
+
+ if (!i) {
kfree(data);
return -EIO;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: Support for new firmware for ath3k USB Bluetooth device
2010-10-05 6:17 [PATCH] Bluetooth: Support for new firmware for ath3k USB Bluetooth device Suraj Sumangala
@ 2010-10-05 7:01 ` David Vrabel
2010-10-05 7:38 ` Marcel Holtmann
0 siblings, 1 reply; 3+ messages in thread
From: David Vrabel @ 2010-10-05 7:01 UTC (permalink / raw)
To: Suraj Sumangala; +Cc: linux-bluetooth, Jothikumar.Mothilal
On 05/10/2010 07:17, Suraj Sumangala wrote:
> This patch add support for new ath3k USB Bluetooth device firmare.
> The firmware implements shared antenna support and
> fixes few critical bugs.
[...]
> static int ath3k_probe(struct usb_interface *intf,
> const struct usb_device_id *id)
> {
> @@ -110,6 +113,8 @@ static int ath3k_probe(struct usb_interface *intf,
> struct usb_device *udev = interface_to_usbdev(intf);
> struct ath3k_data *data;
> int size;
> + int i;
> + char fw_file[MAXPATHLEN]
Suggest FW_PATH_LEN here to avoid confusion as most people would expect
MAXPATHLEN to be enormous.
> BT_DBG("intf %p id %p", intf, id);
>
> @@ -122,7 +127,16 @@ static int ath3k_probe(struct usb_interface *intf,
>
> data->udev = udev;
>
> - if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
Why not request ath3k-1.fw (for backward compatibility) and ath3k.fw and
symlink this name to ath3k-2.fw or any future version of firmware?
I think users should be able to update firmware without a kernel update
where possible.
David
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: Support for new firmware for ath3k USB Bluetooth device
2010-10-05 7:01 ` David Vrabel
@ 2010-10-05 7:38 ` Marcel Holtmann
0 siblings, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2010-10-05 7:38 UTC (permalink / raw)
To: David Vrabel; +Cc: Suraj Sumangala, linux-bluetooth, Jothikumar.Mothilal
Hi David,
> > This patch add support for new ath3k USB Bluetooth device firmare.
> > The firmware implements shared antenna support and
> > fixes few critical bugs.
> [...]
> > static int ath3k_probe(struct usb_interface *intf,
> > const struct usb_device_id *id)
> > {
> > @@ -110,6 +113,8 @@ static int ath3k_probe(struct usb_interface *intf,
> > struct usb_device *udev = interface_to_usbdev(intf);
> > struct ath3k_data *data;
> > int size;
> > + int i;
> > + char fw_file[MAXPATHLEN]
>
> Suggest FW_PATH_LEN here to avoid confusion as most people would expect
> MAXPATHLEN to be enormous.
>
> > BT_DBG("intf %p id %p", intf, id);
> >
> > @@ -122,7 +127,16 @@ static int ath3k_probe(struct usb_interface *intf,
> >
> > data->udev = udev;
> >
> > - if (request_firmware(&firmware, "ath3k-1.fw", &udev->dev) < 0) {
>
> Why not request ath3k-1.fw (for backward compatibility) and ath3k.fw and
> symlink this name to ath3k-2.fw or any future version of firmware?
>
> I think users should be able to update firmware without a kernel update
> where possible.
yes, it is mandatory to support at least the last two firmware version.
Just forcing a firmware update with a new kernel is not going to work.
So NAK on this patch.
Regards
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-05 7:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-05 6:17 [PATCH] Bluetooth: Support for new firmware for ath3k USB Bluetooth device Suraj Sumangala
2010-10-05 7:01 ` David Vrabel
2010-10-05 7:38 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).