From: "Allen Ye (葉芷勳)" <Allen.Ye@mediatek.com>
To: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"lorenzo@kernel.org" <lorenzo@kernel.org>,
"johannes@sipsolutions.net" <johannes@sipsolutions.net>
Cc: "lorenzo.bianconi@redhat.com" <lorenzo.bianconi@redhat.com>,
"nbd@nbd.name" <nbd@nbd.name>,
"Evelyn Tsai (蔡珊鈺)" <Evelyn.Tsai@mediatek.com>,
"Money Wang (王信安)" <Money.Wang@mediatek.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>
Subject: Re: [PATCH v2] wifi: mac80211: Update bssid indicator with real BSS numbers
Date: Wed, 27 Dec 2023 09:38:07 +0000 [thread overview]
Message-ID: <c23373d71eff81ea043783edff0345502bb2e299.camel@mediatek.com> (raw)
In-Reply-To: <65d21336e8f7e180352403a3e894aeaf27a22cab.camel@sipsolutions.net>
On Thu, 2023-12-14 at 13:29 +0100, Johannes Berg wrote:
>
> Hi,
>
> We should have Lorenzo here, he wrote the original code.
>
> On Fri, 2023-12-08 at 14:38 +0800, Allen Ye wrote:
> > The cnt member in mbssid is the count of total number of MBSSID
> elements
> > instead of BSSID. Therefore, we fix this by reading the MaxBSSID
> Indicator
> > field directly.
>
> I'll say I don't understand this much ...
>
> Are you trying to have BSSIDs that are hidden from the kernel? Or not
> contiguous in the MBSSID set? Not sure how the two can be not
> equivalent?
>
Hi Johannes,
The number of BSS is not equal to MBSSID element count plus 1 because
there might be multiple nontransmitted BSSID profile subelements in one
MBSSID element. Also, one nontransmitted BSSID profile subelement might
be fragmented across two MBSSID elements if the length of the
subelement exceeds 255 octets.
> > Co-developed-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
> > Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
> > Co-developed-by: Money Wang <money.wang@mediatek.com>
> > Signed-off-by: Money Wang <money.wang@mediatek.com>
> > Signed-off-by: Allen Ye <allen.ye@mediatek.com>
>
> I have to admit that I chuckled a bit about this for a 5 line patch
> :-)
>
> > diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> > index 606b1b2e4123..f90bcd59f85a 100644
> > --- a/net/mac80211/cfg.c
> > +++ b/net/mac80211/cfg.c
> > @@ -1164,9 +1164,11 @@ ieee80211_assign_beacon(struct
> ieee80211_sub_if_data *sdata,
> > /* copy in optional mbssid_ies */
> > if (mbssid) {
> > u8 *pos = new->tail + new->tail_len;
> > +const struct element *mbssid_elem;
> >
> > new->mbssid_ies = (void *)pos;
> > pos += struct_size(new->mbssid_ies, elem, mbssid->cnt);
> > +mbssid_elem = (const struct element *)pos;
> > pos += ieee80211_copy_mbssid_beacon(pos, new->mbssid_ies,
> > mbssid);
> > if (rnr) {
> > @@ -1175,8 +1177,7 @@ ieee80211_assign_beacon(struct
> ieee80211_sub_if_data *sdata,
> > ieee80211_copy_rnr_beacon(pos, new->rnr_ies, rnr);
> > }
> > /* update bssid_indicator */
> > -link_conf->bssid_indicator =
> > -ilog2(__roundup_pow_of_two(mbssid->cnt + 1));
> > +link_conf->bssid_indicator = mbssid_elem->data[0];
>
> But this seems fishy to me, if you look into the element itself,
> you're
> going to have to do some validation on it? And what about
> fragmentation?
>
> johannes
Whether the subelement is aggregated or fragmented, the MaxBSSID
Indicator field would be the same for the multiple BSSID set.
Therefore, we directly retrieve this field from the element.
For example, there are five BSSes in one multiple BSSID set, one
transmitted and four non-transmitted BSSes. We might use just two
MBSSID elements to store all the non-transmitted BSS information. Here
the MaxBSSID Indicator is 3 in both MBSSID elements. However, the
element cnt is 2 and if we use the original method to calculate the
BSSID Indicator we will get 2 which is wrong.
Thanks,
Allen
next prev parent reply other threads:[~2023-12-27 9:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 6:38 [PATCH v2] wifi: mac80211: Update bssid indicator with real BSS numbers Allen Ye
2023-12-14 12:29 ` Johannes Berg
2023-12-27 9:38 ` Allen Ye (葉芷勳) [this message]
2024-04-23 11:21 ` Johannes Berg
2024-04-23 11:28 ` Johannes Berg
2024-05-02 16:45 ` Aloka Dixit
2024-04-23 19:12 ` Jeff Johnson
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=c23373d71eff81ea043783edff0345502bb2e299.camel@mediatek.com \
--to=allen.ye@mediatek.com \
--cc=Evelyn.Tsai@mediatek.com \
--cc=Money.Wang@mediatek.com \
--cc=johannes@sipsolutions.net \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=nbd@nbd.name \
/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