cnss2: Print string for firmware mode
This can clearly show the firmware mode sent through QMI message in the logs to help debugging. Signed-off-by: Yue Ma <yuem@codeaurora.org> CRs-fixed: 2059087 Change-Id: I0b11808f00229ed557141226bc2510673a7a1ede
This commit is contained in:
parent
9f462e8a2b
commit
0e8dffdaf8
1 changed files with 31 additions and 6 deletions
|
@ -50,6 +50,30 @@ enum cnss_bdf_type {
|
||||||
CNSS_BDF_ELF,
|
CNSS_BDF_ELF,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static char *cnss_qmi_mode_to_str(enum wlfw_driver_mode_enum_v01 mode)
|
||||||
|
{
|
||||||
|
switch (mode) {
|
||||||
|
case QMI_WLFW_MISSION_V01:
|
||||||
|
return "MISSION";
|
||||||
|
case QMI_WLFW_FTM_V01:
|
||||||
|
return "FTM";
|
||||||
|
case QMI_WLFW_EPPING_V01:
|
||||||
|
return "EPPING";
|
||||||
|
case QMI_WLFW_WALTEST_V01:
|
||||||
|
return "WALTEST";
|
||||||
|
case QMI_WLFW_OFF_V01:
|
||||||
|
return "OFF";
|
||||||
|
case QMI_WLFW_CCPM_V01:
|
||||||
|
return "CCPM";
|
||||||
|
case QMI_WLFW_QVIT_V01:
|
||||||
|
return "QVIT";
|
||||||
|
case QMI_WLFW_CALIBRATION_V01:
|
||||||
|
return "CALIBRATION";
|
||||||
|
default:
|
||||||
|
return "UNKNOWN";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
static void cnss_wlfw_clnt_notifier_work(struct work_struct *work)
|
static void cnss_wlfw_clnt_notifier_work(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct cnss_plat_data *plat_priv =
|
struct cnss_plat_data *plat_priv =
|
||||||
|
@ -585,8 +609,8 @@ int cnss_wlfw_wlan_mode_send_sync(struct cnss_plat_data *plat_priv,
|
||||||
if (!plat_priv)
|
if (!plat_priv)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
cnss_pr_dbg("Sending mode message, state: 0x%lx, mode: %d\n",
|
cnss_pr_dbg("Sending mode message, mode: %s(%d), state: 0x%lx\n",
|
||||||
plat_priv->driver_state, mode);
|
cnss_qmi_mode_to_str(mode), mode, plat_priv->driver_state);
|
||||||
|
|
||||||
if (mode == QMI_WLFW_OFF_V01 &&
|
if (mode == QMI_WLFW_OFF_V01 &&
|
||||||
test_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state)) {
|
test_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state)) {
|
||||||
|
@ -617,14 +641,15 @@ int cnss_wlfw_wlan_mode_send_sync(struct cnss_plat_data *plat_priv,
|
||||||
cnss_pr_dbg("WLFW service is disconnected while sending mode off request.\n");
|
cnss_pr_dbg("WLFW service is disconnected while sending mode off request.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
cnss_pr_err("Failed to send mode request, mode: %d, err = %d\n",
|
cnss_pr_err("Failed to send mode request, mode: %s(%d), err: %d\n",
|
||||||
mode, ret);
|
cnss_qmi_mode_to_str(mode), mode, ret);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
|
if (resp.resp.result != QMI_RESULT_SUCCESS_V01) {
|
||||||
cnss_pr_err("Mode request failed, mode: %d, result: %d err: %d\n",
|
cnss_pr_err("Mode request failed, mode: %s(%d), result: %d, err: %d\n",
|
||||||
mode, resp.resp.result, resp.resp.error);
|
cnss_qmi_mode_to_str(mode), mode, resp.resp.result,
|
||||||
|
resp.resp.error);
|
||||||
ret = resp.resp.result;
|
ret = resp.resp.result;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue