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

Commit d44432ad authored by Amar Singhal's avatar Amar Singhal
Browse files

icnss: Add APIs to store driver load count



The host wlan driver needs to know if the drive has been
reloaded and wiphy re-registered with the kernel.
Therefore add APIs to retrieve this information.

CRs-Fixed: 2058292
Change-Id: Ia323e31e9b6779e2f5279f42b6e1860a9259a189
Signed-off-by: default avatarAmar Singhal <asinghal@codeaurora.org>
parent ffd90498
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -12,11 +12,13 @@

#include <linux/module.h>
#include <linux/slab.h>
#include <soc/qcom/icnss.h>

#define ICNSS_MAX_CH_NUM 45

static DEFINE_MUTEX(unsafe_channel_list_lock);
static DEFINE_SPINLOCK(dfs_nol_info_lock);
static int driver_load_cnt;

static struct icnss_unsafe_channel_list {
	u16 unsafe_ch_count;
@@ -124,3 +126,15 @@ int icnss_wlan_get_dfs_nol(void *info, u16 info_len)
	return len;
}
EXPORT_SYMBOL(icnss_wlan_get_dfs_nol);

void icnss_increment_driver_load_cnt(void)
{
	++driver_load_cnt;
}
EXPORT_SYMBOL(icnss_increment_driver_load_cnt);

int icnss_get_driver_load_cnt(void)
{
	return driver_load_cnt;
}
EXPORT_SYMBOL(icnss_get_driver_load_cnt);
+2 −1
Original line number Diff line number Diff line
@@ -144,5 +144,6 @@ extern bool icnss_is_fw_ready(void);
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 int icnss_get_driver_load_cnt(void);
extern void icnss_increment_driver_load_cnt(void);
#endif /* _ICNSS_WLAN_H_ */