mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
Merge "cnss2: Do not wait in loop if MAC is not provisioned"
This commit is contained in:
commit
9a7b6fe9af
3 changed files with 12 additions and 5 deletions
|
|
@ -517,11 +517,11 @@ static int cnss_setup_dms_mac(struct cnss_plat_data *plat_priv)
|
|||
break;
|
||||
|
||||
ret = cnss_qmi_get_dms_mac(plat_priv);
|
||||
if (ret == 0)
|
||||
if (ret != -EAGAIN)
|
||||
break;
|
||||
msleep(CNSS_DMS_QMI_CONNECTION_WAIT_MS);
|
||||
}
|
||||
if (!plat_priv->dms.mac_valid) {
|
||||
if (!plat_priv->dms.nv_mac_not_prov && !plat_priv->dms.mac_valid) {
|
||||
cnss_pr_err("Unable to get MAC from DMS after retries\n");
|
||||
CNSS_ASSERT(0);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
|
|
@ -394,6 +394,7 @@ enum cnss_ce_index {
|
|||
|
||||
struct cnss_dms_data {
|
||||
u32 mac_valid;
|
||||
u8 nv_mac_not_prov;
|
||||
u8 mac[QMI_WLFW_MAC_ADDR_SIZE_V01];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#define QMI_WLFW_MAX_RECV_BUF_SIZE SZ_8K
|
||||
#define IMSPRIVATE_SERVICE_MAX_MSG_LEN SZ_8K
|
||||
#define DMS_QMI_MAX_MSG_LEN SZ_256
|
||||
#define DMS_MAC_NOT_PROVISIONED 16
|
||||
|
||||
#define QMI_WLFW_MAC_READY_TIMEOUT_MS 50
|
||||
#define QMI_WLFW_MAC_READY_MAX_RETRY 200
|
||||
|
|
@ -2872,7 +2873,7 @@ int cnss_qmi_get_dms_mac(struct cnss_plat_data *plat_priv)
|
|||
|
||||
if (!test_bit(CNSS_QMI_DMS_CONNECTED, &plat_priv->driver_state)) {
|
||||
cnss_pr_err("DMS QMI connection not established\n");
|
||||
return -EINVAL;
|
||||
return -EAGAIN;
|
||||
}
|
||||
cnss_pr_dbg("Requesting DMS MAC address");
|
||||
|
||||
|
|
@ -2903,8 +2904,13 @@ int cnss_qmi_get_dms_mac(struct cnss_plat_data *plat_priv)
|
|||
}
|
||||
|
||||
if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
|
||||
cnss_pr_err("QMI_DMS_GET_MAC_ADDRESS_REQ_V01 failed, result: %d, err: %d\n",
|
||||
resp.resp.result, resp.resp.error);
|
||||
if (resp.resp.error == DMS_MAC_NOT_PROVISIONED) {
|
||||
cnss_pr_err("NV MAC address is not provisioned");
|
||||
plat_priv->dms.nv_mac_not_prov = 1;
|
||||
} else {
|
||||
cnss_pr_err("QMI_DMS_GET_MAC_ADDRESS_REQ_V01 failed, result: %d, err: %d\n",
|
||||
resp.resp.result, resp.resp.error);
|
||||
}
|
||||
ret = -resp.resp.result;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue