rt2x00: Set MIMO PS flag in tx descriptor for STAs in dynamic SMPS mode
authorIvo van Doorn <ivdoorn@gmail.com>
Fri, 6 Aug 2010 18:46:19 +0000 (20:46 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 16 Aug 2010 19:26:42 +0000 (15:26 -0400)
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/rt2x00/rt2800lib.c
drivers/net/wireless/rt2x00/rt2x00ht.c
drivers/net/wireless/rt2x00/rt2x00queue.h

index b66e0fd8f0fa178f2d18544a2dc3e192c7c00b93..833b157512923f7fe3bfee30ce8bf6d42b9d5204 100644 (file)
@@ -437,7 +437,8 @@ void rt2800_write_txwi(__le32 *txwi, struct txentry_desc *txdesc)
        rt2x00_desc_read(txwi, 0, &word);
        rt2x00_set_field32(&word, TXWI_W0_FRAG,
                           test_bit(ENTRY_TXD_MORE_FRAG, &txdesc->flags));
-       rt2x00_set_field32(&word, TXWI_W0_MIMO_PS, 0);
+       rt2x00_set_field32(&word, TXWI_W0_MIMO_PS,
+                          test_bit(ENTRY_TXD_HT_MIMO_PS, &txdesc->flags));
        rt2x00_set_field32(&word, TXWI_W0_CF_ACK, 0);
        rt2x00_set_field32(&word, TXWI_W0_TS,
                           test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags));
index c004cd3a8847c852c5b007ec5cdf2faf220c16f5..ad3c7ff4837b5bc96fb4efc6e74d69aa84fefe0c 100644 (file)
@@ -54,6 +54,16 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
         */
        if (txrate->flags & IEEE80211_TX_RC_MCS) {
                txdesc->mcs = txrate->idx;
+
+               /*
+                * MIMO PS should be set to 1 for STA's using dynamic SM PS
+                * when using more then one tx stream (>MCS7).
+                */
+               if (tx_info->control.sta && txdesc->mcs > 7 &&
+                   (tx_info->control.sta->ht_cap.cap &
+                    (WLAN_HT_CAP_SM_PS_DYNAMIC <<
+                     IEEE80211_HT_CAP_SM_PS_SHIFT)))
+                       __set_bit(ENTRY_TXD_HT_MIMO_PS, &txdesc->flags);
        } else {
                txdesc->mcs = rt2x00_get_rate_mcs(hwrate->mcs);
                if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
index 38b47919c86858c68e9583d855d93987e831b1ee..2d3bf843735ffd87a8616997a893f2a3729e5a0b 100644 (file)
@@ -268,6 +268,7 @@ struct txdone_entry_desc {
  * @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.
+ * @ENTRY_TXD_HT_MIMO_PS: The receiving STA is in dynamic SM PS mode.
  */
 enum txentry_desc_flags {
        ENTRY_TXD_RTS_FRAME,
@@ -286,6 +287,7 @@ enum txentry_desc_flags {
        ENTRY_TXD_HT_AMPDU,
        ENTRY_TXD_HT_BW_40,
        ENTRY_TXD_HT_SHORT_GI,
+       ENTRY_TXD_HT_MIMO_PS,
 };
 
 /**