11 Sep, 2012

1 commit

  • It is a frequent mistake to confuse the netlink port identifier with a
    process identifier. Try to reduce this confusion by renaming fields
    that hold port identifiers portid instead of pid.

    I have carefully avoided changing the structures exported to
    userspace to avoid changing the userspace API.

    I have successfully built an allyesconfig kernel with this change.

    Signed-off-by: "Eric W. Biederman"
    Acked-by: Stephen Hemminger
    Signed-off-by: David S. Miller

    Eric W. Biederman
     

07 Aug, 2012

1 commit

  • libertas currently calls cfg80211_disconnected() when it is being
    brought down. This causes an event to be allocated, but since the
    wdev is already removed from the rdev by the time that the event
    processing work executes, the event is never processed or freed.
    http://article.gmane.org/gmane.linux.kernel.wireless.general/95666

    Fix this leak, and other possible situations, by processing the event
    queue when a device is being unregistered. Thanks to Johannes Berg for
    the suggestion.

    Signed-off-by: Daniel Drake
    Cc: stable@vger.kernel.org
    Reviewed-by: Johannes Berg
    Signed-off-by: John W. Linville

    Daniel Drake
     

13 Jul, 2012

1 commit

  • Revert commit b78e8ceac23655e1e06b30aa95ab11742d1ac7c0
    ("cfg80211: track monitor channel") and remove the
    set_monitor_enabled() callback.

    Due to the tracking happening in NETDEV_PRE_UP, it had
    introduced bugs because the monitor interface callback
    would be called before the device was started. It looks
    like there's no way to fix this, and using NETDEV_PRE_UP
    is broken anyway (since there's no NETDEV_UP_FAIL), so
    remove all that code, track interfaces in NETDEV_UP and
    also stop tracking the monitor channel in cfg80211.

    This mostly reverts to before the tracking, except that
    we keep the interface count tracking so that setting the
    monitor channel can be rejected properly.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

12 Jul, 2012

1 commit

  • To call cfg80211_get_chan_state() we need to lock
    the wdev, so we need to lock the wdev_iter mutex
    in cfg80211_can_use_iftype_chan(). This needs to
    use nested locking for lockdep.

    Also, cfg80211_get_chan_state() doesn't actually
    use the rdev, so remove that completely including
    the lock assertion that isn't needed.

    Reported-by: Eliad Peller
    Signed-off-by: Johannes Berg

    Johannes Berg
     

09 Jul, 2012

2 commits

  • The management frame and remain-on-channel APIs will be
    needed in the P2P device abstraction, so move them over
    to the new wdev-based APIs. Userspace can still use both
    the interface index and wdev identifier for them so it's
    backward compatible, but for the P2P Device wdev it will
    be able to use the wdev identifier only.

    Signed-off-by: Johannes Berg

    Johannes Berg
     
  • In order to support a P2P device abstraction and
    Bluetooth high-speed AMPs, we need to have a way
    to identify virtual interfaces that don't have a
    netdev associated.

    Do this by adding a NL80211_ATTR_WDEV attribute
    to identify a wdev which may or may not also be
    a netdev.

    To simplify things, use a 64-bit value with the
    high 32 bits being the wiphy index for this new
    wdev identifier in the nl80211 API.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

04 Jul, 2012

1 commit

  • Michal's monitor channel tracking introduce a locking problem
    as it locked the rdev lock inside the netdev notifier which
    isn't allowed as we might already hold it if we get there by
    removing an interface that is up.

    Fix this by relying only on the RTNL to protect the interface
    counters, the RTNL is always held in these code paths anyway.

    Signed-off-by: Johannes Berg

    Johannes Berg
     

29 Jun, 2012

5 commits

  • .connect cannot be handled since the driver scans
    and connects on its own. It is up to the driver
    then to refuse a connection (with -EBUSY for
    example).

    Non-fixed channel IBSSes always take a single
    channel resource. For example two non-fixed
    channel IBSSes always take up 2
    num_different_channels, even if they operate on
    the same channel at a given point of time.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     
  • Make it even more obvious we support single
    monitor channel. This will allow us to remove
    .get_channel.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     
  • Implements .set_monitor_enabled(wiphy, enabled).

    Notifies driver upon change of interface layout.

    If only monitor interfaces become present it is
    called with 2nd argument being true. If
    non-monitor interface appears then 2nd argument
    is false. Driver is notified only upon change.

    This makes it more obvious about the fact that
    cfg80211 supports single monitor channel. Once we
    implement multi-channel we don't want to allow
    setting monitor channel while other interface
    types are running. Otherwise it would be ambiguous
    once we start considering num_different_channels.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     
  • Helper function for finding out which channel is
    used by a given interface.

    An exclusive channel can be used only by a single
    interface. This is mainly for non-fixed channel
    IBSS handling.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     
  • This functionality will be reused when interface
    is going down. Avoids code duplication. Also adds
    missing wdev locking.

    Signed-off-by: Michal Kazior
    Signed-off-by: Johannes Berg

    Michal Kazior
     

20 Jun, 2012

1 commit


07 Jun, 2012

1 commit

  • Now that we've removed all uses of the set_channel
    API except for the monitor channel and in libertas,
    clarify this. Split the libertas mesh use into a
    new libertas_set_mesh_channel() operation, just to
    keep backward compatibility, and rename the normal
    set_channel() to set_monitor_channel().

    Also describe the desired set_monitor_channel()
    semantics more clearly.

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

    Johannes Berg
     

06 Jun, 2012

1 commit

  • Just like the AP mode patch, instead of setting
    the channel and then joining the mesh network,
    provide the channel to join the network on to
    the join_mesh() function.

    Like in AP mode, you can also give the channel
    to the join-mesh nl80211 command now.

    Unlike AP mode, it picks a default channel if
    none was given.

    As libertas uses mesh mode interfaces but has
    no join_mesh callback and we can't simply break
    it, keep some compatibility code for that case
    and configure the channel directly for it.

    In the non-libertas case, where we store the
    channel until join, allow setting it while the
    interface is down.

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

    Johannes Berg
     

17 May, 2012

1 commit


07 Feb, 2012

2 commits

  • This is needed by mac80211 to keep a reference
    to a BSS alive for the auth process. Remove the
    old version of cfg80211_ref_bss() since it's
    not actually used.

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

    Johannes Berg
     
  • To track authenticated state seems to have been
    a design mistake in cfg80211. It is possible to
    have out of band authentication (FT), tracking
    multiple authentications caused more problems
    than it ever helped, and the implementation in
    mac80211 is too complex.

    Remove all this complexity, and let userspace
    do whatever it wants to, mac80211 can deal with
    that just fine. Association is still tracked of
    course, but authentication no longer is. Local
    auth state changes are thus no longer of value,
    so ignore them completely.

    This will also help implement SAE -- asking the
    driver to do an authentication is now almost
    equivalent to sending an authentication frame,
    with the exception of shared key authentication
    which is still handled completely.

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

    Johannes Berg
     

14 Dec, 2011

1 commit

  • It is quite possible to run into a race in bss timeout where
    the drivers see the bss entry just before notifying cfg80211
    of a roaming event but it got timed out by the time rdev->event_work
    got scehduled from cfg80211_wq. This would result in the following
    WARN-ON() along with the failure to notify the user space of
    the roaming. The other situation which is happening with ath6kl
    that runs into issue is when the driver reports roam to same AP
    event where the AP bss entry already got expired. To fix this,
    move cfg80211_get_bss() from __cfg80211_roamed() to cfg80211_roamed().

    [158645.538384] WARNING: at net/wireless/sme.c:586
    __cfg80211_roamed+0xc2/0x1b1()
    [158645.538810] Call Trace:
    [158645.538838] [] warn_slowpath_common+0x65/0x7a
    [158645.538917] [] ? __cfg80211_roamed+0xc2/0x1b1
    [158645.538946] [] warn_slowpath_null+0xf/0x13
    [158645.539055] [] __cfg80211_roamed+0xc2/0x1b1
    [158645.539086] [] cfg80211_process_rdev_events+0x153/0x1cc
    [158645.539166] [] cfg80211_event_work+0x26/0x36
    [158645.539195] [] process_one_work+0x219/0x38b
    [158645.539273] [] ? wiphy_new+0x419/0x419
    [158645.539301] [] worker_thread+0xf6/0x1bf
    [158645.539379] [] ? rescuer_thread+0x1b5/0x1b5
    [158645.539407] [] kthread+0x62/0x67
    [158645.539484] [] ? __init_kthread_worker+0x42/0x42
    [158645.539514] [] kernel_thread_helper+0x6/0xd

    Reported-by: Kalle Valo
    Signed-off-by: Vasanthakumar Thiagarajan
    Signed-off-by: John W. Linville

    Vasanthakumar Thiagarajan
     

22 Nov, 2011

1 commit

  • This allows users to disable features such as HT, HT40,
    and to modify the MCS, AMPDU, and AMSDU settings for
    drivers that support it.

    The MCS, AMPDU, and AMSDU features that may be disabled are
    are reported in the phy-info netlink message as a mask.

    Attemping to disable features that are not supported will
    take no affect, but will not return errors. This is to aid
    backwards compatibility in user-space apps that may not be
    clever enough to deal with parsing the the capabilities mask.

    This patch only enables the infrastructure. An additional
    patch will enable the feature in mac80211.

    Signed-off-by: Ben Greear
    Signed-off-by: John W. Linville

    Ben Greear
     

10 Nov, 2011

2 commits

  • For probe responses it can be useful to not wait for ACK to
    avoid retransmissions if the station that sent the probe is
    already on the next channel, so allow userspace to request
    not caring about the ACK with a new nl80211 flag.

    Since mac80211 needs to be updated for the new function
    prototype anyway implement it right away -- it's just a
    few lines of code.

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

    Johannes Berg
     
  • Add the ability to register to received beacon frames
    to allow implementing OLBC logic in userspace. The
    registration is per wiphy since there's no point in
    receiving the same frame multiple times.

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

    Johannes Berg
     

28 Sep, 2011

2 commits

  • Add a new nl80211 attribute to specify whether to send the management
    frames in CCK rate or not. As of now the wpa_supplicant is disabling
    CCK rate at P2P init itself. So this patch helps to send P2P probe
    request/probe response/action frames being sent at non CCK rate in 2GHz
    without disabling 11b rates.

    This attribute is used with NL80211_CMD_TRIGGER_SCAN and
    NL80211_CMD_FRAME commands to disable CCK rate for management frame
    transmission.

    Cc: Jouni Malinen
    Signed-off-by: Rajkumar Manoharan
    Signed-off-by: John W. Linville

    Rajkumar Manoharan
     
  • Instead of using a hardcoded list of cipher suites in nl80211.c, use a
    shared function in util.c to verify that the driver advertises support
    for the specified cipher. This provides more accurate validation of the
    values and allows vendor-specific cipher suites to be added in drivers.

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

    Jouni Malinen
     

15 Sep, 2011

1 commit

  • The function wiphy_update_regulatory() uses the static variable
    last_request and thus needs to be called with reg_mutex held.
    This is the case for all users in reg.c, but the function was
    exported for use by wiphy_register(), from where it is called
    without the lock being held.

    Fix this by making wiphy_update_regulatory() private and introducing
    regulatory_update() as a wrapper that acquires and holds the lock.

    Signed-off-by: Sven Neumann
    Cc: John W. Linville
    Cc: Luis R. Rodriguez
    Cc: Daniel Mack
    Cc: linux-wireless@vger.kernel.org
    Acked-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Sven Neumann
     

20 Jul, 2011

1 commit

  • Some P2P scans are not allowed to advertise
    11b rates, but that is a rather special case
    so instead of having that, allow userspace
    to request the rate sets (per band) that are
    advertised in scan probe request frames.

    Since it's needed in two places now, factor
    out some common code parsing a rate array.

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

    Johannes Berg
     

06 Jul, 2011

1 commit

  • There was a deadlock when rfkill-blocking a wireless interface,
    because we were locking the rdev mutex on NETDEV_GOING_DOWN to stop
    sched_scans that were eventually running. The rfkill block code was
    already holding a mutex under rdev:

    kernel: =======================================================
    kernel: [ INFO: possible circular locking dependency detected ]
    kernel: 3.0.0-rc1-00049-g1fa7b6a #57
    kernel: -------------------------------------------------------
    kernel: kworker/0:1/4525 is trying to acquire lock:
    kernel: (&rdev->mtx){+.+.+.}, at: [] cfg80211_netdev_notifier_call+0x131/0x5b0
    kernel:
    kernel: but task is already holding lock:
    kernel: (&rdev->devlist_mtx){+.+.+.}, at: [] cfg80211_rfkill_set_block+0x4f/0xa0
    kernel:
    kernel: which lock already depends on the new lock.

    To fix this, add a new mutex specifically for sched_scan, to protect
    the sched_scan_req element in the rdev struct, instead of using the
    global rdev mutex.

    Reported-by: Duane Griffin
    Signed-off-by: Luciano Coelho
    Signed-off-by: John W. Linville

    Luciano Coelho
     

19 May, 2011

1 commit

  • cfg80211 scan code adds separate BSS entries if the same BSS shows up
    on multiple channels. However, sme implementation does not use the
    frequency when fetching the BSS entry. Fix this by adding channel
    information to cfg80211_roamed() and include it in cfg80211_get_bss()
    calls.

    Please note that drivers using cfg80211_roamed() need to be modified to
    fully implement this fix. This commit includes only minimal changes to
    avoid compilation issues; it maintains the old (broken) behavior for
    most drivers. ath6kl was the only one that I could test, so I updated
    it to provide the operating frequency in the roamed event.

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

    Jouni Malinen
     

17 May, 2011

1 commit

  • Add the ability to advertise interface combinations in nl80211.
    This allows the driver to indicate what the combinations are
    that it supports. "Combinations" of just a single interface are
    implicit, as previously. Note that cfg80211 will enforce that
    the restrictions are met, but not for all drivers yet (once all
    drivers are updated, we can remove the flag and enforce for all).

    When no combinations are actually supported, an empty list will
    be exported so that userspace can know if the kernel exported
    this info or not (although it isn't clear to me what tools using
    the info should do if the kernel didn't export it).

    Since some interface types are purely virtual/software and don't
    fit the restrictions, those are exposed in a new list of pure SW
    types, not subject to restrictions. This mainly exists to handle
    AP-VLAN and monitor interfaces in mac80211.

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

    Johannes Berg
     

13 May, 2011

2 commits

  • When sched_scan_stopped was called by the driver, mac80211 calls
    cfg80211, which in turn was calling mac80211 back with a flag
    "driver_initiated". This flag was used so that mac80211 would do the
    necessary cleanup but would not call the driver. This was enough to
    prevent the bounce back between the driver and mac80211, but not
    between mac80211 and cfg80211.

    To fix this, we now do the cleanup in mac80211 before calling
    cfg80211. To help with locking issues, the workqueue was moved from
    cfg80211 to mac80211.

    Reported-by: Johannes Berg
    Signed-off-by: Luciano Coelho
    Signed-off-by: John W. Linville

    Luciano Coelho
     
  • Multiple virtual AP interfaces can currently try
    to use different beacon intervals, but that just
    leads to problems since it won't actually be done
    that way by drivers. Return an error in this case
    to make sure it won't be done wrong.

    Also, ignore attempts to change the DTIM period
    or beacon interval during the lifetime of the BSS.

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

    Johannes Berg
     

12 May, 2011

1 commit

  • Implement new functionality for scheduled scan offload. With this feature we
    can scan automatically at certain intervals.

    The idea is that the hardware can perform scan automatically and filter on
    desired results without waking up the host unnecessarily.

    Add NL80211_CMD_START_SCHED_SCAN and NL80211_CMD_STOP_SCHED_SCAN
    commands to the nl80211 interface. When results are available they are
    reported by NL80211_CMD_SCHED_SCAN_RESULTS events. The userspace is
    informed when the scheduled scan has stopped with a
    NL80211_CMD_SCHED_SCAN_STOPPED event, which can be triggered either by
    the driver or by a call to NL80211_CMD_STOP_SCHED_SCAN.

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

    Luciano Coelho
     

06 May, 2011

1 commit

  • This is based on (but now quite far from) the
    original work from Luis and Eliad. Add support
    for configuring WoWLAN triggers, and getting
    the configuration out again. Changes from the
    original patchset are too numerous to list,
    but one important change needs highlighting:
    the suspend() callback is passed NULL for the
    trigger configuration if userspace has not
    configured WoWLAN at all.

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

    Johannes Berg
     

21 Dec, 2010

1 commit

  • Userspace will now be allowed to toggle between the default path
    selection algorithm (HWMP, implemented in the kernel), and a vendor
    specific alternative. Also in the same patch, allow userspace to add
    information elements to mesh beacons. This is accordance with the
    Extensible Path Selection Framework specified in version 7.0 of the
    802.11s draft.

    Signed-off-by: Javier Cardona
    Signed-off-by: John W. Linville

    Javier Cardona
     

07 Dec, 2010

1 commit

  • Instead of tying mesh activity to interface up,
    add join and leave commands for mesh. Since we
    must be backward compatible, let cfg80211 handle
    joining a mesh if a mesh ID was pre-configured
    when the device goes up.

    Note that this therefore must modify mac80211 as
    well since mac80211 needs to lose the logic to
    start the mesh on interface up.

    We now allow querying mesh parameters before the
    mesh is connected, which simply returns defaults.
    Setting them (internally renamed to "update") is
    only allowed while connected. Specify them with
    the new mesh join command instead where needed.

    In mac80211, beaconing must now also follow the
    mesh enabled/not enabled state, which is done
    by testing the mesh ID.

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

    Johannes Berg
     

30 Nov, 2010

1 commit

  • With p2p, it is sometimes necessary to transmit
    a frame (typically an action frame) on another
    channel than the current channel. Enable this
    through the CMD_FRAME API, and allow it to wait
    for a response. A new command allows that wait
    to be aborted.

    However, allow userspace to specify whether or
    not it wants to allow off-channel TX, it may
    actually want to use the same channel only.

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

    Johannes Berg
     

09 Oct, 2010

1 commit


07 Oct, 2010

1 commit


24 Sep, 2010

1 commit


17 Sep, 2010

1 commit

  • Instead of using a WARN_ON(!mutex_is_locked())
    use lockdep_assert_held() which compiles away
    completely when lockdep isn't enabled, and
    also is a more accurate assertion since it
    checks that the current thread is holding the
    mutex.

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

    Johannes Berg