linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Matthias Schiffer" <mschiffer@universe-factory.net>,
	"Richard Schütz" <rschuetz@uni-koblenz.de>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/2] wireless: set correct mandatory rate flags
Date: Tue, 30 Jan 2018 08:43:11 +0100	[thread overview]
Message-ID: <1517298191.2189.33.camel@sipsolutions.net> (raw)
In-Reply-To: <2f3b9bd7-f083-f46c-8c47-051019a6f495@universe-factory.net>

On Fri, 2018-01-26 at 23:17 +0100, Matthias Schiffer wrote:
> 
> I propose to revert this for now (I assume it's too late for 4.15, but
> hopefully the regression can be fixed in 4.15.1).

I really don't think we should revert this, it fixes a real bug.

We can easily switch the default though, would something like this
help?

diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 51aa55618ef7..b12da6ef3c12 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -170,9 +170,28 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
 		enum nl80211_bss_scan_width scan_width;
 		struct ieee80211_supported_band *sband =
 				rdev->wiphy.bands[setup->chandef.chan->band];
-		scan_width = cfg80211_chandef_to_scan_width(&setup->chandef);
-		setup->basic_rates = ieee80211_mandatory_rates(sband,
-							       scan_width);
+
+		if (setup->chandef.chan->band == NL80211_BAND_2GHZ) {
+			int i;
+
+			/*
+			 * Older versions selected the mandatory rates for
+			 * 2.4 GHz as well, but were broken in that only
+			 * 1 Mbps was regarded as a mandatory rate. Keep
+			 * using just 1 Mbps as the default basic rate for
+			 * mesh to be interoperable with older versions.
+			 */
+			for (i = 0; i < sband->n_bitrates; i++) {
+				if (sband->bitrates[i].bitrate == 10) {
+					setup->basic_rates = BIT(i);
+					break;
+				}
+			}
+		} else {
+			scan_width = cfg80211_chandef_to_scan_width(&setup->chandef);
+			setup->basic_rates = ieee80211_mandatory_rates(sband,
+								       scan_width);
+		}
 	}
 
 	err = cfg80211_chandef_dfs_required(&rdev->wiphy,

johannes

  reply	other threads:[~2018-01-30  7:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 15:47 [PATCH 1/2] wireless: set correct mandatory rate flags Richard Schütz
2017-09-07 15:47 ` [PATCH 2/2] wireless: return correct mandatory rates Richard Schütz
2017-09-08  6:55   ` Johannes Berg
2017-09-08  8:43     ` Richard Schütz
2017-09-08  8:53       ` Richard Schütz
2017-09-08  9:33         ` Simon Wunderlich
2017-09-08  9:03       ` Johannes Berg
2017-09-08 10:10         ` Richard Schütz
2017-09-08 10:12           ` Johannes Berg
2017-09-08 16:07   ` [PATCH v2 " Richard Schütz
2017-09-21 13:52     ` Johannes Berg
2017-09-22 10:09       ` Richard Schütz
2017-09-22 10:28         ` Johannes Berg
2017-09-08  6:54 ` [PATCH 1/2] wireless: set correct mandatory rate flags Johannes Berg
2017-09-08  8:43   ` Richard Schütz
2017-09-08  8:57     ` Johannes Berg
2017-09-21 13:49 ` Johannes Berg
2018-01-26 22:17 ` Matthias Schiffer
2018-01-30  7:43   ` Johannes Berg [this message]
2018-01-30 10:47     ` Matthias Schiffer

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=1517298191.2189.33.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mschiffer@universe-factory.net \
    --cc=rschuetz@uni-koblenz.de \
    /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 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).