1. 08 4月, 2010 2 次提交
    • J
      mac80211: clean up/fix aggregation code · 098a6070
      Johannes Berg 提交于
      The aggregation code has a number of quirks, like
      inventing an unneeded WLAN_BACK_TIMER value and
      leaking memory under certain circumstances during
      station destruction. Fix these issues by using
      the regular aggregation session teardown code and
      blocking new aggregation sessions, all before the
      station is really destructed.
      
      As a side effect, this gets rid of the long code
      block to destroy aggregation safely.
      
      Additionally, rename tid_state_rx which can only
      have the values IDLE and OPERATIONAL to
      tid_active_rx to make it easier to understand
      that there is no bitwise stuff going on on the
      RX side -- the TX side remains because it needs
      to keep track of the driver and peer states.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      098a6070
    • J
      mac80211: fix station destruction problem · e64b3795
      Johannes Berg 提交于
      When a station w/o a key is destroyed, or when
      a driver submits work for a station and thereby
      references it again, it seems like potentially
      we could reference the station structure while
      it is being destroyed.
      
      Wait for an RCU grace period to elapse before
      finishing destroying the station after we have
      removed the station from the driver and from
      the hash table etc., even in the case where no
      key is associated with the station.
      
      Also, there's no point in deleting the plink
      timer here since it'll be properly deleted just
      a bit later.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e64b3795
  2. 07 4月, 2010 1 次提交
  3. 11 3月, 2010 1 次提交
  4. 09 2月, 2010 1 次提交
    • J
      mac80211: allow station add/remove to sleep · 34e89507
      Johannes Berg 提交于
      Many drivers would like to sleep during station
      addition and removal, and currently have a high
      complexity there from not being able to.
      
      This introduces two new callbacks sta_add() and
      sta_remove() that drivers can implement instead
      of using sta_notify() and that can sleep, and
      the new sta_add() callback is also allowed to
      fail.
      
      The reason we didn't do this previously is that
      the IBSS code wants to insert stations from the
      RX path, which is a tasklet, so cannot sleep.
      This patch will keep the station allocation in
      that path, but moves adding the station to the
      driver out of line. Since the addition can now
      fail, we can have IBSS peer structs the driver
      rejected -- in that case we still talk to the
      station but never tell the driver about it in
      the control.sta pointer. If there will ever be
      a driver that has a low limit on the number of
      stations and that cannot talk to any stations
      that are not known to it, we need to do come up
      with a new strategy of handling larger IBSSs,
      maybe quicker expiry or rejecting peers.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      34e89507
  5. 13 1月, 2010 1 次提交
  6. 29 12月, 2009 2 次提交
  7. 22 12月, 2009 3 次提交
  8. 19 11月, 2009 2 次提交
  9. 12 11月, 2009 1 次提交
    • F
      mac80211: implement support for 4-address frames for AP and client mode · f14543ee
      Felix Fietkau 提交于
      In some situations it might be useful to run a network with an
      Access Point and multiple clients, but with each client bridged
      to a network behind it. For this to work, both the client and the
      AP need to transmit 4-address frames, containing both source and
      destination MAC addresses.
      With this patch, you can configure a client to communicate using
      only 4-address frames for data traffic.
      On the AP side you can enable 4-address frames for individual
      clients by isolating them in separate AP VLANs which are configured
      in 4-address mode.
      Such an AP VLAN will be limited to one client only, and this client
      will be used as the destination for all traffic on its interface,
      regardless of the destination MAC address in the packet headers.
      The advantage of this mode compared to regular WDS mode is that it's
      easier to configure and does not require a static list of peer MAC
      addresses on any side.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f14543ee
  10. 07 11月, 2009 1 次提交
    • J
      mac80211: async station powersave handling · af818581
      Johannes Berg 提交于
      Some devices require that all frames to a station
      are flushed when that station goes into powersave
      mode before being able to send frames to that
      station again when it wakes up or polls -- all in
      order to avoid reordering and too many or too few
      frames being sent to the station when it polls.
      
      Normally, this is the case unless the station
      goes to sleep and wakes up very quickly again.
      But in that case, frames for it may be pending
      on the hardware queues, and thus races could
      happen in the case of multiple hardware queues
      used for QoS/WMM. Normally this isn't a problem,
      but with the iwlwifi mechanism we need to make
      sure the race doesn't happen.
      
      This makes mac80211 able to cope with the race
      with driver help by a new WLAN_STA_PS_DRIVER
      per-station flag that can be controlled by the
      driver and tells mac80211 whether it can transmit
      frames or not. This flag must be set according to
      very specific rules outlined in the documentation
      for the function that controls it.
      
      When we buffer new frames for the station, we
      normally set the TIM bit right away, but while
      the driver has blocked transmission to that sta
      we need to avoid that as well since we cannot
      respond to the station if it wakes up due to the
      TIM bit. Once the driver unblocks, we can set
      the TIM bit.
      
      Similarly, when the station just wakes up, we
      need to wait until all other frames are flushed
      before we can transmit frames to that station,
      so the same applies here, we need to wait for
      the driver to give the OK.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      af818581
  11. 05 11月, 2009 1 次提交
  12. 08 10月, 2009 1 次提交
    • J
      mac80211: fix vlan and optimise RX · fbc44bf7
      Johannes Berg 提交于
      When receiving data frames, we can send them only to
      the interface they belong to based on transmitting
      station (this doesn't work for probe requests). Also,
      don't try to handle other frames for AP_VLAN at all
      since those interface should only receive data.
      
      Additionally, the transmit side must check that the
      station we're sending a frame to is actually on the
      interface we're transmitting on, and not transmit
      packets to functions that live on other interfaces,
      so validate that as well.
      
      Another bug fix is needed in sta_info.c where in the
      VLAN case when adding/removing stations we overwrite
      the sdata variable we still need.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Cc: stable@kernel.org
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      fbc44bf7
  13. 14 8月, 2009 1 次提交
    • J
      nl80211: add generation number to all dumps · f5ea9120
      Johannes Berg 提交于
      In order for userspace to be able to figure out whether
      it obtained a consistent snapshot of data or not when
      using netlink dumps, we need to have a generation number
      in each dump message that indicates whether the list has
      changed or not -- its value is arbitrary.
      
      This patch adds such a number to all dumps, this needs
      some mac80211 involvement to keep track of a generation
      number to start with when adding/removing mesh paths or
      stations.
      
      The wiphy and netdev lists can be fully handled within
      cfg80211, of course, but generation numbers need to be
      stored there as well.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      f5ea9120
  14. 04 6月, 2009 1 次提交
  15. 21 5月, 2009 2 次提交
    • J
      mac80211: cancel/restart all timers across suspend/resume · 5bb644a0
      Johannes Berg 提交于
      We forgot to cancel all timers in mac80211 when suspending.
      In particular we forgot to deal with some things that can
      cause hardware reconfiguration -- while it is down.
      
      While at it we go ahead and add a warning in ieee80211_sta_work()
      if its run while the suspend->resume cycle is in effect. This
      should not happen and if it does it would indicate there is
      a bug lurking in either mac80211 or mac80211 drivers.
      
      With this now wpa_supplicant doesn't blink when I go to suspend
      and resume where as before there where issues with some timers
      running during the suspend->resume cycle. This caused a lot of
      incorrect assumptions and would at times bring back the device
      in an incoherent, but mostly recoverable, state.
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      5bb644a0
    • S
      mac80211: Initialize RX's last received sequence number · cccaec98
      Senthil Balasubramanian 提交于
      The STA may drop the very first frame if it happens to be a retried
      frame. This is because we maintian the last received sequence number
      per TID for QoS frames and it is initialized to zero through kzalloc
      during sta_info_alloc and the sequence number of the very first date
      frame received would be ZERO (as per IEEE 802.11-2007, 7.1.3.4.1).
      
      If the frame dropped happens to be an EAP Request Identity(very first
      frame from the AP), then wpa_supplicnat disconnects the STA and the
      whole procedure starts again.
      Signed-off-by: NSenthil Balasubramanian <senthilkumar@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      cccaec98
  16. 07 5月, 2009 2 次提交
    • J
      mac80211: add driver ops wrappers · 24487981
      Johannes Berg 提交于
      In order to later add tracing or verifications to the driver
      calls mac80211 makes, this patch adds static inline wrappers
      for all operations.
      
      All calls are now written as
      
      	drv_<op>(local, ...);
      
      instead of
      
      	local->ops-><op>(&local->hw, ...);
      
      Where necessary, the wrappers also do existence checking and
      return default values as appropriate.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      24487981
    • J
      mac80211: clean up beacon interval settings · 57c4d7b4
      Johannes Berg 提交于
      We currently have two beacon interval configuration knobs:
      hw.conf.beacon_int and vif.bss_info.beacon_int. This is
      rather confusing, even though the former is used when we
      beacon ourselves and the latter when we are associated to
      an AP.
      
      This just deprecates the hw.conf.beacon_int setting in favour
      of always using vif.bss_info.beacon_int. Since it touches all
      the beaconing IBSS code anyway, we can also add support for
      the cfg80211 IBSS beacon interval configuration easily.
      
      NOTE: The hw.conf.beacon_int setting is retained for now due
            to drivers still using it -- I couldn't untangle all
            drivers, some are updated in this patch.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      57c4d7b4
  17. 23 4月, 2009 1 次提交
  18. 28 3月, 2009 2 次提交
    • J
      mac80211/iwlwifi: move virtual A-MDPU queue bookkeeping to iwlwifi · e4e72fb4
      Johannes Berg 提交于
      This patch removes all the virtual A-MPDU-queue bookkeeping from
      mac80211. Curiously, iwlwifi already does its own bookkeeping, so
      it doesn't require much changes except where it needs to handle
      starting and stopping the queues in mac80211.
      
      To handle the queue stop/wake properly, we rewrite the software
      queue number for aggregation frames and internally to iwlwifi keep
      track of the queues that map into the same AC queue, and only talk
      to mac80211 about the AC queue. The implementation requires calling
      two new functions, iwl_stop_queue and iwl_wake_queue instead of the
      mac80211 counterparts.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Cc: Reinette Chattre <reinette.chatre@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e4e72fb4
    • J
      mac80211: fix aggregation to not require queue stop · cd8ffc80
      Johannes Berg 提交于
      Instead of stopping the entire AC queue when enabling aggregation
      (which was only done for hardware with aggregation queues) buffer
      the packets for each station, and release them to the pending skb
      queue once aggregation is turned on successfully.
      
      We get a little more code, but it becomes conceptually simpler and
      we can remove the entire virtual queue mechanism from mac80211 in
      a follow-up patch.
      
      This changes how mac80211 behaves towards drivers that support
      aggregation but have no hardware queues -- those drivers will now
      not be handed packets while the aggregation session is being
      established, but only after it has been fully established.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      cd8ffc80
  19. 28 2月, 2009 1 次提交
    • J
      mac80211: fix aggregation for hardware with ampdu queues · 96f5e66e
      Johannes Berg 提交于
      Hardware with AMPDU queues currently has broken aggregation.
      
      This patch fixes it by making all A-MPDUs go over the regular AC queues,
      but keeping track of the hardware queues in mac80211. As a first rough
      version, it actually stops the AC queue for extended periods of time,
      which can be removed by adding buffering internal to mac80211, but is
      currently not a huge problem because people rarely use multiple TIDs
      that are in the same AC (and iwlwifi currently doesn't operate as AP).
      
      This is a short-term fix, my current medium-term plan, which I hope to
      execute soon as well, but am not sure can finish before .30, looks like
      this:
       1) rework the internal queuing layer in mac80211 that we use for
          fragments if the driver stopped queue in the middle of a fragmented
          frame to be able to queue more frames at once (rather than just a
          single frame with its fragments)
       2) instead of stopping the entire AC queue, queue up the frames in a
          per-station/per-TID queue during aggregation session initiation,
          when the session has come up take all those frames and put them
          onto the queue from 1)
       3) push the ampdu queue layer abstraction this patch introduces in
          mac80211 into the driver, and remove the virtual queue stuff from
          mac80211 again
      
      This plan will probably also affect ath9k in that mac80211 queues the
      frames instead of passing them down, even when there are no ampdu queues.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      96f5e66e
  20. 14 2月, 2009 1 次提交
    • J
      mac80211: fix aggregation timer lockups · 55687e38
      Johannes Berg 提交于
      As far as I can tell, there are possible lockups because both the RX
      session_timer and TX addba_resp_timer are del_timer_sync'ed under
      the sta spinlock which both timer functions take. Additionally, the
      TX agg code seems to leak memory when TX aggregation is not disabled
      before the sta_info is freed.
      
      Fix this by making the free code a little smarter in the RX agg case,
      and actually make the sta_info_destroy code free the TX agg info in
      the TX agg case. We won't notify the peer, but it'll notice something
      is wrong anyway, and normally this only happens after we've told it
      in some other way we will no longer talk to it.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      55687e38
  21. 05 12月, 2008 1 次提交
    • S
      mac80211: use unaligned safe memcmp() in-place of compare_ether_addr() · 5cf12e8d
      Shaddy Baddah 提交于
      After fixing zd1211rw: use unaligned safe memcmp() in-place of
      compare_ether_addr(), I started to see kernel log messages detailing
      unaligned access:
      
        Kernel unaligned access at TPC[100f7f44] sta_info_get+0x24/0x68 [mac80211]
      
      As with the aforementioned patch, the unaligned access was eminating
      from a compare_ether_addr() call. Concerned that whilst it was safe to
      assume that unalignment was the norm for the zd1211rw, and take
      preventative measures, it may not be the case or acceptable to use the
      easy fix of changing the call to memcmp().
      
      My research however indicated that it was OK to do this, as there are
      a few instances where memcmp() is the preferred mechanism for doing
      mac address comparisons throughout the module.
      Signed-off-by: NShaddy Baddah <shaddy_baddah@hotmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      5cf12e8d
  22. 01 11月, 2008 1 次提交
  23. 28 10月, 2008 1 次提交
  24. 15 10月, 2008 1 次提交
  25. 25 9月, 2008 1 次提交
    • J
      mac80211: clean up rate control API · 4b7679a5
      Johannes Berg 提交于
      Long awaited, hard work. This patch totally cleans up the rate control
      API to remove the requirement to include internal headers outside of
      net/mac80211/.
      
      There's one internal use in the PID algorithm left for mesh networking,
      we'll have to figure out a way to clean that one up and decide how to
      do the peer link evaluation, possibly independent of the rate control
      algorithm or via new API.
      
      Additionally, ath9k is left using the cross-inclusion hack for now, we
      will add new API where necessary to make this work properly, but right
      now I'm not expert enough to do it. It's still off better than before.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      4b7679a5
  26. 16 9月, 2008 3 次提交
  27. 15 7月, 2008 1 次提交
    • J
      mac80211: make master netdev handling sane · 3e122be0
      Johannes Berg 提交于
      Currently, almost every interface type has a 'bss' pointer
      pointing to BSS information. This BSS information, however,
      is for a _local_ BSS, not for the BSS we joined, so having
      it on a STA mode interface makes little sense, but now they
      have it pointing to the master device, which is an AP mode
      virtual interface. However, except for some bitrate control
      data, this pointer is only used in AP/VLAN modes (for power
      saving stations.)
      
      Overall, it is not necessary to even have the master netdev
      be a valid virtual interface, and it doesn't have to be on
      the list of interfaces either.
      
      This patch changes the master netdev to be special, it now
       - no longer is on the list of virtual interfaces, which
         lets me remove a lot of tests for that
       - no longer has sub_if_data attached, since that isn't used
      
      Additionally, this patch changes some vlan/ap mode handling
      that is related to these 'bss' pointers described above (but
      in the VLAN case they actually make sense because there they
      point to the AP they belong to); it also adds some debugging
      code to IEEE80211_DEV_TO_SUB_IF to validate it is not called
      on the master netdev any more.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3e122be0
  28. 09 7月, 2008 1 次提交
  29. 03 7月, 2008 1 次提交
  30. 27 6月, 2008 1 次提交