提交 15483996 编写于 作者: M Marek Vasut 提交者: John W. Linville

libertas: Fix problem with broken V4 firmware on CF8381

Firmware V4 on CF8381 reports region code shifted by 1 byte to left.
The following patch checks for this and handles it properly.
Signed-off-by: NMarek Vasut <marek.vasut@gmail.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 5d2214ac
...@@ -135,8 +135,14 @@ int lbs_update_hw_spec(struct lbs_private *priv) ...@@ -135,8 +135,14 @@ int lbs_update_hw_spec(struct lbs_private *priv)
/* Clamp region code to 8-bit since FW spec indicates that it should /* Clamp region code to 8-bit since FW spec indicates that it should
* only ever be 8-bit, even though the field size is 16-bit. Some firmware * only ever be 8-bit, even though the field size is 16-bit. Some firmware
* returns non-zero high 8 bits here. * returns non-zero high 8 bits here.
*
* Firmware version 4.0.102 used in CF8381 has region code shifted. We
* need to check for this problem and handle it properly.
*/ */
priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF; if (MRVL_FW_MAJOR_REV(priv->fwrelease) == MRVL_FW_V4)
priv->regioncode = (le16_to_cpu(cmd.regioncode) >> 8) & 0xFF;
else
priv->regioncode = le16_to_cpu(cmd.regioncode) & 0xFF;
for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) { for (i = 0; i < MRVDRV_MAX_REGION_CODE; i++) {
/* use the region code to search for the index */ /* use the region code to search for the index */
......
...@@ -234,6 +234,8 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in ...@@ -234,6 +234,8 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
/** Mesh enable bit in FW capability */ /** Mesh enable bit in FW capability */
#define MESH_CAPINFO_ENABLE_MASK (1<<16) #define MESH_CAPINFO_ENABLE_MASK (1<<16)
/** FW definition from Marvell v4 */
#define MRVL_FW_V4 (0x04)
/** FW definition from Marvell v5 */ /** FW definition from Marvell v5 */
#define MRVL_FW_V5 (0x05) #define MRVL_FW_V5 (0x05)
/** FW definition from Marvell v10 */ /** FW definition from Marvell v10 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册