diff mbox

[V3] mac80211: minstrel_ht: Handle Dynamic SMPS state of the peer.

Message ID 1433355732-7604-1-git-send-email-chaitanya.mgit@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show

Commit Message

Krishna Chaitanya June 3, 2015, 6:22 p.m. UTC
In case of Dynamic SMPS enable RTS/CTS for all rates.

Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com>
---
V3: Moved the check to set_rate.
V2: Fix indent and add signoff.
---
 net/mac80211/rc80211_minstrel_ht.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

Johannes Berg June 9, 2015, 8:08 p.m. UTC | #1
On Wed, 2015-06-03 at 23:52 +0530, Chaitanya T K wrote:
> In case of Dynamic SMPS enable RTS/CTS for all rates.

> +	/* Enable RTS/CTS for below cases.
> +	 * 1) 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
> +	 * 2) 2nd and 3rd Rates, as 1st Rate Failed.
> +	 */
> +	if ((mi->sta->smps_mode == IEEE80211_SMPS_DYNAMIC &&
> +	     group->streams > 1) ||
> +	     offset > 0) {

Indent still isn't right - the line starting with "offset" should be
indented one less. Might also be worthwhile to just reorder the
condition to first check for offset > 0?

I was about to do that and apply this, but it seems the comment doesn't
make sense since you're not doing 1b. afaict?

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Krishna Chaitanya June 9, 2015, 8:28 p.m. UTC | #2
On Wed, Jun 10, 2015 at 1:38 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Wed, 2015-06-03 at 23:52 +0530, Chaitanya T K wrote:
>> In case of Dynamic SMPS enable RTS/CTS for all rates.
>
>> +     /* Enable RTS/CTS for below cases.
>> +      * 1) 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
>> +      * 2) 2nd and 3rd Rates, as 1st Rate Failed.
>> +      */
>> +     if ((mi->sta->smps_mode == IEEE80211_SMPS_DYNAMIC &&
>> +          group->streams > 1) ||
>> +          offset > 0) {
>
> Indent still isn't right - the line starting with "offset" should be
> indented one less. Might also be worthwhile to just reorder the
> condition to first check for offset > 0?
Ok, i will fix the indent and also re-order the check.

> I was about to do that and apply this, but it seems the comment doesn't
> make sense since you're not doing 1b. afaict?
Yes, the comment is not applicable for this version, will remove.
Will submit V4, Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c
index 7430a1d..600208f 100644
--- a/net/mac80211/rc80211_minstrel_ht.c
+++ b/net/mac80211/rc80211_minstrel_ht.c
@@ -867,7 +867,15 @@  minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
 	else
 		idx = index % MCS_GROUP_RATES + (group->streams - 1) * 8;
 
-	if (offset > 0) {
+	/* Enable RTS/CTS for below cases.
+	 * 1) 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
+	 * 2) 2nd and 3rd Rates, as 1st Rate Failed.
+	 */
+	if ((mi->sta->smps_mode == IEEE80211_SMPS_DYNAMIC &&
+	     group->streams > 1) ||
+	     offset > 0) {
 		ratetbl->rate[offset].count = ratetbl->rate[offset].count_rts;
 		flags |= IEEE80211_TX_RC_USE_RTS_CTS;
 	}