Net: CNSS_SDIO: Add cnss_get_restart_level CNSS API

export cnss_get_restart_level cnss API for wlan driver
to get current subsystem restart level.

Change-Id: I7e5d9b0055707bbad06b6cd1496723da6c28d4d5
CRs-Fixed: 961579
Signed-off-by: Liangwei Dong <liangwei@codeaurora.org>
This commit is contained in:
Liangwei Dong 2016-01-14 02:37:32 -05:00 committed by Gerrit - the friendly Code Review server
parent 25c596c5cd
commit 1e50b7f02a
2 changed files with 40 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -556,6 +556,37 @@ void cnss_device_crashed(void)
}
EXPORT_SYMBOL(cnss_device_crashed);
/**
* cnss_get_restart_level() - cnss get restart level API
*
* Wlan sdio function driver uses this API to get the current
* subsystem restart level.
*
* Return: CNSS_RESET_SOC - "SYSTEM", restart system
* CNSS_RESET_SUBSYS_COUPLED - "RELATED",restart subsystem
*/
int cnss_get_restart_level(void)
{
struct cnss_ssr_info *ssr_info;
int level;
if (!cnss_pdata)
return CNSS_RESET_SOC;
ssr_info = &cnss_pdata->ssr_info;
if (!ssr_info->subsys)
return CNSS_RESET_SOC;
level = subsys_get_restart_level(ssr_info->subsys);
switch (level) {
case RESET_SOC:
return CNSS_RESET_SOC;
case RESET_SUBSYS_COUPLED:
return CNSS_RESET_SUBSYS_COUPLED;
default:
return CNSS_RESET_SOC;
}
}
EXPORT_SYMBOL(cnss_get_restart_level);
static int cnss_sdio_wlan_inserted(
struct sdio_func *func,
const struct sdio_device_id *id)

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -189,6 +189,13 @@ extern int cnss_get_ramdump_mem(unsigned long *address, unsigned long *size);
extern void *cnss_get_virt_ramdump_mem(unsigned long *size);
extern void cnss_schedule_recovery_work(void);
enum {
CNSS_RESET_SOC = 0,
CNSS_RESET_SUBSYS_COUPLED,
CNSS_RESET_LEVEL_MAX
};
extern int cnss_get_restart_level(void);
#ifdef CONFIG_CNSS_SDIO
struct cnss_sdio_wlan_driver {
const char *name;