qcacmn: Enable dynamic puncture for DFS radar

1. Enable sub chan DFS type if QCA_DFS_BW_PUNCTURE defined, or all bonded
operation freq will be affected and disabled for nol, puncture can't work,
always need to switch freq.

2. Find nearest puncture pattern for a bitmap.
For example, SAP started with channel width 320 MHz, if only 20 MHz freq
affected by radar, 320 + 20 puncture pattern is invalid, but puncture
pattern 320 + 40 can be used.

3. Fix build issue when QCA_DFS_BW_PUNCTURE defined as following.
error: incompatible pointer types passing 'qdf_freq_t[16]' (aka
'unsigned int[16]') to parameter of type 'uint16_t *' (aka 'unsigned
short *')

Change-Id: I374ed76c6a13ef5fac1a78073f1b8974b0a9bb30
CRs-Fixed: 3386020
This commit is contained in:
Jianmin Zhu
2023-01-21 13:16:39 +08:00
zatwierdzone przez Madan Koyyalamudi
rodzic b0fa96084a
commit a8fbfe3aae
7 zmienionych plików z 27 dodań i 26 usunięć

Wyświetl plik

@@ -187,6 +187,23 @@ int dfs_create_object(struct wlan_dfs **dfs)
return 0;
}
#if defined(QCA_DFS_BW_PUNCTURE) && defined(CONFIG_REG_CLIENT)
static void dfs_puncture_init(struct wlan_dfs *dfs)
{
/*
* Enable sub chan DFS type if QCA_DFS_BW_PUNCTURE defined, or all
* bonded operation freq will be affected and disabled for nol,
* puncture can't work, always need to switch freq.
*/
dfs_set_nol_subchannel_marking(dfs, true);
dfs->dfs_use_puncture = true;
}
#else
static inline void dfs_puncture_init(struct wlan_dfs *dfs)
{
}
#endif
int dfs_attach(struct wlan_dfs *dfs)
{
int ret;
@@ -217,6 +234,9 @@ int dfs_attach(struct wlan_dfs *dfs)
* and full offload, indicating test mode timer initialization for both.
*/
dfs_main_task_testtimer_init(dfs);
dfs_puncture_init(dfs);
return 0;
}

Wyświetl plik

@@ -960,7 +960,7 @@ uint16_t dfs_generate_radar_bitmap(struct wlan_dfs *dfs,
uint16_t dfs_radar_bitmap = 0x0;
uint16_t bits = 0x1;
uint8_t i, j;
qdf_freq_t cur_freq_list[MAX_20MHZ_SUBCHANS];
uint16_t cur_freq_list[MAX_20MHZ_SUBCHANS] = {0};
n_cur_channels =
dfs_get_bonding_channel_without_seg_info_for_freq(dfs->dfs_curchan,