ath10k: program FW with appropriate regdomain
PATCH 1/1 ath10k: program FW with appropriate regdomain
We already setup scan channel list upon regdomain update but we should also setup the regpair to the FW.
Signed-off-by Michal Kazior <[email protected]>
--- drivers/net/wireless/ath/ath10k/mac.c | 13 +++++++++++++ drivers/net/wireless/ath/ath10k/wmi.c | 18 ++++++++++-------- drivers/net/wireless/ath/ath10k/wmi.h | 3 ++- 3 files changed, 25 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath10k/mac.c +13 -0
@@ -1249,6 +1249,7 @@ static void ath10k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) {struct ieee80211_hw *hw =wiphy_to_ieee80211_hw (wiphy); +struct reg_dmn_pair_mapping *regpair;struct ath10k *ar = hw->priv;int ret;
@@ -1257,6 +1258,18 @@ static void ath10k_reg_notifier(struct wiphy *wiphy, ret =ath10k_update_channel_list (ar);if (ret)ath10k_warn ("could not update channel list (%d)\n" , ret); + + regpair = ar->ath_common.regulatory.regpair; +/* Target allows setting up per-band regdomain but ath_common provides +* a combined one only */ + ret =ath10k_wmi_pdev_set_regdomain (ar, + regpair->regDmnEnum, + regpair->regDmnEnum,/* 2ghz */ + regpair->regDmnEnum,/* 5ghz */ + regpair->reg_2ghz_ctl, + regpair->reg_5ghz_ctl); +if (ret) +ath10k_warn ("could not set pdev regdomain (%d)\n" , ret); }/***************/
drivers/net/wireless/ath/ath10k/wmi.c +10 -8
@@ -1132,7 +1132,8 @@ int ath10k_wmi_connect_htc_service(struct ath10k *ar)return 0 ; } -int ath10k_wmi_pdev_set_regdomain (struct ath10k *ar) +int ath10k_wmi_pdev_set_regdomain (struct ath10k *ar,u16 rd,u16 rd2g, +u16 rd5g,u16 ctl2g,u16 ctl5g) {struct wmi_pdev_set_regdomain_cmd *cmd;struct sk_buff *skb;
@@ -1142,14 +1143,15 @@ int ath10k_wmi_pdev_set_regdomain(struct ath10k *ar)return -ENOMEM ; cmd = (struct wmi_pdev_set_regdomain_cmd *)skb->data; + cmd->reg_domain =__cpu_to_le32 (rd); + cmd->reg_domain_2G =__cpu_to_le32 (rd2g); + cmd->reg_domain_5G =__cpu_to_le32 (rd5g); + cmd->conformance_test_limit_2G =__cpu_to_le32 (ctl2g); + cmd->conformance_test_limit_5G =__cpu_to_le32 (ctl5g); -/* FIXME: do not use hardcoded values */ -/* TODO: provide correct values for reg domain */ - cmd->reg_domain =__cpu_to_le32 (0x3a );/* FCC3_FCCA */ - cmd->reg_domain_2G =__cpu_to_le32 (0x0a10 );/* FCCA */ - cmd->reg_domain_5G =__cpu_to_le32 (0x160 );/* FCC3 */ - cmd->conformance_test_limit_2G =__cpu_to_le32 (0x12 );/* FCC4-FCCA */ - cmd->conformance_test_limit_5G =__cpu_to_le32 (0x10 );/* FCC1-FCCA */ +ath10k_dbg (ATH10K_DBG_WMI , +"wmi pdev regdomain rd %x rd2g %x rd5g %x ctl2g %x ctl5g %x\n" , + rd, rd2g, rd5g, ctl2g, ctl5g);return ath10k_wmi_cmd_send (ar, skb,WMI_PDEV_SET_REGDOMAIN_CMDID ); }
drivers/net/wireless/ath/ath10k/wmi.h +2 -1
@@ -2958,7 +2958,8 @@ int ath10k_wmi_pdev_set_channel(struct ath10k *ar, const struct wmi_channel_arg *); int ath10k_wmi_pdev_suspend_target(struct ath10k *ar);int ath10k_wmi_pdev_resume_target (struct ath10k *ar); -int ath10k_wmi_pdev_set_regdomain (struct ath10k *ar); +int ath10k_wmi_pdev_set_regdomain (struct ath10k *ar,u16 rd,u16 rd2g, +u16 rd5g,u16 ctl2g,u16 ctl5g);int ath10k_wmi_pdev_set_param (struct ath10k *ar,enum wmi_pdev_param id,u32 value);int ath10k_wmi_cmd_init (struct ath10k *ar);
Signature · 1 line
1.7.9.5
Kalle Valo
AppliedPATCH 1/1 ath10k: program FW with appropriate regdomain
Quoted 5 lines · Michal Kazior
We already setup scan channel list upon regdomain update but we should also setup the regpair to the FW.
Signed-off-by Michal Kazior <[email protected]>
Thanks, applied.
There's actually one checkpatch warning:
drivers/net/wireless/ath/ath10k/mac.c:1266: WARNING: Avoid CamelCase: <regpair->regDmnEnum>
But there's not much we can do about that :)
Signature · 1 line
Kalle Valo