16 Dec, 2010

1 commit

  • Allow drivers or rate control algorithms to specify BlockAck session
    timeout when initiating an ADDBA transaction. This is useful in cases
    where maintaining persistent BA sessions does not incur any overhead.

    The current timeout value of 5000 TUs is retained for all non ath9k/ath9k_htc
    drivers.

    Signed-off-by: Sujith Manoharan
    Reviewed-by: Johannes Berg
    Signed-off-by: John W. Linville

    Sujith Manoharan
     

30 Nov, 2010

1 commit

  • The RX aggregation locking documentation was
    wrong, which led Christian to also code the
    timer timeout handling for it somewhat wrongly.

    Fix the documentation, the two places that
    need to hold the reorder lock across accesses
    to the structure, and the debugfs code that
    should just use RCU.

    Also, remove acquiring the sta->lock across
    reorder timeouts since it isn't necessary, and
    change a few places to GFP_KERNEL because the
    code path here doesn't need atomic allocations
    as I noticed when reviewing all this.

    Signed-off-by: Johannes Berg
    Acked-by: Christian Lamparter
    Signed-off-by: John W. Linville

    Johannes Berg
     

16 Nov, 2010

1 commit


24 Oct, 2010

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1699 commits)
    bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL.
    vlan: Calling vlan_hwaccel_do_receive() is always valid.
    tproxy: use the interface primary IP address as a default value for --on-ip
    tproxy: added IPv6 support to the socket match
    cxgb3: function namespace cleanup
    tproxy: added IPv6 support to the TPROXY target
    tproxy: added IPv6 socket lookup function to nf_tproxy_core
    be2net: Changes to use only priority codes allowed by f/w
    tproxy: allow non-local binds of IPv6 sockets if IP_TRANSPARENT is enabled
    tproxy: added tproxy sockopt interface in the IPV6 layer
    tproxy: added udp6_lib_lookup function
    tproxy: added const specifiers to udp lookup functions
    tproxy: split off ipv6 defragmentation to a separate module
    l2tp: small cleanup
    nf_nat: restrict ICMP translation for embedded header
    can: mcp251x: fix generation of error frames
    can: mcp251x: fix endless loop in interrupt handler if CANINTF_MERRF is set
    can-raw: add msg_flags to distinguish local traffic
    9p: client code cleanup
    rds: make local functions/variables static
    ...

    Fix up conflicts in net/core/dev.c, drivers/net/pcmcia/smc91c92_cs.c and
    drivers/net/wireless/ath/ath9k/debug.c as per David

    Linus Torvalds
     

07 Oct, 2010

1 commit

  • When roaming while we have active BA session,
    we can end up transmitting delBA frames to
    the old AP while we're already on the new AP's
    channel, which can cause warnings.

    Simply avoid sending those frames, but still
    tear down the internal session state, since
    they are not really necessary anyway as we
    will implicitly disassociate when sending the
    association to the new AP.

    Signed-off-by: Johannes Berg
    Acked-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Johannes Berg
     

28 Sep, 2010

1 commit


16 Sep, 2010

1 commit

  • The default llseek operation is changing from
    default_llseek to no_llseek, so all code relying on
    the current behaviour needs to make that explicit.

    The wireless driver infrastructure and some of the drivers
    make use of generated debugfs files, so they cannot
    be converted by our script that automatically determines
    the right operation.

    All these files use debugfs and they typically rely
    on simple_read_from_buffer, so the best llseek operation
    here is generic_file_llseek.

    Signed-off-by: Arnd Bergmann
    Cc: "John W. Linville"
    Cc: linux-wireless@vger.kernel.org
    Cc: netdev@vger.kernel.org

    Arnd Bergmann
     

15 Jun, 2010

3 commits

  • When the driver or rate control requests starting
    or stopping an aggregation session, that currently
    causes a direct callback into the driver, which
    could potentially cause locking problems. Also,
    the functions need to be callable from contexts
    that cannot sleep, and thus will interfere with
    making the ampdu_action callback sleeping.

    To address these issues, add a new work item for
    each station that will process any start or stop
    requests out of line.

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

    Johannes Berg
     
  • Currently we allocate some memory for each TX
    aggregation session and additionally keep a
    state bitmap indicating the state it is in.
    By using RCU to protect the pointer, moving
    the state into the structure and some locking
    trickery we can avoid locking when the TX agg
    session is fully operational.

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

    Johannes Berg
     
  • Currently we allocate some memory for each RX
    aggregation session and additionally keep a
    flag indicating whether or not it is valid.
    By using RCU to protect the pointer and making
    sure that the memory is fully set up before it
    becomes visible to the RX path, we can remove
    the need for the bool that indicates validity,
    as well as for locking on the RX path since it
    is always synchronised against itself, and we
    can guarantee that all other modifications are
    done when the structure is not visible to the
    RX path.

    The net result is that since we remove locking
    requirements from the RX path, we can in the
    future use any kind of lock for the setup and
    teardown code paths.

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

    Johannes Berg
     

04 Jun, 2010

2 commits

  • This patch reduces the binary size by around 25k (measured on MIPS,
    with CONFIG_MAC80211_DEBUG_COUNTERS enabled).

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

    Felix Fietkau
     
  • 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
     

04 May, 2010

1 commit

  • This allows enabling TX and disabling both TX and
    RX aggregation sessions manually in debugfs. It is
    very useful for debugging session initiation and
    teardown problems since with this you don't have
    to force a lot of traffic to get aggregation and
    thus have less data to analyse.

    Also, to debug mac80211 code itself, make hwsim
    "support" aggregation sessions. It will still just
    transfer the frame, but go through the setup and
    teardown handshakes.

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

    Johannes Berg
     

10 Apr, 2010

1 commit


08 Apr, 2010

1 commit

  • The aggregation code has a number of quirks, like
    inventing an unneeded WLAN_BACK_TIMER value and
    leaking memory under certain circumstances during
    station destruction. Fix these issues by using
    the regular aggregation session teardown code and
    blocking new aggregation sessions, all before the
    station is really destructed.

    As a side effect, this gets rid of the long code
    block to destroy aggregation safely.

    Additionally, rename tid_state_rx which can only
    have the values IDLE and OPERATIONAL to
    tid_active_rx to make it easier to understand
    that there is no bitwise stuff going on on the
    RX side -- the TX side remains because it needs
    to keep track of the driver and peer states.

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

    Johannes Berg
     

10 Mar, 2010

1 commit

  • The noise value as is won't be used, isn't
    filled by most drivers and doesn't really
    make a whole lot of sense on a per packet
    basis -- proper cfg80211 survey support in
    mac80211 will need to be different.

    Mark the struct member as deprecated so it
    will be removed from drivers.

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

    Johannes Berg
     

02 Feb, 2010

2 commits


23 Dec, 2009

3 commits

  • IEEE-802.11n spec says the RX highest data rate field does
    not specify the highest supported RX data rate if its not set.
    Ignore it if not set then. Refer to section 7.3.56.4

    Cc: johannes@sipsolutions.net
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • When debugging you want to be lazy and not have to parse
    bits yourself so let mac80211 debugfs do the parsing for you.

    This is what I get against my WRT610N:

    root@tux:~# cat /sys/kernel/debug/ieee80211/phy0/stations/00\:22\:6b\:aa\:bb\:01/ht_capa
    ht supported
    cap: 0x000e
    HT20/HT40
    SM Power Save disabled
    No RX STBC
    Max AMSDU length: 7935 bytes
    No DSSS/CCK HT40
    ampdu factor/density: 2/6
    MCS mask: ff ff 00 00 00 00 00 00 00 00
    MCS rx highest: 0
    MCS tx params: 0

    Cc: johannes@sipsolutions.net
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • The MCS set is 16 bits so when debugging ensure the full 16 bits
    are represented. Current reading would make you think its only
    8 bits.

    Cc: johannes@sipsolutions.net
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     

22 Dec, 2009

1 commit

  • 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
     

20 Nov, 2009

1 commit


07 Nov, 2009

1 commit

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

    Johannes Berg
     

31 Oct, 2009

2 commits

  • This value is unused by mac80211, because it was only
    be used by wireless extensions, and turned out to not
    be useful there because the quality value needs to be
    comparable between scan results and the current value
    which is impossible when the qual value is calculated
    taking into account noise, for example.

    Since it is unused anyway, this patch deprecates it
    in the hope that drivers will remove their sometimes
    quite expensive calculations of the value.

    I'm open to actual uses of the value, but the best
    way of using it seems to be what the Intel drivers do
    which should probably be generalised if we have noise
    values from the hardware.

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

    Johannes Berg
     
  • We can save a lot of code and pointers in the structs
    by using debugfs_remove_recursive().

    First, change cfg80211 to use debugfs_remove_recursive()
    so that drivers do not need to clean up any files they
    added to the per-wiphy debugfs (if and only if they are
    ok to be accessed until after wiphy_unregister!).

    Then also make mac80211 use debugfs_remove_recursive()
    where necessary -- it need not remove per-wiphy files
    as cfg80211 now removes those, but netdev etc. files
    still need to be handled but can now be removed without
    needing struct dentry pointers to all of them.

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

    Johannes Berg
     

11 Jul, 2009

1 commit

  • We had code for a number of files, that we didn't publish
    in debugfs, fix that. Also make the agg_status file layout
    more readable and add more information to it.

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

    Johannes Berg
     

30 Jan, 2009

1 commit


01 Nov, 2008

2 commits


28 Oct, 2008

1 commit


15 Oct, 2008

1 commit

  • When debugfs_create_dir fails, sta_info_debugfs_add_work will not
    terminate because it will find the same station again and again.
    This is possible whenever debugfs fails for whatever reason; one
    reason is a race condition in mac80211, unfortunately we cannot
    do much about it, so just document it, it just means some station
    may be missing from debugfs.

    Signed-off-by: Johannes Berg
    Cc: Robin Holt
    Signed-off-by: John W. Linville

    Johannes Berg
     

25 Sep, 2008

1 commit

  • There's no need to register the master netdev with cfg80211,
    in fact, this is quite dangerous and lead to having to add
    checks for the master interface all over the config handlers.
    This patch removes the "ieee80211_ptr" from the master iface
    in favour of having a small netdev_priv() associated with
    the master interface that stores the ieee80211_local pointer.
    Because of this, a lot of code in the configuration handlers
    can go away. To make this patch easier to verify I have also
    removed a number of wiphy_priv() calls in favour of getting
    the sdata first and then the local pointer from that.

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

    Johannes Berg
     

16 Sep, 2008

1 commit

  • This patch changes mac80211 to share some more data about
    stations with drivers. Should help iwlwifi and ath9k when
    they get around to updating, and might also help with
    implementing rate control algorithms without internals.

    Signed-off-by: Johannes Berg
    Cc: Sujith Manoharan
    Signed-off-by: John W. Linville

    Johannes Berg
     

23 Aug, 2008

1 commit

  • This patch replaces net_device arguments to mac80211 internal functions
    with ieee80211_{local,sub_if_data} as appropriate.

    It also does the same for many 802.11s mesh functions, and changes the
    mesh path table to be indexed on sub_if_data rather than net_device.

    If the mesh part needs to be a separate patch let me know, but since
    mesh uses a lot of mac80211 functions which were being converted anyway,
    the changes go hand-in-hand somewhat.

    This patch probably does not convert all the functions which could be
    converted, but it is a large chunk and followup patches will be
    provided.

    Signed-off-by: Jasper Bryant-Greene
    Signed-off-by: John W. Linville

    Jasper Bryant-Greene
     

22 May, 2008

1 commit

  • The useless channel use statistics are quite a lot of code, currently
    use integer divisions in the packet fast path, are rather inaccurate
    since they do not account for retries and finally nobody even cares.
    Hence, remove them completely.

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

    Johannes Berg
     

15 May, 2008

2 commits

  • trying to clean up the signal/noise code. the previous code in mac80211 had
    confusing names for the related variables, did not have much definition of
    what units of signal and noise were provided and used implicit mechanisms from
    the wireless extensions.

    this patch introduces hardware capability flags to let the hardware specify
    clearly if it can provide signal and noise level values and which units it can
    provide. this also anticipates possible new units like RCPI in the future.

    for signal:

    IEEE80211_HW_SIGNAL_UNSPEC - unspecified, unknown, hw specific
    IEEE80211_HW_SIGNAL_DB - dB difference to unspecified reference point
    IEEE80211_HW_SIGNAL_DBM - dBm, difference to 1mW

    for noise we currently only have dBm:

    IEEE80211_HW_NOISE_DBM - dBm, difference to 1mW

    if IEEE80211_HW_SIGNAL_UNSPEC or IEEE80211_HW_SIGNAL_DB is used the driver has
    to provide the maximum value (max_signal) it reports in order for applications
    to make sense of the signal values.

    i tried my best to find out for each driver what it can provide and update it
    but i'm not sure (?) for some of them and used the more conservative guess in
    doubt. this can be fixed easily after this patch has been merged by changing
    the hardware flags of the driver.

    DRIVER SIGNAL MAX NOISE QUAL
    -----------------------------------------------------------------
    adm8211 unspec(?) 100 n/a missing
    at76_usb unspec(?) (?) unused missing
    ath5k dBm dBm percent rssi
    b43legacy dBm dBm percent jssi(?)
    b43 dBm dBm percent jssi(?)
    iwl-3945 dBm dBm percent snr+more
    iwl-4965 dBm dBm percent snr+more
    p54 unspec 127 n/a missing
    rt2x00 dBm n/a percent rssi+tx/rx frame success
    rt2400 dBm n/a
    rt2500pci dBm n/a
    rt2500usb dBm n/a
    rt61pci dBm n/a
    rt73usb dBm n/a
    rtl8180 unspec(?) 65 n/a (?)
    rtl8187 unspec(?) 65 (?) noise(?)
    zd1211 dB(?) 100 n/a percent

    drivers/net/wireless/ath5k/base.c: Changes-licensed-under: 3-Clause-BSD

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

    Bruno Randolf
     
  • As discussed earlier, we can unify locking in struct sta_info
    and use just a single spinlock protecting all members of the
    structure that need protection. Many don't, but one of the
    especially bad ones is the 'flags' member that can currently
    be clobbered when RX and TX is being processed on different
    CPUs at the same time.

    Because having four spinlocks for different, mostly exclusive
    parts of a single structure is overkill, this patch also kills
    the ampdu and mesh plink spinlocks and uses just a single one
    for everything. Because none of the spinlocks are nested, this
    is safe.

    It remains to be seen whether or not we should make the sta
    flags use atomic bit operations instead, for now though this
    is a safe thing and using atomic operations instead will be
    very simple using the new static inline functions this patch
    introduces for accessing sta->flags.

    Since spin_lock_bh() is used with this lock, there shouldn't
    be any contention even if aggregation is enabled at around the
    same time as both requires frame transmission/reception which
    is in a bh context.

    Signed-off-by: Johannes Berg
    Cc: Tomas Winkler
    Cc: Ron Rindjunsky
    Cc: Luis Carlos Cobo
    Signed-off-by: John W. Linville

    Johannes Berg
     

08 May, 2008

1 commit

  • This
    * makes the queue number passed to drivers a u16
    (as it will be with skb_get_queue_mapping)
    * removes the useless queue number defines
    * splits hw->queues into hw->queues/ampdu_queues
    * removes the debugfs files for per-queue counters
    * removes some dead QoS code
    * removes the beacon queue configuration for IBSS
    so that the drivers now never get a queue number
    bigger than (hw->queues + hw->ampdu_queues - 1)
    for tx and only in the range 0..hw->queues-1 for
    conf_tx.

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

    Johannes Berg
     

09 Apr, 2008

1 commit

  • Unfortunately, debugfs can be made to access invalid memory by
    open()ing a file and then waiting until the corresponding debugfs
    file has been removed (and, probably, the underlying object.)

    That could be exploited by any user if the user is able to open
    debugfs files and can cause networking devices, STA entries or
    similar to disappear which is quite easy to do.

    Hence, all debugfs files should be root-only.

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

    Johannes Berg