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

Commit d8b4f0b2 authored by Mihir Shete's avatar Mihir Shete Committed by Gerrit - the friendly Code Review server
Browse files

wcnss: add API to check if wcnss is undergoing an SSR



Wlan driver should not read registers from wcnss or
try to communicate with the chip when it is undergoing
a subsystem-restart. Added an API with the wcnss platform
driver to check if ssr is in progress, this API will be
used by the wlan driver to protect register access and
other prohibited operations.

Change-Id: Ia0d93e774af126d84dbaabf5c36a2c90fdbd58be
CRs-Fixed: 621974
Signed-off-by: default avatarMihir Shete <smihir@codeaurora.org>
parent 7fbf06d6
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -393,6 +393,7 @@ static struct {
	struct pinctrl_state *gpio_state_active;
	struct pinctrl_state *gpio_state_suspend;
	int use_pinctrl;
	u8 is_shutdown;
} *penv = NULL;

static ssize_t wcnss_wlan_macaddr_store(struct device *dev,
@@ -1163,12 +1164,20 @@ EXPORT_SYMBOL(wcnss_get_wlan_config);

int wcnss_device_ready(void)
{
	if (penv && penv->pdev && penv->nv_downloaded)
	if (penv && penv->pdev && penv->nv_downloaded &&
	    !wcnss_device_is_shutdown())
		return 1;
	return 0;
}
EXPORT_SYMBOL(wcnss_device_ready);

int wcnss_device_is_shutdown(void)
{
	if (penv && penv->is_shutdown)
		return 1;
	return 0;
}
EXPORT_SYMBOL(wcnss_device_is_shutdown);

struct resource *wcnss_wlan_get_memory_map(struct device *dev)
{
@@ -2672,6 +2681,10 @@ static int wcnss_notif_cb(struct notifier_block *this, unsigned long code,
		wcnss_log_debug_regs_on_bite();
	else if (code == SUBSYS_POWERUP_FAILURE)
		wcnss_pronto_log_debug_regs();
	else if (SUBSYS_BEFORE_SHUTDOWN == code)
		penv->is_shutdown = 1;
	else if (SUBSYS_AFTER_POWERUP == code)
		penv->is_shutdown = 0;

	return NOTIFY_DONE;
}
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ void wcnss_resume_notify(void);
void wcnss_riva_log_debug_regs(void);
void wcnss_pronto_log_debug_regs(void);
int wcnss_device_ready(void);
int wcnss_device_is_shutdown(void);
void wcnss_riva_dump_pmic_regs(void);
int wcnss_xo_auto_detect_enabled(void);
u32 wcnss_get_wlan_rx_buff_count(void);