wcn36xx: Add wrapper function wcn36xx_smd_set_sta_params_v1()
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Thu, 10 Sep 2020 15:05:52 +0000 (16:05 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 21 Sep 2020 13:14:30 +0000 (16:14 +0300)
This commit adds a wrapper function wcn36xx_smd_set_sta_params_v1() which
calls into wcn36xx_smd_set_sta_params() and then subsequently sets
version-1 specific parameters.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910150552.2178882-8-bryan.odonoghue@linaro.org
drivers/net/wireless/ath/wcn36xx/smd.c

index d5089aa382bdcc7ecc92b1fc26b141cb3aaa98b4..71ecf3ef5ab2130f9a4a9da784613696ffe9a64f 100644 (file)
@@ -1262,6 +1262,36 @@ static void wcn36xx_smd_convert_sta_to_v1(struct wcn36xx *wcn,
        v1->p2p = orig->p2p;
 }
 
+void
+wcn36xx_smd_set_sta_params_v1(struct wcn36xx *wcn,
+                             struct ieee80211_vif *vif,
+                             struct ieee80211_sta *sta,
+                             struct wcn36xx_hal_config_sta_params_v1 *sta_par);
+void
+wcn36xx_smd_set_sta_params_v1(struct wcn36xx *wcn,
+                             struct ieee80211_vif *vif,
+                             struct ieee80211_sta *sta,
+                             struct wcn36xx_hal_config_sta_params_v1 *sta_par)
+{
+       struct wcn36xx_sta *sta_priv = NULL;
+       struct wcn36xx_hal_config_sta_params sta_par_v0;
+
+       wcn36xx_smd_set_sta_params(wcn, vif, sta, &sta_par_v0);
+       wcn36xx_smd_convert_sta_to_v1(wcn, &sta_par_v0, sta_par);
+
+       if (sta) {
+               sta_priv = wcn36xx_sta_to_priv(sta);
+               wcn36xx_smd_set_sta_vht_params(wcn, sta, sta_par);
+               wcn36xx_smd_set_sta_ht_ldpc_params(sta, sta_par);
+               memcpy(&sta_par->supported_rates, &sta_priv->supported_rates,
+                      sizeof(sta_par->supported_rates));
+       } else {
+               wcn36xx_set_default_rates_v1(&sta_par->supported_rates);
+               wcn36xx_smd_set_sta_default_vht_params(wcn, sta_par);
+               wcn36xx_smd_set_sta_default_ht_ldpc_params(wcn, sta_par);
+       }
+}
+
 static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn,
                                      struct ieee80211_sta *sta,
                                      void *buf,