* [PATCH] firmware: Allocate firmware id dynamically @ 2009-05-26 14:04 Samuel Ortiz 2009-05-26 14:11 ` Kay Sievers 2009-05-26 14:51 ` [PATCH] libertas: adapt for dynamic firmware id allocation John W. Linville 0 siblings, 2 replies; 12+ messages in thread From: Samuel Ortiz @ 2009-05-26 14:04 UTC (permalink / raw) To: Andrew Morton Cc: Kay Sievers, Marcel Holtmann, Zhu, Yi, linux-kernel, linville Hi Andrew, Since the firmware loader is not maintained by anyone, I'm sending this one to you, for the next merge window: From: Samuel Ortiz <sameo@linux.intel.com> The firmware loader has a statically allocated 30 bytes long string for the firmware id (a.k.a. the firmware file name). There is no reason why we couldnt allocate dynamically, and avoid having restrictions on the firmware names lengths. Please note that we have to keep the FIRMWARE_NAME_MAX definition around as some drivers rely on it. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> --- drivers/base/firmware_class.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index d3a59c6..1f0daf9 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -40,7 +40,7 @@ static int loading_timeout = 60; /* In seconds */ static DEFINE_MUTEX(fw_lock); struct firmware_priv { - char fw_id[FIRMWARE_NAME_MAX]; + char *fw_id; struct completion completion; struct bin_attribute attr_data; struct firmware *fw; @@ -278,6 +278,7 @@ static void fw_dev_release(struct device *dev) { struct firmware_priv *fw_priv = dev_get_drvdata(dev); + kfree(fw_priv->fw_id); kfree(fw_priv); kfree(dev); @@ -309,7 +310,13 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, init_completion(&fw_priv->completion); fw_priv->attr_data = firmware_attr_data_tmpl; - strlcpy(fw_priv->fw_id, fw_name, FIRMWARE_NAME_MAX); + fw_priv->fw_id = kstrdup(fw_name, GFP_KERNEL); + if (!fw_priv->fw_id) { + dev_err(device, "%s: Firmware name allocation failed\n", + __func__); + retval = -ENOMEM; + goto error_kfree; + } fw_priv->timeout.function = firmware_class_timeout; fw_priv->timeout.data = (u_long) fw_priv; @@ -323,11 +330,14 @@ static int fw_register_device(struct device **dev_p, const char *fw_name, retval = device_register(f_dev); if (retval) { dev_err(device, "%s: device_register failed\n", __func__); - goto error_kfree; + goto error_kfree_fw_id; } *dev_p = f_dev; return 0; +error_kfree_fw_id: + kfree(fw_priv->fw_id); + error_kfree: kfree(fw_priv); kfree(f_dev); -- Intel Open Source Technology Centre http://oss.intel.com/ ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] firmware: Allocate firmware id dynamically 2009-05-26 14:04 [PATCH] firmware: Allocate firmware id dynamically Samuel Ortiz @ 2009-05-26 14:11 ` Kay Sievers 2009-05-26 20:23 ` Andrew Morton 2009-05-27 6:19 ` Marcel Holtmann 2009-05-26 14:51 ` [PATCH] libertas: adapt for dynamic firmware id allocation John W. Linville 1 sibling, 2 replies; 12+ messages in thread From: Kay Sievers @ 2009-05-26 14:11 UTC (permalink / raw) To: Samuel Ortiz Cc: Andrew Morton, Marcel Holtmann, Zhu, Yi, linux-kernel, linville, Greg Kroah-Hartmann On Tue, May 26, 2009 at 16:04, Samuel Ortiz <sameo@linux.intel.com> wrote: > Since the firmware loader is not maintained by anyone, I'm sending this one to > you, for the next merge window: It's part of the driver-core directory, and handled by Greg. > The firmware loader has a statically allocated 30 bytes long string for the > firmware id (a.k.a. the firmware file name). There is no reason why we couldnt > allocate dynamically, and avoid having restrictions on the firmware names > lengths. Looks good. > Please note that we have to keep the FIRMWARE_NAME_MAX definition around as > some drivers rely on it. I think the 6 files should be converted, and FIRMWARE_NAME_MAX removed, otherwise people will keep copying that crap around. drivers/pcmcia/ds.c drivers/usb/atm/ueagle-atm.c drivers/net/wireless/libertas/if_usb.c drivers/net/wireless/libertas/if_spi.c drivers/media/dvb/dvb-usb/dvb-usb.h drivers/media/common/tuners/tuner-xc2028.c Thanks, Kay ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] firmware: Allocate firmware id dynamically 2009-05-26 14:11 ` Kay Sievers @ 2009-05-26 20:23 ` Andrew Morton 2009-05-27 1:57 ` Stephen Rothwell 2009-05-27 6:19 ` Marcel Holtmann 1 sibling, 1 reply; 12+ messages in thread From: Andrew Morton @ 2009-05-26 20:23 UTC (permalink / raw) To: Kay Sievers; +Cc: sameo, holtmann, yi.zhu, linux-kernel, linville, greg On Tue, 26 May 2009 16:11:35 +0200 Kay Sievers <kay.sievers@vrfy.org> wrote: > On Tue, May 26, 2009 at 16:04, Samuel Ortiz <sameo@linux.intel.com> wrote: > > > Since the firmware loader is not maintained by anyone, I'm sending this one to > > you, for the next merge window: > > It's part of the driver-core directory, and handled by Greg. To which it doesn't apply. It needed more fixes than I felt like making. > > The firmware loader has a statically allocated 30 bytes long string for the > > firmware id (a.k.a. the firmware file name). There is no reason why we couldnt > > allocate dynamically, and avoid having restrictions on the firmware names > > lengths. > > Looks good. > > > Please note that we have to keep the FIRMWARE_NAME_MAX definition around as > > some drivers rely on it. > > I think the 6 files should be converted, and FIRMWARE_NAME_MAX > removed, otherwise people will keep copying that crap around. > > drivers/pcmcia/ds.c > drivers/usb/atm/ueagle-atm.c > drivers/net/wireless/libertas/if_usb.c > drivers/net/wireless/libertas/if_spi.c > drivers/media/dvb/dvb-usb/dvb-usb.h > drivers/media/common/tuners/tuner-xc2028.c Yep. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] firmware: Allocate firmware id dynamically 2009-05-26 20:23 ` Andrew Morton @ 2009-05-27 1:57 ` Stephen Rothwell 2009-05-27 8:17 ` Samuel Ortiz 0 siblings, 1 reply; 12+ messages in thread From: Stephen Rothwell @ 2009-05-27 1:57 UTC (permalink / raw) To: Andrew Morton Cc: Kay Sievers, sameo, holtmann, yi.zhu, linux-kernel, linville, greg [-- Attachment #1: Type: text/plain, Size: 1360 bytes --] Hi all, On Tue, 26 May 2009 13:23:51 -0700 Andrew Morton <akpm@linux-foundation.org> wrote: > > > > Please note that we have to keep the FIRMWARE_NAME_MAX definition around as > > > some drivers rely on it. > > > > I think the 6 files should be converted, and FIRMWARE_NAME_MAX > > removed, otherwise people will keep copying that crap around. > > > > drivers/pcmcia/ds.c > > drivers/usb/atm/ueagle-atm.c > > drivers/net/wireless/libertas/if_usb.c > > drivers/net/wireless/libertas/if_spi.c > > drivers/media/dvb/dvb-usb/dvb-usb.h > > drivers/media/common/tuners/tuner-xc2028.c > > Yep. $ git grep -l -w FIRMWARE_NAME_MAX next-20090526 next-20090526:drivers/base/firmware_class.c next-20090526:drivers/media/common/tuners/tuner-xc2028.c next-20090526:drivers/media/dvb/dvb-usb/dvb-usb.h next-20090526:drivers/net/wireless/libertas/if_spi.c next-20090526:drivers/net/wireless/libertas/if_usb.c next-20090526:drivers/net/wireless/p54/p54usb.c next-20090526:drivers/pcmcia/ds.c next-20090526:drivers/usb/atm/ueagle-atm.c next-20090526:include/linux/firmware.h next-20090526:samples/firmware_class/firmware_sample_firmware_class.c Its already started ... /me looks forward to more breakage in -next :-( -- Cheers, Stephen Rothwell sfr@canb.auug.org.au http://www.canb.auug.org.au/~sfr/ [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --] ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] firmware: Allocate firmware id dynamically 2009-05-27 1:57 ` Stephen Rothwell @ 2009-05-27 8:17 ` Samuel Ortiz 2009-05-27 8:30 ` Kay Sievers 2009-05-27 9:16 ` John W. Linville 0 siblings, 2 replies; 12+ messages in thread From: Samuel Ortiz @ 2009-05-27 8:17 UTC (permalink / raw) To: Stephen Rothwell Cc: Andrew Morton, Kay Sievers, holtmann, yi.zhu, linux-kernel, linville, greg Hi Stephen, On Wed, May 27, 2009 at 11:57:48AM +1000, Stephen Rothwell wrote: > Hi all, > > On Tue, 26 May 2009 13:23:51 -0700 Andrew Morton <akpm@linux-foundation.org> wrote: > > > > > > Please note that we have to keep the FIRMWARE_NAME_MAX definition around as > > > > some drivers rely on it. > > > > > > I think the 6 files should be converted, and FIRMWARE_NAME_MAX > > > removed, otherwise people will keep copying that crap around. > > > > > > drivers/pcmcia/ds.c > > > drivers/usb/atm/ueagle-atm.c > > > drivers/net/wireless/libertas/if_usb.c > > > drivers/net/wireless/libertas/if_spi.c > > > drivers/media/dvb/dvb-usb/dvb-usb.h > > > drivers/media/common/tuners/tuner-xc2028.c > > > > Yep. > > $ git grep -l -w FIRMWARE_NAME_MAX next-20090526 > next-20090526:drivers/base/firmware_class.c > next-20090526:drivers/media/common/tuners/tuner-xc2028.c > next-20090526:drivers/media/dvb/dvb-usb/dvb-usb.h > next-20090526:drivers/net/wireless/libertas/if_spi.c > next-20090526:drivers/net/wireless/libertas/if_usb.c > next-20090526:drivers/net/wireless/p54/p54usb.c > next-20090526:drivers/pcmcia/ds.c > next-20090526:drivers/usb/atm/ueagle-atm.c > next-20090526:include/linux/firmware.h All of those have been taken care of by my last patch set, see: http://lkml.org/lkml/2009/5/26/518 The p54usb one has been sent to John and linux-wireless as it's coming from wireless-testing. > next-20090526:samples/firmware_class/firmware_sample_firmware_class.c Do I really need to fix this one too ? Cheers, Samuel. -- Intel Open Source Technology Centre http://oss.intel.com/ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] firmware: Allocate firmware id dynamically 2009-05-27 8:17 ` Samuel Ortiz @ 2009-05-27 8:30 ` Kay Sievers 2009-05-27 15:04 ` Greg KH 2009-05-27 9:16 ` John W. Linville 1 sibling, 1 reply; 12+ messages in thread From: Kay Sievers @ 2009-05-27 8:30 UTC (permalink / raw) To: Samuel Ortiz Cc: Stephen Rothwell, Andrew Morton, holtmann, yi.zhu, linux-kernel, linville, greg On Wed, May 27, 2009 at 10:17, Samuel Ortiz <sameo@linux.intel.com> wrote: >> next-20090526:samples/firmware_class/firmware_sample_firmware_class.c > Do I really need to fix this one too ? I does not compile since ages, it is totally outdated and uses the long removed struct class_device. And we really don't need an example for firmware loading, I think. This file should just be deleted. Thanks, Kay ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] firmware: Allocate firmware id dynamically 2009-05-27 8:30 ` Kay Sievers @ 2009-05-27 15:04 ` Greg KH 0 siblings, 0 replies; 12+ messages in thread From: Greg KH @ 2009-05-27 15:04 UTC (permalink / raw) To: Kay Sievers Cc: Samuel Ortiz, Stephen Rothwell, Andrew Morton, holtmann, yi.zhu, linux-kernel, linville On Wed, May 27, 2009 at 10:30:19AM +0200, Kay Sievers wrote: > On Wed, May 27, 2009 at 10:17, Samuel Ortiz <sameo@linux.intel.com> wrote: > > >> next-20090526:samples/firmware_class/firmware_sample_firmware_class.c > > Do I really need to fix this one too ? > > I does not compile since ages, it is totally outdated and uses the > long removed struct class_device. And we really don't need an example > for firmware loading, I think. This file should just be deleted. Yeah, I had plans to write it "properly", but it's at the end of my long TODO list :( I'll just go delete the thing instead. thanks, greg k-h ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] firmware: Allocate firmware id dynamically 2009-05-27 8:17 ` Samuel Ortiz 2009-05-27 8:30 ` Kay Sievers @ 2009-05-27 9:16 ` John W. Linville 2009-05-27 9:53 ` Samuel Ortiz 1 sibling, 1 reply; 12+ messages in thread From: John W. Linville @ 2009-05-27 9:16 UTC (permalink / raw) To: Samuel Ortiz Cc: Stephen Rothwell, Andrew Morton, Kay Sievers, holtmann, yi.zhu, linux-kernel, greg On Wed, May 27, 2009 at 10:17:33AM +0200, Samuel Ortiz wrote: > > next-20090526:drivers/net/wireless/p54/p54usb.c > All of those have been taken care of by my last patch set, see: > http://lkml.org/lkml/2009/5/26/518 > > The p54usb one has been sent to John and linux-wireless as it's coming from > wireless-testing. Is that patch dependent on other p54 bits in wireless-next-2.6? John -- John W. Linville Someday the world will need a hero, and you linville@tuxdriver.com might be all we have. Be ready. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] firmware: Allocate firmware id dynamically 2009-05-27 9:16 ` John W. Linville @ 2009-05-27 9:53 ` Samuel Ortiz 0 siblings, 0 replies; 12+ messages in thread From: Samuel Ortiz @ 2009-05-27 9:53 UTC (permalink / raw) To: John W. Linville Cc: Stephen Rothwell, Andrew Morton, Kay Sievers, holtmann, yi.zhu, linux-kernel, greg On Wed, May 27, 2009 at 11:16:13AM +0200, John W. Linville wrote: > On Wed, May 27, 2009 at 10:17:33AM +0200, Samuel Ortiz wrote: > > > > next-20090526:drivers/net/wireless/p54/p54usb.c > > > All of those have been taken care of by my last patch set, see: > > http://lkml.org/lkml/2009/5/26/518 > > > > The p54usb one has been sent to John and linux-wireless as it's coming from > > wireless-testing. > > Is that patch dependent on other p54 bits in wireless-next-2.6? The p54usb.c FIRMWARE_NAME_MAX reference was introduce with commit 1ca5f2e94c40b04d5dec437cd41fd5ba12aaac31 from your wireless-next-2.6 tree. Cheers, Samuel. > John > -- > John W. Linville Someday the world will need a hero, and you > linville@tuxdriver.com might be all we have. Be ready. -- Intel Open Source Technology Centre http://oss.intel.com/ ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] firmware: Allocate firmware id dynamically 2009-05-26 14:11 ` Kay Sievers 2009-05-26 20:23 ` Andrew Morton @ 2009-05-27 6:19 ` Marcel Holtmann 1 sibling, 0 replies; 12+ messages in thread From: Marcel Holtmann @ 2009-05-27 6:19 UTC (permalink / raw) To: Kay Sievers Cc: Samuel Ortiz, Andrew Morton, Zhu, Yi, linux-kernel, linville, Greg Kroah-Hartmann Hi Samuel, > > Since the firmware loader is not maintained by anyone, I'm sending this one to > > you, for the next merge window: > > It's part of the driver-core directory, and handled by Greg. > > > The firmware loader has a statically allocated 30 bytes long string for the > > firmware id (a.k.a. the firmware file name). There is no reason why we couldnt > > allocate dynamically, and avoid having restrictions on the firmware names > > lengths. > > Looks good. Acked-by: Marcel Holtmann <marcel@holtmann.org> > > Please note that we have to keep the FIRMWARE_NAME_MAX definition around as > > some drivers rely on it. > > I think the 6 files should be converted, and FIRMWARE_NAME_MAX > removed, otherwise people will keep copying that crap around. > > drivers/pcmcia/ds.c > drivers/usb/atm/ueagle-atm.c > drivers/net/wireless/libertas/if_usb.c > drivers/net/wireless/libertas/if_spi.c > drivers/media/dvb/dvb-usb/dvb-usb.h > drivers/media/common/tuners/tuner-xc2028.c I do agree with Kay here that we should just go ahead and fix these. Regards Marcel ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] libertas: adapt for dynamic firmware id allocation 2009-05-26 14:04 [PATCH] firmware: Allocate firmware id dynamically Samuel Ortiz 2009-05-26 14:11 ` Kay Sievers @ 2009-05-26 14:51 ` John W. Linville 2009-05-26 17:02 ` Dan Williams 1 sibling, 1 reply; 12+ messages in thread From: John W. Linville @ 2009-05-26 14:51 UTC (permalink / raw) To: linux-kernel Cc: Samuel Ortiz, Andrew Morton, Kay Sievers, Marcel Holtmann, Zhu Yi, Dan Williams, John W. Linville Signed-off-by: John W. Linville <linville@tuxdriver.com> --- drivers/net/wireless/libertas/if_spi.c | 8 ++++---- drivers/net/wireless/libertas/if_spi.h | 3 +++ drivers/net/wireless/libertas/if_usb.c | 8 ++------ 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c index 5fa55fe..b3dc609 100644 --- a/drivers/net/wireless/libertas/if_spi.c +++ b/drivers/net/wireless/libertas/if_spi.c @@ -44,8 +44,8 @@ struct if_spi_card { struct lbs_private *priv; struct libertas_spi_platform_data *pdata; - char helper_fw_name[FIRMWARE_NAME_MAX]; - char main_fw_name[FIRMWARE_NAME_MAX]; + char helper_fw_name[IF_SPI_FW_NAME_MAX]; + char main_fw_name[IF_SPI_FW_NAME_MAX]; /* The card ID and card revision, as reported by the hardware. */ u16 card_id; @@ -1013,9 +1013,9 @@ static int if_spi_calculate_fw_names(u16 card_id, lbs_pr_err("Unsupported chip_id: 0x%02x\n", card_id); return -EAFNOSUPPORT; } - snprintf(helper_fw, FIRMWARE_NAME_MAX, "libertas/gspi%d_hlp.bin", + snprintf(helper_fw, IF_SPI_FW_NAME_MAX, "libertas/gspi%d_hlp.bin", chip_id_to_device_name[i].name); - snprintf(main_fw, FIRMWARE_NAME_MAX, "libertas/gspi%d.bin", + snprintf(main_fw, IF_SPI_FW_NAME_MAX, "libertas/gspi%d.bin", chip_id_to_device_name[i].name); return 0; } diff --git a/drivers/net/wireless/libertas/if_spi.h b/drivers/net/wireless/libertas/if_spi.h index 2103869..f87eec4 100644 --- a/drivers/net/wireless/libertas/if_spi.h +++ b/drivers/net/wireless/libertas/if_spi.h @@ -22,6 +22,9 @@ #define IF_SPI_CMD_BUF_SIZE 2400 /***************** Firmware *****************/ + +#define IF_SPI_FW_NAME_MAX 30 + struct chip_ident { u16 chip_id; u16 name; diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index ea3dc03..713c830 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c @@ -61,11 +61,9 @@ static ssize_t if_usb_firmware_set(struct device *dev, { struct lbs_private *priv = to_net_dev(dev)->ml_priv; struct if_usb_card *cardp = priv->card; - char fwname[FIRMWARE_NAME_MAX]; int ret; - sscanf(buf, "%29s", fwname); /* FIRMWARE_NAME_MAX - 1 = 29 */ - ret = if_usb_prog_firmware(cardp, fwname, BOOT_CMD_UPDATE_FW); + ret = if_usb_prog_firmware(cardp, buf, BOOT_CMD_UPDATE_FW); if (ret == 0) return count; @@ -88,11 +86,9 @@ static ssize_t if_usb_boot2_set(struct device *dev, { struct lbs_private *priv = to_net_dev(dev)->ml_priv; struct if_usb_card *cardp = priv->card; - char fwname[FIRMWARE_NAME_MAX]; int ret; - sscanf(buf, "%29s", fwname); /* FIRMWARE_NAME_MAX - 1 = 29 */ - ret = if_usb_prog_firmware(cardp, fwname, BOOT_CMD_UPDATE_BOOT2); + ret = if_usb_prog_firmware(cardp, buf, BOOT_CMD_UPDATE_BOOT2); if (ret == 0) return count; -- 1.6.0.6 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] libertas: adapt for dynamic firmware id allocation 2009-05-26 14:51 ` [PATCH] libertas: adapt for dynamic firmware id allocation John W. Linville @ 2009-05-26 17:02 ` Dan Williams 0 siblings, 0 replies; 12+ messages in thread From: Dan Williams @ 2009-05-26 17:02 UTC (permalink / raw) To: John W. Linville Cc: linux-kernel, Samuel Ortiz, Andrew Morton, Kay Sievers, Marcel Holtmann, Zhu Yi On Tue, 2009-05-26 at 16:51 +0200, John W. Linville wrote: > Signed-off-by: John W. Linville <linville@tuxdriver.com> Acked-by: Dan Williams <dcbw@redhat.com> > --- > drivers/net/wireless/libertas/if_spi.c | 8 ++++---- > drivers/net/wireless/libertas/if_spi.h | 3 +++ > drivers/net/wireless/libertas/if_usb.c | 8 ++------ > 3 files changed, 9 insertions(+), 10 deletions(-) > > diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c > index 5fa55fe..b3dc609 100644 > --- a/drivers/net/wireless/libertas/if_spi.c > +++ b/drivers/net/wireless/libertas/if_spi.c > @@ -44,8 +44,8 @@ struct if_spi_card { > struct lbs_private *priv; > struct libertas_spi_platform_data *pdata; > > - char helper_fw_name[FIRMWARE_NAME_MAX]; > - char main_fw_name[FIRMWARE_NAME_MAX]; > + char helper_fw_name[IF_SPI_FW_NAME_MAX]; > + char main_fw_name[IF_SPI_FW_NAME_MAX]; > > /* The card ID and card revision, as reported by the hardware. */ > u16 card_id; > @@ -1013,9 +1013,9 @@ static int if_spi_calculate_fw_names(u16 card_id, > lbs_pr_err("Unsupported chip_id: 0x%02x\n", card_id); > return -EAFNOSUPPORT; > } > - snprintf(helper_fw, FIRMWARE_NAME_MAX, "libertas/gspi%d_hlp.bin", > + snprintf(helper_fw, IF_SPI_FW_NAME_MAX, "libertas/gspi%d_hlp.bin", > chip_id_to_device_name[i].name); > - snprintf(main_fw, FIRMWARE_NAME_MAX, "libertas/gspi%d.bin", > + snprintf(main_fw, IF_SPI_FW_NAME_MAX, "libertas/gspi%d.bin", > chip_id_to_device_name[i].name); > return 0; > } > diff --git a/drivers/net/wireless/libertas/if_spi.h b/drivers/net/wireless/libertas/if_spi.h > index 2103869..f87eec4 100644 > --- a/drivers/net/wireless/libertas/if_spi.h > +++ b/drivers/net/wireless/libertas/if_spi.h > @@ -22,6 +22,9 @@ > #define IF_SPI_CMD_BUF_SIZE 2400 > > /***************** Firmware *****************/ > + > +#define IF_SPI_FW_NAME_MAX 30 > + > struct chip_ident { > u16 chip_id; > u16 name; > diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c > index ea3dc03..713c830 100644 > --- a/drivers/net/wireless/libertas/if_usb.c > +++ b/drivers/net/wireless/libertas/if_usb.c > @@ -61,11 +61,9 @@ static ssize_t if_usb_firmware_set(struct device *dev, > { > struct lbs_private *priv = to_net_dev(dev)->ml_priv; > struct if_usb_card *cardp = priv->card; > - char fwname[FIRMWARE_NAME_MAX]; > int ret; > > - sscanf(buf, "%29s", fwname); /* FIRMWARE_NAME_MAX - 1 = 29 */ > - ret = if_usb_prog_firmware(cardp, fwname, BOOT_CMD_UPDATE_FW); > + ret = if_usb_prog_firmware(cardp, buf, BOOT_CMD_UPDATE_FW); > if (ret == 0) > return count; > > @@ -88,11 +86,9 @@ static ssize_t if_usb_boot2_set(struct device *dev, > { > struct lbs_private *priv = to_net_dev(dev)->ml_priv; > struct if_usb_card *cardp = priv->card; > - char fwname[FIRMWARE_NAME_MAX]; > int ret; > > - sscanf(buf, "%29s", fwname); /* FIRMWARE_NAME_MAX - 1 = 29 */ > - ret = if_usb_prog_firmware(cardp, fwname, BOOT_CMD_UPDATE_BOOT2); > + ret = if_usb_prog_firmware(cardp, buf, BOOT_CMD_UPDATE_BOOT2); > if (ret == 0) > return count; > ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2009-05-27 15:09 UTC | newest] Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-05-26 14:04 [PATCH] firmware: Allocate firmware id dynamically Samuel Ortiz 2009-05-26 14:11 ` Kay Sievers 2009-05-26 20:23 ` Andrew Morton 2009-05-27 1:57 ` Stephen Rothwell 2009-05-27 8:17 ` Samuel Ortiz 2009-05-27 8:30 ` Kay Sievers 2009-05-27 15:04 ` Greg KH 2009-05-27 9:16 ` John W. Linville 2009-05-27 9:53 ` Samuel Ortiz 2009-05-27 6:19 ` Marcel Holtmann 2009-05-26 14:51 ` [PATCH] libertas: adapt for dynamic firmware id allocation John W. Linville 2009-05-26 17:02 ` Dan Williams
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.