04 Jun, 2009

1 commit

  • To be easier on drivers and users, have cfg80211 register an
    rfkill structure that drivers can access. When soft-killed,
    simply take down all interfaces; when hard-killed the driver
    needs to notify us and we will take down the interfaces
    after the fact. While rfkilled, interfaces cannot be set UP.

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

    Johannes Berg
     

12 May, 2009

1 commit

  • When a software scan starts, it first sets sw_scanning, but
    leaves the scan_channel "unset" (it currently actually gets
    initialised to a default). Now, when something else tries
    to (re)configure the hardware in the window between these two
    events (after sw_scanning = true, but before scan_channel is
    set), the current code switches to the (unset!) scan_channel.
    This causes trouble, especially when switching bands and
    sending frames on the wrong channel.

    To work around this, leave scan_channel initialised to NULL
    and use it to determine whether or not a switch to a different
    channel should occur (and also use the same condition to check
    whether to adjust power for scan or not).

    Additionally, avoid reconfiguring the hardware completely when
    recalculating idle resulted in no changes, this was the problem
    that originally led us to discover the race condition in the
    first place, which was helpfully bisected by Pavel. This part
    of the patch should not be necessary with the other fixes, but
    not calling the ieee80211_hw_config function when we know it to
    be unnecessary is certainly a correct thing to do.

    Unfortunately, this patch cannot and does not fix the race
    condition completely, but due to the way the scan code is
    structured it makes the particular problem Pavel discovered
    (race while changing channel at the same time as transmitting
    frames) go away. To fix it completely, more work especially
    with locking configuration is needed.

    Bisected-by: Pavel Roskin
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     

07 May, 2009

2 commits

  • When we aren't doing anything in mac80211, we can turn off
    much of the hardware, depending on the driver/hw. Not doing
    anything, aka being idle, means:

    * no monitor interfaces
    * no AP/mesh/wds interfaces
    * any station interfaces are in DISABLED state
    * any IBSS interfaces aren't trying to be in a network
    * we aren't trying to scan

    By creating a new function that verifies these conditions and calling
    it at strategic points where the states of those conditions change,
    we can easily make mac80211 tell the driver when we are idle to save
    power.

    Additionally, this fixes a small quirk where a recalculated powersave
    state is passed to the driver even if the hardware is about to stopped
    completely.

    This patch intentionally doesn't touch radio_enabled because that is
    currently implemented to be a soft rfkill which is inappropriate here
    when we need to be able to wake up with low latency.

    One thing I'm not entirely sure about is this:

    phy0: device no longer idle - in use
    wlan0: direct probe to AP 00:11:24:91:07:4d try 1
    wlan0 direct probe responded
    wlan0: authenticate with AP 00:11:24:91:07:4d
    wlan0: authenticated
    > phy0: device now idle
    > phy0: device no longer idle - in use
    wlan0: associate with AP 00:11:24:91:07:4d
    wlan0: RX AssocResp from 00:11:24:91:07:4d (capab=0x401 status=0 aid=1)
    wlan0: associated

    Is it appropriate to go into idle state for a short time when we have
    just authenticated, but not associated yet? This happens only with the
    userspace SME, because we cannot really know how long it will wait
    before asking us to associate. Would going idle after a short timeout
    be more appropriate? We may need to revisit this, depending on what
    happens.

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

    Johannes Berg
     
  • In order to later add tracing or verifications to the driver
    calls mac80211 makes, this patch adds static inline wrappers
    for all operations.

    All calls are now written as

    drv_(local, ...);

    instead of

    local->ops->(&local->hw, ...);

    Where necessary, the wrappers also do existence checking and
    return default values as appropriate.

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

    Johannes Berg
     

23 Apr, 2009

3 commits

  • This converts mac80211 to the new cfg80211 IBSS API, the
    wext handling functions are called where appropriate.

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

    Johannes Berg
     
  • When an application asks for a latency lower than the beacon interval
    there's nothing we can do -- we need to stay awake and not have the
    AP buffer frames for us. Add code to automatically calculate this
    constraint in mac80211 so drivers need not concern themselves with it.

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

    Johannes Berg
     
  • When you have multiple virtual interfaces the current
    implementation requires setting them up properly from
    userspace, which is undesirable when we want to default
    to power save mode. Keep track of powersave requested
    from userspace per managed mode interface, and only
    enable powersave globally when exactly one managed mode
    interface is active and has powersave turned on.

    Second, only start the dynPS timer when PS is turned
    on, and properly turn it off when PS is turned off.

    Third, fix the scan_sdata abuse in the dynps code.

    Finally, also reorder the code and refactor the code
    that enables PS or the dynps timer instead of having
    it copied in two places.

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

    Johannes Berg
     

28 Mar, 2009

4 commits

  • Add IEEE80211_HW_BEACON_FILTERING flag so that driver inform that it supports
    beacon filtering. Drivers need to call the new function
    ieee80211_beacon_loss() to notify about beacon loss.

    Signed-off-by: Kalle Valo
    Signed-off-by: John W. Linville

    Kalle Valo
     
  • Neither can currently be set from userspace, so there's no
    regression potential, and neither will be supported from
    userspace since the new userspace APIs allow the SME, which
    is in userspace, to control all we need.

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

    Johannes Berg
     
  • The functionality that NL80211_CMD_SET_MGMT_EXTRA_IE provided can now
    be achieved with cleaner design by adding IE(s) into
    NL80211_CMD_TRIGGER_SCAN, NL80211_CMD_AUTHENTICATE,
    NL80211_CMD_ASSOCIATE, NL80211_CMD_DEAUTHENTICATE, and
    NL80211_CMD_DISASSOCIATE.

    Since this is a very recently added command and there are no known (or
    known planned) applications using NL80211_CMD_SET_MGMT_EXTRA_IE and
    taken into account how much extra complexity it adds to the IE
    processing we have now (and need to add in the future to fix IE order
    in couple of frames), it looks like the best option is to just remove
    the implementation of this command for now. The enum values themselves
    are left to avoid changing the nl80211 command or attribute numbers.

    Signed-off-by: Jouni Malinen
    Signed-off-by: John W. Linville

    Jouni Malinen
     
  • This file was forgotten from the quilt patch that added MLME
    primitives, so the kfree on interface removal is missing. Fix this
    potential memleak by freeing the temporary Authentication frame IEs
    from SME when the interface is being removed.

    Signed-off-by: Jouni Malinen
    Signed-off-by: John W. Linville

    Jouni Malinen
     

17 Mar, 2009

1 commit

  • Even after commit "mac80211: deauth when interface is marked down"
    (e327b847 on Linus tree), userspace still isn't notified when interface
    goes down. There isn't a problem with this commit, but because of other
    code changes it doesn't work on kernels >= 2.6.28 (works if same/similar
    change applied on 2.6.27 for example).

    The issue is as follows: after commit "mac80211: restructure disassoc/deauth
    flows" in 2.6.28, the call to ieee80211_sta_deauthenticate added by
    commit e327b847 will not work: because we do sta_info_flush(local, sdata)
    inside ieee80211_stop (iface.c), all stations in interface are cleared, so
    when calling ieee80211_sta_deauthenticate->ieee80211_set_disassoc (mlme.c),
    inside ieee80211_set_disassoc we have this in the beginning:

    sta = sta_info_get(local, ifsta->bssid);
    if (!sta) {

    The !sta check triggers, thus the function returns early and
    ieee80211_sta_send_apinfo(sdata, ifsta) later isn't called, so
    wpa_supplicant/userspace isn't notified with SIOCGIWAP.

    This commit moves deauthentication to before flushing STA info
    (sta_info_flush), thus the above can't happen and userspace is really
    notified when interface goes down.

    Signed-off-by: Herton Ronaldo Krzesinski
    Signed-off-by: John W. Linville

    Herton Ronaldo Krzesinski
     

28 Feb, 2009

2 commits

  • This patch splits out the ibss code and data from managed (station) mode.
    The reason to do this is to better separate the state machines, and have
    the code be contained better so it gets easier to determine what exactly
    a given change will affect, that in turn makes it easier to understand.

    This is quite some churn, especially because I split sdata->u.sta into
    sdata->u.mgd and sdata->u.ibss, but I think it's easier to maintain that
    way. I've also shuffled around some code -- null function sending is only
    applicable to managed interfaces so put that into that file, some other
    functions are needed from various places so put them into util, and also
    rearranged the prototypes in ieee80211_i.h accordingly.

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

    Johannes Berg
     
  • mac80211 currently assumes init_net for all interfaces,
    so really will not cope well with network namespaces,
    at least at this time.

    To change this, we would have keep track of the netns
    in addition to the ifindex, which is not something I
    want to think about right now.

    Signed-off-by: Johannes Berg
    Cc: Eric W. Biederman
    Signed-off-by: John W. Linville

    Johannes Berg
     

14 Feb, 2009

2 commits


10 Feb, 2009

1 commit


30 Jan, 2009

5 commits

  • Using only the RTNL has a number of problems, most notably that
    ieee80211_iterate_active_interfaces() and other interface list
    traversals cannot be done from the internal workqueue because it
    needs to be flushed under the RTNL.

    This patch introduces a new mutex that protects the interface list
    against modifications. A more detailed explanation is part of the
    code change.

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

    Johannes Berg
     
  • A new nl80211 command, NL80211_CMD_SET_MGMT_EXTRA_IE, can be used to
    add arbitrary IE data into the end of management frames. The interface
    allows extra IEs to be configured for each management frame subtype, but
    only some of them (ProbeReq, ProbeResp, Auth, (Re)AssocReq, Deauth,
    Disassoc) are currently accepted in mac80211 implementation.

    This makes it easier to implement IEEE 802.11 extensions like WPS and
    FT that add IE(s) into some management frames. In addition, this can
    be useful for testing and experimentation purposes.

    Signed-off-by: Jouni Malinen
    Acked-by: Johannes Berg
    Signed-off-by: John W. Linville

    Jouni Malinen
     
  • Move to the advertised channel on reception of
    a CSA element. This is needed for 802.11h compliance.

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

    Sujith
     
  • Since the station info is flushed before calling set_disassoc
    in ieee80211_stop, the power save timer is never cancelled
    when the driver is unloaded. Hence the timer cancellation has
    to be done in ieee80211_stop itself.

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

    Vivek Natarajan
     
  • As TKIP is not updated to new security needs which arise when
    TKIP is used to encrypt A-MPDU aggregated data frames, IEEE802.11n
    does not allow any cipher other than CCMP (Which has new extensions
    defined) as pairwise cipher between HT peers.

    When such configuration (TKIP/WEP in HT) is forced, we still
    associate in non-HT mode (11a/b/g).

    Signed-off-by: Vasanthakumar Thiagarajan
    Acked-by: Johannes Berg
    Signed-off-by: John W. Linville

    Vasanthakumar Thiagarajan
     

13 Jan, 2009

1 commit


05 Dec, 2008

2 commits


22 Nov, 2008

1 commit

  • Mesh interfaces are currently opened with the FIF_ALLMULTI rx filter flag set,
    however there is no BSSID in mesh so BSSID filtering should be disabled by
    setting the FIF_OTHER_BSS flag as well. Also explicitly call
    ieee80211_configure_filter for mesh.

    Signed-off-by: Andrey Yurovsky
    Signed-off-by: Javier Cardona
    Acked-by: Johannes Berg
    Signed-off-by: John W. Linville

    Andrey Yurovsky
     

01 Nov, 2008

2 commits

  • Move bss_conf into the vif struct so that drivers can
    access it during ->tx without having to store it in
    the private data or similar. No driver updates because
    this is only for when they want to start using it.

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

    Johannes Berg
     
  • This makes mac80211 notify the driver which configuration
    actually changed, e.g. channel etc.

    No driver changes, this is just plumbing, driver authors are
    expected to act on this if they want to.

    Also remove the HW CONFIG debug printk, it's incorrect, often
    we configure something else.

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

    Johannes Berg
     

01 Oct, 2008

1 commit


25 Sep, 2008

1 commit

  • This patch makes cfg80211 show the interface in the nl80211
    information about a specific interface. API users are required
    to keep the type updated (everything else is fairly complicated)
    but you will get a warning if you fail to keep it updated.

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

    Johannes Berg
     

16 Sep, 2008

7 commits

  • When monitor mode is changed to BSS or IBSS, data trasnfer can not happen
    because proper transmit function is not assigend for BSS ,IBSS mode.
    This patch fixes this problem by assigning the ieee80211_subif_start_xmit
    to device's hard_start_xmit function.

    Signed-off-by: Abhijeet Kolekar
    Acked-by: Zhu Yi
    Acked-by: Johannes Berg
    Signed-off-by: John W. Linville

    Abhijeet Kolekar
     
  • 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
     
  • Move the code to handle regular interfaces out of main.c and
    into iface.c, keep only the master interface stuff in main.c.

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

    Johannes Berg
     
  • There's really no reason for mac80211 to be using its
    own interface type defines. Use the nl80211 types and
    simplify the configuration code a bit: there's no need
    to translate them any more now.

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

    Johannes Berg
     
  • Drivers need to know the basic rateset to be able to configure
    the ACK/CTS programming in hardware correctly.

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

    Johannes Berg
     
  • This way all the utility functions are at the top, then the
    state machine and externally callable functions are moved to
    the bottom. Also clean up ieee80211_i.h a bit and add a few
    comments about which functions are called from where.

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

    Johannes Berg
     
  • This patch splits off mesh handling from the STA/IBSS.
    Unfortunately it increases mesh code size a bit, but I
    think it makes things clearer. The patch also reduces
    per-interface run-time memory usage.

    Also clean up a few places where ifdef is not required.

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

    Johannes Berg
     

12 Sep, 2008

1 commit

  • ieee80211_free_keys() must be called before
    ieee80211_debugfs_remove_netdev() in order to make sure that the
    possible default_key symlink is removed before attempting to
    remove the netdev debugfs directory.

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

    Jouni Malinen
     

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
     

15 Jul, 2008

1 commit

  • This patch makes mac80211 assign proper sequence numbers to
    QoS-data frames. It also removes the old sequence number code
    because we noticed that only the driver or hardware can assign
    sequence numbers to non-QoS-data and especially management
    frames in a race-free manner because beacons aren't passed
    through mac80211's TX path.

    This patch also adds temporary code to the rt2x00 drivers to
    not break them completely, that code will have to be reworked
    for proper sequence numbers on beacons.

    It also moves sequence number assignment down in the TX path
    so no sequence numbers are assigned to frames that are dropped.

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

    Johannes Berg