[PATCH 7/8] wcn36xx: remove sta property from wcn36xx struct

Eugene Krasnikov k.eugene.e at gmail.com
Mon Sep 9 09:35:21 EDT 2013


Use sta from vif_priv from now on.

Signed-off-by: Eugene Krasnikov <k.eugene.e at gmail.com>
---
 main.c    |  5 +----
 smd.c     | 23 +++++++++++++----------
 wcn36xx.h |  1 -
 3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/main.c b/main.c
index 189521b..18ece1f 100644
--- a/main.c
+++ b/main.c
@@ -319,7 +319,7 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 {
 	struct wcn36xx *wcn = hw->priv;
 	struct wcn36xx_vif *vif_priv = (struct wcn36xx_vif *)vif->drv_priv;
-	struct wcn36xx_sta *sta_priv = NULL;
+	struct wcn36xx_sta *sta_priv = vif_priv->sta;
 	int ret = 0;
 	u8 key[WLAN_MAX_KEY_LEN];
 
@@ -330,7 +330,6 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	wcn36xx_dbg_dump(WCN36XX_DBG_MAC, "KEY: ",
 			 key_conf->key,
 			 key_conf->keylen);
-	sta_priv = sta ? (struct wcn36xx_sta *)sta->drv_priv : wcn->sta;
 
 	switch (key_conf->cipher) {
 	case WLAN_CIPHER_SUITE_WEP40:
@@ -571,7 +570,6 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
 			wcn36xx_smd_set_link_st(wcn, bss_conf->bssid,
 				vif->addr,
 				WCN36XX_HAL_LINK_POSTASSOC_STATE);
-			wcn->sta = sta_priv;
 			wcn36xx_smd_config_bss(wcn, vif, sta,
 					       bss_conf->bssid,
 					       true);
@@ -697,7 +695,6 @@ static int wcn36xx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 	wcn36xx_dbg(WCN36XX_DBG_MAC, "mac sta add vif %p sta %pM\n",
 		    vif, sta->addr);
 
-	wcn->sta = (struct wcn36xx_sta *)sta->drv_priv;
 	vif_priv->sta = sta_priv;
 	sta_priv->vif = vif_priv;
 	/*
diff --git a/smd.c b/smd.c
index 8e0bf22..8092791 100644
--- a/smd.c
+++ b/smd.c
@@ -851,11 +851,14 @@ static void wcn36xx_smd_convert_sta_to_v1(struct wcn36xx *wcn,
 	v1->sta_index = orig->sta_index;
 }
 
-static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn, void *buf,
+static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn,
+				      struct ieee80211_sta *sta,
+				      void *buf,
 				      size_t len)
 {
 	struct wcn36xx_hal_config_sta_rsp_msg *rsp;
 	struct config_sta_rsp_params *params;
+	struct wcn36xx_sta *sta_priv = (struct wcn36xx_sta *)sta->drv_priv;
 
 	if (len < sizeof(*rsp))
 		return -EINVAL;
@@ -869,11 +872,8 @@ static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn, void *buf,
 		return -EIO;
 	}
 
-	if (wcn->sta) {
-		wcn->sta->sta_index = params->sta_index;
-		wcn->sta->dpu_desc_index = params->dpu_index;
-		wcn->sta = NULL;
-	}
+	sta_priv->sta_index = params->sta_index;
+	sta_priv->dpu_desc_index = params->dpu_index;
 
 	wcn36xx_dbg(WCN36XX_DBG_HAL,
 		    "hal config sta rsp status %d sta_index %d bssid_index %d p2p %d\n",
@@ -935,7 +935,10 @@ int wcn36xx_smd_config_sta(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 		wcn36xx_err("Sending hal_config_sta failed\n");
 		goto out;
 	}
-	ret = wcn36xx_smd_config_sta_rsp(wcn, wcn->hal_buf, wcn->hal_rsp_len);
+	ret = wcn36xx_smd_config_sta_rsp(wcn,
+					 sta,
+					 wcn->hal_buf,
+					 wcn->hal_rsp_len);
 	if (ret) {
 		wcn36xx_err("hal_config_sta response failed err=%d\n", ret);
 		goto out;
@@ -1085,9 +1088,9 @@ static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
 
 	priv_vif->bss_index = params->bss_index;
 
-	if (wcn->sta) {
-		wcn->sta->bss_sta_index =  params->bss_sta_index;
-		wcn->sta->bss_dpu_desc_index = params->dpu_desc_index;
+	if (priv_vif->sta) {
+		priv_vif->sta->bss_sta_index =  params->bss_sta_index;
+		priv_vif->sta->bss_dpu_desc_index = params->dpu_desc_index;
 	}
 
 	priv_vif->ucast_dpu_signature = params->ucast_dpu_signature;
diff --git a/wcn36xx.h b/wcn36xx.h
index 8eb659a..e61f1b6 100644
--- a/wcn36xx.h
+++ b/wcn36xx.h
@@ -169,7 +169,6 @@ struct wcn36xx {
 	struct mac_address	addresses;
 	struct wcn36xx_hal_mac_ssid ssid;
 	struct list_head	vif_list;
-	struct wcn36xx_sta	*sta;
 
 	u8			fw_revision;
 	u8			fw_version;
-- 
1.8.2.2




More information about the wcn36xx mailing list