firmware: wireless/libertas: prepare for FIRMWARE_NAME_MAX removal
authorJohn W. Linville <linville@tuxdriver.com>
Tue, 26 May 2009 22:49:36 +0000 (00:49 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 16 Jun 2009 04:30:25 +0000 (21:30 -0700)
We're going to remove the FIRMWARE_NAME_MAX definition in order to avoid any
firmware name length restriction.
This patch eplaces the shared FIRMWARE_NAME_MAX definition with a libertas
local one.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/libertas/if_spi.c
drivers/net/wireless/libertas/if_spi.h
drivers/net/wireless/libertas/if_usb.c

index f8c2898d82b05b305e69c566e52e8291b5118348..06a46d7b3d6c2460aecd793d2827033c7c0348f6 100644 (file)
@@ -43,8 +43,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;
@@ -1019,9 +1019,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;
 }
index 2103869cc5b06dc8940eb2a3c8c00cd89af6c8a5..f87eec410848fb023416170c0241a84938949f55 100644 (file)
@@ -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;
index d649caebf08a1e93ffd9a136f7682340fe380f33..1844c5adf6e9fb1ad3807f5346174a75654a71c8 100644 (file)
@@ -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;