1. 29 Jul, 2009 2 commits
  2. 24 Jul, 2009 2 commits
    • Zhu Yi's avatar
      cfg80211: fix NULL dereference in IBSS SIOCGIWAP · 80e5b06a
      Zhu Yi authored
      This patch avoids memcpy from wdev->wext.ibss.bssid if it is NULL.
      This could happen if we SIOCGIWAP before SIOCSIWAP.
      Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      80e5b06a
    • Johannes Berg's avatar
      cfg80211: rework key operation · fffd0934
      Johannes Berg authored
      This reworks the key operation in cfg80211, and now only
      allows, from userspace, configuring keys (via nl80211)
      after the connection has been established (in managed
      mode), the IBSS been joined (in IBSS mode), at any time
      (in AP[_VLAN] modes) or never for all the other modes.
      
      In order to do shared key authentication correctly, it
      is now possible to give a WEP key to the AUTH command.
      To configure static WEP keys, these are given to the
      CONNECT or IBSS_JOIN command directly, for a userspace
      SME it is assumed it will configure it properly after
      the connection has been established.
      
      Since mac80211 used to check the default key in IBSS
      mode to see whether or not the network is protected,
      it needs an update in that area, as well as an update
      to make use of the WEP key passed to auth() for shared
      key authentication.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      fffd0934
  3. 10 Jul, 2009 4 commits
    • Johannes Berg's avatar
      cfg80211: fix locking · 667503dd
      Johannes Berg authored
      Over time, a lot of locking issues have crept into
      the smarts of cfg80211, so e.g. scan completion can
      race against a new scan, IBSS join can race against
      leaving an IBSS, etc.
      
      Introduce a new per-interface lock that protects
      most of the per-interface data that we need to keep
      track of, and sprinkle assertions about that lock
      everywhere. Some things now need to be offloaded to
      work structs so that we don't require being able to
      sleep in functions the drivers call. The exception
      to that are the MLME callbacks (rx_auth etc.) that
      currently only mac80211 calls because it was easier
      to do that there instead of in cfg80211, and future
      drivers implementing those calls will, if they ever
      exist, probably need to use a similar scheme like
      mac80211 anyway...
      
      In order to be able to handle _deauth and _disassoc
      properly, introduce a cookie passed to it that will
      determine locking requirements.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      667503dd
    • Johannes Berg's avatar
      cfg80211: fix netdev down problem · 78485475
      Johannes Berg authored
      We shouldn't be looking at the ssid_len for non-IBSS,
      and for IBSS we should also return an error on trying
      to leave an IBSS while not in or joining an IBSS.
      
      This fixes an issue where we wouldn't disconnect() on
      an interface being taken down since there's no SSID
      configured this way.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      78485475
    • Johannes Berg's avatar
      cfg80211: keep track of BSSes · 19957bb3
      Johannes Berg authored
      In order to avoid problems with BSS structs going away
      while they're in use, I've long wanted to make cfg80211
      keep track of them. Without the SME, that wasn't doable
      but now that we have the SME we can do this too. It can
      keep track of up to four separate authentications and
      one association, regardless of whether it's controlled
      by the cfg80211 SME or the userspace SME.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      19957bb3
    • Johannes Berg's avatar
      cfg80211: remove wireless_dev->bssid · 7ebbe6bd
      Johannes Berg authored
      This variable isn't necessary -- the wext code keeps
      track of the BSSID itself, and otherwise we have
      current_bss.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      7ebbe6bd
  4. 11 May, 2009 1 commit
  5. 22 Apr, 2009 4 commits
    • Johannes Berg's avatar
      nl80211: allow configuring IBSS beacon interval · 8e30bc55
      Johannes Berg authored
      Make the JOIN_IBSS command look at the beacon interval
      attribute to see if the user requested a specific beacon
      interval, if not default to 100 TU (wext too).
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      8e30bc55
    • Johannes Berg's avatar
      cfg80211: clear WEXT SSID when clearing IBSS · 9d308429
      Johannes Berg authored
      When we leave an IBSS, we should clear the SSID and not just the
      BSSID, but since WEXT allows configuring while the interface is
      down we must not clear it when leaving due to taking the iface
      down, so some complications are needed.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      9d308429
    • Johannes Berg's avatar
      cfg80211: clean up includes · d3236553
      Johannes Berg authored
      Trying to separate header files into net/wireless.h and
      net/cfg80211.h has been a source of confusion. Remove
      net/wireless.h (because there also is the linux/wireless.h)
      and subsume everything into net/cfg80211.h -- except the
      definitions for regulatory structures which get moved to
      a new header net/regulatory.h.
      
      The "new" net/cfg80211.h is now divided into sections.
      
      There are no real changes in this patch but code shuffling
      and some very minor documentation fixes.
      
      I have also, to make things reflect reality, put in a
      copyright line for Luis to net/regulatory.h since that
      is probably exclusively written by him but was formerly
      in a file that only had my copyright line.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      d3236553
    • Johannes Berg's avatar
      cfg80211/nl80211: add IBSS API · 04a773ad
      Johannes Berg authored
      This adds IBSS API along with (preliminary) wext handlers.
      The wext handlers can only do IBSS so you need to call them
      from your own wext handlers if the mode is IBSS.
      
      The nl80211 API requires
       * an SSID
       * a channel (frequency) for the case that a new IBSS
         has to be created
      
      It optionally supports
       * a flag to fix the channel
       * a fixed BSSID
      
      The cfg80211 code also takes care to leave the IBSS before
      the netdev is set down. If wireless extensions are used, it
      also caches values when the interface is down and instructs
      the driver to join when the interface is set up.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      04a773ad