Skip to contentSkip to conversation

ath9k: Remove redundant beacon_interval from struct ath_softc

RFC New Steve Brown 3 participants 3 messages Jan 27, 2011 – Feb 7, 2011 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

RFC 1/2 ath9k: Remove redundant beacon_interval from struct ath_softc

The variable appears in both in ath_softc and ath_beacon_config. The struct ath_beacon_config is embedded in ath_softc. The extra variable was added by commit id 57c4d7b4c4986037be51476b8e3025d5ba18d8b8.

---

drivers/net/wireless/ath/ath9k/ath9k.h +1 -3
@@ -369,7 +369,7 @@ struct ath_vif {
 #define IEEE80211_MS_TO_TU(x)           (((x) * 1000) / 1024)
 
 struct ath_beacon_config {
-	u16 beacon_interval;
+	int beacon_interval;
 	u16 listen_interval;
 	u16 dtim_period;
 	u16 bmiss_timeout;
@@ -621,8 +621,6 @@ struct ath_softc {
 	struct ath9k_hw_cal_data caldata;
 	int last_rssi;
 
-	int beacon_interval;
-
 #ifdef CONFIG_ATH9K_DEBUGFS
 	struct ath9k_debug debug;
 	spinlock_t nodes_lock;
drivers/net/wireless/ath/ath9k/beacon.c +4 -2
@@ -226,6 +226,7 @@ int ath_beacon_alloc(struct ath_softc *s
 	struct ath_vif *avp;
 	struct ath_buf *bf;
 	struct sk_buff *skb;
+	struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 	__le64 tstamp;
 
 	avp = (void *)vif->drv_priv;
@@ -282,7 +283,7 @@ int ath_beacon_alloc(struct ath_softc *s
 		u64 tsfadjust;
 		int intval;
 
-		intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
+		intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL;
 
 		/*
 		 * Calculate the TSF offset for this beacon slot, i.e., the
@@ -346,6 +347,7 @@ void ath_beacon_return(struct ath_softc 
 void ath_beacon_tasklet(unsigned long data)
 {
 	struct ath_softc *sc = (struct ath_softc *)data;
+	struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ath_buf *bf = NULL;
@@ -393,7 +395,7 @@ void ath_beacon_tasklet(unsigned long da
 	 * on the tsf to safeguard against missing an swba.
 	 */
 
-	intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
+	intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL;
 
 	tsf = ath9k_hw_gettsf64(ah);
 	tsftu = TSF_TO_TU(tsf>>32, tsf);
drivers/net/wireless/ath/ath9k/main.c +2 -1
@@ -1922,6 +1922,7 @@ static void ath9k_bss_info_changed(struc
 				   u32 changed)
 {
 	struct ath_softc *sc = hw->priv;
+	struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ath_vif *avp = (void *)vif->drv_priv;
@@ -1980,7 +1981,7 @@ static void ath9k_bss_info_changed(struc
 		ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
 
 	if (changed & BSS_CHANGED_BEACON_INT) {
-		sc->beacon_interval = bss_conf->beacon_int;
+		cur_conf->beacon_interval = bss_conf->beacon_int;
 		/*
 		 * In case of AP mode, the HW TSF has to be reset
 		 * when the beacon interval changes.
drivers/net/wireless/ath/ath9k/xmit.c +2 -1
@@ -1054,6 +1054,7 @@ int ath_txq_update(struct ath_softc *sc,
 int ath_cabq_update(struct ath_softc *sc)
 {
 	struct ath9k_tx_queue_info qi;
+	struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 	int qnum = sc->beacon.cabq->axq_qnum;
 
 	ath9k_hw_get_txq_props(sc->sc_ah, qnum, &qi);
@@ -1065,7 +1066,7 @@ int ath_cabq_update(struct ath_softc *sc
 	else if (sc->config.cabqReadytime > ATH9K_READY_TIME_HI_BOUND)
 		sc->config.cabqReadytime = ATH9K_READY_TIME_HI_BOUND;
 
-	qi.tqi_readyTime = (sc->beacon_interval *
+	qi.tqi_readyTime = (cur_conf->beacon_interval *
 			    sc->config.cabqReadytime) / 100;
 	ath_txq_update(sc, qnum, &qi);
 
#1 lore raw

RFC 1/2 ath9k: Remove redundant beacon_interval from struct ath_softc

Quoted 102 lines · Steve Brown

The variable appears in both in ath_softc and ath_beacon_config. The struct ath_beacon_config is embedded in ath_softc. The extra variable was added by commit id 57c4d7b4c4986037be51476b8e3025d5ba18d8b8.

---

drivers/net/wireless/ath/ath9k/ath9k.h +1 -3
@@ -369,7 +369,7 @@ struct ath_vif {
 ?#define IEEE80211_MS_TO_TU(x) ? ? ? ? ? (((x) * 1000) / 1024)
 
 ?struct ath_beacon_config {
- ? ? ? u16 beacon_interval;
+ ? ? ? int beacon_interval;
 ? ? ? ?u16 listen_interval;
 ? ? ? ?u16 dtim_period;
 ? ? ? ?u16 bmiss_timeout;
@@ -621,8 +621,6 @@ struct ath_softc {
 ? ? ? ?struct ath9k_hw_cal_data caldata;
 ? ? ? ?int last_rssi;
 
- ? ? ? int beacon_interval;
-

?#ifdef CONFIG_ATH9K_DEBUGFS
? ? ? ?struct ath9k_debug debug;
? ? ? ?spinlock_t nodes_lock;

drivers/net/wireless/ath/ath9k/beacon.c +2 -1
@@ -226,6 +226,7 @@ int ath_beacon_alloc(struct ath_softc *s
 ? ? ? ?struct ath_vif *avp;
 ? ? ? ?struct ath_buf *bf;
 ? ? ? ?struct sk_buff *skb;
+ ? ? ? struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 ? ? ? ?__le64 tstamp;
 
 ? ? ? ?avp = (void *)vif->drv_priv;
@@ -282,7 +283,7 @@ int ath_beacon_alloc(struct ath_softc *s
 ? ? ? ? ? ? ? ?u64 tsfadjust;
 ? ? ? ? ? ? ? ?int intval;
 
- ? ? ? ? ? ? ? intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
+ ? ? ? ? ? ? ? intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL;
 

? ? ? ? ? ? ? ?/*
? ? ? ? ? ? ? ? * Calculate the TSF offset for this beacon slot, i.e., the

drivers/net/wireless/ath/ath9k/beacon.c +1 -0
@@ -346,6 +347,7 @@ void ath_beacon_return(struct ath_softc
 ?void ath_beacon_tasklet(unsigned long data)
 ?{
 ? ? ? ?struct ath_softc *sc = (struct ath_softc *)data;
+ ? ? ? struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 ? ? ? ?struct ath_hw *ah = sc->sc_ah;
 ? ? ? ?struct ath_common *common = ath9k_hw_common(ah);
 ? ? ? ?struct ath_buf *bf = NULL;
@@ -393,7 +395,7 @@ void ath_beacon_tasklet(unsigned long da

? ? ? ? * on the tsf to safeguard against missing an swba. ? ? ? ? */

- ? ? ? intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
+ ? ? ? intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL;

? ? ? ?tsf = ath9k_hw_gettsf64(ah);
? ? ? ?tsftu = TSF_TO_TU(tsf>>32, tsf);

drivers/net/wireless/ath/ath9k/main.c +2 -1
@@ -1922,6 +1922,7 @@ static void ath9k_bss_info_changed(struc
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u32 changed)
 ?{
 ? ? ? ?struct ath_softc *sc = hw->priv;
+ ? ? ? struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 ? ? ? ?struct ath_hw *ah = sc->sc_ah;
 ? ? ? ?struct ath_common *common = ath9k_hw_common(ah);
 ? ? ? ?struct ath_vif *avp = (void *)vif->drv_priv;
@@ -1980,7 +1981,7 @@ static void ath9k_bss_info_changed(struc
 ? ? ? ? ? ? ? ?ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
 
 ? ? ? ?if (changed & BSS_CHANGED_BEACON_INT) {
- ? ? ? ? ? ? ? sc->beacon_interval = bss_conf->beacon_int;
+ ? ? ? ? ? ? ? cur_conf->beacon_interval = bss_conf->beacon_int;

? ? ? ? ? ? ? ?/*
? ? ? ? ? ? ? ? * In case of AP mode, the HW TSF has to be reset ? ? ? ? ? ? ? ? * when the beacon interval changes.

drivers/net/wireless/ath/ath9k/xmit.c +2 -1
@@ -1054,6 +1054,7 @@ int ath_txq_update(struct ath_softc *sc,
 ?int ath_cabq_update(struct ath_softc *sc)
 ?{
 ? ? ? ?struct ath9k_tx_queue_info qi;
+ ? ? ? struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 ? ? ? ?int qnum = sc->beacon.cabq->axq_qnum;
 
 ? ? ? ?ath9k_hw_get_txq_props(sc->sc_ah, qnum, &qi);
@@ -1065,7 +1066,7 @@ int ath_cabq_update(struct ath_softc *sc
 ? ? ? ?else if (sc->config.cabqReadytime > ATH9K_READY_TIME_HI_BOUND)
 ? ? ? ? ? ? ? ?sc->config.cabqReadytime = ATH9K_READY_TIME_HI_BOUND;
 
- ? ? ? qi.tqi_readyTime = (sc->beacon_interval *
+ ? ? ? qi.tqi_readyTime = (cur_conf->beacon_interval *
 ? ? ? ? ? ? ? ? ? ? ? ? ? ?sc->config.cabqReadytime) / 100;
 ? ? ? ?ath_txq_update(sc, qnum, &qi);
 
Quoted 5 lines

_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

Thanks Steve... could not find any mistake in it.

#2 lore raw

RFC 1/2 ath9k: Remove redundant beacon_interval from struct ath_softc

In reply to Steve Brown
Quoted 93 lines · Steve Brown

The variable appears in both in ath_softc and ath_beacon_config. The struct ath_beacon_config is embedded in ath_softc. The extra variable was added by commit id 57c4d7b4c4986037be51476b8e3025d5ba18d8b8.

---

drivers/net/wireless/ath/ath9k/ath9k.h +1 -3
@@ -369,7 +369,7 @@ struct ath_vif {
 ?#define IEEE80211_MS_TO_TU(x) ? ? ? ? ? (((x) * 1000) / 1024)
 
 ?struct ath_beacon_config {
- ? ? ? u16 beacon_interval;
+ ? ? ? int beacon_interval;
 ? ? ? ?u16 listen_interval;
 ? ? ? ?u16 dtim_period;
 ? ? ? ?u16 bmiss_timeout;
@@ -621,8 +621,6 @@ struct ath_softc {
 ? ? ? ?struct ath9k_hw_cal_data caldata;
 ? ? ? ?int last_rssi;
 
- ? ? ? int beacon_interval;
-

?#ifdef CONFIG_ATH9K_DEBUGFS
? ? ? ?struct ath9k_debug debug;
? ? ? ?spinlock_t nodes_lock;

drivers/net/wireless/ath/ath9k/beacon.c +2 -1
@@ -226,6 +226,7 @@ int ath_beacon_alloc(struct ath_softc *s
 ? ? ? ?struct ath_vif *avp;
 ? ? ? ?struct ath_buf *bf;
 ? ? ? ?struct sk_buff *skb;
+ ? ? ? struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 ? ? ? ?__le64 tstamp;
 
 ? ? ? ?avp = (void *)vif->drv_priv;
@@ -282,7 +283,7 @@ int ath_beacon_alloc(struct ath_softc *s
 ? ? ? ? ? ? ? ?u64 tsfadjust;
 ? ? ? ? ? ? ? ?int intval;
 
- ? ? ? ? ? ? ? intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
+ ? ? ? ? ? ? ? intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL;
 

? ? ? ? ? ? ? ?/*
? ? ? ? ? ? ? ? * Calculate the TSF offset for this beacon slot, i.e., the

drivers/net/wireless/ath/ath9k/beacon.c +1 -0
@@ -346,6 +347,7 @@ void ath_beacon_return(struct ath_softc
 ?void ath_beacon_tasklet(unsigned long data)
 ?{
 ? ? ? ?struct ath_softc *sc = (struct ath_softc *)data;
+ ? ? ? struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 ? ? ? ?struct ath_hw *ah = sc->sc_ah;
 ? ? ? ?struct ath_common *common = ath9k_hw_common(ah);
 ? ? ? ?struct ath_buf *bf = NULL;
@@ -393,7 +395,7 @@ void ath_beacon_tasklet(unsigned long da

? ? ? ? * on the tsf to safeguard against missing an swba. ? ? ? ? */

- ? ? ? intval = sc->beacon_interval ? : ATH_DEFAULT_BINTVAL;
+ ? ? ? intval = cur_conf->beacon_interval ? : ATH_DEFAULT_BINTVAL;

? ? ? ?tsf = ath9k_hw_gettsf64(ah);
? ? ? ?tsftu = TSF_TO_TU(tsf>>32, tsf);

drivers/net/wireless/ath/ath9k/main.c +2 -1
@@ -1922,6 +1922,7 @@ static void ath9k_bss_info_changed(struc
 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? u32 changed)
 ?{
 ? ? ? ?struct ath_softc *sc = hw->priv;
+ ? ? ? struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 ? ? ? ?struct ath_hw *ah = sc->sc_ah;
 ? ? ? ?struct ath_common *common = ath9k_hw_common(ah);
 ? ? ? ?struct ath_vif *avp = (void *)vif->drv_priv;
@@ -1980,7 +1981,7 @@ static void ath9k_bss_info_changed(struc
 ? ? ? ? ? ? ? ?ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
 
 ? ? ? ?if (changed & BSS_CHANGED_BEACON_INT) {
- ? ? ? ? ? ? ? sc->beacon_interval = bss_conf->beacon_int;
+ ? ? ? ? ? ? ? cur_conf->beacon_interval = bss_conf->beacon_int;

? ? ? ? ? ? ? ?/*
? ? ? ? ? ? ? ? * In case of AP mode, the HW TSF has to be reset ? ? ? ? ? ? ? ? * when the beacon interval changes.

drivers/net/wireless/ath/ath9k/xmit.c +1 -0
@@ -1054,6 +1054,7 @@ int ath_txq_update(struct ath_softc *sc,
 ?int ath_cabq_update(struct ath_softc *sc)
 ?{
 ? ? ? ?struct ath9k_tx_queue_info qi;
+ ? ? ? struct ath_beacon_config *cur_conf = &sc->cur_beacon_conf;
 ? ? ? ?int qnum = sc->beacon.cabq->axq_qnum;
 
 ? ? ? ?ath9k_hw_get_txq_props(sc->sc_ah, qnum, &qi);

drivers/net/wireless/ath/ath9k/xmit.c int ath_cabq_update(struct ath_softc *sc · line 1071

Quoted 7 lines
drivers/net/wireless/ath/ath9k/xmit.c +1 -1
@@ -1065,7 +1066,7 @@ int ath_cabq_update(struct ath_softc *sc
 ? ? ? ?else if (sc->config.cabqReadytime > ATH9K_READY_TIME_HI_BOUND)
 ? ? ? ? ? ? ? ?sc->config.cabqReadytime = ATH9K_READY_TIME_HI_BOUND;
 
- ? ? ? qi.tqi_readyTime = (sc->beacon_interval *
+ ? ? ? qi.tqi_readyTime = (cur_conf->beacon_interval *
 ? ? ? ? ? ? ? ? ? ? ? ? ? ?sc->config.cabqReadytime) / 100;
 ? ? ? ?ath_txq_update(sc, qnum, &qi);

This patch was not there in wireless-testing..can you please send the patch to wireless testing

Quoted 7 lines

_______________________________________________
ath9k-devel mailing list
ath9k-devel at lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel