Commit graph

2391 commits

Author SHA1 Message Date
Stanislaw Gruszka dc1a4068fc iwlwifi: more priv->mutex serialization
Check status bits with mutex taken, because when we wait for mutex
unlock, status can change. Patch should also make remaining sync
commands be send with priv->mutex taken. That will prevent execute
these commands when we are currently reset firmware, what could
possibly cause troubles.

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>
2011-04-07 15:34:11 -04:00
Stanislaw Gruszka 3598e1774c iwlwifi: fix enqueue hcmd race conditions
We mark command as huge by using meta->flags from other (non huge) command,
but flags can be possibly overridden, when non huge command is enqueued,
what can lead to:

WARNING: at lib/dma-debug.c:696 dma_debug_device_change+0x1a3/0x1f0()
DMA-API: device driver has pending DMA allocations while released from device [count=1]

To fix introduce additional CMD_MAPPED to mark command as mapped and
serialize iwl_enqueue_hcmd() with iwl_tx_cmd_complete() using
hcmd_lock. Serialization will also fix possible race conditions,
because q->read_ptr, q->write_ptr are modified/used in parallel.

On the way fix whitespace.

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>
2011-04-07 15:34:11 -04:00
Johannes Berg 2845fd858c 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>
2011-04-07 14:40:13 -04:00
John W. Linville 18d6a0f5b6 Merge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-2.6 2011-04-04 16:10:36 -04:00
John W. Linville 3d7dc7e8c1 iwlwifi: accept EEPROM version 0x423 for iwl6000
A number of these devices have appeared "in the wild", and apparently
the Windows driver is perfectly happy to support this EEPROM version.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Cc: stable@kernel.org
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-04 15:22:13 -04:00
Dan Carpenter 22dd2fd283 iwlwifi: remove duplicate initialization in __iwl_down()
We initialize exit_pending twice.  It's the second initialization which
is correct.  That was added in d745d472af "iwlwifi: cancel scan when
down the device".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-30 14:15:11 -04:00
Wey-Yi Guy 7eaa6a5e96 iwlagn: remove deprecated module parameters
Number of deprecated module parameters need to be remove for 2.6.40 kernel

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25 06:58:54 -07:00
Wey-Yi Guy f7d046f91b iwlagn: remove reference to 3945 and 4965
After driver split, remove the unused reference to 3945 and 4965

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25 06:58:47 -07:00
Wey-Yi Guy 2a226ab67f iwlagn: remove 3945 only station code
After driver split, no more 3945 only station support needed.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25 06:58:39 -07:00
Wey-Yi Guy d6b8061824 iwlwifi: remove legacy isr tasklet
After driver split, no need for support legacy isr, remove it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25 06:58:24 -07:00
Daniel Halperin 4263108c2a iwlwifi: set default aggregation frame limit to 63
This gives much better performance at fast 3x3 rates (up to ~160 Mbps).
The scheduler will still make most decisions about batch size based on
available packets and RX parameters.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25 06:58:15 -07:00
Daniel Halperin 2520546aec iwlwifi: add RATE_MCS_RATE_MSK
Throughout the code we use rate_n_flags & 0xff to extract the lower byte
of the rate_n_flags u32 that contains the information about the rate.
Add a #define and remove the use of the magic number.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25 06:58:06 -07:00
Daniel Halperin d0eb633431 iwlwifi: cleanup and bugfix tx aggregation code
Since the driver split, there's no need for no_agg_framecnt_info since
all devices have this set to false. Secondly, the compressed block ack
handling code was broken. Fix this.

(1) A shift less than zero simply implies that the buffer wrapped, this
is expected. Remove the incorrect comment.

(2) The (agg->frame_count > (64-sh)) condition can happen if the last
frame is dropped. E.g., if I send 7 frames and the 6th is received but
the 7th is lost, the other side may only shift the window 6, not 7
frames since the last bit is a 0. This is perfectly fine behavior and
doesn't invalidate the feedback.

(3) Store the feedback from a Compressed BA in the first newly received
frame, rather than the start of the window. This way it will get
processed by the rate selection code. Feedback stored in a non-received
frame is likely to get overwritten by the retransmission.
    This is based on the approach taken by minstrel_ht.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25 06:57:59 -07:00
Daniel Halperin 374920cb05 iwlwifi: limit number of attempts for highest HT rate
When filling out its rate scale table, iwlwifi repeats the first HT rate
IWL_HT_NUMBER_TRY times. The hardware scheduler will stop using
aggregation for any frame that fails LINK_QUAL_AGG_DISABLE_START_DEF
times. Currently, both these constants equal 3.

If iwlwifi probes a faster rate than the link supports, all frames in a
(potentially tens of frames large) batch will fail IWL_HT_NUMBER_TRY
times. Because this happens to be as large as
LINK_QUAL_AGG_DISABLE_START_DEF, all frames will then be sent
individually. This leads to a short, but performance-degrading window
where the legacy stop-and-wait MAC takes over.

Bounding the initial rate by (LINK_QUAL_AGG_DISABLE_START_DEF-1)
attempts makes the third try use a lower rate and hence more be likely
to succeed. This somewhat mitigates the above described behavior.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25 06:57:50 -07:00
Johannes Berg c8823ec133 iwlagn: fix aggregation queue scheduler setup
iwlagn's hardware scheduler needs to be set up
with the right aggregation frame limit and
buffer sizes. To achieve this, we need to move
the hardware queue setup to when the session
becomes operational.

Tested-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25 06:57:40 -07:00
Johannes Berg 7ffef13d7a 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>
2011-03-25 06:57:30 -07:00
Wey-Yi Guy d103e3448a iwlagn: use 6030 configuration for 6035 series
6035 series of devices should use the same uCode as 6030 series,
change it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-25 06:57:16 -07:00
Johannes Berg be36cacddd iwlagn: fix error in command waiting
Clearly a mistake, since pointers won't suddenly
change their value...

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-23 15:22:04 -04:00
Dan Carpenter f8a22a2b16 iwlwifi: missing unlock on error path
We should unlock here instead of returning -EINVAL directly.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-21 15:17:14 -04:00
David S. Miller 4a37390de9 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-03-15 18:55:20 -07:00
John W. Linville 106af2c99a Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem 2011-03-15 14:16:48 -04:00
Johannes Berg 266af4c745 iwlagn: support off-channel TX
Add support to iwlagn for off-channel TX. The
microcode API for this is a bit strange in that
it uses a hacked-up scan command, so the scan
code needs to change quite a bit to accomodate
that and be able to send it out.

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>
2011-03-11 14:15:55 -05:00
John W. Linville 409ec36c32 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem 2011-03-11 14:11:11 -05:00
Stanislaw Gruszka 118253ca46 iwlwifi: fix iwl-rx.c compilation
My commit 466a19a003 "iwlwifi: move rx
handlers code to iwl-rx.c" breaks compilation on 32 bits. Fix that.

Reported-by: Guy, Wey-Yi <wey-yi.w.guy@intel.com>
Reported-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-07 13:51:04 -05:00
David S. Miller d72751ede1 Merge branch 'for-davem' of ssh://master.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 2011-03-04 12:48:25 -08:00
John W. Linville 85a7045a90 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem 2011-03-04 14:10:40 -05:00
Stanislaw Gruszka 410f2bb30d iwlwifi: avoid too frequent recover from statistics
Usually H/W generate statistics notify once per about 100ms, but
sometimes we can receive notify in shorter time, even 2 ms.

This can be problem for plcp health and ack health checking.

I.e. with 2 plcp errors happens randomly in 2 ms duration, we
exceed plcp delta threshold equal to 100 (2*100/2).

Also checking ack's in short time, can results not necessary false
positive and firmware reset, for example when channel is noised and
we do not receive ACKs frames or when remote device does not send
ACKs at the moment.

Patch change code to do statistic check and possible recovery only
if 99ms elapsed from last check. Forced delay should assure we have
good statistic data to estimate hardware state.

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>
2011-03-04 14:06:50 -05:00
Stanislaw Gruszka 6198c387b2 iwlwifi: cleanup iwl_good_plcp_health
Make iwl_good_plcp_health code easiest to read.

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>
2011-03-04 14:06:50 -05:00
Stanislaw Gruszka 466a19a003 iwlwifi: move rx handlers code to iwl-rx.c
Put generic rx_handlers (except iwlagn_rx_reply_compressed_ba) to
iwl-rx.c . Make functions static and change prefix from iwlagn_ to
iwl_ . Beautify iwl_setup_rx_handlers and do some other minor coding
style changes.

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>
2011-03-04 14:06:50 -05:00
David S. Miller 0a0e9ae1bd Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/bnx2x/bnx2x.h
2011-03-03 21:27:42 -08:00
Fry, Donald H f8f79a5dbe iwlagn: report correct temperature for WiFi/BT devices.
The temperature reported by 'cat /sys/class/net/wlan?/device/temperature'
is incorrect for devices with BT capability.  Report the value from the
correct statistics structure.  Tested with 130, 100, 6205 and 5300.

Signed-off-by:  Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-03 10:05:11 -08:00
Fry, Donald H fea41cc9b1 iwlagn: Support new 1000 microcode.
iwlagn: Support new 1000 microcode.

New iwlwifi-1000 microcode requires driver support for API version 5.
(There is no version 4)

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-03-03 08:38:14 -08:00
David S. Miller 6ea25a6c2b Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-03-01 12:38:18 -08:00
Sergei Shtylyov ff938e43d3 net: use pci_dev->revision, again
Several more network drivers that read the device's revision ID
from the PCI configuration register were merged after the commit
44c10138fd (PCI: Change all drivers
to use pci_device->revision), so it's time to do another pass of
conversion to using the 'revision' field of 'struct pci_dev'...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: "John W. Linville" <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2011-02-28 11:57:33 -08:00
Stanislaw Gruszka 67289941d8 iwlwifi: move remaining iwl-agn-rx.c code into iwl-rx.c
There is no need to have separate iwl-agn-rx.c file after iwlegacy
split.

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>
2011-02-28 14:11:36 -05:00
Stanislaw Gruszka ad6e82a534 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>
2011-02-28 14:11:27 -05:00
Stanislaw Gruszka b7977ffaab iwlwifi: add {ack,plpc}_check module parameters
Add module ack_check, and plcp_check parameters. Ack_check is disabled
by default since is proved that check ack health can cause troubles.
Plcp_check is enabled by default.

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>
2011-02-28 14:06:57 -05:00
Stanislaw Gruszka 387f3381f7 iwlwifi: fix dma mappings and skbs leak
Since commit commit 470058e0ad
"iwlwifi: avoid Tx queue memory allocation in interface down" we do
not unmap dma and free skbs when down device and there is pending
transfer. What in consequence may cause that system hung (waiting
for free skb's) when performing shutdown at iptables module unload.

DMA leak manifest itself following warning:

WARNING: at lib/dma-debug.c:689 dma_debug_device_change+0x15a/0x1b0()
Hardware name: HP xw8600 Workstation
pci 0000:80:00.0: DMA-API: device driver has pending DMA allocations while released from device [count=240]
Modules linked in: iwlagn(-) aes_x86_64 aes_generic fuse cpufreq_ondemand acpi_cpufreq freq_table mperf xt_physdev ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ipv6 ext3 jbd dm_mirror dm_region_hash dm_log dm_mod uinput hp_wmi sparse_keymap sg wmi microcode serio_raw tg3 arc4 ecb shpchp mac80211 cfg80211 rfkill ext4 mbcache jbd2 sr_mod cdrom sd_mod crc_t10dif firewire_ohci firewire_core crc_itu_t mptsas mptscsih mptbase scsi_transport_sas pata_acpi ata_generic ata_piix ahci libahci floppy nouveau ttm drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: iwlagn]
Pid: 9131, comm: rmmod Tainted: G        W   2.6.38-rc6-wl+ #33
Call Trace:
 [<ffffffff810649ef>] ? warn_slowpath_common+0x7f/0xc0
 [<ffffffff81064ae6>] ? warn_slowpath_fmt+0x46/0x50
 [<ffffffff812320ab>] ? dma_debug_device_change+0xdb/0x1b0
 [<ffffffff8123212a>] ? dma_debug_device_change+0x15a/0x1b0
 [<ffffffff8149dc18>] ? notifier_call_chain+0x58/0xb0
 [<ffffffff8108e370>] ? __blocking_notifier_call_chain+0x60/0x90
 [<ffffffff8108e3b6>] ? blocking_notifier_call_chain+0x16/0x20
 [<ffffffff812f570c>] ? __device_release_driver+0xbc/0xe0
 [<ffffffff812f5808>] ? driver_detach+0xd8/0xe0
 [<ffffffff812f45d1>] ? bus_remove_driver+0x91/0x100
 [<ffffffff812f6022>] ? driver_unregister+0x62/0xa0
 [<ffffffff8123d5d4>] ? pci_unregister_driver+0x44/0xa0
 [<ffffffffa05632d1>] ? iwl_exit+0x15/0x1c [iwlagn]
 [<ffffffff810ab492>] ? sys_delete_module+0x1a2/0x270
 [<ffffffff81498da9>] ? trace_hardirqs_on_thunk+0x3a/0x3f
 [<ffffffff8100bf42>] ? system_call_fastpath+0x16/0x1b

I still can observe above warning after apply patch, but it is very
hard to reproduce it, and have count=1. Whereas that one is easy to
reproduce using debugfs force_reset while transmitting data, and have
very big counts eg. 240, like quoted here. So count=1 WARNING seems
to be different issue that need to be resolved separately.

v1 -> v2: fix infinity loop bug I made during "for" to "while" loop transition.
v2 -> v3: remove unneeded EXPORT_SYMBOL

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>
2011-02-28 14:06:56 -05:00
Wey-Yi Guy 6013270a03 iwlagn: enable BT session 2 type UART for 2000 series
For 2000 series device, use session 2 type of BT UART message

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-26 10:29:02 -08:00
Wey-Yi Guy 399f66fda0 iwlagn: split BT page and inquiry UART msg
Both inquiry and page was combine in frame7 of UART message, separate it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-26 10:28:56 -08:00
Wey-Yi Guy d7220f0d4f iwlagn: add BT Session Activity 2 UART message (BT -> WiFi)
additional UART message defines

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-26 10:28:47 -08:00
Wey-Yi Guy d6f626553d iwlagn: add bt config structure support for 2000 series
2000 series has different bt config command structure, add support for it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-26 10:28:41 -08:00
Wey-Yi Guy 5596026081 iwlagn: name change for BT config command
No functional changes, name changes to reflect the structure used by
6000 series.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-26 10:28:27 -08:00
Johannes Berg 850bedcc10 iwlagn: fix iwlagn_check_needed_chains
This function was intended to calculate the
number of RX chains needed, but could only
work where the AP's streams were asymmetric,
i.e. 2 TX and 3 RX or similar. In the case
where IEEE80211_HT_MCS_TX_RX_DIFF was not
set, this function would calculate the wrong
information.

Additionally, mac80211 didn't pass through
the required values at all, so it couldn't
work anyway.

Rewrite the logic in this function and add
appropriate comments to make it readable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-25 15:33:39 -05:00
Johannes Berg 7bb4568372 mac80211: make tx() operation return void
The return value of the tx operation is commonly
misused by drivers, leading to errors. All drivers
will drop frames if they fail to TX the frame, and
they must also properly manage the queues (if they
didn't, mac80211 would already warn).

Removing the ability for drivers to return a BUSY
value also allows significant cleanups of the TX
TX handling code in mac80211.

Note that this also fixes a bug in ath9k_htc, the
old "return -1" there was wrong.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Sedat Dilek <sedat.dilek@googlemail.com> [ath5k]
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> [rt2x00]
Acked-by: Larry Finger <Larry.Finger@lwfinger.net> [b43, rtl8187, rtlwifi]
Acked-by: Luciano Coelho <coelho@ti.com> [wl12xx]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-25 15:32:34 -05:00
Johannes Berg 6ebacbb79d mac80211: rename RX_FLAG_TSFT
The flag isn't very descriptive -- the intention
is that the driver provides a TSF timestamp at
the beginning of the MPDU -- make that clearer
by renaming the flag to RX_FLAG_MACTIME_MPDU.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-23 16:25:29 -05:00
John W. Linville 5db5e44cdc Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem 2011-02-22 15:10:22 -05:00
Fry, Donald H 41504cce24 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>
2011-02-21 11:50:03 -08:00
Wey-Yi Guy be663ab670 iwlwifi: split the drivers for agn and legacy devices 3945/4965
Intel WiFi devices 3945 and 4965 now have their own driver in the folder

	drivers/net/wireless/iwlegacy

Add support to build these drivers independently of the driver for
AGN devices. Selecting the 3945 builds iwl3945.ko and iwl_legacy.ko,
and selecting the 4965 builds iwl4965.ko and iwl_legacy.ko. iwl-legacy.ko
contains code shared between both devices.

The 3945 is an ABG/BG device, with no support for 802.11n. The 4965 is a 2x3
ABGN device.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Acked-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-21 11:27:26 -08:00
Wey-Yi Guy 4bc85c1324 Revert "iwlwifi: split the drivers for agn and legacy devices 3945/4965"
This reverts commit aa833c4b1a.
2011-02-21 11:11:05 -08:00
Wey-Yi Guy aa833c4b1a iwlwifi: split the drivers for agn and legacy devices 3945/4965
Intel WiFi devices 3945 and 4965 now have their own driver in the folder

	drivers/net/wireless/iwlegacy

Add support to build these drivers independently of the driver for
AGN devices. Selecting the 3945 builds iwl3945.ko and iwl_legacy.ko,
and selecting the 4965 builds iwl4965.ko and iwl_legacy.ko. iwl-legacy.ko
contains code shared between both devices.

The 3945 is an ABG/BG device, with no support for 802.11n. The 4965 is a 2x3
ABGN device.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Acked-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-21 10:57:10 -08:00
Wey-Yi Guy 73b78a2272 iwlwifi: enable 2-wire bt coex support for non-combo device
For non-combo devices, 2-wire BT coex is needed to make sure BT coex
still function with external BT devices

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-21 10:09:16 -08:00
Wey-Yi Guy 46d0637a12 iwlwifi: Loading correct uCode again when fail to load
During uCode loading, if the reply_alive come back with "failure",
try to load the same uCode again.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-21 10:08:38 -08:00
Wey-Yi Guy 491bc29276 iwlwifi: Limit number of firmware reload
If device has serious problem and cause firmware can not recover itself.
Keep reloading firmware will not help, it can only fill up the syslog and
lock up the system because busy reloading.

Introduce the limit reload counter, if the reload reach the maximum within
the pre-defined duration;stop the reload operation.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-21 10:08:15 -08:00
David S. Miller da935c66ba Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	Documentation/feature-removal-schedule.txt
	drivers/net/e1000e/netdev.c
	net/xfrm/xfrm_policy.c
2011-02-19 19:17:35 -08:00
John W. Linville b67afe7f43 Merge ssh://master.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts:
	drivers/bluetooth/ath3k.c
	drivers/bluetooth/btusb.c
2011-02-18 17:03:41 -05:00
David S. Miller 5d17920bd4 iwlwifi: Delete iwl3945_good_plcp_health.
Fixes this build warning:

drivers/net/wireless/iwlwifi/iwl-3945.c:411:13: warning: 'iwl3945_good_plcp_health' defined but not used

As per Johannes Berg.

Signed-off-by: David S. Miller <davem@davemloft.net>
2011-02-14 13:28:00 -08:00
David S. Miller 8bc26a008f Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-02-14 12:51:42 -08:00
Wey-Yi Guy caebbb7a4a iwlagn: handle bt defer work in 2000 series
For 2000 series, need to handle bt traffic changes when
receive notification from uCode

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-11 11:51:57 -08:00
Wey-Yi Guy c4197c6298 iwlagn: donot process bt update when bt coex disable
If bt coex is disabled, do not process any bt related information
from uCode even received.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-11 11:51:49 -08:00
Stanislaw Gruszka 67acad5fe5 iwlwifi: fix ack health for WiFi/BT combo devices
Combo devices have TX statistics on different place, because
struct statistics_rx_bt and struct statistics_rx have different
size. User proper values on combo devices instead of random data.

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>
2011-02-09 16:09:50 -05:00
Stanislaw Gruszka f266526da4 iwlwifi: cleanup iwl_good_ack_health
Make ack health code easies to read. Compared to previous
code, we do not print debug messages when expected_ack_cnt_delta == 0
and also do check against negative deltas.

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>
2011-02-09 16:09:49 -05:00
Stanislaw Gruszka ca3d938964 iwlwifi: cleanup iwl_recover_from_statistics
No functional change, make recover from statistics code
easies to read.

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>
2011-02-09 16:09:49 -05:00
Stanislaw Gruszka c91d01556f iwl3945: remove plcp check
Patch fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=654599

Many users report very low speed problem on 3945 devices,
this patch fixes problem, but only for some of them.

For unknown reason, sometimes after hw scanning, device is not able
to receive frames at high rate. Since plcp health check may request
hw scan to "reset radio", performance problem start to be observable
after update kernel to .35, where plcp check was introduced.

Bug reporter confirmed that removing plcp check fixed problem for him.

Reported-and-tested-by: SilvioTO <silviotoya@yahoo.it>
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>
2011-02-09 15:35:12 -05:00
David S. Miller 263fb5b1bf Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/e1000e/netdev.c
2011-02-08 17:19:01 -08:00
David S. Miller e0985f27dd Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-02-08 12:03:54 -08:00
Don Fry 3dd823e6b8 iwlagn: Re-enable RF_KILL interrupt when down
With commit 554d1d027b only one RF_KILL
interrupt will be seen by the driver when the interface is down.

Re-enable the interrupt when it occurs to see all transitions.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-07 16:02:14 -05:00
Wey-Yi Guy 80b38fffab iwlwifi: fix compiling error with different configuration
When .config has different configuration, it might fail to compile
iwlwifi. fix it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-06 09:31:00 -08:00
Johannes Berg 2f115cf24e iwlwifi: remove unnecessary locking
This code, and the places that set the variable
is_internal_short_scan and the vif pointers are
all protected by the mutex, there's no point in
locking the spinlock here as well (any more).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-02-06 09:30:54 -08:00
Wey-Yi Guy ff458edc0c iwlagn: overwrite EEPROM chain setting for 6250 devices
6250 2x2 devices have 2 tx chain and 2 rx chain. For some reason,
the EEPROM contain incorrect information and indicate it only has single
tx chain. overwrite it with .cfg parameter to make sure both chain 'A' and
chain 'B' can be used for transmit and receive

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-02-02 16:38:58 -05:00
Wey-Yi Guy c52bf9b73a iiwlagn: remove unused parameter
sco_cmd is not being used, remove it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:22:35 -08:00
Wey-Yi Guy 187bc4f6b2 iwlagn: remove unsupported BT SCO command
During the period of BT coex changes, REPLY_BT_COEX_SCO host command
is no longer needed to support SCO/eSCO type of traffic. delete it.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:22:25 -08:00
Wey-Yi Guy 96234cc84e iwlagn: use 2030 macro for 2030 devices
For 2030 series of devices, 2030 macro need to be used.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:22:13 -08:00
Johannes Berg 241887a2d3 iwlwifi: fix beacon notification parsing
The beacon notification changed between 4965 and
agn because the embedded TX response changed, but
iwlwifi was never updated to know about this.
Update it now so the IBSS manager status will be
tracked correctly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:19:39 -08:00
Johannes Berg 7b09068721 iwlwifi: use maximum aggregation size
Use the values from the peer to set up the ucode
for the right maximum number of subframes in an
aggregate. Since the ucode only tracks this per
station, use the minimum across all aggregation
sessions with this peer.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:19:32 -08:00
Johannes Berg 9b76883284 iwlwifi: advertise max aggregate size
Allow peers to size their reorder buffer more
accurately by advertising that we'll never send
aggregates longer than the default (31).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:19:24 -08:00
Johannes Berg 274102a8a2 iwlwifi: support RSN IBSS
In order to support RSN IBSS, we need to
(ok actually maybe it's just easiest to)
disable group key programming so that any
group-addressed frames will be decrypted
in software which handles the per-station
keys for this easily. We could keep the
encryption in the device, but that takes
more work and seems unnecessary.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:19:14 -08:00
Wey-Yi Guy 9dc2153315 iwlwifi: always support idle mode for agn devices
For agn devices, always support idle mode which help power
consumption in idle unassociated state.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:19:02 -08:00
Wey-Yi Guy 52e6b85fe0 iwlagn: add IQ inversion support for 2000 series devices
The I/Q swapping is extremely important and should be dealt with extra care.
It will affects OFDM and CCK differently.

For 6000/6005/6030 series devices, the I/Q were swapped, and for 2000 series
devices, it is in non-swapped status (but its swapped with respected to 6000/6005/6030).
so the CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER register need to be set to support
the correct behavior.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:17:53 -08:00
Wey-Yi Guy 7fc11e9bbe iwlagn: adjust rate table
Minor adjustment for rate scale table

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:17:43 -08:00
Wey-Yi Guy 10480b0566 iwlwifi: check ucode loading error and restart
Driver check alive message from ucode, if it is not ok, then need
to restart the loading process. instead of checking multiple places
for failure, only need to check in once place when receive alive
message from uCode.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-31 13:17:28 -08:00
Stanislaw Gruszka 5a3a0352f3 iwlwifi: correct frequency settings
After commit 59eb21a650
"cfg80211: Extend channel to frequency mapping for 802.11j"
we use uninitialized sband->band when assign channel frequencies, what
results that 5GHz channels have erroneous (zero) center_freq value.

Patch fixes problem and simplifies code a bit.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-31 15:06:25 -05:00
Stanislaw Gruszka d828cd5a95 iwl3945: do not use agn specific IWL_RATE_COUNT
Only use IWL_RATE_COUNT_3945 in 3945 code.

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>
2011-01-31 15:06:21 -05:00
John W. Linville 3e11210d46 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts:
	drivers/net/wireless/ath/ath9k/init.c
2011-01-28 16:23:14 -05:00
Stanislaw Gruszka 9f60e7ee42 iwlwifi: introduce iwl_bt_statistics
We use priv->cfg->bt_params && priv->cfg->bt_params->bt_statistics
conditional in few places, merge it into one function.

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>
2011-01-28 15:46:25 -05:00
Stanislaw Gruszka 8c9f514b38 iwlwifi: remove unneeded disable_hw_scan check
We never set STATUS_SCANNING in softwre scanning mode, disable_hw_scan
check is unneeded. Correct debug message while at it.

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>
2011-01-28 15:46:25 -05:00
Stanislaw Gruszka 88e58fc5d9 iwlwifi: introduce iwl_advanced_bt_coexist()
We use priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist
conditional in few places, merge it into one function.

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>
2011-01-28 15:46:24 -05:00
Stanislaw Gruszka a839cf6955 iwlwifi: remove unneeded __packed
struct iwl_queue is not part of firmware interface, so __packed is not
needed. Remove it since is may affect performance.

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>
2011-01-28 15:46:24 -05:00
Stanislaw Gruszka 5a5289dfa5 iwl3945: set STATUS_READY before commit_rxon
Similar change as we already do for agn, need to avoid
"Error setting Tx power (-5)" message when loading module.

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>
2011-01-28 15:46:24 -05:00
Stanislaw Gruszka f844a709a7 iwlwifi: do not set tx power when channel is changing
Mac80211 can request for tx power and channel change in one ->config
call. If that happens, *_send_tx_power functions will try to setup tx
power for old channel, what can be not correct because we already change
the band. I.e  error  "Failed to get channel info for channel 140 [0]",
can be printed frequently when operating in software scanning mode.

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>
2011-01-28 15:46:24 -05:00
David S. Miller 9b6941d8b1 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-01-26 11:49:49 -08:00
Wey-Yi Guy f35c0c5609 iwlwifi: initial P2P support
If PAN functionality is present, advertise
P2P interface type support and thus support
for P2P. However, the support is currently
somewhat incomplete -- NoA schedule isn't
added to probe responses, and 11b bitrates
may be used still, etc. Therefore, make it
all optional with a Kconfig option.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:51:16 -08:00
Johannes Berg 940739196c iwlwifi: replace minimum slot time constant
There are a number of places where the minimum
slot time is hardcoded to 20 TU, add a new
constant for that and use it everywhere.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:51:08 -08:00
Johannes Berg 9b9190d968 iwlwifi: implement remain-on-channel
For device supporting PAN/P2P, use the PAN
context to implement the remain-on-channel
operation using device offloads so that the
filters in the device will be programmed
correctly -- otherwise we cannot receive
any probe request frames during off-channel
periods.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2011-01-21 15:50:58 -08:00
Meenakshi Venkataraman 9d4dea7259 iwlagn: Enable idle powersave mode in 1000 series
The iwlagn powersave algorithm uses the supports_idle parameter
to tell the device to save power when it is not associated with
an AP and is idle.

Enable this feature for the 1000 series of devices.

Reported-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:50:46 -08:00
Jay Sternberg 24834d2c84 iwlwifi: correct debugfs data dumped from sram
the sram data dumped through the debugfs interface would only work properly
when dumping data on even u32 boundaries and swap bytes based on endianness
on that boundary making byte arrays impossible to read.

now addresses are displayed at the start of every line and the data is
displayed consistently if dumping 1 byte or 20 and regardless of what is the
starting address.

if no lenght given, address displayed is u32 in device format

Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:50:33 -08:00
Wey-Yi Guy fcdf1f73fe iwlwifi: add hw rev for 2000 series devices
2000 series device has different HW rev, add it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:50:23 -08:00
Wey-Yi Guy 14a75766f3 iwlwifi: remove g2 from csr hw rev
Remove refernce of g2 and use offical number for hw rev.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:49:44 -08:00
Wey-Yi Guy 52d8a50c39 iwlagn: remove Gen2 from Kconfig
Remove Gen 2 from Kconfig file since 6005/6030/6150 series of
products are released.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:49:35 -08:00
Wey-Yi Guy d380cbceea iwlagn: add 2000 series to Kconfig
Add 2000 series support to Kconfig

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:49:26 -08:00
Wey-Yi Guy 04b8e75100 iwlagn: add 2000 series pci id
Add PCI ID supports for all 2000 series devices

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:48:51 -08:00
Wey-Yi Guy c5a5e1853a iwlagn: 2000 series devices support
Adding 2000 series devices supports, the 2000 series devices has
many different SKUs which includes 1x1 and 2x2 devices,also with
and without BT combo.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:47:21 -08:00
Wey-Yi Guy fa57980e40 iwlagn: add 2000 series EEPROM version
Adding EEPROM version for 2000 series devices

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:28:55 -08:00
Wey-Yi Guy 1956e1ad62 iwlagn: remove reference to gen2a and gen2b
Since 6005, 6030 and 6150 series are offical released, remove the reference
to gen2x and use the product number instead.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:28:40 -08:00
Wey-Yi Guy 5ed540aecc iwlwifi: use mac80211 throughput trigger
Instead of keeping track of LED blink speed
in the driver, use the new mac80211 trigger
and link it up with an LED classdev that we
now register. This also allows users more
flexibility in how they want to have the LED
blink or not.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-01-21 15:26:39 -08:00
Bruno Randolf 59eb21a650 cfg80211: Extend channel to frequency mapping for 802.11j
Extend channel to frequency mapping for 802.11j Japan 4.9GHz band, according to
IEEE802.11 section 17.3.8.3.2 and Annex J. Because there are now overlapping
channel numbers in the 2GHz and 5GHz band we can't map from channel to
frequency without knowing the band. This is no problem as in most contexts we
know the band. In places where we don't know the band (and WEXT compatibility)
we assume the 2GHz band for channels below 14.

This patch does not implement all channel to frequency mappings defined in
802.11, it's just an extension for 802.11j 20MHz channels. 5MHz and 10MHz
channels as well as 802.11y channels have been omitted.

The following drivers have been updated to reflect the API changes:
iwl-3945, iwl-agn, iwmc3200wifi, libertas, mwl8k, rt2x00, wl1251, wl12xx.
The drivers have been compile-tested only.

Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: Brian Prodoehl <bprodoehl@gmail.com>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-21 15:34:17 -05:00
Johannes Berg ea67485ae6 iwlwifi: fix 4965 notification wait setup
The notification wait support code is shared
between 4965 and other AGN devices, so 4965
also has to initialize the data structures
for it, otherwise it crashes.

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>
2011-01-21 15:32:21 -05:00
Johannes Berg 2a1a78d240 iwlagn: return error if PAN disable timeout
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>
2011-01-21 15:32:21 -05:00
Johannes Berg 311dce71b6 iwlagn: properly wait for PAN disable
Previously I hacked this with an msleep(300)
which was fine since we never had longer PAN
time slots, but now that we will have them I
need to fix that. Use the new notification
wait support to properly wait for the WIPAN
deactivation complete signal from the ucode.

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>
2011-01-21 15:32:21 -05:00
Johannes Berg 7194207cee iwlagn: add support for waiting for notifications
In order to implement waiting for notifications,
add a structure that captures the information,
and a list of such structures that will be
traversed when a command is received from the
ucode.

Use sparse checking to make sure calls to the
prepare/wait/cancel functions are always nested
correctly.

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>
2011-01-21 15:32:20 -05:00
Johannes Berg f945f1087f iwlagn: make iwl_rx_handle static
It's not used or likely to be needed from other
files, so it can be static.

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>
2011-01-21 15:32:20 -05:00
Wey-Yi Guy 239712ebb2 iwlwifi: don't read sku information from EEPROM for 4965
For all the new devices, the sku information should read from EEPROM
but for legacy devices such as 4965, appearly the EEPROM does not
contain the necessary information. so skip the read from EEPROM
and go back to use software configuration.

Reported-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Tested-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-21 15:05:57 -05:00
Linus Torvalds 1268afe676 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (41 commits)
  sctp: user perfect name for Delayed SACK Timer option
  net: fix can_checksum_protocol() arguments swap
  Revert "netlink: test for all flags of the NLM_F_DUMP composite"
  gianfar: Fix misleading indentation in startup_gfar()
  net/irda/sh_irda: return to RX mode when TX error
  net offloading: Do not mask out NETIF_F_HW_VLAN_TX for vlan.
  USB CDC NCM: tx_fixup() race condition fix
  ns83820: Avoid bad pointer deref in ns83820_init_one().
  ipv6: Silence privacy extensions initialization
  bnx2x: Update bnx2x version to 1.62.00-4
  bnx2x: Fix AER setting for BCM57712
  bnx2x: Fix BCM84823 LED behavior
  bnx2x: Mark full duplex on some external PHYs
  bnx2x: Fix BCM8073/BCM8727 microcode loading
  bnx2x: LED fix for BCM8727 over BCM57712
  bnx2x: Common init will be executed only once after POR
  bnx2x: Swap BCM8073 PHY polarity if required
  iwlwifi: fix valid chain reading from EEPROM
  ath5k: fix locking in tx_complete_poll_work
  ath9k_hw: do PA offset calibration only on longcal interval
  ...
2011-01-19 20:25:45 -08:00
Johannes Berg 0b01f030d3 mac80211: track receiver's aggregation reorder buffer size
The aggregation code currently doesn't implement the
buffer size negotiation. It will always request a max
buffer size (which is fine, if a little pointless, as
the mac80211 code doesn't know and might just use 0
instead), but if the peer requests a smaller size it
isn't possible to honour this request.

In order to fix this, look at the buffer size in the
addBA response frame, keep track of it and pass it to
the driver in the ampdu_action callback when called
with the IEEE80211_AMPDU_TX_OPERATIONAL action. That
way the driver can limit the number of subframes in
aggregates appropriately.

Note that this doesn't fix any drivers apart from the
addition of the new argument -- they all need to be
updated separately to use this variable!

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-19 11:36:11 -05:00
Wey-Yi Guy 38d59392b2 iwlwifi: fix valid chain reading from EEPROM
When read valid tx/rx chains from EEPROM, there is a bug to use the
tx chain value for both tx and rx, the result of this cause low
receive throughput on 1x2 devices becuase rx will only utilize single
chain instead of two chains

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-18 15:10:31 -05:00
Linus Torvalds 008d23e485 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
  Documentation/trace/events.txt: Remove obsolete sched_signal_send.
  writeback: fix global_dirty_limits comment runtime -> real-time
  ppc: fix comment typo singal -> signal
  drivers: fix comment typo diable -> disable.
  m68k: fix comment typo diable -> disable.
  wireless: comment typo fix diable -> disable.
  media: comment typo fix diable -> disable.
  remove doc for obsolete dynamic-printk kernel-parameter
  remove extraneous 'is' from Documentation/iostats.txt
  Fix spelling milisec -> ms in snd_ps3 module parameter description
  Fix spelling mistakes in comments
  Revert conflicting V4L changes
  i7core_edac: fix typos in comments
  mm/rmap.c: fix comment
  sound, ca0106: Fix assignment to 'channel'.
  hrtimer: fix a typo in comment
  init/Kconfig: fix typo
  anon_inodes: fix wrong function name in comment
  fix comment typos concerning "consistent"
  poll: fix a typo in comment
  ...

Fix up trivial conflicts in:
 - drivers/net/wireless/iwlwifi/iwl-core.c (moved to iwl-legacy.c)
 - fs/ext4/ext4.h

Also fix missed 'diabled' typo in drivers/net/bnx2x/bnx2x.h while at it.
2011-01-13 10:05:56 -08:00
John W. Linville 6303710d7a Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-01-05 14:35:41 -05:00
Stanislaw Gruszka cd017f25e3 iwlagn: fix scan tx antenna setting on 5Ghz band
Looks that we do not set correctly antennas when scanning
on 5Ghz band and when bluetooth is enabled, because
priv->cfg->scan_tx_antennas[band] is only defined for
IEEE80211_BAND_2GHZ.

To fix we check band before limiting antennas to first one.
This allow to remove hard coded cfg->scan_tx_antennas[band].

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>
2011-01-04 14:35:11 -05:00
Stanislaw Gruszka 554d1d027b iwlagn: enable only rfkill interrupt when device is down
Since commit 6cd0b1cb87 "iwlagn: fix
hw-rfkill while the interface is down", we enable interrupts when
device is not ready to receive them. However hardware, when it is in
some inconsistent state, can generate other than rfkill interrupts
and crash the system. I can reproduce crash with "kernel BUG at
drivers/net/wireless/iwlwifi/iwl-agn.c:1010!" message, when forcing
firmware restarts.

To fix only enable rfkill interrupt when down device and after probe.
I checked patch on laptop with 5100 device, rfkill change is still
passed to user space when device is down.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: stable@kernel.org
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-04 14:15:08 -05:00
Justin P. Mattock 62e45c14fb wireless: comment typo fix diable -> disable.
The below patch fixes a typo "diable" to "disable". Please let me know if this
is correct or not.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-01-03 16:05:53 +01:00
Wey-Yi Guy 003ea98195 iwlwifi: remove reference to Gen2
The correct name should be used for the newer devices, remove
reference to Gen2

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-26 10:09:02 -08:00
Johannes Berg bdb84fec61 iwlagn: fix FH error
# iw wlan0 interface add moni0 type monitor flags control
# ip link set moni0 up

causes a continuous spew of FH_ERROR from the
device. Fix this by not setting the CTL2HOST
filter by itself -- CTL + promisc works fine.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-26 10:08:48 -08:00
Wey-Yi Guy e88735d711 iwlwifi: remove extra string
For "led_mode" module parameters, string "led_mode" is duplicated twice,
remove one.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-26 10:01:04 -08:00
Jiri Kosina 4b7bd36470 Merge branch 'master' into for-next
Conflicts:
	MAINTAINERS
	arch/arm/mach-omap2/pm24xx.c
	drivers/scsi/bfa/bfa_fcpim.c

Needed to update to apply fixes for which the old branch was too
outdated.
2010-12-22 18:57:02 +01:00
Sedat Dilek 7d5f01ad53 iwlwifi: Fix error: struct iwl_lq_sta has no member named dbg_fixed_rate
While compiling linux-next (next-20101216) I fell over this breakage:
...
drivers/net/wireless/iwlwifi/iwl-agn-rs.c: In function ‘iwl_rs_rate_init’:
drivers/net/wireless/iwlwifi/iwl-agn-rs.c:2876:8: error: ‘struct iwl_lq_sta’ has no member named ‘dbg_fixed_rate’

dbg_fixed_rate is only used when CONFIG_MAC80211_DEBUGFS is set:

[ drivers/net/wireless/iwlwifi/iwl-agn-rs.h ]
...
 #ifdef CONFIG_MAC80211_DEBUGFS
       struct dentry *rs_sta_dbgfs_scale_table_file;
       struct dentry *rs_sta_dbgfs_stats_table_file;
       struct dentry *rs_sta_dbgfs_rate_scale_data_file;
       struct dentry *rs_sta_dbgfs_tx_agg_tid_en_file;
       u32 dbg_fixed_rate;
 #endif

The issue was introduced by commit a1da077bc3:
"iwlwifi: clear dbg_fixed_rate during init"

Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-16 09:47:02 -05:00
Sujith Manoharan bd2ce6e43f mac80211: Add timeout to BA session start API
Allow drivers or rate control algorithms to specify BlockAck session
timeout when initiating an ADDBA transaction. This is useful in cases
where maintaining persistent BA sessions does not incur any overhead.

The current timeout value of 5000 TUs is retained for all non ath9k/ath9k_htc
drivers.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-15 17:03:59 -05:00
Wey-Yi Guy 14a085e770 iwlagn: fix witespace damage
patch "iwlagn: check ready in iwlagn_bss_info_changed()" introduce
whitespace, fix it

please merge with the previous patch

Reported 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>
2010-12-15 17:03:55 -05:00
Wey-Yi Guy 65af8dea26 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>
2010-12-13 15:53:54 -08:00
Wey-Yi Guy f21dd005df iwlwifi: keep track of bt coex enable/disable stage
For debugging purpose, keep track of the bt coex enable/disable state.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:53:38 -08:00
Wey-Yi Guy 50619ac9ba 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>
2010-12-13 15:53:24 -08:00
Wey-Yi Guy 33c68770a8 iwlagn: More detail tx power logging
For enhanced tx power table in EEPROM, add more detail logging
to help debugging

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:53:09 -08:00
Wey-Yi Guy d058ff8b92 iwlwifi: use IWL_DEBUG_EEPROM for EEPROM related info
For logging EEPROM related info, instead of using IWL_DEBUG_INFO,
use the dedicated logging (IWL_DEBUG_EEPROM) for easier debugging

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:52:53 -08:00
Wey-Yi Guy fb4c32bba1 iwlwifi: add new EEPROM debug log type
Adding new debug type to log EEPROM related data

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:52:39 -08:00
Johannes Berg c6fc108776 iwlagn: remove old EEPROM TX power reading
This removes the old TX power reading code, it isn't
necessary since the new code is able to read all the
various EEPROM layouts due to relying on information
contained in the EEPROM.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:52:23 -08:00
Johannes Berg 8d6748ca73 iwlagn: implement layout-agnostic EEPROM reading
The current EEPROM reading code has some layout
assumptions that now turned out to be false with
some newer versions of the EEPROM. Luckily, we
can avoid all such assumptions by using data in
the EEPROM itself, so implement using that.

However, for risk mitigation purposes, keep the
old reading code for current hardware for now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:52:11 -08:00
Johannes Berg e7362a0069 iwlagn: rename enhanced txpower fields
Some fields we didn't previously use from the
enhanced TX power structure will be needed in
the next patch, so rename them to their correct
names to be able to use them and change code
reading them accordingly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:51:58 -08:00
Wey-Yi Guy 17423ea877 iwlagn: rx antenna diversity
For the new 1x1 devices, hw and uCode will support rx
antenna diversity, but we need to indicate 1x1 device to
AccessPoint to make sure it won't use MIMO.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:51:44 -08:00
Johannes Berg 9decde95be iwlagn: fix debug variable access
The compiler correctly warns:
iwl-agn-tx.c: In function ‘iwlagn_tx_status_reply_compressed_ba’:
iwl-agn-tx.c:1240: warning: ‘bitmap’ may be used uninitialized in this function

Move the debug print to the branch that reads the
bitmap, and move the variables too so it's more
obvious where they are needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:51:33 -08:00
Shanyu Zhao ae0b693c12 iwlagn: check ready in iwlagn_bss_info_changed()
In function iwlagn_bss_info_changed(), we need to check if the driver
is ready before doing real work. Also, the previously put WARN() is
removed because the vif is not guaranteed to be valid. uCode restart
routine will clear the vif.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:51:18 -08:00
Shanyu Zhao a1da077bc3 iwlwifi: clear dbg_fixed_rate during init
This prevent bad fixed_rate keeps crashing uCode in an endless loop.

Signed-off-by: Shanyu Zhao <shanyu.zhao@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:51:01 -08:00
Wey-Yi Guy 4fb33244d1 iwlagn: change led compensation for 6005 and 6030 devices
For both 6005 and 6030 devices, change the led compensation to 57

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-13 15:50:44 -08:00
Wey-Yi Guy 6942fec92d iwlagn: implement layout-agnostic EEPROM reading
From: Johannes Berg <johannes.berg@intel.com>

The current EEPROM reading code has some layout
assumptions that now turned out to be false with
some newer versions of the EEPROM. Luckily, we
can avoid all such assumptions by using data in
the EEPROM itself, so implement using that.

However, for risk mitigation purposes, keep the
old reading code for current hardware for now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-09 10:09:14 -08:00
Johannes Berg cbf68a668d iwlagn: rename enhanced txpower fields
Some fields we didn't previously use from the
enhanced TX power structure will be needed in
the next patch, so rename them to their correct
names to be able to use them and change code
reading them accordingly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-09 09:51:48 -08:00
Stanislaw Gruszka 22de94de7d 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>
2010-12-06 16:01:29 -05:00
Stanislaw Gruszka abc471dc31 iwl3945: prevent too frequent firmware resets
Similarly like on iwlagn, initialize reset duration on iwl3945 to prevent
too frequent firmware resets.

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>
2010-12-06 16:01:29 -05:00
Wey-Yi Guy 9f28ebc381 iwlagn: name change for bt_ch_announce module parameter
Change the module parameter name to bt_ch_inhibition from
bt_ch_announce to better describe the functionality

In order to allow Bluetooth to activate a smart AFH mechanism
and to maximize its available bandwidth the WiFi will request
BT Core to inhibit its activity in channels that interfere
with WiFi activity (and vice versa) if bt_ch_inhibition is enabled

Set module parameter "bt_ch_inhibition=0" will disable the channel
inhibition function

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-02 08:35:34 -08:00
Wey-Yi Guy adb90a0037 iwlwifi: check for STATUS_EXIT_PENDING when send RXON command
If driver is on the way down, there is no need to send
RXON to uCode, check the condition before continuous the process.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-02 08:35:23 -08:00
Wey-Yi Guy 8b3ee29626 iwlagn: remove structure name reference to gen2
Give the corresponding name for .cfg data structure

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-02 08:35:12 -08:00
Grumbach, Emmanuel e7cad69cda iwlagn: Enable PCI L1 ACTIVE state after uCode has been loaded
PCI L1 Active needs to be disabled while loading the uCode so that the bus
doesn't go to sleep. The enablement of L1 Active should be done after
the uCode has sent the ALIVE response. The enablement of L1 Active was
missing.
Enabling L1 Active allows to save power if the BIOS / bus driver allows
it.

I measured the power consumption while not associated and
idle/associated:
L1 Active disabled: 39 mA = 130mW
L1 Active enabled:   6 mA = 20 mW

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-02 08:35:02 -08:00
Wey-Yi Guy 40b97c2fe9 iwlagn: fix race condition when reprogram sta
During reprogram stations, do not send link quality command.
uCode will crash if receive link quality command for invalid station

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2010-12-02 08:34:54 -08:00