linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aloka Dixit <alokad@codeaurora.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, John Crispin <john@phrozen.org>
Subject: Re: [PATCH v9 3/4] mac80211: add multiple bssid/EMA support to beacon handling
Date: Thu, 08 Apr 2021 10:16:53 -0700	[thread overview]
Message-ID: <066c16c890835a3b929e4da7e88c9454@codeaurora.org> (raw)
In-Reply-To: <9b475ee0514083ee50c45098bae596fd6a579e89.camel@sipsolutions.net>

On 2021-04-08 05:11, Johannes Berg wrote:
> On Wed, 2021-03-10 at 10:26 -0800, Aloka Dixit wrote:
>> 
>> +/**
>> + * enum ieee80211_bcn_tmpl_ema - EMA beacon generation type
>> + * @IEEE80211_BCN_EMA_NONE: don't generate an EMA beacon.
>> + * @IEEE80211_BCN_EMA_NEXT: generate the next periodicity beacon.
>> + * @IEEE80211_BCN_EMA_INDEX: generate beacon by periodicity index
>> + *	if the value is >= this enum value.
>> + */
>> +enum ieee80211_bcn_tmpl_ema {
>> +	IEEE80211_BCN_EMA_NONE	= -2,
>> +	IEEE80211_BCN_EMA_NEXT	= -1,
>> +	IEEE80211_BCN_EMA_INDEX	= 0,
> 
> Maybe call it _BASE instead of _INDEX, it's not really meant to be used
> as is?
> 

Sure

>> +static u8 *ieee80211_copy_multiple_bssid_beacon(u8 *offset,
>> +						struct cfg80211_multiple_bssid_data *dest,
>> +						struct cfg80211_multiple_bssid_data *src)
>> +{
>> +	int i;
>> +
>> +	if (!dest || !src)
>> +		return offset;
>> +
>> +	dest->cnt = src->cnt;
>> +	for (i = 0; i < dest->cnt; i++) {
>> +		dest->elems[i].len = src->elems[i].len;
>> +		dest->elems[i].data = offset;
>> +		memcpy(dest->elems[i].data, src->elems[i].data,
>> +		       dest->elems[i].len);
>> +		offset += dest->elems[i].len;
>> +	}
> 
> 
> Following my earlier question - here you just copy all the elements one
> after another, as far as I can tell, so why did they need to be 
> separate
> in the first place? Might be a lot simpler everywhere if all of this 
> was
> just a single buffer, starting from the userspace API?
> 
> 

Separate buffers required as only one buffer is copied when
(ema_index >= IEEE80211_BCN_EMA_INDEX) in
__ieee80211_beacon_get().


>> @@ -4740,13 +4800,11 @@ __ieee80211_beacon_get(struct ieee80211_hw 
>> *hw,
>>  	struct ieee80211_chanctx_conf *chanctx_conf;
>>  	int csa_off_base = 0;
> 
>> -	rcu_read_lock();
>> -
>>  	sdata = vif_to_sdata(vif);
>>  	chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
> 
> OK, but ...
> 
>>  struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
>>  					 struct ieee80211_vif *vif,
>>  					 u16 *tim_offset, u16 *tim_length)
>>  {
>>  	struct ieee80211_mutable_offsets offs = {};
>> -	struct sk_buff *bcn = __ieee80211_beacon_get(hw, vif, &offs, false);
>> +	struct sk_buff *bcn = __ieee80211_beacon_get(hw, vif, &offs, false,
>> +						     IEEE80211_BCN_EMA_NONE);
> 
> You didn't add the protection everywhere.
> 

Will revise this part, thanks for bringing it up.

> johannes

  reply	other threads:[~2021-04-08 17:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 18:26 [PATCH v9 0/4] Multiple BSSID support Aloka Dixit
2021-03-10 18:26 ` [PATCH v9 1/4] nl80211: add basic multiple bssid support Aloka Dixit
2021-04-08 12:05   ` Johannes Berg
2021-04-08 17:09     ` Aloka Dixit
2021-03-10 18:26 ` [PATCH v9 2/4] mac80211: add multiple bssid support to interface handling Aloka Dixit
2021-04-08 12:06   ` Johannes Berg
2021-04-16 21:35     ` Aloka Dixit
2021-04-19 11:28       ` Johannes Berg
2021-04-19 22:35         ` Aloka Dixit
2021-04-19 22:42           ` Aloka Dixit
2021-04-20  8:25           ` Johannes Berg
2021-03-10 18:26 ` [PATCH v9 3/4] mac80211: add multiple bssid/EMA support to beacon handling Aloka Dixit
2021-04-08 12:11   ` Johannes Berg
2021-04-08 17:16     ` Aloka Dixit [this message]
2021-03-10 18:26 ` [PATCH v9 4/4] mac80211: CSA on non-transmitting interfaces Aloka Dixit
2021-04-08 11:53 ` [PATCH v9 0/4] Multiple BSSID support Johannes Berg
2021-04-09 18:05   ` Aloka Dixit
2021-04-08 12:17 ` Johannes Berg
2021-04-09 18:31   ` Aloka Dixit
2021-04-09 19:28     ` 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=066c16c890835a3b929e4da7e88c9454@codeaurora.org \
    --to=alokad@codeaurora.org \
    --cc=johannes@sipsolutions.net \
    --cc=john@phrozen.org \
    --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 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).