linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Alexei Avshalom Lazar <ailizaro@codeaurora.org>
Cc: linux-wireless@vger.kernel.org, wil6210@qti.qualcomm.com
Subject: Re: [PATCH 2/3] nl80211: Add support for EDMG channels
Date: Tue, 28 Aug 2018 11:33:50 +0200	[thread overview]
Message-ID: <1535448830.5895.30.camel@sipsolutions.net> (raw)
In-Reply-To: <1534163582-9983-3-git-send-email-ailizaro@codeaurora.org>

On Mon, 2018-08-13 at 15:33 +0300, Alexei Avshalom Lazar wrote:
> 
>  /**
> + * struct ieee80211_sta_edmg_cap - EDMG capabilities
> + *
> + * This structure describes most essential parameters needed
> + * to describe 802.11ay EDMG capabilities
> + *
> + * @supported: is EDMG supported, Device may support EDMG
> + *	without supporting channel bonding. In this case
> + *	supported would be TRUE with n_channels = 0

TRUE -> %true

> + * @channels: supported ieee EDMG channel numbers

IEEE

> + * @n_channels: Number of channels in @channels
> + */
> +struct ieee80211_sta_edmg_cap {
> +	bool supported;
> +	u8 *channels;

const?

But really this is pointless - there are *two* channels here (6 and 7),
and so at most you point to a 2-byte array? Just make it

	u8 channels[2];

or something and save the whole pointering?

Ok, no, there are 9-25 or something, so I guess more than that...

Uh. Why do we bother though? Do we need the channel number anywhere? Why
not just let userspace specify the bitmap to start with?

Would there really be devices that base their support for channels on
anything other than support for the underlying DMG channels?


>   * @center_freq1: center frequency of first segment
>   * @center_freq2: center frequency of second segment
>   *	(only with 80+80 MHz)
> + * @edmg_mode: if defined, edmg supported and primary channel is EDMG
> + * @edmg_channel: the EDMG channel
>   */
>  struct cfg80211_chan_def {
>  	struct ieee80211_channel *chan;
>  	enum nl80211_chan_width width;
>  	u32 center_freq1;
>  	u32 center_freq2;
> +	bool edmg_mode;
> +	u8 edmg_channel;

This seems odd. What do you put into chan_width if it's EDMG then? What
do you put into the chan pointer?

> + * @NL80211_ATTR_WIPHY_EDMG_CHANNEL: EDMG channel to be used for AP
> + *      configuration and connect command.

u8 is intended, I assume?

But why do you need this anyhow? The EDMG channel has a frequency just
like all other channels, no? Can't we continue to use the existing
attributes?

> +static const struct edmg_chan_table {
> +	/* the edmg channel - 9,10,11... */
> +	u8 edmg_chan;
> +	/* the sub channels represented as a bitfield where the bit-index
> +	 * corresponds to the legacy channel (bit 0 not used).
> +	 */
> +	u8 sub_chans;

Uh, ok, so I guess it's more complicated?

I'm not familiar with 802.11ay ... I guess a short primer should be in
the patch set here somewhere :)

> +} cfg80211_edmg_table[] = {
> +	{9, 0x06},	/* channels 1,2 */

BIT(1) | BIT(2) ? then you don't really need the comments ...

> +	{10, 0x0c},	/* channels 2,3 */
> +	{11, 0x18},	/* channels 3,4 */
> +	{12, 0x30},	/* channels 4,5 */
> +	{13, 0x60},	/* channels 5,6 */
> +	{17, 0x0e},	/* channels 1,2,3 */
> +	{18, 0x1c},	/* channels 2,3,4 */
> +	{19, 0x38},	/* channels 3,4,5 */
> +	{20, 0x70},	/* channels 4,5,6 */

What happened to 21-24?

> +	{25, 0x1e},	/* channels 1,2,3,4 */

> +static u8 cfg80211_get_edmg_sub_chans(u8 edmg_channel)
> +{
> +	int i;
> +
> +	for (i = 0; i < ARRAY_SIZE(cfg80211_edmg_table); i++)
> +		if (cfg80211_edmg_table[i].edmg_chan == edmg_channel)
> +			return cfg80211_edmg_table[i].sub_chans;

Maybe just index the array at "edmg_channel - 9", add dummies for 21-24
and save the whole loop? I guess it doesn't matter so much though.

johannes

  reply	other threads:[~2018-08-28 13:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13 12:32 [PATCH 0/3] Add support for new channels on 60GHz band Alexei Avshalom Lazar
2018-08-13 12:33 ` [PATCH 1/3] cfg80211: Add support for 60GHz band channels 5 and 6 Alexei Avshalom Lazar
2018-08-28  9:25   ` Johannes Berg
2018-08-13 12:33 ` [PATCH 2/3] nl80211: Add support for EDMG channels Alexei Avshalom Lazar
2018-08-28  9:33   ` Johannes Berg [this message]
2019-05-13 14:38     ` Alexei Avshalom Lazar
2018-08-13 12:33 ` [PATCH 3/3] wil6210: Add EDMG channel support Alexei Avshalom Lazar

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=1535448830.5895.30.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=ailizaro@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=wil6210@qti.qualcomm.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 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).