rt2x00: Move iv_len into tx descriptor data
PATCH 1/5 rt2x00: Move iv_len into tx descriptor data
By placing the iv_len into the tx descriptor data and by passing this data to the crypto IV handlers we can save multiple calls to ieee80211_get_hdrlen_from_skb() and some if-statements when copying/removing the IV data from the outgoing frame.
--- drivers/net/wireless/rt2x00/rt2x00crypto.c | 19 +++++++++---------- drivers/net/wireless/rt2x00/rt2x00lib.h | 10 ++++++---- drivers/net/wireless/rt2x00/rt2x00queue.c | 8 ++------ drivers/net/wireless/rt2x00/rt2x00queue.h | 2 ++ 4 files changed, 19 insertions(+), 20 deletions(-)
drivers/net/wireless/rt2x00/rt2x00crypto.c +9 -10
@@ -66,6 +66,7 @@ void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry, txdesc->key_idx = hw_key->hw_key_idx; txdesc->iv_offset =ieee80211_get_hdrlen_from_skb (entry->skb); + txdesc->iv_len = hw_key->iv_len;if (!(hw_key->flags &IEEE80211_KEY_FLAG_GENERATE_IV ))__set_bit (ENTRY_TXD_ENCRYPT_IV , &txdesc->flags);
@@ -103,34 +104,32 @@ unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev,return overhead; } -void rt2x00crypto_tx_copy_iv (struct sk_buff *skb,unsigned int iv_len) +void rt2x00crypto_tx_copy_iv (struct sk_buff *skb,struct txentry_desc *txdesc) {struct skb_frame_desc *skbdesc =get_skb_frame_desc (skb); -unsigned int header_length =ieee80211_get_hdrlen_from_skb (skb); -if (unlikely (!iv_len)) +if (unlikely (!txdesc->iv_len))return ;/* Copy IV/EIV data */ -memcpy (skbdesc->iv, skb->data + header_length, iv_len); +memcpy (skbdesc->iv, skb->data + txdesc->iv_offset, txdesc->iv_len); } -void rt2x00crypto_tx_remove_iv (struct sk_buff *skb,unsigned int iv_len) +void rt2x00crypto_tx_remove_iv (struct sk_buff *skb,struct txentry_desc *txdesc) {struct skb_frame_desc *skbdesc =get_skb_frame_desc (skb); -unsigned int header_length =ieee80211_get_hdrlen_from_skb (skb); -if (unlikely (!iv_len)) +if (unlikely (!txdesc->iv_len))return ;/* Copy IV/EIV data */ -memcpy (skbdesc->iv, skb->data + header_length, iv_len); +memcpy (skbdesc->iv, skb->data + txdesc->iv_offset, txdesc->iv_len);/* Move ieee80211 header */ -memmove (skb->data + iv_len, skb->data, header_length); +memmove (skb->data + txdesc->iv_len, skb->data, txdesc->iv_offset);/* Pull buffer to correct size */ -skb_pull (skb, iv_len); +skb_pull (skb, txdesc->iv_len);/* IV/EIV data has officially be stripped */ skbdesc->flags |=FRAME_DESC_IV_STRIPPED ;
drivers/net/wireless/rt2x00/rt2x00lib.h +6 -4
@@ -295,8 +295,10 @@ void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry, struct txentry_desc *txdesc);unsigned int rt2x00crypto_tx_overhead (struct rt2x00_dev *rt2x00dev,struct sk_buff *skb); -void rt2x00crypto_tx_copy_iv (struct sk_buff *skb,unsigned int iv_len); -void rt2x00crypto_tx_remove_iv (struct sk_buff *skb,unsigned int iv_len); +void rt2x00crypto_tx_copy_iv (struct sk_buff *skb, +struct txentry_desc *txdesc); +void rt2x00crypto_tx_remove_iv (struct sk_buff *skb, +struct txentry_desc *txdesc);void rt2x00crypto_tx_insert_iv (struct sk_buff *skb); void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, unsigned int align, unsigned int header_length,
@@ -319,12 +321,12 @@ static inline unsigned int rt2x00crypto_tx_overhead(struct rt2x00_dev *rt2x00dev }static inline void rt2x00crypto_tx_copy_iv (struct sk_buff *skb, -unsigned int iv_len) +struct txentry_desc *txdesc) { }static inline void rt2x00crypto_tx_remove_iv (struct sk_buff *skb, -unsigned int iv_len) +struct txentry_desc *txdesc) { }
drivers/net/wireless/rt2x00/rt2x00queue.c +2 -6
@@ -368,7 +368,6 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb)struct queue_entry *entry =rt2x00queue_get_entry (queue,Q_INDEX );struct txentry_desc txdesc;struct skb_frame_desc *skbdesc; -unsigned int iv_len =0 ;u8 rate_idx, rate_flags;if (unlikely (rt2x00queue_full (queue)))
@@ -390,9 +389,6 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb) entry->skb = skb;rt2x00queue_create_tx_descriptor (entry, &txdesc); -if (IEEE80211_SKB_CB (skb)->control.hw_key !=NULL ) - iv_len =IEEE80211_SKB_CB (skb)->control.hw_key->iv_len; -/* * All information is retrieved from the skb->cb array, * now we should claim ownership of the driver part of that
@@ -415,9 +411,9 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb)if (test_bit (ENTRY_TXD_ENCRYPT , &txdesc.flags) && !test_bit (ENTRY_TXD_ENCRYPT_IV , &txdesc.flags)) {if (test_bit (DRIVER_REQUIRE_COPY_IV , &queue->rt2x00dev->flags)) -rt2x00crypto_tx_copy_iv (skb, iv_len); +rt2x00crypto_tx_copy_iv (skb, &txdesc);else -rt2x00crypto_tx_remove_iv (skb, iv_len); +rt2x00crypto_tx_remove_iv (skb, &txdesc); }/*
drivers/net/wireless/rt2x00/rt2x00queue.h +2 -0
@@ -280,6 +280,7 @@ enum txentry_desc_flags {* @cipher: Cipher type used for encryption. * @key_idx: Key index used for encryption. * @iv_offset: Position where IV should be inserted by hardware. +* @iv_len: Length of IV data. */ struct txentry_desc {unsigned long flags;
@@ -302,6 +303,7 @@ struct txentry_desc {enum cipher cipher;u16 key_idx;u16 iv_offset; +u16 iv_len; };/**
Signature · 1 line
1.6.2.3
PATCH 2/5 rt2x00: Add support for L2 padding during TX/RX
Some hardware require L2 padding between header and payload because both must be aligned to a 4-byte boundary. This hardware also is easier during the RX path since we no longer need to move the entire payload but rather only the header to remove the padding (mac80211 only wants the payload to be 4-byte aligned).
--- drivers/net/wireless/rt2x00/rt2x00.h | 10 ++++ drivers/net/wireless/rt2x00/rt2x00crypto.c | 68 +++++++++++++++++----------- drivers/net/wireless/rt2x00/rt2x00dev.c | 33 +++++++------ drivers/net/wireless/rt2x00/rt2x00lib.h | 27 +++++++++-- drivers/net/wireless/rt2x00/rt2x00queue.c | 39 ++++++++++++++++ drivers/net/wireless/rt2x00/rt2x00queue.h | 14 +++++- 6 files changed, 143 insertions(+), 48 deletions(-)
drivers/net/wireless/rt2x00/rt2x00.h +10 -0
@@ -103,6 +103,15 @@#define GET_DURATION_RES (__size, __rate)(((__size) * 8 * 10) % (__rate))/* +* Determine the alignment requirement, +* to make sure the 802.11 payload is padded to a 4-byte boundrary +* we must determine the address of the payload and calculate the +* amount of bytes needed to move the data. +*/ +#define ALIGN_SIZE (__skb, __header) \ + ( ((unsigned long)((__skb)->data + (__header))) & 3 ) + +/* * Standard timing and size defines. * These values should follow the ieee80211 specifications. */
@@ -590,6 +599,7 @@ enum rt2x00_flags {DRIVER_REQUIRE_SCHEDULED ,DRIVER_REQUIRE_DMA ,DRIVER_REQUIRE_COPY_IV , + DRIVER_REQUIRE_L2PAD,/* * Driver features
drivers/net/wireless/rt2x00/rt2x00crypto.c +42 -26
112 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2x00dev.c +18 -15
@@ -227,6 +227,7 @@ void rt2x00lib_txdone(struct queue_entry *entry,struct ieee80211_tx_info *tx_info =IEEE80211_SKB_CB (entry->skb);struct skb_frame_desc *skbdesc =get_skb_frame_desc (entry->skb);enum data_queue_qid qid =skb_get_queue_mapping (entry->skb); +unsigned int header_length =ieee80211_get_hdrlen_from_skb (entry->skb);u8 rate_idx, rate_flags;/*
@@ -235,13 +236,19 @@ void rt2x00lib_txdone(struct queue_entry *entry,rt2x00queue_unmap_skb (rt2x00dev, entry->skb);/* +* Remove L2 padding which was added during +*/ +if (test_bit (DRIVER_REQUIRE_L2PAD , &rt2x00dev->flags)) +rt2x00queue_payload_align (entry->skb, true, header_length); + +/* * If the IV/EIV data was stripped from the frame before it was * passed to the hardware, we should now reinsert it again because * mac80211 will expect the the same data to be present it the * frame as it was passed to us. */ if (test_bit (CONFIG_SUPPORT_HW_CRYPTO , &rt2x00dev->flags)) -rt2x00crypto_tx_insert_iv (entry->skb); +rt2x00crypto_tx_insert_iv (entry->skb, header_length);/* * Send frame to debugfs immediately, after this call is completed
@@ -325,7 +332,7 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,struct ieee80211_supported_band *sband;const struct rt2x00_rate *rate;unsigned int header_length; -unsigned int align; +bool l2pad;unsigned int i;int idx =-1 ;
@@ -348,12 +355,15 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,memset (&rxdesc,0 ,sizeof (rxdesc)); rt2x00dev->ops->lib->fill_rxdone (entry, &rxdesc); +/* Trim buffer to correct size */ +skb_trim (entry->skb, rxdesc.size); +/* * The data behind the ieee80211 header must be * aligned on a 4 byte boundary. */ header_length =ieee80211_get_hdrlen_from_skb (entry->skb); - align = ((unsigned long )(entry->skb->data + header_length)) &3 ; + l2pad = !!(rxdesc.dev_flags &RXDONE_L2PAD );/* * Hardware might have stripped the IV/EIV/ICV data,
@@ -362,18 +372,11 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,* in which case we should reinsert the data into the frame. */ if ((rxdesc.dev_flags &RXDONE_CRYPTO_IV ) && - (rxdesc.flags &RX_FLAG_IV_STRIPPED )) { -rt2x00crypto_rx_insert_iv (entry->skb, align, - header_length, &rxdesc); - }else if (align) { -skb_push (entry->skb, align); -/* Move entire frame in 1 command */ -memmove (entry->skb->data, entry->skb->data + align, - rxdesc.size); - } - -/* Update data pointers, trim buffer to correct size */ -skb_trim (entry->skb, rxdesc.size); + (rxdesc.flags &RX_FLAG_IV_STRIPPED )) +rt2x00crypto_rx_insert_iv (entry->skb, l2pad, header_length, + &rxdesc); +else +rt2x00queue_payload_align (entry->skb, l2pad, header_length);/* * Update RX statistics.
drivers/net/wireless/rt2x00/rt2x00lib.h +22 -5
@@ -113,6 +113,23 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb);void rt2x00queue_free_skb (struct rt2x00_dev *rt2x00dev,struct sk_buff *skb);/** +* rt2x00queue_payload_align - Align 802.11 payload to 4-byte boundary +* @skb: The skb to align +* @l2pad: Should L2 padding be used +* @header_length: Length of 802.11 header +* +* This function prepares the @skb to be send to the device or mac80211. +* If @l2pad is set to true padding will occur between the 802.11 header +* and payload. Otherwise the padding will be done in front of the 802.11 +* header. +* When @l2pad is set the function will check for the &SKBDESC_L2_PADDED +* flag in &skb_frame_desc. If that flag is set, the padding is removed +* and the flag cleared. Otherwise the padding is added and the flag is set. +*/ +void rt2x00queue_payload_align (struct sk_buff *skb, +bool l2pad,unsigned int header_length); + +/** * rt2x00queue_write_tx_frame - Write TX frame to hardware * @queue: Queue over which the frame should be send * @skb: The skb to send
@@ -299,8 +316,8 @@ void rt2x00crypto_tx_copy_iv(struct sk_buff *skb, struct txentry_desc *txdesc);void rt2x00crypto_tx_remove_iv (struct sk_buff *skb,struct txentry_desc *txdesc); -void rt2x00crypto_tx_insert_iv (struct sk_buff *skb); -void rt2x00crypto_rx_insert_iv (struct sk_buff *skb,unsigned int align, +void rt2x00crypto_tx_insert_iv (struct sk_buff *skb,unsigned int header_length); +void rt2x00crypto_rx_insert_iv (struct sk_buff *skb,bool l2pad,unsigned int header_length,struct rxdone_entry_desc *rxdesc);#else
@@ -330,12 +347,12 @@ static inline void rt2x00crypto_tx_remove_iv(struct sk_buff *skb, { } -static inline void rt2x00crypto_tx_insert_iv (struct sk_buff *skb) +static inline void rt2x00crypto_tx_insert_iv (struct sk_buff *skb, +unsigned int header_length) { } -static inline void rt2x00crypto_rx_insert_iv (struct sk_buff *skb, -unsigned int align, +static inline void rt2x00crypto_rx_insert_iv (struct sk_buff *skb,bool l2pad,unsigned int header_length,struct rxdone_entry_desc *rxdesc) {
drivers/net/wireless/rt2x00/rt2x00queue.c +39 -0
@@ -148,6 +148,35 @@ void rt2x00queue_free_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb)dev_kfree_skb_any (skb); } +void rt2x00queue_payload_align (struct sk_buff *skb, +bool l2pad,unsigned int header_length) +{ +struct skb_frame_desc *skbdesc =get_skb_frame_desc (skb); +unsigned int frame_length = skb->len; +unsigned int align =ALIGN_SIZE (skb, header_length); + +if (!align) +return ; + +if (l2pad) { +if (skbdesc->flags &SKBDESC_L2_PADDED ) { +/* Remove L2 padding */ +memmove (skb->data + align, skb->data, header_length); +skb_pull (skb, align); + skbdesc->flags &= ~SKBDESC_L2_PADDED ; + }else { +/* Add L2 padding */ +skb_push (skb, align); +memmove (skb->data, skb->data + align, header_length); + skbdesc->flags |=SKBDESC_L2_PADDED ; + } + }else { +/* Generic payload alignment to 4-byte boundary */ +skb_push (skb, align); +memmove (skb->data, skb->data + align, frame_length); + } +} +static void rt2x00queue_create_tx_descriptor_seq (struct queue_entry *entry,struct txentry_desc *txdesc) {
@@ -259,6 +288,12 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry, txdesc->aifs = entry->queue->aifs;/* +* Header and alignment information. +*/ + txdesc->header_length =ieee80211_get_hdrlen_from_skb (entry->skb); + txdesc->l2pad =ALIGN_SIZE (entry->skb, txdesc->header_length); + +/* * Check whether this frame is to be acked. */ if (!(tx_info->flags &IEEE80211_TX_CTL_NO_ACK ))
@@ -416,6 +451,10 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb)rt2x00crypto_tx_remove_iv (skb, &txdesc); } +if (test_bit (DRIVER_REQUIRE_L2PAD , &queue->rt2x00dev->flags)) +rt2x00queue_payload_align (entry->skb, true, + txdesc.header_length); +/* * It could be possible that the queue was corrupted and this * call failed. Since we always return NETDEV_TX_OK to mac80211,
drivers/net/wireless/rt2x00/rt2x00queue.h +12 -2
@@ -87,13 +87,16 @@ enum data_queue_qid {* * @SKBDESC_DMA_MAPPED_RX: &skb_dma field has been mapped for RX * @SKBDESC_DMA_MAPPED_TX: &skb_dma field has been mapped for TX -* @FRAME_DESC_IV_STRIPPED: Frame contained a IV/EIV provided by +* @SKBDESC_IV_STRIPPED: Frame contained a IV/EIV provided by * mac80211 but was stripped for processing by the driver. +* @SKBDESC_L2_PADDED: Payload has been padded for 4-byte alignment, +* the padded bytes are located between header and payload. */ enum skb_frame_desc_flags {SKBDESC_DMA_MAPPED_RX =1 <<0 ,SKBDESC_DMA_MAPPED_TX =1 <<1 , -FRAME_DESC_IV_STRIPPED =1 <<2 , +SKBDESC_IV_STRIPPED =1 <<2 , +SKBDESC_L2_PADDED =1 <<3 };/**
@@ -148,6 +151,7 @@ static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb)* @RXDONE_MY_BSS: Does this frame originate from device's BSS. * @RXDONE_CRYPTO_IV: Driver provided IV/EIV data. * @RXDONE_CRYPTO_ICV: Driver provided ICV data. +* @RXDONE_L2PAD: 802.11 payload has been padded to 4-byte boundary. */ enum rxdone_entry_desc_flags {RXDONE_SIGNAL_PLCP =1 <<0 ,
@@ -155,6 +159,7 @@ enum rxdone_entry_desc_flags {RXDONE_MY_BSS =1 <<2 ,RXDONE_CRYPTO_IV =1 <<3 ,RXDONE_CRYPTO_ICV =1 <<4 , + RXDONE_L2PAD = 1 << 5, };/**
@@ -267,6 +272,8 @@ enum txentry_desc_flags {* * @flags: Descriptor flags (See &enum queue_entry_flags). * @queue: Queue identification (See &enum data_queue_qid). +* @header_length: Length of 802.11 header. +* @l2pad: Amount of padding to align 802.11 payload to 4-byte boundrary. * @length_high: PLCP length high word. * @length_low: PLCP length low word. * @signal: PLCP signal.
@@ -287,6 +294,9 @@ struct txentry_desc {enum data_queue_qid queue; +u16 header_length; +u16 l2pad; +u16 length_high;u16 length_low;u16 signal;
Signature · 1 line
1.6.2.3
PATCH 3/5 rt2x00: Fix the interval for rfkill and link_tuner.
From: Alban Browaeys <[email protected]>
extra parenthesis made the value an argument and the value of the define empty. This was triggering those very fast.
--- drivers/net/wireless/rt2x00/rt2x00lib.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/rt2x00/rt2x00lib.h +2 -2
@@ -32,8 +32,8 @@* Interval defines * Both the link tuner as the rfkill will be called once per second. */ -#define LINK_TUNE_INTERVAL ( round_jiffies_relative(HZ) ) -#define RFKILL_POLL_INTERVAL ( 1000 ) +#define LINK_TUNE_INTERVAL round_jiffies_relative(HZ) +#define RFKILL_POLL_INTERVAL 1000/* * rt2x00_rate: Per rate device information
Signature · 1 line
1.6.2.3
PATCH 4/5 rt2x00: Implement support for 802.11n
Extend rt2x00lib capabilities to support 802.11n,
it still lacks aggregation support, but that can
be added in the future.
--- drivers/net/wireless/rt2x00/Kconfig | 3 + drivers/net/wireless/rt2x00/Makefile | 1 + drivers/net/wireless/rt2x00/rt2x00.h | 11 +++ drivers/net/wireless/rt2x00/rt2x00config.c | 5 ++ drivers/net/wireless/rt2x00/rt2x00dev.c | 92 ++++++++++++++++++++-------- drivers/net/wireless/rt2x00/rt2x00ht.c | 69 +++++++++++++++++++++ drivers/net/wireless/rt2x00/rt2x00lib.h | 24 +++++++ drivers/net/wireless/rt2x00/rt2x00queue.c | 1 + drivers/net/wireless/rt2x00/rt2x00queue.h | 39 +++++++++--- 9 files changed, 211 insertions(+), 34 deletions(-) create mode 100644 drivers/net/wireless/rt2x00/rt2x00ht.c
drivers/net/wireless/rt2x00/Kconfig +3 -0
@@ -88,6 +88,9 @@ config RT2X00_LIB_USB config RT2X00_LIB tristate +config RT2X00_LIB_HT + boolean + config RT2X00_LIB_FIRMWARE boolean select FW_LOADER
drivers/net/wireless/rt2x00/Makefile +1 -0
@@ -8,6 +8,7 @@ rt2x00lib-$(CONFIG_RT2X00_LIB_CRYPTO) += rt2x00crypto.o rt2x00lib-$(CONFIG_RT2X00_LIB_RFKILL) += rt2x00rfkill.o rt2x00lib-$(CONFIG_RT2X00_LIB_FIRMWARE) += rt2x00firmware.o rt2x00lib-$(CONFIG_RT2X00_LIB_LEDS) += rt2x00leds.o +rt2x00lib-$(CONFIG_RT2X00_LIB_HT) += rt2x00ht.o obj-$(CONFIG_RT2X00_LIB) += rt2x00lib.o obj-$(CONFIG_RT2X00_LIB_PCI) += rt2x00pci.o
drivers/net/wireless/rt2x00/rt2x00.h +11 -0
@@ -366,6 +366,7 @@ static inline struct rt2x00_intf* vif_to_intf(struct ieee80211_vif *vif)* for @tx_power_a, @tx_power_bg and @channels. * @channels: Device/chipset specific channel values (See &struct rf_channel). * @channels_info: Additional information for channels (See &struct channel_info). +* @ht: Driver HT Capabilities (See &ieee80211_sta_ht_cap). */ struct hw_mode_spec {unsigned int supported_bands;
@@ -379,6 +380,8 @@ struct hw_mode_spec {unsigned int num_channels;const struct rf_channel *channels;const struct channel_info *channels_info; + +struct ieee80211_sta_ht_cap ht; };/*
@@ -616,6 +619,7 @@ enum rt2x00_flags {CONFIG_EXTERNAL_LNA_BG ,CONFIG_DOUBLE_ANTENNA ,CONFIG_DISABLE_LINK_TUNING , + CONFIG_CHANNEL_HT40, };/*
@@ -788,6 +792,13 @@ struct rt2x00_dev {u8 freq_offset;/* +* Calibration information (for rt2800usb & rt2800pci). +* [0] -> BW20 +* [1] -> BW40 +*/ +u8 calibration[2 ]; + +/* * Low level statistics which will have * to be kept up to date while device is running. */
drivers/net/wireless/rt2x00/rt2x00config.c +5 -0
@@ -173,6 +173,11 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, libconf.conf = conf;if (ieee80211_flags &IEEE80211_CONF_CHANGE_CHANNEL ) { +if (conf_is_ht40 (conf)) +__set_bit (CONFIG_CHANNEL_HT40 , &rt2x00dev->flags); +else +__clear_bit (CONFIG_CHANNEL_HT40 , &rt2x00dev->flags); +memcpy (&libconf.rf, &rt2x00dev->spec.channels[conf->channel->hw_value],sizeof (libconf.rf));
drivers/net/wireless/rt2x00/rt2x00dev.c +67 -25
203 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2x00ht.c new file +69 -0
69 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2x00lib.h +24 -0
@@ -48,6 +48,7 @@ struct rt2x00_rate {unsigned short ratemask;unsigned short plcp; +unsigned short mcs; };extern const struct rt2x00_rate rt2x00_supported_rates[12 ];
@@ -57,6 +58,14 @@ static inline const struct rt2x00_rate *rt2x00_get_rate(const u16 hw_value)return &rt2x00_supported_rates[hw_value &0xff ]; } +#define RATE_MCS (__mode, __mcs) \ + ( (((__mode) & 0x00ff) << 8) | ((__mcs) & 0x00ff) ) + +static inline int rt2x00_get_rate_mcs (const u16 mcs_value) +{ +return (mcs_value &0x00ff ); +} +/* * Radio control handlers. */
@@ -360,6 +369,21 @@ static inline void rt2x00crypto_rx_insert_iv(struct sk_buff *skb, bool l2pad,#endif /* CONFIG_RT2X00_LIB_CRYPTO */ /* +* HT handlers. +*/ +#ifdef CONFIG_RT2X00_LIB_HT +void rt2x00ht_create_tx_descriptor (struct queue_entry *entry, +struct txentry_desc *txdesc, +const struct rt2x00_rate *hwrate); +#else +static inline void rt2x00ht_create_tx_descriptor (struct queue_entry *entry, +struct txentry_desc *txdesc, +const struct rt2x00_rate *hwrate) +{ +} +#endif /* CONFIG_RT2X00_LIB_HT */ + +/* * RFkill handlers. */ #ifdef CONFIG_RT2X00_LIB_RFKILL
drivers/net/wireless/rt2x00/rt2x00queue.c +1 -0
@@ -361,6 +361,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,* Apply TX descriptor handling by components */ rt2x00crypto_create_tx_descriptor (entry, txdesc); +rt2x00ht_create_tx_descriptor (entry, txdesc, hwrate);rt2x00queue_create_tx_descriptor_seq (entry, txdesc);rt2x00queue_create_tx_descriptor_plcp (entry, txdesc, hwrate); }
drivers/net/wireless/rt2x00/rt2x00queue.h +30 -9
@@ -35,9 +35,12 @@* for USB devices this restriction does not apply, but the value of * 2432 makes sense since it is big enough to contain the maximum fragment * size according to the ieee802.11 specs. +* The aggregation size depends on support from the driver, but should +* be something around 3840 bytes. */ -#define DATA_FRAME_SIZE 2432 -#define MGMT_FRAME_SIZE 256 +#define DATA_FRAME_SIZE 2432 +#define MGMT_FRAME_SIZE 256 +#define AGGREGATION_SIZE 3840/** * DOC: Number of entries per queue
@@ -148,18 +151,20 @@ static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb)* * @RXDONE_SIGNAL_PLCP: Signal field contains the plcp value. * @RXDONE_SIGNAL_BITRATE: Signal field contains the bitrate value. +* @RXDONE_SIGNAL_MCS: Signal field contains the mcs value. * @RXDONE_MY_BSS: Does this frame originate from device's BSS. * @RXDONE_CRYPTO_IV: Driver provided IV/EIV data. * @RXDONE_CRYPTO_ICV: Driver provided ICV data. * @RXDONE_L2PAD: 802.11 payload has been padded to 4-byte boundary. */ enum rxdone_entry_desc_flags { -RXDONE_SIGNAL_PLCP =1 <<0 , -RXDONE_SIGNAL_BITRATE =1 <<1 , -RXDONE_MY_BSS =1 <<2 , -RXDONE_CRYPTO_IV =1 <<3 , -RXDONE_CRYPTO_ICV =1 <<4 , -RXDONE_L2PAD =1 <<5 , +RXDONE_SIGNAL_PLCP =BIT (0 ), +RXDONE_SIGNAL_BITRATE =BIT (1 ), +RXDONE_SIGNAL_MCS =BIT (2 ), +RXDONE_MY_BSS =BIT (3 ), +RXDONE_CRYPTO_IV =BIT (4 ), +RXDONE_CRYPTO_ICV =BIT (5 ), +RXDONE_L2PAD =BIT (6 ), };/**
@@ -168,7 +173,7 @@ enum rxdone_entry_desc_flags {* from &rxdone_entry_desc to a signal value type. */ #define RXDONE_SIGNAL_MASK \ - ( RXDONE_SIGNAL_PLCP | RXDONE_SIGNAL_BITRATE ) + ( RXDONE_SIGNAL_PLCP | RXDONE_SIGNAL_BITRATE | RXDONE_SIGNAL_MCS )/** * struct rxdone_entry_desc: RX Entry descriptor
@@ -182,6 +187,7 @@ enum rxdone_entry_desc_flags {* @size: Data size of the received frame. * @flags: MAC80211 receive flags (See &enum mac80211_rx_flags). * @dev_flags: Ralink receive flags (See &enum rxdone_entry_desc_flags). +* @rate_mode: Rate mode (See @enum rate_modulation). * @cipher: Cipher type used during decryption. * @cipher_status: Decryption status. * @iv: IV/EIV data used during decryption.
@@ -195,6 +201,7 @@ struct rxdone_entry_desc {int size;int flags;int dev_flags; +u16 rate_mode;u8 cipher;u8 cipher_status;
@@ -248,6 +255,9 @@ struct txdone_entry_desc {* @ENTRY_TXD_ENCRYPT_PAIRWISE: Use pairwise key table (instead of shared). * @ENTRY_TXD_ENCRYPT_IV: Generate IV/EIV in hardware. * @ENTRY_TXD_ENCRYPT_MMIC: Generate MIC in hardware. +* @ENTRY_TXD_HT_AMPDU: This frame is part of an AMPDU. +* @ENTRY_TXD_HT_BW_40: Use 40MHz Bandwidth. +* @ENTRY_TXD_HT_SHORT_GI: Use short GI. */ enum txentry_desc_flags {ENTRY_TXD_RTS_FRAME ,
@@ -263,6 +273,9 @@ enum txentry_desc_flags {ENTRY_TXD_ENCRYPT_PAIRWISE ,ENTRY_TXD_ENCRYPT_IV ,ENTRY_TXD_ENCRYPT_MMIC , +ENTRY_TXD_HT_AMPDU , +ENTRY_TXD_HT_BW_40 , + ENTRY_TXD_HT_SHORT_GI, };/**
@@ -278,7 +291,11 @@ enum txentry_desc_flags {* @length_low: PLCP length low word. * @signal: PLCP signal. * @service: PLCP service. +* @msc: MCS. +* @stbc: STBC. +* @ba_size: BA size. * @rate_mode: Rate mode (See @enum rate_modulation). +* @mpdu_density: MDPU density. * @retry_limit: Max number of retries. * @aifs: AIFS value. * @ifs: IFS value.
@@ -302,7 +319,11 @@ struct txentry_desc {u16 signal;u16 service; +u16 mcs; +u16 stbc; +u16 ba_size;u16 rate_mode; +u16 mpdu_density;short retry_limit;short aifs;
Signature · 1 line
1.6.2.3
PATCH 5/5 rt2x00: Implement support for rt2800usb
Add support for the rt2800usb chipset.
Current problems:
* Cannot scan 11n AP's
* No TX during first minute after association
* Broken Hardware encryption
Includes various patches from Mattias, Felix, Xose and Axel.
Re: [PATCH 3/5] rt2x00: Fix the interval for rfkill and link_tuner.
In reply to Ivo van DoornQuoted 7 lines · Ivo van Doorn
From: Alban Browaeys <[email protected]>
extra parenthesis made the value an argument and the value of the define empty. This was triggering those very fast.
Signed-off-by Alban Browaeys <[email protected]>Signed-off-by Ivo van Doorn <[email protected]>
???
If that were so, wouldn't that have caused compile-time errors?
John
Quoted 23 lines
--- drivers/net/wireless/rt2x00/rt2x00lib.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)drivers/net/wireless/rt2x00/rt2x00lib.h +2
-2@@ -32,8 +32,8 @@* Interval defines * Both the link tuner as the rfkill will be called once per second. */ -#define LINK_TUNE_INTERVAL ( round_jiffies_relative(HZ) ) -#define RFKILL_POLL_INTERVAL ( 1000 ) +#define LINK_TUNE_INTERVAL round_jiffies_relative(HZ) +#define RFKILL_POLL_INTERVAL 1000/* * rt2x00_rate: Per rate device information Signature · 1 line
1.6.2.3
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
Re: [PATCH 3/5] rt2x00: Fix the interval for rfkill and link_tuner.
Quoted 6 lines · John W. Linville
Quoted 5 lines · Ivo van Doorn
From: Alban Browaeys <[email protected]>
extra parenthesis made the value an argument and the value of the define empty. This was triggering those very fast.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Alban Browaeys <[email protected]>Signed-off-by Ivo van Doorn <[email protected]>???
If that were so, wouldn't that have caused compile-time errors?
I've CCed Alban so he can explain the issue he experienced..
For me this patch is just a style-fix, because those parenthesis were useless anyway.
Ivo
Re: [PATCH 3/5] rt2x00: Fix the interval for rfkill and link_tuner.
Quoted 11 lines · Ivo Van Doorn
Quoted 9 lines · John W. Linville
Quoted 7 lines · Ivo van Doorn
From: Alban Browaeys <[email protected]>
extra parenthesis made the value an argument and the value of the define empty. This was triggering those very fast.
Signed-off-by Alban Browaeys <[email protected]>Signed-off-by Ivo van Doorn <[email protected]>
Quoted 8 lines
Quoted 3 lines
???
If that were so, wouldn't that have caused compile-time errors?
I've CCed Alban so he can explain the issue he experienced..
For me this patch is just a style-fix, because those parenthesis were useless anyway.
I'd be happy to take it as a style fix, but it needs an appropriate changelog for that.
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
Re: [PATCH 3/5] rt2x00: Fix the interval for rfkill and link_tuner.
Quoted 16 lines · John W. Linville
Quoted 15 lines · Ivo Van Doorn
Quoted 12 lines · John W. Linville
Quoted 7 lines · Ivo van Doorn
From: Alban Browaeys <[email protected]>
extra parenthesis made the value an argument and the value of the define empty. This was triggering those very fast.
Signed-off-by Alban Browaeys <[email protected]>Signed-off-by Ivo van Doorn <[email protected]>???
If that were so, wouldn't that have caused compile-time errors?
Quoted 7 lines
Quoted 4 lines
I've CCed Alban so he can explain the issue he experienced..
For me this patch is just a style-fix, because those parenthesis were useless anyway.
I'd be happy to take it as a style fix, but it needs an appropriate changelog for that.
Ok, please drop this patch. I'll send the version with a better description in a few moments.
Ivo
Re: [PATCH 3/5] rt2x00: Fix the interval for rfkill and link_tuner.
In reply to Ivo Van DoornLe mardi 28 avril 2009 =E0 22:18 +0200, Ivo Van Doorn a =E9crit :
Quoted 11 lines
Quoted 9 lines · John W. Linville
Quoted 7 lines · Ivo van Doorn
From: Alban Browaeys <[email protected]>
extra parenthesis made the value an argument and the value of the define empty. This was triggering those very fast.
Signed-off-by Alban Browaeys <[email protected]>Signed-off-by Ivo van Doorn <[email protected]>
Quoted 8 lines
Quoted 3 lines
???
If that were so, wouldn't that have caused compile-time errors?
=20
I've CCed Alban so he can explain the issue he experienced.. =20
For me this patch is just a style-fix, because those parenthesis were useless anyway.
Right this is only style change. Not that when I sent it I thought :
#define A (x)
was like:
#define A(X)()
thus the patch and the comment.
Thankfully it does not hurt though it does not help either . My getting the issue fixed was that I had EV_KEY instead of EV_SW for the rfkill switch. I mixed the results of this test and the one about this patch.
By the way I found out that I had rfkill-input loaded for no good reaso= n
(only because the debian eeepc acpi support package load it at boot). If one load it at the same time as rt2800pci crash follows next rfkill switch.=20
That could be due to the init of the rfkill-input module that register = a
handler to input subsystem. Its connect operation triggers a start whic= h
itself triggers the EV_SW,and swbit code of its device. Thus it would explain that the device is shut down at registration of the input_register_polled_device. =20
=20
This is minor as on eeepc the status is always on (when off the device is out of power and thus no status is available) and the rfkill for wla= n
is already managed by eeepc-laptop platform driver.
One only need not have rfkill-input loaded which is the default on debian and may be required by other uses .
Regards,
Alban
PS: sorry for the mistake and the time I took to tell about it. Finding out the real culprit of the crash/invalid behaviour (crash is new ... reproducible though) took time.
--
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