04 Jun, 2009

40 commits

  • Add some blurb about /dev/rfkill to the documentation and
    fix the "transmiter" spelling error.

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

    Johannes Berg
     
  • The rfkill core didn't initialise the poll delayed work
    because it assumed that polling was always done by specifying
    the poll function. cfg80211, however, would like to start
    polling only later, which is a valid use case and easy to
    support, so change rfkill to always initialise the poll
    delayed work and thus allow starting polling by calling the
    rfkill_resume_polling() function after registration.

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

    Johannes Berg
     
  • When we remove the active interface, there's no need to continue
    sending beacons; doing so would cause a null pointer deref in
    ieee80211_beacon_get(). Disable the interrupt in remove_interface
    and add a WARN_ON(!vif) in case there are other instances lurking.

    Signed-off-by: Bob Copeland
    Signed-off-by: John W. Linville

    Bob Copeland
     
  • Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • Fixes spares warning:
    net/wireless/util.c:261:5: warning:
    symbol 'ieee80211_get_mesh_hdrlen' was not declared. Should it be static?

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

    Luis R. Rodriguez
     
  • This should help when reviewing issues regarding regulatory
    domain on ath5k/ath9k/ar9170.

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

    Luis R. Rodriguez
     
  • Handle error condition on copy_from_user() properly and
    make sure a NUL terminated char[] is sent to strict_strtoul()
    for proper conversion.

    Signed-off-by: Vasanthakumar Thiagarajan
    Signed-off-by: John W. Linville

    Vasanthakumar Thiagarajan
     
  • Which means removing all rfkill code since it only does
    soft-kill which cfg80211 will now handle in exactly the
    same way the driver did.

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

    Johannes Berg
     
  • 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
     
  • Sometimes it is necessary to know how the state is,
    and it is easier to query rfkill than keep track of
    it somewhere else, so add a function for that. This
    could later be expanded to return hard/soft block,
    but so far that isn't necessary.

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

    Johannes Berg
     
  • This patch introduces new cfg80211 API to set the TX power
    via cfg80211, puts the wext code into cfg80211 and updates
    mac80211 to use all that. The -ENETDOWN bits are a hack but
    will go away soon.

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

    Johannes Berg
     
  • The new code added by this patch will make rfkill create
    a misc character device /dev/rfkill that userspace can use
    to control rfkill soft blocks and get status of devices as
    well as events when the status changes.

    Using it is very simple -- when you open it you can read
    a number of times to get the initial state, and every
    further read blocks (you can poll) on getting the next
    event from the kernel. The same structure you read is
    also used when writing to it to change the soft block of
    a given device, all devices of a given type, or all
    devices.

    This also makes CONFIG_RFKILL_INPUT selectable again in
    order to be able to test without it present since its
    functionality can now be replaced by userspace entirely
    and distros and users may not want the input part of
    rfkill interfering with their userspace code. We will
    also write a userspace daemon to handle all that and
    consequently add the input code to the feature removal
    schedule.

    In order to have rfkilld support both kernels with and
    without CONFIG_RFKILL_INPUT (or new kernels after its
    eventual removal) we also add an ioctl (that only exists
    if rfkill-input is present) to disable rfkill-input.
    It is not very efficient, but at least gives the correct
    behaviour in all cases.

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

    Johannes Berg
     
  • This patch completely rewrites the rfkill core to address
    the following deficiencies:

    * all rfkill drivers need to implement polling where necessary
    rather than having one central implementation

    * updating the rfkill state cannot be done from arbitrary
    contexts, forcing drivers to use schedule_work and requiring
    lots of code

    * rfkill drivers need to keep track of soft/hard blocked
    internally -- the core should do this

    * the rfkill API has many unexpected quirks, for example being
    asymmetric wrt. alloc/free and register/unregister

    * rfkill can call back into a driver from within a function the
    driver called -- this is prone to deadlocks and generally
    should be avoided

    * rfkill-input pointlessly is a separate module

    * drivers need to #ifdef rfkill functions (unless they want to
    depend on or select RFKILL) -- rfkill should provide inlines
    that do nothing if it isn't compiled in

    * the rfkill structure is not opaque -- drivers need to initialise
    it correctly (lots of sanity checking code required) -- instead
    force drivers to pass the right variables to rfkill_alloc()

    * the documentation is hard to read because it always assumes the
    reader is completely clueless and contains way TOO MANY CAPS

    * the rfkill code needlessly uses a lot of locks and atomic
    operations in locked sections

    * fix LED trigger to actually change the LED when the radio state
    changes -- this wasn't done before

    Tested-by: Alan Jenkins
    Signed-off-by: Henrique de Moraes Holschuh [thinkpad]
    Signed-off-by: Johannes Berg
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • nl80211_michael_mic_failure can be called in atomic context but
    does a GFP_KERNEL allocation. Fixes the error below:

    [ 126.793225] BUG: sleeping function called from invalid context at mm/slab.c:3055
    [ 126.793234] in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper
    [ 126.793241] 2 locks held by swapper/0:
    [ 126.793246] #0: (&sc->rxbuflock){+.-.+.}, at: [] ath5k_tasklet_rx+0x34/0x55e [ath5k]
    [ 126.793294] #1: (rcu_read_lock){.+.+.+}, at: [] __ieee80211_rx+0x7e/0x563 [mac80211]
    [ 126.793342] Pid: 0, comm: swapper Not tainted 2.6.30-rc7-wl #124
    [ 126.793347] Call Trace:
    [ 126.793361] [] ? __debug_show_held_locks+0x1e/0x20
    [ 126.793380] [] __might_sleep+0x100/0x107
    [ 126.793386] [] kmem_cache_alloc+0x35/0x170
    [ 126.793393] [] ? __alloc_skb+0x2e/0x117
    [ 126.793397] [] ? mark_held_locks+0x43/0x5b
    [ 126.793402] [] __alloc_skb+0x2e/0x117
    [ 126.793419] [] nl80211_michael_mic_failure+0x2a/0x1fa [cfg80211]
    [ 126.793425] [] ? trace_hardirqs_on_caller+0xf6/0x130
    [ 126.793430] [] ? trace_hardirqs_on+0xb/0xd
    [ 126.793444] [] cfg80211_michael_mic_failure+0x30/0x38 [cfg80211]
    [ 126.793463] [] mac80211_ev_michael_mic_failure+0xfd/0x108 [mac80211]
    [ 126.793480] [] ieee80211_rx_h_michael_mic_verify+0xd4/0x117 [mac80211]
    [ 126.793499] [] ieee80211_invoke_rx_handlers+0xdde/0x1963 [mac80211]
    [ 126.793505] [] ? sched_clock+0x3f/0x64
    [ 126.793511] [] ? sched_clock+0x3f/0x64
    [ 126.793516] [] ? trace_hardirqs_off+0xb/0xd
    [ 126.793521] [] ? sched_clock+0x3f/0x64
    [ 126.793526] [] ? __lock_acquire+0x62c/0x1271
    [ 126.793545] [] __ieee80211_rx_handle_packet+0x543/0x564 [mac80211]
    [ 126.793564] [] __ieee80211_rx+0x4e2/0x563 [mac80211]
    [ 126.793577] [] ath5k_tasklet_rx+0x4e4/0x55e [ath5k]
    [ 126.793583] [] ? restore_nocheck_notrace+0x0/0xe
    [ 126.793589] [] tasklet_action+0x92/0xe5
    [ 126.793594] [] __do_softirq+0xb1/0x182
    [ 126.793599] [] do_softirq+0x30/0x48
    [ 126.793603] [] irq_exit+0x3d/0x74
    [ 126.793609] [] do_IRQ+0x76/0x8c
    [ 126.793613] [] common_interrupt+0x2e/0x34
    [ 126.793618] [] ? timer_list_show+0x277/0x939
    [ 126.793630] [] ? acpi_idle_enter_bm+0x266/0x291 [processor]
    [ 126.793636] [] cpuidle_idle_call+0x6a/0x9c
    [ 126.793640] [] cpu_idle+0x53/0x87
    [ 126.793645] [] rest_init+0x6c/0x6e
    [ 126.793651] [] start_kernel+0x286/0x28b
    [ 126.793656] [] __init_begin+0x37/0x3c

    Signed-off-by: Bob Copeland
    Signed-off-by: John W. Linville

    Bob Copeland
     
  • This patch is to incorporate Dan Williams' comments for commit:
    "libertas: implement function init/shutdown commands for SD8688"

    1. remove fn_init_required and fn_shutdown_required variables from
    lbs_private structure. If required, __lbs_cmd() will be called
    directly to send function init/shutdown command for SD8688 in
    if_sdio_probe() or if_sdio_remove() callback.

    2. add global variable "user_rmmod" to distinguish between the module
    removal case and the card removal case. This flag will be checked in
    if_sdio_remove() against SD8688 card to determine whether or not the
    function shutdown command needs to be sent.

    3. remove "card" from if_sdio_model structure as it cannot store
    card pointers for multiple cards. Besides, it's no longer needed
    to store the "card" pointer with changes #1 & #2 above.

    Signed-off-by: Bing Zhao
    Acked-by: Dan Williams
    Signed-off-by: John W. Linville

    Bing Zhao
     
  • We're going to remove the FIRMWARE_NAME_MAX definition in order to avoid any
    firmware name length restriction.
    This patch gets rid of the statically allocated p54usb firmware string, and
    replaces them with const char pointers.

    Signed-off-by: Samuel Ortiz
    Signed-off-by: John W. Linville

    Samuel Ortiz
     
  • iwmc3200wifi: trim down calibration firmware name

    The patch trims down iwmc3200wifi calibration firmware name from
    iwmc3200wifi-lmac-calib-sdio.bin to iwmc3200wifi-calib-sdio.bin. We can
    shorten the firmware name because all calibration is done by LMAC.

    Signed-off-by: Samuel Ortiz
    Signed-off-by: Zhu Yi
    Signed-off-by: John W. Linville

    Samuel Ortiz
     
  • "[PATCH 3/4 v2] ar9170: fix LED power state handling" revealed
    a bug which can cause a ugly crash.

    The delayed worker is canceled before the LED class functions are
    unregistered... So, if something manages to update the LEDs
    while unregister routine is running the timer could fire _after_ the
    module has been unloaded.

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

    Christian Lamparter
     
  • This patch contains a few more mostly random fixes for the USB front-end.

    1. handle irq command response, instead of printing it to the console.

    2. remove fixed FIXME.
    (real fix: "ar9170usb: reset device on resume". )

    3. some more one-liner.
    - get rid of a useless "return;"
    - add a few branch prediction hints in hot-paths
    etc.

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

    Christian Lamparter
     
  • This patch takes care of Johannes' deadlock report by moving the
    mutex_lock right after cancel_work_sync in ar9170_op_stop.

    Besides, the janitor does not need to hold the mutex anymore,
    so this extra lines can be removed as well.

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

    Christian Lamparter
     
  • This patch fixes a minor visual bug in the led code, which
    left the LED in the wrong power state when it was toggled
    in a _unexpected_ way (e.g: enabling the LED twice).

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

    Christian Lamparter
     
  • This patch removes a redundant flag.

    .cap = IEEE80211_HT_CAP_MAX_AMSDU | \
    > IEEE80211_HT_CAP_SM_PS | \ <
    [...] \
    > IEEE80211_HT_CAP_SM_PS, \ <
    .ampdu_factor = 3, \

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

    Christian Lamparter
     
  • This patch fixes a bug in configure_filter's (sub-)routines.
    We never really cleared the flags once we updated the hardware state,
    so we wasted our resources by applying already active settings.

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

    Christian Lamparter
     
  • This patch introduces 3 new function which are used to update
    the MAC state, whenever needed... e.g: after a band switch.

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

    Christian Lamparter
     
  • This patch replace a few constant magics which may affected
    the device when operating in a 40MHz channel.

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

    Christian Lamparter
     
  • This patch only contains a few uncritical updates for the
    hardware definition header.

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

    Christian Lamparter
     
  • This patch fixes a simple copy & paste error that affected beacon
    transmission in 802.11a mode.

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

    Christian Lamparter
     
  • This removes the use of the deprecated radio_enabled setting
    and code associated with that.

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

    Johannes Berg
     
  • This fixes an incorrect assumption (BUG_ON) made in
    cfg80211 when handling country IE regulatory requests.
    The assumption was that we won't try to call_crda()
    twice for the same event and therefore we will not
    recieve two replies through nl80211 for the regulatory
    request. As it turns out it is true we don't call_crda()
    twice for the same event, however, kobject_uevent_env()
    *might* send the udev event twice and/or userspace can
    simply process the udev event twice. We remove the BUG_ON()
    and simply ignore the duplicate request.

    For details refer to this thread:

    http://marc.info/?l=linux-wireless&m=124149987921337&w=2

    Cc: stable@kernel.org
    Reported-by: Maxim Levitsky
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • NETDEV_UP is called after the device is set UP, but sometimes
    it is useful to be able to veto the device UP. Introduce a
    new NETDEV_PRE_UP notifier that can be used for exactly this.
    The first use case will be cfg80211 denying interfaces to be
    set UP if the device is known to be rfkill'ed.

    Signed-off-by: Johannes Berg
    Acked-by: David S. Miller
    Signed-off-by: John W. Linville

    Johannes Berg
     
  • This adds:

    USB 0x057C:0x8401 AVM FRITZ!WLAN USB Stick N
    USB 0x057C:0x8402 AVM FRITZ!WLAN USB Stick N 2.4

    These devices require the 1-stage firmware, if not present we
    don't continue.

    Cc: Peter Grabienski
    Cc: Stephen Chen
    Cc: Michael Fortin
    Cc: Johnny Cheng
    Cc: Yuan-Gu Wei
    Cc: Joerg Albert
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • You can get the stage 1 firmware from here:

    http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170/ar9170.fw

    md5sum: 34feec4ec0eae3bb92c7c1ea2dfb4530
    sha1sum: 6e5250498b815c2940d97242de31e054ae44e079

    Its license:

    http://www.kernel.org/pub/linux/kernel/people/mcgrof/firmware/ar9170/LICENSE

    This is a new firmware, tested with WNDA3100.

    Cc: Peter Grabienski
    Cc: Stephen Chen
    Cc: Michael Fortin
    Cc: Johnny Cheng
    Cc: Yuan-Gu Wei
    Cc: Joerg Albert
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • It looks like mac80211 can request the driver to start beaconing with
    a beacon interval of zero in some cases (at least for mesh point). This
    does not sound correct and something may need to be fixed in
    mac80211. However, taken into account the unpleasantness of getting
    stuck in an infinite busy loop with rtnl_lock held, let's add a quick
    workaround in the driver to avoid the worst symptom while someone more
    familiar with the mesh implementation can figure out what should be done
    with mac80211 as far as beacon interval configuration is concerned.

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

    Jouni Malinen
     
  • ieee80211_conf->beacon_int was deprecated and removed in a cleanup
    patch, however it was accidentally added back to ath5k in the change
    "ath5k: Allow user/driver to set txpower." Remove it once more,
    fixing the following warning:

    [13091.968902] WARNING: at drivers/net/wireless/ath/ath5k/base.c:2167 warn_slowpath_null+0x15/0x1a()
    [13091.968906] Hardware name: MacBook1,1
    [13091.968909] Modules linked in: usb_storage fuse i915 drm af_packet acpi_cpufreq binfmt_misc dm_mirror dm_region_hash dm_log dm_multipath dm_mod snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_seq_dummy hid_apple arc4 ecb snd_seq_oss snd_seq_midi_event usbhid snd_seq ath5k mac80211 appletouch snd_seq_device snd_pcm_oss snd_mixer_oss sky2 snd_pcm ath processor cfg80211 snd_timer sg ohci1394 snd uhci_hcd bitrev ieee1394 joydev ehci_hcd crc32 snd_page_alloc button ac thermal battery sr_mod applesmc cdrom evdev input_polldev unix [last unloaded: microcode]
    [13091.968985] Pid: 2132, comm: phy0 Tainted: G W 2.6.30-rc5-wl #118
    [13091.968988] Call Trace:
    [13091.968994] [] warn_slowpath_fmt+0x77/0xa6
    [13091.969003] [] ? _spin_unlock+0x2c/0x41
    [13091.969008] [] ? _spin_lock_irqsave+0x15/0x69
    [13091.969012] [] ? _spin_unlock_irqrestore+0x34/0x5d
    [13091.969019] [] ? trace_hardirqs_off+0xb/0xd
    [13091.969024] [] ? _spin_unlock_irqrestore+0x34/0x5d
    [13091.969029] [] ? trace_hardirqs_off+0xb/0xd
    [13091.969034] [] ? _spin_unlock_irqrestore+0x34/0x5d
    [13091.969039] [] warn_slowpath_null+0x15/0x1a
    [13091.969054] [] ath5k_beacon_update_timers+0x44/0x27f [ath5k]
    [13091.969059] [] ? vprintk+0x2dd/0x312
    [13091.969063] [] ? release_console_sem+0x1a6/0x1d3
    [13091.969076] [] ath5k_reset_tsf+0x1d/0x2c [ath5k]
    [13091.969095] [] __ieee80211_sta_join_ibss+0x35/0x3aa [mac80211]
    [13091.969102] [] ? extract_entropy+0x47/0x8a
    [13091.969121] [] ieee80211_sta_find_ibss+0x2de/0x32f [mac80211]
    [13091.969126] [] ? mutex_lock_nested+0x28b/0x2a5
    [13091.969145] [] ? ieee80211_ibss_notify_scan_completed+0x1c/0x6f [mac80211]
    [13091.969164] [] ieee80211_ibss_notify_scan_completed+0x57/0x6f [mac80211]
    [13091.969182] [] ieee80211_scan_completed+0x31a/0x33f [mac80211]
    [13091.969201] [] ieee80211_scan_work+0xcb/0x18b [mac80211]
    [13091.969207] [] worker_thread+0x1b1/0x28e
    [13091.969212] [] ? worker_thread+0x16c/0x28e
    [13091.969230] [] ? ieee80211_scan_work+0x0/0x18b [mac80211]
    [13091.969237] [] ? autoremove_wake_function+0x0/0x38
    [13091.969242] [] ? worker_thread+0x0/0x28e
    [13091.969246] [] kthread+0x4a/0x70
    [13091.971460] [] ? kthread+0x0/0x70
    [13091.971467] [] kernel_thread_helper+0x7/0x10
    [13091.971470] ---[ end trace 8defaa5d15c50cef ]---

    Signed-off-by: Bob Copeland
    Signed-off-by: John W. Linville

    Bob Copeland
     
  • When the SME requests to associate to an open AP
    ieee80211_sta_set_extra_ie() can be called with zero IE
    length. When this happens or when the extra IE has already
    been set -EALREADY is passed down and the supplicant will
    complain that the operation is already in progress and it will
    not let us associate. We correct this by treating -EALREADY
    from ieee80211_sta_set_extra_ie() as a success just as we do
    for wext.

    Cc: Shan.Palanisamy@Atheros.com
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: John W. Linville

    Luis R. Rodriguez
     
  • Signed-off-by: Cliff Cai
    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Acked-by: Dan Williams
    Signed-off-by: John W. Linville

    Cliff Cai
     
  • This patch adds the debug file to the ath9k debugfs, which lets you modify
    the debug_mask at runtime, without having to reload the ath9k module.

    Signed-off-by: Jeff Hansen
    Signed-off-by: John W. Linville

    Jeff Hansen
     
  • This patch combines the legacy and 11n rcstats into one, using the normal
    rate table indices instead of two separate indices for each mode. Legacy
    rates also get all of the PER and retry information, now, too.

    Signed-off-by: Jeff Hansen
    Signed-off-by: John W. Linville

    Jeff Hansen
     
  • I have a TrendNet 652-BRP running OpenWRT + ath9k very well. The only
    problem is that the beacon gets stuck maybe once a day. After
    Vasanthakumar Thiagarajan's "ath9k: cleanup beacon parameters
    configuration" patch, ath9k would nearly re-configure the beacons after it
    detected the stuck beacon, and did a reset. But it would fail the
    SC_OP_TSF_RESET check in ath_beacon_config_ap. This patch gets the beacon
    fully reconfigured after the reset.

    Signed-off-by: Jeff Hansen
    Signed-off-by: John W. Linville

    Jeff Hansen