Skip to content

Commit

Permalink
cnss: Add Set/Get DFS NOL APIs
Browse files Browse the repository at this point in the history
According to 802.11h spec, once the radar detection is done, AP
shouldn't try to use the No Occupancy List (NOL). Since WLAN
driver is a module, there is no way for WLAN driver to store the
DFS NOL info. So adding Set and Get APIs so that DFS NOL info is
stored in CNSS driver before unloading WLAN driver and info is
queried back once the driver is brought-up again.

CRs-fixed: 661350
Change-Id: I9b99df7c351a45593a3febbbdda731771475b6d4
Signed-off-by: Prashanth Bhatta <bhattap@codeaurora.org>
Signed-off-by: Sunghun Ra <sktjdgns1189@naver.com>
  • Loading branch information
Prashanth Bhatta authored and javilonas committed May 14, 2015
1 parent 38731cc commit ca13770
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
50 changes: 50 additions & 0 deletions drivers/net/wireless/cnss/cnss.c
Expand Up @@ -124,6 +124,8 @@ static struct cnss_data {
struct wakeup_source ws;
uint32_t recovery_count;
enum cnss_driver_status driver_status;
void *dfs_nol_info;
u16 dfs_nol_info_len;
#ifdef CONFIG_CNSS_SECURE_FW
void *fw_mem;
#endif
Expand Down Expand Up @@ -992,6 +994,52 @@ int cnss_get_wlan_unsafe_channel(u16 *unsafe_ch_list,
}
EXPORT_SYMBOL(cnss_get_wlan_unsafe_channel);

int cnss_wlan_set_dfs_nol(void *info, u16 info_len)
{
void *temp;

if (!penv)
return -ENODEV;

if (!info || !info_len)
return -EINVAL;

temp = kmalloc(info_len, GFP_KERNEL);
if (!temp)
return -ENOMEM;

memcpy(temp, info, info_len);

kfree(penv->dfs_nol_info);

penv->dfs_nol_info = temp;
penv->dfs_nol_info_len = info_len;

return 0;
}
EXPORT_SYMBOL(cnss_wlan_set_dfs_nol);

int cnss_wlan_get_dfs_nol(void *info, u16 info_len)
{
int len;

if (!penv)
return -ENODEV;

if (!info || !info_len)
return -EINVAL;

if (penv->dfs_nol_info == NULL || penv->dfs_nol_info_len == 0)
return -ENOENT;

len = min(info_len, penv->dfs_nol_info_len);

memcpy(info, penv->dfs_nol_info, len);

return len;
}
EXPORT_SYMBOL(cnss_wlan_get_dfs_nol);

void cnss_pm_wake_lock_init(struct wakeup_source *ws, const char *name)
{
wakeup_source_init(ws, name);
Expand Down Expand Up @@ -1523,6 +1571,8 @@ static int cnss_remove(struct platform_device *pdev)

cnss_pm_wake_lock_destroy(&penv->ws);

kfree(penv->dfs_nol_info);

cnss_wlan_gpio_set(gpio_info, WLAN_EN_LOW);
if (cnss_wlan_vreg_set(vreg_info, VREG_OFF))
pr_err("Failed to turn OFF wlan vreg\n");
Expand Down
2 changes: 2 additions & 0 deletions include/net/cnss.h
Expand Up @@ -78,6 +78,8 @@ extern int cnss_get_ramdump_mem(unsigned long *address, unsigned long *size);
extern int cnss_set_wlan_unsafe_channel(u16 *unsafe_ch_list, u16 ch_count);
extern int cnss_get_wlan_unsafe_channel(u16 *unsafe_ch_list,
u16 *ch_count, u16 buf_len);
extern int cnss_wlan_set_dfs_nol(void *info, u16 info_len);
extern int cnss_wlan_get_dfs_nol(void *info, u16 info_len);
extern void cnss_schedule_recovery_work(void);
extern void cnss_wlan_pci_link_down(void);
extern int cnss_pcie_shadow_control(struct pci_dev *dev, bool enable);
Expand Down

0 comments on commit ca13770

Please sign in to comment.