Commit graph

633 commits

Author SHA1 Message Date
Tobias Doerffel e6a3b61681 ath5k: added cfg80211 based rfkill support
This patch introduces initial rfkill support for the ath5k driver
based on rfkill support in the cfg80211 framework.
All rfkill related code is separated into newly created rfkill.c.

Changes to existing code are minimal:

* added a new data structure ath5k_rfkill to the ath5k_softc structure
* inserted calls to HW rfkill init/deinit routines
* ath5k_intr() has been extended to handle AR5K_INT_GPIO interrupts

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-06-10 13:27:54 -04:00
Bob Copeland 72828b1b3c ath5k: disable beacon interrupt when interface is down
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 <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-06-03 14:06:15 -04:00
Bob Copeland 73ca520336 ath5k: remove conf->beacon_int usage
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]  [<c0125884>] warn_slowpath_fmt+0x77/0xa6
[13091.969003]  [<c03557d8>] ? _spin_unlock+0x2c/0x41
[13091.969008]  [<c0355a56>] ? _spin_lock_irqsave+0x15/0x69
[13091.969012]  [<c0355783>] ? _spin_unlock_irqrestore+0x34/0x5d
[13091.969019]  [<c01445bb>] ? trace_hardirqs_off+0xb/0xd
[13091.969024]  [<c0355783>] ? _spin_unlock_irqrestore+0x34/0x5d
[13091.969029]  [<c01445bb>] ? trace_hardirqs_off+0xb/0xd
[13091.969034]  [<c0355783>] ? _spin_unlock_irqrestore+0x34/0x5d
[13091.969039]  [<c01258c8>] warn_slowpath_null+0x15/0x1a
[13091.969054]  [<f965846d>] ath5k_beacon_update_timers+0x44/0x27f [ath5k]
[13091.969059]  [<c0126370>] ? vprintk+0x2dd/0x312
[13091.969063]  [<c0125e50>] ? release_console_sem+0x1a6/0x1d3
[13091.969076]  [<f96586c5>] ath5k_reset_tsf+0x1d/0x2c [ath5k]
[13091.969095]  [<f93f4426>] __ieee80211_sta_join_ibss+0x35/0x3aa [mac80211]
[13091.969102]  [<c0252793>] ? extract_entropy+0x47/0x8a
[13091.969121]  [<f93f4b21>] ieee80211_sta_find_ibss+0x2de/0x32f [mac80211]
[13091.969126]  [<c035422c>] ? mutex_lock_nested+0x28b/0x2a5
[13091.969145]  [<f93f4b8e>] ? ieee80211_ibss_notify_scan_completed+0x1c/0x6f [mac80211]
[13091.969164]  [<f93f4bc9>] ieee80211_ibss_notify_scan_completed+0x57/0x6f [mac80211]
[13091.969182]  [<f93f26da>] ieee80211_scan_completed+0x31a/0x33f [mac80211]
[13091.969201]  [<f93f27ca>] ieee80211_scan_work+0xcb/0x18b [mac80211]
[13091.969207]  [<c0133a6a>] worker_thread+0x1b1/0x28e
[13091.969212]  [<c0133a25>] ? worker_thread+0x16c/0x28e
[13091.969230]  [<f93f26ff>] ? ieee80211_scan_work+0x0/0x18b [mac80211]
[13091.969237]  [<c013736e>] ? autoremove_wake_function+0x0/0x38
[13091.969242]  [<c01338b9>] ? worker_thread+0x0/0x28e
[13091.969246]  [<c0137031>] kthread+0x4a/0x70
[13091.971460]  [<c0136fe7>] ? kthread+0x0/0x70
[13091.971467]  [<c0103527>] kernel_thread_helper+0x7/0x10
[13091.971470] ---[ end trace 8defaa5d15c50cef ]---

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-06-03 14:05:11 -04:00
John W. Linville 55aa4e0f16 ath5k: avoid leaking mutex in ath5k_config
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-06-03 14:05:08 -04:00
David S. Miller c649c0e31d Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/wireless/ath/ath5k/phy.c
	drivers/net/wireless/iwlwifi/iwl-agn.c
	drivers/net/wireless/iwlwifi/iwl3945-base.c
2009-05-25 01:42:21 -07:00
Zhu Yi e31a16d6f6 wireless: move some utility functions from mac80211 to cfg80211
The patch moves some utility functions from mac80211 to cfg80211.
Because these functions are doing generic 802.11 operations so they
are not mac80211 specific. The moving allows some fullmac drivers
to be also benefit from these utility functions.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-22 14:06:02 -04:00
Bob Copeland 9c8b3eddc0 ath5k: avoid and warn on potential infinite loop
If we are trying to interpolate a curve with slope == 0, the return
value will always be the y-coordinate.  In this code we are looping
until we reach a minimum y-coordinate on a line, which in the 0-slope
case can never happen, thus the loop never terminates.

The PCDAC steps come from the EEPROM and should never be equal, but
we should gracefully handle that case, so warn and bail out.

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-20 14:46:32 -04:00
Bob Copeland 1071db863b ath5k: update beacons in AP mode
ath5k only generated the beacon when bss_info_changed() was called,
but for AP mode this is not enough, because the TIM IE would never
get updated and consequently PS mode clients wouldn't know about
buffered frames.  Instead, get a new beacon on every SWBA interrupt.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-20 14:46:28 -04:00
David S. Miller bb803cfbec Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/scsi/fcoe/fcoe.c
2009-05-18 21:08:20 -07:00
Paride Legovini 84379cba44 Add LED support for AR5BXB6 IBM Thinkpad PCIe adapters
Add LED support on the IBM ThinkPad 11a/b/g Wireless LAN Mini Express
Adapter (AR5BXB6), found on the IBM/Lenovo Thinkpad X60/T60/Z60 series.

Signed-off-by: Paride Legovini <legovini@spiro.fisica.unipd.it>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:57 -04:00
Bob Copeland 6752ee90aa ath5k: use ctl settings based on current regdomain
Update ath5k to use the ctl settings for tx power based on current
regulatory domain.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:56 -04:00
Nick Kossifidis 57e6c56dbb ath5k: Add Spur filter support on newer chips
* Add spur filter support for RF5413 and later chips

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
 Signed-off-by: Bob Copeland <me@bobcopeland.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:56 -04:00
Nick Kossifidis 2bed03ebf6 ath5k: Implement antenna control
* Add code to support the various antenna scenarios supported by hw

 * For now hardcode the default scenario (single or dual omnis with
 tx/rx diversity working and tx antenna handled by session -hw keeps
 track on which antenna it got ack from each ap/station and maps each
 ap/station to one of the antennas-).

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
 Signed-off-by: Bob Copeland <me@bobcopeland.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:56 -04:00
Jiri Slaby 6f5f39c95a ath5k: Enable AP mode
After some debuging we were hitting the following bugs so far...

 * Due to huge channel list hostapd couldn't get infos from the driver
 and couldn't set the channel. If we manualy set the channel after
 hostapd starts (by setting channel to 0 -auto), beacons are sent
 but they wont show up on scan because they are malformed (they have
 channel = 0 because hostapd doesn't update the channel info -this is
 probably a hostapd bug so i'm CCing Jouni) and they get dropped. Bob
 fixed this by only allowing standard channels to be registered so
 now hostapd works as expected.

 * Docs (and HAL source) say that we must write 0 on timer0 when
 operating on AP mode to start TSF increment but this seems to
 mess with DBA in many cases and beacon queue never gets started.
 We fixed that on the previous patch.

 We have some more things to deal with...

 * For some reason (hw bug or something else) after restarting hostapd
 a few times, beacon inteval seems to change from 100ms to a sec
 (we get one beacon per sec).

 * We need to set sleep timers on STA mode and enable power saving +
 support PCF.

 ...but i think it's time we enable AP support "officialy" so that
 we can get more feedback from users. I ran ath5k with the mentioned
 patches + hostapd 0.6.8 and AP mode worked fine (it had some less
 throughput on my tests than IBSS but it worked).

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
 Signed-off-by: Bob Copeland <me@bobcopeland.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:56 -04:00
Nick Kossifidis 428cbd4ff4 ath5k: Beaconing fixes
* Write next beacon timer even on AP mode since without this we get
 no beacons + ath9k does it too.  Docs say that we must write 0 on
 this register on AP mode to start TSF increment, we do both to be
 on the safe side.

 * Fix num_tx_pending function, we never read the register :P that's
 why we got all those "beacon queue 7 didn't stop messages".

 * Put full prioriy on beacon queue, lock all queues with lower
 priority using the arblock and also bypass any arblock by seting
 the arblock ignore flag.

 * For the CAB queue (do we need this thing ?, it seems crap) since
 it's supposed to fire up after each beacon (we don't use it on driver
 part, ath9k/MadWiFi does), don't make it DBA gated but instead make
 it fire after each beacon by using the beacon sent gated flag.

 * Increase bmiss threshold to 10, that's what we used on MadWiFi for
 a long time. Also when we have pending frames on the beacon queue (we
 got a beacon that didn't make it on the air) it's more likely that
 the beacon queue never started, probably due to faulty DBA setting,
 so change that "beacon queue didn't stop" message.

 Tested this with AP mode and IBSS mode and seems to work fine ;-)

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
 Signed-off-by: Bob Copeland <me@bobcopeland.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:55 -04:00
Nick Kossifidis 1889ba0a48 ath5k: Put remaining EEPROM data on ee struct
* Put remaining EEPROM information on ee struct and remove is_hb63
 function.

 Now we also have rfkill stuff available.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
 Signed-off-by: Bob Copeland <me@bobcopeland.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:55 -04:00
Nick Kossifidis cd41751908 ath5k: Read Spur channels from EEPROM
* Read Spur channel information from EEPROM and use default channels
 for RF5413 compatible chips that don't have this info on EEPROM.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
 Signed-off-by: Bob Copeland <me@bobcopeland.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:55 -04:00
Nick Kossifidis a082381044 ath5k: Allow user/driver to set txpower
* Now that we have regulatory control enable the driver to set
 txpower on hw

 * Also use txpower table offset so that we can match
 power range set by user/driver with indices on power table.

 Tested 2 different cards (a CM9 and an RF5112-based ubnt) and got
 the same output using a remote machine to measure per-packet rssi
 (conected the cards using attenuators). I also switched between
 various tx power levels and i saw an equal power change on the remote
 machine (so txpower changes as expected) and verified that we have
 the same output on each rate.

 Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
 Signed-off-by: Bob Copeland <me@bobcopeland.com>

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:55 -04:00
Bob Copeland 2516baa63b ath5k: correct interrupt storm warning
Ben Greear points out that the "too many interrupts" message will
never print in the intended case since the interrupt counter
will be -1 after the loop.  Change it to pre-decrement so it will
be 0 on the thousandth iteration.

Cc: Ben Greear <greearb@candelatech.com>

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:50 -04:00
Tobias Klauser bbb33881ae ath5k: Storage class should be before const qualifier
commit 8e218fb24f reverted the previous
patch (commit 925be8a307).

The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the
beginning of the declaration specifiers in a declaration is an
obsolescent feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:49 -04:00
Jiri Slaby ded7a7eaab ath5k: 5211, don't crypt every protected frame
Set null key type even on ar5211, otherwise it en/decrypts every frame with
protected bit set which renders the card unusable on encrypted networks.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
Cc: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:41 -04:00
Johannes Berg 2d0ddec5b2 mac80211: unify config_interface and bss_info_changed
The config_interface method is a little strange, it contains the
BSSID and beacon updates, while bss_info_changed contains most
other BSS information for each interface. This patch removes
config_interface and rolls all the information it previously
passed to drivers into bss_info_changed.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:36 -04:00
Johannes Berg 57c4d7b4c4 mac80211: clean up beacon interval settings
We currently have two beacon interval configuration knobs:
hw.conf.beacon_int and vif.bss_info.beacon_int. This is
rather confusing, even though the former is used when we
beacon ourselves and the latter when we are associated to
an AP.

This just deprecates the hw.conf.beacon_int setting in favour
of always using vif.bss_info.beacon_int. Since it touches all
the beaconing IBSS code anyway, we can also add support for
the cfg80211 IBSS beacon interval configuration easily.

NOTE: The hw.conf.beacon_int setting is retained for now due
      to drivers still using it -- I couldn't untangle all
      drivers, some are updated in this patch.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-05-06 15:14:33 -04:00
David S. Miller aba7453037 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	Documentation/isdn/00-INDEX
	drivers/net/wireless/iwlwifi/iwl-scan.c
	drivers/net/wireless/rndis_wlan.c
	net/mac80211/main.c
2009-04-29 20:30:35 -07:00
Bob Copeland 26925042b6 ath5k: manipulate rxlink and descriptor address under rxbuf lock
Grabbing an ath5k_buf then dropping the lock is racy because the
referenced descriptor can be obtained in another thread and released
before the buffer is handed to the hardware.  Likewise, manipulating
sc->rxlink without the lock can lead to having multiple self-linked
hardware descriptors.

Changes-licensed-under: 3-Clause-BSD

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-04-22 16:57:15 -04:00
Bob Copeland c57ca81576 ath5k: use rx hw descriptor pointer for self-linked check
This patch simplifies the code used to detect when the
self-linked DMA buffer is still in use by hardware, by
checking the hardware's rxdp register instead of looking
at the software buffer list.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-04-22 16:57:14 -04:00
Bob Copeland 46802a4f07 ath5k: use bool for modparams
Current code uses int types, but both modparams are boolean values.

Changes-licensed-under: 3-Clause-BSD

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-04-22 16:57:14 -04:00
Bob Copeland 56d2ac7638 ath5k: use tasklet_hi_schedule for beacon queue
For embedded platforms, beacon transmission can be starved when
flooded with data packets.  Prioritize beacons by giving the beacon
queue the first shot when the isr completes.

Changes-licensed-under: 3-Clause-BSD

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-04-22 16:57:14 -04:00
Bob Copeland 77ded01cc2 ath5k: fix initvals errors
This patch corrects a few errors in the initvals tables to match those
in the HAL tables.  Namely, remove a couple of repetitions, fix some
turbo mode errors, and correct a register for the CCK rate power table.

Changes-licensed-under: ISC

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-04-22 16:57:14 -04:00
Bob Copeland 6a362bb1c9 ath5k: add support for Fukato Datacask Jupiter LEDs
This adds support for the LEDs on the Jupiter netbook.

Reported-by: Martin Bammer <mrb74@gmx.at>

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-04-22 16:54:41 -04:00
Fabio Rossi 64cdb0e3b8 ath5k: fix interpolation with equal power levels
When the EEPROM contains weird values for the power levels we have to
fix the interpolation process.

Signed-off-by: Fabio Rossi <rossi.f@inwind.it>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-04-22 16:54:40 -04:00
Luis R. Rodriguez 75c2148fa5 ath5k: sparse fix ath5k_led_on needs to be static
drivers/net/wireless/ath/ath5k/led.c:81:6: warning:
symbol 'ath5k_led_on' was not declared. Should it be static?

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-04-22 16:54:39 -04:00
Luis R. Rodriguez 203c4805e9 atheros: put atheros wireless drivers into ath/
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-04-22 16:54:38 -04:00