29 Nov, 2011

1 commit

  • This fixes frequent WARN_ONs when using AP VLAN + aggregation, as these vifs
    are virtual and not registered with drivers.
    Use sta_info_get_bss instead of sta_info_get in aggregation callbacks, so
    that these callbacks can find the station entry when called with the AP vif.

    Signed-off-by: Felix Fietkau
    Signed-off-by: John W. Linville

    Felix Fietkau
     

22 Nov, 2011

1 commit

  • Drivers can usually handle fragmented packets
    much easier when they get the entire list of
    fragments at once. The only thing they need to
    do is keep enough space on the queues for up
    to ten fragments of a single MSDU.

    This allows them to implement this with a new
    operation tx_frags.

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

    Johannes Berg
     

10 Nov, 2011

1 commit


04 Oct, 2011

1 commit

  • tx params should be configured per interface.
    add ieee80211_vif param to the conf_tx callback,
    and change all the drivers that use this callback.

    The following spatch was used:
    @rule1@
    struct ieee80211_ops ops;
    identifier conf_tx_op;
    @@
    ops.conf_tx = conf_tx_op;

    @rule2@
    identifier rule1.conf_tx_op;
    identifier hw, queue, params;
    @@
    conf_tx_op (
    - struct ieee80211_hw *hw,
    + struct ieee80211_hw *hw, struct ieee80211_vif *vif,
    u16 queue,
    const struct ieee80211_tx_queue_params *params) {...}

    Signed-off-by: Eliad Peller
    Signed-off-by: John W. Linville

    Eliad Peller
     

01 Oct, 2011

2 commits

  • iwlwifi needs to know the number of frames that are
    going to be sent to a station while it is asleep so
    it can properly handle the uCode blocking of that
    station.

    Before uAPSD, we got by by telling the device that
    a single frame was going to be released whenever we
    encountered IEEE80211_TX_CTL_POLL_RESPONSE. With
    uAPSD, however, that is no longer possible since
    there could be more than a single frame.

    To support this model, add a new callback to notify
    drivers when frames are going to be released.

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

    Johannes Berg
     
  • If there are frames for a station buffered in
    the driver, mac80211 announces those in the TIM
    IE but there's no way to release them. Add new
    API to release such frames and use it when the
    station polls for a frame.

    Since the API will soon also be used for uAPSD
    it is easily extensible.

    Note that before this change drivers announcing
    driver-buffered frames in the TIM bit actually
    will respond to a PS-Poll with a potentially
    lower priority frame (if there are any frames
    buffered in mac80211), after this patch a driver
    that hasn't been changed will no longer respond
    at all. This only affects ath9k, which will need
    to be fixed to implement the new API.

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

    Johannes Berg
     

28 Sep, 2011

2 commits


09 Aug, 2011

1 commit

  • For iwlwifi, I decided not to use this API since
    it just increased the complexity for little gain.
    Since nobody else intends to use it, let's kill
    it again. If anybody later needs to have it, we
    can always revive it then.

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

    Johannes Berg
     

21 Jul, 2011

1 commit

  • In P2P client mode, the GO (AP) to connect to might
    have periods of time where it is not available due
    to powersave. To allow the driver to sync with it
    and send frames to the GO only when it is available
    add a new callback tx_sync (and the corresponding
    finish_tx_sync). These callbacks can sleep unlike
    the actual TX.

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

    Johannes Berg
     

12 Jul, 2011

1 commit

  • mac80211 maintains a running average of the RSSI when a STA
    is associated to an AP. Report threshold events to any driver
    that has registered callbacks for getting RSSI measurements.

    Implement callbacks in mac80211 so that driver can set thresholds.
    Add callbacks in mac80211 which is invoked when an RSSI threshold
    event occurs.

    mac80211: add tracing to rssi_reports api and remove extraneous fn argument
    mac80211: scale up rssi thresholds from driver by 16 before storing

    Signed-off-by: Meenakshi Venkataraman
    Signed-off-by: Wey-Yi Guy
    Signed-off-by: John W. Linville

    Meenakshi Venkataraman
     

07 Jul, 2011

1 commit


18 Jun, 2011

1 commit

  • When suspending, __ieee80211_suspend() calls ieee80211_scan_cancel(),
    which will only cancel sw scan. In order to cancel hw scan, the
    low-level driver has to cancel it in the suspend() callback. however,
    this is too late, as a new scan_work will be enqueued (while the driver
    is going into suspend).

    Add a new cancel_hw_scan() callback, asking the driver to cancel an
    active hw scan, and call it in ieee80211_scan_cancel().

    Signed-off-by: Eliad Peller
    Reviewed-by: Stanislaw Gruszka
    Signed-off-by: John W. Linville

    Eliad Peller
     

12 May, 2011

1 commit

  • Implement support for HW scheduled scan. The mac80211 code doesn't perform
    scheduled scans itself, but calls the driver to start and stop scheduled
    scans.

    This patch also creates a trace event class to be used by drv_hw_scan
    and the new drv_sched_scan_start and drv_sched_stop functions, in
    order to avoid duplicate code.

    Signed-off-by: Luciano Coelho
    Signed-off-by: John W. Linville

    Luciano Coelho
     

06 May, 2011

1 commit

  • This adds basic support for the new WoWLAN
    configuration in mac80211. The behaviour is
    completely offloaded to the driver though,
    with two new callbacks (suspend/resume).

    Options for the driver include a complete
    reconfiguration after wakeup, and exposing
    all the triggers it wants to support.

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

    Johannes Berg
     

29 Apr, 2011

1 commit

  • This patch adds a new API for setting a TX rate mask in
    drivers that have rate control in either the firmware or hardware.
    This can be used for various purposes, for example, masking out the
    11b rates in P2P operation.

    Signed-off-by: Sujith Manoharan
    Signed-off-by: John W. Linville

    Sujith Manoharan
     

13 Apr, 2011

1 commit

  • In a highly noisy environment, the tx rate of the driver drops and
    the application slows down since it has not yet received ACKs for
    the frames already queued in the hardware. Since this ACK may take
    more than 100ms, stopping the dev queues for entering PS at this
    stage breaks applications, WMM test cases in my testing.
    If there are frames already pending in the tx queue, postponing the
    PS logic helps to avoid redundant queue stops. When power save is
    enabled by default and in a noisy environment, this API certainly
    helps in improving the average throughput.

    Signed-off-by: Vivek Natarajan
    Signed-off-by: John W. Linville

    Vivek Natarajan
     

12 Mar, 2011

1 commit


26 Feb, 2011

2 commits

  • 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
     
  • The return value of the tx operation is commonly
    misused by drivers, leading to errors. All drivers
    will drop frames if they fail to TX the frame, and
    they must also properly manage the queues (if they
    didn't, mac80211 would already warn).

    Removing the ability for drivers to return a BUSY
    value also allows significant cleanups of the TX
    TX handling code in mac80211.

    Note that this also fixes a bug in ath9k_htc, the
    old "return -1" there was wrong.

    Signed-off-by: Johannes Berg
    Tested-by: Sedat Dilek [ath5k]
    Acked-by: Gertjan van Wingerde [rt2x00]
    Acked-by: Larry Finger [b43, rtl8187, rtlwifi]
    Acked-by: Luciano Coelho [wl12xx]
    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


14 Dec, 2010

1 commit

  • The 802.11 spec states that the STA that generated the last Beacon frame shall
    be the STA that response to a probe request. This is important for congestion
    reduction when a probe request is received - only 1 node in an adhoc BSS
    will transmit a response. While mac80211 drivers should provide the
    tx_last_beacon function to report if they transmitted the last beacon many
    do not. As an attempt to reduce probe response congestion default this
    to 0 such that a node not implementing this capability does not contribute
    to unnecessary congestion.

    In a modern medium sized office environment I see upwards of 100 probe
    requests per second received at a given node from various hardware/OS/drivers
    doing zeroconf 'active probing' as opposed to passively listening for beacons.
    With a modest 10-node adhoc network consisting of drivers that do not implement
    this tx_last_beacon feature, I have seen this result in the simultaneous xmit
    of probe responses accumulating to 500 probe responses per second because of
    collisions which brings the adhoc network to its knees as well as causes
    needless congestion.

    Signed-off-by: John W. Linville

    Tim Harvey
     

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
     

30 Jun, 2010

1 commit


15 Jun, 2010

5 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
     
  • Allow drivers to sleep, and indicate this in
    the documentation. ath9k has some locking I
    don't understand, so keep it safe and disable
    BHs in it, all other drivers look fine with
    the context change.

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

    Johannes Berg
     
  • To prepare for allowing drivers to sleep in
    ampdu_action, change the locking in the TX
    aggregation code to use the mutex the RX part
    already uses. The spinlock is still necessary
    around some code to avoid races with TX, but
    now we can also synchronize_net() to avoid
    getting an inconsistent sequence number.

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

    Johannes Berg
     
  • To prepare for allowing drivers to sleep in
    ampdu_action, change the locking in the RX
    aggregation code to use a mutex, so that it
    would already allow drivers to sleep. But
    explicitly disable BHs around the callback
    for now since the TX part cannot yet sleep,
    and drivers' locking might require it.

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

    Johannes Berg
     

08 Jun, 2010

2 commits


05 Jun, 2010

1 commit


04 Jun, 2010

1 commit

  • 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
     

18 May, 2010

1 commit


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
     

06 May, 2010

1 commit