Skip to contentSkip to conversation

ath9k patches

PATCH New Sujith Manoharan 1 participant 6 messages Sep 15, 2014 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

cover ath9k patches

From: Sujith Manoharan <[email protected]>

MCC fixes for 3.18

Sujith Manoharan (5):
ath9k: Remove unnecessary tbtt assignment
ath9k: Check beaconing mode properly
ath9k: Set offchannel state properly
ath9k: Remove useless opmode check
ath9k: Fix primary station configuration

 drivers/net/wireless/ath/ath9k/ath9k.h   |  4 +-
 drivers/net/wireless/ath/ath9k/channel.c |  8 ++--
 drivers/net/wireless/ath/ath9k/main.c    | 70 ++++++++++++++++++++------------
 drivers/net/wireless/ath/ath9k/recv.c    |  2 +-
 4 files changed, 51 insertions(+), 33 deletions(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/5 ath9k: Remove unnecessary tbtt assignment

From: Sujith Manoharan <[email protected]>

The next_tbtt variable in the scheduler is needed only for GO/AP mode operation and is always read from the NEXT_TBTT_TIMER in the HW. There is no need to store the timestamp for received beacons.

---
 drivers/net/wireless/ath/ath9k/ath9k.h   | 4 ++--
 drivers/net/wireless/ath/ath9k/channel.c | 5 ++---
 drivers/net/wireless/ath/ath9k/recv.c    | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +2 -2
index 660c151..dd0f97f 100644
@@ -454,7 +454,7 @@ void ath9k_p2p_ps_timer(void *priv);
 void ath9k_chanctx_wake_queues(struct ath_softc *sc);
 void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx);
 
-void ath_chanctx_beacon_recv_ev(struct ath_softc *sc, u32 ts,
+void ath_chanctx_beacon_recv_ev(struct ath_softc *sc,
 				enum ath_chanctx_event ev);
 void ath_chanctx_beacon_sent_ev(struct ath_softc *sc,
 				enum ath_chanctx_event ev);
@@ -483,7 +483,7 @@ static inline void ath9k_offchannel_init(struct ath_softc *sc)
 static inline void ath9k_deinit_channel_context(struct ath_softc *sc)
 {
 }
-static inline void ath_chanctx_beacon_recv_ev(struct ath_softc *sc, u32 ts,
+static inline void ath_chanctx_beacon_recv_ev(struct ath_softc *sc,
 					      enum ath_chanctx_event ev)
 {
 }
drivers/net/wireless/ath/ath9k/channel.c +2 -3
index a1b3282..3906df9 100644
@@ -398,7 +398,6 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif,
 			break;
 		}
 
-
 		/*
 		 * Clear the extend_absence flag if it had been
 		 * set during the previous beacon transmission,
@@ -418,6 +417,7 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif,
 			avp->noa_duration = 0;
 			sc->sched.extend_absence = true;
 		}
+
 		/* Prevent wrap-around issues */
 		if (avp->noa_duration && tsf_time - avp->noa_start > BIT(30))
 			avp->noa_duration = 0;
@@ -608,10 +608,9 @@ void ath_chanctx_beacon_sent_ev(struct ath_softc *sc,
 		ath_chanctx_event(sc, NULL, ev);
 }
 
-void ath_chanctx_beacon_recv_ev(struct ath_softc *sc, u32 ts,
+void ath_chanctx_beacon_recv_ev(struct ath_softc *sc,
 				enum ath_chanctx_event ev)
 {
-	sc->sched.next_tbtt = ts;
 	ath_chanctx_event(sc, NULL, ev);
 }
 
drivers/net/wireless/ath/ath9k/recv.c +1 -1
index dea8e1b..0b53b74 100644
@@ -909,7 +909,7 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
 
 	if (ath9k_is_chanctx_enabled()) {
 		if (rx_stats->is_mybeacon)
-			ath_chanctx_beacon_recv_ev(sc, rx_stats->rs_tstamp,
+			ath_chanctx_beacon_recv_ev(sc,
 					   ATH_CHANCTX_EVENT_BEACON_RECEIVED);
 	}
 
Signature · 1 line
2.1.0
#2 lore raw

PATCH 2/5 ath9k: Check beaconing mode properly

In reply to Sujith Manoharan

From: Sujith Manoharan <[email protected]>

In MCC mode, the TSF of a context needs to be
adjusted only if it is GO/AP.

---
 drivers/net/wireless/ath/ath9k/channel.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/ath/ath9k/channel.c +3 -0
index 3906df9..7be940f 100644
@@ -262,6 +262,9 @@ static void ath_chanctx_adjust_tbtt_delta(struct ath_softc *sc)
 	cur = sc->cur_chan;
 	prev = ath_chanctx_get_next(sc, cur);
 
+	if (!prev->switch_after_beacon)
+		return;
+
 	getrawmonotonic(&ts);
 	cur_tsf = (u32) cur->tsf_val +
 		  ath9k_hw_get_tsf_offset(&cur->tsf_ts, &ts);
Signature · 1 line
2.1.0
#3 lore raw

PATCH 3/5 ath9k: Set offchannel state properly

In reply to Sujith Manoharan

From: Sujith Manoharan <[email protected]>

When switching offchannel, BSS related information in the HW has to be reset to default values. Add a routine to do this.

---
 drivers/net/wireless/ath/ath9k/main.c | 57 ++++++++++++++++++++++++++---------
 1 file changed, 42 insertions(+), 15 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +42 -15
index 1bc2369..aa541fd 100644
@@ -953,21 +953,6 @@ void ath9k_calculate_iter_data(struct ath_softc *sc,
 
 	list_for_each_entry(avp, &ctx->vifs, list)
 		ath9k_vif_iter(iter_data, avp->vif->addr, avp->vif);
-
-#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
-	if (ctx == &sc->offchannel.chan) {
-		struct ieee80211_vif *vif;
-
-		if (sc->offchannel.state < ATH_OFFCHANNEL_ROC_START)
-			vif = sc->offchannel.scan_vif;
-		else
-			vif = sc->offchannel.roc_vif;
-
-		if (vif)
-			ath9k_vif_iter(iter_data, vif->addr, vif);
-		iter_data->beacons = false;
-	}
-#endif
 }
 
 static void ath9k_set_assoc_state(struct ath_softc *sc,
@@ -1007,6 +992,43 @@ static void ath9k_set_assoc_state(struct ath_softc *sc,
 		vif->addr, common->curbssid);
 }
 
+#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
+static void ath9k_set_offchannel_state(struct ath_softc *sc)
+{
+	struct ath_hw *ah = sc->sc_ah;
+	struct ath_common *common = ath9k_hw_common(ah);
+	struct ieee80211_vif *vif = NULL;
+
+	ath9k_ps_wakeup(sc);
+
+	if (sc->offchannel.state < ATH_OFFCHANNEL_ROC_START)
+		vif = sc->offchannel.scan_vif;
+	else
+		vif = sc->offchannel.roc_vif;
+
+	if (WARN_ON(!vif))
+		goto exit;
+
+	eth_zero_addr(common->curbssid);
+	eth_broadcast_addr(common->bssidmask);
+	ether_addr_copy(common->macaddr, vif->addr);
+	common->curaid = 0;
+	ah->opmode = vif->type;
+	ah->imask &= ~ATH9K_INT_SWBA;
+	ah->imask &= ~ATH9K_INT_TSFOOR;
+	ah->slottime = ATH9K_SLOT_TIME_9;
+
+	ath_hw_setbssidmask(common);
+	ath9k_hw_setopmode(ah);
+	ath9k_hw_write_associd(sc->sc_ah);
+	ath9k_hw_set_interrupts(ah);
+	ath9k_hw_init_global_settings(ah);
+
+exit:
+	ath9k_ps_restore(sc);
+}
+#endif
+
 /* Called with sc->mutex held. */
 void ath9k_calculate_summary_state(struct ath_softc *sc,
 				   struct ath_chanctx *ctx)
@@ -1021,6 +1043,11 @@ void ath9k_calculate_summary_state(struct ath_softc *sc,
 	if (ctx != sc->cur_chan)
 		return;
 
+#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT
+	if (ctx == &sc->offchannel.chan)
+		return ath9k_set_offchannel_state(sc);
+#endif
+
 	ath9k_ps_wakeup(sc);
 	ath9k_calculate_iter_data(sc, ctx, &iter_data);
 
Signature · 1 line
2.1.0
#4 lore raw

PATCH 4/5 ath9k: Remove useless opmode check

In reply to Sujith Manoharan

From: Sujith Manoharan <[email protected]>

The opmode is verified to be NL80211_IFTYPE_STATION before calling ath9k_set_assoc_state().

---
 drivers/net/wireless/ath/ath9k/main.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +0 -7
index aa541fd..3a91b30 100644
@@ -963,13 +963,6 @@ static void ath9k_set_assoc_state(struct ath_softc *sc,
 	unsigned long flags;
 
 	set_bit(ATH_OP_PRIM_STA_VIF, &common->op_flags);
-	/* Set the AID, BSSID and do beacon-sync only when
-	 * the HW opmode is STATION.
-	 *
-	 * But the primary bit is set above in any case.
-	 */
-	if (sc->sc_ah->opmode != NL80211_IFTYPE_STATION)
-		return;
 
 	ether_addr_copy(common->curbssid, bss_conf->bssid);
 	common->curaid = bss_conf->aid;
Signature · 1 line
2.1.0
#5 lore raw

PATCH 5/5 ath9k: Fix primary station configuration

In reply to Sujith Manoharan

From: Sujith Manoharan <[email protected]>

Assign 'primary_sta' to the active primary station interface after iterating over the list of interfaces.

---
 drivers/net/wireless/ath/ath9k/main.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +1 -5
index 3a91b30..7bc7d55 100644
@@ -1088,9 +1088,7 @@ void ath9k_calculate_summary_state(struct ath_softc *sc,
 			iter_data.beacons = true;
 			ath9k_set_assoc_state(sc, iter_data.primary_sta,
 					      changed);
-			if (!ctx->primary_sta ||
-			    !ctx->primary_sta->bss_conf.assoc)
-				ctx->primary_sta = iter_data.primary_sta;
+			ctx->primary_sta = iter_data.primary_sta;
 		} else {
 			ctx->primary_sta = NULL;
 			memset(common->curbssid, 0, ETH_ALEN);
@@ -1119,8 +1117,6 @@ void ath9k_calculate_summary_state(struct ath_softc *sc,
 	else
 		clear_bit(ATH_OP_PRIM_STA_VIF, &common->op_flags);
 
-	ctx->primary_sta = iter_data.primary_sta;
-
 	ath9k_ps_restore(sc);
 }
 
Signature · 1 line
2.1.0