[PATCH v2] wcn36xx: Channel list update before hardware scan

Kalle Valo kvalo at codeaurora.org
Mon Oct 25 11:27:12 PDT 2021


Loic Poulain <loic.poulain at linaro.org> writes:

> The channel scan list must be updated before triggering a hardware scan
> so that firmware takes into account the regulatory info for each single
> channel such as active/passive config, power, DFS, etc... Without this
> the firmware uses its own internal default channel configuration, which
> is not aligned with mac80211 regulatory rules, and misses several
> channels (e.g. 144).
>
> Fixes: 2f3bef4b247e ("wcn36xx: Add hardware scan offload support")
> Signed-off-by: Loic Poulain <loic.poulain at linaro.org>
> ---
>  v2: Use u32_replace_bits() for setting channel update fields
>
>  drivers/net/wireless/ath/wcn36xx/hal.h  | 32 +++++++++++++
>  drivers/net/wireless/ath/wcn36xx/main.c |  1 +
>  drivers/net/wireless/ath/wcn36xx/smd.c  | 82 +++++++++++++++++++++++++++++++++
>  drivers/net/wireless/ath/wcn36xx/smd.h  |  1 +
>  4 files changed, 116 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h b/drivers/net/wireless/ath/wcn36xx/hal.h
> index 5f1f248..9bea2b0 100644
> --- a/drivers/net/wireless/ath/wcn36xx/hal.h
> +++ b/drivers/net/wireless/ath/wcn36xx/hal.h
> @@ -359,6 +359,8 @@ enum wcn36xx_hal_host_msg_type {
>  	WCN36XX_HAL_START_SCAN_OFFLOAD_RSP = 205,
>  	WCN36XX_HAL_STOP_SCAN_OFFLOAD_REQ = 206,
>  	WCN36XX_HAL_STOP_SCAN_OFFLOAD_RSP = 207,
> +	WCN36XX_HAL_UPDATE_CHANNEL_LIST_REQ = 208,
> +	WCN36XX_HAL_UPDATE_CHANNEL_LIST_RSP = 209,
>  	WCN36XX_HAL_SCAN_OFFLOAD_IND = 210,
>  
>  	WCN36XX_HAL_AVOID_FREQ_RANGE_IND = 233,
> @@ -1353,6 +1355,36 @@ struct wcn36xx_hal_stop_scan_offload_rsp_msg {
>  	u32 status;
>  } __packed;
>  
> +#define WCN36XX_HAL_CHAN_REG1_MIN_PWR_MASK  0x000000ff
> +#define WCN36XX_HAL_CHAN_REG1_MAX_PWR_MASK  0x0000ff00
> +#define WCN36XX_HAL_CHAN_REG1_REG_PWR_MASK  0x00ff0000
> +#define WCN36XX_HAL_CHAN_REG1_CLASS_ID_MASK 0xff000000
> +#define WCN36XX_HAL_CHAN_REG2_ANT_GAIN_MASK 0x000000ff

Usually people use GENMASK() but these masks are so simple that I guess
this is fine as well.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



More information about the wcn36xx mailing list