mwifiex: use firmware API revision from GET_HW_SPEC response
authorAmitkumar Karwar <akarwar@marvell.com>
Tue, 19 Aug 2014 12:24:26 +0000 (08:24 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 28 Aug 2014 18:41:56 +0000 (14:41 -0400)
Newer firmware returns API revision in GET_HW_SPEC command
response. We will make use of it instead of parsing this
information from FW release number.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/cmdevt.c
drivers/net/wireless/mwifiex/fw.h

index 720e5198b437310034f2338e4963d27d70af005a..985f6c2654fb59ba510c862e1c2615fb278cc1ce 100644 (file)
@@ -1508,7 +1508,6 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
        }
 
        adapter->fw_release_number = le32_to_cpu(hw_spec->fw_release_number);
-       adapter->fw_api_ver = (adapter->fw_release_number >> 16) & 0xff;
        adapter->number_of_antenna = le16_to_cpu(hw_spec->number_of_antenna);
 
        if (le32_to_cpu(hw_spec->dot_11ac_dev_cap)) {
@@ -1552,6 +1551,13 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv,
                                                adapter->key_api_major_ver,
                                                adapter->key_api_minor_ver);
                                        break;
+                               case FW_API_VER_ID:
+                                       adapter->fw_api_ver =
+                                                       api_rev->major_ver;
+                                       dev_dbg(adapter->dev,
+                                               "Firmware api version %d\n",
+                                               adapter->fw_api_ver);
+                                       break;
                                default:
                                        dev_warn(adapter->dev,
                                                 "Unknown api_id: %d\n",
index adc47f3ea1224bf4187eb216aa2e29376155e549..6a703ea18800b417f839ecc284a8d05a74ea6c9f 100644 (file)
@@ -846,6 +846,7 @@ struct host_cmd_ds_802_11_ps_mode_enh {
 
 enum API_VER_ID {
        KEY_API_VER_ID = 1,
+       FW_API_VER_ID = 2,
 };
 
 struct hw_spec_api_rev {