linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Kazior <michal.kazior@tieto.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [RFC v3] initial channel context implementation
Date: Thu, 28 Jun 2012 08:04:04 +0200	[thread overview]
Message-ID: <4FEBF3D4.3030705@tieto.com> (raw)
In-Reply-To: <1340805730.11012.33.camel@jlt3.sipsolutions.net>

Johannes Berg wrote:
> On Wed, 2012-06-27 at 14:43 +0200, Michal Kazior wrote:
> I think we should do
>    c) if the driver advertises support for multiple channels in its
>       interface combinations or implements the channel context callbacks,
>       it must have hw_scan/roc, otherwise we fail hw registration; if it
>       advertises support for multiple channels obviously it must have all
>       the channel context callbacks
>
> This would leave all existing drivers operating as-is, the next step
> would be adding channel context support to a driver (must have hw
> scan/roc in that case), and the next step after that would be actually
> advertising support for multiple channels -- in practice it's probably
> just a single patch doing both but that's the logical order then.

Right.


>> For legacy operation we'd need to iterate through active interface in
>> hw_config() and call ieee80211_vif_use_channel() for each. This would
>> allow us to have the same channel context across all interfaces (so we
>> can virtually use channel context everywhere instead of
>> hw.conf.channel). This means the .assign_vif_chanctx cannot sleep if my
>> understanding is correct (we'd need to use RCU locking for iteration
>> since devlist lock may be held while hw_config() is caled).
>>
>> What do you think?
>
> What 'legacy operation' are you referring to?

The case when we support swscan and tmpchan.


> In any case, I think you're turning it upside down. I think we should
> get rid of local->oper_channel(_type) completely, and instead use the
> channel contexts in mac80211 everywhere. If the driver doesn't implement
> channel contexts it can only support a single channel. Thus, we can have
> at most one channel context, so whenever a new context is added (there
> could be zero) or any context is modified (the only one) we can set
> hw.conf.channel and call hw_config() with the CHANNEL_CHANGE flag.
>
> IOW, nothing in mac80211 would ever call hw_config() for the channel or
> channel type change, it would all do channel contexts, but the channel
> context code would see that if the driver doesn't support channel
> contexts
>   1) there will be at most one context in mac80211
>   2) this context is programmed into the device by using hw_config()
>      instead of the context callbacks

Yes, this is more or less what I also had in mind. I was just thinking 
about solving the issue of channel context and hw.conf.channel 
consistency. If we switch a channel we either modify channel in channel 
context directly (violating the immutability of channel contexts) or we 
iterate and re-set the new channel on each interface (because 
single-channel drivers may still have multiple interfaces and we 
probably want to use sdata->vif.chanctx_conf->channel instead of 
hw.conf.channel inside mac80211).

Now that I think about it I guess violating the immutability for the 
single-channel case is okay. It would greatly simplify the code and we'd 
just put a comment down in hw_config where the only violation would occur.


-- 
Pozdrawiam / Best regards, Michal Kazior.


  reply	other threads:[~2012-06-28  6:04 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26 12:37 [RFC v3] initial channel context implementation Michal Kazior
2012-06-26 12:37 ` [RFC v3 1/7] mac80211: introduce channel context skeleton code Michal Kazior
2012-06-26 12:37 ` [RFC v3 2/7] mac80211: introduce new ieee80211_ops Michal Kazior
2012-06-26 12:37 ` [RFC v3 3/7] mac80211: add drv_* wrappers for channel contexts Michal Kazior
2012-06-26 12:37 ` [RFC v3 4/7] mac80211: add chanctx tracing Michal Kazior
2012-06-26 12:37 ` [RFC v3 5/7] mac80211: use channel context notifications Michal Kazior
2012-06-26 13:35   ` Johannes Berg
2012-06-26 14:01     ` Michal Kazior
2012-06-26 15:34       ` Johannes Berg
2012-06-26 12:37 ` [RFC v3 6/7] mac80211: refactor set_channel_type Michal Kazior
2012-06-26 14:04   ` Eliad Peller
2012-06-26 12:37 ` [RFC v3 7/7] mac80211: reuse channels for channel contexts Michal Kazior
2012-06-26 13:41   ` Johannes Berg
2012-06-26 13:55     ` Michal Kazior
2012-06-26 15:34       ` Johannes Berg
2012-06-26 13:43 ` [RFC v3] initial channel context implementation Johannes Berg
2012-06-27  7:30   ` Michal Kazior
2012-06-27  8:10     ` Johannes Berg
2012-06-27 10:13       ` Michal Kazior
2012-06-27 11:10         ` Johannes Berg
2012-06-27 12:43           ` Michal Kazior
2012-06-27 14:02             ` Johannes Berg
2012-06-28  6:04               ` Michal Kazior [this message]
2012-06-28  7:31                 ` Johannes Berg
2012-06-28  7:54                   ` Michal Kazior
2012-06-28  8:13                     ` Johannes Berg
2012-06-28  9:20                       ` Michal Kazior
2012-06-28  9:27                         ` Johannes Berg
2012-06-28  9:47                           ` Michal Kazior
2012-06-28  7:01               ` Michal Kazior
2012-06-28  8:15                 ` Johannes Berg
2012-06-28  8:54                   ` Michal Kazior
2012-06-28  9:27                     ` Johannes Berg
2012-07-25 10:22 ` 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=4FEBF3D4.3030705@tieto.com \
    --to=michal.kazior@tieto.com \
    --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 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).