diff options
author | John W. Linville <linville@tuxdriver.com> | 2009-05-26 18:49:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:30:25 -0400 |
commit | cadeba315cc91ae1b57632e61b0cec3a4ed7088d (patch) | |
tree | e061f57ec4afa217ca97ce22ab122c9ce79fbeb9 | |
parent | ed62acec209fa7e104b9d7871c1e5307fab83bf0 (diff) |
firmware: wireless/libertas: prepare for FIRMWARE_NAME_MAX removal
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>
-rw-r--r-- | drivers/net/wireless/libertas/if_spi.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/if_spi.h | 3 | ||||
-rw-r--r-- | 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 f8c2898d82b0..06a46d7b3d6c 100644 --- a/drivers/net/wireless/libertas/if_spi.c +++ b/drivers/net/wireless/libertas/if_spi.c | |||
@@ -43,8 +43,8 @@ struct if_spi_card { | |||
43 | struct lbs_private *priv; | 43 | struct lbs_private *priv; |
44 | struct libertas_spi_platform_data *pdata; | 44 | struct libertas_spi_platform_data *pdata; |
45 | 45 | ||
46 | char helper_fw_name[FIRMWARE_NAME_MAX]; | 46 | char helper_fw_name[IF_SPI_FW_NAME_MAX]; |
47 | char main_fw_name[FIRMWARE_NAME_MAX]; | 47 | char main_fw_name[IF_SPI_FW_NAME_MAX]; |
48 | 48 | ||
49 | /* The card ID and card revision, as reported by the hardware. */ | 49 | /* The card ID and card revision, as reported by the hardware. */ |
50 | u16 card_id; | 50 | u16 card_id; |
@@ -1019,9 +1019,9 @@ static int if_spi_calculate_fw_names(u16 card_id, | |||
1019 | lbs_pr_err("Unsupported chip_id: 0x%02x\n", card_id); | 1019 | lbs_pr_err("Unsupported chip_id: 0x%02x\n", card_id); |
1020 | return -EAFNOSUPPORT; | 1020 | return -EAFNOSUPPORT; |
1021 | } | 1021 | } |
1022 | snprintf(helper_fw, FIRMWARE_NAME_MAX, "libertas/gspi%d_hlp.bin", | 1022 | snprintf(helper_fw, IF_SPI_FW_NAME_MAX, "libertas/gspi%d_hlp.bin", |
1023 | chip_id_to_device_name[i].name); | 1023 | chip_id_to_device_name[i].name); |
1024 | snprintf(main_fw, FIRMWARE_NAME_MAX, "libertas/gspi%d.bin", | 1024 | snprintf(main_fw, IF_SPI_FW_NAME_MAX, "libertas/gspi%d.bin", |
1025 | chip_id_to_device_name[i].name); | 1025 | chip_id_to_device_name[i].name); |
1026 | return 0; | 1026 | return 0; |
1027 | } | 1027 | } |
diff --git a/drivers/net/wireless/libertas/if_spi.h b/drivers/net/wireless/libertas/if_spi.h index 2103869cc5b0..f87eec410848 100644 --- a/drivers/net/wireless/libertas/if_spi.h +++ b/drivers/net/wireless/libertas/if_spi.h | |||
@@ -22,6 +22,9 @@ | |||
22 | #define IF_SPI_CMD_BUF_SIZE 2400 | 22 | #define IF_SPI_CMD_BUF_SIZE 2400 |
23 | 23 | ||
24 | /***************** Firmware *****************/ | 24 | /***************** Firmware *****************/ |
25 | |||
26 | #define IF_SPI_FW_NAME_MAX 30 | ||
27 | |||
25 | struct chip_ident { | 28 | struct chip_ident { |
26 | u16 chip_id; | 29 | u16 chip_id; |
27 | u16 name; | 30 | u16 name; |
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index d649caebf08a..1844c5adf6e9 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, | |||
61 | { | 61 | { |
62 | struct lbs_private *priv = to_net_dev(dev)->ml_priv; | 62 | struct lbs_private *priv = to_net_dev(dev)->ml_priv; |
63 | struct if_usb_card *cardp = priv->card; | 63 | struct if_usb_card *cardp = priv->card; |
64 | char fwname[FIRMWARE_NAME_MAX]; | ||
65 | int ret; | 64 | int ret; |
66 | 65 | ||
67 | sscanf(buf, "%29s", fwname); /* FIRMWARE_NAME_MAX - 1 = 29 */ | 66 | ret = if_usb_prog_firmware(cardp, buf, BOOT_CMD_UPDATE_FW); |
68 | ret = if_usb_prog_firmware(cardp, fwname, BOOT_CMD_UPDATE_FW); | ||
69 | if (ret == 0) | 67 | if (ret == 0) |
70 | return count; | 68 | return count; |
71 | 69 | ||
@@ -88,11 +86,9 @@ static ssize_t if_usb_boot2_set(struct device *dev, | |||
88 | { | 86 | { |
89 | struct lbs_private *priv = to_net_dev(dev)->ml_priv; | 87 | struct lbs_private *priv = to_net_dev(dev)->ml_priv; |
90 | struct if_usb_card *cardp = priv->card; | 88 | struct if_usb_card *cardp = priv->card; |
91 | char fwname[FIRMWARE_NAME_MAX]; | ||
92 | int ret; | 89 | int ret; |
93 | 90 | ||
94 | sscanf(buf, "%29s", fwname); /* FIRMWARE_NAME_MAX - 1 = 29 */ | 91 | ret = if_usb_prog_firmware(cardp, buf, BOOT_CMD_UPDATE_BOOT2); |
95 | ret = if_usb_prog_firmware(cardp, fwname, BOOT_CMD_UPDATE_BOOT2); | ||
96 | if (ret == 0) | 92 | if (ret == 0) |
97 | return count; | 93 | return count; |
98 | 94 | ||