[PATCH] ath10k: update regulatory domain settings for 10.x firmware

Kalle Valo kvalo at qca.qualcomm.com
Fri Mar 21 11:10:42 EDT 2014


Marek Puzyniak <marek.puzyniak at tieto.com> writes:

> Regulatory domain settings for firmware 10.x has more options
> than main firmware, so handle regulatory domain setup separately
> for both supported firmwares. Fill in additional dfs domain
> parameter according to current regulatory.
> This patch does not solve any known bug. Not handled parameter
> for firmware 10.x was found during code review.
>
> Signed-off-by: Marek Puzyniak <marek.puzyniak at tieto.com>

[...]

> @@ -1730,6 +1730,8 @@ static void ath10k_regd_update(struct ath10k *ar)
>  {
>  	struct reg_dmn_pair_mapping *regpair;
>  	int ret;
> +	enum wmi_dfs_region wmi_dfs_reg = WMI_UNINIT_DFS_DOMAIN;
> +	enum nl80211_dfs_regions nl_dfs_reg;
>  
>  	lockdep_assert_held(&ar->conf_mutex);
>  
> @@ -1739,6 +1741,11 @@ static void ath10k_regd_update(struct ath10k *ar)
>  
>  	regpair = ar->ath_common.regulatory.regpair;
>  
> +	if (config_enabled(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) {
> +		nl_dfs_reg = ar->dfs_detector->region;
> +		wmi_dfs_reg = ath10k_wmi_dfs_region_from_nl80211(nl_dfs_reg);
> +	}

I added else branch here, that way can avoid variable initialisation in
the beginning of the function.

> +enum wmi_dfs_region
> +ath10k_wmi_dfs_region_from_nl80211(enum nl80211_dfs_regions dfs_region)
> +{
> +	switch (dfs_region) {
> +	case NL80211_DFS_UNSET:
> +		return WMI_UNINIT_DFS_DOMAIN;
> +	case NL80211_DFS_FCC:
> +		return WMI_FCC_DFS_DOMAIN;
> +	case NL80211_DFS_ETSI:
> +		return WMI_ETSI_DFS_DOMAIN;
> +	case NL80211_DFS_JP:
> +		return WMI_MKK4_DFS_DOMAIN;
> +	}
> +	return WMI_UNINIT_DFS_DOMAIN;
> +}

I don't see why this should be in wmi.c so I moved it to mac.c.

> --- a/drivers/net/wireless/ath/ath10k/wmi.h
> +++ b/drivers/net/wireless/ath/ath10k/wmi.h
> @@ -2185,6 +2185,27 @@ struct wmi_pdev_set_regdomain_cmd {
>  	__le32 conformance_test_limit_5G;
>  } __packed;
>  
> +enum wmi_dfs_region {
> +	/* Uninitialized dfs domain */
> +	WMI_UNINIT_DFS_DOMAIN = 0,
> +	/* FCC3 dfs domain */
> +	WMI_FCC_DFS_DOMAIN = 1,
> +	/* ETSI dfs domain */
> +	WMI_ETSI_DFS_DOMAIN = 2,
> +	/*Japan dfs domain */
> +	WMI_MKK4_DFS_DOMAIN = 3,
> +};
> +
> +struct wmi_pdev_set_regdomain_cmd_10x {
> +	__le32 reg_domain;
> +	__le32 reg_domain_2G;
> +	__le32 reg_domain_5G;
> +	__le32 conformance_test_limit_2G;
> +	__le32 conformance_test_limit_5G;
> +	/* dfs domain from wmi_dfs_region */
> +	__le32 dfs_domain;
> +} __packed;

I added few newlines to these structs.

> @@ -4214,8 +4235,11 @@ int ath10k_wmi_pdev_set_channel(struct ath10k *ar,
>  				const struct wmi_channel_arg *);
>  int ath10k_wmi_pdev_suspend_target(struct ath10k *ar, u32 suspend_opt);
>  int ath10k_wmi_pdev_resume_target(struct ath10k *ar);
> +enum wmi_dfs_region
> +ath10k_wmi_dfs_region_from_nl80211(enum nl80211_dfs_regions dfs_region);

And removed this as the function can be static now.

The modified patch is here, please check my changes:

https://github.com/kvalo/ath/commit/99e45d3191515238d3924704e9203752f47e66d3

-- 
Kalle Valo



More information about the ath10k mailing list