Commit cca84799 authored by Christian Lamparter's avatar Christian Lamparter Committed by John W. Linville

ar9170: rework rxstream code

With this patch ar9170 is capable of receiving aggregated 802.11n frames
and sniffing on most networks without having a "debug message overhead".

(Includes phy initialization requested by
Johannes Berg <johannes@sipsolutions.net> -- JWL)
Signed-off-by: default avatarChristian Lamparter <chunkeey@web.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e7ec86f5
...@@ -104,10 +104,16 @@ enum ar9170_device_state { ...@@ -104,10 +104,16 @@ enum ar9170_device_state {
AR9170_ASSOCIATED, AR9170_ASSOCIATED,
}; };
struct ar9170_rxstream_mpdu_merge {
struct ar9170_rx_head plcp;
bool has_plcp;
};
struct ar9170 { struct ar9170 {
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
struct mutex mutex; struct mutex mutex;
enum ar9170_device_state state; enum ar9170_device_state state;
unsigned long bad_hw_nagger;
int (*open)(struct ar9170 *); int (*open)(struct ar9170 *);
void (*stop)(struct ar9170 *); void (*stop)(struct ar9170 *);
...@@ -135,6 +141,7 @@ struct ar9170 { ...@@ -135,6 +141,7 @@ struct ar9170 {
u64 cur_mc_hash, want_mc_hash; u64 cur_mc_hash, want_mc_hash;
u32 cur_filter, want_filter; u32 cur_filter, want_filter;
unsigned int filter_changed; unsigned int filter_changed;
unsigned int filter_state;
bool sniffer_enabled; bool sniffer_enabled;
/* PHY */ /* PHY */
...@@ -174,6 +181,11 @@ struct ar9170 { ...@@ -174,6 +181,11 @@ struct ar9170 {
struct sk_buff_head global_tx_status; struct sk_buff_head global_tx_status;
struct sk_buff_head global_tx_status_waste; struct sk_buff_head global_tx_status_waste;
struct delayed_work tx_status_janitor; struct delayed_work tx_status_janitor;
/* rxstream mpdu merge */
struct ar9170_rxstream_mpdu_merge rx_mpdu;
struct sk_buff *rx_failover;
int rx_failover_missing;
}; };
struct ar9170_sta_info { struct ar9170_sta_info {
......
...@@ -312,7 +312,7 @@ struct ar9170_rx_head { ...@@ -312,7 +312,7 @@ struct ar9170_rx_head {
u8 plcp[12]; u8 plcp[12];
} __packed; } __packed;
struct ar9170_rx_tail { struct ar9170_rx_phystatus {
union { union {
struct { struct {
u8 rssi_ant0, rssi_ant1, rssi_ant2, u8 rssi_ant0, rssi_ant1, rssi_ant2,
...@@ -324,6 +324,9 @@ struct ar9170_rx_tail { ...@@ -324,6 +324,9 @@ struct ar9170_rx_tail {
u8 evm_stream0[6], evm_stream1[6]; u8 evm_stream0[6], evm_stream1[6];
u8 phy_err; u8 phy_err;
} __packed;
struct ar9170_rx_macstatus {
u8 SAidx, DAidx; u8 SAidx, DAidx;
u8 error; u8 error;
u8 status; u8 status;
...@@ -339,7 +342,7 @@ struct ar9170_rx_tail { ...@@ -339,7 +342,7 @@ struct ar9170_rx_tail {
#define AR9170_RX_ENC_SOFTWARE 0x8 #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 | return (t->SAidx & 0xc0) >> 4 |
(t->DAidx & 0xc0) >> 6; (t->DAidx & 0xc0) >> 6;
...@@ -357,10 +360,9 @@ static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_tail *t) ...@@ -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_MASK 0x30
#define AR9170_RX_STATUS_MPDU_SINGLE 0x00 #define AR9170_RX_STATUS_MPDU_SINGLE 0x00
#define AR9170_RX_STATUS_MPDU_FIRST 0x10 #define AR9170_RX_STATUS_MPDU_FIRST 0x20
#define AR9170_RX_STATUS_MPDU_MIDDLE 0x20 #define AR9170_RX_STATUS_MPDU_MIDDLE 0x30
#define AR9170_RX_STATUS_MPDU_LAST 0x30 #define AR9170_RX_STATUS_MPDU_LAST 0x10
#define AR9170_RX_ERROR_RXTO 0x01 #define AR9170_RX_ERROR_RXTO 0x01
#define AR9170_RX_ERROR_OVERRUN 0x02 #define AR9170_RX_ERROR_OVERRUN 0x02
...@@ -369,6 +371,7 @@ static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_tail *t) ...@@ -369,6 +371,7 @@ static inline u8 ar9170_get_decrypt_type(struct ar9170_rx_tail *t)
#define AR9170_RX_ERROR_WRONG_RA 0x10 #define AR9170_RX_ERROR_WRONG_RA 0x10
#define AR9170_RX_ERROR_PLCP 0x20 #define AR9170_RX_ERROR_PLCP 0x20
#define AR9170_RX_ERROR_MMIC 0x40 #define AR9170_RX_ERROR_MMIC 0x40
#define AR9170_RX_ERROR_FATAL 0x80
struct ar9170_cmd_tx_status { struct ar9170_cmd_tx_status {
__le16 unkn; __le16 unkn;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment