wcn36xx: Add wcn36xx_smd_config_bss_v0
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Thu, 10 Sep 2020 15:06:29 +0000 (16:06 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 21 Sep 2020 13:17:09 +0000 (16:17 +0300)
This commit adds wcn36xx_smd_config_bss_v0() as a step along the road of
functionally decomposing wcn36xx_smd_config_bss().

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200910150631.2178970-6-bryan.odonoghue@linaro.org
drivers/net/wireless/ath/wcn36xx/smd.c

index 809a4c0899ff860a0bb44638840834d1fad5076f..57833eec16ebba2a36e5c6f266168db1ecc588a2 100644 (file)
@@ -1605,6 +1605,50 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
        return ret;
 }
 
+int wcn36xx_smd_config_bss_v0(struct wcn36xx *wcn, struct ieee80211_vif *vif,
+                             struct ieee80211_sta *sta, const u8 *bssid,
+                             bool update);
+int wcn36xx_smd_config_bss_v0(struct wcn36xx *wcn, struct ieee80211_vif *vif,
+                             struct ieee80211_sta *sta, const u8 *bssid,
+                             bool update)
+{
+       struct wcn36xx_hal_config_bss_req_msg *msg;
+       struct wcn36xx_hal_config_bss_params *bss;
+       struct wcn36xx_hal_config_sta_params *sta_params;
+       int ret;
+
+       msg = kzalloc(sizeof(*msg), GFP_KERNEL);
+       if (!msg)
+               return -ENOMEM;
+
+       INIT_HAL_MSG((*msg), WCN36XX_HAL_CONFIG_BSS_REQ);
+
+       bss = &msg->bss_params;
+       sta_params = &bss->sta;
+
+       wcn36xx_smd_set_bss_params(wcn, vif, sta, bssid, update, bss);
+       wcn36xx_smd_set_sta_params(wcn, vif, sta, sta_params);
+
+       PREPARE_HAL_BUF(wcn->hal_buf, (*msg));
+
+       wcn36xx_dbg(WCN36XX_DBG_HAL,
+                   "hal config bss bssid %pM self_mac_addr %pM bss_type %d oper_mode %d nw_type %d\n",
+                   bss->bssid, bss->self_mac_addr, bss->bss_type,
+                   bss->oper_mode, bss->nw_type);
+
+       wcn36xx_dbg(WCN36XX_DBG_HAL,
+                   "- sta bssid %pM action %d sta_index %d bssid_index %d aid %d type %d mac %pM\n",
+                   sta_params->bssid, sta_params->action,
+                   sta_params->sta_index, sta_params->bssid_index,
+                   sta_params->aid, sta_params->type,
+                   sta_params->mac);
+
+       ret = wcn36xx_smd_send_and_wait(wcn, msg->header.len);
+       kfree(msg);
+
+       return ret;
+}
+
 static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
                                      struct ieee80211_vif *vif,
                                      struct ieee80211_sta *sta,