[PATCH v2 6/6] Move is_joining to vif struct

Olof Johansson dev at skyshaper.net
Thu Jul 11 05:41:41 EDT 2013


Moves this parameter to the vif struct where it belongs.
---
 main.c    | 9 +++++----
 txrx.c    | 5 +++--
 wcn36xx.h | 5 +++--
 3 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/main.c b/main.c
index 91985a8..27b386f 100644
--- a/main.c
+++ b/main.c
@@ -513,15 +513,15 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
 			    bss_conf->bssid);
 
 		if (!is_zero_ether_addr(bss_conf->bssid)) {
-			wcn->is_joining = true;
+			((struct wcn36xx_vif*)vif->drv_priv)->is_joining = true;
 			wcn36xx_smd_join(wcn, bss_conf->bssid,
 					 vif->addr, WCN36XX_HW_CHANNEL(wcn));
 			wcn36xx_smd_config_bss(wcn, NL80211_IFTYPE_STATION,
 					       bss_conf->bssid, false,
 					       wcn->beacon_interval);
 		} else {
-			wcn->is_joining = false;
 			wcn36xx_smd_delete_bss(wcn);
+			((struct wcn36xx_vif*)vif->drv_priv)->is_joining = false;
 		}
 	}
 
@@ -536,7 +536,7 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
 	}
 
 	if (changed & BSS_CHANGED_ASSOC) {
-		wcn->is_joining = false;
+		((struct wcn36xx_vif*)vif->drv_priv)->is_joining = false;
 		if (bss_conf->assoc) {
 			struct ieee80211_sta *sta;
 
@@ -552,6 +552,7 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
 			sta = ieee80211_find_sta(vif, bss_conf->bssid);
 			if(sta)
 				wcn36xx_update_allowed_rates(wcn, sta);
+
 			rcu_read_unlock();
 
 			wcn36xx_smd_set_link_st(wcn, bss_conf->bssid,
@@ -680,6 +681,7 @@ static int wcn36xx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		wcn->aid = sta->aid;
 		wcn36xx_smd_config_sta(wcn, vif->addr, sta->addr, vif->type);
 	}
+	((struct wcn_sta*)sta->drv_priv)->vif_priv = (struct wcn36xx_vif*)vif->drv_priv;
 	return 0;
 }
 
@@ -927,7 +929,6 @@ static int __init wcn36xx_init(void)
 
 	wcn->aid = 0;
 	wcn->current_vif = NULL;
-	wcn->is_joining = false;
 
 	mutex_init(&wcn->pm_mutex);
 	mutex_init(&wcn->smd_mutex);
diff --git a/txrx.c b/txrx.c
index c2a95cb..4cbba8d 100644
--- a/txrx.c
+++ b/txrx.c
@@ -107,6 +107,7 @@ static void wcn36xx_set_tx_data(struct wcn36xx_tx_bd *bd,
 
 static void wcn36xx_set_tx_mgmt(struct wcn36xx_tx_bd *bd,
 				struct wcn36xx *wcn,
+				struct wcn_sta *sta_priv,
 				struct ieee80211_hdr *hdr,
 				bool bcast)
 {
@@ -128,7 +129,7 @@ static void wcn36xx_set_tx_mgmt(struct wcn36xx_tx_bd *bd,
 	 * In joining state trick hardware that probe is sent as
 	 * unicast even if address is broadcast.
 	 */
-	if (wcn->is_joining &&
+	if (sta_priv && sta_priv->vif_priv->is_joining &&
 	    ieee80211_is_probe_req(hdr->frame_control))
 		bcast = false;
 
@@ -209,7 +210,7 @@ int wcn36xx_start_tx(struct wcn36xx *wcn,
 		wcn36xx_set_tx_data(bd, wcn, sta_priv, hdr, bcast);
 	} else {
 		/* MGMT and CTRL frames are handeld here*/
-		wcn36xx_set_tx_mgmt(bd, wcn, hdr, bcast);
+		wcn36xx_set_tx_mgmt(bd, wcn, sta_priv, hdr, bcast);
 	}
 
 	buff_to_be((u32 *)bd, sizeof(*bd)/sizeof(u32));
diff --git a/wcn36xx.h b/wcn36xx.h
index 3c70e7a..17092fb 100644
--- a/wcn36xx.h
+++ b/wcn36xx.h
@@ -101,12 +101,15 @@ struct wcn36xx_vif {
 	/* Returned from WCN36XX_HAL_ADD_STA_SELF_RSP */
 	u8 self_sta_index;
 	u8 self_dpu_desc_index;
+	bool is_joining;
 };
 
 struct wcn_sta {
 	u8 sta_id;
 	bool is_data_encrypted;
+	struct wcn36xx_vif *vif_priv;
 };
+
 struct wcn36xx_dxe_ch;
 struct wcn36xx {
 	struct ieee80211_hw	*hw;
@@ -158,8 +161,6 @@ struct wcn36xx {
 	struct work_struct	rx_ready_work;
 	struct completion	smd_compl;
 
-	bool			is_joining;
-
 	/* DXE channels */
 	struct wcn36xx_dxe_ch	dxe_tx_l_ch;	/* TX low */
 	struct wcn36xx_dxe_ch	dxe_tx_h_ch;	/* TX high */
-- 
1.8.3.1




More information about the wcn36xx mailing list