12 Mar, 2011

1 commit


26 Feb, 2011

1 commit

  • For devices supported by iwlwifi sometimes
    off-channel transmissions need to be handled
    by the device completely. To support this
    mac80211 needs to pass the frame directly
    to the driver and not through the TX path
    as the driver needs the frame and channel
    information at the same time.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

27 Jan, 2011

1 commit

  • For events that include only the local struct as
    their parameter, we can use DECLARE_EVENT_CLASS
    and save quite some binary size across segments
    as well lines of code.

    text data bss dec hex filename
    375745 19296 916 395957 60ab5 mac80211.ko.before
    367473 17888 916 386277 5e4e5 mac80211.ko.after
    -8272 -1408 0 -9680 -25d0 delta

    Some more tracepoints with identical arguments
    could be combined like this but for now this is
    the one that benefits most.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

20 Jan, 2011

1 commit

  • The aggregation code currently doesn't implement the
    buffer size negotiation. It will always request a max
    buffer size (which is fine, if a little pointless, as
    the mac80211 code doesn't know and might just use 0
    instead), but if the peer requests a smaller size it
    isn't possible to honour this request.

    In order to fix this, look at the buffer size in the
    addBA response frame, keep track of it and pass it to
    the driver in the ampdu_action callback when called
    with the IEEE80211_AMPDU_TX_OPERATIONAL action. That
    way the driver can limit the number of subframes in
    aggregates appropriately.

    Note that this doesn't fix any drivers apart from the
    addition of the new argument -- they all need to be
    updated separately to use this variable!

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

06 Jan, 2011

1 commit


17 Nov, 2010

2 commits

  • Allow antenna configuration by calling driver's function for it.

    We disallow antenna configuration if the wiphy is already running, mainly to
    make life easier for 802.11n drivers which need to recalculate HT capabilites.

    Signed-off-by: Bruno Randolf
    Signed-off-by: John W. Linville

    Bruno Randolf
     
  • The lower driver is notified when the fragmentation threshold changes
    and upon a reconfig of the interface.

    If the driver supports hardware TX fragmentation, don't fragment
    packets in the stack.

    Signed-off-by: Arik Nemtsov
    Signed-off-by: John W. Linville

    Arik Nemtsov
     

17 Sep, 2010

1 commit

  • When a driver advertises p2p device support,
    mac80211 will handle it, but internally it will
    rewrite the interface type to STA/AP rather than
    P2P-STA/GO since otherwise a lot of paths need
    to be touched that are otherwise identical. A
    p2p boolean tells drivers whether or not a given
    interface will be used for p2p or not.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

28 Aug, 2010

1 commit

  • Add support to mac80211 for changing the interface
    type even when the interface is UP, if the driver
    supports it.

    To achieve this
    * add a new driver callback for switching,
    * split some of the interface up/down code out
    into new functions (do_open/do_stop), and
    * maintain an own __SDATA_RUNNING bit that will
    not be set during interface type, so that any
    other code doesn't use the interface.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

17 Aug, 2010

1 commit

  • Currently, mac80211 translates the cfg80211
    cipher suite selectors into ALG_* values.
    That isn't all too useful, and some drivers
    benefit from the distinction between WEP40
    and WEP104 as well. Therefore, convert it
    all to use the cipher suite selectors.

    Signed-off-by: Johannes Berg
    Acked-by: Gertjan van Wingerde
    Signed-off-by: John W. Linville

    Johannes Berg
     

30 Jun, 2010

1 commit


15 Jun, 2010

2 commits

  • There is a circular locking dependency when configuring the
    hardware ARP filters on association, occurring when flushing the mac80211
    workqueue. This is what happens:

    [ 92.026800] =======================================================
    [ 92.030507] [ INFO: possible circular locking dependency detected ]
    [ 92.030507] 2.6.34-04781-g2b2c009 #85
    [ 92.030507] -------------------------------------------------------
    [ 92.030507] modprobe/5225 is trying to acquire lock:
    [ 92.030507] ((wiphy_name(local->hw.wiphy))){+.+.+.}, at: [] flush_workq
    ueue+0x0/0xb0
    [ 92.030507]
    [ 92.030507] but task is already holding lock:
    [ 92.030507] (rtnl_mutex){+.+.+.}, at: [] rtnl_lock+0x12/0x20
    [ 92.030507]
    [ 92.030507] which lock already depends on the new lock.
    [ 92.030507]
    [ 92.030507]
    [ 92.030507] the existing dependency chain (in reverse order) is:
    [ 92.030507]
    [ 92.030507] -> #2 (rtnl_mutex){+.+.+.}:
    [ 92.030507] [] lock_acquire+0xdb/0x110
    [ 92.030507] [] mutex_lock_nested+0x44/0x300
    [ 92.030507] [] rtnl_lock+0x12/0x20
    [ 92.030507] [] ieee80211_assoc_done+0x6c/0xe0 [mac80211]
    [ 92.030507] [] ieee80211_work_work+0x31d/0x1280 [mac80211]

    [ 92.030507] -> #1 ((&local->work_work)){+.+.+.}:
    [ 92.030507] [] lock_acquire+0xdb/0x110
    [ 92.030507] [] worker_thread+0x22a/0x370
    [ 92.030507] [] kthread+0x96/0xb0
    [ 92.030507] [] kernel_thread_helper+0x4/0x10
    [ 92.030507]
    [ 92.030507] -> #0 ((wiphy_name(local->hw.wiphy))){+.+.+.}:
    [ 92.030507] [] __lock_acquire+0x1c0c/0x1d50
    [ 92.030507] [] lock_acquire+0xdb/0x110
    [ 92.030507] [] flush_workqueue+0x4e/0xb0
    [ 92.030507] [] ieee80211_stop_device+0x2b/0xb0 [mac80211]
    [ 92.030507] [] ieee80211_stop+0x3e5/0x680 [mac80211]

    The locking in this case is quite complex. Fix the problem by rewriting the
    way the hardware ARP filter list is handled - i.e. make a copy of the address
    list to the bss_conf struct, and provide that list to the hardware driver
    when needed.

    The current patch will enable filtering also in promiscuous mode. This may need
    to be changed in the future.

    Reported-by: Reinette Chatre
    Signed-off-by: Juuso Oikarinen
    Signed-off-by: John W. Linville

    Juuso Oikarinen
     
  • Currently, driver tracing is sometimes invoked
    after and sometimes before the actual driver
    callback. This is fine as long as the driver
    has no tracing itself, but as soon as it does
    it gets confusing.

    To make traces containing such information
    easier to read, introduce a return tracer in
    mac80211 that essentially brackets any driver
    tracing, and invoke the real trace before the
    driver's callback, only showing the return
    value, if any, afterwards.

    Since tracing records the process, there's no
    problem with overlapping calls if that should
    happen.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

04 Jun, 2010

2 commits

  • There's no sense in letting anything but internal
    mac80211 functions set the initiator to anything
    but WLAN_BACK_INITIATOR, since WLAN_BACK_RECIPIENT
    is only valid when we have received a frame from
    the peer, which we react to directly in mac80211.

    The debugfs code I recently added got this wrong
    as well.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • Some hardware allow extended filtering of ARP frames not intended for
    the host. To perform such filtering, the hardware needs to know the current
    IP address(es) of the host, bound to its interface.

    Add support for ARP filtering to mac80211 by adding a new op to the driver
    interface, allowing to configure the current IP addresses. This op is called
    upon association with the currently configured address(es), and when
    associated whenever the IP address(es) change.

    This patch adds configuration of IPv4 addresses only, as IPv6 addresses don't
    need ARP filtering.

    Signed-off-by: Juuso Oikarinen
    Reviewed-by: Johannes Berg
    Signed-off-by: John W. Linville

    Juuso Oikarinen
     

13 May, 2010

1 commit

  • This adds support for offloading the channel switch
    operation to devices that support such, typically
    by having specific firmware API for it. The reasons
    for this could be that the firmware provides better
    timing or that regulatory enforcement done by the
    device requires special handling of CSAs.

    In order to allow drivers to specify the timing to
    the device, the new channel_switch callback will
    pass through the received frame's mactime, where
    available.

    Signed-off-by: Wey-Yi Guy
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

28 Apr, 2010

1 commit

  • When scanning, it is somewhat important to scan
    on the correct virtual interface. All drivers
    that currently implement hw_scan only support a
    single virtual interface, but that may change
    and then we'd want to be ready.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

09 Apr, 2010

1 commit

  • Enhance tracing by adding tracing for a variety of
    callbacks that the drivers call, and also for
    internal calls (currently limited to queue status).
    This can aid debugging what is going on in mac80211
    in interaction with drivers, since we can now see
    what drivers call and not just what mac80211 calls
    in the driver.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

09 Feb, 2010

3 commits

  • get_tx_stats() driver operation is not currently used anywhere in mac80211
    and there are no plans to use it in the not-so-near future. So it can go
    without anyone missing it.

    Signed-off-by: Kalle Valo
    Acked-by: Johannes Berg
    Signed-off-by: John W. Linville

    Kalle Valo
     
  • 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: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • Conflicts:
    net/mac80211/scan.c

    John W. Linville
     

27 Jan, 2010

1 commit

  • I got below kernel oops when I try to bring down the network interface if
    ftrace is enabled. The root cause is drv_ampdu_action() is passed with a
    NULL ssn pointer in the BA session tear down case. We need to check and
    avoid dereferencing it in trace entry assignment.

    BUG: unable to handle kernel NULL pointer dereference
    Modules linked in: at (null)
    IP: [] ftrace_raw_event_drv_ampdu_action+0x10a/0x160 [mac80211]
    *pde = 00000000
    Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
    [...]
    Call Trace:
    [] ? ftrace_raw_event_drv_ampdu_action+0x0/0x160 [mac80211]
    [] ? __ieee80211_stop_rx_ba_session+0xfc/0x220 [mac80211]
    [] ? ieee80211_sta_tear_down_BA_sessions+0x3b/0x50 [mac80211]
    [] ? ieee80211_set_disassoc+0xe6/0x230 [mac80211]
    [] ? ieee80211_set_disassoc+0x9c/0x230 [mac80211]
    [] ? ieee80211_mgd_deauth+0x158/0x170 [mac80211]
    [] ? ieee80211_deauth+0x1b/0x20 [mac80211]
    [] ? __cfg80211_mlme_deauth+0xe9/0x120 [cfg80211]
    [] ? __cfg80211_disconnect+0x170/0x1d0 [cfg80211]

    Cc: Johannes Berg
    Cc: stable@kernel.org
    Signed-off-by: Zhu Yi
    Signed-off-by: John W. Linville

    Zhu Yi
     

23 Jan, 2010

1 commit


13 Jan, 2010

1 commit


29 Dec, 2009

1 commit

  • We've long lacked a good confirmation that frames
    have really gone out, e.g. before going off-channel
    for a scan. Add a flush() operation that drivers
    can implement to provide that confirmation, and use
    it in a few places:
    * before scanning sends the nullfunc frames
    * after scanning sends the nullfunc frames, if any
    * when going idle, to send any pending frames

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

23 Dec, 2009

1 commit

  • Enable spatial multiplexing in mac80211 by telling the
    driver what to do and, where necessary, sending action
    frames to the AP to update the requested SMPS mode.

    Also includes a trivial implementation for hwsim that
    just logs the requested mode.

    For now, the userspace interface is in debugfs only,
    and let you toggle the requested mode at any time.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

22 Dec, 2009

2 commits

  • It's not all that useful to have the vif/sdata pointer,
    we'd rather refer to the interfaces by their name.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    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: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

29 Nov, 2009

1 commit

  • Enable logging of more configuration data when tracing
    is enabled. Except for the channel frequency this is
    only useful with the binary trace format, but that can
    be recorded and replayed with trace-cmd and I will be
    working on a plugin that reports all the information.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

19 Nov, 2009

1 commit

  • The entire aggregation code currently operates on the
    hw pointer and station addresses, but that needs to
    change to make stations purely per-vif; As one step
    preparing for that make the aggregation code callable
    with the station, or by the combination of virtual
    interface and station address.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

20 Aug, 2009

1 commit

  • 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: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

25 Jul, 2009

2 commits

  • This patch fixes the following errors:

    driver-trace.h:148:1: error: cannot size expression
    driver-trace.h:148:1: error: cannot size expression
    [...]
    driver-trace.h:222:1: error: cannot size expression
    driver-trace.h:71:1: error: incompatible types for operation (
    driver-trace.h:71:1: right side has type int
    driver-trace.h:99:1: error: incompatible types for operation (
    driver-trace.h:99:1: right side has type int
    driver-trace.h:148:1: error: incompatible types for operation (
    driver-trace.h:148:1: right side has type int
    driver-trace.h:222:1: error: cannot size expression
    driver-trace.h:248:1: error: incompatible types for operation (
    driver-trace.h:248:1: right side has type int
    driver-trace.h:446:1: error: incompatible types for operation (
    driver-trace.h:446:1: right side has type int

    Signed-off-by: Christian Lamparter
    Signed-off-by: John W. Linville

    Christian Lamparter
     
  • This makes mac80211 use the event tracing framework
    to log all operations as given to the driver. This
    will need to be extended with more information, but
    as a start it should be good.

    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg