ath10k:New interface to get interface combinations from FW
PATCH 1/1 ath10k:New interface to get interface combinations from FW
New wmi event "WMI_TLV_IFACE_COMBINATION_EVENTID" is used. If WMI_SERVICE_IFACE_COMBINATION_SUPPORT service bit set and WMI_TLV_IFACE_COMBINATION_EVENTID event got from FW side, then interface combinations reported from FW will override the default combinations which is hard-coded in host drivers.
Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-01061-QCAHLSWMTPL-1
--- drivers/net/wireless/ath/ath10k/core.c | 2 + drivers/net/wireless/ath/ath10k/core.h | 36 +++++ drivers/net/wireless/ath/ath10k/mac.c | 12 ++ drivers/net/wireless/ath/ath10k/wmi-tlv.c | 183 ++++++++++++++++++++++- drivers/net/wireless/ath/ath10k/wmi-tlv.h | 232 ++++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/wmi.h | 2 + 6 files changed, 466 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/core.c +2 -0
@@ -3210,6 +3210,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, ath10k_core_set_coverage_class_work);init_dummy_netdev (&ar->napi_dev); +ath10k_init_iface_comb (ar); ret =ath10k_coredump_create (ar);if (ret)
@@ -3248,6 +3249,7 @@ void ath10k_core_destroy(struct ath10k *ar)ath10k_coredump_destroy (ar);ath10k_htt_tx_destroy (&ar->htt);ath10k_wmi_free_host_mem (ar); +ath10k_deinit_iface_comb (ar);ath10k_mac_destroy (ar); }EXPORT_SYMBOL (ath10k_core_destroy);
drivers/net/wireless/ath/ath10k/core.h +36 -0
@@ -40,6 +40,9 @@#define ATH10K_NUM_CHANS 41#define ATH10K_MAX_5G_CHAN 173 +#define MAX_NUM_IFACE_COMBINATIONS 16 +#define BEACON_TX_OFFLOAD_MAX_VDEV 2 +/* Antenna noise floor */ #define ATH10K_DEFAULT_NOISE_FLOOR -95
@@ -940,6 +943,13 @@ struct ath10k_bus_params {bool hl_msdu_ids; }; +struct ath10k_iface_comb { +struct ieee80211_iface_combination combo[MAX_NUM_IFACE_COMBINATIONS ]; +u16 combo_sz; +u16 interface_modes; +u32 beacon_tx_offload_max_vdev; +}; +struct ath10k {struct ath_common ath_common;struct ieee80211_hw *hw;
@@ -1211,10 +1221,36 @@ struct ath10k {struct ath10k_bus_params bus_param;struct completion peer_delete_done; +/* iface combination */ +struct ath10k_iface_comb iface; +/* must be last */ u8 drv_priv[0 ]__aligned(sizeof(void *)) ; }; +static inline void ath10k_init_iface_comb (struct ath10k *ar) +{ +memset (&ar->iface,0 ,sizeof (struct ath10k_iface_comb )); + ar->iface.beacon_tx_offload_max_vdev =BEACON_TX_OFFLOAD_MAX_VDEV ; +} + +static inline void ath10k_deinit_iface_comb (struct ath10k *ar) +{ +int i; + +for (i =0 ; i < ar->iface.combo_sz; i++) { +kfree (ar->iface.combo[i].limits); + ar->iface.combo[i].limits =NULL ; + } +} + +static inline void ath10k_iface_comb_assignment (struct ath10k *ar) +{ + ar->hw->wiphy->iface_combinations = ar->iface.combo; + ar->hw->wiphy->n_iface_combinations = ar->iface.combo_sz; + ar->hw->wiphy->interface_modes = ar->iface.interface_modes; +} +static inline bool ath10k_peer_stats_enabled (struct ath10k *ar) { if (test_bit(ATH10K_FLAG_PEER_STATS, &ar->dev_flags) &&
drivers/net/wireless/ath/ath10k/mac.c +12 -0
@@ -8913,6 +8913,18 @@ int ath10k_mac_register(struct ath10k *ar)ARRAY_SIZE (ath10k_tlv_if_comb); } ar->hw->wiphy->interface_modes |=BIT (NL80211_IFTYPE_ADHOC ); + +if (test_bit + (WMI_SERVICE_IFACE_COMBINATION_SUPPORT , ar->wmi.svc_map)) { +/** +* If combo_sz is not ZERO, it means that host will use +* iface_combinations reported from FW. +*/ +if (ar->iface.combo_sz) +ath10k_iface_comb_assignment (ar); +else +ath10k_warn (ar,"iface combination event missing!\n" ); + }break ;case ATH10K_FW_WMI_OP_VERSION_10_1 :case ATH10K_FW_WMI_OP_VERSION_10_2 :
drivers/net/wireless/ath/ath10k/wmi-tlv.c +182 -1
207 lines not on this page · raw message
drivers/net/wireless/ath/ath10k/wmi-tlv.h +232 -0
260 lines not on this page · raw message
drivers/net/wireless/ath/ath10k/wmi.h +2 -0
@@ -202,6 +202,7 @@ enum wmi_service {WMI_SERVICE_REPORT_AIRTIME ,WMI_SERVICE_SYNC_DELETE_CMDS ,WMI_SERVICE_TX_PWR_PER_PEER , + WMI_SERVICE_IFACE_COMBINATION_SUPPORT,/* Remember to add the new value to wmi_service_name()! */
@@ -496,6 +497,7 @@ static inline char *wmi_service_name(enum wmi_service service_id)SVCSTR (WMI_SERVICE_REPORT_AIRTIME );SVCSTR (WMI_SERVICE_SYNC_DELETE_CMDS );SVCSTR (WMI_SERVICE_TX_PWR_PER_PEER ); +SVCSTR (WMI_SERVICE_IFACE_COMBINATION_SUPPORT );case WMI_SERVICE_MAX :return NULL ;
Signature · 7 lines
2.7.4 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 11 lines · Zhonglin Zhang
New wmi event "
WMI_TLV_IFACE_COMBINATION_EVENTID" is used. IfWMI_SERVICE_IFACE_COMBINATION_SUPPORTservice bit set andWMI_TLV_IFACE_COMBINATION_EVENTIDevent got from FW side, then interface combinations reported from FW will override the default combinations which is hard-coded in host drivers.Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-01061-QCAHLSWMTPL-1Signed-off-by Zhonglin Zhang <[email protected]>Signed-off-by Kalle Valo <[email protected]>
This introduced a new warning:
drivers/net/wireless/ath/ath10k/wmi-tlv.c:556:41: warning: incorrect type in argument 1 (different base types)drivers/net/wireless/ath/ath10k/wmi-tlv.c:556:41: expected unsigned long [usertype] ndrivers/net/wireless/ath/ath10k/wmi-tlv.c:556:41: got restricted __le32 [usertype] limits_n
I fixed that in the pending branch.
Signature · 3 lines
https://patchwork.kernel.org/patch/11027361/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 11 lines · Zhonglin Zhang
New wmi event "
WMI_TLV_IFACE_COMBINATION_EVENTID" is used. IfWMI_SERVICE_IFACE_COMBINATION_SUPPORTservice bit set andWMI_TLV_IFACE_COMBINATION_EVENTIDevent got from FW side, then interface combinations reported from FW will override the default combinations which is hard-coded in host drivers.Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-01061-QCAHLSWMTPL-1Signed-off-by Zhonglin Zhang <[email protected]>Signed-off-by Kalle Valo <[email protected]>
This introduced a new warning:
drivers/net/wireless/ath/ath10k/wmi-tlv.c:556:41: warning: incorrect type in argument 1 (different base types)drivers/net/wireless/ath/ath10k/wmi-tlv.c:556:41: expected unsigned long [usertype] ndrivers/net/wireless/ath/ath10k/wmi-tlv.c:556:41: got restricted __le32 [usertype] limits_n
I fixed that in the pending branch.
Signature · 9 lines
https://patchwork.kernel.org/patch/11027361/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k