1. 15 6月, 2010 4 次提交
    • J
      mac80211: use common work function · 1fa57d01
      Johannes Berg 提交于
      Even with the previous patch, IBSS, managed
      and mesh modes all attach their own work
      function to the shared work struct, which
      means some duplicated code. Change that to
      only have a frame processing function and a
      further work function for each of them and
      share some common code.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      1fa57d01
    • J
      mac80211: use common work struct · 64592c8f
      Johannes Berg 提交于
      IBSS, managed and mesh modes all have their
      own work struct, and in the future we want
      to also use it in other modes to process
      frames from the now common skb queue.
      
      This also makes the skb queue and work safe
      to use from other interface types.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      64592c8f
    • J
      mac80211: use common skb queue · 35f20c14
      Johannes Berg 提交于
      IBSS, managed and mesh modes all have an
      skb queue, and in the future we want to
      also use it in other modes, so make them
      all use a common skb queue already.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      35f20c14
    • J
      mac80211: simplify station/aggregation code · 2a419056
      Johannes Berg 提交于
      A number of places use RCU locking for accessing
      the station list, even though they do not need
      to. Use mutex locking instead to prepare for the
      locking changes I want to make. The mlme code is
      also using a WLAN_STA_DISASSOC flag that has the
      same meaning as WLAN_STA_BLOCK_BA, so use that.
      
      While doing so, combine places where we loop
      over stations twice, and optimise away some of
      the loops by checking if the hardware supports
      aggregation at all first.
      
      Also fix a more theoretical race condition: right
      now we could resume, set up an aggregation session,
      and right after tear it down again due to the code
      that is needed for hardware reconfiguration here.
      Also mark add a comment to that code marking it as
      a workaround.
      
      Finally, remove a pointless aggregation disabling
      loop when an interface is stopped, directly after
      that we remove all stations from it which will also
      disable all aggregation sessions that may still be
      active, and does so in a race-free way unlike the
      current loop that doesn't block new sessions.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      2a419056
  2. 04 6月, 2010 2 次提交
  3. 04 4月, 2010 1 次提交
    • J
      net: convert multicast list to list_head · 22bedad3
      Jiri Pirko 提交于
      Converts the list and the core manipulating with it to be the same as uc_list.
      
      +uses two functions for adding/removing mc address (normal and "global"
       variant) instead of a function parameter.
      +removes dev_mcast.c completely.
      +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
       manipulation with lists on a sandbox (used in bonding and 80211 drivers)
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22bedad3
  4. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  5. 24 3月, 2010 1 次提交
  6. 10 3月, 2010 1 次提交
  7. 16 2月, 2010 1 次提交
  8. 15 2月, 2010 1 次提交
    • D
      mac80211: Fix error introduced in netdev_mc_count() changes. · 228da6c2
      David S. Miller 提交于
      Commit 4cd24eaf
      ("net: use netdev_mc_count and netdev_mc_empty when appropriate")
      added this hunk to net/mac80211/iface.c:
      
       	__dev_addr_unsync(&local->mc_list, &local->mc_count,
      -			  &dev->mc_list, &dev->mc_count);
      +			  &dev->mc_list, dev->mc_count);
      
      which is definitely not correct, introduced a warning (reported
      by Stephen Rothwell):
      
      net/mac80211/iface.c: In function 'ieee80211_stop':
      net/mac80211/iface.c:416: warning: passing argument 4 of '__dev_addr_unsync' makes pointer from integer without a cast
      include/linux/netdevice.h:1967: note: expected 'int *' but argument is of type 'int'
      
      and is thus reverted here.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      228da6c2
  9. 13 2月, 2010 1 次提交
  10. 20 1月, 2010 1 次提交
  11. 13 1月, 2010 1 次提交
    • 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
  12. 12 1月, 2010 1 次提交
    • F
      mac80211: fix queue selection for data frames on monitor interfaces · 193e70ef
      Felix Fietkau 提交于
      When ieee80211_monitor_select_queue encounters data frames, it selects
      the WMM AC based on skb->priority and assumes that skb->priority
      contains a valid 802.1d tag. However this assumption is incorrect, since
      ieee80211_select_queue has not been called at this point.
      If skb->priority > 7, an array overrun occurs, which could lead to
      invalid values, resulting in crashes in the tx path.
      Fix this by setting skb->priority based on the 802.11 header for QoS
      frames and using the default AC for all non-QoS frames.
      Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      193e70ef
  13. 09 1月, 2010 2 次提交
  14. 07 1月, 2010 1 次提交
  15. 06 1月, 2010 2 次提交
    • K
      mac80211: fix ieee80211_change_mac() to use struct sockaddr · fc5f7577
      Kalle Valo 提交于
      Setting the mac address from user space was buggy. For example, when
      executing this command:
      
      ip link set wlan0 address 00:1f:df:88:cd:55
      
      mac80211 used the address 01:00:00:1f:df:88 instead. It was shifted two
      bytes.
      
      The reason was that the addr (type of void *) provided to
      ieee80211_change_mac() is actually of type struct sockaddr, not just the
      mac address array. Also the call to eth_mac_addr() expects the address to
      be struct sockaddr.
      Signed-off-by: NKalle Valo <kalle.valo@nokia.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      fc5f7577
    • 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
  16. 29 12月, 2009 4 次提交
  17. 22 12月, 2009 1 次提交
    • 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
  18. 26 11月, 2009 1 次提交
  19. 20 11月, 2009 1 次提交
    • 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
  20. 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
  21. 31 10月, 2009 1 次提交
    • J
      mac80211: remove RX_FLAG_RADIOTAP · 0869aea0
      Johannes Berg 提交于
      While there may be a case for a driver adding its
      own bits of radiotap information, none currently
      does. Also, drivers would have to copy the code
      to generate the radiotap bits that now mac80211
      generates. If some driver in the future needs to
      add some driver-specific information I'd expect
      that to be in a radiotap vendor namespace and we
      can add a different way of passing such data up
      and having mac80211 include it.
      
      Additionally, rename IEEE80211_CONF_RADIOTAP to
      IEEE80211_CONF_MONITOR since it's still used by
      b43(legacy) to obtain per-frame timestamps.
      
      The purpose of this patch is to simplify the RX
      code in mac80211 to make it easier to add paged
      skb support.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      0869aea0
  22. 28 10月, 2009 1 次提交
  23. 08 10月, 2009 1 次提交
  24. 05 10月, 2009 1 次提交
  25. 12 9月, 2009 1 次提交
    • M
      net: Add DEVTYPE support for Ethernet based devices · 384912ed
      Marcel Holtmann 提交于
      The Ethernet framing is used for a lot of devices these days. Most
      prominent are WiFi and WiMAX based devices. However for userspace
      application it is important to classify these devices correctly and
      not only see them as Ethernet devices. The daemons like HAL, DeviceKit
      or even NetworkManager with udev support tries to do the classification
      in userspace with a lot trickery and extra system calls. This is not
      good and actually reaches its limitations. Especially since the kernel
      does know the type of the Ethernet device it is pretty stupid.
      
      To solve this problem the underlying device type needs to be set and
      then the value will be exported as DEVTYPE via uevents and available
      within udev.
      
        # cat /sys/class/net/wlan0/uevent
        DEVTYPE=wlan
        INTERFACE=wlan0
        IFINDEX=5
      
      This is similar to subsystems like USB and SCSI that distinguish
      between hosts, devices, disks, partitions etc.
      
      The new SET_NETDEV_DEVTYPE() is a convenience helper to set the actual
      device type. All device types are free form, but for convenience the
      same strings as used with RFKILL are choosen.
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      384912ed
  26. 29 8月, 2009 3 次提交
  27. 20 8月, 2009 1 次提交
    • J
      mac80211: allow configure_filter callback to sleep · 3ac64bee
      Johannes Berg 提交于
      Over time, a whole bunch of drivers have come up
      with their own scheme to delay the configure_filter
      operation to a workqueue. To be able to simplify
      things, allow configure_filter to sleep, and add
      a new prepare_multicast callback that drivers that
      need the multicast address list implement. This new
      callback must be atomic, but most drivers either
      don't care or just calculate a hash which can be
      done atomically and then uploaded to the hardware
      non-atomically.
      
      A cursory look suggests that at76c50x-usb, ar9170,
      mwl8k (which is actually very broken now), rt2x00,
      wl1251, wl1271 and zd1211 should make use of this
      new capability.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      3ac64bee
  28. 05 8月, 2009 2 次提交
    • I
      mac80211: FIF_PSPOLL filter flag · e3b90ca2
      Igor Perminov 提交于
      When an interface is configured in the AP mode, the mac80211
      implementation doesn't inform the driver to receive PS Poll frames.
      It leads to inability to communicate with power-saving stations
      reliably.
      The FIF_CONTROL flag isn't passed by mac80211 to
      ieee80211_ops.configure_filter when an interface is in the AP mode.
      And it's ok, because we don't want to receive ACK frames and other
      control ones, but only PS Poll ones.
      
      This patch introduces the FIF_PSPOLL filter flag in addition to
      FIF_CONTROL, which means for the driver "pass PS Poll frames".
      
      This flag is passed to the driver:
      A) When an interface is configured in the AP mode.
      B) In all cases, when the FIF_CONTROL flag was passed earlier (in
      addition to it).
      Signed-off-by: NIgor Perminov <igor.perminov@inbox.ru>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      e3b90ca2
    • 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