qcacmn: Retrieve DFS channel parameters such as CAC, NOL, state

Add APIs to fetch the DFS channel parameters such as CAC, NOL and the
channel state to the user application.
struct dfs_cacelem is defined to store all the CAC related information
such as cac start time, cac completed time and the cac timeout.
dfs_cacelems is stored for NUM_5GHZ_CHANS in the dfs pdev object.
dfs_handle_cac_events() API is used to handle CAC related events such
as WLAN_EV_CAC_COMPLETED, WLAN_EV_CAC_RESET and radar during CAC.

CRs-Fixed: 3428828
Change-Id: I82f7aafeb20222d9722bed5a1a8c10b5703ac975
Este commit está contenido en:
Priyadarshnee Srinivasan
2023-03-06 22:03:07 +05:30
cometido por Madan Koyyalamudi
padre 3b2a716195
commit 70a7674b32
Se han modificado 6 ficheros con 95 adiciones y 16 borrados

Ver fichero

@@ -186,6 +186,7 @@ struct dfs_agile_cac_params {
* DFS channel.
* @CH_DFS_S_PRECAC_COMPLETED: Indicates that the PreCAC has been completed for
* the DFS channel.
* @CH_DFS_S_NON_DFS: Indicates that it is a non-DFS channel.
*/
enum channel_dfs_state {
CH_DFS_S_INVALID,
@@ -195,5 +196,6 @@ enum channel_dfs_state {
CH_DFS_S_NOL,
CH_DFS_S_PRECAC_STARTED,
CH_DFS_S_PRECAC_COMPLETED,
CH_DFS_S_NON_DFS,
};
#endif

Ver fichero

@@ -81,7 +81,7 @@
/* WLAN 5GHz channel number 170 freq */
#define DFS_CHAN_170_FREQ (5852)
#define IS_CHAN_DFS(_flags) ((_flags) & REGULATORY_CHAN_RADAR)
extern struct dfs_to_mlme global_dfs_to_mlme;
@@ -977,4 +977,16 @@ QDF_STATUS dfs_init_chan_state_array(struct wlan_objmgr_pdev *pdev)
* Return: QDF_STATUS.
*/
QDF_STATUS utils_dfs_radar_enable(struct wlan_objmgr_pdev *pdev);
/**
* utils_dfs_convert_freq_to_index() - Converts a channel frequency
* to the DFS channel state array index. The input frequency should be a 5 GHz
* channel frequency and this check should be done in the caller.
*
* @freq: Input DFS channel frequency.
* @index: Output DFS channel state array index.
*
* Return: None.
*/
void utils_dfs_convert_freq_to_index(qdf_freq_t freq, int8_t *index);
#endif /* _WLAN_DFS_UTILS_API_H_ */

Ver fichero

@@ -1440,17 +1440,8 @@ utils_dfs_precac_status_for_channel(struct wlan_objmgr_pdev *pdev,
#define FIRST_DFS_CHAN_NUM 52
#define CHAN_NUM_SPACING 4
#define INVALID_INDEX (-1)
#define IS_CHAN_DFS(_flags) ((_flags) & REGULATORY_CHAN_RADAR)
/**
* utils_dfs_convert_freq_to_index() - Converts a DFS channel frequency
* to the DFS channel state array index. The input frequency should be a DFS
* channel frequency and this check should be done in the caller.
* @freq: Input DFS channel frequency.
* @index: Output DFS channel state array index.
*
* Return: QDF_STATUS.
*/
static void utils_dfs_convert_freq_to_index(qdf_freq_t freq, int8_t *index)
void utils_dfs_convert_freq_to_index(qdf_freq_t freq, int8_t *index)
{
uint16_t chan_num;
int8_t tmp_index;
@@ -1470,7 +1461,7 @@ static void utils_dfs_convert_freq_to_index(qdf_freq_t freq, int8_t *index)
* @state: Input DFS state with which the value indexed by frequency will be
* updated with.
*
* Return: void.
* Return: QDF_STATUS
*/
static QDF_STATUS
utils_dfs_update_chan_state_array_element(struct wlan_dfs *dfs,
@@ -1478,10 +1469,16 @@ utils_dfs_update_chan_state_array_element(struct wlan_dfs *dfs,
enum channel_dfs_state state)
{
int8_t index;
enum channel_enum chan_enum;
if (state == CH_DFS_S_INVALID)
return QDF_STATUS_E_INVAL;
chan_enum = wlan_reg_get_chan_enum_for_freq(freq);
/* Do not send DFS events on invalid IEEE channels */
if (chan_enum == INVALID_CHANNEL)
return QDF_STATUS_E_INVAL;
utils_dfs_convert_freq_to_index(freq, &index);
if (index == INVALID_INDEX)
@@ -1499,13 +1496,11 @@ QDF_STATUS dfs_init_chan_state_array(struct wlan_objmgr_pdev *pdev)
int i;
dfs = wlan_pdev_get_dfs_obj(pdev);
if (!dfs)
return QDF_STATUS_E_FAILURE;
cur_chan_list = qdf_mem_malloc(NUM_CHANNELS *
sizeof(struct regulatory_channel));
if (!cur_chan_list)
return QDF_STATUS_E_NOMEM;