aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wimax/i2400m/i2400m.h
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2009-02-28 18:42:47 -0500
committerDavid S. Miller <davem@davemloft.net>2009-03-02 06:10:23 -0500
commit1039abbc5b1bfa943b6daabbe9de1499037a90c0 (patch)
tree7c8e18a228750d59fba2941cca87850fb603af6c /drivers/net/wimax/i2400m/i2400m.h
parent86739fb96e8c8269fc5b3d300c959bede272a6f6 (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/i2400m.h')
-rw-r--r--drivers/net/wimax/i2400m/i2400m.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h
index f9e55397ee88..ad71ad1086ea 100644
--- a/drivers/net/wimax/i2400m/i2400m.h
+++ b/drivers/net/wimax/i2400m/i2400m.h
@@ -156,10 +156,6 @@ enum {
156}; 156};
157 157
158 158
159/* Firmware version we request when pulling the fw image file */
160#define I2400M_FW_VERSION "1.4"
161
162
163/** 159/**
164 * i2400m_reset_type - methods to reset a device 160 * i2400m_reset_type - methods to reset a device
165 * 161 *
@@ -242,10 +238,14 @@ struct i2400m_reset_ctx;
242 * The caller to this function will check if the response is a 238 * The caller to this function will check if the response is a
243 * barker that indicates the device going into reset mode. 239 * barker that indicates the device going into reset mode.
244 * 240 *
245 * @bus_fw_name: [fill] name of the firmware image (in most cases, 241 * @bus_fw_names: [fill] a NULL-terminated array with the names of the
246 * they are all the same for a single release, except that they 242 * firmware images to try loading. This is made a list so we can
247 * have the type of the bus embedded in the name (eg: 243 * support backward compatibility of firmware releases (eg: if we
248 * i2400m-fw-X-VERSION.sbcf, where X is the bus name). 244 * can't find the default v1.4, we try v1.3). In general, the name
245 * should be i2400m-fw-X-VERSION.sbcf, where X is the bus name.
246 * The list is tried in order and the first one that loads is
247 * used. The fw loader will set i2400m->fw_name to point to the
248 * active firmware image.
249 * 249 *
250 * @bus_bm_mac_addr_impaired: [fill] Set to true if the device's MAC 250 * @bus_bm_mac_addr_impaired: [fill] Set to true if the device's MAC
251 * address provided in boot mode is kind of broken and needs to 251 * address provided in boot mode is kind of broken and needs to
@@ -364,6 +364,8 @@ struct i2400m_reset_ctx;
364 * These have to be in a separate directory, a child of 364 * These have to be in a separate directory, a child of
365 * (wimax_dev->debugfs_dentry) so they can be removed when the 365 * (wimax_dev->debugfs_dentry) so they can be removed when the
366 * module unloads, as we don't keep each dentry. 366 * module unloads, as we don't keep each dentry.
367 *
368 * @fw_name: name of the firmware image that is currently being used.
367 */ 369 */
368struct i2400m { 370struct i2400m {
369 struct wimax_dev wimax_dev; /* FIRST! See doc */ 371 struct wimax_dev wimax_dev; /* FIRST! See doc */
@@ -388,7 +390,7 @@ struct i2400m {
388 size_t, int flags); 390 size_t, int flags);
389 ssize_t (*bus_bm_wait_for_ack)(struct i2400m *, 391 ssize_t (*bus_bm_wait_for_ack)(struct i2400m *,
390 struct i2400m_bootrom_header *, size_t); 392 struct i2400m_bootrom_header *, size_t);
391 const char *bus_fw_name; 393 const char **bus_fw_names;
392 unsigned bus_bm_mac_addr_impaired:1; 394 unsigned bus_bm_mac_addr_impaired:1;
393 395
394 spinlock_t tx_lock; /* protect TX state */ 396 spinlock_t tx_lock; /* protect TX state */
@@ -421,6 +423,7 @@ struct i2400m {
421 struct sk_buff *wake_tx_skb; 423 struct sk_buff *wake_tx_skb;
422 424
423 struct dentry *debugfs_dentry; 425 struct dentry *debugfs_dentry;
426 const char *fw_name; /* name of the current firmware image */
424}; 427};
425 428
426 429