linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] mac80211: add rts-cts for dynamic SMPS stations
@ 2013-04-15  6:33 Vivekananda Holla
  2013-04-15  9:24 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Vivekananda Holla @ 2013-04-15  6:33 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

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)) {

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] mac80211: add rts-cts for dynamic SMPS stations
  2013-04-15  6:33 [Patch] mac80211: add rts-cts for dynamic SMPS stations Vivekananda Holla
@ 2013-04-15  9:24 ` Johannes Berg
  2013-04-15 10:43   ` Vivekananda Holla
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2013-04-15  9:24 UTC (permalink / raw)
  To: Vivekananda Holla; +Cc: linux-wireless

Vivek,

Please work with some of your colleagues at posedge to submit a proper
patch. This is formatted completely wrongly in many ways.

> +        if (dyn_smps) {
> +            if ((info->control.rates[i].idx > 7) &&
> +                (info->control.rates[i].idx != 32))

This is also completely wrong. (hint, there are non-HT bitrates still)

johannes


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch] mac80211: add rts-cts for dynamic SMPS stations
  2013-04-15  9:24 ` Johannes Berg
@ 2013-04-15 10:43   ` Vivekananda Holla
  0 siblings, 0 replies; 3+ messages in thread
From: Vivekananda Holla @ 2013-04-15 10:43 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

Hi Johannes,

I ran checkpatch.pl script and found some trailing white spaces in the patch which i have now
corrected.
 
Also,i had initially placed my code in minstrel_ht_get_rate but saw that the minstrel code is being
changed.
hence, moved the code in to ieee80211_tx_h_rate_ctrl function.

there is a check in this function

        if (info->control.rates[i].flags & IEEE80211_TX_RC_MCS) {
            WARN_ON(info->control.rates[i].idx > 76);
            continue;
        }
 
I feel it would be okay to move  the code for dyn_smps within this loop as
this would solve the check for MCS rates.

however i am not sure whether all ht rates flag settings need to be handled within minstrel_ht?

        if (info->control.rates[i].flags & IEEE80211_TX_RC_MCS) {
            WARN_ON(info->control.rates[i].idx > 76);

+        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;    


            continue;
        }

awaiting your inputs

thanks and regards
Vivek

On 04/15/2013 02:54 PM, Johannes Berg wrote:
> Vivek,
>
> Please work with some of your colleagues at posedge to submit a proper
> patch. This is formatted completely wrongly in many ways.
>
>> +        if (dyn_smps) {
>> +            if ((info->control.rates[i].idx > 7) &&
>> +                (info->control.rates[i].idx != 32))
> This is also completely wrong. (hint, there are non-HT bitrates still)
>
> johannes
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-15 10:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-15  6:33 [Patch] mac80211: add rts-cts for dynamic SMPS stations Vivekananda Holla
2013-04-15  9:24 ` Johannes Berg
2013-04-15 10:43   ` Vivekananda Holla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).