1. 13 1月, 2010 1 次提交
    • J
      mac80211: Select lowest rate based on basic rate set in AP mode · e00cfce0
      Jouni Malinen 提交于
      If the basic rate set is configured to not include the lowest rate
      (e.g., basic rate set = 6, 12, 24 Mbps in IEEE 802.11g mode), the AP
      should not send out broadcast frames at 1 Mbps. This type of
      configuration can be used to optimize channel usage in cases where
      there is no need for backwards compatibility with IEEE 802.11b-only
      devices.
      
      In AP mode, mac80211 was unconditionally using the lowest rate for
      Beacon frames and similarly, with all rate control algorithms that use
      rate_control_send_low(), the lowest rate ended up being used for all
      broadcast frames (and all unicast frames that are sent before
      association). Change this to take into account the basic rate
      configuration in AP mode, i.e., use the lowest rate in the basic rate
      set instead of the lowest supported rate when selecting the rate.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e00cfce0
  2. 06 1月, 2010 1 次提交
    • J
      mac80211: fix skb buffering issue · cf0277e7
      Johannes Berg 提交于
      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: NLennert Buytenhek <buytenh@marvell.com>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Cc: stable@kernel.org [2.6.32]
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      cf0277e7
  3. 29 12月, 2009 2 次提交
  4. 22 12月, 2009 2 次提交
    • J
      mac80211: reduce reliance on netdev · 47846c9b
      Johannes Berg 提交于
      For bluetooth 3, we will most likely not have
      a netdev for a virtual interface (sdata), so
      prepare for that by reducing the reliance on
      having a netdev. This patch moves the name
      and address fields into the sdata struct and
      uses them from there all over. Some work is
      needed to keep them sync'ed, but that's not
      a lot of work and in slow paths anyway.
      
      In doing so, this also reduces the number of
      pointer dereferences in many places, because
      of things like sdata->dev->dev_addr becoming
      sdata->vif.addr.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      47846c9b
    • J
      mac80211: make station management completely depend on vif · abe60632
      Johannes Berg 提交于
      The station management currently uses the virtual
      interface, but you cannot add the same station to
      multiple virtual interfaces if you're communicating
      with it in multiple ways.
      
      This restriction should be lifted so that in the
      future we can, for instance, support bluetooth 3
      with an access point that mac80211 is already
      associated to.
      
      We can do that by requiring all sta_info_get users
      to provide the virtual interface and making the RX
      code aware that an address may match more than one
      station struct. Thanks to the previous patches this
      one isn't all that large and except for the RX and
      TX status paths changes has low complexity.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      abe60632
  5. 30 11月, 2009 1 次提交
  6. 20 11月, 2009 2 次提交
    • J
      mac80211: request TX status where needed · 7351c6bd
      Johannes Berg 提交于
      Right now all frames mac80211 hands to the driver
      have the IEEE80211_TX_CTL_REQ_TX_STATUS flag set to
      request TX status. This isn't really necessary, only
      the injected frames need TX status (the latter for
      hostapd) so move setting this flag.
      
      The rate control algorithms also need TX status, but
      they don't require it.
      
      Also, rt2x00 uses that bit for its own purposes and
      seems to require it being set for all frames, but
      that can be fixed in rt2x00.
      
      This doesn't really change anything for any drivers
      but in the future drivers using hw-rate control may
      opt to not report TX status for frames that don't
      have the IEEE80211_TX_CTL_REQ_TX_STATUS flag set.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Acked-by: Ivo van Doorn <IvDoorn@gmail.com> [rt2x00 bits]
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7351c6bd
    • J
      cfg80211: introduce capability for 4addr mode · 9bc383de
      Johannes Berg 提交于
      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: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      9bc383de
  7. 19 11月, 2009 4 次提交
  8. 14 11月, 2009 1 次提交
  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. 03 11月, 2009 1 次提交
  12. 31 10月, 2009 4 次提交
  13. 28 10月, 2009 1 次提交
  14. 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
  15. 30 9月, 2009 1 次提交
    • I
      mac80211: Fix [re]association power saving issue on AP side · 1f08e84f
      Igor Perminov 提交于
      Consider the following step-by step:
      1. A STA authenticates and associates with the AP and exchanges
      traffic.
      2. The STA reports to the AP that it is going to PS state.
      3. Some time later the STA device goes to the stand-by mode (not only
      its wi-fi card, but the device itself) and drops the association state
      without sending a disassociation frame.
      4. The STA device wakes up and begins authentication with an
      Auth frame as it hasn't been authenticated/associated previously.
      
      At the step 4 the AP "remembers" the STA and considers it is still in
      the PS state, so the AP buffers frames, which it has to send to the STA.
      But the STA isn't actually in the PS state and so it neither checks
      TIM bits nor reports to the AP that it isn't power saving.
      Because of that authentication/[re]association fails.
      
      To fix authentication/[re]association stage of this issue, Auth, Assoc
      Resp and Reassoc Resp frames are transmitted disregarding of STA's power
      saving state.
      
      N.B. This patch doesn't fix further data frame exchange after
      authentication/[re]association. A patch in hostapd is required to fix
      that.
      Signed-off-by: NIgor Perminov <igor.perminov@inbox.ru>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      1f08e84f
  16. 01 9月, 2009 1 次提交
  17. 14 8月, 2009 6 次提交
  18. 05 8月, 2009 1 次提交
    • L
      mac80211: redefine usage of the mac80211 workqueue · 42935eca
      Luis R. Rodriguez 提交于
      The mac80211 workqueue exists to enable mac80211 and drivers
      to queue their own work on a single threaded workqueue. mac80211
      takes care to flush the workqueue during suspend but we never
      really had requirements on drivers for how they should use
      the workqueue in consideration for suspend.
      
      We extend mac80211 to document how the mac80211 workqueue should
      be used, how it should not be used and finally move raw access to
      the workqueue to mac80211 only. Drivers and mac80211 use helpers
      to queue work onto the mac80211 workqueue:
      
        * ieee80211_queue_work()
        * ieee80211_queue_delayed_work()
      
      These helpers will now warn if mac80211 already completed its
      suspend cycle and someone is trying to queue work. mac80211
      flushes the mac80211 workqueue prior to suspend a few times,
      but we haven't taken the care to ensure drivers won't add more
      work after suspend. To help with this we add a warning when
      someone tries to add work and mac80211 already completed the
      suspend cycle.
      
      Drivers should ensure they cancel any work or delayed work
      in the mac80211 stop() callback.
      Signed-off-by: NLuis R. Rodriguez <lrodriguez@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      42935eca
  19. 30 7月, 2009 1 次提交
    • J
      mac80211: verify info->control.vif is not NULL · a7bc376c
      Johannes Berg 提交于
      When enqueuing packets on the internal packet queue, we
      need to ensure that we have a valid vif pointer since
      that is required since the net namespace work. Add some
      assertions to verify this, but also don't crash is for
      some reason we don't end up with a vif pointer -- warn
      and drop the packet in all these cases.
      
      Since this code touches a number of hotpaths, it is
      intended to be temporary, or maybe configurable in the
      future, at least the bit that is in the path that gets
      hit for every packet, ieee80211_tx_pending().
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a7bc376c
  20. 28 7月, 2009 5 次提交
  21. 25 7月, 2009 2 次提交