History log of /drivers/net/wireless/iwlwifi/iwl-5000.c
Revision Date Author Comments
e03bbb62cfdf539ae8110b297493c685f9d12774 13-Apr-2014 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: don't disable SCD chain extension on newer devices

7000 device series have a fix for this hardware feature.
Stop disabling it, and get an improvement in Tx throughput.
This feature allows the scheduler to fetch more frames on
the fly while an A-MPDU is being built - which means that
we can get larger A-MPDU. This, of course, give an
improvement in the Tx throughput.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
51368bf792c79eb917694a4155d62f04359e3734 30-Dec-2013 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: Update Copyright to 2014

Happy new year!

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
0d8877a10d65f3c9bb84ad150e524d95ebd377fb 17-May-2013 Johannes Berg <johannes.berg@intel.com> iwlwifi: move some configuration parameters into DVM

There are a number of parameters that aren't really hardware
specific but rather define how the DVM firmware is used.
Move these into the DVM configuration.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
b1f553c7484b983aac20c107b9766804b69cf73f 19-Feb-2013 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: make device configuration bus agnostic

Newer devices can work on different buses. This means that
their configuration can be shared between different buses.
Hence the configuration structures should exported to all
the buses and not only to PCIE. Change this.

Note that this requires all the fields to be the same
amongst the buses. If differences will appear, we can always
define a part that is bus dependent. Today, this is not
needed.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6468a01a7181f3572a3e686910016f89ee71ff45 16-May-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move PCIe into subdirectory

Structure the code a bit more and move all PCIe code
including the hardware configuration files into a
PCIe specific subdirectory.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
78cbcf2b9dbe0565820dc7721316f9c401000a68 22-Apr-2012 Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> iwlwifi: use correct released ucode version

Report correctly the latest released version
of the iwlwifi firmware for all
iwlwifi-supported devices.

Cc: stable@vger.kernel.org #3.3+
Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0db19cde17ece4695cec503f9f6f0a1d4621dac7 03-Apr-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: clean up some hw file includes

We can't get rid of everything yet due to
the BT definitions that I'm not quite sure
yet how to handle, but we can get rid of
most unneeded includes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
586aed966049c3248db334d6ab9b317e25be7b14 03-Apr-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move eeprom versions to HW files

The hardware files belong to the core PCI
functionality, but the eeprom header file
mixes higher-level functionality and the
defines, so move out the specific defines
and put them into the appropriate HW files
instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
e96766958c914f1240317c967bb322cd3731fb17 10-Apr-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: dynamically determine lib_ops

Having the pointer to lib_ops in the config
makes it impossible to split the driver into
different modules. Determine the ops based on
the device family enumeration to get rid of
the direct pointer.

Also move all the opmode specific code from
the iwl-[1256]000.c files into a new file
iwl-agn-devices.c so that the former only
have configuration data now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2d771cb68bd7fa925d45afb62f0a1a24f82f5315 10-Apr-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: introduce device family enum

This will later be used to dynamically bind
the configuration data for DVM and MVM.

For now, we can use it to get rid of the
additional_nic_config() hook.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11483b5c2296cb318140f8b4ff9148faab0209d0 10-Apr-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move eeprom into priv

The whole code around eeprom is distributed
across whole bunch of different files, most
of which belong to the to-be-DVM code. As a
result, it is currently very hard to split
out the EEPROM code to be generic. However,
it is also quite unlikely that the current
EEPROM code will be needed by the MVM code
as that has different mechanisms to query
the EEPROM (it does so through the uCode.)

So, at least temporarily, move everything
into priv. If it becomes necessary to use
the code from MVM, we will have to split it
out, but then it's also easier since we'll
know what pieces we need.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9e295116bb1f7300e5cdb87a41ce85b1efe79ec2 10-Apr-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move hw_params into priv

The hw_params are mostly values that are
derived from the actual hardware config.
As such, while it is possible that MVM
will require similar ones, it makes more
sense -- at least for now -- to put them
into the DVM struct.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7c5ba4a830cbb730770129b0004e2a06e47dbac5 10-Apr-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move queue watchdog into transport

This removes one of the two sources of device
restarts in the upper layer -- those are a bit
inconvenient because normal restarts originate
in the transport. By moving the watchdog down
it can be treated the same.

Also rewrite the watchdog logic. Timers are
much more efficient when they never fire, so
instead firing a timer every 500ms set up a
timer for each TX queue and fire it only when
the queue is really stuck. This avoids the CPU
waking up when everything is working well.

While at it, remove the wd_disable config item
and replace it by simply setting wd_timeout to
IWL_WATCHHDOG_DISABLED (0).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9eae88fa9a02e31af69a215beaa5e1194da3a5a1 15-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: move queue mapping out of transport

The queue mapping is not only dynamic, it
is also dependent on the uCode, as we can
already see today with the dual-mode and
non-dual-mode being different.

Move the queue mapping out of the transport
layer and let the higher layer manage it.
Part of the transport configuration is how
to set up the queues.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1745e4405b2c0da6db2ec4b6bc0ad930612d8295 09-Mar-2012 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: fix the delta for remove max_txq_num patch

BIg portion of "iwlwifi: remove max_txq_num from hw_params" was
missing during merge, here is the fix for it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9563fe1696fa0ced8cfa3f935736d4662a81c1c3 07-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove unused max_nrg_cck from sensitivity and constify

The sensitivity parameters are never modified, so they
should be const. Also remove the unused max_nrg_cck
value to save some space.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
eae63b858f9a238a8868846dc5f27fc5e1865659 06-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: don't include iwl-prph.h everywhere

It's only needed in a few places.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6794f3ee1dc4a2f7ebed99a4c075f00bbebbcfdc 06-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: constify remaining config data

The HW configuration settings base_params, ht_params
and bt_params all should be const, make it so.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ae9625a1a947f33579c244b730001f2ea7d15045 06-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove num_of_queues module parameter

This is a hardware parameter, so it shouldn't
be configurable by the user. Users can disable
aggregation (which is the only thing affected)
with 11n_disable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e10a0533a9172471b52bd9512838d766420a3baf 06-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: add wrappers for command sending

Add wrappers to send commands from the DVM
op-mode (which essentially consists of the
current driver). This will allow us to move
specific sanity checks there.

Also, this removes iwl_trans_send_cmd_pdu()
since that can now be taken care of in the
DVM-specific wrapper.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
706c4ff67cb86134a3a93413a595a7c5559b7cc2 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: make config const

Writing to the global config structures
is always wrong. To protect against such
mistakes in the future, mark them const.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7e79a3937a44b1dc5f457e6dbb8c50e93719286a 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: use valid TX/RX antenna from hw_params

It's not really a good idea to write to the
global static configuration. Use the valid
TX/RX antenna information only from the HW
params struct except in the case where the
values from the config are used to override
the values from the EEPROM.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
08ae86ac3f9d9c9a60d2883c82cd72a5c66b94db 05-Mar-2012 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove shared lock

Some data doesn't need protection, some of the
lock places are simply useless, and some data
can be protected with the mutex instead. Thus
the shared lock can be removed by making those
changes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
dae66d0d2ee1a188fcfd437c4e6b2bf32dc7a1b2 06-Feb-2012 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: SRAM size moves from hw_params to cfg

This will allow to set the hw_params after we fetch the uCode.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
6d4dec7ba4b0275c97c39b694cfe60e9aeafdf60 17-Feb-2012 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: iwl_set_hw_params returns always 0

Remove the return value.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
87272af74e98225672c9165a20b0604a7db758cf 26-Jan-2012 Don Fry <donald.h.fry@intel.com> iwlwifi: move bcast_sta_id init to common routine

There is nothing device specific in the initialization of the
bcast_sta_id so move it to the common inititalization routine.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
1042db2af183b96cdce5972014d85e8bca0634ad 03-Jan-2012 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: give trans to all the read / write functions

From now on, the transport layer in charge of providing access to the
device. So change all the driver to give a pointer to the transport
to all the low level functions that actually access the device.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
fb4961dbc27d40cdbed297aa9bd74fa4a0e2ba6c 06-Jan-2012 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: update Copyright

Update Copyright to 2012

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4e3182626a914443a5e0fbe014813f03e51a75df 27-Dec-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: update Copyright

Update Copyright to 2012

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
3862241945026a8fa165ab73c57739df77b8e1fb 16-Dec-2011 Don Fry <donald.h.fry@intel.com> iwlwifi: move iwl_cfg from iwl_priv to iwl_shared

Move the configuration pointer from the upper level iwl_priv to the
lower level iwl_shared structure, with associated code fixes.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
ab36eab24e7847d6d92872c55b46554c8ac4c4b3 01-Dec-2011 Don Fry <donald.h.fry@intel.com> iwlwifi: move eeprom pointer from iwl_priv to iwl_shared

The eeprom image is a device level component, move from iwl_priv
to iwl_shared, with associated code changes.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
9995ffe5f5fdddcc73e4465cc3f8b38714df8108 02-Dec-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: change the default behavior of watchdog timer

The current default watchdog timer is enabled, but we are seeing issues on
legacy devices. So change the default setting of watchdog timer to per
device based. But user still can use the "wd_disable" module parameter
to overwrite the system setting

Cc: stable@vger.kernel.org #3.0+
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c27bdc84d6310914cfdd59280c2e663588392d01 25-Nov-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove calibration knowledge

The init microcode knows very well which calibrations
are required and sends us results for those that are.
Consequently, we can just send all of those to the RT
uCode again.

The problem with having the driver know about this is
that it is a uCode feature, not a hardware feature so
the config is completely unsuitable.

The only thing we need to check is whether the device
needs crystal calibration or not, add a new parameter
to the configuration for that.

This makes new uCode work on 6000 series devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
93b64105e5642728cfc441e20a42164323fe4ad0 17-Nov-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove calibration knowledge

The init microcode knows very well which calibrations
are required and sends us results for those that are.
Consequently, we can just send all of those to the RT
uCode again.

The problem with having the driver know about this is
that it is a uCode feature, not a hardware feature so
the config is completely unsuitable.

The only thing we need to check is whether the device
needs crystal calibration or not, add a new parameter
to the configuration for that.

This makes new uCode work on 6000 series devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
6a686c600268b71619f93d35f9373e2b6ab5947b 10-Oct-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: move iwl_enable_rfkill_int and kill iwl-helpers.h

Move iwl_enable_rfkill_int to iwl-core.h, and remove the empty
iwl-helpers.h

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0b3e6f861a108dee24e93624b279984e7385012f 10-Oct-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove 5000 hw header

The inline function in this header is only used
in a single file, so we can move it there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c745f55baf63d08d6e9bb20682102fb8bae8f67a 10-Oct-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: merge station management functions

After driver split, no need to separate station management functions
in two files, merge it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ade4c649a0e9e862751fe1c98f43fbee86554c8a 10-Oct-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: rename all the mac80211 callback functions

Use the same calling style for all the mac80211 callback functions

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3eae4bb176d3d51f6c61b8b1679116e58586d669 10-Oct-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: kill hw_params.max_stations

Not needed since driver split.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
cebcbd752a2e8b3a4da1d554cc570fc5310af057 15-Sep-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: rename iwl-pci.h to iwl-cfg.h

There's nothing PCI(E) specific in this file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
403ba56aedf2b3092e12219188e5c248f04c5acc 15-Sep-2011 Don Fry <donald.h.fry@intel.com> iwlagn: replace beacon_time_fsf_bits variable with #define

All devices use the same value for beacon_time_tsf_bits. Use the #define

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b8c2b05e14fbe1ba3fffa31931a1a9ef8da933f9 15-Sep-2011 Fry, Donald H <donald.h.fry@intel.com> iwlagn: simplify chain_noise_num_beacons indirection

chain_noise_num_beacons is set and never changes. Use the #define
rather than 3 levels of indirection.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
332a4bad975616f33c2d1bf94c4ace2ea4113835 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: iwl-pci doesn't include iwl-dev any more

Move all the iwlXXX_abgn_cfg forward declaration to a separate file
so that iwl-pci.c doesn't need to include iwl-agn.h that includes
all iwl-dev.h
This allows to provide real encapsulation. Dereferencing iwl_priv
in the bus layer will now lead to a compilation error.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
83ed90155f98bd949735c2cc22d832b557a6d7d1 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: all function iwl-io.c receive iwl_bus

Which means that iwl-io.c doesn't need to include iwl-dev.h any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ab9e212e92aa2820a5b961c42142d36257b0742c 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: remove unused parameters from hw_params

Some of them weren't used at all, the others always had the same value since
the driver split.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e6bb4c9c00892c488f3218ea317dc6a71674faf4 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: bus layer chooses its transport layer

Remove iwl_transport_register which was a W/A. The bus layer knows what
transport to use. So now, the bus layer gives the upper layer a pointer to the
iwl_trans_ops struct that it wants to use. The upper layer then, allocates the
desired transport layer using iwl_trans_ops->alloc function.

As a result of this, priv->trans, no longer exists, priv holds a pointer to
iwl_shared, which holds a pointer to iwl_trans. This required to change all the
calls to the transport layer from upper layer. While we were at it, trans_X
inlines have been renamed to iwl_trans_X to avoid confusions, which of course
required to rename the functions inside the transport layer because of
conflicts in names. So the static API functions inside the transport layer
implementation have been renamed to iwl_trans_pcie_X.

Until now, the IRQ / Tasklet were initialized in iwl_transport_layer. This is
confusing since the registration doesn't mean to request IRQ, so I added a
handler for that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10b15e6f67ba4d9abb8788100a5267341cc98b7b 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: priv->lock moves to iwl_shared

Since it is used by all the layers, it needs to move to iwl_shared.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d618912417fbce4f6514fe1cbef7df2e73bdb6c2 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: hw_params moves to iwl_shared

Since it is used by all the layers, it needs to move to iwl_shared.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
48f20d354e729afcfb29ff41aca7583ebb94613d 26-Aug-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: introduce iwl-shared.h

It will hold declaration of functions and forward declaration of struct that
are used by several layers.
This will allow modules not to include iwl_priv. iwl_bus and iwl_trans are
still visible to all.

All the layers share the module parameters, move the struct to iwl-shared.h.
Also add all module parameters to iwl_mod_params instead of having them as
global static. This includes

* debug_level
* ant_coupling
* bt_ch_announce
* wanted_ucode_alternative

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e7515ba154b63c87d987fb2a30bcbe8814c3f317 23-Jul-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: change default sensitivity value for 5000 and 6000 series

Update the default sensitivity value for both 5000 and 6000 series devices

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
29a34f92b5f1776f011272da315daba827a2d950 13-Jul-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove wireless extensions inclusions

linux/wireless.h and net/iw_handler.h headers are
for wireless extensions only, so mac80211 drivers
shouldn't be including them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f35291082294ca6737953bbe4e9491ede04ab822 02-Aug-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: 5000 do not support idle mode

5000 series has issue supporting power save idle mode:

commit 9dc2153315650eae220898668b6aa56a25c130be

iwlwifi: always support idle mode for agn devices

For agn devices, always support idle mode which help power
consumption in idle unassociated state.

the above changes cause 5000 become not stable when power management is "on"

http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2312

Cc: stable@kernel.org #2.6.39, #3.0.0
Reported-by: Devin J Pohly <djpohly+iwl@gmail.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
41c50542669cd7aec45ad708f5120ff8fdaa1194 11-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: transport layer receives struct iwl_trans*

It still holds a pointer to iwl_priv. But hopefully this will disappear at some point.
Also add the multiple inclusion protection to iwl-trans.h that was forgotten.
Move iwl-trans structures to iwl-trans.h

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
6bd4dba3d2b8a90d27dfd32b306fa965650599b4 03-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: kill iwlagn_setup_deferred_work

Since iwlagn_setup_deferred_work is always called, fold it into
iwl_setup_deferred_work. BT related works are setup by the new
bt_setup_deferred_work lib_ops.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
8d30119346d52516f289016e1c57f853a835cb4a 03-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: kill iwlagn_rx_handler_setup

Since iwlagn_rx_handler_setup is always called, fold it into
iwl_rx_handler_setup. BT related handlers are setup by the new
bt_rx_handler_setup lib_ops.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.guy@intel.com>
4caab328eeea02b244765c355f9d875f8f5f6093 08-Jul-2011 Fry, Donald H <donald.h.fry@intel.com> iwlagn: remove indirection for iwlagn_hw_valid_rtc_data_addr

Not needed since the driver split.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
90c300cbd89e76789dbff101a1cb1ec226af277f 07-Jul-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: remove dual-indirect call to simply the code

After driver split, no need to make the code so complex

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
5c3d29fc0d083e674c09407f1bc78e9dbf4ae8a5 08-Jul-2011 Don Fry <donald.h.fry@intel.com> iwlagn: remove iwlagn_hcmd_utils structure and call directly

Not needed since the driver split. Move single use routines to
calling location and keep static where possible.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
909fc3cba374560ada33a7dc3ab242d0f1d2a135 08-Jul-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: remove double level temperature indirect call

No need to do double level indirect call after driver split
no functional changes

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
70e3e8a6e831bf58a7eb98187c186221f01d5b64 08-Jul-2011 Fry, Donald H <donald.h.fry@intel.com> iwlagn: remove indirection for eeprom_query_addr

Not needed since the driver split. Eliminate redundant routine.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e4c598b7ce36f4416f7672617265bc1fa92e5a5f 08-Jul-2011 Fry, Donald H <donald.h.fry@intel.com> iwlagn: remove the indirection for iwl_apm_init

Not needed since the driver split.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6b6db91c8aa14fa9bd041321026d69b9f6ea42ff 08-Jul-2011 Fry, Donald H <donald.h.fry@intel.com> iwlagn: remove the indirection for update_chain_flags

Not needed since the driver split.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bdfbf0924ab05e02d28e50bd2d5024097642a78d 08-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: provide heplers to access the transport ops

This removes the for priv->trans.ops->...

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
02f6f659b0080e60021aae3503163576f88c5ba8 08-Jul-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: remove the indirection for the dma channel num

Not needed since the driver split.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e419d62d72b23392e7f9a5da047fb17d70edc54a 08-Jul-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: consolidate the API that sends host commands and move to transport

Now, there are only two functions to send a host command:
* send_cmd that receives a iwl_host_cmd
* send_cmd_pdu that builds the iwl_host_cmd itself and received flags

The flags CMD_ASYNC / CMD_SYNC / CMD_WANT_SKB are not changed by the API
functions.

Kill the unused flags CMD_SIZE_NORMAL / CMD_NO_SKB on the way.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
252e735d64880b011f6cdeb41ebcac2eaeb58fd3 28-Jun-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: remove the indirection for the rx write pointer

Not needed since the driver split.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
e3f10cea039b235c1de12648ea87b752990c11bf 01-Jul-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: remove hcmd ops

All "agn" devices use the same hcmd functions, no need to call indirectly.
remove hcmd_ops

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
8fcbd4dc7a1b338b393dcd6869deb1725cf1a9f3 12-Jun-2011 Evgeni Golov <sargentd@die-welt.net> iwlagn: fix *_UCODE_API_MAX output in the firmware field

Currently (3.0-rc2), modinfo iwlagn shows:
firmware: iwlwifi-5150-IWL5150_UCODE_API_MAX.ucode
firmware: iwlwifi-5000-IWL5000_UCODE_API_MAX.ucode
firmware: iwlwifi-6000g2b-IWL6000G2_UCODE_API_MAX.ucode
firmware: iwlwifi-6000g2a-IWL6000G2_UCODE_API_MAX.ucode
firmware: iwlwifi-6050-IWL6050_UCODE_API_MAX.ucode
firmware: iwlwifi-6000-IWL6000_UCODE_API_MAX.ucode
firmware: iwlwifi-100-IWL100_UCODE_API_MAX.ucode
firmware: iwlwifi-1000-IWL1000_UCODE_API_MAX.ucode
firmware: iwlwifi-105-IWL105_UCODE_API_MAX.ucode
firmware: iwlwifi-2030-IWL2030_UCODE_API_MAX.ucode
firmware: iwlwifi-2000-IWL2000_UCODE_API_MAX.ucode

which is obviously wrong, the user should not see the *_UCODE_API_MAX
macros but the actual ucode API versions here.

The problem are the
#define *_MODULE_FIRMWARE(api) *_FW_PRE #api ".ucode"
which do not expand api correctly (because this is a macro itself).

Fixed by using __stringify() from linux/stringify.h.

Further information about macro stringification can be found here:
http://gcc.gnu.org/onlinedocs/cpp/Stringification.html

Signed-off-by: Evgeni Golov <sargentd@die-welt.net>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
86cb3b4e08a106594ee79c94dec9c7ca289cf999 15-Jun-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: merge duplicate code into single function

Same operation needed by multiple devices, move to single function.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
c6ca8bc46cc320e31e8fcb8b104eeed044febd6f 30-May-2011 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlagn: remove uneeded include to pci.h and dma_mapping.h from a few files

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
c68744fb935400964f7af4835017cad5014c8c88 18-Jun-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: Remove un-necessary indirect call

After driver split, no need to make indirect call to txfifo flush function

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
42b70a5f6d18165a075d189d1bee82fad7cdbf29 26-May-2011 Stanislaw Gruszka <sgruszka@redhat.com> iwlagn: use cts-to-self protection on 5000 adapters series

This patch fixes 802.11n stability and performance regression we have
since 2.6.35. It boost performance on my 5GHz N-only network from about
5MB/s to 8MB/s. Similar percentage boost can be observed on 2.4 GHz.

These are test results of 5x downloading of approximately 700MB iso
image:

vanilla: 5.27 5.22 4.94 4.47 5.31 ; avr 5.0420 std 0.35110
patched: 8.07 7.95 8.06 7.99 7.96 ; avr 8.0060 std 0.055946

This was achieved with NetworkManager configured to do not perform
periodical scans, by configuring constant BSSID. With periodical scans,
after some time, performance downgrade to unpatched driver level, like
in example below:

patched: 7.40 7.61 4.28 4.37 4.80 avr 5.6920 std 1.6683

However patch still make better here, since similar test on unpatched
driver make link disconnects with below messages after some time:

wlan1: authenticate with 00:23:69:35:d1:3f (try 1)
wlan1: authenticate with 00:23:69:35:d1:3f (try 2)
wlan1: authenticate with 00:23:69:35:d1:3f (try 3)
wlan1: authentication with 00:23:69:35:d1:3f timed out

On 2.6.35 kernel patch helps against connection hangs with messages:

iwlagn 0000:20:00.0: queue 10 stuck 3 time. Fw reload.
iwlagn 0000:20:00.0: On demand firmware reload
iwlagn 0000:20:00.0: Stopping AGG while state not ON or starting

Cc: stable@kernel.org # 2.6.35+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6f213ff1919fab6f8244ceae55631b5d6ef750a7 02-Jun-2011 Stanislaw Gruszka <sgruszka@redhat.com> iwlagn: fix channel switch locking

We use priv->mutex to avoid race conditions between iwl_chswitch_done()
and iwlagn_mac_channel_switch(), when marking channel switch in
progress. But iwl_chswitch_done() can be called in atomic context
from iwl_rx_csa() or with mutex already taken from iwlagn_commit_rxon().

These bugs were introduced by:

commit 79d07325502e73508f917475bc1617b60979dd94
Author: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Date: Thu May 6 08:54:11 2010 -0700

iwlwifi: support channel switch offload in driver

To fix remove mutex from iwl_chswitch_done() and use atomic bitops for
marking channel switch pending.

Also remove iwl2030_hw_channel_switch() since 2000 series adapters are
2.4GHz only devices.

Cc: stable@kernel.org # 2.6.36+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5beaaf3756aef42f31747d81b0676c8ccf59c6c4 27-May-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: remove un-necessary tx power ops

All agn devices use the same tx power function, remove the ops

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
214d14d4d323aab5d455b409e279f9e1e6631123 04-May-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: clean up TXQ indirection

All of these functions no longer need to be
accessed indirectly since they're shared in
all AGN devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
3fa507386dc4cdf731344cb9361e9cca373cedb9 04-May-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: prepare for multi-TB commands

In a subsequent patch, I want to make commands use
multiple TBs in a TFD. This is a simple change to
prepare the data structures for this, with as of
now still just a single TB supported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
94b00658ffc719427c9c09d7920957bc35915c6f 28-Apr-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove bytecount indirection

All AGN devices need the bytecount table, so
remove the indirection and make the functions
static again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
d6d023a1948d13652d719238f8039c09acceda8c 30-Apr-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: remove un-necessary debugfs callback

After driver split, no need for debugfs callback, remove those

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
16b80b714f8ef86d47680e4afa0eeb8cc61daef4 21-Apr-2011 Don Fry <donald.h.fry@intel.com> iwlagn: semaphore and calib cleanup

All agn devices use the same eeprom semaphore and calib version routines.
Delete the indirection and move the semaphore routines to where they are
used and make static.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
9d143e9a0d68025efe902d86eb6207cbec36dcdb 21-Apr-2011 Don Fry <donald.h.fry@intel.com> iwlagn: mod param cleanup

All agn devices use the same module parameter structure. Delete the
indirection and access the structure diretly.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
119ea186cad7643ea82b7290374ebb8e780c35b6 18-Apr-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: remove un-necessary ieee80211_ops

After driver split, no need to use ieee80211_ops, remove it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
f42e7662815647c1a6f73e160abcdf812d3057d2 18-Apr-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: temperature should be measure for all _agn devices

Thermal throttling functions are available for all _agn devices, call the
functions directly.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
b7af6a99690503a48c63ce5e587b4e4555f31cdb 07-Apr-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: always support uCode trace

All _agn devices support continuous uCode trace, remove checking

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
e79b1ca75bb48111e8d93fc576f50e24671f5f9d 05-Apr-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: use direct call for led functions

After driver split, no need to call led functions through callback

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
0da0e5bf1522d75d446f5124e17016628d0a149e 08-Apr-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: clean up & autodetect statistics

There's no need to keep both normal and BT statistics
versions around all the time in memory when we only
use a subset of both. So keep only the subsets that
we need in memory, depending on the debug config).

Also, in doing so, we can remove all the calls to
iwl_bt_statistics() in the driver as we'll just
access the copied statistics now.

Finally, also remove this call from the one place
where it might still be needed and automatically
detect what kind of statistics the device is sending
based on their size. This way, we don't need to keep
track of which devices do what any more, which is
good since this is subject to change based on the
ucode version (as some ucode even for non-BT devices
will in fact use BT statistics).

Warn upon encountering a statistics command from the
ucode that isn't known, so we will find such issues
earlier in the future.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
703bc583cb98a24eeedd297ee59dfa12852897d1 03-Apr-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: sensitivity and chain noise done by driver

_agn driver should perform both sensitivity and chain noise calib.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
15ade3ca647d95611814333cfe0885fd0184481e 02-Apr-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: remove un-needed configuration

After driver split, set_l0s config is no longer needed, remove it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
3ecccbcd3c67374aeee447c08fcb9e39a99f7ee5 30-Mar-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: remove un-necessary function pointer

After driver split, no need to use function pointer for those event and
register dump function.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
1d5cc5559aaf5273cc1f9aac9b428e3a99d41de6 29-Mar-2011 root <root@wtplsrv02.(none)> iwlwifi: remove extranious macro from firmware define

define of firmware filenames use extra macro to build the files name.

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
519d8abd358afad825a1b919a2421d76779f23cd 05-Apr-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove ISR ops

The ISR (interrupt service routine) ops are now
no longer necessary since they are the same for
all devices this driver now handles.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
917b6777b45ac49c436570e36eb09d9b8b84c434 05-Apr-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove BSM clock setting

Again, a 4965 specific code path that we no
longer need in iwlagn.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
901069c71415a76d731857ccda814e18ded062f7 05-Apr-2011 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: change Copyright to 2011

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1fc352765fb461e4afafff4d650624df8ab6b6d6 05-Apr-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: remove bootstrap code

Only 4965 had a bootstrap microcode image, so
the agn driver can completely ignore that and
we can remove some code from it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7102762ef0ef330ab0601b6c3bc92bf9be5b1317 05-Apr-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: clean up ucode loading

All agn devices behave the same, so there's no
need to go through function pointers for any
of the ucode loading functionality.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2845fd858c55c8a05674a071384a12a19cc17dbf 05-Apr-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: override 5300 EEPROM # of chains

At least EEPROM version 0x11A has the wrong
number of chains programmed into it for some
reason, so we need to override in the driver.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7ffef13d7a24654292c4641450f2794224b9eb5d 15-Mar-2011 Johannes Berg <johannes.berg@intel.com> iwlagn: clean up TX aggregation code

Since the driver split, there's no need for
function pointers any more for aggregation
queue setup and teardown as all devices now
share the same code. Simplify this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
ad6e82a5348e494c0023d77fa55933f23b55711c 28-Feb-2011 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: move check health code into iwl-rx.c

Remove check_plcp_health and check_ack_health ops methods, they are
unneeded after iwlegacy driver split. Merge check health code into to
iwl-rx.c and make functions static.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
41504cce240f791f1e16561db95728c5537fbad9 16-Feb-2011 Fry, Donald H <donald.h.fry@intel.com> iwlagn: Support new 5000 microcode.

New iwlwifi-5000 microcode requires driver support for API version 5.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
65af8dea26aa89ae4a810bdaa05545a8e670b636 08-Dec-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: code clean up to remove duplicate code

Multiple devices use almost the same .cfg with minor differences.
Use macro and remove the duplication. By doing this, reduce
the chance for mistake while modify .cfg parameters

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
50619ac9ba48f5ab0c6bcfa10f5d50e4115cdca8 07-Dec-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: do not reload fw if WiMAX own the RF

For WiFi/WiMAX combo devices, if WiMAX own the RF, WiFi driver
try to access RF and fail. This is the W/A to To avoid WiFi keep
reloading firmware and try to access RF again.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
22de94de7de78b8de2fb1f2df5aa85b5556cfcfd 03-Dec-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: jiffies based tx queues watchdog

This patch replace monitor/recover timer by watchdog based on time
stamp. New code allow to discover hangs more precisely.

Timeout values are currently doubled monitoring period values of
previous timer. This have to be tuned based of firmware timing
capabilities.

Tested on 3945, 4965, 5300, 6300.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
dbbf1755b09eef8ff6dd21c8dafe1606f051ce12 15-Nov-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: use antenna information in EEPROM

The valid tx/rx antenna information is part of EEPROM, so use it
to configure the device.

For few cases, the EEPROM did not reflect the correct antenna, but
it is too late to modify the EEPROM, so overwrite with .cfg parameters

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
21a5b3c6b19a8b8972ccdd55389be28a8b7c9180 10-Nov-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: use SKU information in the EEPROM

EEPROM contain the SKU information for the device, use it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
564b344c10b694d433cef5b89f8ff8ac5e33898d 09-Nov-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: change default led mode for different devices

Set the default led mode for different devices.

For the newer devices such as 6000g2a, 6000g2b and newer,
the default led mode is On/Off instead of blinking.

The led_mode still can be control through module parameter
0: system default
1: On/Off
2: blinking

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
e39fdee1d7856817619326fa114438c146d74510 10-Nov-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: put all the isr related function under ops

There were two type of isr supported by iwlwifi devices.
legacy isr - only used by legacy devices (3945 & 4965)
ict isr - used by all new generation of iwlwifi devices

Move all the isr related functions into ops, the ict type of isr
supports only needed for newer devices.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2295c66b68ae160dde2e6e2dc4f3061105153bfc 23-Oct-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: new RXON processing for modern devices

In order to simplify the flow, and make new
enhancements easier, separate out the RXON
processing for modern AGN (5000 and newer)
from RXON processing for the older 3945 and
4965 devices. Avoid changing these old ones
to avoid regressions and move their code to
a new file (iwl-legacy.c). 4965 gets the
commit_rxon that used to be common for all
AGN devices, but with removed PAN support.

The new RXON processing is more central and
does more work in committing, so that it is
easier to follow.

To make it more evident what is split out
for legacy, split the necessary operations
for that into a new struct iwl_legacy_ops.
Those parts that still exist in the new AGN
code don't need to be parametrized.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
dc21b5453249e7e9b8878fab356fd60b731cf04d 23-Oct-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: make mac80211 ops a device config

In the future, 4965 and modern AGN devices will
need to have different mac80211 callbacks since
they have different capabilities. Prepare for
that by making the mac80211 operations a device
config.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14e8e4afeb7e90f1f2d3f2d3b54da57c27f59f38 22-Sep-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove apm_ops.stop

Since all devices share the same operation here,
there's no need to call it indirectly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
9597ebac91e5a88f558d236a51d776508d42a237 22-Sep-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove set_pwr_src operation

The set_pwr_src operation is only ever used from
within the same sub-driver that it is declared
in, so it can just be called directly instead of
being an operation. Also, it is never called to
set the power source to V_aux, so change the two
functions accordingly (but keep the V_aux code
for documentation purposes in a comment).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
0453674c90be7b39c8925ba5e1d746447905f8ee 22-Sep-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove set_ct_kill operation

This operation is only ever called from set_hw_params,
which is also already based on the config/ops, so that
there's no need to have a separate set_ct_kill op and
we can just call the right ct_threshold function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
d3f5ba958d6c425a87535c6fa2a69ca90eb6e930 22-Sep-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove verify_signature eeprom operation

All drivers share the same implementation, so
there's no need to call this via a function
pointer nor to export it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
7cb1b0887fcc61918e3d64827fbef968bb67a57a 06-Oct-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: reduce redundant parameter definitions

move paramater definitions to a device paramater structure only
leaving the device name, which antennas are used and what firmware
file to use in the iwl_cfg structure. this will not completely
remove the redundancies but greatly reduce them for devices that
only vary by name or antennas. the parameters that are more
likely to change within a given device family are left in iwl_cfg.
also separate bt param structure added to help reduce more.

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
54a9aa65f749673f851ef86481940394185c1b0e 05-Sep-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: keep track of failure tx status

Tx command response sent to host by uCode after completed
the transmission attempt. The status parameter indicates
whether the transmission was successful, or else why if failed.

Here we keep the counters to help understand the different failure
cases.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
a437fbb96fe4eab241f06bbd7c7c1070ccdb2544 05-Sep-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: add bt_status_read for 5150

Include bt_status_read function pointer for 5150 device

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
8bd413e611d4324f17e54a2a89b4d09216c22a37 23-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: move virtual interface pointer into context

iwlwifi occasionally needs to find the virtual
interface pointer to give it to mac80211, but right
now it only keeps one. Move it into the context so
that we can keep one pointer each.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
a194e3249baf954dc34c67cdad5b8bed36f49e72 27-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: contextify broadcast station

The broadcast station ID is per context, so
add a variable for the ID in the context and
use it everywhere we previously hardcoded it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
246ed355221076884d225f9d8a4c30a048be8162 23-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: initial contextification

In order to support multiple interfaces, we must move
a lot of data into per-context structures so we can
use the contexts the device offers. To start with,
this makes a lot of code context-aware, more changes
will move more things into the context structure.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
81e95430aaa898799421617c2db2882386bab69a 28-Jul-2010 Shanyu Zhao <shanyu.zhao@intel.com> iwlwifi: do not call ieee80211_frequency_to_channel

A few cases in iwlwifi driver function ieee80211_frequency_to_channel()
is called to get channel number from center frequency. This is not needed
since the channel number is already saved in hw_value field of struct
ieee80211_channel in function iwlcore_init_geos(). So replace those function
calls with hw_value field of struct ieee80211_channel.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
0975cc8fbf5b61b188734f2edd9e588c7edff2a1 31-Jul-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: separate thermal throttling function

"Thermal Throttling" is an advance feature which only available for
newer _agn devices. Move from iwl-core to iwl-agn for better code
organization.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6a017e043a8c5e4f1e7c1152bc6477da8066f5f6 18-Aug-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: use long monitor timer for 5300 series

For 5000 series of devices, use long monitor timer to check
stuck tx queues.

This modification apply to all the 5000 series including 5300 and others.

Cc: stable@kernel.org [2.6.35]
Reported-by: drago01 <drago01@gmail.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3198c68cb4e1967f59244f0a0b9f46102d617373 23-Jul-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: use long monitor timer to avoid un-necessary reload

For 5000 and 6000g2b series of devices, use long monitor timer to check
stuck tx queues.

.6000g2b series device, it is WiFi/BT combo device, there are some cases,
tx queues are not move for a period of time because the WiFi/BT coex.

.5000 series device, it is being reported firmware got reload more
often than necessary, so extend the timer to avoid un-necessary reload.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
ce60659ad838a77d71aa817a6781659799970ae1 23-Jul-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: long monitor timer

Change the name for monitor timer, also adding define for long monitor
timer; long monitor timer can be used for the type of devices require longer
time to determine the uCode is stuck on tx and needed reload.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
94597ab23ea10b3bdcba534be00a9f7b35791c07 09-Aug-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: fix rts cts protection

Currently the driver will try to protect all frames,
which leads to a lot of odd things like sending an
RTS with a zeroed RA before multicast frames, which
is clearly bogus.

In order to fix all of this, we need to take a step
back and see what we need to achieve:
* we need RTS/CTS protection if requested by
the AP for the BSS, mac80211 tells us this
* in that case, CTS-to-self should only be
enabled when mac80211 tells us
* additionally, as a hardware workaround, on
some devices we have to protect aggregated
frames with RTS

To achieve the first two items, set up the RXON
accordingly and set the protection required flag
in the transmit command when mac80211 requests
protection for the frame.

To achieve the last item, set the rate-control
RTS-requested flag for all stations that we have
aggregation sessions with, and set the protection
required flag when sending aggregated frames (on
those devices where this is required).

Since otherwise bugs can occur, do not allow the
user to override the RTS-for-aggregation setting
from sysfs any more.

Finally, also clean up the way all these flags get
set in the driver and move everything into the
device-specific functions.

Cc: stable@kernel.org [2.6.35]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ffb7d896b3bc21e09d77fed45b52b2ff4ce213e5 14-Jul-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: add bluetooth stats to debugfs

For WiFi/BT combo devices, add bluetooth statistics counter
read function to debugfs.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
325322ee34d726bff922853d509e135c8d262e2f 14-Jul-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: add statistic notification structure for WiFi/BT devices

If its WiFi/BT combo device, the statistics notification sent by
uCode will include the additional BT related statistics counters.

Adding new data structure to support the new layout.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
bf3c7fddf9dffb0e5c76da3a94b8f5817a72f92c 24-Jun-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: generic parameter define for _agn device

Code clean up to change name from having 5000 as part of name which easy
to confuse and think it is for 5000 series devices to more
generic _agn name since it is being used by multiple _agn devices.

No functional changes.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
6555063666fea1fc81a14396aca53ab021ccb4f2 24-Jun-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add support for device tx flush request

"Flush" request can come from two different sources, it can either from
mac80211, or from device when the operation is needed. Here
adding the support for device issue "flush" request.

When receive tx complete with status is TX_STATUS_FAIL_RFKILL_FLUSH,
issue REPLY_TXFIFO_FLUSH command to uCode to flush out all the tx frames
in queues.

In this condition, since mac80211 has no knowledge of "flush" operation,
driver need to stop all the tx queues and wait for the operation
completed before wake up the queues for frames transmission.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
716c74b00717ad9caedb4a46059fb64a3da99808 24-Jun-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add mac80211 flush callback support

Adding flush callback support in the driver. Two type of flush can be
issued by mac80211:
1. drop = true: frame drop is ok, issue REPLY_TXFIFO_FLUSH host command
to uCode to drop all the frames in tx fifo queues; then return the
control back to mac80211
2. drop = false: wait for either all the frames in tx fifo queues been
transmitted, or timeout; then return the control back to mac80211

If the flush request coming from mac80211, mac80211 will make sure there
are no additional frames push down to driver before flush operation is
completed.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
278c2f6faafebe28b9776918ce5fbaef9795c141 14-Jun-2010 Daniel Halperin <dhalperi@cs.washington.edu> iwlwifi: update LQ for bcast station on channel change

The rate table in the bcast LQ is computed only when the station is
allocated, and chooses the lowest rate for the band. Because of when this
occurs, this is the 2.4 GHz band and uses the 0x420a (CCK, 1 Mbps) rate. In 5 GHz
beaconing mode, this rate will prevent beacons from being sent and any other
packets from being received.

We can fix this by re-initializing the bcast station's LQ command when the
channel is changed.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
178d1596073e81927a24221dba6c55ae0048a207 16-Jun-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: enable DC calibration based on config parameter

Different devices have different calibration requirement,
some need DC calibration and some don't; make it a cfg parameter
for easy management.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
f3aebeeebc9a18aa548f8c1da18f6cda28d8b732 15-Jun-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move _agn statistics related structure

agn and 3945 has different statistics_notif data structure; since 3945
has it statistics_notif data structure inside the _3945 portion of
iwl_priv, it make sense to move the agn statistics_notif into _agn
portion.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
3839f7ce6dc749e3170e1bfa656cfac748528117 18-May-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: do not use huge command buffer for channel switch

Channel switch host command do not need to allocate huge command buffer
since its size is already included in the iwl_device_cmd structure.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
79d07325502e73508f917475bc1617b60979dd94 06-May-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: support channel switch offload in driver

Support channel switch in driver as a separated mac80211 callback
function instead of part of mac_config callback; by moving to this
approach, uCode can have more control of channel switch timing.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
a0ee74cf080389aee4fbf198ffa7e85b3480b661 06-May-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: beacon format related helper function

Move the ucode beacon formation related helper function from 3945 to
iwlcore, so both _3945 and _agn devices can utilize those functions.

When driver pass the beacon related timing information to uCode in both
spectrum measurement and channel switch commands, the beacon timing
parameter require in uCode beacon format; those helper functions will do
the conversation from uSec to the correct uCode format

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
2daf6c157500b832687f675e323879e3a4c3fe27 03-Jun-2010 John W. Linville <linville@tuxdriver.com> Revert "iwlwifi: move _agn statistics related structure"

This reverts commit a2064b7a4a22d118087898e4308670da7ac07911.

when CONFIG_IWLAGN=n:

drivers/net/wireless/iwlwifi/iwl-rx.c:254: error: 'struct iwl_priv' has no member named '_agn'
drivers/net/wireless/iwlwifi/iwl-rx.c:303: error: 'struct iwl_priv' has no member named '_agn'
drivers/net/wireless/iwlwifi/iwl-rx.c:304: error: 'struct iwl_priv' has no member named '_agn'
drivers/net/wireless/iwlwifi/iwl-rx.c:305: error: 'struct iwl_priv' has no member named '_agn'
drivers/net/wireless/iwlwifi/iwl-rx.c:306: error: 'struct iwl_priv' has no member named '_agn'

and many more.

Conflicts:

drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c
drivers/net/wireless/iwlwifi/iwl-debugfs.c
drivers/net/wireless/iwlwifi/iwl-dev.h
drivers/net/wireless/iwlwifi/iwl-rx.c

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a2064b7a4a22d118087898e4308670da7ac07911 30-Apr-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move _agn statistics related structure

agn and 3945 has different statistics_notif data structure; since 3945
has it statistics_notif data structure inside the _3945 portion of
iwl_priv, it make sense to move the agn statistics_notif into _agn portion.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
2c810ccdbac434ae38f4ec5331d3f047dc90f98a 29-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: rework broadcast station management

Currently, the broadcast station is managed along
with the interface type, rather than always being
present. That leads to a bug with injection -- it
is currently not possible to inject frames when
the only virtual interface is a monitor, because
in that the required broadcast station is missing.

Additionally, allocating and deallocating the
broadcast station's LQ all the time is wasteful,
and the code to support this is fairly complex.

So this changes completely the way we manage the
broadcast station. Rather than manage it along
with any interface, we now allocate it when we
bring the device up, and remove it again when we
bring the device down. When we bring the device
up, we don't immediately program the broadcast
station into it, instead we just mark it active
and rely on the next restore cycle to upload it
to the device. This works because an unassociated
RXON is always required at least once to set up
device parameters, which implies a reprogramming
of stations into the device.

As we now manage all stations properly, there no
longer is a need for forcing a clearing of them
via iwl_clear_ucode_stations(), which can become
a lot simpler.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
22adba2a6995dc24663251ffb954f8856968f26e 28-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: remove ucode virtual functions

AGN devices all use the same ucode operations,
except for 4965, because 4965 uses only v1 file
headers.

Therefore, we can remove all the indirection
we have here and just code the API distinction
in place, with a small special case for 4965.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
1fa61b2e793dad51271c7ce39377daade51261d7 28-Apr-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: manage IBSS station properly

Currently iwlwifi will eventually exhaust the station
table when adding the BSSID station for IBSS mode,
unless the interface is set down.

The new mac80211 ibss joined/left notification allows
us to fix that easily by moving the code to add the
IBSS station to the notification, and also adding
code to remove it again when we leave the IBSS.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
65d1f89682acf4d61dec7a8b771ed34afb7c17d9 26-Apr-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: use cfg to configure calibration operation

sensitivity calibration and chain noise calibration are not available
for all the devices; use .cfg to configure the availability of those
calibration functions

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
6e5c800e75fad95f2a12d45d9b548b23834a13ff 27-Apr-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: use .cfg to enable/disable continuous ucode trace

Instead of checking device type for enable/disable continuous ucode
trace function; put it in .cfg for better control and more
flexibilities.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
e517736ab85fcaa4ceebbb572f3e86838097ad0a 20-Apr-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: set hw parameters based on device type

Separate the hw_set_hw_params() function to per device based; different
devices can have different hardware parameters set, when separate the
function based on device type can avoid mistakes, give more flexibilities and
easier to read.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
b8c76267cfb9a025afdd122bc2a8942dbf493dd1 09-Apr-2010 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwlwifi: add debugfs ops to iwlwifi

Seperate debugfs functions into iwlagn specific
debugfs file and Add debugfs ops to iwlwifi.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
678b385d07835c6c21371c12eaaa3fba4de05168 26-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: default max event log size

Size of event log is determined by uCode which is different per NICs.
Set the maximum event log size per device to better match uCode
configuration.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
2b068618031a91929c21410069f872178ec00329 22-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: merge module parameters into single place

Module parameters used to be defined in both iwl-5000.c and iwl-4965.c,
after the code re-structure, merge into iwl-agn.c for easy to read and
maintenance.

Number of module parameters are deprecated after this merge. These are also
scheduled for removal by 2.6.40.

The current supported parameters are:

parm: debug50:50XX debug output mask (deprecated) (uint)
parm: debug:debug output mask (uint)
parm: swcrypto50:using crypto in software (default 0 [hardware])
(deprecated) (bool)
parm: swcrypto:using crypto in software (default 0 [hardware]) (int)
parm: queues_num50:number of hw queues in 50xx series (deprecated)
(int)
parm: queues_num:number of hw queues. (int)
parm: 11n_disable50:disable 50XX 11n functionality (deprecated) (int)
parm: 11n_disable:disable 11n functionality (int)
parm: amsdu_size_8K50:enable 8K amsdu size in 50XX series (deprecated)
(int)
parm: amsdu_size_8K:enable 8K amsdu size (int)
parm: fw_restart50:restart firmware in case of error (deprecated) (int)
parm: fw_restart:restart firmware in case of error (int)
parm: disable_hw_scan:disable hardware scanning (default 0) (int)

Remove "antenna" module parameter, it is not being used in "agn" driver.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
3d2b162e7e0a3e5093bccdf455f7c83f65c82db8 18-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add missing email address information

Add missing contact email address to iwl-5000.c

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
510cb791ab32a6296e45ebc425a011551bed7bd1 16-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: remove non-exist extern functions and structures

After re-structure the agn files layout and move all the
agn shared functions out from iwl-5000.c, all those functions and data
structures do not need to be declare "extern" from iwl-5000.c in
iwl-dev.h.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
348ee7cd57831c47373dd157f138c558daaf129d 16-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move agn module parameter structure to common place

agn module parameter data structure shared by all agn devices, move it
iwl-agn-lib.c file.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
e04ed0a5bb62520345c73587d7ebf51e426642ee 17-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move agn common code to iwlagn library file

Multiple iwlagn based devices share the same common functions.
Move those functions from iwl-5000.c to iwl-agn-lib.c file.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
741a626627e42812afd957f875c34c89be8a103e 16-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move ucode alive related code to separate file

uCode alive for iwlagn based devices share the same functions.
Move those functions from iwl-5000.c to iwl-agn-ucode.c.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
19e6cda094002e9756a3d181cbb4c31ef2a9b6bb 17-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move hw related defines to separate file

Multiple iwlagn based devices shared the same hw definitions.
Move device hardware related defines from iwl-5000-hw.h to iwl-agn-hw.h
file.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
b305a08058f794c8a99c5ee87827b92d6b8c24ae 17-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move tx queue related code to separate file

Multiple iwlagn based devices shared the same tansmit queue functions.
Move tx queue related code from iwl-5000.c to iwl-agn-tx.c file.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
7dc77dba6a8bde512996824643da5669d73cbcdc 16-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move hcmd related code to separate file

Multiple iwlagn based devices shared the same hcmd related functions.
Move from iwl-5000.c to iwl-agn-hcmd.c file.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
81b8176eb8edac7d2135db2af03ab5fe0cb3b6f7 16-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: code cleanup for "load ucode" function

Loading uCode functions are shared across multiple agn devices.
Move those functions to iwl-agn-ucode.c file with other uCode
related functions.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
792bc3cbe06cddabd865acc3122ee0415f854a11 16-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move ucode loading related code to separated file

Multiple iwlagn based devices shared the same ucode loading procedure.
Move loading related code from iwl-5000.c to iwl-agn-ucode.c file.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
fa8f130c504223d25c116b3d23787f465dfb1317 05-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: code cleanup for connectivity recovery

Split the connectivity check and recovery routine into separated
functions based on the types
1. iwl_good_ack_health() - check for ack count
2. iwl_good_plcp_health() - check for plcp error

Based on the type of errors being detected, different recovery methods
will be used to bring the system back to normal operational state.

Because different NIC has different HW and uCode, the behavior is also
different; these functions thus now form part of the ops infrastructure,
so we can have more control on how to monitor and recover from error condition
case per device.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
beac5498b792ed8420885ee23e8d4f2885ee2d13 04-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: move plcp check to separated function

Move the plcp error checking into stand alone function and pointed by ops
to accommodate devices not needing this recovery.

Signed-off-by: Trieu 'Andrew' Nguyen <trieux.t.nguyen@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
b74e31a9bc1013e69b85b139072485dc153453dd 02-Mar-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: Recover TX flow stall due to stuck queue

Monitors the internal TX queues periodically. When a queue is stuck
for some unknown conditions causing the throughput to drop and the
transfer is stop, the driver will force firmware reload and bring the
system back to normal operational state.

The iwlwifi devices behave differently in this regard so this feature is
made part of the ops infrastructure so we can have more control on how to
monitor and recover from tx queue stall case per device.

Signed-off-by: Trieu 'Andrew' Nguyen <trieux.t.nguyen@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
c11362c01b280f8b2c728bc64793d484282b8734 06-Mar-2010 Shanyu Zhao <shanyu.zhao@intel.com> iwlwifi: clean up driver names for 1000/5000/6000

Align the driver names with official product names for 1000/5000/6000
series. This change mainly affects the debug messages show up in system
log. No functional changes.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
7e2461910e9115c9964975f77584baf8c2f76bfe 19-Feb-2010 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: only add broadcast station once

Currently the broadcast station is added after every RXON command. Change
this to only add the broadcast station when interface is added by mac80211.
With this we need some extra work to ensure broadcast station is always
present since station table is cleared when RXON without ASSOC bit set is
sent. To deal with this we re-add all driver known stations to uCode after
such an RXON command is sent.

We also do some cleanup and remove the various calls to clear the station
table. We now only clear the station table in two scenarios:
- only clear uCode portion of station table when RXON command without ASSOC
bit is sent
- clear uCode and driver portion when interface goes down or is removed.

We need to do this clearing when interface goes down to deal with the
device restart/reconfigure routines which do not remove the interface, but
do add the interface during reconfiguration.

Previously the keys were also cleared when station table in driver is
cleared, this is not done anymore since mac80211 will take care that keys
are set and cleared correctly.

There is a known issue with this change. Associating with different AP
without bringing interface down fails with a firmware error. This is
because of the lack of full station notification support and the later
patches in this series that complete the station notification support will
fix this.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
edc1a3a090e83c48d4b33c23aa16c54b3b790ef5 24-Feb-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: clean up queue/fifo handling

4965 hardware has 7 queues reserved and the
remaining ones used for aggregation, 5000
and higher need to have 10 reserved. This
is not very clear in the code right now,
unfortunately.

Introduce a new IWL_TX_FIFO_UNUSED constant
and make the queue/FIFO mapping arrays able
to hold that value, and change the setup
code to reserve all queues in the arrays
(the queue number is the index) and use the
new unused constant to not map those queues
to any FIFO.

Additionally, clear up the AC/queue mapping
code to be more understandable. The mapping
is the identity mapping right now, but with
the mapping function I think it's easier to
understand what happens there.

Finally, HCCA isn't implemented at all and
I think newer microcode removed it, so let's
remove all mention of it in the code, some
comments remain for 4965.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
949cd92c85fbdf9550582fc09271fa91cc802069 22-Jan-2010 Johannes Berg <johannes.berg@intel.com> iwlwifi: clear up AC/FIFO debug output

Not all queues are mapped for frame transmission,
so saying "AC" is misleading. They are all mapped
to FIFOs, obviously, though, so use that term and
also say AC/CMD instead of just AC for the queue
type.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
a1175124f34a4b859b5064efb84a197e4f6794a6 21-Jan-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: move ICT code into separate file

All the ICT ISR code is iwlagn specific, and doesn't
need to be in iwlcore. So create a new iwl-agn.h
header file that will hold agn specific function
declarations etc., and move the ICT code into a new
iwl-agn-ict.c file that is linked into iwlagn. This
also gets rid of exporting those symbols.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
a120e912eb51e347f36c71b60a1d13af74d30e83 20-Feb-2010 Stanislaw Gruszka <sgruszka@redhat.com> iwlwifi: sanity check before counting number of tfds can be free

Check the frame control for ieee80211_is_data_qos() is true before
counting the number of tfds can be free, the tfds_in_queue only
increment when ieee80211_is_data_qos() is true before transmit; so it
should only decrement if the type match.

Remove ieee80211_is_data_qos check for frame_ctrl in tx_resp to avoid
invalid information pass from uCode.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a239a8b47cc0e5e6d7416a89f340beac06d5edaa 20-Feb-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: error checking for number of tfds in queue

When receive reply_tx and ready to decrement the count for number of
tfds in queue, do error checking to prevent error condition and
tfds_in_queue become negative number.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a9e10fb9b1c6ad16e73cf2656951fce3a817611e 09-Feb-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: clear all the stop_queue flag after load firmware

All the queues are awake and ready to use after loading firmware,
for firmware reload case, if any queues was stopped before
reload, mac80211 will wake those queues after restart hardware, so make
sure all the flag used to keep track of the queue status are
reset correctly.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
dff010ac8e57e43669518a14c0e945dfeb80c2a7 03-Feb-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: clear all tx queues when firmware ready

Reset and clear all the tx queues when finished downloading runtime
uCode and ready to go into operation mode.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
d4fe5ac9e04e6e175a7bd7e29844b351533be591 05-Feb-2010 Ben Cahill <ben.m.cahill@intel.com> iwlwifi: Add chain noise scaling factor

6x50 device requires a different scaling factor for Rx gain values sent to
device via PHY_CALIBRATION_CMD (CHAIN_NOISE_GAIN_CMD). Rather than create
a new iwlXXXX_gain_computation() function, add new chain_noise_scale member
to struct iwl_cfg, and keep using iwl5000_gain_computation().

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>
9f1f3ceacb7e52d9bc0364b4f26ae418de79656f 21-Jan-2010 Johannes Berg <johannes.berg@intel.com> iwlagn: simplify ucode loading

Move the waiting into iwl5000_load_section instead
of duplicating it in the caller.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
9bead7632adb6341548056a80ec36e7ae098f4f4 20-Jan-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: update sensitivity calibration data for 5x00 series

Update sensitivity range values for 5x00 series

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
3459ab5a1c92eaf8b76e9fa1b6ca529cf83066f3 22-Jan-2010 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: make broadcast station addition generic

Add function pointer for broadcast station addition so that we can call it
in from iwlcore at a later time. We only distinguish between iwlagn and
iwl3945 broadcast station addition. For the iwl3945 station addition we add
that function to iwlcore since that is where most station functionality
resides, making it part of iwl3945 will require significant code
reorganization that will dilute station management functionality. This
seems to be an efficient solution.

It may seem as though we are removing error checking when adding the 3945
broadcast station but this error checking was never really necessary since
the function returns the station id and the broadcast station id is always
set.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3e4fb5faefb57824f2e42305b3d5907845af978c 22-Jan-2010 Trieu 'Andrew' Nguyen <trieux.t.nguyen@intel.com> iwlwifi: Tune radio to prevent unexpected behavior

We have seen the throughput dropped due to external noisy environment
and the radio is out of tune. There are lot of plcp errors indicating
this condition. Eventually the station can get de-authenticated by the
Access Point. By resetting and tuning the radio, the plcp errors are
reduced or eliminated and the throughput starts to rise.

To prevent unexpected behavior such as drop in throughput or deauthentication,
- The change provides the driver feature to monitor and tune the radio base on
the statistics notification from the uCode.
- It also allows the setting of the plcp error rate threshold via
the plcp_delta under debugfs interface.

Signed-off-by: Trieu 'Andrew' Nguyen <trieux.t.nguyen@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1f44780827c6bbbcd1f12d5c6b6ce84f49a96bc0 15-Jan-2010 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: update copyright year to 2010

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1b3eb8236ad9369ae519216b61a3d22806370115 15-Jan-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: display flowhandler register when sw error or on-demand

Flowhandler handle the communication between driver and uCode, when any
uCode error happen, we also like to know what is the status of the
flowhandler; it can help to debug flowhandler related problem.

Also adding debugfs file to dump current value of flowhandler registers.

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>
1152dcc28c66a74b5b3f1a3ede0aa6729bfd48e4 15-Jan-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: Fix throughput stall issue in HT mode for 5000

Similar to 6000 and 1000 series, RTS/CTS is the recommended protection
mechanism for 5000 series in HT mode based on the HW design.

Using RTS/CTS will better protect the inner exchange from interference,
especially in highly-congested environment, it also prevent uCode encounter
TX FIFO underrun and other HT mode related performance issues.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
CC: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8ce1ef4a914aef8b9b90a2a2c670494168a2cca9 08-Jan-2010 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: fix bug in tx byte count table

When setting invalid byte count in txq byte count table, read pointer
should be used instead of write pointer.

Reported-by: Guo, Chaohong <chaohong.guo@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
45d5d805988f1f3c0b24dac59fbba771b1f106a8 14-Dec-2009 Emese Revfy <re.emese@gmail.com> iwlwifi: Constify struct iwl_ops

Signed-off-by: Emese Revfy <re.emese@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ba37a3d0395a66b3c9164c4f4d1318317da32e96 10-Dec-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: use new mac80211 SMPS

Instead of hard-coding the SM PS mode per hardware,
this makes iwlwifi support the new mac80211 API for
controlling the SM PS mode.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
696bdee3ba216186e21997d20a839b76158346e6 10-Dec-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: dump "Control and Status Register" when detect uCode HW/SW error

When uCode HW/SW error detected, dumping important CSR (Control and Status
Registers) values.
Also add "csr" debugfs file to dump the current values of CSR defined in
CSR table to syslog.

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>
b7bb1756cb6a610cdbac8cfdad9e79bb5670b63b 14-Dec-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: fix more eeprom endian bugs

I've also for a long time had a problem with the
temperature calculation code, which I had fixed
by byte-swapping the values, and now it turns out
that was the correct fix after all.

Also, any use of iwl_eeprom_query_addr() that is
for more than a u8 must be cast to little endian,
and some structs as well.

Fix all this. Again, no real impact on platforms
that already are little endian.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: stable@kernel.org
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ac592574a577162183b5c1dd040a188caa068a29 20-Nov-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: update supported PCI_ID list for 5xx0 series

Update the PCI_ID list for 5xx0 series.
Remove all the PCI_IDs which never made into production or not longer in
production.

Also make sure the supported bands(a/b/g/n) match specified PCI_IDs

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>
c15d20c1d19616f73b6fee4befd254d0c37b4d87 20-Nov-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: set sm_ps_mode as part of cfg parameters

Setting "Spatial multiplexing Power Save" as part of
per device configuration parameter.

Report to uCode based on priv->conf setting, so driver can
have more control of how different devices should operate
in power save mode.

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>
c397bf15a6067ecf39f8a771907f4721a64fd61f 13-Nov-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: report PS filtered status

When a frame is sent to a sleeping station, the
microcode reports TX_STATUS_FAIL_DEST_PS as its
status -- we need to translate that to the flag
that mac80211 expects.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ae16fc3c3184bf27f0462e1951df918122498829 13-Nov-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: eliminate the possible 1/2 dBm tx power loss in 6x00 & 6x50 series

In both 6x00 and 6x50 series, the enhanced/extended tx power table in
EEPROM is used to set the max. tx power limit.
This new tx power table is in 1/2 dBm format, which creates an issue of
possibility of 1/2 dBm loss when driver set the tx power limit; because
of driver keep track and report the tx power in dBm format.

In order to prevent the 1/2 dBm loss, keep track of the true max tx
power in 1/2 dBm format in driver; do the comparison and adjust the tx
power if needed when send tx power command to uCode.

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>
0924e519a3a18ffbfaa043f4a2c369140c5a235c 06-Nov-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: fix for channel switch

Different channel has different configuration, need to pass correct
configuration to uCode when send "channel switch" command to uCode.
Invalid configuration will cause sysassert in uCode and produce
un-expected result.

Even it is a very small windows, but we also need to consider and handle
the case if commit_rxon occurred before the "channel switch
announcement" notification received from uCode.

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>
a221e6f7b48ee2d9352827af8aec8b49272b5b43 06-Nov-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: don't double-activate queue 4

The fourth queue (command queue) is already activated in
the loop above that also maps it to the command FIFO and
therefore doesn't need to be marked as activated again.
Also change the TODO comment to be accurate -- we need
to initialise the _queues_, not FIFOs, and map them to
device FIFOs.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1933ac4d9377ed44caba45abe1531ec1bc14bb63 30-Oct-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add wimax/wifi coexist support for 6x50 series

For 6x50 series, it is wimax/wifi combo device, so driver need to enable
the wimax/wifi co-exist function and send the coexist event priority
table to uCode for operation.

The priority table will be used by uCode to determine what is the proper
action it should take when co-exist with WiMAX.
For example, when WiFi runs a scan, it must own radio exclusively, therefore
will disconnect WiMAX if WiMAX is connected.

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>
4a56e9652ec2ffce87b099aa2fc5b4eb2d5b2666 23-Oct-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add channel switch support to 5000 series and up

Support "channel switch" request by issue "channel switch" host command
to uCode.

There is no separated "channel switch" indication from mac80211,
when detected "IEEE80211_CONF_CHANGE_CHANNEL" flag in iwl_mac_config(),
if the station is in "associated" state, then assume "channel switch
announcement" IE was received by 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>
fadb3582a38c33d0f7c58ab7905d4dbc67f4c4d9 23-Oct-2009 Ben Cahill <ben.m.cahill@intel.com> iwlwifi: consolidate apm_init() functions

Consolidate most iwlXXXX_apm_init() functions into single iwl_apm_init().
Keep iwl3945_apm_init(), but leverage iwl_apm_init() for most functionality.
Update 4965 init sequence to follow most recent factory recommendations.

Add following members to struct iwl_cfg to guide the init sequence:
pll_cfg_val (replaces needs_pll_cfg), set_l0s, use_bsm

Move L0S enable/disable from nic_config() functions to iwl_apm_init().
This satisifies the "FIXME: put here L1A -L0S w/a" notice, and complies
with factory-recommended sequence.

Add debug info message in iwl_apm_init(), and symmetrical message
in iwl_apm_stop().

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>
065e63b00cf13919010bbeff48f7a120033be448 23-Oct-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: fix gain computation for 5000 series and up

In Rx gain balancing (chain noise) computation for 5000 series and up,
the delta gain calculation should use the average noise of default
chain, not "chain 0" which do not exist for all the devices.

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>
2f301227a1ede57504694e1f64839839f5737cac 09-Oct-2009 Zhu Yi <yi.zhu@intel.com> 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>
88804e2b33b6ab3974ff2330cd045ca53d6750c5 09-Oct-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> 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>
55036d6602679fb88dd7b1c19bb7203a0213b684 09-Oct-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> 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>
b660d3adb8dd4ead54744c9269bae9338163020a 09-Oct-2009 Ben Cahill <ben.m.cahill@intel.com> 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>
d43c36dc6b357fa1806800f18aa30123c747a6d1 07-Oct-2009 Alexey Dobriyan <adobriyan@gmail.com> headers: remove sched.h from interrupt.h

After m68k's task_thread_info() doesn't refer to current,
it's possible to remove sched.h from interrupt.h and not break m68k!
Many thanks to Heiko Carstens for allowing this.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
1739d3322008fb95e88ad0530bcc057789107879 02-Oct-2009 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwlwifi: replace iwl_poll_direct_bit with iwl_poll_bit for CSR access

Replace iwl_poll_direct_bit with iwl_poll_bit when accessing CSR registers.
There is no need to power up the mac to access CSR registers.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Acked-by: Ben M Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d68b603cf01a6e7d8c85c5a86db751ed3960c0c7 02-Oct-2009 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwlwifi/iwl3945 : unify apm stop operation

Unify the usage of apm_stop_master and apm_stop
across all hardwares.

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>
e932a609e9759cc75db0c234f465a5fd6e20d362 02-Oct-2009 Johannes Berg <johannes@sipsolutions.net> iwlwifi: LED cleanup

The iwlwifi drivers have LED blinking requirements that
mac80211 cannot fulfill due to the use of just a single
LED instead of different ones for TX, RX, radio etc.
Instead, the single LED blinks according to transfers
and is solid on the rest of the time. As such, having
LED class devices registered that mac80211 triggers are
connected to is pointless as we don't use the triggers
anyway.

Remove all the useless code and add hooks into the
driver itself. At the same time, make the LED code
abstracted so the core code that determines blink rate
etc. can be shared between 3945 and agn in iwlcore.

At the same time, the fact that we removed the use of
the mac80211 LED triggers means we can also remove the
IWLWIFI_LEDS Kconfig symbol since the LED support is
now self-contained.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
39d5e0ce0f2ab9a4bb88e22a9f07ba3943e3646d 02-Oct-2009 Huaxu Wan <huaxu.wan@linux.intel.com> iwlwifi: clear the translate table area

Driver should clear the translate table area after receiving "Alive"
response from uCode. This patch corrects a mistake when doing this.

Signed-off-by: Huaxu Wan <huaxu.wan@linux.intel.com>
Signed-off-by: Guo Chaohong <chaohong.guo@linux.intel.com>
Acked-by: Ben M Cahill <ben.m.cahill@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d8c07e7a84950b5fdef424c6dabe6bed3a9ffa19 25-Sep-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: Chain Noise Calibration for 6000 series

Adding support of Chain Noise Calibration for 6000 series NICs.

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>
2f748deceee10bac563df0e859830cc628d1a841 17-Sep-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: send cmd to uCode to configure valid tx antenna

In order for uCode to select the valid antennas for transmit, driver
need to configure the allowed tx antennas through host command.

The TX_ANT_CONFIGURATION_CMD should be used for 5000 series and up

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>
4e30cb691b9ba62642cc1594ef08f7439deb5a02 17-Sep-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: use S_IRUGO and S_IWUSR in module parameters

Instead of hardcode module parameter's permissions, use pre-defined.

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>
f2d0d0e2bab7a325071dbaba3bef51c90868e1e6 11-Sep-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: Adjust blink rate to compensate Clock difference

Adjust led blink rate to compensate on a MAC Clock difference on every
HW. Led blink rate analysis showed an average deviation of 0% on 3945,
5% on 4965 HW and 20% on 5000 series and up.
Need to compensate on the led on/off time per HW according to the
deviation to achieve the desired led frequency
The calculation is: (100-averageDeviation)/100 * blinkTime
For code efficiency the calculation will be:
compensation = (100 - averageDeviation) * 64 / 100
NewBlinkTime = (compensation * BlinkTime) / 64

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>
f3a2a42470c1c362b9a7b4e933a15a274d4b090e 11-Sep-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: separate set_hw_params function for 6000 series

Separate set_hw_params() function for 6000
series from 5000/1000 series because:
1) 6000 series use different set of sensitivity range table
2) 6000 series has different uCode image size

Also include the new sensitivity parameters needed by sensitivity
algorithm.

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>
9371d4ed79c1c2efefa00226f7f6b95e0e0b8f2b 11-Sep-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: separate nic_config for different NIC

Different NIC has different requirements for configuration. Currently all
5000 series hardware and later share the same configuration function even
though they do not need the same configurations. Fix this by separating the
needed configuration actions for each hardware model.

.5000 series: L1-ASPM H/W bug work-around
configure radio
write CSR_HW_IF_CONFIG_REG for uCode use
work-around for NIC get stuck after early PCIe power off

.1000 series: write CSR_HW_IF_CONFIG_REG for uCode use
setting digital SVR for 1000 card to 1.32V

.6000 series: configure radio
write CSR_HW_IF_CONFIG_REG for uCode use
write CSR_GP_DRIVER_REG to indicate radio sku

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>
886e71de1f889adadb1065b1a83b0e64625fb716 02-Oct-2009 Reinette Chatre <reinette.chatre@intel.com> iwlagn: fix compile warning in iwl5000_gain_computation

The return type of abs() was recently changed from int to long. With
min()'s type checking we thus need to make sure that values of the same
type are compared.

This fixes:

CC [M] drivers/net/wireless/iwlwifi/iwl-5000.o
drivers/net/wireless/iwlwifi/iwl-5000.c: In function ‘iwl5000_gain_computation’:
drivers/net/wireless/iwlwifi/iwl-5000.c:320: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b7a794048ff30d53764c1e41ccb2bff7f7bec2a8 25-Sep-2009 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: fix 3945 ucode info retrieval after failure

When hardware or uCode problem occurs driver captures significant
information from device to enable debugging. The format of this information
is different between 3945 and 4965 and later devices, yet currently the
3945 uses the 4965 and later format. Fix this by adding a new library call
that is initialized to the correct formatting routine based on device.

This moves the iwlagn event and error log handling back to iwl-agn.c to
make it part of iwlagn module.

Also remove the 3945 sysfs file that triggers dump of event log - there is
already a debugfs file that can do it for all drivers.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6c6a22e26868285dc3dac280e0e57de029bfae1b 23-Sep-2009 Stanislaw Gruszka <sgruszka@redhat.com> iwlagn: fix panic in iwl{5000,4965}_rx_reply_tx

In some cases firmware can give us bad value of index in transmit
buffers array. This patch add sanity check for such values and return
from processing function instantly when it happens.

https://bugzilla.redhat.com/show_bug.cgi?id=521931

Patch was tested by reporter on iwl5000. I think check can be also
helpful for 4965.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
396887a2b2ad1ef5e5526fec34dec582baf39b81 13-Aug-2009 Daniel C Halperin <daniel.c.halperin@intel.com> iwlwifi: fix erroneous use of iwl_rx_packet.len as a length

The field called 'len' in struct iwl_rx_packet is in fact not just a length
field but also includes some flags from the flow handler. In several places
throughout the driver, this causes incorrect values to be interpreted as
lengths when the field is improperly masked.

In most situations the improper use is for debugging output, and simply results
in an erroneous message, such as:

[551933.070224] ieee80211 phy0: I iwl_rx_statistics Statistics notification received (480 vs -1367342620).

which should read '(480 vs 484)'.

In at least one case this could case bad things to happen:

void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
struct iwl_rx_mem_buffer *rxb)
{
struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
IWL_DEBUG_RADIO(priv, "Dumping %d bytes of unhandled "
"notification for %s:\n",
le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd));
iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len)
);
}
EXPORT_SYMBOL(iwl_rx_pm_debug_statistics_notif);

Given the rampant misuse of this field without proper masking throughout the
driver (every use but one), this patch renames the field from 'len' to
'len_n_flags' to reduce confusion. It also adds the proper masking when
this field is used as a length value.

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15993e08ac027b64b6f3400d32754966b4cac7b0 13-Aug-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: add thermal throttling support to 5150

Adding legacy thermal throttling management support to 5150 NIC

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>
b261793da587160d12ce6d63db60493342ddce20 13-Aug-2009 Daniel C Halperin <daniel.c.halperin@intel.com> iwlwifi: use station HT capabilities and BSS operating mode for Green-field

Green-field mode should be configured in the HT station table. This patch uses
both the per-station GF support flag as well as the current BSS HT operation
mode (non-GF stations present flag).

Added the "ht_greenfield_support" field to struct iwl_cfg to replace the
device-specific check in rs_use_green(). That check has been moved to
iwlcore_init_ht_hw_capab().

Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7aafef1c6e2e24f9a10dc2972bf0ee70624ccc47 08-Aug-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: name changed from "fat" to "ht40"

Rename "fat" to "ht40"
The term "fat channel" is deprecated in favor of "HT40"

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>
65b7998a9be418482493e9448bb83ff2914ed050 31-Jul-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: Distinguish power amplifier for 6000 series

For 6x00 2x2 NIC, two types of Power Amplifier are available.
In order for uCode to apply correct tx power,
driver needs to program the CSR_GP_DRIVER_REG register and
let uCode know the type of PA.
If driver do not program CSR_GP_DRIVER_REG register (default to 0),
then it is uCode's decision for tx power

2x2 Hybrid card: use both internal and external PA
2x2 IPA(Internal Power Amplifier) card: internal PA only

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>
39b73fb15e4704fd4d1e33688135810637f5f3fb 24-Jul-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: Thermal Throttling Management - Part 1

Part 1 of Thermal Throttling Management -

Thermal Throttling feature is used to put NIC into low power state when
driver detect the Radio temperature reach pre-defined threshold

Two Thermal Throttling Management Methods; this patch introduce the
Legacy Thermal Management:
IWL_TI_0: normal temperature, system power state
IWL_TI_1: high temperature detect, low power state
IWL_TI_2: higher temperature detected, lower power state
IWL_TI_CT_KILL: critical temperature detected, lowest power state

Once get into CT_KILL state, uCode go into sleep, driver will stop all
the active queues, then move to IWL_TI_CT_KILL state; also set up 5
seconds timer to toggle CSR flag, uCode wake up upon CSR flag change,
then measure the temperature.
If temperature is above CT_KILL exit threshold, uCode go backto sleep;
if temperature is below CT_KILL exit threshold, uCode send Card State
Notification response with appropriate CT_KILL status flag, and uCode
remain awake, Driver receive Card State Notification Response and update
the card temperature to the CT_KILL exit threshold.

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>
672639de13c4db92ed6a47e68043a4317e219902 24-Jul-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: critical temperature enter/exit condition

If advance thermal throttling is used the driver need to pass both
"enter" and "exit" temperature to uCode.

Using different critical temperature threshold for legacy and advance
thermal throttling management based on the type of thermal throttling
method is used except 1000.
For 1000, it use advance thermal throttling critical temperature
threshold, but with legacy thermal management implementation until ucode
has the necessary implementations in place.

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>
a562a9dda7f47e7cac58d80bf1ffe441feca510e 17-Jul-2009 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: make debug level more user friendly

* Deprecate the "debug50" module parameter used to obtain
5000 series and up debugging. Replace it with "debug" module
parameter to match with original driver and be consistent
between them. The "debug50" module parameter can still be used,
except that the module parameter is not writable in keeping
with its previous state. We currently just mark it as "deprecated"
and do not have it in the feature-removal-schedule. Some more
cleanup of module parameters needs to be done and can then be
entered together.

* Only make "debug" module parameters visible if the driver
is compiled with CONFIG_IWLWIFI_DEBUG. This will eliminate
a lot of confusion where users think they have set debug flags
but yet cannot see any debug output.

* Make module parameters writable. This eliminates the need for the
"debug_level" sysfs file, which can now also be deprecated and
added to feature-removal-schedule. This file is in significant
use though with many iwlwifi documents and text referring users
to it. We can thus not take its removal lightly and keep it around.

With iwlcore shared between iwlagn and iwl3945 we really do not need
debug module parameters for each but can instead have one debug
module parameter for the iwlcore module. The same issue is here as
with the sysfs file - a lot of iwlwifi documentation and text (like
bug reports) rely on iwlagn and iwl3945 having this module parameter,
so changing this to a module parameter of iwlcore will have significant
impact and we do not do this for that reason.

One consequence of this patch is that if a user is running a system
with both 3945 and later hardware then the setting of the one module
parameter will affect the value of the other. The likelihood of this
seems low - and even if this setup is present it does not seem like an
issue for both modules to run with the same debug level.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
cc0f555d511a5fe9d4519334c8f674a1dbab9e3a 17-Jul-2009 Jay Sternberg <jay.e.sternberg@intel.com> iwlwifi: Handle new firmware file with ucode build number in header

Adding new API version to account for change to ucode file format. New
header includes the build number of the ucode. This build number is the
SVN revision thus allowing for exact correlation to the code that
generated it.

The header adds the build number so that older ucode images can also be
enhanced to include the build in the future.

some cleanup in iwl_read_ucode needed to ensure old header not used and
reduce unnecessary references through pointer with the data is already
in heap variable.

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
02c06e4abc0680afd31bf481a803541556757fb6 17-Jul-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlagn: modify digital SVR for 1000

On 1000, there are two Switching Voltage Regulators (SVR). The first one
apply digital voltage level (1.32V) for PCIe block and core. We need to
use this regulator to solve a stability issue related to noisy DC2DC
line in the silicon.

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>
fe6efb4b423c923fb491a9ca4fa419e843548740 12-Jun-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: no need to refer to max_nrg_cck range value

max_nrg_cck value inside the sensitivity range structure is not needed
for sensitivity calibration.
Keep the parameter in sensitivity structure but set the value to "0" in case
needed in the future implementation.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9d67187dbd93df98011f7229f76de25d142b57cc 12-Jun-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: modify sensitivity value for 5150

In 5150 there is a long delay between the AGC(Automatic Gain Control) command
till the RF is stabilized causing us to miss detections when there was
adjacent channel noise, so we need to adjusted the Sensitivity calibration
for 5150 differently.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c587de0b8d6e194f7a1719fc6af8a81b4e8916d2 03-Jun-2009 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: unify station management

This patch unifies 3945 and AGN station management
It also removes useless struct iwl_station_mgmt ops
and cleanups a bit the interface

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Tested-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>
ef850d7cb301bda9155c096269557a4586b58071 22-May-2009 Mohamed Abbas <mohamed.abbas@intel.com> iwlcore: support ICT interrupt

Add ICT interrupt handler support, ICT should improve CPU utilization
since it does not require target read which is very expensive. This
interrupt handler only added to 5000 cards and newer. Device will write
interrupts to ICT shared table to inform driver about its interrupts.

These patches will not touch 3945 and 4965 interrupt handlers and tasklet.

Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a8b50a0a966d7ac313f624c6ab4996231a5fe25a 22-May-2009 Mohamed Abbas <mohamed.abbas@intel.com> iwlcore: register locks

Add new lock to be used when accessing some registers. Also move
the register lock and iwl_grab_nic_access inside the function for register access. This
will prevent from forgetting to hold locks and nic access in the right way and make code
easier to maintain.

We over use the priv->lock spin lock and I guess we need to add new
one for Tx queue after that we might need to change most of these lock to
BH and just keep priv->lock as irq type.

Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
62161aefa403a3f8d603b061f5688cf00928a2cc 21-May-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: Temperature sensor voltage reading for 5150

The temperature measurement by uCode for 5150 and 5000 are different
CSR_HW_REV_TYPE_5150: temperature sensor output voltage
CSR_HW_REV_TYPE_5000: temperature in Celsius
temperature related operation for 5150 is measured by temperature sensor
output voltage; additional conversion is required for set and store
the temperature.

To make sure support different HW design; implement _ops method for
temperature related functions (temperature reading and set ct kill
threshold)

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>
c9d2fbf36df5e04efa226614093bb1bacc6fe131 19-May-2009 Jay Sternberg <jay.e.sternberg@linux.intel.com> iwlwifi: update 5000 ucode support to version 2 of API

enable iwl driver to support 5000 ucode having version 2 of API

Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
09f9bf79b7870ac017a94f7f9b603c2e28ac73f7 20-Apr-2009 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwlwifi: remove radio disable parameter.

Patch removes the "manual radio disable" parameter
as there is no usage scenario of disabling radio using this module parameter.
User can use iwconfig's txpower to enable and disable radio.

This module parameter also does not work as expected. During module load
the status of radio is set, the radio is not actually disabled. Even so,
the moment mac80211 requests the interface to be up the radio will be
enabled again.

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>
60690a6a38cc03142a0c5aaed64cf043e707457d 08-Apr-2009 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwlwifi: add config_ap lib op

add config_ap lib op to iwlwifi and iwl3945 in preparation
of future 3945 porting actions.

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>
45823531662028a8cbd68906c20e887bb287c85e 08-Apr-2009 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwlwifi: add set_rxon_chain op

add set_rxon_chain op to iwlwifi cfg ops in preparation of
future 3945 porting work.

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>
06fd3d86a426848dbd8db27b7257a4eb4be8cfae 08-Apr-2009 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwl3945/iwlwifi: unify add_station function

Patch unifies the add_station function for 3945 and iwlwifi drivers.

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>
e11bc0286a4ff8f4e5cdefbcce0878d29c03c630 08-Apr-2009 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwlwifi: use station management ops

Patch replaces station management functions with ops declared.

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>
79fa455a995057b6559fcd2a02e8b089b2e2e288 08-Apr-2009 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwlwifi: add station management ops

This patch adds declarations for station management ops to iwlwifi drivers.

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>
e0158e61108bdadd70865c2149dc829a5c84dd73 08-Apr-2009 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwlwifi: add commit_rxon lib

Patch adds commit_rxon lib operation to iwlwifi and iwl3945 drivers.

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>
5bbe233b9bafabc08a5404d54b9fa086e8390fc7 08-Apr-2009 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwl3945: use iwl_bss_info_changed

3945 can use iwl_bss_info_changed.
A new lib op is created for post_assoicate to distinguish between
3945 and iwlwifi's post_associate operations.

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>
e4e72fb4de93e3d4047a4ee3f08778422e17ed0d 23-Mar-2009 Johannes Berg <johannes@sipsolutions.net> mac80211/iwlwifi: move virtual A-MDPU queue bookkeeping to iwlwifi

This patch removes all the virtual A-MPDU-queue bookkeeping from
mac80211. Curiously, iwlwifi already does its own bookkeeping, so
it doesn't require much changes except where it needs to handle
starting and stopping the queues in mac80211.

To handle the queue stop/wake properly, we rewrite the software
queue number for aggregation frames and internally to iwlwifi keep
track of the queues that map into the same AC queue, and only talk
to mac80211 about the AC queue. The implementation requires calling
two new functions, iwl_stop_queue and iwl_wake_queue instead of the
mac80211 counterparts.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Reinette Chattre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a2f1cbebdccc866d6c7da9eb655d35b5c60d33a0 18-Mar-2009 Wey-Yi Guy <wey-yi.w.guy@intel.com> iwlwifi: report error when detect failure during stop agg queue

This fix related to bug 1921 at
http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1921

when detect error during stopping tx aggregation queue, report the error to
help identify the problem.

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>
39e6d2256b8b8265ef16297887b5521f3e0155c6 28-Feb-2009 Jay Sternberg <jay.e.sternberg@linux.intel.com> iwlwifi: update 5150 API version to support new firmware

update API to support new numbering that is used for other newer devices.
5150 ucode has not been released yet, so the first released API will be v2.
For those who do have a v1 API the driver does have backward compatibility
support new value of REPLY_TX_POWER_DBM_CMD

Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3fdb68de22c9881691c485b05ed3204bdc431a18 11-Feb-2009 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: use pci registers defined in pci_regs.h

This patch replaces where possible usage of pci register
defined in the driver by ones defined in pci_regs.h

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e8c00dcb028a1b702863c3a454315c7ae5f544e7 29-Jan-2009 Jay Sternberg <jay.e.sternberg@linux.intel.com> iwlwifi: define structures and functions externally for customization

defined the structures and functions as extern to alter behavior used by
5000 series for other products including 100 and 6000 series

Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
76a2407a5b043d0950d5657184118e89860d545c 29-Jan-2009 Jay Sternberg <jay.e.sternberg@linux.intel.com> iwlwifi: correct API command overlap

Correct the API commands where same command id used for two different
commands. Update max api versions for affected devices.

TX_ANT_CONFIGURATION_CMD was already using id 0x98, so
REPLY_TX_POWER_DBM_CMD moved to 0x95

Older API interfaces may used original value so V1 defines provided.

Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
050681b77d10ac81bf6be5b2c61aa6c5969947e4 29-Jan-2009 Jay Sternberg <jay.e.sternberg@linux.intel.com> iwlwifi: parametrize configuration of the PLL for exclusion on 6000

added a config parameter to enable setting PLL_CFG. older hardware has
this parameter set true. the 6000 family does not support this setting,
so this parameter set false.

Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c0bac76a22c00d0b4622b2847e0b087befb9ff25 03-Feb-2009 Jay Sternberg <jay.e.sternberg@linux.intel.com> iwlwifi: simplify parameter setting to allow support for 6000 series

by parametrizing the set hw function, in addition to allowing for
supporting the 6000 family significantly simplify the addition of new
hardware.

Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e1623446bb1de1834ff1c57b3e8ed341d5d4a927 27-Jan-2009 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: don't use implicit priv in IWL_DEBUG

Call IWL_DEBUG macro with explicit priv argument.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a8e74e2774cd1aecfef0460de07e6e178df89232 23-Jan-2009 Samuel Ortiz <samuel.ortiz@intel.com> iwl3945: Use iwlcore TX queue management routines

By adding an additional hw_params (tfd_size) and a new iwl_lib ops (txq_init),
we can now use the iwlcore TX queue management routines.
We had to add a new hw_params because we need to allocate the right DMA buffer
for TFDs, and those have a different sizes depending if you're on 3945 or agn.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
cec2d3f38c11f4c7e28ec2a065698653dbccfbb7 20-Jan-2009 Jay Sternberg <jay.e.sternberg@linux.intel.com> iwlwifi: remove static from 5000 structures

remove static from config structures which will be used by new
hardware that is similar to 5000. This way the new devices
can use them without the new structures having to be stored in the
already overloaded iwl-5000.c file.

Signed-off-by: Jay Sternberg <jay.e.sternberg@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7aaa1d79e3a2d573ac469744506f17b1c9386840 20-Jan-2009 Samuel Ortiz <samuel.ortiz@intel.com> iwlwifi: Add TFD library operations

The TFD structures for 3945 and agn HWs are fundamentally different. We thus
need to define operations for attaching and freeing them. This will allow us
to share a fair amount of code (cmd and tx queue related) between both
drivers.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
01f8162a854df7f9c259c839ad3c1168ac13b7b8 08-Jan-2009 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: update copyright year to 2009

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
141c43a3e4c7e8543fea982284765fda5e73837e 08-Jan-2009 Winkler, Tomas <tomas.winkler@intel.com> iwl3945: kill iwl3945_rx_queue_restock

This patch kills iwl3945_rx_queue_restock function on prise of new
hw_params.rx_wrt_ptr_reg which holds per NIC RX write pointer register.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15b1687cb4f45b87ddbe4dfc7759ff5bb69497d2 19-Dec-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: replace IWL_ERROR with IWL_ERR

IWL_ERR doesn't use hidden priv pointer.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
39aadf8c29ad959e823efca15381bea9d0770b1e 19-Dec-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: replace IWL_WARNING with IWL_WARN

IWL_WARN doesn't use hidden priv pointer.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
250bdd216c95907760b3fcc3aac1ed436d21c66c 19-Dec-2008 Samuel Ortiz <sameo@linux.intel.com> iwl3945: Have consistant and not redefined HW constants

SRAM addresses are different for 3945, 4065, and 5000, let's give them
different names.
Also, the RSSI_OFFSET is different for 3945 and 4965, thus they should be
named differently.

Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com>
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>
febf3370c63b4ea7fc1cedb9a73ac37e3cb21079 17-Dec-2008 Wu Fengguang <fengguang.wu@intel.com> iwlwifi: remove useless goto

The patch removes some useless goto in code cleanup.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
95aa194ac4a8fee0aea64c9609e70211cd057ad2 17-Dec-2008 Wu, Fengguang <fengguang.wu@intel.com> iwlwifi: use type uint for module param debug

This enables one to change the debug level at bit 31.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
30dab79ed40f6c0f8a24e25fd9be7bd873eeeb8b 09-Dec-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: remove qos module parameter

The ability of disabling qos from module params is not required anymore.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
73d7b5acc461bdc99e0135779d15e1874c6e00a6 05-Dec-2008 Zhu, Yi <yi.zhu@intel.com> iwlwifi: iwl_poll_{direct_}bit cleanup

The patch merges implementation of iwl_poll_bit() and
iwl_poll_direct_bit() by letting the latter be a special case of
the former.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a0987a8d68c86562f267efa97be01314c490c496 02-Dec-2008 Reinette Chatre <reinette.chatre@intel.com> iwlwifi: rely on API version read from firmware

This adds the infrastructure to support older firmware APIs.
The API version number is stored as part of the filename, we first try to
load the most recent firmware and progressively try lower versions.
The API version is also read from the firmware self and stored as part
of the iwl_priv structure. Only firmware that is supported by driver will
be loaded. The version number read from firmware is compared
to supported versions in the driver not the API version used as part of
filename.

An example using this new infrastrucure:
if (IWL_UCODE_API(priv->ucode_ver) >= 2) {
Driver interacts with Firmware API version >= 2.
} else {
Driver interacts with Firmware API version 1.
}

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f3f911d1773d31f11038d90b04244bc3986c4ccd 02-Dec-2008 Zhu Yi <yi.zhu@intel.com> iwlwifi: fix DMA channel number in iwl_txq_ctx_stop

The patch fixes the misuse of DMA channel number by Tx queue number in
iwl_tx_ctx_stop().

The problem was originally reported by Wu Fengguang who complains
iwlagn driver takes too long time when issuing `ifconfig wlan0 down`.
The patch now decreases the interface bring down time from 2 seconds
to 0.8 second.

This fixes bugs:
http://bugzilla.kernel.org/show_bug.cgi?id=11956
http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1790

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Tested-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7470d7f54064557b6210671c2692bba19af5b79d 02-Dec-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: 5150 enable LO, TXIQ and BB calibrations

This patch enables LO, TXIQ, and BB calibrations for 5150

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fd63edba43c584d334e8fc161ca84e4cf54e26a0 02-Dec-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: 5150 parametrize eeprom versions

Add support for 5150 eeprom versions

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
339afc893d3c1a36151c7578d7eacd2f4b293d5f 02-Dec-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: 5150 compute ct kill threshold

This patch adds computation of ct kill threshold
for 5150. Threshold is computed from calibration
data in the EEPROM.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
819500c5892aeeed079d3ea1671df40f2dd1d417 02-Dec-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: 5150 enable DC calibration

This patch enables DC calibration for 5150

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7100e924661cc23609de8e7ab9fc3a13e0173891 02-Dec-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: 5150 add support for 5150

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0d950d84d9d16f7d4edf380a238c5b534ff00d11 25-Nov-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: properly initialize calibration command header

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
40fc95d57caf258e20282f6526b695426d65a73a 20-Nov-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: TX update chicken bits

This instructs FH to increment the retry count of a packet when
it is brought from the memory to TX-FIFO to save transactions
during aggregation flow.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
31a73fe4f3284d94d52774c285e9e98a5f441d21 20-Nov-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: TX setup fix confusion between TX queue and TX DMA channel

This patch configures correctly TX DMA channel. It is not
the same as TX queue.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
201706ac0b1ab6df5343119883964ec7272844b0 20-Nov-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: enable base band calibration in 5000 HW

This patch adds base band calibration support.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c3056065400aeb437390e1a86b85f9c32fb1c1df 12-Nov-2008 Abhijeet Kolekar <abhijeet.kolekar@intel.com> iwlwifi : fix checkpatch.pl errors

Patch fixes checkpatch.pl errors for iwlwifi.

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>
9f58671e8d4f4896acea30020308ce72bf94ec6e 12-Nov-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: consolidate station management code

This patch moves code around and group most of the station
management code into iwl-sta.c

No functional changes (yet)

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4ddbb7d060061e584cb2137f4c7e41e502a560b4 07-Nov-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: revamp tx scheduler byte count tables handling

This moves byte count tables to tx domain removing completely
ambivalent shared data. Changes handling of allocation
byte count tables and keep warm consistent memory
Moves general tx scheduler definitions from iwl-4956-hw.h
to iwl-fh.h

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8d86422a83d79e3d3241cf0f269fca0c2640bcee 07-Nov-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: move rx queue read pointer into rxq

This patch moves rx status/read registers into
iwl_rx_queue structures. This solution is more memory
hungry but is more structured and provides needed RX/TX
separation

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5b9f8cd3eea04770ff186b853bbde1741f321866 29-Oct-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: rename generic iwlagn functions that had a HW specific name

This patch renames functions that are generic in iwl-agn and had a iwl4965
prefix.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9c80c50211d638555bc4b160d9ccd348e98eedad 29-Oct-2008 Winkler, Tomas <tomas.winkler@intel.com> iwlwifi: reorganize flow handler bitology

This patch cleans up FH bits and adds missing register values
that will be used later in TX initialization rewrite

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a96a27f97f2bbfc1fca54bc3c0b0d41484152740 24-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: run through spell checker

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
127901ab69bbb263fb2b46e850cf20c57ac321d3 24-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: refactor tx byte count table usage

This patch drops unreadable usage of IWL_SET/GET_BITS16 in byte count
tables handling
This patch also cleans a bit the byte count table code and adds
WARN_ON traps on invalid values

This patch is pure cleanup, no functional changes.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f69f42a6bbefb311ccb1626fdb61f723160afbfd 24-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: calibration command namespace renaming

Since calibration framework is not HW specific remove 5000 and 4965 prefix
This patch doesn't provide any functional changes only code renaming
and movement

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0ef2ca67b19e2286eed8eeb7ef7a35ce57d6d629 24-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: parametrize eeprom versions

This patch uses new parameters eeprom_ver and eeprom_calib_ver
to support additional HW.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3fd07a1e5aba89d4be3696c46cb7297f1873195a 24-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: refactor TX response flow

This patch utilize 5000 new TX response command
which contains all necessary information and avoids
back referencing to the original TX frame.
It also change handling of software queue tracking
4965 flow is aligned with changes as much as possible.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Reviewed-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
499b1883038a7db2dcf8b64229f8533ce2c8f0fc 14-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: fix TX cmd dma unmapping

This patch:
1. fixes command DMA unmapping, this might be visible only
on platforms where DMA unmapping is no noop such as PPC64 (not tested)
2. attaches correctly high memory part of the host command buffer
3. changes structure of TFD TB
instead of describing transmit buffer (TB) tuple it describes single
TB and makes code more readable on price of one unaligned access
4. eliminates using of IWL_GET/SET_BITs for TFD handling
5. renames TFD structures to mach the HW spec
6. reduces iwl_tx_info size by reserving first TB to the host command

This patch should not have any visible effect on x86 32

This patch is rework of
iwlwifi: fix DMA code and bugs from
Johannes Berg <johannes@sipsolutions.net>

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4e062f99af771173b601742b0c1c98eb4d52ea08 14-Oct-2008 Jay Sternberg <jay.e.sternberg@intel.com> iwlwifi: define firmware file name once

string repeated for definition of ucode firmware file and in preparation for
multiple firmware files need to consolidate location for their definition.

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Acked-by: Tomas Winkler <tomas.winler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e6a9854b05c1a6af1308fe2b8c68f35abf28a3ee 21-Oct-2008 Johannes Berg <johannes@sipsolutions.net> mac80211/drivers: rewrite the rate control API

So after the previous changes we were still unhappy with how
convoluted the API is and decided to make things simpler for
everybody. This completely changes the rate control API, now
taking into account 802.11n with MCS rates and more control,
most drivers don't support that though.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5d664a41a0a8c612f66bcb3c2a6f395e9afa6beb 08-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: take a valid antenna upon rate scale init

This patch selects a valid antennae upon rate scale init. This solves a
SYSASSERT complaining that the driver is setting a non valid antenna in
the LQ CMD.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
be5d56ed885a2897ec813eab4a8055d495816e9a 08-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: make initial calibration set configurable

This patch adds ability to configure initial calibration set. Not all HW
supported by iwlwifi use the same calibration set, XTAL is one example.
Some clean ups are also included in this patch.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d5d7c584810b3be2b70c979af3283a1e48b6574d 08-Oct-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: fix ct kill configuration for 5350

This patch fixes ct kill configuration for 5350. Temperature units that
HW expects are in Celsius not in kelvins.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c9f79ed2d063c3b0e0f2dbb2befd793ab40f6054 11-Sep-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: add MODULE_FIRMWARE for 5000 HW

This patch adds MODULE_FIRMWARE statement for 5000 HW.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e7b635814b640c6fd9dca1c254dc22fac6fb9a1a 03-Sep-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: cleanup PCI register handling

This patch cleans up pci registers handling.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6e21f2c109edd746a10e08186484bae8168cdd0c 03-Sep-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: generic init calibrations framework

This patch allows variable number of init calibrations and allows
addition new HW.

This patch also fixes critical bug. Only last calibration result
was applied. On reception of one calibration result all the calibration
was freed.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f0b9f5cb4adcec9424142592ca7bf024fe6c91a9 28-Aug-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: fix 64bit platform firmware loading

This patch fixes loading firmware from memory above 32bit.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Acked-by: Marcel Holtmann <holtmann@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1d3e6c61342292140dfe1b921991ee793ec1e0ae 28-Aug-2008 Mohamed Abbas <mohamed.abbas@intel.com> iwlwifi: fix apm_stop (wrong bit polarity for FLAG_INIT_DONE)

The patch fixes CSR_GP_CNTRL_REG_FLAG_INIT_DONE was set instead of
cleared which disabled moving device to D0U state.

Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3eb75aac8907e7ea36f0d078b2cc7393986001cf 17-Aug-2008 Huang Weiyi <weiyi.huang@gmail.com> removed unused #include <version.h>

The drivers below do not use LINUX_VERSION_CODE nor KERNEL_VERSION.
drivers/net/wireless/ath5k/base.c
drivers/net/wireless/b43/main.c
drivers/net/wireless/ipw2100.c
drivers/net/wireless/ipw2200.c
drivers/net/wireless/iwlwifi/iwl-3945.c
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-5000.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-eeprom.c
drivers/net/wireless/iwlwifi/iwl-hcmd.c
drivers/net/wireless/iwlwifi/iwl-power.c
drivers/net/wireless/iwlwifi/iwl3945-base.c

This patch removes the said #include <version.h>.

Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2d3db679511be102741cb2d5f8c2b8a1ededdee7 04-Aug-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: grap nic access before accessing periphery registers

We need to grap nic access before accessing periphery registers.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
caab8f1a5d0da583b6ffe41afea2774c676444ca 04-Aug-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: implement iwl5000_calc_rssi

This patch implements rssi calculation for 5000 HW.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
da99c4b6c25964b90c79f19beccda208df1a865a 04-Aug-2008 Gregory Greenman <gregory.greenman@intel.com> iwlwifi: memory allocation optimization

This patch optimizes memory allocation. The cmd member of
iwl_tx_queue was allocated previously as a continuous block
of memory. This patch allocates separate memory chunks for each command
and maps/unmaps these chunks in the run time.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4c43e0d0ecd5196ed5c67f64ed2f1860770eed34 04-Aug-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: HW bug fixes

This patch adds few HW bug fixes.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3ac7f14694dd38273d9d96f1c873233d71190c15 21-Jul-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: fix checkpatch.pl errors

This patch fixes errors reported by checkpatch in iwlwifi drivers

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4aa41f12aa4f08a10b0b07ed334faa3638ba8e9c 18-Jul-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: bug fix in AGG flow - cast const to ULL

This patch fixes a bug in AGG flow:
u64 bitmap = 0;
bitmap |= 1 << 32 results to be 0xffffffff80000000.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ca579617d81baf5865498eb5fae58e453ee77c2c 18-Jul-2008 Mohamed Abbas <mohamed.abbas@intel.com> iwlwifi: add power save to 5000 HW

This patch adds support for power save for 5000 HW.

Signed-off-by: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9f17b318a1e2335b45cf35ad6509b90e972c0e6b 11-Jul-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: differentiate 4965 and 5000 hw ampdu queues number

This patch asks to allocate the correct amount of sw queues according
to hw ampdu queues number.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a326a5d096f031af46c0073dd78eb80dea1f311a 11-Jul-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: fixes RTS / CTS support

This patch fixes the RTS / CTS support in iwlwifi. 5000 will send CTS to
self when allowed by spec, 4965 will send RTS or CTS to self according to
mac80211 request.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
474086396276a01190974797a69a95fb14ae7cc9 11-Jul-2008 Esti Kummer <stkumer@localhost.localdomain> iwlwifi: adding pci device ids to iwl_hw_card_ids

The patch adds PCI device IDs to iwl_hw_card_ids.

Signed-off-by: Esti Kummer <stkumer@localhost.localdomain>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3235427ecb092e4ff86528edd775e759dbeeecff 01-Jul-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: request Tx of block ack request if necessary

This patch sets the block ack request flag if needed

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5225640bbe397fea3f38031c53641aaaf11115a8 30-Jun-2008 Zhu Yi <yi.zhu@intel.com> iwlwifi: fix iwl4965 temperature callback calibration issue

The patch fixes the temperature calibration issue introduced by the
patch "iwlwifi: move RX stats to core, and move temperature to handler".
It also remove the second parameter "stats" since it is already copied
to priv->statistics.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0a078ffa011209c307880da10917ef205b4b11f4 30-Jun-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: fix 4965 uCode load

This patch fixes uCode load in 4965 HW

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4977929304306b1b0712f9b99e3cbf95f75c31ea 30-Jun-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: control 11n capabilities through module param

This patch adds module param 11n_disable to allow configuration of 11n
capabilities. The default value of this param is 11n enabled (value 0).

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
da154e306eb04426a3693c947588d82c3da05337 30-Jun-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: unite common settings of HW params

This patch unites common settings of 4965 and 5000 hw params.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
37deb2a0baf1bb540b723cc8a3972b42ff2daac6 30-Jun-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: don't send REPLY_REMOVE_ALL_STA upon exit

This patch avoids sending REPLY_REMOVE_ALL_STA in down flow, this avoids a
meaningless warning from being printed
On the way this patch also renames the the function to
iwl_clear_stations_table

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8f91aecb4cdc2d786df8941e827b9dff3c10a4e4 30-Jun-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: move RX stats to core, and move temperature to handler

This patch moves RX stats flow to core modules, and moves temperature
calibration to handler since it is not needed in 5000.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
853554accce19d16b03476676bdcb1ccdd44caae 30-Jun-2008 Gregory Greenman <gregory.greenman@intel.com> iwlwifi: configure uCode to use open loop tx power algorithm

This patch configures uCode to use open loop tx power algorithm
via TX_POWER_DBM (0x98) host command.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fd7c8a40b2a63863f749e4d17f0d94d2e5ab1331 11-Jun-2008 Harvey Harrison <harvey.harrison@gmail.com> mac80211: add helpers for frame control testing

A few general categories:

1) ieee80211_has_* tests if particular fctl bits are set, the helpers are de
in the same order as the fctl defines:

A combined _has_a4 was also added to test when both FROMDS and TODS are set.

2) ieee80211_is_* is meant to test whether the frame control is of a certain
ftype - data, mgmt, ctl, and two special helpers _is_data_qos, _is_data_pres
which also test a subset of the stype space.

When testing for a particular stype applicable only to one ftype, functions
like ieee80211_is_ack have been added. Note that the ftype is also being
checked in these helpers. They have been added for all mgmt and ctl stypes
in the same order as the STYPE defines.

3) ieee80211_get_* is meant to take a struct ieee80211_hdr * and returns a
pointer to somewhere in the struct, see get_SA, get_DA, get_qos_ctl.

The intel wireless drivers had helpers that used this namespace, convert the
all to use the new helpers and remove the byteshifting as they were defined
in cpu-order rather than little-endian.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e7d326ac437e9e9425dcd79382f4e5f6ca31fb16 12-Jun-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: move rate helpers to iwlcore

This patch moves rate helpers to iwlcore.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
630fe9b6f774dd55b71fe94392101eb00df58762 12-Jun-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: refactor setting tx power

This patch
1. Refactors settings of tx power
2. enables iwconfig txpower <value>
3. adds 5000 HW tx power

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
25a6572cc13ba2a3fefc02a63a077ff3664a1ca9 12-Jun-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: refactor tx aggregation response flow

This patch refactors tx aggregation respnse flow
and fixes bug revealed by tx_info to cb patch

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e26e47d94473af0c2a18beac664e526317b4f0b9 12-Jun-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: add TX aggregation code for 5000 HW

This patch adds TX aggregation handler for 5000 HW.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7f3e4bb60f81dd172d5e4b89220cb3f80c6dc552 12-Jun-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: map sw and hw ampdu queues

This patch maps sw and hw queues (for aggregations), so the right
mac80211 queue will be waken when ieee80211_wake_queue is invoked.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
203566f359b5702be72238a8b1d37655c986cc7c 12-Jun-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: add possibility to disable tx_power calibration

This patch adds the possibility to disable the tx_power calibration.
In 5000 HW, this calibration is implemented in uCode, hence, it is
disabled in driver by default.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16e727e866d739d7f02790c794410f6d9f1d720b 12-Jun-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: removes the RUN_TIME_CALIB ifdef

This patch removes the possibility not to compile the run time
calibrations. It also renames priv->sensitivity_work to
priv->run_time_calib_work, and moves bg_run_time_calib to iwl4965_base
since it is common to both: 4965 and 5000.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4f85f5b39208e755a93f63296ec1224d14121b6c 09-Jun-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: removing IWL4965_HT config

This patch removes CONFIG_IWL4965_HT #ifdefs for iwl 4965 and 5000. 11n
feature is stable in those drivers and its mode of operation is determined
in mac80211, so this dependency is not needed any more.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d2f18bfd9bc6b51c8bb72b272ecca902a88387d4 29-May-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi: send calibration results as HUGE commands

This patch saves memory by reducing the size of the entry in the txq. It
was 640 because of the calibration commands. Calibration commands are now
sent as HUGE commands (using the extra 1024 bytes at the end of the command
txq), hence, there is no need for 640 in every entry any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
30e553e3ea3572bee3118fcde36e043c0cb2174c 29-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: move aggregation code to iwl-tx.c

This patch moves aggregation action code to iwl-tx.c in iwlcore.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fe7a90c2b73f0c1da0882861cd015c835ed28781 29-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: iwl-5000 add rxon_assoc

This patch adds rxon assoc command for 5000 HW.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
972cf447d20df30dbd74edfc00ae179c4b822c68 29-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: implement txq invalidate byte count table

This is required to overcome a bug in 5000 HW byte count table.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
17b889290a184b52ee394c31dd5a52b8c1b3456d 29-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: move tx reclaim flow into iwl-tx

This patch
1. moves TX reclaim flow into iwl-tx
2. separates command queue and tx queue reclaim flow

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e532fa0e3ce3feda1f1eb14aa31caae503cd9bda 29-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwlifi: impelemnt 5000 tx response path

This patch implements 5000 HW tx response path.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fe9b6b720bd11c598417529755ac850a85070560 29-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: activate status ready timeout only for run time ucode

This patch makes driver state timeout checks on ucode alive response
only if run time ucode have been loaded.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7c616cba240cd0d579c996be3f3603456acfb0ad 29-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi-5000: implement initial calibration for 5000

This patch adds initial calibration framework for 5000 HW faimily.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
da1bc4539f9b10dc30ac1750fbaaf5afae4b3446 29-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: move txq_ctx_stop into iwl-tx.c

This patch moves txq_ctx_stop into iwl-tx.c iwlcore module.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
46315e012236af887cf442fd494a91b1d36858b9 29-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: refactor stop master function

This patch refactors stop master function for 4965 and 5000.
Currently it duplicates the function.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f118a91d16127e461cc8c17c529306910f13a8b1 29-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: implement apm stop function

This patch adds apm stop function for 4965 and 5000.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7f066108d15d06ec3534434333f0274c868fe798 29-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: implement apm reset flow

This patch implements apm reset flow for 4965 and 5000.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8f0618914e02c62c5cf2482f8acc7eb8e9afb816 29-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: setup correctly L1 L0S pi link values

This patch setups L1 L0S pci link values.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4a4a9e81aed702421ef3e782f82d4e929fb81796 29-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: clean up alive_start routine

This patch cleans up alive_start routine. It removes 4965 from the common
code and moves the run time calibration reset into a common code.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
87283cc1290f23458232cdf3b1893acb750a4ad3 29-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: add RTC data address for iwl5000

This patch fills the valid_rtc_data_addr handler in iwl5000.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9636e583d2c641f8cb32d0681f5052b2885edd79 15-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: iwl5000 WiFi/WiMax coexistence

This patch adds WiFi/WiMax coexistence to iwl5000.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
99da1b48fc77484aa8da85a45d9c3c1e00243659 15-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: add ucode init flow handling for iwl5000

This patch adds all the handlers and functions needed for ucode
initialization flow.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
dbb983b70a4696666112591572ed49c48c58da26 15-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: add ucode loaders for iwl5000

This patch adds ucode initialization handler and functions to load
ucode for iwl5000 NIC.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b600e4e1c5cd8928fef83bb983ab76c9a6f655bc 15-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: add rx_handlers stub for iwl5000

This patch adds rx_handler_setup stub to iwl5000.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
83d527d9e8f9aff92cbd33f208f77c055dabb499 15-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: remove 4956 form iwl4965_tx_cmd

This patch renames iwl4965_tx_cmd to iwl_tx_cmd and cleans
collateral code.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c1adf9fb31e31ee753d613bd5bc6aef9b762b747 15-May-2008 Gregory Greenman <gregory.greenman@intel.com> iwlwifi: get_hw_cmd_size

This patch introduces a new handler get_hw_cmd_size in hcmd_utils,
which should adjust the size of the command sent to the microcode
according to the current nic.
It also changes the RXON flow to make usage of this new handler.

The patch also adds iwl_rxon_cmd structure which is supperset for
5000 HW and 4965.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3a1081e84b0008de8171a95f2c0fff8489af4300 06-May-2008 Ester Kummer <ester.kummer@intel.com> iwlwifi: adding parameter of fw_restart

This patch adds a module parameter of fw_restart which determine if
the uCode will be restarted or not in case of error.

Signed-off-by: Ester Kummer <ester.kummer@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
164669032ecbf7c9a3bc78adad4e13ee486e975c 05-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: remove 4965 prefix from iwl4965_kw and iwl4965_tx_queue

This patch removes the 4965 prefix to form iwl_kw and iwl_tx_queue structs,
as they are used mostly in iwlcore now.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d67f5489d8d9be09bc8e1615ec6c57c3120a731d 05-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: handle shared memory Rx index access

This patch splits ucode's and driver's shared memory Rx index access to
match 4965 and 5000 offsets.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5a676bbeaf9e534b75286f2294ec57a4c544f1d2 05-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi: create disable SCD Tx FIFOs handler

This patch moves disabeling Tx FIFOs in NIC SCD to seperate handlers
in 4965 and 5000 cards.

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2469bf2e9938eef3c6ab0951985b050ff1f8c94f 05-May-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi-5000: add build_addsta_hcmd handler for 5000 HW

This patch adds iwl5000_build_addsta_hcmd handler.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5a835353fb3c68a3da3badcc485614cdfc6e6109 05-May-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi-5000: rename iwl5000_init_nic to iwl5000_init_config

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3e0d4cb12f6fd97193a455b49125398b2231c87c 24-Apr-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi: rename iwl-4965.h to iwl-dev.h

This patch renames iwl-4965.h to iwl-dev.h

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e86fe9f64d7cc3da9f445f3d0a2c5fd265fcd445 24-Apr-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi-5000: add nic config handler for 5000 HW

This patch adds nic config handler for 5000 HW Family

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f1f6941500602504fa9cd97294bfb3df7f22384f 24-Apr-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi-5000: add eeprom check version handler

This patch adds implementation for eeprom check version
handler for 5000 HW

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7839fc03862704677902be2d63c0482fee3deae3 24-Apr-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi-5000: update the byte count in SCD

This patch udpates the byte count of the frame in the registers of the
scheduler.
This patch also moves two defines in iwl-4965.h to a more appropriate
area in the file.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d4100dd985dcc13cc7bd1712ce10dea51b7c8261 24-Apr-2008 Ron Rindjunsky <ron.rindjunsky@intel.com> iwlwifi-5000: add iwl 5000 shared memory handlers

This patch fills the needed handlers for shared memory for
iwl 5000 family

Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1179f18df9fa3449ae6011042df50d9b9b012814 24-Apr-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi-5000: adjust antennas names in 5000 HW family

This patch use new defines for antennas

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
33fd503346ad86bd7470a0f8c4c3080393d14233 24-Apr-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi-5000: add run time calibrations for 5000

This patch adds support for run time calibrations for the 5000 family HW.
Those calibrations are sensitivity calibration, and chain noise calibration.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c031bf806fef4854b02266a4105f55ed31f2d1a8 24-Apr-2008 Emmanuel Grumbach <emmanuel.grumbach@intel.com> iwlwifi-5000: update the CT-Kill value for 5000 series

This patch upadtes the CT-Kill value for 5000 series.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fdd3e8a4ff96d03121b21946bfa684f3b5d783c6 24-Apr-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi-5000: adding iwl5000 HW parameters

This patch adds iwl 5000 HW parameters

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
25ae3986d7ed4303fabc883a87b74956bd59c22c 24-Apr-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi-5000: EEPROM settings for 5000

This patch adds eeprom handlers and values for 5000 HW family

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
88acbd3b32692ae786019ce642c6150b355f4b1e 24-Apr-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi-5000: use iwl4965_set_pwr_src in 5000

This patch makes use of iwl4965_set_pwr_src in 5000 HW family

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
30d59260d54686681e36d3055ff58c58ca3617da 24-Apr-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi-5000: add apm_init handler for 5000 HW family

This patch adds apm_init handler for 5000 HW family

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
da8dec29d7928dcc4ddf6b41d7c4c9cef522c9df 24-Apr-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi-5000: add ops infrastructure for 5000

This patch adds handler framework for 5000 family HW

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5a6a256e195380c062100dffad15f984656772c2 24-Apr-2008 Tomas Winkler <tomas.winkler@intel.com> iwlwifi-5000: adding initial recognition for the 5000 family

This patch adds initial support for recognizing the iwl 5000 family of NICs
ID

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>