Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b08dd67c authored by Sandeep Singh's avatar Sandeep Singh
Browse files

icnss: Add a flag to indicate PDR



During pdr case wlan host driver is not doing the cleanup of
ipa module. So after sap mode recovery in pdr case
data packets are not going on ipa path even ipa is enabled.
To address this issue send pdr indication to wlan host driver.

Change-Id: Ib0480870d3218da61edb0309725787c0382957ab
Signed-off-by: default avatarSandeep Singh <sandsing@codeaurora.org>
parent f4d62ca1
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -302,6 +302,7 @@ enum icnss_driver_state {
	ICNSS_DRIVER_UNLOADING,
	ICNSS_REJUVENATE,
	ICNSS_BLOCK_SHUTDOWN,
	ICNSS_PDR,
};

struct ce_irq_list {
@@ -495,6 +496,7 @@ static struct icnss_priv {
	u16 line_number;
	char function_name[QMI_WLFW_FUNCTION_NAME_LEN_V01 + 1];
	struct completion unblock_shutdown;
	bool is_ssr;
} *penv;

#ifdef CONFIG_ICNSS_DEBUG
@@ -1217,6 +1219,15 @@ bool icnss_is_rejuvenate(void)
}
EXPORT_SYMBOL(icnss_is_rejuvenate);

bool icnss_is_pdr(void)
{
	if (!penv)
		return false;
	else
		return test_bit(ICNSS_PDR, &penv->state);
}
EXPORT_SYMBOL(icnss_is_pdr);

int icnss_power_off(struct device *dev)
{
	struct icnss_priv *priv = dev_get_drvdata(dev);
@@ -2274,8 +2285,10 @@ static int icnss_pd_restart_complete(struct icnss_priv *priv)

	icnss_call_driver_shutdown(priv);

	clear_bit(ICNSS_REJUVENATE, &penv->state);
	clear_bit(ICNSS_PDR, &priv->state);
	clear_bit(ICNSS_REJUVENATE, &priv->state);
	clear_bit(ICNSS_PD_RESTART, &priv->state);
	priv->is_ssr = false;

	if (!priv->ops || !priv->ops->reinit)
		goto out;
@@ -2609,6 +2622,8 @@ static int icnss_modem_notifier_nb(struct notifier_block *nb,
	if (code != SUBSYS_BEFORE_SHUTDOWN)
		return NOTIFY_OK;

	priv->is_ssr = true;

	if (code == SUBSYS_BEFORE_SHUTDOWN && !notif->crashed &&
	    test_bit(ICNSS_BLOCK_SHUTDOWN, &priv->state)) {
		if (!wait_for_completion_timeout(&priv->unblock_shutdown,
@@ -2730,6 +2745,9 @@ static int icnss_service_notifier_notify(struct notifier_block *nb,
	if (notification != SERVREG_NOTIF_SERVICE_STATE_DOWN_V01)
		goto done;

	if (!priv->is_ssr)
		set_bit(ICNSS_PDR, &priv->state);

	event_data = kzalloc(sizeof(*event_data), GFP_KERNEL);

	if (event_data == NULL)
@@ -4015,6 +4033,9 @@ static int icnss_stats_show_state(struct seq_file *s, struct icnss_priv *priv)
			continue;
		case ICNSS_BLOCK_SHUTDOWN:
			seq_puts(s, "BLOCK SHUTDOWN");
			continue;
		case ICNSS_PDR:
			seq_puts(s, "PDR TRIGGERED");
		}

		seq_printf(s, "UNKNOWN-%d", i);
+1 −0
Original line number Diff line number Diff line
@@ -158,4 +158,5 @@ extern int icnss_set_wlan_mac_address(const u8 *in, const uint32_t len);
extern u8 *icnss_get_wlan_mac_address(struct device *dev, uint32_t *num);
extern int icnss_trigger_recovery(struct device *dev);
extern void icnss_block_shutdown(bool status);
extern bool icnss_is_pdr(void);
#endif /* _ICNSS_WLAN_H_ */