ath11k: Fix vdev start failure when operating in CN, KR regdomain
PATCH 1/1 ath11k: Fix vdev start failure when operating in CN, KR regdomain
Currently, firmware expects the correct regdomain to be set in vdev start command. As firmware supports regulatory offload, it can track the current regdomain. This info is received from firmware via REG_CHAN_LIST_CC event during bringup or after setting country code. Currently the dfs_region received is mapped to nl80211_dfs_regions and stored in default_regd or new_regd and is used for vdev start. But since nl80211_dfs_regions doesn't have a value enumerated for CN KR, the firmware rejects VDEV start with an 'invalid regdomain' error. Hence, send the appropriate regdomain received from firmware during REG_CHAN_LIST_CC event in vdev start to avoid vdev start failure.
--- drivers/net/wireless/ath/ath11k/core.h | 13 +++++++++++++ drivers/net/wireless/ath/ath11k/mac.c | 10 +--------- drivers/net/wireless/ath/ath11k/wmi.c | 3 +++ drivers/net/wireless/ath/ath11k/wmi.h | 1 + 4 files changed, 18 insertions(+), 9 deletions(-)
drivers/net/wireless/ath/ath11k/core.h +13 -0
@@ -302,6 +302,16 @@ enum ath11k_stats_type { ATH11K_STATS_TYPE_MAX, }; +enum ath11k_dfs_region { +ATH11K_DFS_REG_UNSET , +ATH11K_DFS_REG_FCC , +ATH11K_DFS_REG_ETSI , +ATH11K_DFS_REG_MKK , +ATH11K_DFS_REG_CN , +ATH11K_DFS_REG_KR , +ATH11K_DFS_REG_UNDEF , +}; +struct ath11k_htt_data_stats {u64 legacy[ATH11K_COUNTER_TYPE_MAX ][ATH11K_LEGACY_NUM ];u64 ht[ATH11K_COUNTER_TYPE_MAX ][ATH11K_HT_MCS_NUM ];
@@ -622,6 +632,9 @@ struct ath11k_base {* This may or may not be used during the runtime */ struct ieee80211_regdomain *new_regd[MAX_RADIOS ]; + +/* Current DFS Regulatory */ +enum ath11k_dfs_region dfs_region;#ifdef CONFIG_ATH11K_DEBUGFS struct dentry *debugfs_soc;#endif
drivers/net/wireless/ath/ath11k/mac.c +1 -9
@@ -3915,15 +3915,7 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, arg.channel.passive = arg.channel.chan_radar;spin_lock_bh (&ab->data_lock); - -/* Use the new reg info if available */ -if (ar->ab->new_regd[ar->pdev_idx]) - arg.regdomain = - ar->ab->new_regd[ar->pdev_idx]->dfs_region; -else - arg.regdomain = - ar->ab->default_regd[ar->pdev_idx]->dfs_region; - + arg.regdomain = ar->ab->dfs_region;spin_unlock_bh (&ab->data_lock);/* TODO: Notify if secondary 80Mhz also needs radar detection */
drivers/net/wireless/ath/ath11k/wmi.c +3 -0
@@ -4645,6 +4645,7 @@ static int ath11k_reg_chan_list_event(struct ath11k_base *ab, u8 *evt_buf, u32 l/* This regd would be applied during mac registration */ ab->default_regd[pdev_idx] = regd; } + ab->dfs_region = reg_info->dfs_region;spin_unlock (&ab->data_lock); goto mem_free;
@@ -4748,6 +4749,8 @@ static inline const char *ath11k_wmi_vdev_resp_print(u32 vdev_resp_status)return "not supported" ;case WMI_VDEV_START_RESPONSE_DFS_VIOLATION :return "dfs violation" ; +case WMI_VDEV_START_RESPONSE_INVALID_REGDOMAIN : +return "invalid regdomain" ;default :return "unknown" ; }
drivers/net/wireless/ath/ath11k/wmi.h +1 -0
@@ -4221,6 +4221,7 @@ enum wmi_vdev_start_resp_status_code {WMI_VDEV_START_RESPONSE_INVALID_VDEVID =1 ,WMI_VDEV_START_RESPONSE_NOT_SUPPORTED =2 ,WMI_VDEV_START_RESPONSE_DFS_VIOLATION =3 , + WMI_VDEV_START_RESPONSE_INVALID_REGDOMAIN = 4, }; ;
Signature · 7 lines
2.7.4 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Quoted 11 lines · Sriram R
Currently, firmware expects the correct regdomain to be set in vdev start command. As firmware supports regulatory offload, it can track the current regdomain. This info is received from firmware via
REG_CHAN_LIST_CCevent during bringup or after setting country code. Currently thedfs_regionreceived is mapped tonl80211_dfs_regionsand stored indefault_regdornew_regdand is used for vdev start. But sincenl80211_dfs_regionsdoesn't have a value enumerated for CN KR, the firmware rejects VDEV start with an 'invalid regdomain' error. Hence, send the appropriate regdomain received from firmware duringREG_CHAN_LIST_CCevent in vdev start to avoid vdev start failure.
Quoted 1 line
Signed-off-by Sriram R <[email protected]>
Patch applied to ath.git, thanks.
b0d742f32bc3 ath11k: Fix vdev start failure when operating in CN, KR regdomain
Signature · 9 lines
https://patchwork.kernel.org/patch/10972787/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Quoted 13 lines · Kalle Valo
Quoted 11 lines · Sriram R
Currently, firmware expects the correct regdomain to be set in vdev start command. As firmware supports regulatory offload, it can track the current regdomain. This info is received from firmware via
REG_CHAN_LIST_CCevent during bringup or after setting country code. Currently thedfs_regionreceived is mapped tonl80211_dfs_regionsand stored indefault_regdornew_regdand is used for vdev start. But sincenl80211_dfs_regionsdoesn't have a value enumerated for CN KR, the firmware rejects VDEV start with an 'invalid regdomain' error. Hence, send the appropriate regdomain received from firmware duringREG_CHAN_LIST_CCevent in vdev start to avoid vdev start failure.
Quoted 5 lines
Quoted 1 line
Signed-off-by Sriram R <[email protected]>Patch applied to ath.git, thanks.
b0d742f32bc3ath11k: Fix vdev start failure when operating in CN, KR regdomain
This added a new warning:
drivers/net/wireless/ath/ath11k/wmi.c:4655:34: warning: mixing different enum typesdrivers/net/wireless/ath/ath11k/wmi.c:4655:34: unsigned int enum dfs_reg versusdrivers/net/wireless/ath/ath11k/wmi.c:4655:34: unsigned int enum ath11k_dfs_region
Please send a followup patch to fix that.
Signature · 6 lines
Kalle Valo _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Quoted 23 lines · Kalle Valo
Quoted 13 lines · Kalle Valo
Quoted 11 lines · Sriram R
Currently, firmware expects the correct regdomain to be set in vdev start command. As firmware supports regulatory offload, it can track the current regdomain. This info is received from firmware via
REG_CHAN_LIST_CCevent during bringup or after setting country code. Currently thedfs_regionreceived is mapped tonl80211_dfs_regionsand stored indefault_regdornew_regdand is used for vdev start. But sincenl80211_dfs_regionsdoesn't have a value enumerated for CN KR, the firmware rejects VDEV start with an 'invalid regdomain' error. Hence, send the appropriate regdomain received from firmware duringREG_CHAN_LIST_CCevent in vdev start to avoid vdev start failure.Quoted 5 lines
Quoted 1 line
Signed-off-by Sriram R <[email protected]>Patch applied to ath.git, thanks.
b0d742f32bc3ath11k: Fix vdev start failure when operating in CN, KR regdomainThis added a new warning:
Quoted 8 lines
drivers/net/wireless/ath/ath11k/wmi.c:4655:34: warning: mixing different enum typesdrivers/net/wireless/ath/ath11k/wmi.c:4655:34: unsigned int enumdfs_regversusdrivers/net/wireless/ath/ath11k/wmi.c:4655:34: unsigned int enumath11k_dfs_regionPlease send a followup patch to fix that.
Sure Kalle. These warnings got subsided during my compilation and they look valid. I'll send a followup patch.
Regards,
Sriram.R
_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k