[PATCH v2 4/6] Remove band variable from wcn struct

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


Removes the band variable and replace it with a macro for
reading it from wcn->hw instead.
---
 main.c    | 1 -
 txrx.c    | 2 +-
 wcn36xx.h | 2 +-
 3 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/main.c b/main.c
index e81622f..b87c08f 100644
--- a/main.c
+++ b/main.c
@@ -294,7 +294,6 @@ static int wcn36xx_config(struct ieee80211_hw *hw, u32 changed)
 	if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
 		int ch = WCN36XX_HW_CHANNEL(wcn);
 		wcn->current_channel = hw->conf.chandef.chan;
-		wcn->band = hw->conf.chandef.chan->band;
 		wcn36xx_dbg(WCN36XX_DBG_MAC, "wcn36xx_config channel switch=%d", ch);
 		wcn36xx_smd_switch_channel(wcn, ch);
 	}
diff --git a/txrx.c b/txrx.c
index 9068fdb..dc5babe 100644
--- a/txrx.c
+++ b/txrx.c
@@ -116,7 +116,7 @@ static void wcn36xx_set_tx_mgmt(struct wcn36xx_tx_bd *bd,
 
 	/* default rate for unicast */
 	if (ieee80211_is_mgmt(hdr->frame_control))
-		bd->bd_rate = (wcn->band == IEEE80211_BAND_5GHZ) ?
+		bd->bd_rate = (WCN36XX_BAND(wcn) == IEEE80211_BAND_5GHZ) ?
 			WCN36XX_BD_RATE_CTRL :
 			WCN36XX_BD_RATE_MGMT;
 	else if (ieee80211_is_ctl(hdr->frame_control))
diff --git a/wcn36xx.h b/wcn36xx.h
index b46d78a..3575c20 100644
--- a/wcn36xx.h
+++ b/wcn36xx.h
@@ -81,6 +81,7 @@ enum wcn36xx_debug_mask {
 } while (0)
 
 #define WCN36XX_HW_CHANNEL(__wcn) (__wcn->hw->conf.chandef.chan->hw_value)
+#define WCN36XX_BAND(__wcn) (__wcn->hw->conf.chandef.chan->band)
 
 static inline void buff_to_be(u32 *buf, size_t len)
 {
@@ -113,7 +114,6 @@ struct wcn36xx {
 	const struct firmware	*nv;
 	struct mac_address	addresses[2];
 	struct ieee80211_channel *current_channel;
-	enum ieee80211_band	band;
 	struct wcn36xx_hal_mac_ssid ssid;
 	u16			aid;
 	struct wcn36xx_vif	*current_vif;
-- 
1.8.3.1




More information about the wcn36xx mailing list