22 Mar, 2014

1 commit


20 Mar, 2014

5 commits

  • John W. Linville
     
  • Macro ASSERT_RDEV_LOCK(rdev) is equal to ASSERT_RTNL(), so replace it
    with ASSERT_RTNL() and remove it.

    Signed-off-by: Zhao, Gang
    Signed-off-by: Johannes Berg

    Zhao, Gang
     
  • RCU pointer bss->pub.beacon_ies is checked before in previous
    statement:

    if (rcu_access_pointer(bss->pub.beacon_ies))
    continue;

    There is no need to check it twice(and in the wrong way :) ).

    Signed-off-by: Zhao, Gang
    Signed-off-by: Johannes Berg

    Zhao, Gang
     
  • On 2.4Ghz band, the channels overlap since the delta
    between different channels is 5Mhz while the width of the
    receiver is 20Mhz (at least).

    This means that we can hear beacons or probe responses from
    adjacent channels. These frames will have a significant
    lower RSSI which will feed all kinds of logic with inaccurate
    data. An obvious example is the roaming algorithm that will
    think our AP is getting weak and will try to move to another
    AP.

    In order to avoid this, update the signal only if the frame
    has been heard on the same channel as the one advertised by
    the AP in its DS / HT IEs.
    We refrain from updating the values only if the AP is
    already in the BSS list so that we will still have a valid
    (but inaccurate) value if the AP was heard on an adjacent
    channel only.

    To achieve this, stop taking the channel from DS / HT IEs
    in mac80211. The DS / HT IEs is taken into account to
    discard the frame if it was received on a disabled channel.
    This can happen due to the same phenomenon: the frame is
    sent on channel 12, but heard on channel 11 while channel
    12 can be disabled on certain devices. Since this check
    is done in cfg80211, stop even checking this in mac80211.

    Signed-off-by: Emmanuel Grumbach
    [remove unused rx_freq variable]
    Signed-off-by: Johannes Berg

    Emmanuel Grumbach
     
  • Function __cfg80211_join_ibss() is only used in net/wireless/ibss.c,
    so make it static.

    Signed-off-by: Zhao, Gang
    Signed-off-by: Johannes Berg

    Zhao, Gang
     

15 Mar, 2014

1 commit


14 Mar, 2014

1 commit


06 Mar, 2014

1 commit

  • Conflicts:
    drivers/net/wireless/ath/ath9k/recv.c
    drivers/net/wireless/mwifiex/pcie.c
    net/ipv6/sit.c

    The SIT driver conflict consists of a bug fix being done by hand
    in 'net' (missing u64_stats_init()) whilst in 'net-next' a helper
    was created (netdev_alloc_pcpu_stats()) which takes care of this.

    The two wireless conflicts were overlapping changes.

    Signed-off-by: David S. Miller

    David S. Miller
     

05 Mar, 2014

2 commits


03 Mar, 2014

2 commits

  • In certain situations we want to trigger reprocessing
    of the last regulatory hint. One situation in which
    this makes sense is the case where the cfg80211 was
    built-in to the kernel, CFG80211_INTERNAL_REGDB was not
    enabled and the CRDA binary is on a partition not availble
    during early boot. In such a case we want to be able to
    re-process the same request at some other point.

    When we are asked to re-process the same request we need
    to be careful to not kfree it, addresses that.

    Reported-by: Sander Eikelenboom
    Signed-off-by: Luis R. Rodriguez
    [rename function]
    Signed-off-by: Johannes Berg

    Luis R. Rodriguez
     
  • In case of AP mode, the beacon interval is already reset to
    zero inside cfg80211_stop_ap(), and in the other modes it
    isn't relevant. Remove the assignment to remove a potential
    race since the assignment isn't properly locked.

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

    Johannes Berg
     

26 Feb, 2014

3 commits

  • Commit "nl80211: send event when AP operation is stopped" added an
    event to notify user space that an AP interface has been stopped, to
    handle cases such as suspend etc. The event is sent regardless
    if the stop AP flow was triggered by user space or due to internal state
    change.

    This might cause issues with wpa_supplicant/hostapd flows that consider
    stop AP flow as a synchronous one, e.g., AP/GO channel change in the
    absence of CSA support. In such cases, the flow will restart the AP
    immediately after the stop AP flow is done, and only handle the stop
    AP event after the current flow is done, and as a result stop the AP
    again.

    Change the current implementation to only send the event in case the
    stop AP was triggered due to an internal reason.

    Signed-off-by: Ilan Peer
    Signed-off-by: Johannes Berg

    Ilan Peer
     
  • Send Channel Availability Check time as a parameter
    of start_radar_detection() callback.
    Get CAC time from regulatory database.

    Signed-off-by: Janusz Dziedzic
    Signed-off-by: Johannes Berg

    Janusz Dziedzic
     
  • Introduce DFS CAC time as a regd param, configured per REG_RULE and
    set per channel in cfg80211. DFS CAC time is close connected with
    regulatory database configuration. Instead of using hardcoded values,
    get DFS CAC time form regulatory database. Pass DFS CAC time to user
    mode (mainly for iw reg get, iw list, iw info). Allow setting DFS CAC
    time via CRDA. Add support for internal regulatory database.

    Signed-off-by: Janusz Dziedzic
    [rewrap commit log]
    Signed-off-by: Johannes Berg

    Janusz Dziedzic
     

25 Feb, 2014

3 commits


21 Feb, 2014

4 commits


20 Feb, 2014

2 commits


19 Feb, 2014

1 commit


14 Feb, 2014

2 commits


12 Feb, 2014

2 commits


06 Feb, 2014

4 commits

  • Due to the previous commit, when a scan finishes, it is in theory
    possible to hit the following sequence:
    1. interface starts being removed
    2. scan is cancelled by driver and cfg80211 is notified
    3. scan done work is scheduled
    4. interface is removed completely, rdev->scan_req is freed,
    event sent to userspace but scan done work remains pending
    5. new scan is requested on another virtual interface
    6. scan done work runs, freeing the still-running scan

    To fix this situation, hang on to the scan done message and block
    new scans while that is the case, and only send the message from
    the work function, regardless of whether the scan_req is already
    freed from interface removal. This makes step 5 above impossible
    and changes step 6 to be
    5. scan done work runs, sending the scan done message

    As this can't work for wext, so we send the message immediately,
    but this shouldn't be an issue since we still return -EBUSY.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • When an interface/wdev is removed, any ongoing scan should be
    cancelled by the driver. This will make it call cfg80211, which
    only queues a work struct. If interface/wdev removal is quick
    enough, this can leave the scan request pending and processed
    only after the interface is gone, causing a use-after-free.

    Fix this by making sure the scan request is not pending after
    the interface is destroyed. We can't flush or cancel the work
    item due to locking concerns, but when it'll run it shouldn't
    find anything to do. This leaves a potential issue, if a new
    scan gets requested before the work runs, it prematurely stops
    the running scan, potentially causing another crash. I'll fix
    that in the next patch.

    This was particularly observed with P2P_DEVICE wdevs, likely
    because freeing them is quicker than freeing netdevs.

    Reported-by: Andrei Otcheretianski
    Fixes: 4a58e7c38443 ("cfg80211: don't "leak" uncompleted scans")
    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • Unfortunately I forgot this during the merge window, but the
    patch seems small enough to go in as a fix. The userspace API
    bug that was the reason for disabling it has long been fixed.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • When the netlink skb is exhausted split_start is left set. In the
    subsequent retry, with a larger buffer, the dump is continued from the
    failing point instead of from the beginning.

    This was causing my rt28xx based USB dongle to now show up when
    running "iw list" with an old iw version without split dump support.

    Cc: stable@vger.kernel.org
    Fixes: 3713b4e364ef ("nl80211: allow splitting wiphy information in dumps")
    Signed-off-by: Pontus Fuchs
    [avoid the entire workaround when state->split is set]
    Signed-off-by: Johannes Berg

    Pontus Fuchs
     

05 Feb, 2014

6 commits

  • In case we will get regulatory request with rule
    where max_bandwidth_khz is set to 0 handle this
    case as a special one.

    If max_bandwidth_khz == 0 we should calculate maximum
    available bandwidth base on all frequency contiguous rules.
    In case we need auto calculation we just have to set:

    country PL: DFS-ETSI
    (2402 - 2482 @ 40), (N/A, 20)
    (5170 - 5250 @ AUTO), (N/A, 20)
    (5250 - 5330 @ AUTO), (N/A, 20), DFS
    (5490 - 5710 @ 80), (N/A, 27), DFS

    This mean we will calculate maximum bw for rules where
    AUTO (N/A) were set, 160MHz (5330 - 5170) in example above.
    So we will get:
    (5170 - 5250 @ 160), (N/A, 20)
    (5250 - 5330 @ 160), (N/A, 20), DFS

    In other case:
    country FR: DFS-ETSI
    (2402 - 2482 @ 40), (N/A, 20)
    (5170 - 5250 @ AUTO), (N/A, 20)
    (5250 - 5330 @ 80), (N/A, 20), DFS
    (5490 - 5710 @ 80), (N/A, 27), DFS

    We will get 80MHz (5250 - 5170):
    (5170 - 5250 @ 80), (N/A, 20)
    (5250 - 5330 @ 80), (N/A, 20), DFS

    Base on this calculations we will set correct channel
    bandwidth flags (eg. IEEE80211_CHAN_NO_80MHZ).

    We don't need any changes in CRDA or internal regulatory.

    Signed-off-by: Janusz Dziedzic
    [extend nl80211 description a bit, fix typo]
    Signed-off-by: Johannes Berg

    Janusz Dziedzic
     
  • It was possible to break interface combinations in
    the following way:

    combo 1: iftype = AP, num_ifaces = 2, num_chans = 2,
    combo 2: iftype = AP, num_ifaces = 1, num_chans = 1, radar = HT20

    With the above interface combinations it was
    possible to:

    step 1. start AP on DFS channel by matching combo 2
    step 2. start AP on non-DFS channel by matching combo 1

    This was possible beacuse (step 2) did not consider
    if other interfaces require radar detection.

    The patch changes how cfg80211 tracks channels -
    instead of channel itself now a complete chandef
    is stored.

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

    Michal Kazior
     
  • When receiving an IBSS_JOINED event select the BSS object
    based on the {bssid, channel} couple rather than the bssid
    only.
    With the current approach if another cell having the same
    BSSID (but using a different channel) exists then cfg80211
    picks up the wrong BSS object.
    The result is a mismatching channel configuration between
    cfg80211 and the driver, that can lead to any sort of
    problem.

    The issue can be triggered by having an IBSS sitting on
    given channel and then asking the driver to create a new
    cell using the same BSSID but with a different frequency.
    By passing the channel to cfg80211_get_bss() we can solve
    this ambiguity and retrieve/create the correct BSS object.
    All the users of cfg80211_ibss_joined() have been changed
    accordingly.

    Moreover WARN when cfg80211_ibss_joined() gets a NULL
    channel as argument and remove a bogus call of the same
    function in ath6kl (it does not make sense to call
    cfg80211_ibss_joined() with a zero BSSID on ibss-leave).

    Cc: Kalle Valo
    Cc: Arend van Spriel
    Cc: Bing Zhao
    Cc: Jussi Kivilinna
    Cc: libertas-dev@lists.infradead.org
    Acked-by: Kalle Valo
    Signed-off-by: Antonio Quartulli
    [minor code cleanup in ath6kl]
    Signed-off-by: Johannes Berg

    Antonio Quartulli
     
  • For better use of CPU idle time, allow the scheduler to select the CPU
    on which the timeout work of regulatory settings would be executed.
    This extends CPU idle residency time and saves power.

    This functionality is enabled when CONFIG_WQ_POWER_EFFICIENT is selected.

    Cc: "John W. Linville"
    Cc: "David S. Miller"
    Signed-off-by: Shaibal Dutta
    [zoran.markovic@linaro.org: Rebased to latest kernel. Added commit message.]
    Signed-off-by: Zoran Markovic
    Signed-off-by: Johannes Berg

    Shaibal Dutta
     
  • Add helper function that will return regdomain.
    Follow the driver's regulatory domain, if present,
    unless a country IE has been processed or a user
    wants to help compliance further.

    Signed-off-by: Janusz Dziedzic
    [remove useless reg variable]
    Signed-off-by: Johannes Berg

    Janusz Dziedzic
     
  • Set preset_chandef in channel switch notification.
    In other case we will have old preset_chandef.

    Signed-off-by: Janusz Dziedzic
    Signed-off-by: Johannes Berg

    Janusz Dziedzic