diff options
author | Shahar Levi <shahar_levi@ti.com> | 2011-03-06 09:32:10 -0500 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-04-19 09:48:10 -0400 |
commit | bc765bf3b9a095b3e41c8cda80643901884c3dd4 (patch) | |
tree | debb36120cb682b9fb848f0876454547f285495f /drivers/net/wireless/wl12xx/cmd.c | |
parent | 49d750ca14cd49e76ab039b33b5a621e0a92b9fd (diff) |
wl12xx: 1281/1283 support - Loading FW & NVS
Take care of FW & NVS with the auto-detection between wl127x and
wl128x.
[Moved some common code outside if statements and added notes about
NVS structure assumptions; Fixed a bug when checking the nvs size: if
the size was incorrect, the local nvs variable was set to NULL, it
should be wl->nvs instead. -- Luca]
[Merged with potential buffer overflow fix -- Luca]
Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/cmd.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/cmd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c index 37eb9f366942..246804428517 100644 --- a/drivers/net/wireless/wl12xx/cmd.c +++ b/drivers/net/wireless/wl12xx/cmd.c | |||
@@ -187,8 +187,9 @@ out: | |||
187 | 187 | ||
188 | int wl1271_cmd_radio_parms(struct wl1271 *wl) | 188 | int wl1271_cmd_radio_parms(struct wl1271 *wl) |
189 | { | 189 | { |
190 | struct wl1271_nvs_file *nvs = (struct wl1271_nvs_file *)wl->nvs; | ||
190 | struct wl1271_radio_parms_cmd *radio_parms; | 191 | struct wl1271_radio_parms_cmd *radio_parms; |
191 | struct wl1271_ini_general_params *gp = &wl->nvs->general_params; | 192 | struct wl1271_ini_general_params *gp = &nvs->general_params; |
192 | int ret; | 193 | int ret; |
193 | 194 | ||
194 | if (!wl->nvs) | 195 | if (!wl->nvs) |
@@ -201,18 +202,18 @@ int wl1271_cmd_radio_parms(struct wl1271 *wl) | |||
201 | radio_parms->test.id = TEST_CMD_INI_FILE_RADIO_PARAM; | 202 | radio_parms->test.id = TEST_CMD_INI_FILE_RADIO_PARAM; |
202 | 203 | ||
203 | /* 2.4GHz parameters */ | 204 | /* 2.4GHz parameters */ |
204 | memcpy(&radio_parms->static_params_2, &wl->nvs->stat_radio_params_2, | 205 | memcpy(&radio_parms->static_params_2, &nvs->stat_radio_params_2, |
205 | sizeof(struct wl1271_ini_band_params_2)); | 206 | sizeof(struct wl1271_ini_band_params_2)); |
206 | memcpy(&radio_parms->dyn_params_2, | 207 | memcpy(&radio_parms->dyn_params_2, |
207 | &wl->nvs->dyn_radio_params_2[gp->tx_bip_fem_manufacturer].params, | 208 | &nvs->dyn_radio_params_2[gp->tx_bip_fem_manufacturer].params, |
208 | sizeof(struct wl1271_ini_fem_params_2)); | 209 | sizeof(struct wl1271_ini_fem_params_2)); |
209 | 210 | ||
210 | /* 5GHz parameters */ | 211 | /* 5GHz parameters */ |
211 | memcpy(&radio_parms->static_params_5, | 212 | memcpy(&radio_parms->static_params_5, |
212 | &wl->nvs->stat_radio_params_5, | 213 | &nvs->stat_radio_params_5, |
213 | sizeof(struct wl1271_ini_band_params_5)); | 214 | sizeof(struct wl1271_ini_band_params_5)); |
214 | memcpy(&radio_parms->dyn_params_5, | 215 | memcpy(&radio_parms->dyn_params_5, |
215 | &wl->nvs->dyn_radio_params_5[gp->tx_bip_fem_manufacturer].params, | 216 | &nvs->dyn_radio_params_5[gp->tx_bip_fem_manufacturer].params, |
216 | sizeof(struct wl1271_ini_fem_params_5)); | 217 | sizeof(struct wl1271_ini_fem_params_5)); |
217 | 218 | ||
218 | wl1271_dump(DEBUG_CMD, "TEST_CMD_INI_FILE_RADIO_PARAM: ", | 219 | wl1271_dump(DEBUG_CMD, "TEST_CMD_INI_FILE_RADIO_PARAM: ", |