1. 22 11月, 2011 1 次提交
    • B
      wireless: Support ht-capabilities over-rides. · 7e7c8926
      Ben Greear 提交于
      This allows users to disable features such as HT, HT40,
      and to modify the MCS, AMPDU, and AMSDU settings for
      drivers that support it.
      
      The MCS, AMPDU, and AMSDU features that may be disabled are
      are reported in the phy-info netlink message as a mask.
      
      Attemping to disable features that are not supported will
      take no affect, but will not return errors.  This is to aid
      backwards compatibility in user-space apps that may not be
      clever enough to deal with parsing the the capabilities mask.
      
      This patch only enables the infrastructure.  An additional
      patch will enable the feature in mac80211.
      Signed-off-by: NBen Greear <greearb@candelatech.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7e7c8926
  2. 10 11月, 2011 2 次提交
  3. 28 9月, 2011 2 次提交
  4. 15 9月, 2011 1 次提交
  5. 20 7月, 2011 1 次提交
  6. 06 7月, 2011 1 次提交
    • L
      cfg80211: fix deadlock with rfkill/sched_scan by adding new mutex · c10841ca
      Luciano Coelho 提交于
      There was a deadlock when rfkill-blocking a wireless interface,
      because we were locking the rdev mutex on NETDEV_GOING_DOWN to stop
      sched_scans that were eventually running.  The rfkill block code was
      already holding a mutex under rdev:
      
      kernel: =======================================================
      kernel: [ INFO: possible circular locking dependency detected ]
      kernel: 3.0.0-rc1-00049-g1fa7b6a2 #57
      kernel: -------------------------------------------------------
      kernel: kworker/0:1/4525 is trying to acquire lock:
      kernel: (&rdev->mtx){+.+.+.}, at: [<ffffffff8164c831>] cfg80211_netdev_notifier_call+0x131/0x5b0
      kernel:
      kernel: but task is already holding lock:
      kernel: (&rdev->devlist_mtx){+.+.+.}, at: [<ffffffff8164dcef>] cfg80211_rfkill_set_block+0x4f/0xa0
      kernel:
      kernel: which lock already depends on the new lock.
      
      To fix this, add a new mutex specifically for sched_scan, to protect
      the sched_scan_req element in the rdev struct, instead of using the
      global rdev mutex.
      Reported-by: NDuane Griffin <duaneg@dghda.com>
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      c10841ca
  7. 19 5月, 2011 1 次提交
    • J
      cfg80211: Use consistent BSS matching between scan and sme · ed9d0102
      Jouni Malinen 提交于
      cfg80211 scan code adds separate BSS entries if the same BSS shows up
      on multiple channels. However, sme implementation does not use the
      frequency when fetching the BSS entry. Fix this by adding channel
      information to cfg80211_roamed() and include it in cfg80211_get_bss()
      calls.
      
      Please note that drivers using cfg80211_roamed() need to be modified to
      fully implement this fix. This commit includes only minimal changes to
      avoid compilation issues; it maintains the old (broken) behavior for
      most drivers. ath6kl was the only one that I could test, so I updated
      it to provide the operating frequency in the roamed event.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      ed9d0102
  8. 17 5月, 2011 1 次提交
    • J
      cfg80211: advertise possible interface combinations · 7527a782
      Johannes Berg 提交于
      Add the ability to advertise interface combinations in nl80211.
      This allows the driver to indicate what the combinations are
      that it supports. "Combinations" of just a single interface are
      implicit, as previously. Note that cfg80211 will enforce that
      the restrictions are met, but not for all drivers yet (once all
      drivers are updated, we can remove the flag and enforce for all).
      
      When no combinations are actually supported, an empty list will
      be exported so that userspace can know if the kernel exported
      this info or not (although it isn't clear to me what tools using
      the info should do if the kernel didn't export it).
      
      Since some interface types are purely virtual/software and don't
      fit the restrictions, those are exposed in a new list of pure SW
      types, not subject to restrictions. This mainly exists to handle
      AP-VLAN and monitor interfaces in mac80211.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7527a782
  9. 13 5月, 2011 2 次提交
  10. 12 5月, 2011 1 次提交
    • L
      cfg80211/nl80211: add support for scheduled scans · 807f8a8c
      Luciano Coelho 提交于
      Implement new functionality for scheduled scan offload.  With this feature we
      can scan automatically at certain intervals.
      
      The idea is that the hardware can perform scan automatically and filter on
      desired results without waking up the host unnecessarily.
      
      Add NL80211_CMD_START_SCHED_SCAN and NL80211_CMD_STOP_SCHED_SCAN
      commands to the nl80211 interface.  When results are available they are
      reported by NL80211_CMD_SCHED_SCAN_RESULTS events.  The userspace is
      informed when the scheduled scan has stopped with a
      NL80211_CMD_SCHED_SCAN_STOPPED event, which can be triggered either by
      the driver or by a call to NL80211_CMD_STOP_SCHED_SCAN.
      Signed-off-by: NLuciano Coelho <coelho@ti.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      807f8a8c
  11. 06 5月, 2011 1 次提交
  12. 21 12月, 2010 1 次提交
  13. 07 12月, 2010 1 次提交
    • J
      cfg80211/mac80211: add mesh join/leave commands · 29cbe68c
      Johannes Berg 提交于
      Instead of tying mesh activity to interface up,
      add join and leave commands for mesh. Since we
      must be backward compatible, let cfg80211 handle
      joining a mesh if a mesh ID was pre-configured
      when the device goes up.
      
      Note that this therefore must modify mac80211 as
      well since mac80211 needs to lose the logic to
      start the mesh on interface up.
      
      We now allow querying mesh parameters before the
      mesh is connected, which simply returns defaults.
      Setting them (internally renamed to "update") is
      only allowed while connected. Specify them with
      the new mesh join command instead where needed.
      
      In mac80211, beaconing must now also follow the
      mesh enabled/not enabled state, which is done
      by testing the mesh ID.
      Signed-off-by: NJavier Cardona <javier@cozybit.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      29cbe68c
  14. 30 11月, 2010 1 次提交
  15. 07 10月, 2010 1 次提交
  16. 24 9月, 2010 1 次提交
  17. 17 9月, 2010 1 次提交
  18. 25 8月, 2010 1 次提交
  19. 03 6月, 2010 1 次提交
  20. 08 5月, 2010 1 次提交
    • J
      cfg80211/mac80211: better channel handling · f444de05
      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: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f444de05
  21. 08 4月, 2010 1 次提交
    • J
      cfg80211: Add local-state-change-only auth/deauth/disassoc · d5cdfacb
      Jouni Malinen 提交于
      cfg80211 is quite strict on allowing authentication and association
      commands only in certain states. In order to meet these requirements,
      user space applications may need to clear authentication or
      association state in some cases. Currently, this can be done with
      deauth/disassoc command, but that ends up sending out Deauthentication
      or Disassociation frame unnecessarily. Add a new nl80211 attribute to
      allow this sending of the frame be skipped, but with all other
      deauth/disassoc operations being completed.
      
      Similar state change is also needed for IEEE 802.11r FT protocol in
      the FT-over-DS case which does not use Authentication frame exchange
      in a transition to another BSS. For this to work with cfg80211, an
      authentication entry needs to be created for the target BSS without
      sending out an Authentication frame. The nl80211 authentication
      command can be used for this purpose, too, with the new attribute to
      indicate that the command is only for changing local state. This
      enables wpa_supplicant to complete FT-over-DS transition successfully.
      Signed-off-by: NJouni Malinen <j@w1.fi>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      d5cdfacb
  22. 16 2月, 2010 1 次提交
    • J
      cfg80211/mac80211: allow registering for and sending action frames · 026331c4
      Jouni Malinen 提交于
      This implements a new command to register for action frames
      that userspace wants to handle instead of the in-kernel
      rejection. It is then responsible for rejecting ones that
      it decided not to handle. There is no unregistration, but
      the socket can be closed for that.
      
      Frames that are not registered for will not be forwarded
      to userspace and will be rejected by the kernel, the
      cfg80211 API helps implementing that.
      
      Additionally, this patch adds a new command that allows
      doing action frame transmission from userspace. It can be
      used either to exchange action frames on the current
      operational channel (e.g., with the AP with which we are
      currently associated) or to exchange off-channel Public
      Action frames with the remain-on-channel command.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      026331c4
  23. 20 1月, 2010 1 次提交
  24. 13 1月, 2010 1 次提交
    • J
      cfg80211: Store IEs from both Beacon and Probe Response frames · 34a6eddb
      Jouni Malinen 提交于
      Store information elements from Beacon and Probe Response frames in
      separate buffers to allow both sets to be made available through
      nl80211. This allows user space applications to get access to IEs from
      Beacon frames even if we have received Probe Response frames from the
      BSS. Previously, the IEs from Probe Response frames would have
      overridden the IEs from Beacon frames.
      
      This feature is of somewhat limited use since most protocols include
      the same (or extended) information in Probe Response frames. However,
      there are couple of exceptions where the IEs from Beacon frames could
      be of some use: TIM IE is only included in Beacon frames (and it would
      be needed to figure out the DTIM period used in the BSS) and at least
      some implementations of Wireless Provisioning Services seem to include
      the full IE only in Beacon frames).
      
      The new BSS attribute for scan results is added to allow both the IE
      sets to be delivered. This is done in a way that maintains the
      previously used behavior for applications that are not aware of the
      new NL80211_BSS_BEACON_IES attribute.
      Signed-off-by: NJouni Malinen <j@w1.fi>
      Acked-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      34a6eddb
  25. 29 12月, 2009 1 次提交
    • J
      cfg80211: add remain-on-channel command · 9588bbd5
      Jouni Malinen 提交于
      Add new commands for requesting the driver to remain awake
      on a specified channel for the specified amount of time
      (and another command to cancel such an operation). This
      can be used to implement userspace-controlled off-channel
      operations, like Public Action frame exchange on another
      channel than the operation channel.
      
      The off-channel operation should behave similarly to scan,
      i.e. the local station (if associated) moves into power
      save mode to request the AP to buffer frames for it and
      then moves to the other channel to allow the off-channel
      operation to be completed. The duration parameter can be
      used to request enough time to receive a response from
      the target station.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      9588bbd5
  26. 22 12月, 2009 1 次提交
  27. 29 11月, 2009 1 次提交
    • A
      wireless : use a dedicated workqueue for cfg80211. · e60d7443
      Alban Browaeys 提交于
      This patch moves the works cleanup, scan and events to a cfg80211
      dedicated workqueue.
      
      Platform driver like eeepc-laptop ought to use works to rfkill (as
      new rfkill does lock in rfkill_unregister and the platform driver is
      called from rfkill_switch_all which also lock the same mutex).
      This raise a new issue in itself that the work scheduled by the platform
      driver to the global worqueue calls wiphy_unregister which flush_work
      scan and event works (which thus flush works on the global workqueue inside
      a work on the global workqueue) and also put on hold the  wdev_cleanup_work
       (which prevents the dev_put on netdev thus indefinite Usage count error on
      wifi device).
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NAlban Browaeys <prahal@yahoo.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e60d7443
  28. 19 11月, 2009 1 次提交
  29. 31 10月, 2009 1 次提交
    • J
      cfg80211/mac80211: use debugfs_remove_recursive · 7bcfaf2f
      Johannes Berg 提交于
      We can save a lot of code and pointers in the structs
      by using debugfs_remove_recursive().
      
      First, change cfg80211 to use debugfs_remove_recursive()
      so that drivers do not need to clean up any files they
      added to the per-wiphy debugfs (if and only if they are
      ok to be accessed until after wiphy_unregister!).
      
      Then also make mac80211 use debugfs_remove_recursive()
      where necessary -- it need not remove per-wiphy files
      as cfg80211 now removes those, but netdev etc. files
      still need to be handled but can now be removed without
      needing struct dentry pointers to all of them.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7bcfaf2f
  30. 28 10月, 2009 1 次提交
  31. 29 8月, 2009 3 次提交
    • J
      cfg80211: clean up properly on interface type change · 3d54d255
      Johannes Berg 提交于
      When the interface type changes while connected, and the
      driver does not require the interface to be down for a
      type change, it is currently possible to get very strange
      results unless the driver takes special care, which it
      shouldn't have to.
      
      To fix this, take care to disconnect/leave IBSS when
      changing the interface type -- even if the driver may fail
      the call. Also process all events that may be pending to
      avoid running into a situation where an event is reported
      but only processed after the type has already changed,
      which would lead to missing events and warnings.
      
      A side effect of this is that you will have disconnected
      or left the IBSS even if the mode change ultimately fails,
      but since the intention was to change it and thus leave or
      disconnect, this is not a problem.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3d54d255
    • J
      cfg80211: make spurious warnings less likely, configurable · f7969969
      Johannes Berg 提交于
      Bob reported that he got warnings in IBSS mode about
      the ssid_len being zero on a joined event, but only
      when kmemcheck was enabled. This appears to be due
      to a race condition between drivers and userspace,
      when the driver reports joined but the user in the
      meantime decided to leave the IBSS again, the warning
      would trigger. This was made more likely by kmemcheck
      delaying the code that does the check and sends the
      event.
      
      So first, make the warning trigger closer to the
      driver, which means it's not locked, but since only
      the warning depends on it that's ok.
      
      And secondly, users will not want to have spurious
      warnings at all, so make those that are known to be
      racy in such a way configurable.
      Reported-by: NBob Copeland <me@bobcopeland.com>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f7969969
    • J
      cfg80211: check lost scans later, fix bug · 01a0ac41
      Johannes Berg 提交于
      When we lose a scan, cfg80211 tries to clean up after
      the driver. However, it currently does this too early,
      it does this in GOING_DOWN already instead of DOWN, so
      it may happen with mac80211. Besides fixing this, also
      make it more robust by leaking the scan request so if
      the driver later actually finishes the scan, it won't
      crash. Also check in ___cfg80211_scan_done whether a
      scan request is still pending and exit if not.
      Reported-by: NFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Tested-by: NFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      01a0ac41
  32. 20 8月, 2009 1 次提交
  33. 14 8月, 2009 3 次提交