Please pull 'upstream' branch of rt2x00
Hi John,
Here is another rt2x00 update for the 2.6.28 kernel, I believe some patches have been send earlier, but I lost my overview on my patches, so this bunch will get rt2x00 completely up to date.
A few patches are needed for rt2800, but they are small, and clean enough to be merged early.
Ivo
---
The following changes since commit b51f3c6077d59b41e3f9d2af33e2e2f94ecbbc39:
John W. Linville (1):
at76_usb: fix for removal of IEEE80211_TX_CTL_DO_NOT_ENCRYPT
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/ivd/rt2x00.git/ upstream
Ivo van Doorn (5):
rt2x00: Fix race conditions in flag handling
rt2x00: Map extra_tx_headroom to DMA
rt2x00: Initialize txop during conf_tx() callback
rt2x00: Add Signal type flag
rt2x00: Release rt2x00 2.2.1
Mattias Nissler (2):
rt2x00: Only configure hardware when radio is enabled
rt2x00: skb->data pointer should not include TX descriptor
drivers/net/wireless/rt2x00/rt2400pci.c | 2 +- drivers/net/wireless/rt2x00/rt2500pci.c | 4 +- drivers/net/wireless/rt2x00/rt2500usb.c | 7 ++- drivers/net/wireless/rt2x00/rt2x00.h | 17 +++--- drivers/net/wireless/rt2x00/rt2x00config.c | 4 +- drivers/net/wireless/rt2x00/rt2x00dev.c | 68 +++++++++++-------------- drivers/net/wireless/rt2x00/rt2x00mac.c | 75 ++++++++++++++-------------- drivers/net/wireless/rt2x00/rt2x00queue.c | 31 +++++++++-- drivers/net/wireless/rt2x00/rt2x00queue.h | 9 ++- drivers/net/wireless/rt2x00/rt2x00rfkill.c | 6 +- drivers/net/wireless/rt2x00/rt2x00usb.c | 21 ++++---- drivers/net/wireless/rt2x00/rt61pci.c | 73 ++++++++++++++++++++++----- drivers/net/wireless/rt2x00/rt73usb.c | 74 ++++++++++++++++++++++----- 13 files changed, 253 insertions(+), 138 deletions(-)
PATCH 1/7 rt2x00: Fix race conditions in flag handling
Some of the flags should be accessed atomically to prevent race conditions. The flags that are most important are those that can change often and indicate the actual state of the device, queue or queue entry.
The big flag rename was done to move all state flags to the same naming type as the other rt2x00dev flags and made sure all places where the flags were used were changed. ;)
Thanks to Stephen for most of the queue flags updates, which fixes some of the most obvious consequences of the race conditions. Among those the notorious:
rt2x00queue_write_tx_frame: Error - Arrived at non-free entry in the non-full queue 0. rt2x00queue_write_tx_frame: Error - Arrived at non-free entry in the non-full queue 0. rt2x00queue_write_tx_frame: Error - Arrived at non-free entry in the non-full queue 0.
--- drivers/net/wireless/rt2x00/rt2400pci.c | 2 +- drivers/net/wireless/rt2x00/rt2500pci.c | 2 +- drivers/net/wireless/rt2x00/rt2500usb.c | 2 +- drivers/net/wireless/rt2x00/rt2x00.h | 16 ++++---- drivers/net/wireless/rt2x00/rt2x00config.c | 4 +- drivers/net/wireless/rt2x00/rt2x00dev.c | 58 ++++++++++++++------------- drivers/net/wireless/rt2x00/rt2x00mac.c | 26 ++++++------ drivers/net/wireless/rt2x00/rt2x00queue.c | 6 +- drivers/net/wireless/rt2x00/rt2x00rfkill.c | 6 +- drivers/net/wireless/rt2x00/rt2x00usb.c | 10 ++-- drivers/net/wireless/rt2x00/rt61pci.c | 2 +- 11 files changed, 68 insertions(+), 66 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +1 -1
@@ -1241,7 +1241,7 @@ static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance)if (!reg)return IRQ_NONE ; -if (!test_bit (DEVICE_ENABLED_RADIO , &rt2x00dev->flags)) +if (!test_bit (DEVICE_STATE_ENABLED_RADIO , &rt2x00dev->flags))return IRQ_HANDLED ;/*
drivers/net/wireless/rt2x00/rt2500pci.c +1 -1
@@ -1377,7 +1377,7 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)if (!reg)return IRQ_NONE ; -if (!test_bit (DEVICE_ENABLED_RADIO , &rt2x00dev->flags)) +if (!test_bit (DEVICE_STATE_ENABLED_RADIO , &rt2x00dev->flags))return IRQ_HANDLED ;/*
drivers/net/wireless/rt2x00/rt2500usb.c +1 -1
@@ -1297,7 +1297,7 @@ static void rt2500usb_beacondone(struct urb *urb)struct queue_entry *entry = (struct queue_entry *)urb->context;struct queue_entry_priv_usb_bcn *bcn_priv = entry->priv_data; -if (!test_bit (DEVICE_ENABLED_RADIO , &entry->queue->rt2x00dev->flags)) +if (!test_bit (DEVICE_STATE_ENABLED_RADIO , &entry->queue->rt2x00dev->flags))return ;/*
drivers/net/wireless/rt2x00/rt2x00.h +8 -8
@@ -629,14 +629,14 @@ enum rt2x00_flags {/* * Device state flags */ -DEVICE_PRESENT , -DEVICE_REGISTERED_HW , -DEVICE_INITIALIZED , -DEVICE_STARTED , -DEVICE_STARTED_SUSPEND , -DEVICE_ENABLED_RADIO , -DEVICE_DISABLED_RADIO_HW , -DEVICE_DIRTY_CONFIG , +DEVICE_STATE_PRESENT , +DEVICE_STATE_REGISTERED_HW , +DEVICE_STATE_INITIALIZED , +DEVICE_STATE_STARTED , +DEVICE_STATE_STARTED_SUSPEND , +DEVICE_STATE_ENABLED_RADIO , +DEVICE_STATE_DISABLED_RADIO_HW , +DEVICE_STATE_DIRTY_CONFIG ,/* * Driver requirements
drivers/net/wireless/rt2x00/rt2x00config.c +2 -2
@@ -121,7 +121,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,* Antenna setup changes require the RX to be disabled, * else the changes will be ignored by the device. */ -if (test_bit (DEVICE_ENABLED_RADIO , &rt2x00dev->flags)) +if (test_bit (DEVICE_STATE_ENABLED_RADIO , &rt2x00dev->flags))rt2x00lib_toggle_rx (rt2x00dev,STATE_RADIO_RX_OFF_LINK );/*
@@ -136,7 +136,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev, rt2x00dev->link.ant.active.rx = libconf.ant.rx; rt2x00dev->link.ant.active.tx = libconf.ant.tx; -if (test_bit (DEVICE_ENABLED_RADIO , &rt2x00dev->flags)) +if (test_bit (DEVICE_STATE_ENABLED_RADIO , &rt2x00dev->flags))rt2x00lib_toggle_rx (rt2x00dev,STATE_RADIO_RX_ON_LINK ); }
drivers/net/wireless/rt2x00/rt2x00dev.c +30 -28
207 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2x00mac.c +13 -13
@@ -117,7 +117,7 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)* Note that we can only stop the TX queues inside the TX path * due to possible race conditions in mac80211. */ -if (!test_bit (DEVICE_PRESENT , &rt2x00dev->flags)) +if (!test_bit (DEVICE_STATE_PRESENT , &rt2x00dev->flags)) goto exit_fail;/*
@@ -175,7 +175,7 @@ int rt2x00mac_start(struct ieee80211_hw *hw) {struct rt2x00_dev *rt2x00dev = hw->priv; -if (!test_bit (DEVICE_PRESENT , &rt2x00dev->flags)) +if (!test_bit (DEVICE_STATE_PRESENT , &rt2x00dev->flags))return 0 ;return rt2x00lib_start (rt2x00dev);
@@ -186,7 +186,7 @@ void rt2x00mac_stop(struct ieee80211_hw *hw) {struct rt2x00_dev *rt2x00dev = hw->priv; -if (!test_bit (DEVICE_PRESENT , &rt2x00dev->flags)) +if (!test_bit (DEVICE_STATE_PRESENT , &rt2x00dev->flags))return ;rt2x00lib_stop (rt2x00dev);
@@ -206,8 +206,8 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,* Don't allow interfaces to be added * the device has disappeared. */ -if (!test_bit (DEVICE_PRESENT , &rt2x00dev->flags) || - !test_bit (DEVICE_STARTED , &rt2x00dev->flags)) +if (!test_bit (DEVICE_STATE_PRESENT , &rt2x00dev->flags) || + !test_bit (DEVICE_STATE_STARTED , &rt2x00dev->flags))return -ENODEV ;switch (conf->type) {
@@ -256,7 +256,7 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,*/ for (i =0 ; i < queue->limit; i++) { entry = &queue->entries[i]; -if (!__test_and_set_bit (ENTRY_BCN_ASSIGNED , &entry->flags)) +if (!test_and_set_bit (ENTRY_BCN_ASSIGNED , &entry->flags))break ; }
@@ -310,7 +310,7 @@ void rt2x00mac_remove_interface(struct ieee80211_hw *hw,* either the device has disappeared or when * no interface is present. */ -if (!test_bit (DEVICE_PRESENT , &rt2x00dev->flags) || +if (!test_bit (DEVICE_STATE_PRESENT , &rt2x00dev->flags) || (conf->type ==IEEE80211_IF_TYPE_AP && !rt2x00dev->intf_ap_count) || (conf->type !=IEEE80211_IF_TYPE_AP && !rt2x00dev->intf_sta_count))return ;
@@ -324,7 +324,7 @@ void rt2x00mac_remove_interface(struct ieee80211_hw *hw,* Release beacon entry so it is available for * new interfaces again. */ -__clear_bit (ENTRY_BCN_ASSIGNED , &intf->beacon->flags); +clear_bit (ENTRY_BCN_ASSIGNED , &intf->beacon->flags);/* * Make sure the bssid and mac address registers
@@ -344,14 +344,14 @@ int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)* Mac80211 might be calling this function while we are trying * to remove the device or perhaps suspending it. */ -if (!test_bit (DEVICE_PRESENT , &rt2x00dev->flags)) +if (!test_bit (DEVICE_STATE_PRESENT , &rt2x00dev->flags))return 0 ;/* * Check if we need to disable the radio, * if this is not the case, at least the RX must be disabled. */ -if (test_bit (DEVICE_ENABLED_RADIO , &rt2x00dev->flags)) { +if (test_bit (DEVICE_STATE_ENABLED_RADIO , &rt2x00dev->flags)) {if (!conf->radio_enabled)rt2x00lib_disable_radio (rt2x00dev);else
@@ -366,14 +366,14 @@ int rt2x00mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf)* initialized. */ force_reconfig = -__test_and_clear_bit (DEVICE_DIRTY_CONFIG , &rt2x00dev->flags); +test_and_clear_bit (DEVICE_STATE_DIRTY_CONFIG , &rt2x00dev->flags);rt2x00lib_config (rt2x00dev, conf, force_reconfig);/* * Reenable RX only if the radio should be on. */ -if (test_bit (DEVICE_ENABLED_RADIO , &rt2x00dev->flags)) +if (test_bit (DEVICE_STATE_ENABLED_RADIO , &rt2x00dev->flags))rt2x00lib_toggle_rx (rt2x00dev,STATE_RADIO_RX_ON );else if (conf->radio_enabled)return rt2x00lib_enable_radio (rt2x00dev);
@@ -395,7 +395,7 @@ int rt2x00mac_config_interface(struct ieee80211_hw *hw,* Mac80211 might be calling this function while we are trying * to remove the device or perhaps suspending it. */ -if (!test_bit (DEVICE_PRESENT , &rt2x00dev->flags)) +if (!test_bit (DEVICE_STATE_PRESENT , &rt2x00dev->flags))return 0 ;spin_lock (&intf->lock);
drivers/net/wireless/rt2x00/rt2x00queue.c +3 -3
@@ -356,7 +356,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb)if (unlikely (rt2x00queue_full (queue)))return -EINVAL ; -if (__test_and_set_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags)) { +if (test_and_set_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags)) { ERROR(queue->rt2x00dev, "Arrived at non-free entry in the non-full queue %d.\n" "Please file bug report to %s.\n",
@@ -396,7 +396,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb)* the frame to mac80211 because the skb->cb has now been tainted. */ if (unlikely (queue->rt2x00dev->ops->lib->write_tx_data (entry))) { -__clear_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags); +clear_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags);dev_kfree_skb_any (entry->skb); entry->skb =NULL ;return 0 ;
@@ -405,7 +405,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb)if (test_bit (DRIVER_REQUIRE_DMA , &queue->rt2x00dev->flags))rt2x00queue_map_txskb (queue->rt2x00dev, skb); -__set_bit (ENTRY_DATA_PENDING , &entry->flags); +set_bit (ENTRY_DATA_PENDING , &entry->flags);rt2x00queue_index_inc (queue,Q_INDEX );rt2x00queue_write_tx_descriptor (entry, &txdesc);
drivers/net/wireless/rt2x00/rt2x00rfkill.c +3 -3
@@ -41,16 +41,16 @@ static int rt2x00rfkill_toggle_radio(void *data, enum rfkill_state state)/* * Only continue if there are enabled interfaces. */ -if (!test_bit (DEVICE_STARTED , &rt2x00dev->flags)) +if (!test_bit (DEVICE_STATE_STARTED , &rt2x00dev->flags))return 0 ;if (state ==RFKILL_STATE_UNBLOCKED ) {INFO (rt2x00dev,"Hardware button pressed, enabling radio.\n" ); -__clear_bit (DEVICE_DISABLED_RADIO_HW , &rt2x00dev->flags); +clear_bit (DEVICE_STATE_DISABLED_RADIO_HW , &rt2x00dev->flags); retval =rt2x00lib_enable_radio (rt2x00dev); }else if (state ==RFKILL_STATE_SOFT_BLOCKED ) {INFO (rt2x00dev,"Hardware button pressed, disabling radio.\n" ); -__set_bit (DEVICE_DISABLED_RADIO_HW , &rt2x00dev->flags); +set_bit (DEVICE_STATE_DISABLED_RADIO_HW , &rt2x00dev->flags);rt2x00lib_disable_radio (rt2x00dev); }else { WARNING(rt2x00dev, "Received unexpected rfkill state %d.\n",
drivers/net/wireless/rt2x00/rt2x00usb.c +5 -5
@@ -163,7 +163,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;struct txdone_entry_desc txdesc; -if (!test_bit (DEVICE_ENABLED_RADIO , &rt2x00dev->flags) || +if (!test_bit (DEVICE_STATE_ENABLED_RADIO , &rt2x00dev->flags) || !test_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags))return ;
@@ -232,7 +232,7 @@ static inline void rt2x00usb_kick_tx_entry(struct queue_entry *entry) {struct queue_entry_priv_usb *entry_priv = entry->priv_data; -if (__test_and_clear_bit (ENTRY_DATA_PENDING , &entry->flags)) +if (test_and_clear_bit (ENTRY_DATA_PENDING , &entry->flags))usb_submit_urb (entry_priv->urb,GFP_ATOMIC ); }
@@ -283,7 +283,7 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)struct skb_frame_desc *skbdesc =get_skb_frame_desc (entry->skb);u8 rxd[32 ]; -if (!test_bit (DEVICE_ENABLED_RADIO , &rt2x00dev->flags) || +if (!test_bit (DEVICE_STATE_ENABLED_RADIO , &rt2x00dev->flags) || !test_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags))return ;
@@ -293,7 +293,7 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)* a problem. */ if (urb->actual_length < entry->queue->desc_size || urb->status) { -__set_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags); +set_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags);usb_submit_urb (urb,GFP_ATOMIC );return ; }
@@ -361,7 +361,7 @@ void rt2x00usb_init_rxentry(struct rt2x00_dev *rt2x00dev, entry->skb->data, entry->skb->len, rt2x00usb_interrupt_rxdone, entry); -__set_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags); +set_bit (ENTRY_OWNER_DEVICE_DATA , &entry->flags);usb_submit_urb (entry_priv->urb,GFP_ATOMIC ); }EXPORT_SYMBOL_GPL (rt2x00usb_init_rxentry);
drivers/net/wireless/rt2x00/rt61pci.c +1 -1
@@ -2121,7 +2121,7 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance)if (!reg && !reg_mcu)return IRQ_NONE ; -if (!test_bit (DEVICE_ENABLED_RADIO , &rt2x00dev->flags)) +if (!test_bit (DEVICE_STATE_ENABLED_RADIO , &rt2x00dev->flags))return IRQ_HANDLED ;/*
Signature · 1 line
1.5.6.1
PATCH 2/7 rt2x00: Map extra_tx_headroom to DMA
If a driver requests additional headroom it should be mapped to DMA as well because it will be send to the hardware as well (as form of extra descriptor).
--- drivers/net/wireless/rt2x00/rt2x00queue.c | 24 +++++++++++++++++++++--- 1 files changed, 21 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2x00queue.c +21 -3
@@ -100,8 +100,21 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) {struct skb_frame_desc *skbdesc =get_skb_frame_desc (skb); - skbdesc->skb_dma =dma_map_single (rt2x00dev->dev, skb->data, skb->len, -DMA_TO_DEVICE ); +/* +* If device has requested headroom, we should make sure that +* is also mapped to the DMA so it can be used for transfering +* additional descriptor information to the hardware. +*/ +skb_push (skb, rt2x00dev->hw->extra_tx_headroom); + + skbdesc->skb_dma = +dma_map_single (rt2x00dev->dev, skb->data, skb->len,DMA_TO_DEVICE ); + +/* +* Restore data pointer to original location again. +*/ +skb_pull (skb, rt2x00dev->hw->extra_tx_headroom); + skbdesc->flags |=SKBDESC_DMA_MAPPED_TX ; }EXPORT_SYMBOL_GPL (rt2x00queue_map_txskb);
@@ -117,7 +130,12 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) }if (skbdesc->flags &SKBDESC_DMA_MAPPED_TX ) { -dma_unmap_single (rt2x00dev->dev, skbdesc->skb_dma, skb->len, +/* +* Add headroom to the skb length, it has been removed +* by the driver, but it was actually mapped to DMA. +*/ +dma_unmap_single (rt2x00dev->dev, skbdesc->skb_dma, + skb->len + rt2x00dev->hw->extra_tx_headroom,DMA_TO_DEVICE ); skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX ; }
Signature · 1 line
1.5.6.1
PATCH 3/7 rt2x00: Only configure hardware when radio is enabled
From: Mattias Nissler <[email protected]>
Some hardware configuration registers such as antenna and channel configuration can only be written when the radio is enabled. Previously, we didn't consider this, so some configuration items could be set inconsistently after reenabling the radio. This patch changes the config() handler to only reprogram the hardware when the radio is enabled. Configuration changes that are made while the radio is off are postponed until the radio is switched back on. We also leave the radio turned off during initialization and only enable it when requested by mac80211. This allows us to get rid of the DIRTY_CONFIG flag, because the device is now guaranteed to be completely initialized when brought up by mac80211.
--- drivers/net/wireless/rt2x00/rt2x00.h | 1 - drivers/net/wireless/rt2x00/rt2x00dev.c | 10 ------ drivers/net/wireless/rt2x00/rt2x00mac.c | 50 +++++++++++++++--------------- 3 files changed, 25 insertions(+), 36 deletions(-)
drivers/net/wireless/rt2x00/rt2x00.h +0 -1
@@ -636,7 +636,6 @@ enum rt2x00_flags {DEVICE_STATE_STARTED_SUSPEND ,DEVICE_STATE_ENABLED_RADIO , DEVICE_STATE_DISABLED_RADIO_HW, - DEVICE_STATE_DIRTY_CONFIG,/* * Driver requirements
drivers/net/wireless/rt2x00/rt2x00dev.c +0 -10
@@ -1014,21 +1014,11 @@ int rt2x00lib_start(struct rt2x00_dev *rt2x00dev)if (retval)return retval; -/* -* Enable radio. -*/ - retval =rt2x00lib_enable_radio (rt2x00dev); -if (retval) { -rt2x00lib_uninitialize (rt2x00dev); -return retval; - } - rt2x00dev->intf_ap_count =0 ; rt2x00dev->intf_sta_count =0 ; rt2x00dev->intf_associated =0 ;set_bit (DEVICE_STATE_STARTED , &rt2x00dev->flags); -set_bit (DEVICE_STATE_DIRTY_CONFIG , &rt2x00dev->flags);return 0 ; }
drivers/net/wireless/rt2x00/rt2x00mac.c +25 -25
67 lines not on this page · raw message
Signature · 1 line
1.5.6.1
PATCH 4/7 rt2x00: Initialize txop during conf_tx() callback
The txop parameter is supported by rt61pci and rt73usb, and thus should be written to the register instead of using the fixed value set during initialization.
--- drivers/net/wireless/rt2x00/rt2x00mac.c | 5 +- drivers/net/wireless/rt2x00/rt2x00queue.c | 1 + drivers/net/wireless/rt2x00/rt2x00queue.h | 2 + drivers/net/wireless/rt2x00/rt61pci.c | 69 ++++++++++++++++++++++++----- drivers/net/wireless/rt2x00/rt73usb.c | 69 ++++++++++++++++++++++++----- 5 files changed, 122 insertions(+), 24 deletions(-)
drivers/net/wireless/rt2x00/rt2x00mac.c +3 -2
@@ -666,10 +666,11 @@ int rt2x00mac_conf_tx(struct ieee80211_hw *hw, u16 queue_idx, queue->cw_max =10 ;/* cw_min: 2^10 = 1024. */ queue->aifs = params->aifs; + queue->txop = params->txop;INFO (rt2x00dev, -"Configured TX queue %d - CWmin: %d, CWmax: %d, Aifs: %d.\n" , - queue_idx, queue->cw_min, queue->cw_max, queue->aifs); +"Configured TX queue %d - CWmin: %d, CWmax: %d, Aifs: %d, TXop: %d.\n" , + queue_idx, queue->cw_min, queue->cw_max, queue->aifs, queue->txop);return 0 ; }
drivers/net/wireless/rt2x00/rt2x00queue.c +1 -0
@@ -736,6 +736,7 @@ static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev, queue->rt2x00dev = rt2x00dev; queue->qid = qid; + queue->txop =0 ; queue->aifs =2 ; queue->cw_min =5 ; queue->cw_max =10 ;
drivers/net/wireless/rt2x00/rt2x00queue.h +2 -0
@@ -368,6 +368,7 @@ enum queue_index {* @length: Number of frames in queue. * @index: Index pointers to entry positions in the queue, * use &enum queue_index to get a specific index field. +* @txop: maximum burst time. * @aifs: The aifs value for outgoing frames (field ignored in RX queue). * @cw_min: The cw min value for outgoing frames (field ignored in RX queue). * @cw_max: The cw max value for outgoing frames (field ignored in RX queue).
@@ -387,6 +388,7 @@ struct data_queue {unsigned short length;unsigned short index[Q_INDEX_MAX ]; +unsigned short txop;unsigned short aifs;unsigned short cw_min;unsigned short cw_max;
drivers/net/wireless/rt2x00/rt61pci.c +58 -11
87 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt73usb.c +58 -11
87 lines not on this page · raw message
Signature · 1 line
1.5.6.1
PATCH 5/7 rt2x00: Add Signal type flag
Instead of using the PLCP flag to indicate if the signal value is plcp or the bitrate we should add a new flag to mark the bitrate type explicitely. This is usefull when new types are added later for rt2800.
--- drivers/net/wireless/rt2x00/rt2500pci.c | 2 ++ drivers/net/wireless/rt2x00/rt2500usb.c | 2 ++ drivers/net/wireless/rt2x00/rt2x00dev.c | 2 +- drivers/net/wireless/rt2x00/rt2x00queue.h | 7 ++++--- drivers/net/wireless/rt2x00/rt61pci.c | 2 ++ drivers/net/wireless/rt2x00/rt73usb.c | 2 ++ 6 files changed, 13 insertions(+), 4 deletions(-)
drivers/net/wireless/rt2x00/rt2500pci.c +2 -0
@@ -1316,6 +1316,8 @@ static void rt2500pci_fill_rxdone(struct queue_entry *entry,if (rt2x00_get_field32 (word0,RXD_W0_OFDM )) rxdesc->dev_flags |=RXDONE_SIGNAL_PLCP ; +else + rxdesc->dev_flags |=RXDONE_SIGNAL_BITRATE ;if (rt2x00_get_field32 (word0,RXD_W0_MY_BSS )) rxdesc->dev_flags |=RXDONE_MY_BSS ; }
drivers/net/wireless/rt2x00/rt2500usb.c +2 -0
@@ -1280,6 +1280,8 @@ static void rt2500usb_fill_rxdone(struct queue_entry *entry,if (rt2x00_get_field32 (word0,RXD_W0_OFDM )) rxdesc->dev_flags |=RXDONE_SIGNAL_PLCP ; +else + rxdesc->dev_flags |=RXDONE_SIGNAL_BITRATE ;if (rt2x00_get_field32 (word0,RXD_W0_MY_BSS )) rxdesc->dev_flags |=RXDONE_MY_BSS ;
drivers/net/wireless/rt2x00/rt2x00dev.c +1 -1
@@ -653,7 +653,7 @@ void rt2x00lib_rxdone(struct rt2x00_dev *rt2x00dev,if (((rxdesc.dev_flags &RXDONE_SIGNAL_PLCP ) && (rate->plcp == rxdesc.signal)) || - (!(rxdesc.dev_flags &RXDONE_SIGNAL_PLCP ) && + ((rxdesc.dev_flags &RXDONE_SIGNAL_BITRATE ) && (rate->bitrate == rxdesc.signal))) { idx = i;break ;
drivers/net/wireless/rt2x00/rt2x00queue.h +4 -3
@@ -140,13 +140,14 @@ static inline struct skb_frame_desc* get_skb_frame_desc(struct sk_buff *skb)/** * enum rxdone_entry_desc_flags: Flags for &struct rxdone_entry_desc * -* @RXDONE_SIGNAL_PLCP: Does the signal field contain the plcp value, -* or does it contain the bitrate itself. +* @RXDONE_SIGNAL_PLCP: Signal field contains the plcp value. +* @RXDONE_SIGNAL_BITRATE: Signal field contains the bitrate value. * @RXDONE_MY_BSS: Does this frame originate from device's BSS. */ enum rxdone_entry_desc_flags {RXDONE_SIGNAL_PLCP =1 <<0 , -RXDONE_MY_BSS =1 <<1 , +RXDONE_SIGNAL_BITRATE =1 <<1 , +RXDONE_MY_BSS =1 <<2 , };/**
drivers/net/wireless/rt2x00/rt61pci.c +2 -0
@@ -1991,6 +1991,8 @@ static void rt61pci_fill_rxdone(struct queue_entry *entry,if (rt2x00_get_field32 (word0,RXD_W0_OFDM )) rxdesc->dev_flags |=RXDONE_SIGNAL_PLCP ; +else + rxdesc->dev_flags |=RXDONE_SIGNAL_BITRATE ;if (rt2x00_get_field32 (word0,RXD_W0_MY_BSS )) rxdesc->dev_flags |=RXDONE_MY_BSS ; }
drivers/net/wireless/rt2x00/rt73usb.c +2 -0
@@ -1766,6 +1766,8 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry,if (rt2x00_get_field32 (word0,RXD_W0_OFDM )) rxdesc->dev_flags |=RXDONE_SIGNAL_PLCP ; +else + rxdesc->dev_flags |=RXDONE_SIGNAL_BITRATE ;if (rt2x00_get_field32 (word0,RXD_W0_MY_BSS )) rxdesc->dev_flags |=RXDONE_MY_BSS ;
Signature · 1 line
1.5.6.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 6/7 rt2x00: skb->data pointer should not include TX descriptor
From: Mattias Nissler <[email protected]>
Make sure the skb->data pointer points to the frame data, not the TX descriptor. The frame dumping code relies on that.
--- drivers/net/wireless/rt2x00/rt2500usb.c | 3 +-- drivers/net/wireless/rt2x00/rt2x00usb.c | 11 ++++++----- drivers/net/wireless/rt2x00/rt73usb.c | 3 +-- 3 files changed, 8 insertions(+), 9 deletions(-)
drivers/net/wireless/rt2x00/rt2500usb.c +1 -2
@@ -1114,8 +1114,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,rt2x00_set_field32 (&word,TXD_W0_NEW_SEQ ,test_bit (ENTRY_TXD_FIRST_FRAGMENT , &txdesc->flags));rt2x00_set_field32 (&word,TXD_W0_IFS , txdesc->ifs); -rt2x00_set_field32 (&word,TXD_W0_DATABYTE_COUNT , - skb->len - skbdesc->desc_len); +rt2x00_set_field32 (&word,TXD_W0_DATABYTE_COUNT , skb->len);rt2x00_set_field32 (&word,TXD_W0_CIPHER ,CIPHER_NONE );rt2x00_desc_write (txd,0 , word); }
drivers/net/wireless/rt2x00/rt2x00usb.c +6 -5
@@ -168,11 +168,6 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)return ;/* -* Remove the descriptor data from the buffer. -*/ -skb_pull (entry->skb, entry->queue->desc_size); - -/* * Obtain the status about this packet. * Note that when the status is 0 it does not mean the * frame was send out correctly. It only means the frame
@@ -224,6 +219,12 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry) entry->skb->data, length, rt2x00usb_interrupt_txdone, entry); +/* +* Make sure the skb->data pointer points to the frame, not the +* descriptor. +*/ +skb_pull (entry->skb, entry->queue->desc_size); +return 0 ; }EXPORT_SYMBOL_GPL (rt2x00usb_write_tx_data);
drivers/net/wireless/rt2x00/rt73usb.c +1 -2
@@ -1556,8 +1556,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,rt2x00_set_field32 (&word,TXD_W0_KEY_TABLE ,test_bit (ENTRY_TXD_ENCRYPT_PAIRWISE , &txdesc->flags));rt2x00_set_field32 (&word,TXD_W0_KEY_INDEX , txdesc->key_idx); -rt2x00_set_field32 (&word,TXD_W0_DATABYTE_COUNT , - skb->len - skbdesc->desc_len); +rt2x00_set_field32 (&word,TXD_W0_DATABYTE_COUNT , skb->len);rt2x00_set_field32 (&word,TXD_W0_BURST2 ,test_bit (ENTRY_TXD_BURST , &txdesc->flags));rt2x00_set_field32 (&word,TXD_W0_CIPHER_ALG , txdesc->cipher);
Signature · 1 line
1.5.6.1
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 7/7 rt2x00: Release rt2x00 2.2.1
--- drivers/net/wireless/rt2x00/rt2x00.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00.h +1 -1
@@ -44,7 +44,7 @@/* * Module information. */ -#define DRV_VERSION "2.2.0" +#define DRV_VERSION "2.2.1"#define DRV_PROJECT "http://rt2x00.serialmonkey.com"/*
Signature · 1 line
1.5.6.1