All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Peter Große" <pegro@friiks.de>
To: linux-wireless@vger.kernel.org
Subject: Handling user regdom hints while having intersected world regdom
Date: Sat, 29 Sep 2018 02:13:21 +0200	[thread overview]
Message-ID: <20180929021321.1e1b6c3e@fem-net.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 1974 bytes --]

Hi.

When a setup has multiple wifi cards anounncing different regdoms, the
regularitory subsystem stores an intersected world regdom using aplha2 "98".

I wonder what the correct result should be, when I call "iw reg set 00" or with
any other country code?

Because in my system with multiple cards nothing happened.

I added a lot of debug messages and I found the request is rejected with
REG_REQ_IGNORE in __reg_process_hint_user (in net/wireless/reg.c:2371).

In this check, last_request is considered (the request before my user request),
which in my case was the driver request for the second card leading to the
intersected regdom. But since "98" doesn't match the regdom provided by the
driver, the check returns true and the request gets rejected.

The comment above the check mentions not yet processed requests, but I doubt
that checking the current regdom against the last_request regdom helps in my
case. But from reading the code I got there is a "processed" flag for each
requst.

So maybe a patch like below is enough? Or are there more things to consider?
Or maybe I'm wrong and the current behavior is intended?!

Regards
Peter

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 4fc66a117b7d..ed4543c7b255 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -2428,15 +2428,15 @@ __reg_process_hint_user(struct regulatory_request
*user_request) /*
         * Process user requests only after previous user/driver/core
         * requests have been processed
         */
        if ((lr->initiator == NL80211_REGDOM_SET_BY_CORE ||
             lr->initiator == NL80211_REGDOM_SET_BY_DRIVER ||
             lr->initiator == NL80211_REGDOM_SET_BY_USER) &&
-           regdom_changes(lr->alpha2))
+           !lr->processed)
                return REG_REQ_IGNORE;
 
        if (!regdom_changes(user_request->alpha2))
                return REG_REQ_ALREADY_SET;
 
        return REG_REQ_OK;
 }

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2018-09-29  0:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-29  0:13 Peter Große [this message]
2018-10-19 16:26 ` Handling user regdom hints while having intersected world regdom Tom Psyborg

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=20180929021321.1e1b6c3e@fem-net.de \
    --to=pegro@friiks.de \
    --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.