All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Wunderlich <sw@simonwunderlich.de>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, benjamin@sipsolutions.net
Subject: Re: [PATCH 5/7] mac80211: add wide bandwidth channel switch announcement to CSA action frames and mesh beacons
Date: Fri, 19 May 2017 13:45:19 +0200	[thread overview]
Message-ID: <2485332.tTJvvc4NYf@prime> (raw)
In-Reply-To: <1495193617.3274.7.camel@sipsolutions.net>

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

Hi Johannes,

On Friday, May 19, 2017 1:33:37 PM CEST Johannes Berg wrote:
> I've applied patches 1-4 now.
> 
> The subject is a bit long - I was going to change it to
> 
>     mac80211: mesh: support sending wide bandwidth CSA
>     
>     To support HT and VHT channel switch announcements, both beacons
>     and action frames must include the corresponding IEs.
> 
> but:
> > +		   2 + 2 + sizeof(struct
> > ieee80211_wide_bw_chansw_ie) +
> > +		   2 + sizeof(struct ieee80211_sec_chan_offs_ie) +
> 
> The "2 + 2" should have a comment - no that I'm even really sure that
> you need the wrapper?
> 

right, I'll add a comment. The spec says I need it, and if I understood the 
parsing function correctly it will only search for the wide bw IE when it finds 
the wrapper.

> > -		pos = skb_put(skb, 13);
> > -		memset(pos, 0, 13);
> 
> Removing that is nice - but why do you do this:
> > +		bool have_secondary_chan_offset = false;
> > +		bool have_wide_bandwidth_cs = false;
> > +		int ie_len = 2 + sizeof(struct
> > ieee80211_channel_sw_ie) +
> > +			     2 + sizeof(struct
> > ieee80211_mesh_chansw_params_ie);
> > +
> > +		switch (csa->settings.chandef.width) {
> > +		case NL80211_CHAN_WIDTH_80:
> > +		case NL80211_CHAN_WIDTH_80P80:
> > +		case NL80211_CHAN_WIDTH_160:
> > +			have_wide_bandwidth_cs = true;
> > +			ie_len += 2 + 2 +
> > +				  sizeof(struct
> > ieee80211_wide_bw_chansw_ie);
> > +			break;
> > +		case NL80211_CHAN_WIDTH_40:
> > +			have_secondary_chan_offset = true;
> > +			ie_len += 2 + sizeof(struct
> > ieee80211_sec_chan_offs_ie);
> > +		default:
> > +			break;
> > +		}
> > +		pos = skb_put(skb, ie_len);
> > +		memset(pos, 0, ie_len);
> 
> I think having multiple calls to skb_put() would be better.
> 

OK.

>[...]
> 
> and likewise here.
> 
> That'd also be safer in a way.

Understood, I can change it this way.

Thanks a lot for the feedback!
      Simon

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-05-19 11:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16  9:23 [PATCH 0/7] extend mac80211 mesh DFS and CSA functionality Simon Wunderlich
2017-05-16  9:23 ` [PATCH 1/7] mac80211: Mark channel as unusable if a regulatory MESH CSA is received Simon Wunderlich
2017-05-16  9:23 ` [PATCH 2/7] wireless: Only join DFS channels in mesh mode if userspace flags support Simon Wunderlich
2017-05-16  9:23 ` [PATCH 3/7] wireless: Require HANDLE_DFS flag to switch channel for non-AP mode Simon Wunderlich
2017-05-16  9:23 ` [PATCH 4/7] mac80211: Allow following CSA to DFS channels if userspace handles it Simon Wunderlich
2017-05-16  9:23 ` [PATCH 5/7] mac80211: add wide bandwidth channel switch announcement to CSA action frames and mesh beacons Simon Wunderlich
2017-05-19 11:33   ` Johannes Berg
2017-05-19 11:45     ` Simon Wunderlich [this message]
2017-05-19 11:51       ` Johannes Berg
2017-05-16  9:23 ` [PATCH 6/7] mac80211: enable VHT for mesh channel processing Simon Wunderlich
2017-05-16  9:23 ` [PATCH 7/7] mac80211: mark as action frame when parsing IEs of CSA action frames Simon Wunderlich
2017-05-19 11:35   ` Johannes Berg
2017-05-16  9:44 ` [PATCH 0/7] extend mac80211 mesh DFS and CSA functionality Bastian Bittorf
2017-05-16 10:18   ` Simon Wunderlich
2017-05-16 11:55     ` Bastian Bittorf
2017-05-16 12:04       ` Simon Wunderlich

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=2485332.tTJvvc4NYf@prime \
    --to=sw@simonwunderlich.de \
    --cc=benjamin@sipsolutions.net \
    --cc=johannes@sipsolutions.net \
    --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.