22 Apr, 2013

1 commit


11 Apr, 2013

2 commits


26 Mar, 2013

1 commit


25 Mar, 2013

1 commit

  • Corey Richardson reported that my idle handling cleanup
    (commit fd0f979a1b, "mac80211: simplify idle handling")
    broke ath9k_htc. The reason appears to be that it wants
    to go out of idle before switching channels. To fix it,
    reimplement that sequence.

    Reported-by: Corey Richardson
    Signed-off-by: Johannes Berg

    Johannes Berg
     

15 Feb, 2013

4 commits

  • For HT and VHT the current bandwidth can change,
    add the function ieee80211_vif_change_bandwidth()
    to take care of this. It returns a failure if the
    new bandwidth isn't compatible with the existing
    channel context, the caller has to handle that.
    When it happens, also inform the driver that the
    bandwidth changed for this virtual interface (no
    drivers would actually care today though.)

    Changing to/from HT/VHT isn't allowed though.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • This should be called ieee80211_change_chanctx() since
    it changes the channel context, not a chandef.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Since the idle decision rework, mac80211 started calling
    bss_info_changed() for the driver's monitor interface,
    which causes a crash for iwlwifi, but drivers generally
    don't expect this to happen. Therefore, avoid it.

    While at it, also prevent calling it in such cases and
    only print a warning. For the P2P Device interface the
    idle will no longer be called (no channel context), so
    also prevent that and warn on it.

    Reported-by: Chaitanya
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Add command to trigger radar detection in the driver/FW.
    Once radar detection is started it should continuously
    monitor for radars as long as the channel active.
    If radar is detected usermode notified with 'radar
    detected' event.

    Scanning and remain on channel functionality must be disabled
    while doing radar detection/scanning, and vice versa.

    Based on original patch by Victor Goldenshtein

    Signed-off-by: Simon Wunderlich
    Signed-off-by: Johannes Berg

    Simon Wunderlich
     

12 Feb, 2013

2 commits

  • Now that we have channel contexts, idle is (pretty
    much) equivalent to not having a channel context.
    Change the code to use this relation so that there
    no longer is a need for a lot of idle recalculate
    calls everywhere.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Currently the code assigns channel contexts to VLANs
    (for use by the TX/RX code) when the AP master gets
    its channel context assigned. This works fine, but
    in the upcoming radar detection work the VLANs don't
    require a channel context (during radar detection)
    and assigning one to them anyway causes issues with
    locking and also inconsistencies -- a VLAN interface
    that is added before radar detection would get the
    channel context, while one added during it wouldn't.

    Fix these issues moving the channel context copying
    to a new explicit operation that will not be used
    in the radar detection code.

    Acked-by: Simon Wunderlich
    Signed-off-by: Johannes Berg

    Johannes Berg
     

03 Jan, 2013

2 commits

  • During suspend/resume channel contexts might be
    iterated even if they haven't been re-added to
    the driver, keep track of this and skip them in
    iteration. Also use the new status for sanity
    checks.

    Also clarify the fact that during HW restart all
    contexts are iterated over (thanks Eliad.)

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Make AP_VLAN type interfaces track the AP master channel
    context so they have one assigned for the various lookups.
    Don't give them their own refcount etc. since they're just
    slaves to the AP master.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

26 Nov, 2012

1 commit

  • Convert mac80211 (and where necessary, some drivers a
    little bit) to the new channel definition struct.

    This will allow extending mac80211 for VHT, which is
    currently restricted to channel contexts since there
    are no drivers using that which makes it easier. As
    I also don't care about VHT for drivers not using the
    channel context API, I won't convert the previous API
    to VHT support.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

30 Oct, 2012

1 commit

  • Even before channel contexts/multi-channel, having a
    single global TX power limit was already problematic,
    in particular if two managed interfaces connected to
    two APs with different power constraints. The channel
    context introduction completely broke this though and
    in fact I had disabled TX power configuration there
    for drivers using channel contexts.

    Change everything to track TX power per interface so
    that different user settings and different channel
    maxima are treated correctly. Also continue tracking
    the global TX power though for compatibility with
    applications that attempt to configure the wiphy's
    TX power globally.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

17 Oct, 2012

6 commits

  • Drivers may need to iterate the active channel
    contexts, export an iterator function to allow
    that. To make it possible, use RCU-safe list
    functions.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • On each channel that the device is operating on, it
    may need to listen using one or more chains depending
    on the SMPS settings of the interfaces using it. The
    previous channel context changes completely removed
    this ability (before, it was available as the SMPS
    mode).

    Add per-context tracking of the required static and
    dynamic RX chains and notify the driver on changes.
    To achieve this, track the chains and SMPS mode used
    on each virtual interface and update the channel
    context whenever this changes.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Instead of operating on a single channel only,
    use the new channel context infrastructure in
    all mac80211 code.

    This enables drivers that want to use the new
    channel context infrastructure to use multiple
    channels, while nothing should change for all
    the other drivers that don't support it.

    Right now this disables both TX power settings
    and spatial multiplexing powersave. Both need
    to be re-enabled on a channel context basis.

    Additionally, when channel contexts are used
    drop the connection when channel switch is
    received rather than trying to handle it. This
    will have to be improved later.

    [With fixes from Eliad and Emmanuel incorporated]
    Signed-off-by: Eliad Peller
    Signed-off-by: Emmanuel Grumbach
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Reuse channels with compatible channel types. Some
    channel types are compatible and can be used
    concurrently.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     
  • Channel context pointer will be accessible on
    both assign and unassign events.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     
  • Channel context are the foundation for multi-channel
    operation. They are are immutable and are re-created
    (or re-used if other interfaces are bound to a certain
    channel and a compatible channel type) on channel
    switching.

    This is an initial implementation and more features
    will come in separate patches.

    Signed-off-by: Michal Kazior
    [some changes including RCU protection]
    Signed-off-by: Johannes Berg

    Michal Kazior
     

06 Sep, 2012

1 commit


06 Jun, 2012

1 commit


11 Apr, 2012

1 commit

  • The channel type argument to the rate_update()
    callback isn't really the correct way to give
    the rate control algorithm about the desired
    RX bandwidth of the peer.

    Remove this argument, and instead update the
    STA capabilities with 20/40 appropriately. The
    SMPS update done by this callback works in the
    same way, so this makes the callback cleaner.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

14 Mar, 2012

1 commit

  • When regulatory information changes our HT behavior (e.g,
    when we get a country code from the AP we have just associated
    with), we should use this information to change the power with
    which we transmit, and what channels we transmit. Sometimes
    the channel parameters we derive from regulatory information
    contradicts the parameters we used in association. For example,
    we could have associated specifying HT40, but the regulatory
    rules we apply may forbid HT40 operation.

    In the situation above, we should reconfigure ourselves to
    transmit in HT20 only, however it makes no sense for us to
    disable receive in HT40, since if we associated with these
    parameters, the AP has every reason to expect we can and
    will receive packets this way. The code in mac80211 does
    not have the capability of sending the appropriate action
    frames to signal a change in HT behaviour so the AP has
    no clue we can no longer receive frames encoded this way.
    In some broken AP implementations, this can leave us
    effectively deaf if the AP never retries in lower HT rates.

    This change breaks up the channel_type parameter in the
    ieee80211_enable_ht function into a separate receive and
    transmit part. It honors the channel flags set by regulatory
    in order to configure the rate control algorithm, but uses
    the capability flags to configure the channel on the radio,
    since these were used in association to set the AP's transmit
    rate.

    Signed-off-by: Paul Stewart
    Cc: Sam Leffler
    Cc: Johannes Berg
    Reviewed-by: Luis R Rodriguez
    Signed-off-by: John W. Linville

    Paul Stewart
     

25 Jan, 2012

1 commit


15 Mar, 2011

1 commit

  • When running an AP interface along with the cooked monitor interface created
    by hostapd, adding an interface and deleting it again triggers a channel type
    recalculation during which the (non-HT) monitor interface takes precedence
    over the HT AP interface, thus causing the channel type to be set to non-HT.
    Fix this by ensuring that a more wide channel type will not be overwritten
    by a less wide channel type.

    Signed-off-by: Felix Fietkau
    Signed-off-by: John W. Linville

    Felix Fietkau
     

17 Sep, 2010

1 commit

  • Instead of using a WARN_ON(!mutex_is_locked())
    use lockdep_assert_held() which compiles away
    completely when lockdep isn't enabled, and
    also is a more accurate assertion since it
    checks that the current thread is holding the
    mutex.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

29 May, 2010

1 commit


08 May, 2010

2 commits

  • Currently, when one interface switches HT mode,
    all others will follow along. This is clearly
    undesirable, since the new one might switch to
    no-HT while another one is operating in HT.

    Address this issue by keeping track of the HT
    mode per interface, and allowing only changes
    that are compatible, i.e. switching into HT40+
    is not possible when another interface is in
    HT40-, in that case the second one needs to
    fall back to HT20.

    Also, to allow drivers to know what's going on,
    store the per-interface HT mode (channel type)
    in the virtual interface's bss_conf.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • Currently (all tested with hwsim) you can do stupid
    things like setting up an AP on a certain channel,
    then adding another virtual interface and making
    that associate on another channel -- this will make
    the beaconing to move channel but obviously without
    the necessary IEs data update.

    In order to improve this situation, first make the
    configuration APIs (cfg80211 and nl80211) aware of
    multi-channel operation -- we'll eventually need
    that in the future anyway. There's one userland API
    change and one API addition. The API change is that
    now SET_WIPHY must be called with virtual interface
    index rather than only wiphy index in order to take
    effect for that interface -- luckily all current
    users (hostapd) do that. For monitor interfaces, the
    old setting is preserved, but monitors are always
    slaved to other devices anyway so no guarantees.

    The second userland API change is the introduction
    of a per virtual interface SET_CHANNEL command, that
    hostapd should use going forward to make it easier
    to understand what's going on (it can automatically
    detect a kernel with this command).

    Other than mac80211, no existing cfg80211 drivers
    are affected by this change because they only allow
    a single virtual interface.

    mac80211, however, now needs to be aware that the
    channel settings are per interface now, and needs
    to disallow (for now) real multi-channel operation,
    which is another important part of this patch.

    One of the immediate benefits is that you can now
    start hostapd to operate on a hardware that already
    has a connection on another virtual interface, as
    long as you specify the same channel.

    Note that two things are left unhandled (this is an
    improvement -- not a complete fix):

    * different HT/no-HT modes

    currently you could start an HT AP and then
    connect to a non-HT network on the same channel
    which would configure the hardware for no HT;
    that can be fixed fairly easily

    * CSA

    An AP we're connected to on a virtual interface
    might indicate switching channels, and in that
    case we would follow it, regardless of how many
    other interfaces are operating; this requires
    more effort to fix but is pretty rare after all

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg