diff mbox

[V2] mac80211: Minstrel HT: Handle all SMPS states of the peer STA.

Message ID 1433270224-10013-1-git-send-email-chaitanya.mgit@gmail.com (mailing list archive)
State Superseded
Delegated to: Johannes Berg
Headers show

Commit Message

Krishna Chaitanya June 2, 2015, 6:37 p.m. UTC
From: Chaitanya Tata <chaitanya.mgit@gmail.com>

In case of Dynamic SMPS enable RTS/CTS for all rates.
In case of Static SMPS mark the Nss > 1 rates as not supported.

Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com>
---
V2: Fix the Indent and Sign off missing.
---
 net/mac80211/rc80211_minstrel_ht.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

Comments

Krishna Chaitanya June 2, 2015, 7:10 p.m. UTC | #1
On Wed, Jun 3, 2015 at 12:07 AM, Chaitanya T K <chaitanya.mgit@gmail.com> wrote:
> From: Chaitanya Tata <chaitanya.mgit@gmail.com>
>
> In case of Dynamic SMPS enable RTS/CTS for all rates.
> In case of Static SMPS mark the Nss > 1 rates as not supported.
>
> Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com>
> ---
> V2: Fix the Indent and Sign off missing.
> ---
>  net/mac80211/rc80211_minstrel_ht.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
> index 7430a1d..0889c22 100644
> --- a/net/mac80211/rc80211_minstrel_ht.c
> +++ b/net/mac80211/rc80211_minstrel_ht.c
> @@ -1176,9 +1176,16 @@ minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
>
>                 nss = minstrel_mcs_groups[i].streams;
>
> -               /* Mark MCS > 7 as unsupported if STA is in static SMPS mode */
> -               if (sta->smps_mode == IEEE80211_SMPS_STATIC && nss > 1)
> -                       continue;
> +               /* Handle STA's SMPS State, if Nss > 1.
> +               * a. Use RTS_CTS, if STA is in Dynamic SMPS Mode
> +               * b. Mark Nss > 1 as unsupported, if STA is in static SMPS mode
> +               */
> +               if (nss > 1) {
> +                       if (sta->smps_mode == IEEE80211_SMPS_DYNAMIC)
> +                               gflags |= IEEE80211_TX_RC_USE_RTS_CTS;

Just noticed that the minstrel_mcs_groups is a const struct, so this wont work.

So may be we can move this check to set_rate we can populate rate_table
and also have access to "sta" info?

> +                       else if (sta->smps_mode == IEEE80211_SMPS_STATIC)
> +                               continue;
> +               }
>
>                 /* HT rate */
>                 if (gflags & IEEE80211_TX_RC_MCS) {
> --
> 1.9.1
>
diff mbox

Patch

diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 7430a1d..0889c22 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -1176,9 +1176,16 @@  minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
 
 		nss = minstrel_mcs_groups[i].streams;
 
-		/* Mark MCS > 7 as unsupported if STA is in static SMPS mode */
-		if (sta->smps_mode == IEEE80211_SMPS_STATIC && nss > 1)
-			continue;
+		/* Handle STA's SMPS State, if Nss > 1.
+		* a. Use RTS_CTS, if STA is in Dynamic SMPS Mode
+		* b. Mark Nss > 1 as unsupported, if STA is in static SMPS mode
+		*/
+		if (nss > 1) {
+			if (sta->smps_mode == IEEE80211_SMPS_DYNAMIC)
+				gflags |= IEEE80211_TX_RC_USE_RTS_CTS;
+			else if (sta->smps_mode == IEEE80211_SMPS_STATIC)
+				continue;
+		}
 
 		/* HT rate */
 		if (gflags & IEEE80211_TX_RC_MCS) {