Commit graph

73701 commits

Author SHA1 Message Date
Holger Schurig e93156e7c4 libertas: sort and categorize entries in decl.h
This now makes decl.h only contain declarations for functions that don't
have their own *.h file.

No function change.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:49:58 -04:00
Holger Schurig 560c63383f libertas: move mic failure event to wext.c
... because for cfg80211 we'll need a completely different
implementation.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:40 -04:00
Holger Schurig fea2b8ec81 libertas: move SIOCGIWAP calls to wext.c
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:39 -04:00
Holger Schurig 8ec97cc803 libertas: remove "struct cmd_ds_gen"
It was only used as a source for S_DS_GEN, but the size of this struct
is equal to the size of "struct cmd_header".

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:39 -04:00
Holger Schurig b856f73b39 libertas: remove handling for CMD_GET_TSF
... which just resided as an old-style command in cmd/cmdresp, but
was nowhere useed. If we ever need it, we can re-add it as a newstyle
command.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:39 -04:00
Holger Schurig f57bd284e4 libertas: remove handling for CMD_802_11_LED_GPIO_CTRL
... which just resided as an old-style command in cmd/cmdresp, but
was nowhere useed. If we ever need it, we can re-add it as a newstyle
command.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:38 -04:00
Holger Schurig 6e85e0b7ab libertas: move lbs_send_iwevcustom_event() to wext.c
... because it's purely a WEXT function.

No functional change.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:38 -04:00
Holger Schurig d0de37417e libertas: move association related commands into assoc.c
That's because the new cfg80211 implementation will provide cleaner
implementations.

No functional changes.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:38 -04:00
Holger Schurig c14951fec6 libertas: get current channel out of priv->curbssparams
... as priv->curbssparams won't exist once libertas+cfg80211 lands.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:37 -04:00
Holger Schurig 5e04769224 libertas: sort variables in struct lbs_private
Having the variables in logical groups allows us to easier
#ifdef stuff out.

No functional change.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:37 -04:00
Holger Schurig 2d46502dce libertas: move scan/assoc related stuff
Another cfg80211-preparation patch: removes some code/definitions from
main.c and dev.h and put's it into assoc.c/.h, scan.c/.h.

No function change.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:36 -04:00
Holger Schurig 243e84e91e libertas: change IW_ESSID_MAX_SIZE -> IEEE80211_MAX_SSID_LEN
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:36 -04:00
Holger Schurig f4228b4c2e libertas: remove unused 11d.h as well, priv->countryinfo
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:36 -04:00
Holger Schurig d37b4fdd43 libertas: remove unused 11d code
Most of the 11d code was protected with an "if (priv->enable11d)" clause.
But there was no code that anywhere that was able to set this
variable to true. So all 11d code was dead for almost a year and no one
complained. That's enought incentive to remove this code.

Besides removing old cruft, we gain back the 11d capability in a common way
when we merge the cfg80211 functionality.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:35 -04:00
Benoit PAPILLAULT 7f4013f096 zd1211rw: Fix TX status reporting in order to have proper rate control
First, we reduce the number of hardware retries to 0 (ie 2 real retries
for each rate). Next, when we report the retries to mac80211, we always
report a retry count of 1 (it seems to be 2 in fact, but using 2 seems
to lead to wrong performance for some reason). We use a state machine to
determine the real fate of a packet based on the 802.11 ACK and what the
Zydas hardware is saying when a real retry occurs. The real retry rates
are encoded in a static array. It has been tested with both zd1211 and
zd1211b hardware. Of course, since the Zydas hardware is not reporting
retries accurately, we are just doing our best in order to get the best
performance (ie higher throughput).

Signed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:35 -04:00
Luciano Coelho 287d374120 wl1271: use ieee80211_rx_ni()
Use the new ieee80211_rx_ni() function instead of ieee80211_rx().  Since we
use a workqueue to handle the RX path, we need to call the new function,
which disables bottom half handling.  This patch fixes the NOHZ:
local_softirq_pending messages.

CC: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:35 -04:00
Christian Lamparter 68676df00d ar9170: don't filter BlockACK frames
The current A-MPDU tx_status report mechanism is too inaccurate.
With this patch BlockACK frames show now up to the driver and
can be processed.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:34 -04:00
Christian Lamparter 731d6bfc2d ar9170usb: atomic pending urbs counter
This patch follows "ar9170: atomic pending A-MPDU counter"
idea and converts another critical counter to atomic_*.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:34 -04:00
Christian Lamparter 02bdf5b48a ar9170: atomic pending A-MPDU counter
A ref-counting bug emerged after testing ar9170usb's HT
implementation on a bigger SMP/SMT system without the usual
_debugging_ overhead.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:34 -04:00
Wey-Yi Guy 4ad177b5c8 iwlwifi: rework for static power save
For static power save, the actual intervals are calculated by driver based on
the default table and DTIM flag, then sent to uCode when the scheme
is changed.

Three tables are defined based on DTIM period.
	1. DTIM 0 - 2
	2. DTIM 3 - 10
	3. DTIM > 11

The actual number of DTIM a station may miss may not exceed the
following:
	. Only 1 DTIM may be skipped at PI=4 when allowed
	. Only 2 DTIMs may be skipped at PI=5 when allowed
	. DTIM may be skipped only 5 sec after last activity
	. DTIM may be skipped only 30 sec after connection establishment

Only allow user to override the power_level when rf is ready to make sure
power level gets changed upon request.

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-10-27 16:48:34 -04:00
Wey-Yi Guy 9444b18802 iwlwifi: no chain noise support for 6x50 series
For initial bring up of 6x50 series NICs, no chain noise support in
uCode, this feature will be added in the later stage of development.

Two chain noise related functions are removed from 6x50 series:
1. gain computation
2. chain noise reset

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-10-27 16:48:33 -04:00
Wey-Yi Guy 32004ee42f iwlwifi: set auto clock gate disable bit for 6x00/6x50 series
For 6x00 and 6x50 series NIC with OTP shadow RAM, set auto clock gate
disable bit when initializing OTP access.

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-10-27 16:48:33 -04:00
Reinette Chatre 8d9698b3e6 iwlagn: store station rate scale information in mac80211 station structure
Currently mac80211 initializes the rate scaling before notifying the driver
of the station's existence. The driver dealt with this by not relying on
mac80211's station notifications and instead mixing this functionality with
the rate scaling code and other places. To clean this up the driver needs
to do rate scaling initialization after being notified of the station, this
can be done if the rate scaling information forms part of the station
information passed from mac80211 to driver.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:33 -04:00
Reinette Chatre cc1282f63b iwlwifi: move rate scaling structures to header file
Move to header file so they can be included and used in other parts of the
driver.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:32 -04:00
Reinette Chatre f0b6e2e8cb iwlwifi: move iwl_setup_mac to iwlagn
This function is only used in iwlagn so there is no need to have it in
iwlcore.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:32 -04:00
Wey-Yi Guy 3ab312a893 iwlwifi: fix incorrect otp blocks number for 6x50 series
For 6x50 series, number of OTP blocks is different from 6x00 series

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-10-27 16:48:31 -04:00
Wey-Yi Guy 32b7e244f2 iwlwifi: identify eeprom version for 6x50 series NIC
Adding support for 6x50 series EEPROM version check, 6x50 is wifi/wimax
combo device which has different EEPROM map

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-10-27 16:48:31 -04:00
Wey-Yi Guy c09430abed iwlwifi: show current power save status reported by uCode
Power save request is sent from driver to uCode, but there is no
indication from uCode about the current device power save state.

Reading GP_CNTRL register bit 25:24 to show the current power save
status

00: no power save
01: MAC power down
10: PHY power down
11: Error

The uCode could switch in and out of power save mode in the order of
once per 100-300 ms in many cases. The reading here should just be used for
reference on the current uCode power save status. Do not confuse this
reading with the PowerSave set by driver and mac80211.

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-10-27 16:48:31 -04:00
Abhijeet Kolekar 1f80989e8b iwl3945: disable all tx fifos
Disable the all the tx fifos while stopping the tx queues.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:30 -04:00
John W. Linville 9a493e8f4d wl1251: re-disable PG10 chips
"wl1251: add support for PG11 chips." accidentally enabled PG10 chips as
well...

Reported-by: Kalle Valo <kalle.valo@iki.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:30 -04:00
John W. Linville 72f5f45756 b43: use ieee80211_rx_ni()
Convert to new use ieee80211_rx_ni() routine rather than open-coded
version.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:30 -04:00
Holger Schurig 8ef37f1cb2 libertas: remove unused lbs_cmd_802_11_inactivity_timeout()
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:30 -04:00
Holger Schurig a3cbfb08ca libertas: make lbs_get_channel() static
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:29 -04:00
Holger Schurig bca61f8a4d libertas: harmonize cmd.h
* move declarations for functions of cmd.c/cmdresp.c into cmd.h
* move declarations from cmd.h that are in main.c to decl.h
* group command functions

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:29 -04:00
Holger Schurig 9e66e701d0 libertas: cleanup host.h and hostcmd.h
Also remove some unused definitions and make tab usage consistent.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:29 -04:00
Zhu Yi b8fcf59093 iwmc3200wifi: handle coexistence radio notification
Handle WiFi/WiMax coexistence radio preemption notification event.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:28 -04:00
Samuel Ortiz 5dc53163c2 iwmc3200wifi: Set wiphy firmware version
Our wiphy firmware version is a combination of the UMAC and LMAC ones.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:27 -04:00
Samuel Ortiz 7fd6b12f32 iwmc3200wifi: Support unexpected reboot barker
We can receive unexpected reboot barker at any time, and we're supposed to
reset the whole device then.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:27 -04:00
Samuel Ortiz 9829e1b510 iwmc3200wifi: Try shared auth when open WEP fails
When we fail to associate with an open WEP AP, we fall back to shared auth.
This allows us to support joining a shared auth WEP AP with iwconfig.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:27 -04:00
Samuel Ortiz 56e3f085f5 iwmc3200wifi: Do not handle wifi command if the interface is not ready
When resetting or bringing the interface down, we should just reject any wifi
related command.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:27 -04:00
Samuel Ortiz 708567e072 iwmc3200wifi: Check for cmd pointer before dereferencing it
The wifi_if_wrapper notification handling code uses a cmd pointer without
checking if it's valid or not. We're dereferencing it because we assume that
we only get to that point if there was a pending command for us. That's not
always true, so we'd better check.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:26 -04:00
Samuel Ortiz f96cca8483 iwmc3200wifi: SDIO disable race fix
When calling sdio->bus_disable(), we are flushing the command lists before
disabling the sdio function. We can thus potentially get a command response
after having flushed the command list.
To avoid that race, we have to call iwm_reset() after disabling the sdio
function.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:26 -04:00
Samuel Ortiz 88e6195a91 iwmc3200wifi: Tx power setting
We can now set the Tx power from e.g. iwconfig.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:26 -04:00
Samuel Ortiz 7eae165e2d iwmc3200wifi: Update fixed size config definitions
We need to be in sync with the latest firmware API.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:26 -04:00
Samuel Ortiz 05f9589cd3 iwmc3200wifi: Update statistics notification structure
The latest firmware adds a ht_rates and a chain_energy field. The latter is
needed as we want to eventually support RSSI/antenna handling.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:25 -04:00
Samuel Ortiz 69cf6e2d5b iwmc3200wifi: Improve rx debug
We display the correct DROP/RELEASE string for each rx packets, and when
it's dropped we also display the reason.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:25 -04:00
Samuel Ortiz 6a79c9f62a iwmc3200wifi: Profile flags can be WPA1 or WPA2 not both
UMAC will ASSERT if the profile security flag is WPA1 | WPA2, so we can only
accept one of those.
Moreover wpa_s wext and nl80211 drivers dont try to send WPA1 | WPA2, but only
one at a time.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:25 -04:00
Samuel Ortiz e85498b21d iwmc3200wifi: CT kill support
We set the initial CT (Temperature control) value to 110 degrees.
If the chip goes over that threshold, we hard block the device which will turn
it down. At the same time we schedule a 30 seconds delayed work that unblock
the device (and userspace is supposed to bring it back up), hoping that the
chip will have cooled down by then...

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:24 -04:00
Samuel Ortiz a82aedbf1b iwmc3200wifi: WPS support
By setting the WSC profile flag, we now support WPS as an enrollee.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:24 -04:00
Zhu Yi 03d1a62c1f iwmc3200wifi: allow joining an existed IBSS network
We used to only support creating a new IBSS network. Now joining to
an existed IBSS network is supported as well.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:24 -04:00
Zhu Yi 30315ff05f iwmc3200wifi: add BGN sdio device id
Add BGN SKU sdio device id.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:24 -04:00
Ivo van Doorn a9b3a9f721 rt2x00: Implement support for rt2800pci
Add support for the rt2860/rt3090 chipsets from Ralink.

Includes various patches from a lot of people who helped
getting this driver into the current shape.

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
Signed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Luis Correia <luis.f.correia@gmail.com>
Signed-off-by: Mattias Nissler <mattias.nissler@gmx.de>
Signed-off-by: Mark Asselstine <asselsm@gmail.com>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:22 -04:00
Ivo van Doorn 5d78d34ba2 rt2x00: Add rt2x00soc bus module
Add new library module for SoC drivers.
This is needed to fully support the platform
driver part of rt2800pci.

Based on original patch from Felix.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:21 -04:00
Kalle Valo 878283f198 wl1251: use ieee80211_rx_ni()
Because of SPI and SDIO wl1251 does everything in a workqueue, including
calling ieee80211_rx() which should be called with bottom halves disabled.
An error message is emitted because of this:

NOHZ: local_softirq_pending 08

Fix this by using ieee80211_rx_ni().

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:21 -04:00
Michael Buesch 88499ab3d8 b43: Optimize PIO scratchbuffer usage
This optimizes the PIO scratchbuffer usage.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:20 -04:00
David-John Willis 2c759e03b3 wl1251: add support for PG11 chips.
This simple patch adds support for the PG11 variant of the WL1251 chip as
used on the OpenPandora OMAP3 device.

Signed-off-by: David-John Willis <John.Willis@Distant-earth.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:20 -04:00
Luciano Coelho fb46f26f38 wl1271: added missing packed modifier in some cmd structs
Some of the struct definitions in the wl1271_acx.h file were missing the
__attribute__ ((packed)) modifier.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:20 -04:00
Luciano Coelho d0f63b2021 wl1271: fix endianess issues
We were not handling endianess correctly.  The wl1271 chip runs on
little-endian values.  This patch makes sure that all the communication with
the wl1271 firmware is done in little-endian by using cpu_to_le* and
le*_to_cpu where appropriate.

Also, all the struct definitions for data exchanged with the firmware has
been changed to use __le16/32 types instead of u16/32.

This fixes a few sparse warnings, such as these:

drivers/net/wireless/wl12xx/wl1271_cmd.c:554:42: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:555:42: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:577:58: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:579:58: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:676:18: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:787:22: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_cmd.c:789:21: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_tx.c:98:47: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_acx.c:932:32: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_boot.c:191:32: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_boot.c:197:38: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_boot.c:199:37: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1271_init.c:255:40: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1271_init.c:275:53: warning: incorrect type in assignment (different base types)

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:19 -04:00
Luciano Coelho 0b5b72da1b wl1271: added missing packed modifier in some acx structs
Some of the struct definitions in the wl1271_acx.h file were missing the
__attribute__ ((packed)) modifier.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:19 -04:00
Luciano Coelho 938e30c930 wl1271: fix sparse warnings about undeclared functions
The following sparse warnings were fixed:

drivers/net/wireless/wl12xx/wl1271_spi.c:199:6: warning: symbol 'wl1271_spi_read_busy' was not declared. Should it be static?
drivers/net/wireless/wl12xx/wl1271_cmd.c:84:5: warning: symbol 'wl1271_cmd_cal_channel_tune' was not declared. Should it be static?
drivers/net/wireless/wl12xx/wl1271_cmd.c:107:5: warning: symbol 'wl1271_cmd_cal_update_ref_point' was not declared. Should it be static?
drivers/net/wireless/wl12xx/wl1271_cmd.c:132:5: warning: symbol 'wl1271_cmd_cal_p2g' was not declared. Should it be static?
drivers/net/wireless/wl12xx/wl1271_cmd.c:153:5: warning: symbol 'wl1271_cmd_cal' was not declared. Should it be static?

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:19 -04:00
Juuso Oikarinen 7a38079e0d wl1271: Set IEEE80211_FCTL_TODS in the null data template
Set the IEEE80211_FCTL_TODS bit in the FC of the null data template.
This is a mandatory requirement in specification.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Cc: Vidhya Govindan <vidhya.govindan@nokia.com>
Cc: Janne Ylälehto <janne.ylalehto@nokia.com>
Reviewed-by: Janne Ylalehto <janne.ylalehto@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:18 -04:00
Bob Copeland e5e2647fd6 ath5k: use noise calibration from madwifi hal
This updates ath5k to calibrate the noise floor similar to the
way it is done in the madwifi hal and ath9k.  Of note:

- we start NF measurement at the same time as AGC calibration,
  but do not actually read the value until the periodic (long)
  calibration
- we keep a history of the last few values read and write the
  median back to the hardware for CCA
- we do not complain if NF calibration isn't complete, instead
  we keep the last read value.

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-10-27 16:48:18 -04:00
Marek Lindner e307fcf0a1 ath9k: adjust ahb callbacks to new struct layout to avoid compile errors
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:18 -04:00
Holger Schurig 6d898b1983 libertas: make __lbs_cmd_async() non-static
This function will be needed for the cfg80211-enabled libertas driver.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:17 -04:00
Kalle Valo 40f54242ae wl1251: rename spi device to wl1251
During rename of the driver from wl12xx to wl1251 the spi device name
was accidentally left as wl12xx. Rename it to wl1251 which is the proper
name of the driver.

Signed-off-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:17 -04:00
Juuso Oikarinen b54853f1b1 wl1271: Fix filter configuration
Fix the filter configuration to properly work with the two phase filter
configuration (prepare_multicast/configure_filter.)

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:16 -04:00
Luciano Coelho bd5ea18f7b wl1271: make sure PS is disabled in PLT
We cannot be in PS mode when running PLT tests, so we need to make sure we're
in active mode.  Also, we need to clear up the rx_counter when we stop PLT,
otherwise it could cause problems when entering PLT again.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:16 -04:00
Juuso Oikarinen ed317788b9 wl1271: Correct memory handling for FW boot
Several memory allocation related failure cases were not properly
handled by the driver - the result was that in low memory conditions
booting of a corrupted FW could be attempted - and user space would not
get proper failure code.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:16 -04:00
Juuso Oikarinen a163acce48 wl1271: Remove unnecessary rx_descriptor memory allocation
Remove unnecessary RX descriptor memory allocation from the driver. The
allocation was a remnant of the wl1251 driver.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:15 -04:00
Juuso Oikarinen 01c09162cd wl1271: Support for IPv4 ARP filtering
Add support for IPv4 ARP filtering in the driver. This will dramatically
reduce the number of unnecessary interrupts by the device in conqested
networks.

This patch is based on a similar patch to wl1251 by Janne Ylälehto.

Cc: Janne Ylälehto <janne.ylalehto@nokia.com>
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:14 -04:00
Juuso Oikarinen 1fd2794f36 wl1271: Fix event handling mechanism
The event handling mechanism could miss events if multiple events would
occur simultaneously. Fix event handling mechanism to process all
events.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:11 -04:00
Juuso Oikarinen 7444113017 wl1271: Fix multicast list handling
Fixes bugs in the multicast list handling:
 - Use atomic memory allocation in non-sleepable context
 - Increment address pointer when iterating list of MC addresses

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:11 -04:00
Teemu Paasikivi 5d07b668f2 wl1271: Checking of rx descriptor status fixed
Fixed checking of status of the received packet. On wl1251 status is in the
flags field of the descriptor, on wl1271 there is a separate status field.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:11 -04:00
Teemu Paasikivi a410264553 wl1271: Added 5 GHz support to join and rx
Added support to assiociate and use connection on 5 GHz band (802.11a).

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:11 -04:00
Teemu Paasikivi abb0b3bfb2 wl1271: Added support to scan on 5 GHz band
Added support to scan 802.11a access points on 5 GHz band when using
wl1273 chip.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:10 -04:00
Teemu Paasikivi 311494c47f wl1271: Scan only enabled channels
Added checking of whether channel is enabled or disabled by mac80211
stack to scan. Disabled channels are not scanned.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:10 -04:00
Teemu Paasikivi 1ebec3d750 wl1271: Added 5 GHz parameters for wl1273
Added data rate and frequency tables for 5 GHz band channels, 5
GHz radio configration parameters and configuration option to enable
802.11 support.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:10 -04:00
Juuso Oikarinen c6d5d06e45 wl1271: Remove busy-word checking
Remove busy-word checking to work around an SPI bug. To reduce the
chance of chipset-busy scenarios, increment the number of fixed busy
words.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:10 -04:00
Juuso Oikarinen 11f70f9715 wl1271: Implement beacon early termination support
Add support to enable beacon early termination in the firmware. Early
Beacon termination is a feature which allows the radio to be turned off
after TIM IE to save power.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:09 -04:00
Juuso Oikarinen eb5b28d021 wl1271: Fix IRQ enable handling on FW init failure
Disable IRQ's after FW initialization failure - originally this was not
done in all cases, and it resulted in a kernel warning if firmware
initialization was tried again without reboot.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:09 -04:00
Juuso Oikarinen 8a08048a37 wl1271: Move default FW config struct away from stack
Move the default FW config into a module global static variable, instead
of being a stack variable.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:09 -04:00
Juuso Oikarinen 47fab7d589 wl1271: Add config structure for FW init parameters
Add a configuration structure for RX path parameters, and set default
configuration values there.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:08 -04:00
Juuso Oikarinen 51f2be2432 wl1271: Add config structure for connection management parameters
Add a configuration structure for connection management parameters, and
set default configuration values there.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:08 -04:00
Juuso Oikarinen 45b531a86f wl1271: Add config structure for TX path parameters
Add a configuration structure for TX path parameters, and set defalt
configuration values there.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:08 -04:00
Juuso Oikarinen 8793f9bb19 wl1271: Add config structure for RX path parameters
Add a configuration structure for RX path parameters, and set default
configuration values there.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:08 -04:00
Juuso Oikarinen 2b60100bf0 wl1271: Add structure for firmware configuration values
In order to make the firmware configuration more manageable, collect
hardcoded configuration values into one data structure, and set default values
there.

Add the SoftGemini BT/WLAN coex paramters into the config structure.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:07 -04:00
Juuso Oikarinen 2cc8d4db9d wl1271: Workaround for reference clock setting on boot.
If the 38.4MHz reference clock is configured to the firmware, it crashes
on boot. Configuring an experimental 38.4MHz in XTAL mode allows the
firmware to boot, and everything appears to work.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:07 -04:00
Zhu Yi 2f301227a1 iwlwifi: use paged Rx
This switches the iwlwifi driver to use paged skb from linear skb for Rx
buffer. So that it relieves some Rx buffer allocation pressure for the
memory subsystem. Currently iwlwifi (4K for 3945) requests 8K bytes for
Rx buffer. Due to the trailing skb_shared_info in the skb->data,
alloc_skb() will do the next order allocation, which is 16K bytes. This
is suboptimal and more likely to fail when the system is under memory
usage pressure. Switching to paged Rx skb lets us allocate the RXB
directly by alloc_pages(), so that only order 1 allocation is required.

It also adjusts the area spin_lock (with IRQ disabled) protected in the
tasklet because tasklet guarentees to run only on one CPU and the new
unprotected code can be preempted by the IRQ handler. This saves us from
spawning another workqueue to make skb_linearize/__pskb_pull_tail happy
(which cannot be called in hard irq context).

Finally, mac80211 doesn't support paged Rx yet. So we linearize the skb
for all the management frames and software decryption or defragmentation
required data frames before handed to mac80211. For all the other frames,
we __pskb_pull_tail 64 bytes in the linear area of the skb for mac80211
to handle them properly.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:06 -04:00
Luciano Coelho ae751bab9f wl1271: remove unnecessary joins and join only when the bssid changes
We were using the join command to change some settings when the stack asked
us to do it.  In many cases they were not needed (and could cause potential
problems), so they were removed.  In other cases there are ACX commands that
can be used instead of using join to reconfigure.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:06 -04:00
Luciano Coelho 0535d9f4f0 wl1271: use acx_rx_config instead of join when updating filters
We shouldn't use a join command to change the filter settings while
associated.  The right way to do it is to use ACX_RX_CFG.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:06 -04:00
Juuso Oikarinen 8bcfcb125b wl1271: Update boot time configuration for the new firmware
Update the magic values of the wl1271 boot time config according to the new
reference driver.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:06 -04:00
Juuso Oikarinen 7462141787 wl1271: Remove outdated SPI functions
With the change to the new firmware, there was a change to firmware memory
partitioning. Along with that change, the translation of all partitions was
unified, and separate functions for reg and mem access became unnecessary.

Cleanup the unnecessary functions.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:05 -04:00
Juuso Oikarinen 207347e498 wl1271: Update TX path block calucation algo
Update the TX path block calculation algorithm based on TI reference.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:05 -04:00
Juuso Oikarinen 3cfd6cf960 wl1271: Enable smart reflex
Enable and configure smart reflex. This should have a reducing impact on
power consumption.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:05 -04:00
Juuso Oikarinen 5d0af498c0 wl1271: Enable ELP
The new firmware has fixed a firmware crash problem related to ELP entry.
Enable ELP to conserve power.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:04 -04:00
Juuso Oikarinen c15f63bffa wl1271: Update interrupt handling by removing an extra SPI read
Remove separate interrupt register reading from the interrupt handling
routine. This will slightly improve interrupt performance.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:04 -04:00
Juuso Oikarinen 284134eb6f wl1271: RefClk configuration
Updated RefClk configuration based on reference sources. Apparently this
change will improve RF performance.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:04 -04:00
Juuso Oikarinen e8768eeb59 wl1271: Add top-register access functions
Add top register access function.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:04 -04:00
Juuso Oikarinen 732a1ad93e wl1271: Remove RX workaround
Remove RX workaround which is not needed with newer firmware revisions. This
will reduce one SPI register transaction per RX packet.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:03 -04:00
Juuso Oikarinen 451de97adb wl1271: Update memory mapping for firmware revision 6.1.0.0.241
Update the memory regions and memory mapping to support firmware revision
6.1.0.0.241.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:48:03 -04:00
Luciano Coelho 37079a831d wl1271: enable HW_AVAILABLE interrupt to fix ELP
We need to listen to HW_AVAILABLE interrupts when using ELP with firmware
revision 6.1.0.0.241.  Add WL1271_ACX_INTR_HW_AVAILABLE to the interrupts that
are enabled by default.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:03 -04:00
Luciano Coelho ac78403e14 wl1271: add workaround to avoid distortion due to excessive tx power
We still don't have proper calibration for our devices, so we are using way
too much power for TX, which causes a lot of distortion.  This hack hardcodes
the txpower to 7dBm.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:02 -04:00
Luciano Coelho d6e19d135d wl1271: workaround to send a disconnect before rejoining
We don't get any indication from the stack when we have disassociated.  In
wl1271, it is important to send a CMD_DISCONNECT before joining again,
because the firmware cleans some things up.  So we check if we're already
joined and disconnect if that's the case.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:02 -04:00
Luciano Coelho 25a7dc6d22 wl1271: implement cmd_disconnect
This patch implements the CMD_DISCONNECT command, which should be sent to the
firmware when we are disassociated.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:01 -04:00
Wey-Yi Guy e57f14895b iwlwifi: update channel switch command API
Channel switch host command has different data structure for
different devices. Adding additional structures to support 5000 and 6000
NICs. unlike 4965, starting with 5000 series, the tx power is managed by
uCode, there is no tx power db information need to be passing from driver to
uCode; but the space needs to be reserved to match uCode expection.

1000 NIC do not support channel switch operation since it is 'bgn'
device, there is no need to have data structure defined for it.

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-10-27 16:48:01 -04:00
Abhijeet Kolekar 768db9829d iwl3945: rearrange the code.
Rearrange the code and groups setting of
retry_limit and data_retry_limits code together.
Make 'data_retry_limit' setting similar to iwlwifi
for better readability.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:01 -04:00
Abhijeet Kolekar 1f0436f470 iwlwifi/iwl3945: remove data_retry_limit
Remove the ununsed variable data_retry_limit
from priv.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:00 -04:00
Abhijeet Kolekar 9744c91f91 iwl3945: rename tx to tx_cmd
Rename iwl3945_tx_cmd variable tx to tx_cmd for better
readability.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:00 -04:00
Abhijeet Kolekar 37dc70fea8 iwlwifi/iwl3945: unify rts_tx_cmd_flag
3945 and 4965 share the functionality for setting RTS and CTS to
the tx_cmd. Unify these functions and move the common
functionality to core.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:48:00 -04:00
Wey-Yi Guy 92a35bda79 iwlwifi: showing accumulative ucode statistics counters
Adding accumulative statistics counters in iwlwifi driver.
Statistics counters are reported by uCode every beacon interval; but can
be reset by uCode when needed. The accumulative statistics counters is
maintained by driver to keep track of the history of all the counters.

Update the ucode stats files in debugfs to display both latest and
accumulative counters.

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-10-27 16:48:00 -04:00
Wey-Yi Guy 88804e2b33 iwlwifi: dynamic allocate tx queue structure
Instead of always allocate the max number of tx queue structure,
use dynamic allocation based on the number of queues in device
configuration. With these changes, device does not have to allocate more
memory than the h/w can support.

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-10-27 16:47:59 -04:00
Ben Cahill 008a9e3e3c iwl3945: move iwl_power_initialize()
iwl_power_initialize() initializes driver data (not device hardware), and does
not need to execute more than once (when the driver initializes).  Therefore, it
does not belong in iwl3945_apm_init(), which initializes hardware, and may run
more than once.

Move it to iwl3945_pci_probe(), where it will run only once.  This agrees
with similar placement in iwl-agn.c's iwl_pci_probe(), although placement
under "services" seemed more appropriate than under "mac80211".

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:59 -04:00
Ben Cahill 743cdf1b65 iwl3945: streamline iwl3945_rfkill_poll()
iwl3945_rfkill_poll() has been silently calling wiphy_rfkill_set_hw_state()
every 2 seconds, regardless of whether hardware RF KILL switch changed state.

Call wiphy_rfkill_set_hw_state() only when RFKILL switch changes.
Add IWL_DEBUG_RF_KILL log message and documentation.

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:59 -04:00
Reinette Chatre 1a34c04380 iwlwifi: fix userspace setting of sleep_level_override
The sleep_level_override debugfs file is used by the user to request a
static power index instead of the dynamic sleep values. Users are expected
to provide value from 1 to 5 as an index or -1 to disable it.

The problem at the moment is that users can also provide 0 to this file
which, together with the value 1, is translated to index 1. This is
confusing and even more so when users write 0 to sleep_level_override and
then read 1 from it afterwards.

Modify checking to treat 0 as invalid.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:58 -04:00
Wey-Yi Guy 55036d6602 iwlwifi: additional items in sensitivity range table
Add more items to sensitivity range table to avoid using hardcoded values.
Initialize the table per device since unique per device information is
required to perform sensitivity calibration.

additional items in sensitivity range table:
   .barker_corr_th_min: Barker correlation threshold minimum
   .barker_corr_th_min_mrc: Barker correlation threshold minimum for MRC
   .nrg_th_cca: Energy threshold for Clear Channel Assessment

Barker codes are a technique used in WLAN encoding for transmission.
MRC is "Maximal Ratio Combining", a technique for optimally combining the
signals from 2 or more receivers to achieve a better signal.

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-10-27 16:47:58 -04:00
Wey-Yi Guy bd35f15082 iwlwifi: remove duplicated/unused definition
"IWL_CMD_QUEUE_NUM" is being defined in multiple places and used by all
the devices. move it to iwl-dev.h file and shared by all the devices.

Remove "IWL_CMD_FIFO_NUM", replaced by "IWL49_CMD_FIFO_NUM" and IWL50_CMD_FIFO_NUM"

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-10-27 16:47:58 -04:00
Ben Cahill b660d3adb8 iwlagn, iwl3945: remove apm_reset() functions
Clean up device-specific apm_reset() functions and library infrastructure,
now that these reset() functions are no longer being used.

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:58 -04:00
Ben Cahill 278d84051d iwl3945: remove unnecessary call to apm_ops.reset()
Now that we're unconditionally using apm_ops.stop() to reset and power-down
the device in __iwl3945_down(), the apm_ops.reset() is redundant.  Removing
this call will also allow us to remove iwl3945_apm_reset().

Remove unneeded iwl_clear_bit(CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ) because
this bit will be set again very soon in iwl3945_hw_txq_ctx_stop() and other
following calls.

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:57 -04:00
Ben Cahill 4d2ccdb948 iwlwifi: turn off device when not used.
In some cases (e.g. when mac80211 calls iwl_mac_stop() for suspend or user
no longer wants device active), device has not been going into low power state
via __iwl_down().  apm_ops.reset() does not put device into low power state;
instead it resets the device, then puts it into a powered-up state ready to be
re-loaded with uCode and re-started.  This has needlessly warmed up user's
laptops and drained batteries.

With current architecture in which mac80211 controls device up/down (including
resetting device after firmware errors), there is no need for apm_ops.reset()
any more; apm_ops.reset() is basically a combination of apm_ops.stop() and
apm_ops.init().

Instead, __iwl_down() now unconditionally places the device into a low-power
state via apm_ops.stop(). Device may be re-started via __iwl_up() calling
apm_ops.init() as soon as it may be needed (e.g. quickly for firmware errors),
but in the meantime, device will stop wasting energy.

Note that, even in this low power state, if driver re-enables interrupts,
the device retains the ability to sense the hardware RF-KILL switch, and
(except for 3945) interrupt the host when it changes.

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:57 -04:00
Ben Cahill f33269b896 iwl3945: update iwl3945_apm_init()
Update iwl3945_apm_init() to set up device registers in sequence most recently
recommended by factory.

Add resets for APMG interrupts and radio chip, formerly done only in
iwl3945_apm_reset(); moving them here assures that apm_init() will do
a complete job of preparing hardware not only after platform boot,
but also after apm_stop() has executed (due to rfkill, ifconfig down,
driver unload, etc.).  This is in preparation to completely remove apm_reset().

Add some comments.

Signed-off-by: Ben Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:56 -04:00
matthieu castet 40b93ad6e9 airo : allow supend with card without power management
Some airo card don't support power Management [1].
Don't abort suspend with those cards.

00:06.0 Network controller: AIRONET Wireless Communications PC4800 (rev 01)
        Flags: medium devsel, IRQ 17
        Memory at dffffe00 (32-bit, non-prefetchable) [size=128]
        I/O ports at d000 [size=128]
        I/O ports at cc00 [size=64]
        Kernel driver in use: airo

Signed-off-by: Matthieu CASTET <castet.matthieu@free.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:56 -04:00
Michael Buesch 8b45499ccb ssb: Put host pointers into a union
This slightly shrinks the structure.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:55 -04:00
Michael Buesch 899110fe4e b43/legacy: Fix usage of host_pci pointer
We must check the bustype before using the host_pci pointer.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:55 -04:00
Sujith 332c556633 ath9k: Fix TX hang poll routine
When TX is hung, the chip is reset. Ensure that
the chip is awake by using the PS wrappers.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:55 -04:00
Amitkumar Karwar c0bbd57679 libertas: Check return status of command functions
Return status of lbs_prepare_and_send_command and lbs_cmd_with_response
functions is not checked at some places. Those checks are added.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:55 -04:00
Juuso Oikarinen be823e5b2d wl1271: Mask unneeded events from firmware to conserve power
Currently several events are enabled from the firmware for which there
is no handling. This wakes up the host unnecessarily. Mask those
unneeded events.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:54 -04:00
Juuso Oikarinen 1922167b9d wl1271: Configure beacon filtering on if PSM used
Enable beacon filtering when PSM is enabled

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:54 -04:00
Juuso Oikarinen b771eee583 wl1271: Enable beacon filtering with the stack
Enable beacon filtering with the mac80211 stack.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:54 -04:00
Juuso Oikarinen 344152361e wl1271: Add connection monitoring configuration
Add configuration for connection monitor (number of allowed beacons, and
timeout after last received beacon.)

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:53 -04:00
Juuso Oikarinen 1fba49741d wl1271: Use vmalloc to allocate memory for firmware
Use vmalloc to allocate memory for the firmware image, and use a smaller
linear buffer for the actual transfer of the firmware to the chipset.

This patch is an adaptation of a similar patch for wl1251 by Kalle Valo.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:53 -04:00
Juuso Oikarinen c87dec9f18 wl1271: Multicast filtering configuration
Enable multicast filtering. This way by default no multicast frames will
reach the host, and when needed, only required multicast frames can be
passed from the WLAN chipset to the host.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:53 -04:00
Juuso Oikarinen 66497dc3bd wl1271: Clear probe-request template after scan
Clear the probe-request template on the firmware after scan. Unless
cleared, the firmware can independently send probe requests to the AP
and interfere with the mac80211 logic.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:53 -04:00
Juuso Oikarinen a64b07e8c6 wl1271: use workqueue provided by mac80211 instead of the default
Use the workqueue provided by the mac80211 stack instead of the system
default queue.

Modified to use new ieee_queue_work() as required by changes in the
stack.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:52 -04:00
Luciano Coelho 64a7f67287 wl1271: hack to disable filters
This is a hack to disable all filters in the join command.  This is based on
Kalle Valo's patch for wl1251.

Cc: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:51 -04:00
Luciano Coelho 2f01872500 wl1271: added Juuso Oikarinen as module author
Add Juuso as one of the module authors, since he's working heavily on this
module as well.

Cc: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:51 -04:00
Juuso Oikarinen be7078c21d wl1271: Corrections to TX path
Corrections to the TX path - use correct number of maximum descriptors
(32 instead of 16) and correct checking and setting of excessive retries
on completion.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:50 -04:00
Juuso Oikarinen d94cd297e5 wl1271: Update join usage
Update the usage of join's, including using actual beacon interval and
dtim from AP, and configuring a basic rate set from AP.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:50 -04:00
Juuso Oikarinen 8a5a37a6c4 wl1271: Configure rate policies based on AP rates
Configure the rate policies to the firmware based on the rates given by
the AP.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:50 -04:00
Juuso Oikarinen 545f1da8ef wl1271: Implementation for SPI busy word checking
This patch adds implementation for checking for SPI busy words - i.e.
honoring a delay request from the WLAN chipset upon reading
registers/memory.

To optimized the average SPI ready by 32 bits, also configure the number
of busywords to one to disable the "fixed-busy-word" functionality.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:49 -04:00
Juuso Oikarinen c3fea1994a wl1271: mask aid bits 14 and 15 in ps-poll template
In ps-poll template aid bits 14 and 15 were not masked as required by
the standard. Mask them so that aid is sent in correct format.

This patch is a direct port of the respective patch for the wl1251
driver by Kalle Valo.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:49 -04:00
Juuso Oikarinen 37b70a8185 wl1271: Implement delayed entry into ELP
Implement delayed entry into ELP. This will promote the following:
 - Less redundant sleep/wake cycles (better perf)
 - Avoids known firmware issues with going to ELP too fast after an
   operation

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:49 -04:00
Juuso Oikarinen 1e2b79761d wl1271: Correct TKIP header space handling in TX path
Correct the position to which TKIP header space is appended for TX
packets.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@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-10-27 16:47:48 -04:00
Juuso Oikarinen ac4e4ce54e wl1271: Security sequence number handling for TX (for WPA)
Add security sequence number handling to the driver TX data path needed
by WPA.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:48 -04:00
Juuso Oikarinen 3b4be9e08a wl1271: Correction to TX block allocation calculation
Correct the TX path implementation to allocate sufficient blocks in the
firmware for TX packets.

Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:48 -04:00
Luciano Coelho 9d565973de wl1271: remove unecessary qual parameter from rx status
The qual element in ieee80211_rx_status is not used anymore, so we don't need
to set it in the wl1271_rx_status() function.  This saves a bit of time in
the RX path.

Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:47 -04:00
David Kilroy 3414fc3f52 orinoco: use cfg80211 ethtool ops
Signed-off-by: David Kilroy <kilroyd@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:47 -04:00
Luis R. Rodriguez 6226811f4e ath9k_hw: run ath9k_hw_9271_pa_cal() initial calibration
The PA calibration for ar9271 ath9k_hw_9271_pa_cal() can run during
reset or initial calibration, update the PA calibration to account
for that and initialize PA calibration variables for both conditions.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:47 -04:00
Luis R. Rodriguez b57df129aa ath9k_hw: run the carrier leakage calibration fix for ar9271 as well
This is required for the ar9271 hardware as well.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:47:46 -04:00
Roel Kluin 30bd572673 airo: Reorder tests, check bounds before element
Test whether index is within bounds before reading the element

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:29:49 -04:00
Holger Schurig d18ba452d7 libertas spi: fix sparse errors
This fixes the following sparse warnings:

$ make modules SUBDIRS=drivers/net/wireless/libertas C=1 CF=-D__CHECK_ENDIAN__
make: Entering directory `/usr/src/linux-wl'
  CHECK   drivers/net/wireless/libertas/if_spi.c
drivers/net/wireless/libertas/if_spi.c:137:16: warning: incorrect type in initializer (different base types)
drivers/net/wireless/libertas/if_spi.c:137:16:    expected unsigned short [unsigned] [usertype] reg_out
drivers/net/wireless/libertas/if_spi.c:137:16:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:191:16: warning: incorrect type in initializer (different base types)
drivers/net/wireless/libertas/if_spi.c:191:16:    expected unsigned short [unsigned] [usertype] reg_out
drivers/net/wireless/libertas/if_spi.c:191:16:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:256:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:256:24:    expected restricted __le32 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:256:24:    got unsigned int *<noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:171:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/libertas/if_spi.c:171:7:    expected unsigned short [unsigned] [usertype] buff
drivers/net/wireless/libertas/if_spi.c:171:7:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/libertas/if_spi.c:243:24: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/libertas/if_spi.c:243:24:    expected restricted __le16 const [usertype] *p
drivers/net/wireless/libertas/if_spi.c:243:24:    got unsigned short *<noident>

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:29:48 -04:00
Miguel Boton e6693eab35 b43: add 'struct b43_wl' missing declaration
'struct b43_wl' declaration is missing at 'leds.h'.
It should be declared to avoid getting some GCC warnings at 'b43_leds_unregister'.

Signed-off-by: Miguel Botón <mboton@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:29:46 -04:00
Larry Finger d50bae33d1 b43: Fix Bugzilla #14181 and the bug from the previous 'fix'
"b43: Fix PPC crash in rfkill polling on unload" fixed the bug reported
in Bugzilla No. 14181; however, it introduced a new bug. Whenever the
radio switch was turned off, it was necessary to unload and reload
the driver for it to recognize the switch again.

This patch fixes both the original bug in #14181 and the bug introduced by
the previous patch. It must be stated, however, that if there is a BCM4306/3
with an rfkill switch (not yet proven), then the driver will need an
unload/reload cycle to turn the device back on.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:29:46 -04:00
Benoit PAPILLAULT 1761631083 rt2x00: Fix crypto in TX frame for rt2800usb
Signed-off-by: Benoit PAPILLAULT <benoit.papillault@free.fr>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2009-10-27 16:29:45 -04:00
Jasper Spaans a361c83cb4 bonding: Remove bond_dev from xmit_hash_policy call.
Now that the bonding device is no longer used in determining the device to
which to send packets, it can be dropped from the argument list of the various
xmit_hash_policy calls.

Signed-off-by: Jasper Spaans <spaans@fox-it.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-27 01:05:13 -07:00
David S. Miller cfadf853f6 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/sh_eth.c
2009-10-27 01:03:26 -07:00
Kurt Van Dijck 9dbb58d867 can: sja1000: fix bug using library functions for skb allocation
Commit 7b6856a0 "can: provide library functions for skb allocation"
did not properly remove two lines of the SJA1000 driver resulting in
a 'skb_over_panic' when calling skb_put, as reported by Kurt.

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-27 01:02:33 -07:00
Krishna Kumar 10e85f7f08 cxgb3: Set the rxq
Set the rxq# for LRO when processing the last fragment of a
frame. This helps in fast txq selection for routing workloads.

Signed-off-by: Krishna Kumar <krkumar2@in.ibm.com>
Acked-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-27 01:02:32 -07:00
Nobuhiro Iwamatsu f568a926a3 sh_eth: Add asm/cacheflush.h
Add include asm/cacheflush.h,  because declaration of __flush_purge_region
moved to asm/cacheflush.h.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-26 17:19:44 -07:00
Michal Ostrowski fb64bb560e PPPoE: Fix flush/close races.
Be more careful about the state of pointers during tear-down.
The "pppoe_dev" field can only be looked at safely while holding socket locks.
This subsequently allows for the flush_lock to be killed.

We depend on the PPPOX_CONNECTED state to tell us that that those fields are
valid, so whoever clears that state (pppox_unbind_sock()) is responsible for
the dev_put() call.

We also have to ensure that we delete_item() on all sockets before they are
cleaned up.

The need for these changes has been exposed by scenarios wherein namespace
bindings of ethernet devices change while there are ongoing PPPoE sessions,
which resulted in oopses due to unusual socket connection termination paths,
exposing these issues.

Signed-off-by: Michal Ostrowski <mostrows@gmail.com>
Reviewed-by: Cyril Gorcunov <gorcunov@gmail.com>
Reported-by: Denys Fedoryschenko <denys@visp.net.lb>
Tested-by: Denys Fedoryschenko <denys@visp.net.lb>
2009-10-26 16:23:20 -07:00
Bruce Allan 5ccdcecb72 e1000e: allow for swflag to be held over consecutive PHY accesses
PCH-based parts (82577/82578) and some ICH8-based parts (82566) need to
hold the swflag (sw/fw/hw hardware semaphore) over consecutive PHY accesses
in order to perform sw-driven PHY configuration during initialization to
workaround known hardware issues (see follow-on patch).  This patch
provides new PHY read/write functions (and function pointers) that will
allow accessing the PHY registers assuming the swflag has already been
acquired.  The actual PHY register access code has moved into helper
functions that are called with a flag indicating whether or not the swflag
has already been acquired and acquires/releases it if not.

The functions called from within the updated PHY access functions had to be
updated to assume the swflag was already acquired, and other functions that
called those functions were also updated to acquire/release the swflag.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-26 16:16:25 -07:00
Bruce Allan ca15df58b1 e1000e: separate mutex usage between NVM and PHY/CSR register for ICHx/PCH
Accesses to NVM and PHY/CSR registers on ICHx/PCH-based parts are protected
from concurrent accesses with a mutex that is acquired when the access is
initiated and released when the access has completed.  However, the two
types of accesses should not be protected by the same mutex because the
driver may have to access the NVM while already holding the mutex over
several consecutive PHY/CSR accesses which would result in livelock.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-26 16:16:24 -07:00
Bruce Allan fa2ce13ca7 e1000e: 82577/82578 requires a different method to configure LPLU
Unlike previous ICHx-based parts, the PCH-based parts (82577/82578) require
LPLU (Low Power Link Up, or "reverse auto-negotiation") to be configured in
the PHY rather than the MAC.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-26 16:16:23 -07:00
Bruce Allan 53ac5a8875 e1000e: increase swflag acquisition timeout for ICHx/PCH
In some conditions (e.g. when AMT is enabled on the system), it is possible
to take an extended period of time to for the driver to acquire the sw/fw/hw
hardware semaphore used to protect against concurrent access of a shared
resource (e.g. PHY registers).  This could cause PHY registers to not get
configured properly resulting in link issues.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-26 16:16:19 -07:00
Bruce Allan db2932ecf8 e1000e: clear PHY wakeup bit after LCD reset on 82577/82578
Performing a dummy read of the PHY Wakeup Control (WUC) register clears the
wakeup enable bit set by an PHY reset.  If this bit remains set, link
problems may occur.

Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-26 16:16:18 -07:00
Alexander Duyck 39305965f3 igbvf: fix memory leak when ring size changed while interface down
This patch resolves a memory leak which occurs while changing the ring size
while the interface is down.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-26 16:09:01 -07:00
Alexander Duyck 759884b4d4 ixgbe: fix memory leak when resizing rings while interface is down
This patch resolves a memory leak that occurs when you resize the rings via
the ethtool -G option while the interface is down.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-26 16:08:59 -07:00
Alexander Duyck 6d9f4fc420 igb: fix memory leak when setting ring size while interface is down
Changing ring sizes while the interface was down was causing a double
allocation of the receive and transmit rings.  This issue is amplified when
there are multiple rings enabled.  To prevent this we need to add an
additional check which will just update the ring counts when the interface
is not up and skip the allocation steps.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-26 16:08:56 -07:00
Jasper Spaans d3da68310a bonding: Modify hash transmit policies to use the packet's source MAC address
Modify bonding hash transmit policies to use the psource MAC address of
the packet instead of the MAC address configured for the bonding device.

The old sitation conflicts with the documentation.

Signed-off-by: Jasper Spaans <spaans@fox-it.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 07:02:28 -07:00
Ben Dooks 62e20a624b DM9000: Fix revision ID for DM9000B
The DM9000B revision ID is 0x1A, not 0x1B as set in the curernt
dm9000.h header.

Fix bug reported by Paolo Zebelloni.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Simtec Linux Team <linux@simtec.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 06:53:07 -07:00
Simon Wunderlich 05af2142d0 r8169: fix Ethernet Hangup for RTL8110SC rev d
The 8110SC rev d chip on our board shows a regression which the 8110SB chip
did not have. When inbound traffic is overflowing the receive descriptor queue,
"holes" in the ring buffer may occur which lead to a hangup until the buffer
is filled again. The packets are than completely processed, but the ring
remains porous and no packets are processed until the next overflow. Setting
the interface down and up can fix the problem temporary from userspace.

For some reason we don't know, this behaviour is not occuring if the RxVlan
bit for hardware VLAN untagging is set. There is another "Work around for
AMD plateform" in the current code which checks the VLAN status
word in receive descriptors, but does never come to effect when hardware
VLAN support is enabled. We assume that this is a bug in the chip.

The following patch fixes the problem. Without the patch we could reproduce
the hang within minutes (given other devices also generating lots of
interrupts), without we couldn't reproduce within a few days of long term
testing.

This version contains minor style adjustments and is sent with mutt which
will hopefully not destroy the formatting again.

Signed-off-by: Bernhard Schmidt <bernhard.schmidt@saxnet.de>
Signed-off-by: Simon Wunderlich <simon.wunderlich@saxnet.de>
Acked-by: Francois Romieu <romieu@zoreil.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 06:47:33 -07:00
Ben Hutchings b37b62fea1 sfc: Rename 'xfp' file and functions to reflect reality
The 'XFP' driver is really a driver for the QT2022C2 and QT2025C PHYs,
covering both more and less than XFP.  Rename its functions and
constants to reflect reality and to reduce namespace pollution when
sfc is a built-in driver.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:28 -07:00
Ben Hutchings fc2b5e673f sfc: Remove unused code for non-autoneg speed/duplex switching
The only multi-speed PHY driver using this is 10Xpress, and it does
not support non-autoneg operation.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:26 -07:00
Ben Hutchings 18ea024fd6 sfc: Merge efx_fc_resolve() into efx_mdio_get_pause()
efx_fc_resolve() is specific to MDIO and is not used by any other
function.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:25 -07:00
Ben Hutchings a5211bb5f7 sfc: Move MTD probe after netdev registration and name allocation
The MTD partition is named based on the netdev name, which is set to
'eth%d' before registration.  Also, the MTD partition will currently
be left registered if netdev registration fails.

Fix both these problems by moving the MTD probe after netdev
registration.  Hold the RTNL to serialise this with the netdev
notifier that calls efx_mtd_rename().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:24 -07:00
Ben Hutchings 2ed380a59b sfc: Remove unnecessary tests of efx->membase
These cleanup functions will never be called if the MMIO region could
not be mapped.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:23 -07:00
Ben Hutchings be4b163b28 sfc: Remove incorrect assertion from efx_pci_remove_main()
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:22 -07:00
Ben Hutchings 96c45726c7 sfc: Merge falcon_probe_phy() into falcon_probe_port()
MAC and PHY probing are bound up together, as evidenced by the
initialisation of efx_nic::loopback_modes.  Remove the current
arbitrary separation.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:18 -07:00
Ben Hutchings dc803df8dd sfc: Remove pointless abstraction of memory BAR number
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:18 -07:00
Ben Hutchings 8698a6b642 sfc: Removed kernel-doc for nonexistent member of efx_phy_operations
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:17 -07:00
Ben Hutchings 0d86ebd815 sfc: Maintain interrupt moderation values in ticks, not microseconds
This simplifies the implementation a lot.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:15 -07:00
Ben Hutchings 0484e0db7c sfc: Move shared members of struct falcon_nic_data into struct efx_nic
These will also be used with Siena NICs.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:14 -07:00
Ben Hutchings 59cf09cc2f sfc: Move efx_xmit_done() declaration into correct stanza
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:13 -07:00
Ben Hutchings 5c86987e86 sfc: Remove declarations of nonexistent functions
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:13 -07:00
Ben Hutchings f01865f064 sfc: Change order of device removal to reverse of probe order
This makes efx_pci_remove_main() more obviously the inverse of
efx_pci_probe_main(), and matches our out-of-tree driver.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:12 -07:00
Ben Hutchings 7d4cdb5af0 sfc: Merge struct efx_blinker into struct efx_board
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:08 -07:00
Ben Hutchings 63f1988419 sfc: Move all TX DMA length limiting into tx.c
Replace the duplicated logic in efx_enqueue_skb() and
efx_tx_queue_insert() with an inline function, efx_max_tx_len().

Remove the failed attempt at abstracting hardware-specifics and put
all the magic numbers in efx_max_tx_len().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:07 -07:00
Ben Hutchings 6d51d30750 sfc: Define DMA address mask explicitly in terms of descriptor field width
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:06 -07:00
Ben Hutchings 3ffeabdd2b sfc: Eliminate indirect lookups of queue size constants
Move size and mask definitions into efx.h; calculate page orders in falcon.c.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:05 -07:00
Ben Hutchings 12d00cadcc sfc: Rename register I/O header and functions used by both Falcon and Siena
While we're at it, use type suffixes of 'd', 'q' and 'o', consistent
with register type names.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:04 -07:00
Ben Hutchings 3e6c453854 sfc: Update hardware definitions for Siena
Siena is still based on the Falcon hardware architecture and will
share many of these definitions, so replace falcon_hwdefs.h with
regs.h.

The new definitions have been generated according to a naming
convention which incorporates the type and revision information.
Update the code accordingly.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:03 -07:00
Ben Hutchings 625b451455 sfc: Move RX data FIFO thresholds out of struct efx_nic_type
Since there are now separate blocks of code to set the thresholds for
each NIC type, it is no longer useful to include them in the NIC type
description.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:27:00 -07:00
Ben Hutchings 56241ceb9e sfc: Remove versioned bitfield macros
These macros are not extensible to more than two NIC types without
repetition of register definitions, and they are only used to deal
with a few fields in RX_CFG_REG and global events which moved between
Falcon rev A1 and B0.

Therefore:
- Move RX_CFG_REG initialisation into its own function which tests the
  NIC revision just once
- Explicitly test the NIC revision when checking the RX_RECOVERY flag in
  global events
- Merge definitions of RX_XOFF_MAC_EN flag, which did not move
- Remove the macro definitions

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:26:56 -07:00
Ben Hutchings 5087b54ddc sfc: Remove boards.h, moving last remaining declaration to falcon.h
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:26:56 -07:00
Ben Hutchings c9597d4f89 sfc: Merge sfe4001.c into falcon_boards.c
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:26:55 -07:00
Ben Hutchings 3473a5b118 sfc: Rename Falcon-specific board code and types
Siena will require entirely different board code.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:26:52 -07:00
Ben Hutchings 19e71cf691 sfc: Remove redundant hardware initialisation
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:26:52 -07:00
Ben Hutchings 7dbb06f707 sfc: Remove redundant header gmii.h
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-24 04:26:50 -07:00
Eric Dumazet db51914424 ifb: should not use __dev_get_by_index() without locks
At this point (ri_tasklet()), RTNL or dev_base_lock are not held,
we must use dev_get_by_index() instead of __dev_get_by_index()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-22 21:54:19 -07:00
Manuel Lauss bc36b42851 net: au1000_eth: add missing capability.h
fixes the following build failure:
  CC      drivers/net/au1000_eth.o
/drivers/net/au1000_eth.c: In function 'au1000_set_settings':
/drivers/net/au1000_eth.c:623: error: implicit declaration of function 'capable'
/drivers/net/au1000_eth.c:623: error: 'CAP_NET_ADMIN' undeclared (first use in this function)
/drivers/net/au1000_eth.c:623: error: (Each undeclared identifier is reported only once
/drivers/net/au1000_eth.c:623: error: for each function it appears in.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-22 21:51:27 -07:00
Brice Goglin 196f17eb17 myri10ge: improve port type reporting in ethtool
Improve the reporting of myri10ge port type in ethtool,
and update for new boards.

Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-22 21:43:43 -07:00