From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Marek Puzyniak <marek.puzyniak@tieto.com>
Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org
Subject: Re: [PATCH] ath10k: update regulatory domain settings for 10.x firmware
Date: Fri, 21 Mar 2014 17:10:42 +0200 [thread overview]
Message-ID: <878us3bn9p.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1394797261-9219-1-git-send-email-marek.puzyniak@tieto.com> (Marek Puzyniak's message of "Fri, 14 Mar 2014 12:41:01 +0100")
Marek Puzyniak <marek.puzyniak@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@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
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
next prev parent reply other threads:[~2014-03-21 15:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 11:41 [PATCH] ath10k: update regulatory domain settings for 10.x firmware Marek Puzyniak
2014-03-21 15:10 ` Kalle Valo [this message]
2014-03-24 8:07 ` Marek Puzyniak
2014-03-24 8:26 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878us3bn9p.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=ath10k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=marek.puzyniak@tieto.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox