[PATCH v2 5/6] Remove center_freq variable from wcn struct

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


Removes the center_freq variable from the wcn struct and replaces it
with a macro.
---
 main.c    | 1 -
 txrx.c    | 4 ++--
 wcn36xx.h | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/main.c b/main.c
index b87c08f..91985a8 100644
--- a/main.c
+++ b/main.c
@@ -293,7 +293,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;
 		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 dc5babe..c2a95cb 100644
--- a/txrx.c
+++ b/txrx.c
@@ -37,8 +37,8 @@ int wcn36xx_rx_skb(struct wcn36xx *wcn, struct sk_buff *skb)
 	skb_pull(skb, bd->pdu.mpdu_header_off);
 
 	status.mactime = 10;
-	status.freq = wcn->current_channel->center_freq;
-	status.band = wcn->current_channel->band;
+	status.freq = WCN36XX_CENTER_FREQ(wcn);
+	status.band = WCN36XX_BAND(wcn);
 	status.signal = -RSSI0(bd);
 	status.antenna = 1;
 	status.rate_idx = 1;
diff --git a/wcn36xx.h b/wcn36xx.h
index 3575c20..3c70e7a 100644
--- a/wcn36xx.h
+++ b/wcn36xx.h
@@ -82,6 +82,7 @@ enum wcn36xx_debug_mask {
 
 #define WCN36XX_HW_CHANNEL(__wcn) (__wcn->hw->conf.chandef.chan->hw_value)
 #define WCN36XX_BAND(__wcn) (__wcn->hw->conf.chandef.chan->band)
+#define WCN36XX_CENTER_FREQ(__wcn) (__wcn->hw->conf.chandef.chan->center_freq)
 
 static inline void buff_to_be(u32 *buf, size_t len)
 {
@@ -113,7 +114,6 @@ struct wcn36xx {
 	struct device		*dev;
 	const struct firmware	*nv;
 	struct mac_address	addresses[2];
-	struct ieee80211_channel *current_channel;
 	struct wcn36xx_hal_mac_ssid ssid;
 	u16			aid;
 	struct wcn36xx_vif	*current_vif;
-- 
1.8.3.1




More information about the wcn36xx mailing list