Commit Graph

67600 Commits

Author SHA1 Message Date
Christian Lamparter 6d541a684d p54usb: fix stalls caused by urb allocation failures
This patch squashes a few old bugs, which have been around since
the initial version of p54usb in one form or another.

we never freed a orphaned frame, when were denied the resources,
which are necessary to pass the data into the usb subsystem.
As a result we could end up with a full queue that wasn't emptied,
until the device was brought down.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:30 -04:00
Bob Copeland 3355443ad7 ath5k: write PCU registers on initial reset
"Ath5k: unify resets"
introduced a regression into 2.6.28 where the PCU registers are never
initialized, due to ath5k_reset() always passing true for change_channel.
We subsequently program a lot of these registers but several may start
in an unknown state.

Cc: stable@kernel.org
Reported-by: Forrest Zhang <forrest@hifulltech.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:29 -04:00
Bob Copeland 0d0cd72fa1 ath5k: do not release irq across suspend/resume
Paraphrasing Rafael J. Wysocki: "drivers should not release PCI IRQs
in suspend."  Doing so causes a warning during suspend/resume on some
platforms.

Cc: Rafael J. Wysocki <rjw@sisk.pl>
Reported-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:29 -04:00
Bob Copeland 88f6bfe182 ath: remove unnecessary return in ath_regd_get_band_ctl
'default' case already returns NO_CTL

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:29 -04:00
Bob Copeland 21800491cc ath5k: rework beacon configuration
Using the enable_beacon flag allows some simplifications and fixes
some corner cases in beacon handling.  This change adds a state
variable for beaconing in ath5k_beacon_config and handles both
enabling and disabling, thus eliminating the need for
ath5k_beacon_disable.  We also now configure the beacon when any
of the beacon parameters change, so ath5k_beacon_reconfig is no
longer needed (its mmiowb gets moved to ath5k_beacon_config).
Finally, by locking around the whole config function, we don't
need to worry about clearing the interrupt mask register before
installing the new mask.

The upshot is this correctly disables beaconing when the interfaces
are taken down, it fixes a potential restarting of beaconing
when ath5k_reset() is called, and ensures that updates to the
beacon interval take effect immediately.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:29 -04:00
Bob Copeland cec8db2301 ath5k: send buffered frames after the beacon
Enable the "Content" After Beacon queue and utilize it to send
any buffered frames for power-saving clients.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:28 -04:00
Christian Lamparter 0859339b5c p54spi: remove dead code and definitions
This patch removes some dead code:
p54spi.c:115: warning: ‘p54spi_read16’ defined but not used

and while we're at it, p54spi_registers_array is purged as well.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:28 -04:00
Christian Lamparter a7eee06b87 p54: two endian fixes
This patch fixes all CHECK_ENDIAN complains:

1. p54/fwio.c:296:6: warning: restricted __le32 degrades to integer
    p54/fwio.c:296:6: warning: restricted __le32 degrades to integer

2. p54/p54spi.c:172:32: warning: incorrect type in initializer
   p54spi.c:172:32:    expected restricted __le32 [usertype] buffer
   p54/p54spi.c:172:32:    got unsigned int

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:28 -04:00
Ivo van Doorn e47a5cddf8 rt2x00: use wiphy rfkill interface
Remove the input_polldev from rt2x00 and replace it with
the rfkill interface offered by the wiphy structure. This
simplifies the entire rfkill handling in rt2x00 and allows
us to remove the CONFIG_RT2X00_LIB_RFKILL option and always
enables rfkill capabilities.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:27 -04:00
Johannes Berg b623a9f7c4 iwlwifi: fix aggregation limit
According to the documentation, the limit is 0x3f == 63, not 64.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:27 -04:00
Jiri Slaby 9d49e861a5 ath9k: remove permissions from debugfs files
Don't allow users to open debugfs files, because it can cause oopses.

When a user opens some file, driver unlinks it and frees the
corresponding structure, we will dereference freed memory.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:26 -04:00
Jiri Slaby 31670070ff ath5k: remove permissions from debugfs files
Don't allow users to open debugfs files, because it can cause oopses.

When a user opens some file, driver unlinks it and frees the
corresponding structure, we will dereference freed memory.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:26 -04:00
Joe Perches 6badaaf772 drivers/net/wireless/ath/ath9k: Remove unnecessary semicolons
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:26 -04:00
Reinette Chatre 7ac487260e iwlwifi: always print buffer when error condition occurs
We want to see the buffer contents when the error occurs without
needing to set any debug flags.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:26 -04:00
Reinette Chatre 68021b966b iwlwifi: add utility to print buffer when error occurs
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:26 -04:00
Reinette Chatre f55e668f90 iwlagn: re-enable PS support for iwlagn
The register locking rework addressed the problem where nic
access was obtained incorrectly when PS is enabled.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:25 -04:00
Zhu Yi 19a42803f3 iwmc3200wifi: remove B0 hardware support
The patch removes B0 hardware support. Nobody is using it anyway.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:25 -04:00
Zhu Yi fd2c7fe0b4 iwmc3200wifi: simplify calibration map
The patch simplifies calibration map by combining the init_calib_map
and periodic_calib_map into one calib_map in struct iwm_conf. Now the
initial calibration map is stored in the lower 16 bits of calib_map
and the periodic calibration map is stored in the higher 16 bits.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:25 -04:00
Zhu Yi dd13fd6498 iwmc3200wifi: replace netif_rx with netif_rx_ni
The patch uses netif_rx_ni() over netif_rx() to post buffers to
upper network code because it is always scheduled in a workqueue.
The problem was first observed from a dynamic ticks warning:

    "NOHZ: local_softirq_pending ..."

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:25 -04:00
Joe Perches 8ab0ea7727 drivers/net/wireless: Use PCI_VDEVICE
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:25 -04:00
Senthil Balasubramanian 140add2135 ath9k: Handle different TX and RX streams properly.
This patch fixes an issue when the TX and RX streams are different.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:24 -04:00
Senthil Balasubramanian e5f0921a95 ath9k: race condition in SCANNING state check during ANI calibration
ANI calibration shouldn't be done when we are not on our home channel.
This is already verified. However, it is racy. Fix this by proper
spin locks.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:24 -04:00
Senthil Balasubramanian f38faa31e0 ath9k: stop ani when the STA gets disconnected.
ANI is not required when the STA is disconnected. So stop it and enable
ANI for adhoc and monitor mode.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:24 -04:00
Senthil Balasubramanian 2664f201ef ath9k: remove unnecessary STATION mode check.
Remove unncessary STATION mode check in ath9k_bss_assoc_info() as
it is called only for STATION mode.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:24 -04:00
Christian Lamparter d8c9210757 p54: Modify p54 files for new organization
Modify the remaining p54 files to account for the new file organization.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:02:24 -04:00
Christian Lamparter 0a5fb84f6b p54: Move TX/RX code
Copy the TX/RX code from p54common.c into a new file txrx.c

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:59 -04:00
Christian Lamparter 0ac0d6cedf p54: Move mac80211 glue code
Copy the mac80211 glue code from p54common.c into a new file main.c

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:58 -04:00
Christian Lamparter 0533f79699 p54: Move LMAC interface definitions
Copy the LMAC Interface specific definitions from p54common.h into a new file lmac.h

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:58 -04:00
Christian Lamparter 0597c0141c p54: Move LED code
Copy the LED code from p54common.c into a new file led.c

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:58 -04:00
Christian Lamparter 76074e1670 p54: Move firmware code
Copy the firmware i/o code from p54common.c into a new file fwio.c

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:58 -04:00
Christian Lamparter 289b098c27 p54: Move eeprom header
Copy the eeprom code from p54common.h into a new file eeprom.h

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:58 -04:00
Christian Lamparter 4c8a32f571 p54: Move eeprom code
Copy the eeprom code from p54common.c into a new file eeprom.c

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:57 -04:00
Roel Kluin 35a0ace773 wireless: remove redundant tests on unsigned
bufsize and remainder are unsigned. When negative they are wrapped and caught by
the other test.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:57 -04:00
Christian Lamparter 1795378ee8 p54: redo rx_status into skb->cb
This patch slightly optimizes p54_rx_data's stack and code size.

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:57 -04:00
Christian Lamparter 92179986ba ar9170usb: module link in sysfs
Andrey Yurovsky reported that the driver forwarded erroneously the
parent device structure instead of the real thing, which of course
led to some dodgy sysfs links (at least?).

Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:57 -04:00
Tomas Winkler 2c2f3b3388 iwlwifi: unify iwl_setup_rxon_timing
This patch unifies setup_rxon_timing funcions
of AGN and 3945. HWs differ only in supported maximal
beacon interval. This is reflected in hw_paras.max_beacon_itrvl

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:57 -04:00
Johannes Berg 4e05c2347a iwlwifi: scan requested channels only
When userspace requests only certain channels to be scanned,
we currently ignore that request entirely.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:56 -04:00
Johannes Berg 45af81956e iwlwifi: make software queue assignment more efficient
There really is no reason to be assigning txq->swq_id all the
time, once at aggregation setup is sufficient.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:56 -04:00
Tomas Winkler 90e8e424d9 iwlwifi: drop sw_crypto from hw_params.
Each HW supported by iwlwifi is capable of hardware crypto
so drop this flag from hw_params structure.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:56 -04:00
Mohamed Abbas 3354a0f6a3 iwlwifi: Check HW ready before prepare card.
Hardware may be ready for us to manage it without us trying to prepare
it first. Check if this is the case.

Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:55 -04:00
Luis R. Rodriguez 7d5ca3b8b2 ath9k: differentiate quality reporting between legacy and HT configurations
We were not differentiating quality between legacy and HT
configurations. We change this to consider the differences.

New theory for reporting quality:

At a hardware RSSI of 45 you will be able to use MCS 7  reliably.
At a hardware RSSI of 45 you will be able to use MCS 15 reliably.
At a hardware RSSI of 35 you should be able use 54 Mbps reliably.

MCS 7  is the highets MCS index usable by a 1-stream device.
MCS 15 is the highest MCS index usable by a 2-stream device.

All ath9k devices are either 1-stream or 2-stream.

How many bars you see is derived from the qual reporting.

A more elaborate scheme can be used here but it requires tables
of SNR/throughput for each possible mode used. For the MCS table
you can refer to the wireless wiki:

http://wireless.kernel.org/en/developers/Documentation/ieee80211/802.11n

This should fix this bug report:

http://bugzilla.kernel.org/show_bug.cgi?id=13537

Cc: Janath.Peiris@atheros.com
Cc: Matt.Smith@atheros.com
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:55 -04:00
Andrey Yurovsky 23b149c189 libertas: fix card cleanup order in SDIO driver
The SDIO driver sets the surpriseremoved flag before calling
lbs_remove_card.  With IEEE PS enabled, lbs_remove_card must issue a
command to exit IEEE PS mode, however with that flag set the command
path is blocked and the card is never taken out of IEEE PS mode.  This
step is required to ensure that the driver can be reloaded.  This patch
moves the setting of surpriseremoved after lbs_remove_card is called.

Tested with V9 firmware by ensuring that IEEE PS is disabled when the
driver is removed.  Reloading the driver is not fully tested due to a
separate issue with module reload in the SDIO driver, however this
patch at least leaves the card in a better state when we bring the
driver down.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:55 -04:00
Andrey Yurovsky efcfd1f28f libertas: correct card cleanup order in SPI driver
The SPI driver does a couple of card cleanup steps in the wrong order on
module removal.  If IEEE PS is enabled, this results in the card being
left in IEEE PS mode and subsequent failures to reload the module.  The
problem is that the surpriseremoved flag is set before calling
lbs_remove_card, but that function needs to issue a command to exit IEEE
PS mode (the flag blocks the command path).  In addition, lbs_stop_card
should be called first because it clears out any pending commands.

Tested on a GSPI device with V9 firmware by confirming that we can
reload the module with or without IEEE PS enabled.

Also fix a warning from the wrong uint format in a printk.

V2: use z modifier, thanks Sebastian.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:55 -04:00
Andrey Yurovsky ce8d096dac libertas: copy WPA keys to priv when associating
Libertas currently maintains a copy of the WPA unicast and group keys
when using WPA or WPA2.  This copy is checked when deciding whether or
not to return to sleep in IEEE PS mode but the actual copying back to
priv was omitted, which breaks IEEE PS mode with WPA/WPA2 when one
issues commands that require temporarily keeping the device awake.

This patch introduces the omitted copy-back of the keys so that IEEE PS
functions correctly in WPA/WPA2 mode.  Thanks to Dan Williams for
clearing up the issue.

V2: fix typo.  Also, this has been tested on GSPI and SDIO with V9 firmware.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:54 -04:00
David Kilroy 4244f41a04 orinoco: fix printk format specifier for size_t arguments
This addresses the following compile warnings on 64-bit platforms.

drivers/net/wireless/orinoco/scan.c: In function 'orinoco_add_hostscan_results':
drivers/net/wireless/orinoco/scan.c:194: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
drivers/net/wireless/orinoco/scan.c:211: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
drivers/net/wireless/orinoco/scan.c:211: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:54 -04:00
Johannes Berg bc92afd920 cfg80211: implement iwpower
Just on/off and timeout, and with a hacky cfg80211 method
until we figure out what we want, though this is probably
sufficient as we want to use pm_qos for wifi everywhere.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:51 -04:00
Johannes Berg aff89a9b90 cfg80211: introduce nl80211 testmode command
This introduces a new NL80211_CMD_TESTMODE for testing
and calibration use with nl80211. There's no multiplexing
like like iwpriv had, and the command is not available by
default, it needs to be explicitly enabled in Kconfig and
shouldn't be enabled in most kernels.

The command requires a wiphy index or interface index to
identify the device to operate on, and the new TESTDATA
attribute. There also is API for sending replies to the
command, and testmode multicast messages (on a testmode
multicast group).

I've also updated mac80211 to be able to pass through the
command to the driver, since it itself doesn't implement
the testmode command.

Additionally, to give people an idea of how to use the
command, I've added a little code to hwsim that makes use
of the new command to set the powersave mode, this is
currently done via debugfs and should remain there, and
the testmode command only serves as an example of how to
use this best -- with nested netlink attributes in the
TESTDATA attribute. A hwsim testmode tool can be found at
http://git.sipsolutions.net/hwsim.git/. This tool is BSD
licensed so people can easily use it as a basis for their
own internal fabrication and validation tools.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:50 -04:00
John W. Linville c0acf38e0b mac80211_hwsim: fix-up build damage from removal of skb->dst
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:48 -04:00
Gabor Juhos 293dc5dfdb ath9k: remove ath_rx_ps_back_to_sleep helper
This helper only clears the SC_OP_WAIT_FOR_{BEACON,CAB} flags.
Remove it and clear these flags directly in the approptiate
places instead.

Changes-licensed-under: ISC
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:47 -04:00
Gabor Juhos b7351a003c ath9k: remove unnecessary clearing of SC_OP_WAIT_{BEACON,CAB} flags
All SC_OP_WAIT_* flags will be cleared in 'ath9k_conf' when PS mode
is disabled, so we don't have to clear it here.

Changes-licensed-under: ISC
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:47 -04:00
David Kilroy b5c4691089 orinoco: remove WE nickname support
Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:47 -04:00
David Kilroy 934fd51a94 orinoco: convert giwrange to cfg80211
Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:47 -04:00
David Kilroy c63cdbe8f8 orinoco: convert scanning to cfg80211
This removes the custom scan cache used by orinoco.

We also have to avoid calling cfg80211_scan_done from the hard
interrupt, so we offload the entirety of scan processing to a workqueue.

This may behave strangely if you start scanning just prior to
suspending...

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:46 -04:00
David Kilroy 5217c571c8 orinoco: convert mode setting to cfg80211
Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:46 -04:00
David Kilroy 721aa2f75b orinoco: provide generic commit function
This allows changes to be commited from cfg80211 functions.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:46 -04:00
David Kilroy 6415f7df10 orinoco: Handle suspend/restore in core driver
Each device does almost exactly the same things on suspend and resume
when upping and downing the interface. So move this logic into a common
routine.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:46 -04:00
David Kilroy ef96b5c9ed airport: store irq in card private structure
... instead of relying on the net_device fields.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:45 -04:00
David Kilroy 5381956b78 orinoco: move netdev interface creation to main driver
With the move to cfg80211 it's nice to keep the hardware operations
distinct from the interface, even though we can only support a single
interface.

This also means the driver resembles other cfg80211 drivers.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:45 -04:00
David Kilroy 35832c50d1 orinoco: make firmware download less verbose
The firmware download code has been in a couple of releases, without any
significant issues reported in this code.

Convert to use pr_debug, so the messages can be recoverred by defining
DEBUG.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:45 -04:00
David Kilroy ea60a6aaf5 orinoco: initiate cfg80211 conversion
Initialise and register a wiphy.

Store the orinoco_private structure in the new wiphy, and use the
net_device private area to store the wireless_dev. This results in a
change to the way we navigate from a net_device to the driver private
orinoco_private, which we encapsulate in the inline function ndev_priv.
Most of the remaining calls to netdev_priv are thus replaced by
ndev_priv.

We can immediately rely on cfg80211 to handle SIOCGIWNAME, so
orinoco_ioctl_getname is removed.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:44 -04:00
David Kilroy 98e5f40448 orinoco: Change set_tkip to use orinoco_private instead of hermes_t
hw.h does not include hermes.h, and none of the other functions
requires types from that file. Also hermes_t is a (discouraged) typedef
so we can't add a forward declaration. Therefore change this function to
use orinoco_private.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:44 -04:00
David Kilroy 8e638267a8 orinoco: initialise independently of netdev
Initialise the orinoco driver before registerring with netdev, which
will help when we get to cfg80211...

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:44 -04:00
David Kilroy a2608362b2 orinoco: Replace net_device with orinoco_private in driver interfaces
Move away from using net_device as the main structure in orinoco
function calls. Use orinoco_private instead.

This makes more sense when we move to cfg80211, and we get wiphys as
well.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:44 -04:00
David Kilroy 44d8dade8f orinoco: firmware helpers should use dev_err and friends
We should be able to call these routines before we register with
netdev, so avoid printks using the netdev name.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:43 -04:00
David Kilroy a3f47b9c2a orinoco: use dev_err in early initialisation routines
This allows us to use determine_fw_capabilities,
orinoco_hw_read_card_setting and orinoco_hw_allocate_fid prior to
netdev registration.

Since dev_dbg only prints if DEBUG is defined (or dynamic debug is
enabled), move a couple of the more useful prints up to info.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:43 -04:00
David Kilroy 42a51b9330 orinoco: Move FID allocation to hw.c
This is part of refactorring the initialisation code so that we can
load the firmware before registerring with netdev.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:43 -04:00
David Kilroy e9e3d0100e orinoco: Move card reading code into hw.c
This is part of refactorring the initialisation code so that we can
load the firmware before registerring with netdev.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:43 -04:00
David Kilroy a2d1a42a4b orinoco: Move firmware capability determination into hw.c
This is part of refactorring the initialisation code so that we can load
the firmware before registerring with netdev.

Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:43 -04:00
Johannes Berg 90e3012e94 mac80211_hwsim: clean up the skb before passing it back
We need to clean up the skb before we can copy it, this
is required for proper operation since the socket it is
still attached to could potentially live in a different
network namespace or so.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:41 -04:00
Hin-Tak Leung 3bfbe80e44 zd1211rw: sort vid/pid pairs by numerical value
In the past ids were inserted in no particular order and it has
become hard to see what ids are already included or not. This
patch sorts the ids by numerical value and has no functional effect.

Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 15:01:41 -04:00
Johannes Berg f1d58c2521 mac80211: push rx status into skb->cb
Within mac80211, we often need to copy the rx status into
skb->cb. This is wasteful, as drivers could be building it
in there to start with. This patch changes the API so that
drivers are expected to pass the RX status in skb->cb, now
accessible as IEEE80211_SKB_RXCB(skb). It also updates all
drivers to pass the rx status in there, but only by making
them memcpy() it into place before the call to the receive
function (ieee80211_rx(_irqsafe)). Each driver can now be
optimised on its own schedule.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:54 -04:00
Johannes Berg 18ad01c439 rt2x00: remove skb->do_not_encrypt usage
Johannes is trying to get rid of the master netdev and in the process will
remove skb->do_not_encrypt field. This removes the do_not_encrypt
usage from rt2x00 to make the change easier.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:54 -04:00
Jussi Kivilinna 222ec50a0a rndis_wlan: convert set/get txpower to cfg80211
Convert set/get txpower to cfg80211 and add stop netdev handler to turn off
radio for rfkill.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:53 -04:00
Jussi Kivilinna a33e9e7f35 usbnet: Add stop function pointer to 'struct rndis_data'.
Allow minidriver to know that netdev has stopped. This is to let
wireless turn off radio when usbnet dev is stopped.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:52 -04:00
Jussi Kivilinna d75ec2b7ec rndis_wlan: convert get/set frag/rts to cfg80211
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:52 -04:00
Zhu Yi 257862f3fa iwmc3200wifi: rfkill cleanup
The patch cleans up the unused rfkill related structures and flags.
It also adds wext and cfg80211 handlers for txpower auto and off so
that software rfkill could be issued by user space.

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-07-10 14:57:52 -04:00
Samuel Ortiz 3549716484 iwmc3200wifi: cache keys when interface is down
When the interface is down and one sets a WEP key from userspace, we should
be able to simply cache it.
Since that implies setting part of the profile's security settings, we now
alloc/free the umac_profile at probe/remove time, and no longer at interface
bring up/down time. Simply resetting it during the latter is enough.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:52 -04:00
Zhu Yi 191506ecbc iwmc3200wifi: change coexist periodic calibration flag
The patch changes coexist periodic calibration priority flag. It also
set wireless mode to UMAC and set PM control flag to 0x1.

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-07-10 14:57:52 -04:00
Samuel Ortiz 13e0fe7096 iwmc3200wifi: cfg80211 key hooks implemetation
This patch implements the new cfg80211 privacy related hooks: add/get/set_key
and the set_default_key one.
With this implementation we can now call the wext-compat *encode* routines and
reduce our own wext code.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:51 -04:00
Samuel Ortiz a70742f167 iwmc3200wifi: handling wifi_if_ntfy responses
When we're calling iwm_send_wifi_if_cmd() with the resp flag set, we're
currently waiting on the mlme queue, waiting for some flags here and there to
show up.
This patch adds a wifi_ntfy bitmap, and when we're sending a wifi_if command
expecting an answers, we wait synchronously for it to show up, on a dedicated
queue. The wifi_ntfy bit is set when we receive the corresponding answer.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:51 -04:00
Samuel Ortiz 0c5553b139 iwmc3200wifi: invalidate keys when changing the BSSID
While associated, we have to invalidate our key cache if we clear our BSSID
through siwap.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:51 -04:00
Wey-Yi Guy 030b865520 iwlwifi: remove disable_tx_power for device > 4965
After 4965, tx_power_calibration moved from driver to uCode.
remove "disable_tx_power" from debugfs to minimize the confusion.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:51 -04:00
Wey-Yi Guy fe6efb4b42 iwlwifi: no need to refer to max_nrg_cck range value
max_nrg_cck value inside the sensitivity range structure is not needed
for sensitivity calibration.
Keep the parameter in sensitivity structure but set the value to "0" in case
needed in the future implementation.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:50 -04:00
Wey-Yi Guy 9d67187dbd iwlwifi: modify sensitivity value for 5150
In 5150 there is a long delay between the AGC(Automatic Gain Control) command
till the RF is stabilized causing us to miss detections when there was
adjacent channel noise, so we need to adjusted the Sensitivity calibration
for 5150 differently.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:50 -04:00
Luciano Coelho 47af3fe36d wl1251: change psm enabled/disabled info to debug
With shorter CAM timeouts, the logs get flooded with "psm enabled" and "psm
disabled traces.  This patch changes it from wl1251_info to wl1251_debug, so
they are only shown if DEBUF_PSM is enabled.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Janne Ylalehto <janne.ylalehto@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:50 -04:00
Kalle Valo 05fac682c2 wl1251: fix a checkpatch warning
drivers/net/wireless/wl12xx/wl1251_main.c:158: WARNING:
braces {} are not necessary for single statement blocks

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:50 -04:00
Kalle Valo 80301cdcfe wl1251: use wl1251 prefix everywhere
Last we can change all code prefixes from wl12xx/WL12XX to
wl1251/WL1251.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:50 -04:00
Kalle Valo 1e6f172fcc wl12xx: remove unused wl12xx_hw_init_mem_config()
The function declaration is a leftover from some earlier, already
removed, code.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:49 -04:00
Kalle Valo 1367411858 wl1251: rename wl12xx.h to wl1251.h
wl12xx.h is now only used by 1251 code, so we can rename it.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:49 -04:00
Kalle Valo ef2f8d4577 wl1251: add wl1251 prefix to all 1251 files
Now that all 1271 files are split, we can add wl1251_ prefix to the files.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:49 -04:00
Kalle Valo c731837855 wl1251: remove wl1271_setup()
We don't want to have any 1271 code in wl1251.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:49 -04:00
Kalle Valo c5ce901b3f wl12xx: rename driver to wl1251
Rename driver to wl1251.ko in preparation for wl1271 driver.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:48 -04:00
Kalle Valo e6f0b5c299 wl12xx: rename wl1251.c wl1251_ops.c
In preparation to split wl12xx to wl1251 and wl1271.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:48 -04:00
Juuso Oikarinen 77cc9e43ce wl12xx: Use chipset specific join commands
Add implementation to use chipset specific join commands.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:48 -04:00
Vidhya Govindan ce650b5cde wl12xx: Assign value to rx msdu lifetime variable
The patch "wl12xx: cmd and acx interface rework" failed to assign MSDU
lifetime value in wl12xx_acx_rx_msdu_life_time() and breaks the functionality.
This patch fixes the regression by assigning the correct value.

Signed-off-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:48 -04:00
Kalle Valo 0182f8d56c wl12xx: enable ELP mode
ELP mode is working now, let's enable it so that the firmware can sleep
and reduce power consumption.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:47 -04:00
Kalle Valo c5483b7193 wl12xx: check if elp wakeup failed
Check the return call from wl12xx_ps_elp_wakeup() and bail out if it
fails. This shouldn't happen, but if does there's a fundamental low
level issue.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:47 -04:00
Kalle Valo 01d9cfbdaa wl12xx: optimise elp wakeup and sleep calls
The wakeup call was done too deep in code path, it's better to wakeup
chip from higher levels. This will also reduce wakeup calls significantly.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:47 -04:00
Kalle Valo cee4fd2712 wl12xx: protect wl12xx_op_set_rts_threshold()
The function doesn't lock the mutex before sending the acx.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Reviewed-by: Vidhya Govindan <vidhya.govindan@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:47 -04:00
Ari Kauppi 6021b28958 wl12xx: Fix CMD_TEST regression via netlink.
CMD_TEST via netlink API has been broken since
e29c3f59cfbc38c3b481a2694b08962da19c4664: cmd and acx interface rework.

The user of the interface sends the request in a buffer without the
wl12xx_command header but expects the response to have the wl12xx_command
header (with id and status).

This patch reverts the e29c3f5 commit for cmd.c:wl12xx_cmd_test
and implements the needed wrapper functionality in netlink.c. Now the
API of wl12xx_cmd_test and rest of wl12xx_cmd_* commands in cmd.c are
similar.

Signed-off-by: Ari Kauppi <Ext-Ari.Kauppi@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-07-10 14:57:46 -04:00