aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wimax
diff options
context:
space:
mode:
authorInaky Perez-Gonzalez <inaky@linux.intel.com>2009-09-04 17:53:43 -0400
committerInaky Perez-Gonzalez <inaky@linux.intel.com>2009-10-19 02:55:56 -0400
commitfabce1a485dd985c0e4c16f61f4ddb5e27e49cbf (patch)
treebe682e23feea2e06c6ff7a1a1bb9f2f82b1b27e7 /drivers/net/wimax
parent923d708fed9d47c7b4d67694500d766337663e29 (diff)
wimax/i2400m: verify firmware format version is known
Make sure the bootloading code checks that the format of the file is understood (major version match). This also fixes a dumb typo in extracting the major version field. Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Diffstat (limited to 'drivers/net/wimax')
-rw-r--r--drivers/net/wimax/i2400m/fw.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c
index eef236d85af3..1fd2fee4c6c2 100644
--- a/drivers/net/wimax/i2400m/fw.c
+++ b/drivers/net/wimax/i2400m/fw.c
@@ -1179,7 +1179,7 @@ int i2400m_fw_check(struct i2400m *i2400m,
1179 1179
1180 module_type = bcf->module_type; 1180 module_type = bcf->module_type;
1181 header_len = sizeof(u32) * le32_to_cpu(bcf->header_len); 1181 header_len = sizeof(u32) * le32_to_cpu(bcf->header_len);
1182 major_version = le32_to_cpu(bcf->header_version) & 0xffff0000 >> 16; 1182 major_version = (le32_to_cpu(bcf->header_version) & 0xffff0000) >> 16;
1183 minor_version = le32_to_cpu(bcf->header_version) & 0x0000ffff; 1183 minor_version = le32_to_cpu(bcf->header_version) & 0x0000ffff;
1184 module_id = le32_to_cpu(bcf->module_id); 1184 module_id = le32_to_cpu(bcf->module_id);
1185 module_vendor = le32_to_cpu(bcf->module_vendor); 1185 module_vendor = le32_to_cpu(bcf->module_vendor);
@@ -1205,6 +1205,12 @@ int i2400m_fw_check(struct i2400m *i2400m,
1205 goto error; 1205 goto error;
1206 } 1206 }
1207 1207
1208 if (major_version != 1) {
1209 dev_err(dev, "%s: major header version v%u.%u not supported\n",
1210 i2400m->fw_name, major_version, minor_version);
1211 goto error;
1212 }
1213
1208 /* Check soft-er errors */ 1214 /* Check soft-er errors */
1209 result = 0; 1215 result = 0;
1210 if (module_vendor != 0x8086) 1216 if (module_vendor != 0x8086)