aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wimax/i2400m
diff options
context:
space:
mode:
authorCindy H Kao <cindy.h.kao@intel.com>2009-10-02 22:31:17 -0400
committerInaky Perez-Gonzalez <inaky@linux.intel.com>2009-10-19 02:56:16 -0400
commit28cff50d99ce9a1db65b7d4dcdcc0f1f8d9f9309 (patch)
tree67c39a2383a8eba76e7c036c6d85dbbd86399a08 /drivers/net/wimax/i2400m
parent6f4fc90a36fbe87e3003b3f7c8090ecc89bd1353 (diff)
wimax/i2400m: change the bcf_len to exclude the extended header size
The actual fw->size may not equal to the bcf size indicated in the bcf header if the extended bcf debug header is added in the tail. To reflect the actual fw size that will be downloaded to the device, it is now retrived from from the size field indicated in the bcf header. All of the headers (if there are extended headers) should indicate same value for the size field since only one set of firmware chunks is downloaded Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
Diffstat (limited to 'drivers/net/wimax/i2400m')
-rw-r--r--drivers/net/wimax/i2400m/fw.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c
index 97ea78406725..fda54bfdf70e 100644
--- a/drivers/net/wimax/i2400m/fw.c
+++ b/drivers/net/wimax/i2400m/fw.c
@@ -1388,15 +1388,16 @@ const struct i2400m_bcf_hdr *i2400m_bcf_hdr_find(struct i2400m *i2400m)
1388 */ 1388 */
1389static 1389static
1390int i2400m_fw_dnload(struct i2400m *i2400m, const struct i2400m_bcf_hdr *bcf, 1390int i2400m_fw_dnload(struct i2400m *i2400m, const struct i2400m_bcf_hdr *bcf,
1391 size_t bcf_size, enum i2400m_bri flags) 1391 size_t fw_size, enum i2400m_bri flags)
1392{ 1392{
1393 int ret = 0; 1393 int ret = 0;
1394 struct device *dev = i2400m_dev(i2400m); 1394 struct device *dev = i2400m_dev(i2400m);
1395 int count = i2400m->bus_bm_retries; 1395 int count = i2400m->bus_bm_retries;
1396 const struct i2400m_bcf_hdr *bcf_hdr; 1396 const struct i2400m_bcf_hdr *bcf_hdr;
1397 size_t bcf_size;
1397 1398
1398 d_fnstart(5, dev, "(i2400m %p bcf %p size %zu)\n", 1399 d_fnstart(5, dev, "(i2400m %p bcf %p fw size %zu)\n",
1399 i2400m, bcf, bcf_size); 1400 i2400m, bcf, fw_size);
1400 i2400m->boot_mode = 1; 1401 i2400m->boot_mode = 1;
1401 wmb(); /* Make sure other readers see it */ 1402 wmb(); /* Make sure other readers see it */
1402hw_reboot: 1403hw_reboot:
@@ -1434,6 +1435,12 @@ hw_reboot:
1434 if (ret < 0) 1435 if (ret < 0)
1435 goto error_dnload_init; 1436 goto error_dnload_init;
1436 1437
1438 /*
1439 * bcf_size refers to one header size plus the fw sections size
1440 * indicated by the header,ie. if there are other extended headers
1441 * at the tail, they are not counted
1442 */
1443 bcf_size = sizeof(u32) * le32_to_cpu(bcf_hdr->size);
1437 ret = i2400m_dnload_bcf(i2400m, bcf, bcf_size); 1444 ret = i2400m_dnload_bcf(i2400m, bcf, bcf_size);
1438 if (ret == -ERESTARTSYS) 1445 if (ret == -ERESTARTSYS)
1439 goto error_dev_rebooted; 1446 goto error_dev_rebooted;
@@ -1464,7 +1471,7 @@ error_bcf_hdr_find:
1464error_bootrom_init: 1471error_bootrom_init:
1465error_too_many_reboots: 1472error_too_many_reboots:
1466 d_fnend(5, dev, "(i2400m %p bcf %p size %zu) = %d\n", 1473 d_fnend(5, dev, "(i2400m %p bcf %p size %zu) = %d\n",
1467 i2400m, bcf, bcf_size, ret); 1474 i2400m, bcf, fw_size, ret);
1468 return ret; 1475 return ret;
1469 1476
1470error_dev_rebooted: 1477error_dev_rebooted: