1. 19 5月, 2009 8 次提交
  2. 18 5月, 2009 10 次提交
  3. 14 5月, 2009 11 次提交
  4. 12 5月, 2009 11 次提交
    • J
      wext: fix get_wireless_stats locking · 7be69c0b
      Johannes Berg 提交于
      Currently, get_wireless_stats is racy by _design_. This is
      because it returns a buffer, which needs to be statically
      allocated since it cannot be freed if it was allocated
      dynamically. Also, SIOCGIWSTATS and /proc/net/wireless use
      no common lock, and /proc/net/wireless accesses are not
      synchronised against each other. This is a design flaw in
      get_wireless_stats since the beginning.
      
      This patch fixes it by wrapping /proc/net/wireless accesses
      with the RTNL so they are protected against each other and
      SIOCGIWSTATS. The more correct method of fixing this would
      be to pass in the buffer instead of returning it and have
      the caller take care of synchronisation of the buffer, but
      even then most drivers probably assume that their callback
      is protected by the RTNL like all other wext callbacks.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7be69c0b
    • J
      cfg80211: disallow interfering with stations on non-AP · e80cf853
      Johannes Berg 提交于
      On non-AP interfaces userspace has no business interfering with
      the station management, this can confuse mac80211 (and other
      drivers probably wouldn't support it anyway). Allow adding and
      removing stations only on AP interfaces.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e80cf853
    • J
      cfg80211: put wext data into substructure · cbe8fa9c
      Johannes Berg 提交于
      To make it more apparent in the code what is for wext
      only (and needs to be #ifdef'ed) put all the info for
      wext into a substruct in each wireless_dev.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      cbe8fa9c
    • J
      cfg80211: constify key mac address in ops · 4e943900
      Johannes Berg 提交于
      The address pointed to by mac_addr can be marked as const.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4e943900
    • J
      mac80211: properly track HT operation_mode · 413ad50a
      Johannes Berg 提交于
      When we disassociate, we set the channel to non-HT which
      obviously invalidates any ht_operation_mode setting. But
      when we then associate with the next AP again, we might
      still have the ht_operation_mode from the previous AP
      cached and fail to configure the hardware with the new
      (but unchanged) operation mode. This patch fixes it by
      separately tracking whether our cache is valid.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      413ad50a
    • J
      mac80211: move HT operation mode BSS info · 9ed6bcce
      Johannes Berg 提交于
      There really is no need to have a separate struct for a
      single variable. The fact that it exists is due to the
      code legacy, but we can remove that now. Very simple.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      9ed6bcce
    • J
      mac80211: improve scan timing · 99c84cb0
      Johannes Berg 提交于
      The call to ieee80211_hw_config() is supposed to apply changes
      synchronously, so once it returns the parameters are applied to
      the hardware. Thus, there really is no need to delay the probing
      by the channel switch time again since the channel switch has
      already happened once we get to this code.
      
      Additionally, there is no need to wait for a NAV update (probe
      delay) when the channel is passively scanned. Remove that extra
      time too.
      
      This cuts scanning time from over 7 seconds to under 4 on ar9170,
      which is due to the number of channels scanned and ar9170's switch
      time being advertised as 135ms (my test now indicates it is about
      77ms with the current driver, but the difference might also be due
      to using a different machine with different USB controllers).
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      99c84cb0
    • J
      mac80211: MFP - Drop unprotected Action frames prior key setup · f2ca3ea4
      Jouni Malinen 提交于
      When management frame protection (IEEE 802.11w) is used, unprotected
      Robust Action frames are not allowed prior to key configuration.
      However, unprotected Deauthentication and Disassociation frames are
      allowed at that point, but not after key configuration.
      
      Make ieee80211_drop_unencrypted() handle the special cases for MFP by
      separating the basic Data frame case from Management frame processing
      and handle the Management frames only if MFP has been negotiated. In
      addition, do not use sdata->drop_unencrypted for Management frames
      since the decision on whether to accept the frame depends on the key
      being configured.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f2ca3ea4
    • J
      mac80211: Drop unencrypted frames based on key setup · 0c7c10c7
      Jouni Malinen 提交于
      When using nl80211, we do not have a mechanism to set
      sdata->drop_unencrypted. Currently, this breaks code that is supposed
      to drop unencrypted frames when protection is expected since
      ieee80211_rx_h_decrypt() is optimized to not set rx->key when the
      frame is not protected.
      
      This patch modifies ieee80211_rx_h_decrypt() to set rx->key for all
      frames and only skip decryption if the frame is not protected. This
      allows ieee80211_drop_unencrypted() to correctly drop frames even if
      drop_unencrypted is not set.
      
      The changes here are not enough to handle all cases, though. Additional
      patches will be needed to implement proper IEEE 802.1X PAE for station
      mode (currently, this is only used for AP mode) and some additional
      rules are needed for MFP to drop unprotected Robust Action frames prior
      to having PTK and IGTK configured.
      
      In theory, the unprotected frames could and should be dropped in
      ieee80211_rx_h_decrypt(). However, due to the special case with EAPOL
      frames that have to be allowed to be received unprotected even when
      keys are set, it is simpler to only set rx->key and allow the
      ieee80211_frame_allowed() function to handle the actual dropping of
      data frames after 802.11->802.3 header conversion. In addition,
      unprotected robust management frames are dropped before they are
      processed.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0c7c10c7
    • J
      cfg80211: fix wext iw_freq parsing · 0b258582
      Johannes Berg 提交于
      The function to parse a struct iw_freq has a stupid bug,
      it returns NULL when the channel cannot be found at all,
      but NULL is supposed to mean "auto". Fix this by checking
      the return value of ieee80211_get_channel() and returning
      ERR_PTR(-EINVAL) if it returned NULL (channel not found).
      
      This fixes an issue where you could say (in IBSS mode)
      	iwconfig wlan0 channel 21
      and it would use channel 1 instead because that's the
      first available channel with IBSS allowed (which is what
      the "auto" setting uses).
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0b258582
    • J
      mac80211: set default QoS values according to spec · aa837e1d
      Johannes Berg 提交于
      We've never really cared about the default QoS (WMM) values, but
      we really should if the AP doesn't send any. This patch makes
      mac80211 use the default values according to 802.11-2007, and
      additionally syncs the default values when we disassociate so
      whatever the last AP said gets "unconfigured".
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      aa837e1d