icnss: Send FW Down indication to WLAN host driver
If FW is down irrespective of crash, a uevent is sent to wlan host driver to indicate FW is down. Change-Id: I9fe2a2a11178f72ea27150d74d93a1e411eac030 CRs-fixed: 2027902 Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org> Signed-off-by: Anurag Chouhan <achouhan@codeaurora.org>
This commit is contained in:
parent
92124c76a2
commit
c1f5dcc5e8
2 changed files with 33 additions and 17 deletions
|
@ -1763,11 +1763,29 @@ static void icnss_qmi_wlfw_clnt_notify(struct qmi_handle *handle,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int icnss_call_driver_uevent(struct icnss_priv *priv,
|
||||||
|
enum icnss_uevent uevent, void *data)
|
||||||
|
{
|
||||||
|
struct icnss_uevent_data uevent_data;
|
||||||
|
|
||||||
|
if (!priv->ops || !priv->ops->uevent)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
icnss_pr_dbg("Calling driver uevent state: 0x%lx, uevent: %d\n",
|
||||||
|
priv->state, uevent);
|
||||||
|
|
||||||
|
uevent_data.uevent = uevent;
|
||||||
|
uevent_data.data = data;
|
||||||
|
|
||||||
|
return priv->ops->uevent(&priv->pdev->dev, &uevent_data);
|
||||||
|
}
|
||||||
|
|
||||||
static void icnss_qmi_wlfw_clnt_ind(struct qmi_handle *handle,
|
static void icnss_qmi_wlfw_clnt_ind(struct qmi_handle *handle,
|
||||||
unsigned int msg_id, void *msg,
|
unsigned int msg_id, void *msg,
|
||||||
unsigned int msg_len, void *ind_cb_priv)
|
unsigned int msg_len, void *ind_cb_priv)
|
||||||
{
|
{
|
||||||
struct icnss_event_pd_service_down_data *event_data;
|
struct icnss_event_pd_service_down_data *event_data;
|
||||||
|
struct icnss_uevent_fw_down_data fw_down_data;
|
||||||
|
|
||||||
if (!penv)
|
if (!penv)
|
||||||
return;
|
return;
|
||||||
|
@ -1799,6 +1817,9 @@ static void icnss_qmi_wlfw_clnt_ind(struct qmi_handle *handle,
|
||||||
return;
|
return;
|
||||||
event_data->crashed = true;
|
event_data->crashed = true;
|
||||||
event_data->fw_rejuvenate = true;
|
event_data->fw_rejuvenate = true;
|
||||||
|
fw_down_data.crashed = true;
|
||||||
|
icnss_call_driver_uevent(penv, ICNSS_UEVENT_FW_DOWN,
|
||||||
|
&fw_down_data);
|
||||||
icnss_driver_event_post(ICNSS_DRIVER_EVENT_PD_SERVICE_DOWN,
|
icnss_driver_event_post(ICNSS_DRIVER_EVENT_PD_SERVICE_DOWN,
|
||||||
0, event_data);
|
0, event_data);
|
||||||
break;
|
break;
|
||||||
|
@ -1912,23 +1933,6 @@ static int icnss_driver_event_server_exit(void *data)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int icnss_call_driver_uevent(struct icnss_priv *priv,
|
|
||||||
enum icnss_uevent uevent, void *data)
|
|
||||||
{
|
|
||||||
struct icnss_uevent_data uevent_data;
|
|
||||||
|
|
||||||
if (!priv->ops || !priv->ops->uevent)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
icnss_pr_dbg("Calling driver uevent state: 0x%lx, uevent: %d\n",
|
|
||||||
priv->state, uevent);
|
|
||||||
|
|
||||||
uevent_data.uevent = uevent;
|
|
||||||
uevent_data.data = data;
|
|
||||||
|
|
||||||
return priv->ops->uevent(&priv->pdev->dev, &uevent_data);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int icnss_call_driver_probe(struct icnss_priv *priv)
|
static int icnss_call_driver_probe(struct icnss_priv *priv)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -2308,6 +2312,7 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb,
|
||||||
struct notif_data *notif = data;
|
struct notif_data *notif = data;
|
||||||
struct icnss_priv *priv = container_of(nb, struct icnss_priv,
|
struct icnss_priv *priv = container_of(nb, struct icnss_priv,
|
||||||
modem_ssr_nb);
|
modem_ssr_nb);
|
||||||
|
struct icnss_uevent_fw_down_data fw_down_data;
|
||||||
|
|
||||||
icnss_pr_dbg("Modem-Notify: event %lu\n", code);
|
icnss_pr_dbg("Modem-Notify: event %lu\n", code);
|
||||||
|
|
||||||
|
@ -2340,6 +2345,9 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb,
|
||||||
if (notif->crashed == CRASH_STATUS_WDOG_BITE)
|
if (notif->crashed == CRASH_STATUS_WDOG_BITE)
|
||||||
event_data->wdog_bite = true;
|
event_data->wdog_bite = true;
|
||||||
|
|
||||||
|
fw_down_data.crashed = !!notif->crashed;
|
||||||
|
icnss_call_driver_uevent(priv, ICNSS_UEVENT_FW_DOWN, &fw_down_data);
|
||||||
|
|
||||||
icnss_driver_event_post(ICNSS_DRIVER_EVENT_PD_SERVICE_DOWN,
|
icnss_driver_event_post(ICNSS_DRIVER_EVENT_PD_SERVICE_DOWN,
|
||||||
ICNSS_EVENT_SYNC, event_data);
|
ICNSS_EVENT_SYNC, event_data);
|
||||||
|
|
||||||
|
@ -2403,6 +2411,7 @@ static int icnss_service_notifier_notify(struct notifier_block *nb,
|
||||||
service_notifier_nb);
|
service_notifier_nb);
|
||||||
enum pd_subsys_state *state = data;
|
enum pd_subsys_state *state = data;
|
||||||
struct icnss_event_pd_service_down_data *event_data;
|
struct icnss_event_pd_service_down_data *event_data;
|
||||||
|
struct icnss_uevent_fw_down_data fw_down_data;
|
||||||
|
|
||||||
icnss_pr_dbg("PD service notification: 0x%lx state: 0x%lx\n",
|
icnss_pr_dbg("PD service notification: 0x%lx state: 0x%lx\n",
|
||||||
notification, priv->state);
|
notification, priv->state);
|
||||||
|
@ -2438,6 +2447,8 @@ static int icnss_service_notifier_notify(struct notifier_block *nb,
|
||||||
event_post:
|
event_post:
|
||||||
icnss_ignore_qmi_timeout(true);
|
icnss_ignore_qmi_timeout(true);
|
||||||
|
|
||||||
|
fw_down_data.crashed = event_data->crashed;
|
||||||
|
icnss_call_driver_uevent(priv, ICNSS_UEVENT_FW_DOWN, &fw_down_data);
|
||||||
icnss_driver_event_post(ICNSS_DRIVER_EVENT_PD_SERVICE_DOWN,
|
icnss_driver_event_post(ICNSS_DRIVER_EVENT_PD_SERVICE_DOWN,
|
||||||
ICNSS_EVENT_SYNC, event_data);
|
ICNSS_EVENT_SYNC, event_data);
|
||||||
done:
|
done:
|
||||||
|
|
|
@ -20,6 +20,11 @@
|
||||||
enum icnss_uevent {
|
enum icnss_uevent {
|
||||||
ICNSS_UEVENT_FW_READY,
|
ICNSS_UEVENT_FW_READY,
|
||||||
ICNSS_UEVENT_FW_CRASHED,
|
ICNSS_UEVENT_FW_CRASHED,
|
||||||
|
ICNSS_UEVENT_FW_DOWN,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct icnss_uevent_fw_down_data {
|
||||||
|
bool crashed;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct icnss_uevent_data {
|
struct icnss_uevent_data {
|
||||||
|
|
Loading…
Add table
Reference in a new issue