rt2x00: Implement tx mpdu aggregation
PATCH 1/21 rt2x00: Implement tx mpdu aggregation
From: Helmut Schaa <[email protected]>
In order to implement tx mpdu aggregation we only have to implement the ampdu_action callback such that mac80211 allows negotiation of blockack sessions.
The hardware will handle everything on its own as long as the ampdu flag in the TXWI struct is set up correctly and we translate the tx status correctly.
For now, refuse requests to start rx aggregation.
--- drivers/net/wireless/rt2x00/rt2800lib.c | 34 ++++++++++++++++++++++++++++++- drivers/net/wireless/rt2x00/rt2x00dev.c | 15 +++++++++++++ 2 files changed, 48 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +33 -1
@@ -2499,7 +2499,8 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |IEEE80211_HW_SIGNAL_DBM |IEEE80211_HW_SUPPORTS_PS | -IEEE80211_HW_PS_NULLFUNC_STACK ; +IEEE80211_HW_PS_NULLFUNC_STACK | +IEEE80211_HW_AMPDU_AGGREGATION ;SET_IEEE80211_DEV (rt2x00dev->hw, rt2x00dev->dev); SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
@@ -2751,6 +2752,36 @@ static u64 rt2800_get_tsf(struct ieee80211_hw *hw)return tsf; } +static int rt2800_ampdu_action (struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +enum ieee80211_ampdu_mlme_action action, +struct ieee80211_sta *sta, +u16 tid,u16 *ssn) +{ +struct rt2x00_dev *rt2x00dev = hw->priv; +int ret =0 ; + +switch (action) { +case IEEE80211_AMPDU_RX_START : +case IEEE80211_AMPDU_RX_STOP : +/* we don't support RX aggregation yet */ + ret = -ENOTSUPP ; +break ; +case IEEE80211_AMPDU_TX_START : +ieee80211_start_tx_ba_cb_irqsafe (vif, sta->addr, tid); +break ; +case IEEE80211_AMPDU_TX_STOP : +ieee80211_stop_tx_ba_cb_irqsafe (vif, sta->addr, tid); +break ; +case IEEE80211_AMPDU_TX_OPERATIONAL : +break ; +default : +WARNING (rt2x00dev,"Unknown AMPDU action\n" ); + } + +return ret; +} +const struct ieee80211_ops rt2800_mac80211_ops = { .tx = rt2x00mac_tx, .start = rt2x00mac_start,
@@ -2768,6 +2799,7 @@ const struct ieee80211_ops rt2800_mac80211_ops = { .conf_tx = rt2800_conf_tx, .get_tsf = rt2800_get_tsf, .rfkill_poll = rt2x00mac_rfkill_poll, + .ampdu_action = rt2800_ampdu_action, };EXPORT_SYMBOL_GPL (rt2800_mac80211_ops);
drivers/net/wireless/rt2x00/rt2x00dev.c +15 -0
@@ -286,6 +286,21 @@ void rt2x00lib_txdone(struct queue_entry *entry, rt2x00dev->low_level_stats.dot11ACKFailureCount++; } +/* +* Every single frame has it's own tx status, hence report +* every frame as ampdu of size 1. +* +* TODO: if we can find out how many frames were aggregated +* by the hw we could provide the real ampdu_len to mac80211 +* which would allow the rc algorithm to better decide on +* which rates are suitable. +*/ +if (tx_info->flags &IEEE80211_TX_CTL_AMPDU ) { + tx_info->flags |=IEEE80211_TX_STAT_AMPDU ; + tx_info->status.ampdu_len =1 ; + tx_info->status.ampdu_ack_len = success ?1 :0 ; + } +if (rate_flags &IEEE80211_TX_RC_USE_RTS_CTS ) {if (success) rt2x00dev->low_level_stats.dot11RTSSuccessCount++;
Signature · 1 line
1.6.6.1
PATCH 2/21 rt2x00: Write the BSSID to register when interface is added
From: Ivo van Doorn <[email protected]>
For the Master mode case, we initialized the BSSID as the MAC address, but never wrote it into the registers. This causes Hardware crypto to break in Master mode when receiving frames which require the BSSID to be filled in.
This is safe for STA mode since the BSSID will be initialized to 00:00:00:00:00 at this point, but will be set to the correct value later when the device associates.
--- drivers/net/wireless/rt2x00/rt2x00mac.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00mac.c +2 -1
@@ -282,7 +282,8 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,* has been initialized. Otherwise the device can reset * the MAC registers. */ -rt2x00lib_config_intf (rt2x00dev, intf, vif->type, intf->mac,NULL ); +rt2x00lib_config_intf (rt2x00dev, intf, vif->type, + intf->mac, intf->bssid);/* * Some filters depend on the current working mode. We can force
Signature · 1 line
1.6.6.1
PATCH 3/21 rt2x00: Remove unneeded variable
From: Ivo van Doorn <[email protected]>
The update_bssid is set only when BSS_CHANGED_BSSID is used, but the check if that field is true is done later in the function but also only when BSS_CHANGED_BSSID is set. This makes the variable useless, as it can never result in a negative check.
--- drivers/net/wireless/rt2x00/rt2x00mac.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/net/wireless/rt2x00/rt2x00mac.c +2 -5
@@ -563,7 +563,6 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, {struct rt2x00_dev *rt2x00dev = hw->priv;struct rt2x00_intf *intf =vif_to_intf (vif); -int update_bssid =0 ;/* * mac80211 might be calling this function while we are trying
@@ -578,10 +577,8 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,* conf->bssid can be NULL if coming from the internal * beacon update routine. */ -if (changes &BSS_CHANGED_BSSID ) { - update_bssid =1 ; +if (changes &BSS_CHANGED_BSSID )memcpy (&intf->bssid, bss_conf->bssid,ETH_ALEN ); - }spin_unlock (&intf->lock);
@@ -593,7 +590,7 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw,*/ if (changes &BSS_CHANGED_BSSID )rt2x00lib_config_intf (rt2x00dev, intf, vif->type,NULL , - update_bssid ? bss_conf->bssid :NULL ); + bss_conf->bssid);/* * Update the beacon.
Signature · 1 line
1.6.6.1
PATCH 4/21 rt2x00: Fix frame dumping for USB devices.
From: Gertjan van Wingerde <[email protected]>
We forgot to clear the SKBDESC_DESC_IN_SKB when the descriptor was removed from the front of the skb.
--- drivers/net/wireless/rt2x00/rt2x00usb.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/net/wireless/rt2x00/rt2x00usb.c +6 -0
@@ -171,6 +171,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) {struct queue_entry *entry = (struct queue_entry *)urb->context;struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; +struct skb_frame_desc *skbdesc =get_skb_frame_desc (entry->skb);struct txdone_entry_desc txdesc; if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags) ||
@@ -183,6 +184,11 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)skb_pull (entry->skb, entry->queue->desc_size);/* +* Signal that the TX descriptor is no longer in the skb. +*/ + skbdesc->flags &= ~SKBDESC_DESC_IN_SKB ; + +/* * 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
Signature · 1 line
1.6.6.1
PATCH 5/21 rt2x00: Move filling of TX URB to rt2x00usb_kick_tx_entry function.
From: Gertjan van Wingerde <[email protected]>
There is no need to fill the TX URB this early, and moving it to the rt2x00usb_kick_tx_entry function allows us to merge the PCI and USB variants of the write_tx_data function.
--- drivers/net/wireless/rt2x00/rt2x00usb.c | 33 ++++++++++++++++--------------- 1 files changed, 17 insertions(+), 16 deletions(-)
drivers/net/wireless/rt2x00/rt2x00usb.c +17 -16
@@ -211,9 +211,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry, struct txentry_desc *txdesc) {struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; -struct usb_device *usb_dev =to_usb_device_intf (rt2x00dev->dev); -struct queue_entry_priv_usb *entry_priv = entry->priv_data; -u32 length;/* * Add the descriptor in front of the skb.
@@ -222,18 +219,6 @@ int rt2x00usb_write_tx_data(struct queue_entry *entry,memset (entry->skb->data,0 , entry->queue->desc_size);/* -* USB devices cannot blindly pass the skb->len as the -* length of the data to usb_fill_bulk_urb. Pass the skb -* to the driver to determine what the length should be. -*/ - length = rt2x00dev->ops->lib->get_tx_data_len (entry); - -usb_fill_bulk_urb (entry_priv->urb, usb_dev, -usb_sndbulkpipe (usb_dev, entry->queue->usb_endpoint), - entry->skb->data, length, - rt2x00usb_interrupt_txdone, entry); - -/* * Call the driver's write_tx_datadesc function, if it exists. */ if (rt2x00dev->ops->lib->write_tx_datadesc)
@@ -245,10 +230,26 @@ EXPORT_SYMBOL_GPL(rt2x00usb_write_tx_data);static inline void rt2x00usb_kick_tx_entry (struct queue_entry *entry) { +struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; +struct usb_device *usb_dev =to_usb_device_intf (rt2x00dev->dev);struct queue_entry_priv_usb *entry_priv = entry->priv_data; +u32 length; + +if (test_and_clear_bit (ENTRY_DATA_PENDING , &entry->flags)) { +/* +* USB devices cannot blindly pass the skb->len as the +* length of the data to usb_fill_bulk_urb. Pass the skb +* to the driver to determine what the length should be. +*/ + length = rt2x00dev->ops->lib->get_tx_data_len (entry); + +usb_fill_bulk_urb (entry_priv->urb, usb_dev, +usb_sndbulkpipe (usb_dev, entry->queue->usb_endpoint), + entry->skb->data, length, + rt2x00usb_interrupt_txdone, entry); -if (test_and_clear_bit (ENTRY_DATA_PENDING , &entry->flags))usb_submit_urb (entry_priv->urb,GFP_ATOMIC ); + } } void rt2x00usb_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
Signature · 1 line
1.6.6.1
PATCH 6/21 rt2x00: Merge PCI and USB versions of write_tx_data into single function.
From: Gertjan van Wingerde <[email protected]>
Now that rt2x00pci_write_tx_data and rt2x00usb_write_tx_data are similar we can merge them in a single function in rt2x00queue.c.
--- drivers/net/wireless/rt2x00/rt2400pci.c | 1 - drivers/net/wireless/rt2x00/rt2500pci.c | 1 - drivers/net/wireless/rt2x00/rt2500usb.c | 1 - drivers/net/wireless/rt2x00/rt2800pci.c | 1 - drivers/net/wireless/rt2x00/rt2800usb.c | 1 - drivers/net/wireless/rt2x00/rt2x00pci.c | 43 ----------------------------- drivers/net/wireless/rt2x00/rt2x00pci.h | 10 ------- drivers/net/wireless/rt2x00/rt2x00queue.c | 43 +++++++++++++++++++++++++++- drivers/net/wireless/rt2x00/rt2x00usb.c | 21 -------------- drivers/net/wireless/rt2x00/rt2x00usb.h | 10 ------- drivers/net/wireless/rt2x00/rt61pci.c | 1 - drivers/net/wireless/rt2x00/rt73usb.c | 1 - 12 files changed, 41 insertions(+), 93 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +0 -1
@@ -1588,7 +1588,6 @@ static const struct rt2x00lib_ops rt2400pci_rt2x00_ops = { .reset_tuner = rt2400pci_reset_tuner, .link_tuner = rt2400pci_link_tuner, .write_tx_desc = rt2400pci_write_tx_desc, - .write_tx_data = rt2x00pci_write_tx_data, .write_beacon = rt2400pci_write_beacon, .kick_tx_queue = rt2400pci_kick_tx_queue, .kill_tx_queue = rt2400pci_kill_tx_queue,
drivers/net/wireless/rt2x00/rt2500pci.c +0 -1
@@ -1886,7 +1886,6 @@ static const struct rt2x00lib_ops rt2500pci_rt2x00_ops = { .reset_tuner = rt2500pci_reset_tuner, .link_tuner = rt2500pci_link_tuner, .write_tx_desc = rt2500pci_write_tx_desc, - .write_tx_data = rt2x00pci_write_tx_data, .write_beacon = rt2500pci_write_beacon, .kick_tx_queue = rt2500pci_kick_tx_queue, .kill_tx_queue = rt2500pci_kill_tx_queue,
drivers/net/wireless/rt2x00/rt2500usb.c +0 -1
@@ -1769,7 +1769,6 @@ static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = { .link_stats = rt2500usb_link_stats, .reset_tuner = rt2500usb_reset_tuner, .write_tx_desc = rt2500usb_write_tx_desc, - .write_tx_data = rt2x00usb_write_tx_data, .write_beacon = rt2500usb_write_beacon, .get_tx_data_len = rt2500usb_get_tx_data_len, .kick_tx_queue = rt2x00usb_kick_tx_queue,
drivers/net/wireless/rt2x00/rt2800pci.c +0 -1
@@ -1044,7 +1044,6 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { .reset_tuner = rt2800_reset_tuner, .link_tuner = rt2800_link_tuner, .write_tx_desc = rt2800pci_write_tx_desc, - .write_tx_data = rt2x00pci_write_tx_data, .write_tx_datadesc = rt2800pci_write_tx_datadesc, .write_beacon = rt2800_write_beacon, .kick_tx_queue = rt2800pci_kick_tx_queue,
drivers/net/wireless/rt2x00/rt2800usb.c +0 -1
@@ -652,7 +652,6 @@ static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = { .reset_tuner = rt2800_reset_tuner, .link_tuner = rt2800_link_tuner, .write_tx_desc = rt2800usb_write_tx_desc, - .write_tx_data = rt2x00usb_write_tx_data, .write_beacon = rt2800_write_beacon, .get_tx_data_len = rt2800usb_get_tx_data_len, .kick_tx_queue = rt2x00usb_kick_tx_queue,
drivers/net/wireless/rt2x00/rt2x00pci.c +0 -43
49 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2x00pci.h +0 -10
@@ -86,16 +86,6 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev, u32 *reg);/** -* rt2x00pci_write_tx_data - Initialize data for TX operation -* @entry: The entry where the frame is located -* -* This function will initialize the DMA and skb descriptor -* to prepare the entry for the actual TX operation. -*/ -int rt2x00pci_write_tx_data (struct queue_entry *entry, -struct txentry_desc *txdesc); - -/** * struct queue_entry_priv_pci: Per entry PCI specific information * * @desc: Pointer to device descriptor
drivers/net/wireless/rt2x00/rt2x00queue.c +41 -2
55 lines not on this page · raw message
drivers/net/wireless/rt2x00/rt2x00usb.c +0 -21
@@ -207,27 +207,6 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)rt2x00lib_txdone (entry, &txdesc); } -int rt2x00usb_write_tx_data (struct queue_entry *entry, -struct txentry_desc *txdesc) -{ -struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; - -/* -* Add the descriptor in front of the skb. -*/ -skb_push (entry->skb, entry->queue->desc_size); -memset (entry->skb->data,0 , entry->queue->desc_size); - -/* -* Call the driver's write_tx_datadesc function, if it exists. -*/ -if (rt2x00dev->ops->lib->write_tx_datadesc) - rt2x00dev->ops->lib->write_tx_datadesc (entry, txdesc); - -return 0 ; -} -EXPORT_SYMBOL_GPL (rt2x00usb_write_tx_data); -static inline void rt2x00usb_kick_tx_entry (struct queue_entry *entry) {struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev;
drivers/net/wireless/rt2x00/rt2x00usb.h +0 -10
@@ -351,16 +351,6 @@ int rt2x00usb_regbusy_read(struct rt2x00_dev *rt2x00dev,void rt2x00usb_disable_radio (struct rt2x00_dev *rt2x00dev);/** -* rt2x00usb_write_tx_data - Initialize URB for TX operation -* @entry: The entry where the frame is located -* -* This function will initialize the URB and skb descriptor -* to prepare the entry for the actual TX operation. -*/ -int rt2x00usb_write_tx_data (struct queue_entry *entry, -struct txentry_desc *txdesc); - -/** * struct queue_entry_priv_usb: Per entry USB specific information * * @urb: Urb structure used for device communication.
drivers/net/wireless/rt2x00/rt61pci.c +0 -1
@@ -2800,7 +2800,6 @@ static const struct rt2x00lib_ops rt61pci_rt2x00_ops = { .reset_tuner = rt61pci_reset_tuner, .link_tuner = rt61pci_link_tuner, .write_tx_desc = rt61pci_write_tx_desc, - .write_tx_data = rt2x00pci_write_tx_data, .write_beacon = rt61pci_write_beacon, .kick_tx_queue = rt61pci_kick_tx_queue, .kill_tx_queue = rt61pci_kill_tx_queue,
drivers/net/wireless/rt2x00/rt73usb.c +0 -1
@@ -2249,7 +2249,6 @@ static const struct rt2x00lib_ops rt73usb_rt2x00_ops = { .reset_tuner = rt73usb_reset_tuner, .link_tuner = rt73usb_link_tuner, .write_tx_desc = rt73usb_write_tx_desc, - .write_tx_data = rt2x00usb_write_tx_data, .write_beacon = rt73usb_write_beacon, .get_tx_data_len = rt73usb_get_tx_data_len, .kick_tx_queue = rt2x00usb_kick_tx_queue,
Signature · 1 line
1.6.6.1
PATCH 7/21 rt2x00: Move common txdone handling to rt2x00lib_txdone.
From: Gertjan van Wingerde <[email protected]>
Now that the write_tx_data functions are merged, also merge the relevant parts of the txdone handling into common code, rather than {usb,pci} specific code.
--- drivers/net/wireless/rt2x00/rt2400pci.c | 2 +- drivers/net/wireless/rt2x00/rt2500pci.c | 2 +- drivers/net/wireless/rt2x00/rt2800pci.c | 2 +- drivers/net/wireless/rt2x00/rt2x00dev.c | 15 +++++++++++++++ drivers/net/wireless/rt2x00/rt2x00pci.c | 31 ------------------------------- drivers/net/wireless/rt2x00/rt2x00pci.h | 8 -------- drivers/net/wireless/rt2x00/rt2x00usb.c | 11 ----------- drivers/net/wireless/rt2x00/rt61pci.c | 4 ++-- 8 files changed, 20 insertions(+), 55 deletions(-)
drivers/net/wireless/rt2x00/rt2400pci.c +1 -1
@@ -1229,7 +1229,7 @@ static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev, } txdesc.retry =rt2x00_get_field32 (word,TXD_W0_RETRY_COUNT ); -rt2x00pci_txdone (entry, &txdesc); +rt2x00lib_txdone (entry, &txdesc); } }
drivers/net/wireless/rt2x00/rt2500pci.c +1 -1
@@ -1365,7 +1365,7 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev, } txdesc.retry =rt2x00_get_field32 (word,TXD_W0_RETRY_COUNT ); -rt2x00pci_txdone (entry, &txdesc); +rt2x00lib_txdone (entry, &txdesc); } }
drivers/net/wireless/rt2x00/rt2800pci.c +1 -1
@@ -905,7 +905,7 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev)if (txdesc.retry)__set_bit (TXDONE_FALLBACK , &txdesc.flags); -rt2x00pci_txdone (entry, &txdesc); +rt2x00lib_txdone (entry, &txdesc); } }
drivers/net/wireless/rt2x00/rt2x00dev.c +15 -0
@@ -211,6 +211,21 @@ void rt2x00lib_txdone(struct queue_entry *entry,bool success;/* +* Unmap the skb. +*/ +rt2x00queue_unmap_skb (rt2x00dev, entry->skb); + +/* +* Remove the extra tx headroom from the skb. +*/ +skb_pull (entry->skb, rt2x00dev->ops->extra_tx_headroom); + +/* +* Signal that the TX descriptor is no longer in the skb. +*/ + skbdesc->flags &= ~SKBDESC_DESC_IN_SKB ; + +/* * Remove L2 padding which was added during */ if (test_bit (DRIVER_REQUIRE_L2PAD , &rt2x00dev->flags))
drivers/net/wireless/rt2x00/rt2x00pci.c +0 -31
@@ -60,37 +60,6 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev, }EXPORT_SYMBOL_GPL (rt2x00pci_regbusy_read); -/* -* TX/RX data handlers. -*/ -void rt2x00pci_txdone (struct queue_entry *entry, -struct txdone_entry_desc *txdesc) -{ -struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; -struct skb_frame_desc *skbdesc =get_skb_frame_desc (entry->skb); - -/* -* Unmap the skb. -*/ -rt2x00queue_unmap_skb (rt2x00dev, entry->skb); - -/* -* Remove the extra tx headroom from the skb. -*/ -skb_pull (entry->skb, rt2x00dev->ops->extra_tx_headroom); - -/* -* Signal that the TX descriptor is no longer in the skb. -*/ - skbdesc->flags &= ~SKBDESC_DESC_IN_SKB ; - -/* -* Pass on to rt2x00lib. -*/ -rt2x00lib_txdone (entry, txdesc); -} -EXPORT_SYMBOL_GPL (rt2x00pci_txdone); -void rt2x00pci_rxdone (struct rt2x00_dev *rt2x00dev) {struct data_queue *queue = rt2x00dev->rx;
drivers/net/wireless/rt2x00/rt2x00pci.h +0 -8
@@ -99,14 +99,6 @@ struct queue_entry_priv_pci { };/** -* rt2x00pci_txdone - Handle TX done events. -* @entry: The queue entry for which a TX done event was received. -* @txdesc: The TX done descriptor for the entry. -*/ -void rt2x00pci_txdone (struct queue_entry *entry, -struct txdone_entry_desc *txdesc); - -/** * rt2x00pci_rxdone - Handle RX done events * @rt2x00dev: Device pointer, see &struct rt2x00_dev. */
drivers/net/wireless/rt2x00/rt2x00usb.c +0 -11
@@ -171,7 +171,6 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) {struct queue_entry *entry = (struct queue_entry *)urb->context;struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; -struct skb_frame_desc *skbdesc =get_skb_frame_desc (entry->skb);struct txdone_entry_desc txdesc; if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags) ||
@@ -179,16 +178,6 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb)return ;/* -* Remove the descriptor from the front of the skb. -*/ -skb_pull (entry->skb, entry->queue->desc_size); - -/* -* Signal that the TX descriptor is no longer in the skb. -*/ - skbdesc->flags &= ~SKBDESC_DESC_IN_SKB ; - -/* * 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
drivers/net/wireless/rt2x00/rt61pci.c +2 -2
@@ -2108,7 +2108,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)__set_bit (TXDONE_UNKNOWN , &txdesc.flags); txdesc.retry =0 ; -rt2x00pci_txdone (entry_done, &txdesc); +rt2x00lib_txdone (entry_done, &txdesc); entry_done =rt2x00queue_get_entry (queue,Q_INDEX_DONE ); }
@@ -2135,7 +2135,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)if (txdesc.retry)__set_bit (TXDONE_FALLBACK , &txdesc.flags); -rt2x00pci_txdone (entry, &txdesc); +rt2x00lib_txdone (entry, &txdesc); } }
Signature · 1 line
1.6.6.1
PATCH 8/21 rt2x00: Rename driver write_tx_datadesc callback function.
From: Gertjan van Wingerde <[email protected]>
Now that the {usb,pci} specific write_tx_data functions are no longer present we can rename the write_tx_datadesc callback function back to its old name.
--- drivers/net/wireless/rt2x00/rt2800pci.c | 6 +++--- drivers/net/wireless/rt2x00/rt2x00.h | 6 ++---- drivers/net/wireless/rt2x00/rt2x00queue.c | 6 +++--- 3 files changed, 8 insertions(+), 10 deletions(-)
drivers/net/wireless/rt2x00/rt2800pci.c +3 -3
@@ -645,8 +645,8 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,/* * TX descriptor initialization */ -static void rt2800pci_write_tx_datadesc (struct queue_entry * entry, -struct txentry_desc *txdesc) +static void rt2800pci_write_tx_data (struct queue_entry * entry, +struct txentry_desc *txdesc) {rt2800_write_txwi ((__le32 *) entry->skb->data, txdesc); }
@@ -1044,7 +1044,7 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { .reset_tuner = rt2800_reset_tuner, .link_tuner = rt2800_link_tuner, .write_tx_desc = rt2800pci_write_tx_desc, - .write_tx_datadesc = rt2800pci_write_tx_datadesc, + .write_tx_data = rt2800pci_write_tx_data, .write_beacon = rt2800_write_beacon, .kick_tx_queue = rt2800pci_kick_tx_queue, .kill_tx_queue = rt2800pci_kill_tx_queue,
drivers/net/wireless/rt2x00/rt2x00.h +2 -4
@@ -550,10 +550,8 @@ struct rt2x00lib_ops {void (*write_tx_desc) (struct rt2x00_dev *rt2x00dev,struct sk_buff *skb,struct txentry_desc *txdesc); -int (*write_tx_data) (struct queue_entry *entry, -struct txentry_desc *txdesc); -void (*write_tx_datadesc) (struct queue_entry *entry, -struct txentry_desc *txdesc); +void (*write_tx_data) (struct queue_entry *entry, +struct txentry_desc *txdesc);void (*write_beacon) (struct queue_entry *entry,struct txentry_desc *txdesc);int (*get_tx_data_len) (struct queue_entry *entry);
drivers/net/wireless/rt2x00/rt2x00queue.c +3 -3
@@ -430,10 +430,10 @@ static int rt2x00queue_write_tx_data(struct queue_entry *entry,memset (entry->skb->data,0 , rt2x00dev->ops->extra_tx_headroom);/* -* Call the driver's write_tx_datadesc function, if it exists. +* Call the driver's write_tx_data function, if it exists. */ -if (rt2x00dev->ops->lib->write_tx_datadesc) - rt2x00dev->ops->lib->write_tx_datadesc (entry, txdesc); +if (rt2x00dev->ops->lib->write_tx_data) + rt2x00dev->ops->lib->write_tx_data (entry, txdesc);/* * Map the skb to DMA.
Signature · 1 line
1.6.6.1
PATCH 9/21 rt2x00: Split of TXWI writing to write_tx_data callback in rt2800usb.
From: Gertjan van Wingerde <[email protected]>
Align with the way PCI devices are handled, even though it is not strictly necessary.
--- drivers/net/wireless/rt2x00/rt2800pci.c | 4 +++- drivers/net/wireless/rt2x00/rt2800usb.c | 16 ++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-)
drivers/net/wireless/rt2x00/rt2800pci.c +3 -1
@@ -648,7 +648,9 @@ static int rt2800pci_set_device_state(struct rt2x00_dev *rt2x00dev,static void rt2800pci_write_tx_data (struct queue_entry * entry,struct txentry_desc *txdesc) { -rt2800_write_txwi ((__le32 *) entry->skb->data, txdesc); +__le32 *txwi = (__le32 *) entry->skb->data; + +rt2800_write_txwi (txwi, txdesc); }
drivers/net/wireless/rt2x00/rt2800usb.c +10 -6
@@ -430,21 +430,24 @@ static int rt2800usb_set_device_state(struct rt2x00_dev *rt2x00dev,/* * TX descriptor initialization */ +static void rt2800usb_write_tx_data (struct queue_entry * entry, +struct txentry_desc *txdesc) +{ +__le32 *txwi = (__le32 *) (entry->skb->data +TXINFO_DESC_SIZE ); + +rt2800_write_txwi (txwi, txdesc); +} + +static void rt2800usb_write_tx_desc (struct rt2x00_dev *rt2x00dev,struct sk_buff *skb,struct txentry_desc *txdesc) {struct skb_frame_desc *skbdesc =get_skb_frame_desc (skb);__le32 *txi = (__le32 *) skb->data; -__le32 *txwi = (__le32 *) (skb->data +TXINFO_DESC_SIZE );u32 word;/* -* Initialize TXWI descriptor -*/ -rt2800_write_txwi (txwi, txdesc); - -/* * Initialize TXINFO descriptor */ rt2x00_desc_read (txi,0 , &word);
@@ -652,6 +655,7 @@ static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = { .reset_tuner = rt2800_reset_tuner, .link_tuner = rt2800_link_tuner, .write_tx_desc = rt2800usb_write_tx_desc, + .write_tx_data = rt2800usb_write_tx_data, .write_beacon = rt2800_write_beacon, .get_tx_data_len = rt2800usb_get_tx_data_len, .kick_tx_queue = rt2x00usb_kick_tx_queue,
Signature · 1 line
1.6.6.1
PATCH 10/21 eeprom_93cx6: Add support for 93c86 EEPROMs.
From: Gertjan van Wingerde <[email protected]>
--- include/linux/eeprom_93cx6.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/linux/eeprom_93cx6.h +1 -0
@@ -30,6 +30,7 @@#define PCI_EEPROM_WIDTH_93C46 6#define PCI_EEPROM_WIDTH_93C56 8#define PCI_EEPROM_WIDTH_93C66 8 +#define PCI_EEPROM_WIDTH_93C86 8#define PCI_EEPROM_WIDTH_OPCODE 3#define PCI_EEPROM_WRITE_OPCODE 0x05#define PCI_EEPROM_READ_OPCODE 0x06
Signature · 1 line
1.6.6.1
PATCH 11/21 rt2x00: Correctly detect 93C86 EEPROMs in rt2800pci.
From: Gertjan van Wingerde <[email protected]>
--- drivers/net/wireless/rt2x00/rt2800pci.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-)
drivers/net/wireless/rt2x00/rt2800pci.c +12 -2
@@ -139,8 +139,18 @@ static void rt2800pci_read_eeprom_pci(struct rt2x00_dev *rt2x00dev) eeprom.data = rt2x00dev; eeprom.register_read = rt2800pci_eepromregister_read; eeprom.register_write = rt2800pci_eepromregister_write; - eeprom.width = !rt2x00_get_field32 (reg,E2PROM_CSR_TYPE ) ? -PCI_EEPROM_WIDTH_93C46 :PCI_EEPROM_WIDTH_93C66 ; +switch (rt2x00_get_field32 (reg,E2PROM_CSR_TYPE )) + { +case 0 : + eeprom.width =PCI_EEPROM_WIDTH_93C46 ; +break ; +case 1 : + eeprom.width =PCI_EEPROM_WIDTH_93C66 ; +break ; +default : + eeprom.width =PCI_EEPROM_WIDTH_93C86 ; +break ; + } eeprom.reg_data_in =0 ; eeprom.reg_data_out =0 ; eeprom.reg_data_clock =0 ;
Signature · 1 line
1.6.6.1
PATCH 12/21 rt2x00: Align rt2800 EEPROM validation to Ralink vendor driver.
From: Gertjan van Wingerde <[email protected]>
Align with the latest versions of the Ralink legacy driver(s).
--- drivers/net/wireless/rt2x00/rt2800lib.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +7 -1
@@ -2185,6 +2185,8 @@ int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev)rt2x00_set_field16 (&word,EEPROM_NIC_WPS_PBC ,0 );rt2x00_set_field16 (&word,EEPROM_NIC_BW40M_BG ,0 );rt2x00_set_field16 (&word,EEPROM_NIC_BW40M_A ,0 ); +rt2x00_set_field16 (&word,EEPROM_NIC_ANT_DIVERSITY ,0 ); +rt2x00_set_field16 (&word,EEPROM_NIC_DAC_TEST ,0 );rt2x00_eeprom_write (rt2x00dev,EEPROM_NIC , word);EEPROM (rt2x00dev,"NIC: 0x%04x\n" , word); }
@@ -2192,6 +2194,10 @@ int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev)rt2x00_eeprom_read (rt2x00dev,EEPROM_FREQ , &word);if ((word &0x00ff ) ==0x00ff ) {rt2x00_set_field16 (&word,EEPROM_FREQ_OFFSET ,0 ); +rt2x00_eeprom_write (rt2x00dev,EEPROM_FREQ , word); +EEPROM (rt2x00dev,"Freq: 0x%04x\n" , word); + } +if ((word &0xff00 ) ==0xff00 ) {rt2x00_set_field16 (&word,EEPROM_FREQ_LED_MODE ,LED_MODE_TXRX_ACTIVITY );rt2x00_set_field16 (&word,EEPROM_FREQ_LED_POLARITY ,0 );
@@ -2199,7 +2205,7 @@ int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev)rt2x00_eeprom_write (rt2x00dev,EEPROM_LED1 ,0x5555 );rt2x00_eeprom_write (rt2x00dev,EEPROM_LED2 ,0x2221 );rt2x00_eeprom_write (rt2x00dev,EEPROM_LED3 ,0xa9f8 ); -EEPROM (rt2x00dev,"Freq: 0x%04x\n" , word); +EEPROM (rt2x00dev,"Led Mode: 0x%04x\n" , word); }/*
Signature · 1 line
1.6.6.1
PATCH 13/21 rt2x00: Enable multiBSS in rt2800
From: Ivo van Doorn <[email protected]>
MAC_BSSID_DW1_BSS_ID_MASK must be set to the mask 3, to enable 8 BSSID's. The MAC_BSSID_DW1_BSS_BCN_NUM is initialized to 7 to enable the 8 beacons.
--- drivers/net/wireless/rt2x00/rt2800lib.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +2 -2
@@ -768,8 +768,8 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,if (flags &CONFIG_UPDATE_BSSID ) { reg =le32_to_cpu (conf->bssid[1 ]); -rt2x00_set_field32 (®,MAC_BSSID_DW1_BSS_ID_MASK ,0 ); -rt2x00_set_field32 (®,MAC_BSSID_DW1_BSS_BCN_NUM ,0 ); +rt2x00_set_field32 (®,MAC_BSSID_DW1_BSS_ID_MASK ,3 ); +rt2x00_set_field32 (®,MAC_BSSID_DW1_BSS_BCN_NUM ,7 ); conf->bssid[1 ] =cpu_to_le32 (reg); rt2800_register_multiwrite(rt2x00dev, MAC_BSSID_DW0,
Signature · 1 line
1.6.6.1
PATCH 14/21 rt2x00: Fix beacon updates in rt2800pci
From: Helmut Schaa <[email protected]>
rt2800pci didn't update the beacon template after each beacon interval, resulting in the DTIM count being incorrect (if DTIM period > 1). Fix this by calling rt2x00lib_beacondone after the current beacon was sent out.
--- drivers/net/wireless/rt2x00/rt2800pci.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/net/wireless/rt2x00/rt2800pci.c +6 -0
@@ -953,6 +953,12 @@ static irqreturn_t rt2800pci_interrupt(int irq, void *dev_instance)if (rt2x00_get_field32 (reg,INT_SOURCE_CSR_TX_FIFO_STATUS ))rt2800pci_txdone (rt2x00dev); +/* +* Current beacon was sent out, fetch the next one +*/ +if (rt2x00_get_field32 (reg,INT_SOURCE_CSR_TBTT )) +rt2x00lib_beacondone (rt2x00dev); +if (rt2x00_get_field32 (reg,INT_SOURCE_CSR_AUTO_WAKEUP ))rt2800pci_wakeup (rt2x00dev);
Signature · 1 line
1.6.6.1
PATCH 15/21 rt2x00: Fix beacon updates in rt61pci
From: Helmut Schaa <[email protected]>
Fix rt61pci beacon updates in the same way as rt2800pci. rt61pci didn't update the beacon template after each beacon interval, resulting in the DTIM count being incorrect (if DTIM period > 1). Fix this by calling rt2x00lib_beacondone after the current beacon was sent out.
--- drivers/net/wireless/rt2x00/rt61pci.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
drivers/net/wireless/rt2x00/rt61pci.c +6 -0
@@ -2200,6 +2200,12 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance)if (rt2x00_get_field32 (reg_mcu,MCU_INT_SOURCE_CSR_TWAKEUP ))rt61pci_wakeup (rt2x00dev); +/* +* 5 - Beacon done interrupt. +*/ +if (rt2x00_get_field32 (reg,INT_SOURCE_CSR_BEACON_DONE )) +rt2x00lib_beacondone (rt2x00dev); +return IRQ_HANDLED ; }
Signature · 1 line
1.6.6.1
PATCH 16/21 rt2x00: Disable link tuning in AP mode
From: Helmut Schaa <[email protected]>
Since the link tuning is based on average RSSI values taken from all received frames it doesn't make sense to enable it in AP mode where every associated station provides independent RSSI values. Furthermore the legacy drivers don't enable link tuning in AP mode as well.
--- drivers/net/wireless/rt2x00/rt2x00link.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/rt2x00/rt2x00link.c +4 -4
@@ -271,11 +271,11 @@ void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev)/* * Link tuning should only be performed when -* an active sta or master interface exists. -* Single monitor mode interfaces should never have -* work with link tuners. +* an active sta interface exists. AP interfaces +* don't need link tuning and monitor mode interfaces +* should never have to work with link tuners. */ -if (!rt2x00dev->intf_ap_count && !rt2x00dev->intf_sta_count) +if (!rt2x00dev->intf_sta_count)return ;rt2x00link_reset_tuner (rt2x00dev, false);
Signature · 1 line
1.6.6.1
PATCH 17/21 rt2x00: fix beacon reset on rt2800
From: Helmut Schaa <[email protected]>
When an interface is removed the according beacon entry should be reset. The current approach to only clear the first word is not enough to stop the device from sending out the beacon, hence resulting in beacons being sent out for already removed interfaces.
Fix this by invalidating the entire TXWI in front of the beacon instead of only the first word.
Also clear all beacons during startup in the same way.
--- drivers/net/wireless/rt2x00/rt2800lib.c | 42 +++++++++++++++++------------- 1 files changed, 24 insertions(+), 18 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +24 -18
@@ -432,6 +432,20 @@ void rt2800_write_beacon(struct queue_entry *entry, struct txentry_desc *txdesc) }EXPORT_SYMBOL (rt2800_write_beacon); +static void inline rt2800_clear_beacon (struct rt2x00_dev *rt2x00dev, +unsigned int beacon_base) +{ +int i; + +/* +* For the Beacon base registers we only need to clear +* the whole TXWI which (when set to 0) will invalidate +* the entire beacon. +*/ +for (i =0 ; i <TXWI_DESC_SIZE ; i +=sizeof (__le32)) +rt2800_register_write (rt2x00dev, beacon_base + i,0 ); +} +#ifdef CONFIG_RT2X00_LIB_DEBUGFS const struct rt2x00debug rt2800_rt2x00debug = { .owner = THIS_MODULE,
@@ -733,19 +747,14 @@ EXPORT_SYMBOL_GPL(rt2800_config_filter);void rt2800_config_intf (struct rt2x00_dev *rt2x00dev,struct rt2x00_intf *intf,struct rt2x00intf_conf *conf,const unsigned int flags) { -unsigned int beacon_base;u32 reg;if (flags &CONFIG_UPDATE_TYPE ) {/* * Clear current synchronisation setup. -* For the Beacon base registers we only need to clear -* the first byte since that byte contains the VALID and OWNER -* bits which (when set to 0) will invalidate the entire beacon. */ - beacon_base =HW_BEACON_OFFSET (intf->beacon->entry_idx); -rt2800_register_write (rt2x00dev, beacon_base,0 ); - +rt2800_clear_beacon (rt2x00dev, +HW_BEACON_OFFSET (intf->beacon->entry_idx));/* * Enable synchronisation. */
@@ -1565,18 +1574,15 @@ int rt2800_init_registers(struct rt2x00_dev *rt2x00dev)/* * Clear all beacons -* For the Beacon base registers we only need to clear -* the first byte since that byte contains the VALID and OWNER -* bits which (when set to 0) will invalidate the entire beacon. */ -rt2800_register_write (rt2x00dev,HW_BEACON_BASE0 ,0 ); -rt2800_register_write (rt2x00dev,HW_BEACON_BASE1 ,0 ); -rt2800_register_write (rt2x00dev,HW_BEACON_BASE2 ,0 ); -rt2800_register_write (rt2x00dev,HW_BEACON_BASE3 ,0 ); -rt2800_register_write (rt2x00dev,HW_BEACON_BASE4 ,0 ); -rt2800_register_write (rt2x00dev,HW_BEACON_BASE5 ,0 ); -rt2800_register_write (rt2x00dev,HW_BEACON_BASE6 ,0 ); -rt2800_register_write (rt2x00dev,HW_BEACON_BASE7 ,0 ); +rt2800_clear_beacon (rt2x00dev,HW_BEACON_BASE0 ); +rt2800_clear_beacon (rt2x00dev,HW_BEACON_BASE1 ); +rt2800_clear_beacon (rt2x00dev,HW_BEACON_BASE2 ); +rt2800_clear_beacon (rt2x00dev,HW_BEACON_BASE3 ); +rt2800_clear_beacon (rt2x00dev,HW_BEACON_BASE4 ); +rt2800_clear_beacon (rt2x00dev,HW_BEACON_BASE5 ); +rt2800_clear_beacon (rt2x00dev,HW_BEACON_BASE6 ); +rt2800_clear_beacon (rt2x00dev,HW_BEACON_BASE7 );if (rt2x00_is_usb (rt2x00dev)) {rt2800_register_read (rt2x00dev,US_CYC_CNT , ®);
Signature · 1 line
1.6.6.1
PATCH 18/21 rt2x00: Fix IEEE80211_HT_CAP_RX_STBC assignment
From: Ivo van Doorn <[email protected]>
IEEE80211_HT_CAP_RX_STBC is a 2 bit flag, and should thus never be set as normal flag. Instead we must read the number of RX paths from the EEPROM and set the IEEE80211_HT_CAP_RX_STBC with the correct value (using the same logic as the number of TX streams).
--- drivers/net/wireless/rt2x00/rt2800lib.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +5 -2
@@ -2572,12 +2572,15 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)IEEE80211_HT_CAP_SUP_WIDTH_20_40 |IEEE80211_HT_CAP_GRN_FLD |IEEE80211_HT_CAP_SGI_20 | -IEEE80211_HT_CAP_SGI_40 | -IEEE80211_HT_CAP_RX_STBC ; +IEEE80211_HT_CAP_SGI_40 ;if (rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_TXPATH ) >=2 ) spec->ht.cap |=IEEE80211_HT_CAP_TX_STBC ; + spec->ht.cap |= +rt2x00_get_field16 (eeprom,EEPROM_ANTENNA_RXPATH ) << +IEEE80211_HT_CAP_RX_STBC_SHIFT ; + spec->ht.ampdu_factor =3 ; spec->ht.ampdu_density =4 ; spec->ht.mcs.tx_params =
Signature · 1 line
1.6.6.1
PATCH 19/21 rt2x00: Fix antenna initialization
From: Ivo van Doorn <[email protected]>
Legacy driver indicates that BBP1_TX_ANTENNA must be set to 0 for TXPATH values of 1 and 3. So the previous statement that nothing should be done for TXPATH = 3, is false.
Furthermore, remove the false BBP3_RX_ANTENNA initialization when TXPATH is 1 for PCI and SOC devices. This field will always be overridden in the next switch statement, making this initialization bogus. History of this line indicates it was there from the beginning, and was once caught as typo. Instead of replacing the line with the correct line, the correct line was added...
--- drivers/net/wireless/rt2x00/rt2800lib.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +1 -3
@@ -836,14 +836,12 @@ void rt2800_config_ant(struct rt2x00_dev *rt2x00dev, struct antenna_setup *ant)switch ((int )ant->tx) {case 1 :rt2x00_set_field8 (&r1,BBP1_TX_ANTENNA ,0 ); -if (rt2x00_is_pci (rt2x00dev) ||rt2x00_is_soc (rt2x00dev)) -rt2x00_set_field8 (&r3,BBP3_RX_ANTENNA ,0 );break ;case 2 :rt2x00_set_field8 (&r1,BBP1_TX_ANTENNA ,2 );break ;case 3 : -/* Do nothing */ +rt2x00_set_field8 (&r1,BBP1_TX_ANTENNA ,0 );break ; }
Signature · 1 line
1.6.6.1
PATCH 20/21 rt2x00: Always set BBP_CSR_CFG_BBP_RW_MODE to 1
From: Ivo van Doorn <[email protected]>
Latest rt2870 legacy driver also sets BBP_CSR_CFG_BBP_RW_MODE to 1 when reading or writing the EEPROM. This means we can make the BBP reading and writing completely equal on all platforms.
--- drivers/net/wireless/rt2x00/rt2800lib.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +2 -4
@@ -99,8 +99,7 @@ static void rt2800_bbp_write(struct rt2x00_dev *rt2x00dev,rt2x00_set_field32 (®,BBP_CSR_CFG_REGNUM , word);rt2x00_set_field32 (®,BBP_CSR_CFG_BUSY ,1 );rt2x00_set_field32 (®,BBP_CSR_CFG_READ_CONTROL ,0 ); -if (rt2x00_is_pci (rt2x00dev) ||rt2x00_is_soc (rt2x00dev)) -rt2x00_set_field32 (®,BBP_CSR_CFG_BBP_RW_MODE ,1 ); +rt2x00_set_field32 (®,BBP_CSR_CFG_BBP_RW_MODE ,1 );rt2800_register_write_lock (rt2x00dev,BBP_CSR_CFG , reg); }
@@ -128,8 +127,7 @@ static void rt2800_bbp_read(struct rt2x00_dev *rt2x00dev,rt2x00_set_field32 (®,BBP_CSR_CFG_REGNUM , word);rt2x00_set_field32 (®,BBP_CSR_CFG_BUSY ,1 );rt2x00_set_field32 (®,BBP_CSR_CFG_READ_CONTROL ,1 ); -if (rt2x00_is_pci (rt2x00dev) ||rt2x00_is_soc (rt2x00dev)) -rt2x00_set_field32 (®,BBP_CSR_CFG_BBP_RW_MODE ,1 ); +rt2x00_set_field32 (®,BBP_CSR_CFG_BBP_RW_MODE ,1 );rt2800_register_write_lock (rt2x00dev,BBP_CSR_CFG , reg);
Signature · 1 line
1.6.6.1
PATCH 21/21 rt2x00: Fix compile warning when debug disabled
From: Ivo van Doorn <[email protected]>
CC [M] drivers/net/wireless/rt2x00/rt2800lib.o drivers/net/wireless/rt2x00/rt2800lib.c: In function 'rt2800_ampdu_action':drivers/net/wireless/rt2x00/rt2800lib.c:2821: warning: unused variable 'rt2x00dev'
--- drivers/net/wireless/rt2x00/rt2800lib.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/wireless/rt2x00/rt2800lib.c +1 -2
@@ -2769,7 +2769,6 @@ static int rt2800_ampdu_action(struct ieee80211_hw *hw,struct ieee80211_sta *sta, u16 tid, u16 *ssn) { - struct rt2x00_dev *rt2x00dev = hw->priv; int ret = 0;switch (action) {
@@ -2787,7 +2786,7 @@ static int rt2800_ampdu_action(struct ieee80211_hw *hw,case IEEE80211_AMPDU_TX_OPERATIONAL :break ;default : -WARNING (rt2x00dev,"Unknown AMPDU action\n" ); +WARNING ((struct rt2x00_dev *)hw->priv,"Unknown AMPDU action\n" ); }return ret;
Signature · 1 line
1.6.6.1