Commit c951da46 authored by Pontus Fuchs's avatar Pontus Fuchs Committed by John W. Linville

wcn36xx: Improve feature caps exchange

* Response format is not in the canonical format.
  wcn36xx_smd_rsp_status_check cannot be used.

* Save the FW caps in wcn36xx struct for later use.
Signed-off-by: default avatarPontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 08762322
...@@ -4384,11 +4384,13 @@ enum place_holder_in_cap_bitmap { ...@@ -4384,11 +4384,13 @@ enum place_holder_in_cap_bitmap {
MAX_FEATURE_SUPPORTED = 128, MAX_FEATURE_SUPPORTED = 128,
}; };
#define WCN36XX_HAL_CAPS_SIZE 4
struct wcn36xx_hal_feat_caps_msg { struct wcn36xx_hal_feat_caps_msg {
struct wcn36xx_hal_msg_header header; struct wcn36xx_hal_msg_header header;
u32 feat_caps[4]; u32 feat_caps[WCN36XX_HAL_CAPS_SIZE];
} __packed; } __packed;
/* status codes to help debug rekey failures */ /* status codes to help debug rekey failures */
......
...@@ -1731,8 +1731,8 @@ static inline void clear_feat_caps(u32 *bitmap, ...@@ -1731,8 +1731,8 @@ static inline void clear_feat_caps(u32 *bitmap,
int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn) int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn)
{ {
struct wcn36xx_hal_feat_caps_msg msg_body; struct wcn36xx_hal_feat_caps_msg msg_body, *rsp;
int ret = 0; int ret = 0, i;
mutex_lock(&wcn->hal_mutex); mutex_lock(&wcn->hal_mutex);
INIT_HAL_MSG(msg_body, WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ); INIT_HAL_MSG(msg_body, WCN36XX_HAL_FEATURE_CAPS_EXCHANGE_REQ);
...@@ -1746,12 +1746,15 @@ int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn) ...@@ -1746,12 +1746,15 @@ int wcn36xx_smd_feature_caps_exchange(struct wcn36xx *wcn)
wcn36xx_err("Sending hal_feature_caps_exchange failed\n"); wcn36xx_err("Sending hal_feature_caps_exchange failed\n");
goto out; goto out;
} }
ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len); if (wcn->hal_rsp_len != sizeof(*rsp)) {
if (ret) { wcn36xx_err("Invalid hal_feature_caps_exchange response");
wcn36xx_err("hal_feature_caps_exchange response failed err=%d\n",
ret);
goto out; goto out;
} }
rsp = (struct wcn36xx_hal_feat_caps_msg *) wcn->hal_buf;
for (i = 0; i < WCN36XX_HAL_CAPS_SIZE; i++)
wcn->fw_feat_caps[i] = rsp->feat_caps[i];
out: out:
mutex_unlock(&wcn->hal_mutex); mutex_unlock(&wcn->hal_mutex);
return ret; return ret;
......
...@@ -175,6 +175,7 @@ struct wcn36xx { ...@@ -175,6 +175,7 @@ struct wcn36xx {
u8 fw_version; u8 fw_version;
u8 fw_minor; u8 fw_minor;
u8 fw_major; u8 fw_major;
u32 fw_feat_caps[WCN36XX_HAL_CAPS_SIZE];
/* extra byte for the NULL termination */ /* extra byte for the NULL termination */
u8 crm_version[WCN36XX_HAL_VERSION_LENGTH + 1]; u8 crm_version[WCN36XX_HAL_VERSION_LENGTH + 1];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment