aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2010-05-07 05:03:08 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-05-07 14:57:21 -0400
commit1affa091975e47d50ce6a88e9b1abfe717c2fe27 (patch)
treef278fcbf35ea04e619de3d07ac1234d174f9c943
parentcbd1ea87a198669537591cef9ee834d6986c169b (diff)
rt2x00: rt2800: use correct txop value in tx descriptor
rt2800 devices use a different enumeration to specify what IFS values should be used on frame transmission compared to the other rt2x00 devices. Hence, create a new enum called txop that contains the valid values. Furthermore use the appropriate txop values as found in the ralink drivers: - TXOP_BACKOFF for management frames - TXOP_SIFS for subsequent fragments in a burst - TXOP_HTTXOP for all data frames Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00ht.c17
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00reg.h10
5 files changed, 31 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index f08b6a37bf2d..df2c3fb8b4b6 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -643,7 +643,7 @@ static int rt2800pci_write_tx_data(struct queue_entry* entry,
643 rt2x00_set_field32(&word, TXWI_W0_AMPDU, 643 rt2x00_set_field32(&word, TXWI_W0_AMPDU,
644 test_bit(ENTRY_TXD_HT_AMPDU, &txdesc->flags)); 644 test_bit(ENTRY_TXD_HT_AMPDU, &txdesc->flags));
645 rt2x00_set_field32(&word, TXWI_W0_MPDU_DENSITY, txdesc->mpdu_density); 645 rt2x00_set_field32(&word, TXWI_W0_MPDU_DENSITY, txdesc->mpdu_density);
646 rt2x00_set_field32(&word, TXWI_W0_TX_OP, txdesc->ifs); 646 rt2x00_set_field32(&word, TXWI_W0_TX_OP, txdesc->txop);
647 rt2x00_set_field32(&word, TXWI_W0_MCS, txdesc->mcs); 647 rt2x00_set_field32(&word, TXWI_W0_MCS, txdesc->mcs);
648 rt2x00_set_field32(&word, TXWI_W0_BW, 648 rt2x00_set_field32(&word, TXWI_W0_BW,
649 test_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags)); 649 test_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags));
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 67f8234f24d0..94b68127811e 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -417,7 +417,7 @@ static void rt2800usb_write_tx_desc(struct rt2x00_dev *rt2x00dev,
417 rt2x00_set_field32(&word, TXWI_W0_AMPDU, 417 rt2x00_set_field32(&word, TXWI_W0_AMPDU,
418 test_bit(ENTRY_TXD_HT_AMPDU, &txdesc->flags)); 418 test_bit(ENTRY_TXD_HT_AMPDU, &txdesc->flags));
419 rt2x00_set_field32(&word, TXWI_W0_MPDU_DENSITY, txdesc->mpdu_density); 419 rt2x00_set_field32(&word, TXWI_W0_MPDU_DENSITY, txdesc->mpdu_density);
420 rt2x00_set_field32(&word, TXWI_W0_TX_OP, txdesc->ifs); 420 rt2x00_set_field32(&word, TXWI_W0_TX_OP, txdesc->txop);
421 rt2x00_set_field32(&word, TXWI_W0_MCS, txdesc->mcs); 421 rt2x00_set_field32(&word, TXWI_W0_MCS, txdesc->mcs);
422 rt2x00_set_field32(&word, TXWI_W0_BW, 422 rt2x00_set_field32(&word, TXWI_W0_BW,
423 test_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags)); 423 test_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags));
diff --git a/drivers/net/wireless/rt2x00/rt2x00ht.c b/drivers/net/wireless/rt2x00/rt2x00ht.c
index 1056c92143a8..5a407602ce3e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00ht.c
+++ b/drivers/net/wireless/rt2x00/rt2x00ht.c
@@ -35,6 +35,7 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
35{ 35{
36 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb); 36 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(entry->skb);
37 struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0]; 37 struct ieee80211_tx_rate *txrate = &tx_info->control.rates[0];
38 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)entry->skb->data;
38 39
39 if (tx_info->control.sta) 40 if (tx_info->control.sta)
40 txdesc->mpdu_density = 41 txdesc->mpdu_density =
@@ -66,4 +67,20 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
66 __set_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags); 67 __set_bit(ENTRY_TXD_HT_BW_40, &txdesc->flags);
67 if (txrate->flags & IEEE80211_TX_RC_SHORT_GI) 68 if (txrate->flags & IEEE80211_TX_RC_SHORT_GI)
68 __set_bit(ENTRY_TXD_HT_SHORT_GI, &txdesc->flags); 69 __set_bit(ENTRY_TXD_HT_SHORT_GI, &txdesc->flags);
70
71 /*
72 * Determine IFS values
73 * - Use TXOP_BACKOFF for management frames
74 * - Use TXOP_SIFS for fragment bursts
75 * - Use TXOP_HTTXOP for everything else
76 *
77 * Note: rt2800 devices won't use CTS protection (if used)
78 * for frames not transmitted with TXOP_HTTXOP
79 */
80 if (ieee80211_is_mgmt(hdr->frame_control))
81 txdesc->txop = TXOP_BACKOFF;
82 else if (!(tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT))
83 txdesc->txop = TXOP_SIFS;
84 else
85 txdesc->txop = TXOP_HTTXOP;
69} 86}
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
index 94a48c174d67..36a957adc1f9 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
@@ -299,6 +299,7 @@ enum txentry_desc_flags {
299 * @retry_limit: Max number of retries. 299 * @retry_limit: Max number of retries.
300 * @aifs: AIFS value. 300 * @aifs: AIFS value.
301 * @ifs: IFS value. 301 * @ifs: IFS value.
302 * @txop: IFS value for 11n capable chips.
302 * @cw_min: cwmin value. 303 * @cw_min: cwmin value.
303 * @cw_max: cwmax value. 304 * @cw_max: cwmax value.
304 * @cipher: Cipher type used for encryption. 305 * @cipher: Cipher type used for encryption.
@@ -328,6 +329,7 @@ struct txentry_desc {
328 short retry_limit; 329 short retry_limit;
329 short aifs; 330 short aifs;
330 short ifs; 331 short ifs;
332 short txop;
331 short cw_min; 333 short cw_min;
332 short cw_max; 334 short cw_max;
333 335
diff --git a/drivers/net/wireless/rt2x00/rt2x00reg.h b/drivers/net/wireless/rt2x00/rt2x00reg.h
index 603bfc0adaa3..b9fe94873ee0 100644
--- a/drivers/net/wireless/rt2x00/rt2x00reg.h
+++ b/drivers/net/wireless/rt2x00/rt2x00reg.h
@@ -101,6 +101,16 @@ enum ifs {
101}; 101};
102 102
103/* 103/*
104 * IFS backoff values for HT devices
105 */
106enum txop {
107 TXOP_HTTXOP = 0,
108 TXOP_PIFS = 1,
109 TXOP_SIFS = 2,
110 TXOP_BACKOFF = 3,
111};
112
113/*
104 * Cipher types for hardware encryption 114 * Cipher types for hardware encryption
105 */ 115 */
106enum cipher { 116enum cipher {