Skip to contentSkip to conversation

ath9k: Print the negotiated HT capabilities

PATCH In review Sujith Manoharan 3 participants 8 messages Feb 4, 2013 – Feb 12, 2013 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ath9k: Print the negotiated HT capabilities

From: Sujith Manoharan <[email protected]>

Also, reduce the memory allocated for each row.

---
 drivers/net/wireless/ath/ath9k/rc.c | 12 +++++++++++-
 drivers/net/wireless/ath/ath9k/rc.h |  6 ++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/rc.c +11 -1
index 714558d..62abd70 100644
@@ -1364,7 +1364,7 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
 	if (rc->rate_table == NULL)
 		return 0;
 
-	max = 80 + rc->rate_table_size * 1024 + 1;
+	max = 80 + rc->rate_table_size * 256 + 1;
 	buf = kmalloc(max, GFP_KERNEL);
 	if (buf == NULL)
 		return -ENOMEM;
@@ -1410,6 +1410,16 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
 			stats->per);
 	}
 
+	if (rc->ht_cap & WLAN_RC_HT_FLAG) {
+		len += snprintf(buf + len, max - len, "\nNegotiated HT caps: ");
+		PR_HT_CAP((rc->ht_cap & WLAN_RC_HT_FLAG), "[HT20]");
+		PR_HT_CAP((rc->ht_cap & WLAN_RC_40_FLAG), "[HT40]");
+		PR_HT_CAP((rc->ht_cap & WLAN_RC_DS_FLAG), "[2-Stream]");
+		PR_HT_CAP((rc->ht_cap & WLAN_RC_TS_FLAG), "[3-Stream]");
+		PR_HT_CAP((rc->ht_cap & WLAN_RC_SGI_FLAG), "[SGI]");
+		len += snprintf(buf + len, max - len, "\n");
+	}
+
 	if (len > max)
 		len = max;
 
drivers/net/wireless/ath/ath9k/rc.h +6 -0
index 267dbfc..d9089b9 100644
@@ -131,6 +131,12 @@ enum {
 #define WLAN_RC_SGI_FLAG        (0x08)
 #define WLAN_RC_HT_FLAG         (0x10)
 
+#define PR_HT_CAP(_cond, _str)						\
+	do {								\
+		if (_cond)						\
+			len += snprintf(buf + len, max - len, _str);	\
+	} while (0)
+
 /**
  * struct ath_rate_table - Rate Control table
  * @rate_cnt: total number of rates for the given wireless mode
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 2/3 ath9k: Fix ATH9K_HW_CAP_HT usage

From: Sujith Manoharan <[email protected]>

There are a few places where the station's HT capabilities should be checked instead of ATH9K_HW_CAP_HT, which is a global feature for the driver. Fix this.

---
 drivers/net/wireless/ath/ath9k/main.c | 13 +++++--------
 drivers/net/wireless/ath/ath9k/xmit.c |  5 ++---
 2 files changed, 7 insertions(+), 11 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +5 -8
index 5432f12..6e66f9c 100644
@@ -320,28 +320,25 @@ static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta,
 			    struct ieee80211_vif *vif)
 {
 	struct ath_node *an;
-	u8 density;
 	an = (struct ath_node *)sta->drv_priv;
 
 	an->sc = sc;
 	an->sta = sta;
 	an->vif = vif;
 
-	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
-		ath_tx_node_init(sc, an);
+	ath_tx_node_init(sc, an);
+
+	if (sta->ht_cap.ht_supported) {
 		an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR +
 				     sta->ht_cap.ampdu_factor);
-		density = ath9k_parse_mpdudensity(sta->ht_cap.ampdu_density);
-		an->mpdudensity = density;
+		an->mpdudensity = ath9k_parse_mpdudensity(sta->ht_cap.ampdu_density);
 	}
 }
 
 static void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta)
 {
 	struct ath_node *an = (struct ath_node *)sta->drv_priv;
-
-	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
-		ath_tx_node_cleanup(sc, an);
+	ath_tx_node_cleanup(sc, an);
 }
 
 void ath9k_tasklet(unsigned long data)
drivers/net/wireless/ath/ath9k/xmit.c +2 -3
index feacaaf..89a6441 100644
@@ -1233,7 +1233,7 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
 	 * in HT IBSS when a beacon with HT-info is received after the station
 	 * has already been added.
 	 */
-	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
+	if (sta->ht_cap.ht_supported) {
 		an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR +
 				     sta->ht_cap.ampdu_factor);
 		density = ath9k_parse_mpdudensity(sta->ht_cap.ampdu_density);
@@ -1904,8 +1904,7 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct sk_buff *skb,
 	struct ath_buf *bf;
 	u8 tidno;
 
-	if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) && txctl->an &&
-		ieee80211_is_data_qos(hdr->frame_control)) {
+	if (txctl->an && ieee80211_is_data_qos(hdr->frame_control)) {
 		tidno = ieee80211_get_qos_ctl(hdr)[0] &
 			IEEE80211_QOS_CTL_TID_MASK;
 		tid = ATH_AN_2_TID(txctl->an, tidno);
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH 3/3 ath9k: Fix IBSS joiner mode

In reply to Sujith Manoharan

From: Sujith Manoharan <[email protected]>

On joining an existing IBSS network, beaconing has to start only after a TSF sync has happened by receiving a beacon from the BSS. In creator mode, beaconing can start immediately after a HW reset has been done.

Now that mac80211 notifies the driver of the mode type (creator/joiner) via ieee80211_bss_conf->ibss_creator, make use of it to properly setup the HW beacon timers.

---
 drivers/net/wireless/ath/ath9k/ath9k.h  |   1 +
 drivers/net/wireless/ath/ath9k/beacon.c | 113 ++++++++++++++++++++++++--------
 drivers/net/wireless/ath/ath9k/recv.c   |   2 +-
 3 files changed, 89 insertions(+), 27 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +1 -0
index 97c90b2..a56b241 100644
@@ -389,6 +389,7 @@ struct ath_beacon_config {
 	u16 bmiss_timeout;
 	u8 dtim_count;
 	bool enable_beacon;
+	bool ibss_creator;
 };
 
 struct ath_beacon {
drivers/net/wireless/ath/ath9k/beacon.c +87 -26

166 lines not on this page · raw message

drivers/net/wireless/ath/ath9k/recv.c +1 -1
index 2d0fd17..ee156e5 100644
@@ -533,7 +533,7 @@ static void ath_rx_ps_beacon(struct ath_softc *sc, struct sk_buff *skb)
 	if (sc->ps_flags & PS_BEACON_SYNC) {
 		sc->ps_flags &= ~PS_BEACON_SYNC;
 		ath_dbg(common, PS,
-			"Reconfigure Beacon timers based on timestamp from the AP\n");
+			"Reconfigure beacon timers based on synchronized timestamp\n");
 		ath9k_set_beacon(sc);
 	}
 
Signature · 1 line
1.8.1.2
Tested-by on v1 3/3
#3 lore raw

Re: [PATCH 3/3] ath9k: Fix IBSS joiner mode

Quoted 7 lines · Sujith Manoharan

From: Sujith Manoharan <[email protected]>

On joining an existing IBSS network, beaconing has to start only after a TSF sync has happened by receiving a beacon from the BSS. In creator mode, beaconing can start immediately after a HW reset has been done.

Quoted 6 lines

Now that mac80211 notifies the driver of the mode type (creator/joiner) via ieee80211_bss_conf->ibss_creator, make use of it to properly setup the HW beacon timers.

---

Even though my IBSS network isn't as large as it was when i experienced the most severe problems, i see no stuck beacon now; the network is much more reliable.

Thanks.

#4 lore raw

Re: [PATCH 3/3] ath9k: Fix IBSS joiner mode

Quoted 7 lines · Nicolas Cavallari

Even though my IBSS network isn't as large as it was when i experienced the most severe problems, i see no stuck beacon now; the network is much more reliable.

Thanks.

Thanks for testing !

Sujith

#7 lore raw
Quoted 3 lines · John W. Linville
Quoted 1 line

John, please drop this patch.

Just the "1/3" one? Or the whole series?

Just this one, the other 2 patches can be applied.

Sujith