Skip to contentSkip to conversation

ar9170: 802.11n RX Part

RFC Superseded Christian Lamparter 2 participants 5 messages Apr 14, 2009 – Apr 18, 2009

lore
Share & tools
lore
#0 lore raw

RFC 1/1 ar9170: 802.11n RX Part

With this patch you can finally tune your ar9170 radio to the next network and listen to the sound of HT.

Of course, you won't be able to sing along with all other 11n devices. We still need a rate algo, BA support (weird stuff!) for HT before we can think about coding it.

Regards,
Chr
---

drivers/net/wireless/ath/ar9170/ar9170.h +10 -0
index f797495..066a2ae 100644
@@ -89,6 +89,13 @@ enum ar9170_device_state {
 	AR9170_ASSOCIATED,
 };
 
+struct ar9170_rx_mpdu {
+	struct ar9170_rx_head head;
+	struct ar9170_rx_tail *tail;
+	struct sk_buff_head queue;
+	bool has_head;
+};
+
 struct ar9170 {
 	struct ieee80211_hw *hw;
 	struct mutex mutex;
@@ -159,6 +166,9 @@ struct ar9170 {
 	struct sk_buff_head global_tx_status;
 	struct sk_buff_head global_tx_status_waste;
 	struct delayed_work tx_status_janitor;
+
+	/* rx mpdu merge */
+	struct ar9170_rx_mpdu rx_mpdu;
 };
 
 struct ar9170_sta_info {
drivers/net/wireless/ath/ar9170/main.c +216 -72

410 lines not on this page · raw message

#1 lore raw
Quoted 1 line · On Tue, Apr 14, 2009 at 9:59 PM, Christian Lamparter <[email protected]> = wrote:

With this patch you can finally tune your ar9170 radio to the next ne=

twork

Quoted 3 lines

and listen to the sound of HT.

Of course, you won't be able to sing along with all other 11n devices=

=2E

Quoted 7 lines

We still need a rate algo, BA support (weird stuff!) for HT before we can think about coding it.

Regards,
=A0 =A0 =A0 =A0Chr
--
To unsubscribe from this list: send the line "unsubscribe linux-wirel=

ess" in

Quoted 3 lines

the body of a message to [email protected]
More majordomo info at =A0http://vger.kernel.org/majordomo-info.html

A rate algo is needed because wext doesn't support HT rates, and nl80211 doesn't yet have a rate selection feature, preventing manual setting of HT rates, right?

--G=E1bor

--=20
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-) --
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 3 lines · On Tuesday 14 April 2009 22:29:34 G=E1bor Stefanik wrote:
Quoted 1 line · On Tue, Apr 14, 2009 at 9:59 PM, Christian Lamparter <[email protected]= wrote:

With this patch you can finally tune your ar9170 radio to the next =

network

Quoted 3 lines
Quoted 3 lines

and listen to the sound of HT.

Of course, you won't be able to sing along with all other 11n devic=

es.

Quoted 7 lines
Quoted 7 lines

We still need a rate algo, BA support (weird stuff!) for HT before we can think about coding it.

Regards,
Chr
--
To unsubscribe from this list: send the line "unsubscribe linux-wir=

eless" in

Quoted 7 lines
Quoted 3 lines

the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

=20
A rate algo is needed because wext doesn't support HT rates, and nl80211 doesn't yet have a rate selection feature, preventing manual setting of HT rates, right?

Hmm, what are you trying to say/ask?

The rate algo is not the "big problem" here... as nbd will do the most = work.
(in fact its very easy to "emulate" it for now)

BA on the other hand is next to impossible ;-) And even with code from ath9k, it's still ALOT TODO.

Regards,
Chr
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

RFC v2 1/1 ar9170: 802.11n RX Part

In reply to Christian Lamparter

With this patch you can finally tune your ar9170 radio to the next network and listen to the sound of HT.

---

For HT TX we need:
- rate algo that gives us MCS indexes and sets 40MHz and SGI flags.
- Aggregation ( handle & initiate BlockAck (aka BA) sessions )
- and maybe even more...

changes:
- handle & workaround almost all common errors that broke rxstream and caused frame loss.
- added a informative messages if the rxstream is unstable/corrupted too often
- rewrote rx_status code => split mac_status and phy_status into separate codepaths
- don't pass frames that failed plcp & fcs check to the stack, if the appropriate FIF_ flags aren't set.
---

drivers/net/wireless/ath/ar9170/ar9170.h +12 -0
index f797495..acc2783 100644
@@ -89,6 +89,11 @@ enum ar9170_device_state {
 	AR9170_ASSOCIATED,
 };
 
+struct ar9170_rxstream_mpdu_merge {
+	struct ar9170_rx_head plcp;
+	bool has_plcp;
+};
+
 struct ar9170 {
 	struct ieee80211_hw *hw;
 	struct mutex mutex;
@@ -120,6 +125,7 @@ struct ar9170 {
 	u64 cur_mc_hash, want_mc_hash;
 	u32 cur_filter, want_filter;
 	unsigned int filter_changed;
+	unsigned int filter_state;
 	bool sniffer_enabled;
 
 	/* PHY */
@@ -159,6 +165,12 @@ struct ar9170 {
 	struct sk_buff_head global_tx_status;
 	struct sk_buff_head global_tx_status_waste;
 	struct delayed_work tx_status_janitor;
+
+	/* rxstream mpdu merge */
+	struct ar9170_rxstream_mpdu_merge rx_mpdu;
+	struct sk_buff *rx_failover;
+	unsigned long bad_hw_nagger;
+	int rx_failover_missing;
 };
 
 struct ar9170_sta_info {
drivers/net/wireless/ath/ar9170/hw.h +8 -6
index 53e250a..55d402e 100644
@@ -312,7 +312,7 @@ struct ar9170_rx_head {
 	u8 plcp[12];
 } __packed;
 
-struct ar9170_rx_tail {
+struct ar9170_rx_phystatus {
 	union {
 		struct {
 			u8 rssi_ant0, rssi_ant1, rssi_ant2,
@@ -324,6 +324,9 @@ struct ar9170_rx_tail {
 
 	u8 evm_stream0[6], evm_stream1[6];
 	u8 phy_err;
+} __packed;
+
+struct ar9170_rx_macstatus {
 	u8 SAidx, DAidx;
 	u8 error;
 	u8 status;
@@ -339,7 +342,7 @@ struct ar9170_rx_tail {
 
 #define AR9170_RX_ENC_SOFTWARE			0x8
 
-static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_tail *t)
+static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_macstatus *t)
 {
 	return (t->SAidx & 0xc0) >> 4 |
 	       (t->DAidx & 0xc0) >> 6;
@@ -357,10 +360,9 @@ static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_tail *t)
 
 #define AR9170_RX_STATUS_MPDU_MASK		0x30
 #define AR9170_RX_STATUS_MPDU_SINGLE		0x00
-#define AR9170_RX_STATUS_MPDU_FIRST		0x10
-#define AR9170_RX_STATUS_MPDU_MIDDLE		0x20
-#define AR9170_RX_STATUS_MPDU_LAST		0x30
-
+#define AR9170_RX_STATUS_MPDU_FIRST		0x20
+#define AR9170_RX_STATUS_MPDU_MIDDLE		0x30
+#define AR9170_RX_STATUS_MPDU_LAST		0x10
 
 #define AR9170_RX_ERROR_RXTO			0x01
 #define AR9170_RX_ERROR_OVERRUN			0x02
drivers/net/wireless/ath/ar9170/main.c +342 -112

614 lines not on this page · raw message

#4 lore raw

RFC v3 1/1 ar9170: rework rxstream code

With this patch ar9170 is capable of receiving aggregated 802.11n frames and sniffing to most networks without spamming the logs with frame dumps and debug messages like: "missing tag / invalid rx/ errors: xx etc..."
---
changes:

	v2 -> v3
	- handle (expected) phy/mac errors in sniffer mode
	- added useful information about reported mac_status error codes

	v1 -> v2

- handle & workaround almost all common errors that broke rxstream and caused frame loss.
- added a informative messages if the rxstream is unstable/corrupted too often
- rewrote rx_status code => split mac_status and phy_status into separate code paths
- don't pass frames that failed plcp & fcs check to the stack, if the appropriate FIF_ flags aren't set.
---

drivers/net/wireless/ath/ar9170/ar9170.h +12 -0
index f797495..acc2783 100644
@@ -89,6 +89,11 @@ enum ar9170_device_state {
 	AR9170_ASSOCIATED,
 };
 
+struct ar9170_rxstream_mpdu_merge {
+	struct ar9170_rx_head plcp;
+	bool has_plcp;
+};
+
 struct ar9170 {
 	struct ieee80211_hw *hw;
 	struct mutex mutex;
@@ -120,6 +125,7 @@ struct ar9170 {
 	u64 cur_mc_hash, want_mc_hash;
 	u32 cur_filter, want_filter;
 	unsigned int filter_changed;
+	unsigned int filter_state;
 	bool sniffer_enabled;
 
 	/* PHY */
@@ -159,6 +165,12 @@ struct ar9170 {
 	struct sk_buff_head global_tx_status;
 	struct sk_buff_head global_tx_status_waste;
 	struct delayed_work tx_status_janitor;
+
+	/* rxstream mpdu merge */
+	struct ar9170_rxstream_mpdu_merge rx_mpdu;
+	struct sk_buff *rx_failover;
+	unsigned long bad_hw_nagger;
+	int rx_failover_missing;
 };
 
 struct ar9170_sta_info {
drivers/net/wireless/ath/ar9170/hw.h +8 -6
index 53e250a..55d402e 100644
@@ -312,7 +312,7 @@ struct ar9170_rx_head {
 	u8 plcp[12];
 } __packed;
 
-struct ar9170_rx_tail {
+struct ar9170_rx_phystatus {
 	union {
 		struct {
 			u8 rssi_ant0, rssi_ant1, rssi_ant2,
@@ -324,6 +324,9 @@ struct ar9170_rx_tail {
 
 	u8 evm_stream0[6], evm_stream1[6];
 	u8 phy_err;
+} __packed;
+
+struct ar9170_rx_macstatus {
 	u8 SAidx, DAidx;
 	u8 error;
 	u8 status;
@@ -339,7 +342,7 @@ struct ar9170_rx_tail {
 
 #define AR9170_RX_ENC_SOFTWARE			0x8
 
-static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_tail *t)
+static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_macstatus *t)
 {
 	return (t->SAidx & 0xc0) >> 4 |
 	       (t->DAidx & 0xc0) >> 6;
@@ -357,10 +360,9 @@ static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_tail *t)
 
 #define AR9170_RX_STATUS_MPDU_MASK		0x30
 #define AR9170_RX_STATUS_MPDU_SINGLE		0x00
-#define AR9170_RX_STATUS_MPDU_FIRST		0x10
-#define AR9170_RX_STATUS_MPDU_MIDDLE		0x20
-#define AR9170_RX_STATUS_MPDU_LAST		0x30
-
+#define AR9170_RX_STATUS_MPDU_FIRST		0x20
+#define AR9170_RX_STATUS_MPDU_MIDDLE		0x30
+#define AR9170_RX_STATUS_MPDU_LAST		0x10
 
 #define AR9170_RX_ERROR_RXTO			0x01
 #define AR9170_RX_ERROR_OVERRUN			0x02
drivers/net/wireless/ath/ar9170/main.c +359 -112

631 lines not on this page · raw message