1. 12 Feb, 2014 1 commit
  2. 06 Feb, 2014 2 commits
    • Johannes Berg's avatar
      cfg80211: send scan results from work queue · f9d15d16
      Johannes Berg authored
      
      
      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: default avatarJohannes Berg <johannes.berg@intel.com>
      f9d15d16
    • Pontus Fuchs's avatar
      nl80211: Reset split_start when netlink skb is exhausted · f12cb289
      Pontus Fuchs authored
      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: 3713b4e3
      
       ("nl80211: allow splitting wiphy information in dumps")
      Signed-off-by: default avatarPontus Fuchs <pontus.fuchs@gmail.com>
      [avoid the entire workaround when state->split is set]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      f12cb289
  3. 05 Feb, 2014 1 commit
    • Janusz Dziedzic's avatar
      cfg80211: regulatory introduce maximum bandwidth calculation · 97524820
      Janusz Dziedzic authored
      
      
      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: default avatarJanusz Dziedzic <janusz.dziedzic@tieto.com>
      [extend nl80211 description a bit, fix typo]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      97524820
  4. 04 Feb, 2014 11 commits
    • Michal Kazior's avatar
      cfg80211: consider existing DFS interfaces · 9e0e2961
      Michal Kazior authored
      
      
      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: default avatarMichal Kazior <michal.kazior@tieto.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      9e0e2961
    • Janusz Dziedzic's avatar
      cfg80211: set preset_chandef after channel switch · 96f55f12
      Janusz Dziedzic authored
      
      
      Set preset_chandef in channel switch notification.
      In other case we will have old preset_chandef.
      Signed-off-by: default avatarJanusz Dziedzic <janusz.dziedzic@tieto.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      96f55f12
    • Johannes Berg's avatar
      nl80211: fix scheduled scan RSSI matchset attribute confusion · ea73cbce
      Johannes Berg authored
      
      
      The scheduled scan matchsets were intended to be a list of filters,
      with the found BSS having to pass at least one of them to be passed
      to the host. When the RSSI attribute was added, however, this was
      broken and currently wpa_supplicant adds that attribute in its own
      matchset; however, it doesn't intend that to mean that anything
      that passes the RSSI filter should be passed to the host, instead
      it wants it to mean that everything needs to also have higher RSSI.
      
      This is semantically problematic because we have a list of filters
      like [ SSID1, SSID2, SSID3, RSSI ] with no real indication which
      one should be OR'ed and which one AND'ed.
      
      To fix this, move the RSSI filter attribute into each matchset. As
      we need to stay backward compatible, treat a matchset with only the
      RSSI attribute as a "default RSSI filter" for all other matchsets,
      but only if there are other matchsets (an RSSI-only matchset by
      itself is still desirable.)
      
      To make driver implementation easier, keep a global min_rssi_thold
      for the entire request as well. The only affected driver is ath6kl.
      
      I found this when I looked into the code after Raja Mani submitted
      a patch fixing the n_match_sets calculation to disregard the RSSI,
      but that patch didn't address the semantic issue.
      Reported-by: default avatarRaja Mani <rmani@qti.qualcomm.com>
      Acked-by: default avatarLuciano Coelho <luciano.coelho@intel.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      ea73cbce
    • Johannes Berg's avatar
      nl80211: send event when AP operation is stopped · 348baf0e
      Johannes Berg authored
      
      
      There are a few cases, e.g. suspend, where an AP interface is
      stopped by the kernel rather than by userspace request, most
      commonly when suspending. To let userspace know about this,
      send the NL80211_CMD_STOP_AP command as an event every time
      an AP interface is stopped. This also happens when userspace
      did in fact request the AP stop, but that's not a problem.
      
      For full-MAC drivers this may need to be extended to also
      cover cases where the device stopped the AP operation for
      some reason, this a bit more complicated because then all
      cfg80211 state also needs to be reset; such API is not part
      of this patch.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      348baf0e
    • Johannes Berg's avatar
      nl80211: check nla_parse() return values · ae811e21
      Johannes Berg authored
      
      
      If there's a policy, then nla_parse() return values must be
      checked, otherwise the policy is useless and there's nothing
      that ensures the attributes are actually what we expect them
      to be.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      ae811e21
    • Johannes Berg's avatar
      nl80211: make netlink attribute policies const · 94e860f1
      Johannes Berg authored
      
      
      There's no reason for netlink attribute policies to be
      __read_mostly, they can just be const.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      94e860f1
    • Johannes Berg's avatar
      nl80211: check channel switch validity better · 1ff79dfa
      Johannes Berg authored
      
      
      Before allowing userspace to initiate a channel switch, check
      that it's actually connected in some sense. Also use a more
      appropriate error code for the not connected case.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      1ff79dfa
    • Janusz Dziedzic's avatar
      nl80211: add Guard Interval support for set_bitrate_mask · 0b9323f6
      Janusz Dziedzic authored
      
      
      Allow to force SGI, LGI.
      Mainly for test purpose.
      Signed-off-by: default avatarJanusz Dziedzic <janusz.dziedzic@tieto.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      0b9323f6
    • Jouni Malinen's avatar
      cfg80211: Clean up connect params and channel fetching · 664834de
      Jouni Malinen authored
      
      
      Addition of the frequency hints showed up couple of places in cfg80211
      where pointers could be marked const and a shared function could be used
      to fetch a valid channel.
      Signed-off-by: default avatarJouni Malinen <j@w1.fi>
      [fix mwifiex]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      664834de
    • Jouni Malinen's avatar
      cfg80211: Advertise maximum associated STAs in AP mode · b43504cf
      Jouni Malinen authored
      
      
      This allows drivers to advertise the maximum number of associated
      stations they support in AP mode (including P2P GO). User space
      applications can use this for cleaner way of handling the limit (e.g.,
      hostapd rejecting IEEE 802.11 authentication without manual
      configuration of the limit) or to figure out what type of use cases can
      be executed with multiple devices before trying and failing.
      Signed-off-by: default avatarJouni Malinen <j@w1.fi>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      b43504cf
    • Jouni Malinen's avatar
      cfg80211: Allow BSS hint to be provided for connect · 1df4a510
      Jouni Malinen authored
      
      
      This clarifies the expected driver behavior on the older
      NL80211_ATTR_MAC and NL80211_ATTR_WIPHY_FREQ attributes and adds a new
      set of similar attributes with _HINT postfix to enable use of a
      recommendation of the initial BSS to choose. This can be helpful for
      some drivers that can avoid an additional full scan on connection
      request if the information is provided to them (user space tools like
      wpa_supplicant already has that information available based on earlier
      scans).
      
      In addition, this can be used to get more expected behavior for cases
      where a specific BSS should be picked first based on operations like
      Interworking network selection or WPS. These cases were already easily
      addressed with drivers that leave BSS selection to user space, but there
      was no convenient way to do this with drivers that take care of BSS
      selection internally without using the NL80211_ATTR_MAC which is not
      really desired since it is needed for other purposes to force the
      association to remain with the same BSS.
      Signed-off-by: default avatarJouni Malinen <j@w1.fi>
      [add const, fix policy]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      1df4a510
  5. 15 Jan, 2014 1 commit
  6. 09 Jan, 2014 1 commit
  7. 06 Jan, 2014 1 commit
  8. 19 Dec, 2013 2 commits
    • Kyeyoon Park's avatar
      cfg80211: Add support for QoS mapping · fa9ffc74
      Kyeyoon Park authored
      
      
      This allows QoS mapping from external networks to be implemented as
      defined in IEEE Std 802.11-2012, 10.24.9. APs can use this to advertise
      DSCP ranges and exceptions for mapping frames to a specific UP over
      Wi-Fi.
      
      The payload of the QoS Map Set element (IEEE Std 802.11-2012, 8.4.2.97)
      is sent to the driver through the new NL80211_ATTR_QOS_MAP attribute to
      configure the local behavior either on the AP (based on local
      configuration) or on a station (based on information received from the
      AP).
      Signed-off-by: default avatarKyeyoon Park <kyeyoonp@qca.qualcomm.com>
      Signed-off-by: default avatarJouni Malinen <jouni@qca.qualcomm.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      fa9ffc74
    • Johannes Berg's avatar
      nl80211: support vendor-specific events · 567ffc35
      Johannes Berg authored
      
      
      In addition to vendor-specific commands, also support vendor-specific
      events. These must be registered with cfg80211 before they can be used.
      They're also advertised in nl80211 in the wiphy information so that
      userspace knows can be expected. The events themselves are sent on a
      new multicast group called "vendor".
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      567ffc35
  9. 16 Dec, 2013 1 commit
  10. 05 Dec, 2013 2 commits
  11. 03 Dec, 2013 4 commits
  12. 02 Dec, 2013 4 commits
  13. 25 Nov, 2013 9 commits