1. 21 9月, 2011 1 次提交
  2. 17 9月, 2011 1 次提交
  3. 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
  4. 07 10月, 2010 1 次提交
  5. 17 9月, 2010 1 次提交
  6. 21 7月, 2010 1 次提交
  7. 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
  8. 17 4月, 2010 1 次提交
    • N
      cfg80211: Avoid sending IWEVASSOCREQIE and IWEVASSOCRESPIE events with NULL event body · 7834704b
      Nishant Sarmukadam 提交于
      In a scenario, where a cfg80211 driver (station mode) does not send assoc request
      and assoc response IEs in cfg80211_connect_result after a successful association
      to an AP, cfg80211 sends IWEVASSOCREQIE and IWEVASSOCRESPIE to the user space
      application with NULL data. This can cause an issue at the event recipient.
      
      An example of this is when cfg80211 sends IWEVASSOCREQIE and IWEVASSOCRESPIE
      events with NULL event body to wpa_supplicant. The wpa_supplicant overwrites
      the assoc request and assoc response IEs for this station with NULL data.
      If the association is WPA/WPA2, the wpa_supplicant is not able to generate
      EAPOL handshake messages, since the IEs are NULL.
      
      With the patch, req_ie and resp_ie will be NULL by avoiding the
      assignment if the driver has not sent the IEs to cfg80211. The event sending
      code sends the events only if resp_ie and req_ie are not NULL. This
      will ensure that the events are not sent with NULL event body.
      Signed-off-by: NNishant Sarmukadam <nishants@marvell.com>
      Reviewed-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7834704b
  9. 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
  10. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  11. 02 2月, 2010 1 次提交
    • L
      cfg80211: add regulatory hint disconnect support · 09d989d1
      Luis R. Rodriguez 提交于
      This adds a new regulatory hint to be used when we know all
      devices have been disconnected and idle. This can happen
      when we suspend, for instance. When we disconnect we can
      no longer assume the same regulatory rules learned from
      a country IE or beacon hints are applicable so restore
      regulatory settings to an initial state.
      
      Since driver hints are cached on the wiphy that called
      the hint, those hints are not reproduced onto cfg80211
      as the wiphy will respect its own wiphy->regd regardless.
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      09d989d1
  12. 16 1月, 2010 1 次提交
    • L
      cfg80211: make regulatory_hint_11d() band specific · 84920e3e
      Luis R. Rodriguez 提交于
      In practice APs do not send country IE channel triplets for channels
      the AP is not operating on and if they were to do so they would have
      to use the regulatory extension which we currently do not process.
      No AP has been seen in practice that does this though so just drop
      those country IEs.
      
      Additionally it has been noted the first series of country IE
      channels triplets are specific to the band the AP sends. Propagate
      the band on which the country IE was found on reject the country
      IE then if the triplets are ever oustide of the band.
      
      Although we now won't process country IE information with multiple
      band information we leave the intersection work as is as it is
      technically possible for someone to want to eventually process these
      type of country IEs with regulatory extensions.
      
      Cc: Jouni Malinen <jouni.malinen@atheros.com>
      Cc: Johannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      84920e3e
  13. 15 1月, 2010 1 次提交
  14. 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
  15. 03 11月, 2009 1 次提交
  16. 28 10月, 2009 1 次提交
  17. 08 10月, 2009 1 次提交
    • J
      wext: refactor · 3d23e349
      Johannes Berg 提交于
      Refactor wext to
       * split out iwpriv handling
       * split out iwspy handling
       * split out procfs support
       * allow cfg80211 to have wireless extensions compat code
         w/o CONFIG_WIRELESS_EXT
      
      After this, drivers need to
       - select WIRELESS_EXT	- for wext support
       - select WEXT_PRIV	- for iwpriv support
       - select WEXT_SPY	- for iwspy support
      
      except cfg80211 -- which gets new hooks in wext-core.c
      and can then get wext handlers without CONFIG_WIRELESS_EXT.
      
      Wireless extensions procfs support is auto-selected
      based on PROC_FS and anything that requires the wext core
      (i.e. WIRELESS_EXT or CFG80211_WEXT).
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3d23e349
  18. 29 9月, 2009 1 次提交
    • J
      cfg80211: always get BSS · 8bb89485
      Johannes Berg 提交于
      Multiple problems were reported due to interaction
      between wpa_supplicant and the wext compat code in
      cfg80211, which appear to be due to it not getting
      any bss pointer here when wpa_supplicant sets all
      parameters -- do that now. We should still get the
      bss after doing an extra scan, but that appears to
      increase the time we need for connecting enough to
      sometimes cause timeouts.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Tested-by: Hin-Tak Leung <hintak.leung@gmail.com>,
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8bb89485
  19. 23 9月, 2009 1 次提交
    • J
      cfg80211: fix SME connect · 90c215c4
      Johannes Berg 提交于
      There's a check saying
      	/* we're good if we have both BSSID and channel */
      	if (wdev->conn->params.bssid && wdev->conn->params.channel) {
      
      but that isn't true -- we need the BSS struct. This leads
      to errors such as
      
          Trying to associate with 00:1b:53:11:dc:40 (SSID='TEST' freq=2412 MHz)
          ioctl[SIOCSIWFREQ]: No such file or directory
          ioctl[SIOCSIWESSID]: No such file or directory
          Association request to the driver failed
          Associated with 00:1b:53:11:dc:40
      
      in wpa_supplicant, as reported by Holger.
      
      Instead, we really need to have the BSS struct, and if we
      don't, then we need to initiate a scan for it. But we may
      already have the BSS struct here, so hang on to it if we
      do and scan if we don't.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Tested-by: NHolger Schurig <hs4233@mail.mn-solutions.de>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      90c215c4
  20. 17 9月, 2009 1 次提交
    • J
      cfg80211: fix SME connect · bbac31f4
      Johannes Berg 提交于
      There's a check saying
      	/* we're good if we have both BSSID and channel */
      	if (wdev->conn->params.bssid && wdev->conn->params.channel) {
      
      but that isn't true -- we need the BSS struct. This leads
      to errors such as
      
          Trying to associate with 00:1b:53:11:dc:40 (SSID='TEST' freq=2412 MHz)
          ioctl[SIOCSIWFREQ]: No such file or directory
          ioctl[SIOCSIWESSID]: No such file or directory
          Association request to the driver failed
          Associated with 00:1b:53:11:dc:40
      
      in wpa_supplicant, as reported by Holger.
      
      Instead, we really need to have the BSS struct, and if we
      don't, then we need to initiate a scan for it. But we may
      already have the BSS struct here, so hang on to it if we
      do and scan if we don't.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Tested-by: NHolger Schurig <hs4233@mail.mn-solutions.de>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      bbac31f4
  21. 29 8月, 2009 1 次提交
    • 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
  22. 20 8月, 2009 3 次提交
  23. 14 8月, 2009 5 次提交
    • J
      cfg80211: fix alignment problem in scan request · 5ba63533
      Johannes Berg 提交于
      The memory layout for scan requests was rather wrong,
      we put the scan SSIDs before the channels which could
      lead to the channel pointers being unaligned in memory.
      It turns out that using a pointer to the channel array
      isn't necessary anyway since we can embed a zero-length
      array into the struct.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      5ba63533
    • J
      cfg80211: use reassociation when possible · f401a6f7
      Johannes Berg 提交于
      With the move of everything related to the SME from
      mac80211 to cfg80211, we lost the ability to send
      reassociation frames. This adds them back, but only
      for wireless extensions. With the userspace SME, it
      shall control assoc vs. reassoc (it already can do
      so with the nl80211 interface).
      
      I haven't touched the connect() implementation, so
      it is not possible to reassociate with the nl80211
      connect primitive. I think that should be done with
      the NL80211_CMD_ROAM command, but we'll have to see
      how that can be handled in the future, especially
      with fullmac chips.
      
      This patch addresses only the immediate regression
      we had in mac80211, which previously sent reassoc.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f401a6f7
    • J
      cfg80211: validate channel settings across interfaces · 59bbb6f7
      Johannes Berg 提交于
      Currently, there's a problem that affects regulatory
      enforcement and connection stability, in that it is
      possible to switch the channel while connected to a
      network or joined to an IBSS.
      
      The problem comes from the fact that we only validate
      the channel against the current interface's type, not
      against any other interface. Thus, you have any type
      of interface up, additionally bring up a monitor mode
      interface and switch the channel on the monitor. This
      will obviously also switch the channel on the other
      interface.
      
      The problem now is that if you do that while sending
      beacons for IBSS mode, you can switch to a disabled
      channel or a channel that doesn't allow beaconing.
      Combined with a managed mode interface connected to
      an AP instead of an IBSS interface, you can easily
      break the connection that way.
      
      To fix this, this patch validates any channel change
      with all available interfaces, and disallows such
      changes on secondary interfaces if another interface
      is connected to an AP or joined to an IBSS.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      59bbb6f7
    • S
      cfg80211: Set WEP ciphers · bcba8eae
      Samuel Ortiz 提交于
      With iwconfig there is no way to properly set the ciphers when trying to
      connect to a WEP SSID. Although mac80211 based drivers dont need it, several
      fullmac drivers do.
      This patch basically sets the WEP ciphers whenever they're not set at all.
      Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      bcba8eae
    • J
      cfg80211: fix SME association after disassociation · b6f0b639
      Johannes Berg 提交于
      When an AP disassociates us, we currently go into a weird
      state because the SME doesn't handle authenticated but not
      associated well unless it's within its own state machine,
      it can't recover from that. However, it shouldn't need to,
      since we don't do any decisions in it really -- so when we
      get disconnected, simply deauthenticate too.
      Reported-by: NPavel Roskin <proski@gnu.org>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      b6f0b639
  24. 05 8月, 2009 3 次提交
  25. 30 7月, 2009 1 次提交
  26. 28 7月, 2009 1 次提交
    • J
      cfg80211: make aware of net namespaces · 463d0183
      Johannes Berg 提交于
      In order to make cfg80211/nl80211 aware of network namespaces,
      we have to do the following things:
      
       * del_virtual_intf method takes an interface index rather
         than a netdev pointer - simply change this
      
       * nl80211 uses init_net a lot, it changes to use the sender's
         network namespace
      
       * scan requests use the interface index, hold a netdev pointer
         and reference instead
      
       * we want a wiphy and its associated virtual interfaces to be
         in one netns together, so
          - we need to be able to change ns for a given interface, so
            export dev_change_net_namespace()
          - for each virtual interface set the NETIF_F_NETNS_LOCAL
            flag, and clear that flag only when the wiphy changes ns,
            to disallow breaking this invariant
      
       * when a network namespace goes away, we need to reparent the
         wiphy to init_net
      
       * cfg80211 users that support creating virtual interfaces must
         create them in the wiphy's namespace, currently this affects
         only mac80211
      
      The end result is that you can now switch an entire wiphy into
      a different network namespace with the new command
      	iw phy#<idx> set netns <pid>
      and all virtual interfaces will follow (or the operation fails).
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      463d0183
  27. 25 7月, 2009 5 次提交
  28. 11 7月, 2009 1 次提交