1. 20 2月, 2018 1 次提交
    • K
      net: Convert cfg80211_pernet_ops · 9c537ca1
      Kirill Tkhai 提交于
      This patch finishes converting pernet_operations
      registered in net/wireless directory.
      
      These pernet_operations have only exit method,
      which moves devices to init_net. This action
      is not pernet_operations-specific, and function
      cfg80211_switch_netns() may be called all time
      during the system life. All necessary protection
      against concurrent cfg80211_pernet_exit() is made
      by rtnl_lock(). So, cfg80211_pernet_ops is able
      to be marked as async.
      Signed-off-by: NKirill Tkhai <ktkhai@virtuozzo.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9c537ca1
  2. 15 1月, 2018 1 次提交
    • J
      cfg80211: check dev_set_name() return value · 59b179b4
      Johannes Berg 提交于
      syzbot reported a warning from rfkill_alloc(), and after a while
      I think that the reason is that it was doing fault injection and
      the dev_set_name() failed, leaving the name NULL, and we didn't
      check the return value and got to rfkill_alloc() with a NULL name.
      Since we really don't want a NULL name, we ought to check the
      return value.
      
      Fixes: fb28ad35 ("net: struct device - replace bus_id with dev_name(), dev_set_name()")
      Reported-by: syzbot+1ddfb3357e1d7bb5b5d3@syzkaller.appspotmail.com
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      59b179b4
  3. 11 10月, 2017 1 次提交
    • J
      cfg80211: support loading regulatory database as firmware file · 007f6c5e
      Johannes Berg 提交于
      As the current regulatory database is only about 4k big, and already
      difficult to extend, we decided that overall it would be better to
      get rid of the complications with CRDA and load the database into the
      kernel directly, but in a new format that is extensible.
      
      The new file format can be extended since it carries a length field
      on all the structs that need to be extensible.
      
      In order to be able to request firmware when the module initializes,
      move cfg80211 from subsys_initcall() to the later fs_initcall(); the
      firmware loader is at the same level but linked earlier, so it can
      be called from there. Otherwise, when both the firmware loader and
      cfg80211 are built-in, the request will crash the kernel. We also
      need to be before device_initcall() so that cfg80211 is available
      for devices when they initialize.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      007f6c5e
  4. 13 6月, 2017 1 次提交
  5. 28 4月, 2017 1 次提交
  6. 27 4月, 2017 2 次提交
  7. 17 3月, 2017 1 次提交
  8. 06 3月, 2017 3 次提交
    • V
      cfg80211: Share Channel DFS state across wiphys of same DFS domain · 89766727
      Vasanthakumar Thiagarajan 提交于
      Sharing DFS channel state across multiple wiphys (radios) could
      be useful with multiple radios on the system. When one radio
      completes CAC and markes the channel available another radio
      can use this information and start beaconing without really doing
      CAC.
      
      Whenever there is a state change in dfs channel associated to
      a particular wiphy the the same state change is propagated to
      other wiphys having the same DFS reg domain configuration.
      Also when a new wiphy is created the dfs channel state of
      other existing wiphys of same DFS domain is copied.
      Signed-off-by: NVasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      89766727
    • J
      cfg80211: combine two nested ifs into a single condition · d4f29978
      Johannes Berg 提交于
      Combine two instances of having two nested if statements
      into a single one with a combined condition to reduce the
      indentation.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      d4f29978
    • A
      cfg80211: Accept multiple RSSI thresholds for CQM · 4a4b8169
      Andrew Zaborowski 提交于
      Change the SET CQM command's RSSI threshold attribute to accept any
      number of thresholds as a sorted array.  The API should be backwards
      compatible so that if one s32 threshold value is passed, the old
      mechanism is enabled.  The netlink event generated is the same in both
      cases.
      
      cfg80211 handles an arbitrary number of RSSI thresholds but drivers have
      to provide a method (set_cqm_rssi_range_config) that configures a range
      set by a high and a low value.  Drivers have to call back when the RSSI
      goes out of that range and there's no additional event for each time the
      range is reconfigured as there was with the current one-threshold API.
      
      This method doesn't have a hysteresis parameter because there's no
      benefit to the cfg80211 code from having the hysteresis be handled by
      hardware/driver in terms of the number of wakeups.  At the same time
      it would likely be less consistent between drivers if offloaded or
      done in the drivers.
      Signed-off-by: NAndrew Zaborowski <andrew.zaborowski@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      4a4b8169
  9. 09 2月, 2017 1 次提交
    • L
      cfg80211: fix NAN bands definition · 8585989d
      Luca Coelho 提交于
      The nl80211_nan_dual_band_conf enumeration doesn't make much sense.
      The default value is assigned to a bit, which makes it weird if the
      default bit and other bits are set at the same time.
      
      To improve this, get rid of NL80211_NAN_BAND_DEFAULT and add a wiphy
      configuration to let the drivers define which bands are supported.
      This is exposed to the userspace, which then can make a decision on
      which band(s) to use.  Additionally, rename all "dual_band" elements
      to "bands", to make things clearer.
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      8585989d
  10. 09 1月, 2017 1 次提交
  11. 27 10月, 2016 3 次提交
    • J
      cfg80211: disallow beacon_int_min_gcd with IBSS · 56271da2
      Johannes Berg 提交于
      This can't really be supported right now, because the IBSS
      interface may change its beacon interval at any time due to
      joining another network; thus, there's already "support"
      for different beacon intervals here, implicitly.
      
      Until we figure out how we should handle this case (continue
      to allow it to arbitrarily join? Join only if compatible?)
      disallow advertising that different beacon intervals are
      supported if IBSS is allowed.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      56271da2
    • A
      cfg80211: add generic helper to check interface is running · 73c7da3d
      Arend Van Spriel 提交于
      Add a helper using wdev to check if interface is running. This
      deals with both non-netdev and netdev interfaces. In struct
      wireless_dev replace 'p2p_started' and 'nan_started' by
      'is_running' as those are mutually exclusive anyway, and unify
      all the code to use wdev_running().
      Signed-off-by: NArend van Spriel <arend.vanspriel@broadcom.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      73c7da3d
    • J
      wireless: deprecate WDS and disable by default · 8f205423
      Johannes Berg 提交于
      The old WDS 4-addr frame support is very limited, e.g.
       * no encryption is possible on such links
       * it cannot support rate/HT/VHT negotiation
       * management APIs are very restricted
      
      These make the WDS legacy mode useless in practice.
      
      All of these are resolved by the 4-addr AP/client support,
      so there's also no reason to improve WDS in the future.
      
      Therefore, add a Kconfig option to disable legacy WDS.
      This gives people an "emergency valve" while they migrate
      to the better-supported 4-addr AP/client option; we plan
      to remove it (and the associated cfg80211/mac80211 code,
      which is the ultimate goal) in the future.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      8f205423
  12. 30 9月, 2016 2 次提交
  13. 12 9月, 2016 1 次提交
  14. 11 8月, 2016 2 次提交
    • D
      cfg80211: always notify userspace when wireless netdev is removed · 7f8ed01e
      Denis Kenzior 提交于
      This change alters the semantics of NL80211_CMD_DEL_INTERFACE events
      by always sending this event whenever a net_device object associated
      with a wdev is destroyed.  Prior to this change, this event was only
      emitted as a result of NL80211_CMD_DEL_INTERFACE command sent from
      userspace.  This allows userspace to reliably detect when wireless
      interfaces have been removed, e.g. due to USB removal events, etc.
      
      For wireless device objects without an associated net_device (e.g.
      NL80211_IFTYPE_P2P_DEVICE), the NL80211_CMD_DEL_INTERFACE event is
      now generated inside cfg80211_unregister_wdev.
      Signed-off-by: NDenis Kenzior <denkenz@gmail.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      7f8ed01e
    • D
      cfg80211: always notify userspace of new wireless netdevs · 896ff063
      Denis Kenzior 提交于
      This change alters the semantics of NL80211_CMD_NEW_INTERFACE events
      by always sending this event whenever a new net_device object
      associated with a wdev is registered.  Prior to this change, this event
      was only sent as a result of NL80211_CMD_NEW_INTERFACE command sent
      from userspace.  This allows userspace to reliably detect new wireless
      interfaces (e.g. due to hardware hot-plug events, etc).
      
      For wdevs created without an associated net_device object (e.g.
      NL80211_IFTYPE_P2P_DEVICE), the NL80211_CMD_NEW_INTERFACE event is
      still generated inside the relevant nl80211 command handler.
      Signed-off-by: NDenis Kenzior <denkenz@gmail.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      896ff063
  15. 06 7月, 2016 1 次提交
    • A
      nl80211: support beacon report scanning · 1d76250b
      Avraham Stern 提交于
      Beacon report radio measurement requires reporting observed BSSs
      on the channels specified in the beacon request. If the measurement
      mode is set to passive or active, it requires actually performing a
      scan (passive or active, accordingly), and reporting the time that
      the scan was started and the time each beacon/probe was received
      (both in terms of TSF of the BSS of the requesting AP). If the
      request mode is table, this information is optional.
      In addition, the radio measurement request specifies the channel
      dwell time for the measurement.
      
      In order to use scan for beacon report when the mode is active or
      passive, add a parameter to scan request that specifies the
      channel dwell time, and add scan start time and beacon received time
      to scan results information.
      
      Supporting beacon report is required for Multi Band Operation (MBO).
      Signed-off-by: NAssaf Krauss <assaf.krauss@intel.com>
      Signed-off-by: NDavid Spinadel <david.spinadel@intel.com>
      Signed-off-by: NAvraham Stern <avraham.stern@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      1d76250b
  16. 09 6月, 2016 1 次提交
  17. 31 5月, 2016 1 次提交
  18. 12 5月, 2016 1 次提交
  19. 12 4月, 2016 1 次提交
  20. 05 4月, 2016 1 次提交
  21. 24 2月, 2016 1 次提交
  22. 30 1月, 2016 1 次提交
    • J
      cfg80211/wext: fix message ordering · cb150b9d
      Johannes Berg 提交于
      Since cfg80211 frequently takes actions from its netdev notifier
      call, wireless extensions messages could still be ordered badly
      since the wext netdev notifier, since wext is built into the
      kernel, runs before the cfg80211 netdev notifier. For example,
      the following can happen:
      
      5: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default
          link/ether 02:00:00:00:01:00 brd ff:ff:ff:ff:ff:ff
      5: wlan1: <BROADCAST,MULTICAST,UP>
          link/ether
      
      when setting the interface down causes the wext message.
      
      To also fix this, export the wireless_nlevent_flush() function
      and also call it from the cfg80211 notifier.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      cb150b9d
  23. 15 10月, 2015 1 次提交
  24. 13 10月, 2015 1 次提交
    • A
      cfg80211: Add multiple scan plans for scheduled scan · 3b06d277
      Avraham Stern 提交于
      Add the option to configure multiple 'scan plans' for scheduled scan.
      Each 'scan plan' defines the number of scan cycles and the interval
      between scans. The scan plans are executed in the order they were
      configured. The last scan plan will always run infinitely and thus
      defines only the interval between scans.
      The maximum number of scan plans supported by the device and the
      maximum number of iterations in a single scan plan are advertised
      to userspace so it can configure the scan plans appropriately.
      
      When scheduled scan results are received there is no way to know which
      scan plan is being currently executed, so there is no way to know when
      the next scan iteration will start. This is not a problem, however.
      The scan start timestamp is only used for flushing old scan results,
      and there is no difference between flushing all results received until
      the end of the previous iteration or the start of the current one,
      since no results will be received in between.
      Signed-off-by: NAvraham Stern <avraham.stern@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      3b06d277
  25. 29 9月, 2015 1 次提交
  26. 17 7月, 2015 1 次提交
    • J
      cfg80211: allow mgmt_frame_register callback to sleep · 33d8783c
      Johannes Berg 提交于
      This callback is currently not allowed to sleep, which makes it more
      difficult to implement proper driver methods in mac80211 than it has
      to be. Instead of doing asynchronous work here in mac80211, make it
      possible for the callback to sleep by doing some asynchronous work
      in cfg80211. This also enables improvements to other drivers, like
      ath6kl, that would like to sleep in this callback.
      
      While at it, also fix the code to call the driver on the implicit
      unregistration when an interface is removed, and do that also when
      a P2P-Device wdev is destroyed (otherwise we leak the structs.)
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      33d8783c
  27. 24 2月, 2015 1 次提交
  28. 20 1月, 2015 1 次提交
  29. 18 12月, 2014 2 次提交
  30. 17 12月, 2014 1 次提交
    • J
      cfg80211: allow wiphy specific regdomain management · b0d7aa59
      Jonathan Doron 提交于
      Add a new regulatory flag that allows a driver to manage regdomain
      changes/updates for its own wiphy.
      A self-managed wiphys only employs regulatory information obtained from
      the FW and driver and does not use other cfg80211 sources like
      beacon-hints, country-code IEs and hints from other devices on the same
      system. Conversely, a self-managed wiphy does not share its regulatory
      hints with other devices in the system. If a system contains several
      devices, one or more of which are self-managed, there might be
      contradictory regulatory settings between them. Usage of flag is
      generally discouraged. Only use it if the FW/driver is incompatible
      with non-locally originated hints.
      
      A new API lets the driver send a complete regdomain, to be applied on
      its wiphy only.
      
      After a wiphy-specific regdomain change takes place, usermode will get
      a new type of change notification. The regulatory core also takes care
      enforce regulatory restrictions, in case some interfaces are on
      forbidden channels.
      Signed-off-by: NJonathan Doron <jonathanx.doron@intel.com>
      Signed-off-by: NArik Nemtsov <arikx.nemtsov@intel.com>
      Reviewed-by: NLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      b0d7aa59
  31. 12 12月, 2014 1 次提交
    • V
      wireless: Support of IFLA_INFO_KIND rtnl attribute · ba1debdf
      Vadim Kochan 提交于
      It allows to identify the wlan kind of device for the user application,
      e.g.:
      
          # ip -d link
      
          1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
              link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0
          2: enp0s25: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
              link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0
          3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
              link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff promiscuity 0
              wlan
      Signed-off-by: NVadim Kochan <vadim4j@gmail.com>
      Acked-by: NMarcel Holtmann <marcel@holtmann.org>
      [make wireless_link_ops const]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      ba1debdf
  32. 28 11月, 2014 1 次提交