diff options
author | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-02-28 18:42:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-02 06:10:23 -0500 |
commit | 1039abbc5b1bfa943b6daabbe9de1499037a90c0 (patch) | |
tree | 7c8e18a228750d59fba2941cca87850fb603af6c /drivers/net/wimax/i2400m/sdio.c | |
parent | 86739fb96e8c8269fc5b3d300c959bede272a6f6 (diff) |
wimax/i2400m: add the ability to fallback to other firmware files if the default is not there
In order to support backwards compatibility with older firmwares when
a driver is updated by a new kernel release, the i2400m bus drivers
can declare a list of firmware files they can work with (in general
these will be each a different version). The firmware loader will try
them in sequence until one loads.
Thus, if a user doesn't have the latest and greatest firmware that a
newly installed kernel would require, the driver would fall back to
the firmware from a previous release.
To support this, the i2400m->bus_fw_name is changed to be a NULL
terminated array firmware file names (and renamed to bus_fw_names) and
we add a new entry (i2400m->fw_name) that points to the name of the
firmware being currently used. All code that needs to print the
firmware file name uses i2400m->fw_name instead of the old
i2400m->bus_fw_name.
The code in i2400m_dev_bootstrap() that loads the firmware is changed
with an iterator over the firmware file name list that tries to load
each form user space, using the first one that succeeds in
request_firmware() (and thus stopping the iteration).
The USB and SDIO bus drivers are updated to take advantage of this and
reflect which firmwares they support.
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wimax/i2400m/sdio.c')
-rw-r--r-- | drivers/net/wimax/i2400m/sdio.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/wimax/i2400m/sdio.c b/drivers/net/wimax/i2400m/sdio.c index 123a5f8db6ad..5ac5e76701cd 100644 --- a/drivers/net/wimax/i2400m/sdio.c +++ b/drivers/net/wimax/i2400m/sdio.c | |||
@@ -70,8 +70,13 @@ | |||
70 | static int ioe_timeout = 2; | 70 | static int ioe_timeout = 2; |
71 | module_param(ioe_timeout, int, 0); | 71 | module_param(ioe_timeout, int, 0); |
72 | 72 | ||
73 | /* Our firmware file name */ | 73 | /* Our firmware file name list */ |
74 | #define I2400MS_FW_FILE_NAME "i2400m-fw-sdio-" I2400M_FW_VERSION ".sbcf" | 74 | static const char *i2400ms_bus_fw_names[] = { |
75 | #define I2400MS_FW_FILE_NAME "i2400m-fw-sdio-1.3.sbcf" | ||
76 | I2400MS_FW_FILE_NAME, | ||
77 | NULL | ||
78 | }; | ||
79 | |||
75 | 80 | ||
76 | /* | 81 | /* |
77 | * Enable the SDIO function | 82 | * Enable the SDIO function |
@@ -401,7 +406,7 @@ int i2400ms_probe(struct sdio_func *func, | |||
401 | i2400m->bus_reset = i2400ms_bus_reset; | 406 | i2400m->bus_reset = i2400ms_bus_reset; |
402 | i2400m->bus_bm_cmd_send = i2400ms_bus_bm_cmd_send; | 407 | i2400m->bus_bm_cmd_send = i2400ms_bus_bm_cmd_send; |
403 | i2400m->bus_bm_wait_for_ack = i2400ms_bus_bm_wait_for_ack; | 408 | i2400m->bus_bm_wait_for_ack = i2400ms_bus_bm_wait_for_ack; |
404 | i2400m->bus_fw_name = I2400MS_FW_FILE_NAME; | 409 | i2400m->bus_fw_names = i2400ms_bus_fw_names; |
405 | i2400m->bus_bm_mac_addr_impaired = 1; | 410 | i2400m->bus_bm_mac_addr_impaired = 1; |
406 | 411 | ||
407 | result = i2400ms_enable_function(i2400ms->func); | 412 | result = i2400ms_enable_function(i2400ms->func); |