1. 15 6月, 2010 1 次提交
  2. 08 5月, 2010 1 次提交
  3. 28 4月, 2010 1 次提交
    • S
      mac80211: fix rts threshold check · a2c40249
      Shanyu Zhao 提交于
      Currently whenever rts thresold is set, every packet will use RTS
      protection no matter its size exceeds the threshold or not. This is
      due to a bug in the rts threshold check.
      	if (len > tx->local->hw.wiphy->rts_threshold) {
      		txrc.rts = rts = true;
      	}
      Basically it is comparing an int (len) and a u32 (rts_threshold),
      and the variable len is assigned as:
      	len = min_t(int, tx->skb->len + FCS_LEN,
      			 tx->local->hw.wiphy->frag_threshold);
      However, when frag_threshold is "-1", len is always "-1", which is
      0xffffffff therefore rts is always set to true.
      
      CC: stable@kernel.org
      Signed-off-by: NShanyu Zhao <shanyu.zhao@intel.com>
      Reviewed-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a2c40249
  4. 20 4月, 2010 1 次提交
  5. 08 4月, 2010 1 次提交
  6. 01 4月, 2010 1 次提交
    • J
      mac80211: Fix BIP to be used only with group-addressed frames · ecbcd324
      Jouni Malinen 提交于
      BIP (part of IEEE 802.11w) is only supposed to be used with
      group-addressed frames. We ended up picking it as a default mechanism
      for every management whenever we did not have a STA entry for the
      destination (e.g., for Probe Response to a STA that is not
      associated). While the extra MMIE in the end of management frames
      should not break frames completed in most cases, there is no point in
      doing this. Fix key selection to pick the default management key only
      if the frame is sent to multicast/broadcast address and the frame is a
      robust management frame.
      Signed-off-by: NJouni Malinen <j@w1.fi>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      ecbcd324
  7. 31 3月, 2010 1 次提交
    • J
      mac80211: move netdev queue enabling to correct spot · 7236fe29
      Johannes Berg 提交于
      "mac80211: fix skb buffering issue" still left a race
      between enabling the hardware queues and the virtual
      interface queues. In hindsight it's totally obvious
      that enabling the netdev queues for a hardware queue
      when the hardware queue is enabled is wrong, because
      it could well possible that we can fill the hw queue
      with packets we already have pending. Thus, we must
      only enable the netdev queues once all the pending
      packets have been processed and sent off to the device.
      
      In testing, I haven't been able to trigger this race
      condition, but it's clearly there, possibly only when
      aggregation is being enabled.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Cc: stable@kernel.org
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7236fe29
  8. 25 3月, 2010 1 次提交
  9. 09 2月, 2010 2 次提交
    • 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
    • J
      wireless: update radiotap parser · 33e5a2f7
      Johannes Berg 提交于
      Upstream radiotap has adopted the namespace
      proposal David Young made and I then took care
      of, for which I had adapted the radiotap parser
      as a library outside the kernel. This brings
      the in-kernel parser up to speed.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      33e5a2f7
  10. 02 2月, 2010 2 次提交
  11. 26 1月, 2010 1 次提交
    • J
      mac80211: fix sw crypto · 382b1655
      Johannes Berg 提交于
      What a stupid mistake. In
      
          commit 813d7669
          Author: Johannes Berg <johannes@sipsolutions.net>
          Date:   Sun Jan 17 01:47:58 2010 +0100
      
              mac80211: move control.hw_key assignment
      
      I inserted code testing the wrong flags field,
      which means that the test is almost always true
      (it's really testing for the peer's WMM support)
      and thus the later parts of the stack assume hw
      crypto will be done even if that's not true.
      
      Obviously, that broke software crypto. Maxim
      said so specifically, and Jochen probably uses
      some cipher that iwl3945 doesn't support in
      hardware, which might also explain that Maxim
      reports that even hw crypto is broken.
      
      Fix this to test the right flags field.
      Reported-by: NMaxim Levitsky <maximlevitsky@gmail.com>
      Reported-by: NJochen Friedrich <jochen@scram.de>
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      382b1655
  12. 24 1月, 2010 1 次提交
  13. 23 1月, 2010 1 次提交
  14. 20 1月, 2010 4 次提交
  15. 13 1月, 2010 7 次提交
    • K
      mac80211: check uapsd state for dynamic power save · 0c74211d
      Kalle Valo 提交于
      To make U-APSD client mode effective, we must not wake up from dynamic power
      save when transmitting frames. So if dynamic power save is enabled, it needs
      check the queue the transmitted packet is in and decide if we need to wake
      up or not.
      
      In a perfect world, where all packets would have correct QoS tags, U-APSD
      enabled queues should not trigger wakeup from power save. But in the real
      world, where very few packets have correct QoS tags, this won't work. For
      example, if only voip class has U-APSD enabled and we send a packet in voip
      class, but the packets we receive are in best effort class, we would receive
      the packets with the legacy power save method. And that would increase
      latencies too much from a voip application point of view.
      
      The workaround is to enable U-APSD for all qeueus and still use dynamic ps
      wakeup for all other queues except voip. That way we can still save power
      with a voip application and not sacrifice latency. Normal traffic (in
      background, best effort or video class) would still trigger wakeup from
      dynamic power save.
      Signed-off-by: NKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0c74211d
    • K
      mac80211: create tx handler for dynamic ps · 5c1b98a5
      Kalle Valo 提交于
      Currently dynamic ps check is in ieee80211_xmit(), but it's cleaner
      to have a separate tx handler for this. Also this is a prerequisite for
      U-APSD client mode which needs to know the queue frame is in.
      
      Also need_dynamic_ps() function is embedded to the tx handler.
      
      No functional changes expect that the code is run in a later phase than
      originally.
      Signed-off-by: NKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      5c1b98a5
    • F
      mac80211: do not transmit frames on unconfigured 4-addr vlan interfaces · 3f0e0b22
      Felix Fietkau 提交于
      If frames are transmitted on 4-addr ap vlan interfaces with no station,
      they end up being transmitted unencrypted, even if the ap interface
      uses WPA. This patch add some sanity checking to make sure that this
      does not happen.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      Cc: stable@kernel.org
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3f0e0b22
    • K
      mac80211: create Probe Request template · 05e54ea6
      Kalle Valo 提交于
      Certain type of hardware, for example wl1251 and wl1271, need a template
      for the Probe Request. Create a function ieee80211_probereq_get() which
      creates the template and drivers send it to hardware.
      Signed-off-by: NKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      05e54ea6
    • K
      mac80211: add functions to create PS Poll and Nullfunc templates · 7044cc56
      Kalle Valo 提交于
      Some hardware, for example wl1251 and wl1271, handle the transmission
      of power save related frames in hardware, but the driver is responsible
      for creating the templates. It's better to create the templates in mac80211,
      that way all drivers can benefit from this.
      
      Add two new functions, ieee80211_pspoll_get() and ieee80211_nullfunc_get()
      which drivers need to call to get the frame. Drivers are also responsible
      for updating the templates after each association.
      
      Also new struct ieee80211_hdr_3addr is added to ieee80211.h to make it
      easy to calculate length of the Nullfunc frame.
      Signed-off-by: NKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      7044cc56
    • J
      cfg80211/mac80211: Use more generic bitrate mask for rate control · 37eb0b16
      Jouni Malinen 提交于
      Extend struct cfg80211_bitrate_mask to actually use a bitfield mask
      instead of just a single fixed or maximum rate index. This change
      itself does not modify the behavior (except for debugfs files), but it
      prepares cfg80211 and mac80211 for a new nl80211 command for setting
      which rates can be used in TX rate control.
      
      Since frames are now going through the rate control algorithm
      unconditionally, the internal IEEE80211_TX_INTFL_RCALGO flag can now
      be removed. The RC implementations can use the rate_idx_mask value to
      optimize their behavior if only a single rate is enabled.
      
      The old max_rate_idx in struct ieee80211_tx_rate_control is maintained
      (but commented as deprecated) for backwards compatibility with existing
      RC implementations. Once these implementations have been updated to
      use the more generic rate_idx_mask, the max_rate_idx value can be
      removed.
      Signed-off-by: NJouni Malinen <jouni.malinen@atheros.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      37eb0b16
    • 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
  16. 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
  17. 29 12月, 2009 2 次提交
  18. 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
  19. 30 11月, 2009 1 次提交
  20. 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
  21. 19 11月, 2009 4 次提交
  22. 14 11月, 2009 1 次提交
  23. 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