1. 08 Feb, 2010 1 commit
    • Johannes Berg's avatar
      mac80211: allow station add/remove to sleep · 34e89507
      Johannes Berg authored
      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
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
  2. 01 Feb, 2010 1 commit
  3. 22 Jan, 2010 1 commit
    • Felix Fietkau's avatar
      mac80211: fix rx data handling for non-data frames on multiple vifs · 4bb29f8c
      Felix Fietkau authored
      The loop that passes non-data frames to all relevant vifs inside the
      __ieee80211_rx_handle_packet keeps a pointer to the previous sdata to
      avoid having to make unnecessary copies of the frame it's handling.
      This led to a bug that caused it to apply the ieee80211_rx_data state
      to the wrong interface, thereby either missing the rx.sta pointer or
      having it assigned where it shouldn't be.
      This breaks (among other things) aggregation on some vifs, as action
      frame exchages are dropped to the cooked monitor interface due to
      rx->sta being NULL.
      Fix this by restructuring the loop so that it prepares the rx data just
      before making the skb copy and calling the rx handlers.
      Cc: stable@kernel.org
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
  4. 12 Jan, 2010 1 commit
  5. 08 Jan, 2010 1 commit
  6. 05 Jan, 2010 1 commit
    • Johannes Berg's avatar
      mac80211: fix skb buffering issue · cf0277e7
      Johannes Berg authored
      Since I removed the master netdev, we've been
      keeping internal queues only, and even before
      that we never told the networking stack above
      the virtual interfaces about congestion. This
      means that packets are queued in mac80211 and
      the upper layers never know, possibly leading
      to memory exhaustion and other problems.
      This patch makes all interfaces multiqueue and
      uses ndo_select_queue to put the packets into
      queues per AC. Additionally, when the driver
      stops a queue, we now stop all corresponding
      queues for the virtual interfaces as well.
      The injection case will use VO by default for
      non-data frames, and BE for data frames, but
      downgrade any data frames according to ACM. It
      needs to be fleshed out in the future to allow
      chosing the queue/AC in radiotap.
      Reported-by: default avatarLennert Buytenhek <buytenh@marvell.com>
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: stable@kernel.org [2.6.32]
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
  7. 28 Dec, 2009 2 commits
    • Johannes Berg's avatar
      mac80211: generalise work handling · af6b6374
      Johannes Berg authored
      In order to use auth/assoc for different purposes
      other than MLME, it needs to be split up. For other
      purposes, a generic work handling (potentially on
      another channel) will be useful.
      To achieve that, this patch moves much of the MLME
      work handling out of mlme into a new work API. The
      API can currently handle probing a specific AP,
      authentication and association. The MLME previously
      handled probe/authentication as one step and will
      continue to do so, but they are separate in the new
      work handling.
      Work items are RCU-managed to be able to check for
      existence of an item for a specific frame in the RX
      path, but they can be re-used which the MLME right
      now will do for its combined probe/auth step.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
    • Johannes Berg's avatar
      mac80211: add ieee80211_sdata_running · 9607e6b6
      Johannes Berg authored
      Instead of always using netif_running(sdata->dev)
      use ieee80211_sdata_running(sdata) now which is
      just an inline containing netif_running() for now.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
  8. 22 Dec, 2009 1 commit
  9. 21 Dec, 2009 4 commits
  10. 10 Dec, 2009 1 commit
  11. 04 Dec, 2009 1 commit
  12. 29 Nov, 2009 1 commit
  13. 28 Nov, 2009 3 commits
  14. 19 Nov, 2009 1 commit
    • Johannes Berg's avatar
      cfg80211: introduce capability for 4addr mode · 9bc383de
      Johannes Berg authored
      It's very likely that not many devices will support
      four-address mode in station or AP mode so introduce
      capability bits for both modes, set them in mac80211
      and check them when userspace tries to use the mode.
      Also, keep track of 4addr in cfg80211 (wireless_dev)
      and not in mac80211 any more. mac80211 can also be
      improved for the VLAN case by not looking at the
      4addr flag but maintaining the station pointer for
      it correctly. However, keep track of use_4addr for
      station mode in mac80211 to avoid all the derefs.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
  15. 18 Nov, 2009 5 commits
  16. 13 Nov, 2009 1 commit
  17. 11 Nov, 2009 3 commits
  18. 06 Nov, 2009 1 commit
    • Johannes Berg's avatar
      mac80211: async station powersave handling · af818581
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
  19. 30 Oct, 2009 6 commits
  20. 27 Oct, 2009 1 commit
  21. 12 Oct, 2009 1 commit
    • Johannes Berg's avatar
      mac80211: document ieee80211_rx() context requirement · d20ef63d
      Johannes Berg authored
      ieee80211_rx() must be called with softirqs disabled
      since the networking stack requires this for netif_rx()
      and some code in mac80211 can assume that it can not
      be processing its own tasklet and this call at the same
      It may be possible to remove this requirement after a
      careful audit of mac80211 and doing any needed locking
      improvements in it along with disabling softirqs around
      netif_rx(). An alternative might be to push all packet
      processing to process context in mac80211, instead of
      to the tasklet, and add other synchronisation.
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
  22. 07 Oct, 2009 1 commit
    • Johannes Berg's avatar
      mac80211: fix vlan and optimise RX · fbc44bf7
      Johannes Berg authored
      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: default avatarJohannes Berg <johannes@sipsolutions.net>
      Cc: stable@kernel.org
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
  23. 28 Aug, 2009 1 commit