All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jouni Malinen <j@w1.fi>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: kbuild test robot <lkp@intel.com>, Peng Xu <pxu@codeaurora.org>,
	kbuild-all@01.org, linux-wireless@vger.kernel.org,
	Sara Sharon <sara.sharon@intel.com>,
	Jouni Malinen <jouni@codeaurora.org>
Subject: Re: [mac80211-next:cfg80211-mac80211-multi-bssid 8/20] ERROR: "__umoddi3" [net/wireless/cfg80211.ko] undefined!
Date: Mon, 11 Feb 2019 16:57:47 +0200	[thread overview]
Message-ID: <20190211145747.GA30703@w1.fi> (raw)
In-Reply-To: <9e586a147fa94995b06011d74ab6ee1a082f4b94.camel@sipsolutions.net>

On Sat, Feb 09, 2019 at 09:08:20AM +0100, Johannes Berg wrote:

> but maybe the whole thing is more readable as
> 
> static inline void cfg80211_gen_new_bssid(const u8 *bssid_addr, u8 max_bssid,
>                                           u8 mbssid_index, u8 *new_bssid_addr)
> {
>         u64 bssid = ether_addr_to_u64(bssid_addr);
>         u64 mask = GENMASK_ULL(max_bssid - 1, 0);
>         u64 new_bssid;
> 
>         new_bssid &= bssid & ~mask;

That should be "=" not "&="..

>         new_bssid |= ((bssid & mask) + mbssid_index) & mask;
> 
>         u64_to_ether_addr(new_bssid, new_bssid_addr);
> }

but other than that, this version looks much nicer than the other
alternatives.

> However, isn't it true that 0 <= mbssid_index < max_bssid? Then the
> whole masking isn't really needed at all?

0 <= mbssid_index < 2^max_bssid. The transmitted BSSID (i.e., that
bssid_addr argument) is not required to be the first BSSID in the range,
so the masking is needed to cover wraparound for addition modulo
2^mbssid_index when max_bssid LSBs of bssid are not zeros.

-- 
Jouni Malinen                                            PGP id EFC895FA

  reply	other threads:[~2019-02-11 15:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-09  7:47 [mac80211-next:cfg80211-mac80211-multi-bssid 8/20] ERROR: "__umoddi3" [net/wireless/cfg80211.ko] undefined! kbuild test robot
2019-02-09  8:08 ` Johannes Berg
2019-02-11 14:57   ` Jouni Malinen [this message]
2019-02-11 14:58     ` Johannes Berg

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=20190211145747.GA30703@w1.fi \
    --to=j@w1.fi \
    --cc=johannes@sipsolutions.net \
    --cc=jouni@codeaurora.org \
    --cc=kbuild-all@01.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=pxu@codeaurora.org \
    --cc=sara.sharon@intel.com \
    /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.