All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivekananda Holla <vivekanandah@posedge.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: [Patch] mac80211: add rts-cts for dynamic SMPS stations
Date: Mon, 15 Apr 2013 12:03:05 +0530	[thread overview]
Message-ID: <516B9F21.2080304@posedge.com> (raw)

Checking whether dynamic SMPS is enabled at the receiver station for
which packet is intended to be transmitted. Enable RTS
protection for multi-stream rates for such packets.

Signed-off-by: Vivekananda Holla <vivekanandah@posedge.com>
---
 net/mac80211/tx.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index aad0bf5..38c2ec6 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -621,6 +621,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
     int i;
     u32 len;
     bool inval = false, rts = false, short_preamble = false;
+    bool dyn_smps = false;
     struct ieee80211_tx_rate_control txrc;
     bool assoc = false;
 
@@ -738,6 +739,13 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
         info->control.rts_cts_rate_idx = baserate;
     }
 
+    /* check if dynamic SMPS is on at receiving station */
+    if (tx->sta) {
+        if (tx->sta->sta.smps_mode == WLAN_HT_CAP_SM_PS_DYNAMIC) {
+            dyn_smps = true;
+        }
+    }
+
     for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) {
         /*
          * make sure there's no valid rate following
@@ -766,7 +774,17 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
         if (rts)
             info->control.rates[i].flags |=
                 IEEE80211_TX_RC_USE_RTS_CTS;
-
+        /*
+         * set up RTS protection for multi-stream rates if dynamic
+         * SMPS is enabled for the receiving station
+         */
+        if (dyn_smps) {
+            if ((info->control.rates[i].idx > 7) &&
+                (info->control.rates[i].idx != 32))
+                info->control.rates[i].flags |=
+                    IEEE80211_TX_RC_USE_RTS_CTS;        
+        }
+        
         /* RC is busted */
         if (WARN_ON_ONCE(info->control.rates[i].idx >=
                  sband->n_bitrates)) {

             reply	other threads:[~2013-04-15  6:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-15  6:33 Vivekananda Holla [this message]
2013-04-15  9:24 ` [Patch] mac80211: add rts-cts for dynamic SMPS stations Johannes Berg
2013-04-15 10:43   ` Vivekananda Holla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516B9F21.2080304@posedge.com \
    --to=vivekanandah@posedge.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.