qcacmn: Enhance DCS event handler to support AWGN event

Handle DCS-AWGN event and take actions accordingly:
For STA mode, if the interference locates on primary 20MHz,
disconnect from AP; otherwise, find a max interference free width
and trigger channel change.
For SAP mode, if the interference locates on primary 20MHz,
try to select a random interference free channel and trigger channel
change (stop SAP if no channel is selected); otherwise, find a max
interference free width and trigger channel change.

Change-Id: I33e79f454b459b12ad84f8b0f3259403037464ee
CRs-Fixed: 2958675
这个提交包含在:
Yu Wang
2021-06-01 12:03:35 +08:00
提交者 Madan Koyyalamudi
父节点 61d75799c8
当前提交 98a3fceeb3
修改 9 个文件,包含 806 行新增47 行删除

查看文件

@@ -21,6 +21,20 @@
#ifndef _WLAN_DCS_PUBLIC_STRUCTS_H_
#define _WLAN_DCS_PUBLIC_STRUCTS_H_
/**
* enum wlan_host_dcs_type - types of DCS interference events
* @WLAN_HOST_DCS_NONE: invalid type
* @WLAN_HOST_DCS_CWIM: continuous wave interference
* @WLAN_HOST_DCS_WLANIM: wlan interference stats
* @WLAN_HOST_DCS_AWGNIM: additive white Gaussian noise (awgn) interference
*/
enum wlan_host_dcs_type {
WLAN_HOST_DCS_NONE = 0, /* 0x0 */
WLAN_HOST_DCS_CWIM = BIT(0), /* 0x1 */
WLAN_HOST_DCS_WLANIM = BIT(1), /* 0x2 */
WLAN_HOST_DCS_AWGNIM = BIT(2), /* 0x4 */
};
/**
* struct wlan_host_dcs_interference_param - dcs interference parameters
* @interference_type: type of DCS interference
@@ -119,4 +133,16 @@ struct wlan_host_dcs_awgn_info {
qdf_freq_t center_freq1;
uint32_t chan_bw_intf_bitmap;
};
/**
* struct wlan_host_dcs_event - define dcs event
* @wlan_stat: wlan interference target statistics
* @dcs_param: dcs event param
* @awgn_info: awgn info
*/
struct wlan_host_dcs_event {
struct wlan_host_dcs_im_tgt_stats wlan_stat;
struct wlan_host_dcs_interference_param dcs_param;
struct wlan_host_dcs_awgn_info awgn_info;
};
#endif

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -25,26 +25,16 @@
#include <wlan_objmgr_cmn.h>
#include <wlan_dcs_public_structs.h>
/**
* struct dcs_stats_event - define dcs stats event
* @wlan_stat: wlan interference target statistics
* @dcs_param: dcs event param
*/
struct dcs_stats_event {
struct wlan_host_dcs_im_tgt_stats wlan_stat;
struct wlan_host_dcs_interference_param dcs_param;
};
/**
* tgt_dcs_process_event(): dcs FW event process
* @psoc: pointer to psoc object
* @event: pointer to dcs stats event
* @event: pointer to dcs event
*
* This function gets called to process dcs FW event
*
* Return: QDF_STATUS
*/
QDF_STATUS tgt_dcs_process_event(struct wlan_objmgr_psoc *psoc,
struct dcs_stats_event *event);
struct wlan_host_dcs_event *event);
#endif /* __WLAN_DCS_TGT_API_H__ */

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -25,16 +25,6 @@
#include <wlan_objmgr_pdev_obj.h>
#include <wlan_dcs_public_structs.h>
/**
* @brief List of DCS capabilities that can be set or unset
* dynamically
* @see UMAC auto channel selection document for details on each feature
*
*/
#define CAP_DCS_CWIM 0x1
#define CAP_DCS_WLANIM 0x2
#define CAP_DCS_MASK (CAP_DCS_CWIM | CAP_DCS_WLANIM)
/**
* typedef dcs_callback() - DCS callback
* @psoc: Pointer to psoc
@@ -48,6 +38,16 @@ typedef void (*dcs_callback)(
uint8_t interference_type,
void *arg);
/**
* typedef dcs_switch_chan_cb() - DCS callback for switching channel
* @vdev: Pointer to vdev
* @tgt_freq: target channel frequency
* @tgt_width: target channel width
*/
typedef QDF_STATUS (*dcs_switch_chan_cb)(struct wlan_objmgr_vdev *vdev,
qdf_freq_t tgt_freq,
enum phy_ch_width tgt_width);
#ifdef DCS_INTERFERENCE_DETECTION
/**
* ucfg_dcs_register_cb() - API to register dcs callback
@@ -79,6 +79,16 @@ void ucfg_dcs_register_user_cb(struct wlan_objmgr_psoc *psoc,
struct wlan_host_dcs_im_user_stats *stats,
int status));
/**
* ucfg_dcs_register_awgn_cb() - API to register dcs awgn callback
* @psoc: pointer to psoc object
* @cb: dcs switch channel callback to be registered
*
* Return: QDF_STATUS
*/
QDF_STATUS ucfg_dcs_register_awgn_cb(struct wlan_objmgr_psoc *psoc,
dcs_switch_chan_cb cb);
/**
* ucfg_wlan_dcs_cmd(): API to send dcs command
* @psoc: pointer to psoc object
@@ -98,7 +108,7 @@ ucfg_wlan_dcs_cmd(struct wlan_objmgr_psoc *psoc,
* ucfg_config_dcs_enable() - API to config dcs enable
* @psoc: pointer to psoc object
* @mac_id: mac id
* @interference_type: CAP_DCS_CWIM, CAP_DCS_WLANIM, CAP_DCS_MASK
* @interference_type: type mask(WLAN_HOST_DCS_CWIM / WLAN_HOST_DCS_WLANIM)
*
* This function gets called to config dcs enable
*
@@ -112,7 +122,7 @@ void ucfg_config_dcs_enable(struct wlan_objmgr_psoc *psoc,
* ucfg_config_dcs_disable() - API to config dcs disable
* @psoc: pointer to psoc object
* @mac_id: mac id
* @interference_type: CAP_DCS_CWIM, CAP_DCS_WLANIM, CAP_DCS_MASK
* @interference_type: type mask(WLAN_HOST_DCS_CWIM / WLAN_HOST_DCS_WLANIM)
*
* This function gets called to config dcs disable
*