diff --git a/umac/dfs/core/src/dfs.h b/umac/dfs/core/src/dfs.h index 9010afd8ec..d3d3026eb6 100644 --- a/umac/dfs/core/src/dfs.h +++ b/umac/dfs/core/src/dfs.h @@ -714,6 +714,7 @@ struct dfs_filtertype { * @dfs_ch_mhz_freq_seg2: Channel center frequency of secondary segment * in MHZ applicable only for 80+80MHZ mode of * operation. + * @dfs_ch_punc_pattern: Bitmap representing puncturing patterns. */ struct dfs_channel { uint16_t dfs_ch_freq; @@ -724,6 +725,16 @@ struct dfs_channel { uint8_t dfs_ch_vhtop_ch_freq_seg2; uint16_t dfs_ch_mhz_freq_seg1; uint16_t dfs_ch_mhz_freq_seg2; +#ifdef WLAN_FEATURE_11BE + /* If the bitmap is all 0 then nothing is punctured. If any bit is 1 + * then corresponding 20MHz sub-channel is puntured. For example, for + * channel 100 (BW 240MHz), it will treated as a 320MHz channel and the + * bit-map will be b1111_0000_0000_0000 (where the most significant bit + * indicates the rightmost sub20channel and the least significant bit + * indicates the leftmost sub20channel). + */ + uint16_t dfs_ch_punc_pattern; +#endif }; /** @@ -2584,6 +2595,7 @@ static inline bool dfs_is_en302_502_applicable(struct wlan_dfs *dfs) * @dfs_chan_mhz_freq_seg1: Channel center frequency of primary segment in MHZ. * @dfs_chan_mhz_freq_seg2: Channel center frequency of secondary segment in MHZ * applicable only for 80+80MHZ mode of operation. + * @dfs_chan_op_puncture_bitmap: Static channel puncturing of current channel. * @is_channel_updated: boolean to represent channel update. */ void dfs_set_current_channel_for_freq(struct wlan_dfs *dfs, @@ -2595,8 +2607,8 @@ void dfs_set_current_channel_for_freq(struct wlan_dfs *dfs, uint8_t dfs_chan_vhtop_freq_seg2, uint16_t dfs_chan_mhz_freq_seg1, uint16_t dfs_chan_mhz_freq_seg2, + uint16_t dfs_chan_op_puncture_bitmap, bool *is_channel_updated); - #endif /** * dfs_get_nol_chfreq_and_chwidth() - Get channel freq and width from NOL list. diff --git a/umac/dfs/core/src/misc/dfs.c b/umac/dfs/core/src/misc/dfs.c index debff513ae..36533c16e9 100644 --- a/umac/dfs/core/src/misc/dfs.c +++ b/umac/dfs/core/src/misc/dfs.c @@ -678,6 +678,21 @@ bad: return error; } +#ifdef WLAN_FEATURE_11BE +static inline bool +dfs_is_chan_punc_same_as_given_punc(struct dfs_channel *dfs_curchan, + uint16_t dfs_chan_punc_pattern) +{ + return (dfs_curchan->dfs_ch_punc_pattern == dfs_chan_punc_pattern); +} +#else +static inline bool +dfs_is_chan_punc_same_as_given_punc(struct dfs_channel *dfs_curchan, + uint16_t dfs_chan_punc_pattern) +{ + return true; +} +#endif /** * dfs_is_curchan_same_as_given_chan() - Find if dfs_curchan has the same * channel parameters provided. @@ -697,7 +712,8 @@ dfs_is_curchan_same_as_given_chan(struct dfs_channel *dfs_curchan, uint64_t dfs_ch_flags, uint16_t dfs_ch_flagext, uint8_t dfs_ch_vhtop_ch_freq_seg1, - uint8_t dfs_ch_vhtop_ch_freq_seg2) + uint8_t dfs_ch_vhtop_ch_freq_seg2, + uint16_t dfs_chan_punc_pattern) { if ((dfs_curchan->dfs_ch_freq == dfs_ch_freq) && (dfs_curchan->dfs_ch_flags == dfs_ch_flags) && @@ -705,12 +721,29 @@ dfs_is_curchan_same_as_given_chan(struct dfs_channel *dfs_curchan, (dfs_curchan->dfs_ch_vhtop_ch_freq_seg1 == dfs_ch_vhtop_ch_freq_seg1) && (dfs_curchan->dfs_ch_vhtop_ch_freq_seg2 == - dfs_ch_vhtop_ch_freq_seg2)) + dfs_ch_vhtop_ch_freq_seg2) && + (dfs_is_chan_punc_same_as_given_punc(dfs_curchan, + dfs_chan_punc_pattern))) return true; return false; } +#ifdef WLAN_FEATURE_11BE +static inline void +dfs_set_cur_chan_punc_pattern(struct wlan_dfs *dfs, + uint16_t dfs_ch_punc_pattern) +{ + dfs->dfs_curchan->dfs_ch_punc_pattern = dfs_ch_punc_pattern; +} +#else +static inline void +dfs_set_cur_chan_punc_pattern(struct wlan_dfs *dfs, + uint16_t dfs_ch_punc_pattern) +{ +} +#endif + #ifdef CONFIG_CHAN_FREQ_API void dfs_set_current_channel_for_freq(struct wlan_dfs *dfs, uint16_t dfs_chan_freq, @@ -721,6 +754,7 @@ void dfs_set_current_channel_for_freq(struct wlan_dfs *dfs, uint8_t dfs_chan_vhtop_freq_seg2, uint16_t dfs_chan_mhz_freq_seg1, uint16_t dfs_chan_mhz_freq_seg2, + uint16_t dfs_ch_punc_pattern, bool *is_channel_updated) { if (is_channel_updated) @@ -737,7 +771,8 @@ void dfs_set_current_channel_for_freq(struct wlan_dfs *dfs, dfs_chan_flags, dfs_chan_flagext, dfs_chan_vhtop_freq_seg1, - dfs_chan_vhtop_freq_seg2)) { + dfs_chan_vhtop_freq_seg2, + dfs_ch_punc_pattern)) { dfs_info(dfs, WLAN_DEBUG_DFS_ALWAYS, "dfs_curchan already updated"); return; @@ -757,6 +792,7 @@ void dfs_set_current_channel_for_freq(struct wlan_dfs *dfs, dfs->dfs_curchan->dfs_ch_vhtop_ch_freq_seg2 = dfs_chan_vhtop_freq_seg2; dfs->dfs_curchan->dfs_ch_mhz_freq_seg1 = dfs_chan_mhz_freq_seg1; dfs->dfs_curchan->dfs_ch_mhz_freq_seg2 = dfs_chan_mhz_freq_seg2; + dfs_set_cur_chan_punc_pattern(dfs, dfs_ch_punc_pattern); if (is_channel_updated) *is_channel_updated = true; diff --git a/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h b/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h index 63b127f85d..f702df39b0 100644 --- a/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h +++ b/umac/dfs/dispatcher/inc/wlan_dfs_tgt_api.h @@ -134,6 +134,8 @@ extern struct dfs_to_mlme global_dfs_to_mlme; * @dfs_ch_mhz_freq_seg1: Channel center frequency of primary segment in MHZ. * @dfs_ch_mhz_freq_seg2: Channel center frequency of secondary segment in MHZ * applicable only for 80+80MHZ mode of operation. + * @dfs_ch_op_puncturing: Puncturing pattern followed in current operating + * channel. * @is_channel_updated: Boolean to represent channel update. */ #ifdef CONFIG_CHAN_FREQ_API @@ -147,6 +149,7 @@ tgt_dfs_set_current_channel_for_freq(struct wlan_objmgr_pdev *pdev, uint8_t dfs_ch_vhtop_ch_freq_seg2, uint16_t dfs_ch_mhz_freq_seg1, uint16_t dfs_ch_mhz_freq_seg2, + uint16_t dfs_ch_op_puncturing, bool *is_channel_updated); #endif diff --git a/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c b/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c index fc1e2a2c98..37d6e4af91 100644 --- a/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c +++ b/umac/dfs/dispatcher/src/wlan_dfs_tgt_api.c @@ -101,6 +101,7 @@ tgt_dfs_set_current_channel_for_freq(struct wlan_objmgr_pdev *pdev, uint8_t dfs_chan_vhtop_freq_seg2, uint16_t dfs_chan_mhz_freq_seg1, uint16_t dfs_chan_mhz_freq_seg2, + uint16_t dfs_chan_punc_pattern, bool *is_channel_updated) { struct wlan_dfs *dfs; @@ -123,6 +124,7 @@ tgt_dfs_set_current_channel_for_freq(struct wlan_objmgr_pdev *pdev, dfs_chan_vhtop_freq_seg2, dfs_chan_mhz_freq_seg1, dfs_chan_mhz_freq_seg2, + dfs_chan_punc_pattern, is_channel_updated); return QDF_STATUS_SUCCESS; diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index cc720bfebf..253bf2bccc 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -1842,6 +1842,7 @@ struct wlan_lmac_if_dfs_rx_ops { uint8_t ic_vhtop_ch_freq_seg2, uint16_t dfs_ch_mhz_freq_seg1, uint16_t dfs_ch_mhz_freq_seg2, + uint16_t dfs_ch_punc_pattern, bool *is_channel_updated); #endif #ifdef DFS_COMPONENT_ENABLE diff --git a/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c b/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c index 5d21ab1fea..f24314ac61 100644 --- a/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c +++ b/umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c @@ -126,6 +126,13 @@ vdev_mgr_start_param_update_11be(struct vdev_mlme_obj *mlme_obj, param->eht_ops = mlme_obj->proto.eht_ops_info.eht_ops; param->channel.puncture_pattern = des_chan->puncture_bitmap; } + +static inline void +vdev_mgr_set_cur_chan_punc_pattern(struct wlan_channel *des_chan, + uint16_t *puncture_bitmap) +{ + *puncture_bitmap = des_chan->puncture_bitmap; +} #else static void vdev_mgr_start_param_update_11be(struct vdev_mlme_obj *mlme_obj, @@ -133,6 +140,13 @@ vdev_mgr_start_param_update_11be(struct vdev_mlme_obj *mlme_obj, struct wlan_channel *des_chan) { } + +static inline void +vdev_mgr_set_cur_chan_punc_pattern(struct wlan_channel *des_chan, + uint16_t *puncture_bitmap) +{ + *puncture_bitmap = 0; +} #endif static QDF_STATUS vdev_mgr_start_param_update( @@ -147,6 +161,7 @@ static QDF_STATUS vdev_mgr_start_param_update( enum QDF_OPMODE op_mode; bool is_dfs_chan_updated = false; struct vdev_mlme_mbss_11ax *mbss; + uint16_t puncture_bitmap; vdev = mlme_obj->vdev; if (!vdev) { @@ -172,6 +187,7 @@ static QDF_STATUS vdev_mgr_start_param_update( op_mode = wlan_vdev_mlme_get_opmode(vdev); if (vdev_mgr_is_opmode_sap_or_p2p_go(op_mode) && vdev_mgr_is_49G_5G_chan_freq(des_chan->ch_freq)) { + vdev_mgr_set_cur_chan_punc_pattern(des_chan, &puncture_bitmap); tgt_dfs_set_current_channel_for_freq(pdev, des_chan->ch_freq, des_chan->ch_flags, des_chan->ch_flagext, @@ -180,6 +196,7 @@ static QDF_STATUS vdev_mgr_start_param_update( des_chan->ch_freq_seg2, des_chan->ch_cfreq1, des_chan->ch_cfreq2, + puncture_bitmap, &is_dfs_chan_updated); if (des_chan->ch_cfreq2) param->channel.dfs_set_cfreq2 =