Commit graph

2609 commits

Author SHA1 Message Date
Wey-Yi Guy 6dc0c7fc7c iwlagn: remove unused old_assoc parameter
old_assoc not used, remove it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13 12:03:17 -07:00
Johannes Berg 51b7ef058c iwlagn: change default beacon interval
When the PAN context is active, but unused, it
may still block scans that take more dwell time
than its beacon interval (which is odd). Work
around this problem by using a default beacon
interval of 200 so scans will fit between.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13 12:03:08 -07:00
Johannes Berg 70817b5e14 iwlagn: remove set but unused vars
gcc is warning that a few variables in rate
scaling are set but never otherwise used.
This pointed out a few simplifications.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13 12:02:59 -07:00
Wey-Yi Guy 3083d03c21 iwlagn: alwasy send RXON with disassociate falge before associate
Before send the RXON command with associated flag set, always do disassociate
first to make sure uCode is in the correct state.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13 12:02:49 -07:00
Wey-Yi Guy dd5c940b42 iwlagn: clear STATUS_HCMD_ACTIVE bit if fail enqueue
If fail to enqueue host command, clear the STATUS_hcmD_ACTIVE bit

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13 12:02:40 -07:00
Wey-Yi Guy 6489854b9c iwlagn: add testmode set fixed rate command
Add support in testmode for setting fixed rate

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13 12:02:20 -07:00
Wey-Yi Guy 4babc358c0 iwlagn: add eeprom command to testmode
Add the capability to dump eeprom through testmode request

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13 12:02:11 -07:00
Wey-Yi Guy 7a4e5281d1 iwlagn: add testmode trace command
Adding testmode trace/debug capability

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13 12:02:02 -07:00
Wey-Yi Guy 5065054790 iwlagn: more ucode error log info
No functional changes, just logging more information when uCode crash, also
change change the format.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13 12:01:50 -07:00
Johannes Berg 4ce7cc2b09 iwlagn: support multiple TBs per command
The current "huge" command handling is a bit
confusing, and very limited since only one
command may be huge at a time. Additionally,
we often copy data around quite pointlessly
since we could instead map the existing scan
buffer for example and use it directly.

This patch makes that possible. The first
change is that multiple buffers may be given
to each command (this change was prepared
earlier so callsites don't need to change).
Each of those can be mapped attached to a TB
in the TFD, and the command header can use a
TB (the first one) in the TFD as well.

Doing this allows getting rid of huge commands
in favour of mapping existing buffers. The
beacon transmission is also optimised to not
copy the SKB at all but use multiple TBs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13 12:00:41 -07:00
Johannes Berg 4c42db0f04 iwlagn: remove unused pad argument
The pad argument to iwlagn_txq_free_tfd
isn't used, remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-13 10:32:18 -07:00
Johannes Berg 214d14d4d3 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>
2011-05-13 10:32:04 -07:00
Johannes Berg 3fa507386d 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>
2011-05-13 10:31:52 -07:00
Johannes Berg 054ec92494 iwlagn: fix iwl_is_any_associated
The function iwl_is_any_associated() was intended
to check both contexts, but due to an oversight
it only checks the BSS context. This leads to a
problem with scanning since the passive dwell
time isn't restricted appropriately and a scan
that includes passive channels will never finish
if only the PAN context is associated since the
default dwell time of 120ms won't fit into the
normal 100 TU DTIM interval.

Fix the function by using for_each_context() and
also reorganise the other functions a bit to take
advantage of each other making the code easier to
read.

Cc: stable@kernel.org
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-05-10 15:54:45 -04:00
Wey-Yi Guy 3782cf4a04 iwlagn: led stay solid on when no traffic
commit 5ed540aecc change the led behavior
for iwlwifi driver; the side effect cause led blink all the time.

Modify the led blink table to fix this problem

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-10 15:54:43 -04:00
Johannes Berg 2c46f72e06 iwlagn: check DMA mapping errors
DMA mappings can fail, but the current code
doesn't check for that. Add checking, which
requires some restructuring for proper error
paths.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-06 10:46:23 -07:00
Johannes Berg 94b00658ff 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>
2011-05-06 10:46:17 -07:00
Johannes Berg ccb6c1c0ec iwlagn: dont update bytecount table for command queue
The device doesn't use the bytecount table for the
command queue, only for aggregation queues to make
aggregation decisions. So don't update it for the
command queue (and we even updated it with wrong
values).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-06 10:46:07 -07:00
Johannes Berg 4c2cde3b59 iwlagn: remove unused variable
The variable 'len' here is set but never used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-06 10:45:58 -07:00
Johannes Berg 8a98d49ec1 iwlagn: remove frame pre-allocation
The frame pre-allocation is quite a bit of complex
code, all to avoid a single allocation. Remove it
and consolidate the beacon sending code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-06 10:45:53 -07:00
Johannes Berg 46975f78fe iwlagn: remove get_hcmd_size indirection
There's no need for this, all commands are the right size.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-06 10:45:46 -07:00
Cindy H. Kao 4613e72dbd iwlwifi: support the svtool messages interactions through nl80211 test mode
This patch adds the feature to support the test mode operation through
the generic netlink channel NL80211_CMD_TESTMODE between intel
wireless device iwlwifi and the user space application svtool.

The main purpose is to create a transportation layer between the iwlwifi
device and the user space application so that the interaction between the
user space application svtool and the iwlwifi device in the kernel space is
in a way of generic netlink messaging.

The detail specific functions are:

1. The function iwl_testmode_cmd() is added to digest the svtool test command
   from the user space application. The svtool test commands are categorized  to
   three types : commands to be processed by the device ucode, commands to access
   the registers, and commands to be processed at the driver level(such as reload
   the ucode). iwl_testmode_cmd() dispatches the commands the corresponding handlers
   and reply to user space regarding the command execution status. Extra data is
   returned to the user space application if there's any.

2. The function iwl_testmode_ucode_rx_pkt() is added to multicast all the spontaneous
   messages from the iwlwifi device to the user space. Regardless the message types,
   whenever there is a valid spontaneous message received by the iwlwifi ISR,
   iwl_testmode_ucode_rx_pkt() is invoked to multicast the message content to user
   space. The message content is not attacked and the message parsing is left to
   the user space application.

Implementation guidelines:

1. The generic netlink messaging for iwliwif test mode is through  NL80211_CMD_TESTMODE
   channel, therefore, the codes need to follow the regulations set by cfg80211.ko
   to get the actual device instance ieee80211_ops via cfg80211.ko, so that the iwlwifi
   device is indicated with ieee80211_ops and can be actually accessed.

   Therefore, a callback iwl_testmode_cmd() is added to the structure
   iwlagn_hw_ops in iwl-agn.c.

2. It intends to utilize those low level device access APIs from iwlwifi device driver
   (ie. iwlagn.ko) rather than creating it's own set of device access functions.
   For example, iwl_send_cmd(), iwl_read32(), iwl_write8(), and iwl_write32() are reused.

3. The main functions are maintained in new files instead of spreading all over the
   existing iwlwifi driver files.

   The new files added are :

   drivers/net/wireless/iwlwifi/iwl-sv-open.c
        - to handle the user space test mode application command
          and reply the respective command status to the user space application.
        - to multicast the spontaneous messages from device to user space.

   drivers/net/wireless/iwlwifi/iwl-testmode.h
        - the commonly referenced definitions for the TLVs used in
          the generic netlink messages

Signed-off-by: Cindy H. Kao <cindy.h.kao@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-05-06 10:44:46 -07:00
David S. Miller 7143b7d412 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/tg3.c
2011-05-05 14:59:02 -07:00
John W. Linville a70171dce9 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts:
	drivers/net/wireless/libertas/if_cs.c
	drivers/net/wireless/rtlwifi/pci.c
	net/bluetooth/l2cap_sock.c
2011-05-05 13:32:35 -04:00
David S. Miller badb02953a Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-05-02 12:21:47 -07:00
Wey-Yi Guy d6d023a194 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>
2011-04-30 09:10:53 -07:00
Johannes Berg ebf8dc8060 iwlagn: prefer BSS context
If an interface type changes from a type that is
only supported on the PAN context (e.g. P2P GO)
to a type that is supported on the BSS context,
and the BSS context is not in use, then we need
to use the BSS context instead of changing the
device type within the context. To achieve this,
refuse the type change, which causes a down/up
cycle that will allocate the BSS context for the
interface.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-30 08:57:32 -07:00
Johannes Berg c914ac26ca iwlagn: improve RXON checking
The current RXON checking doesn't verify that
the channel is valid (or at least non-zero),
so add that. Also, add a WARN() so we get a
stacktrace, and capture a bitmask of errors
in order to capture all necessary information
in the warning itself (in case the previous
messages are snipped off.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-30 08:57:22 -07:00
Johannes Berg bbf18ff1be iwlagn: remove spectrum measurement header
This header file isn't used, and if we ever need
these definitions they shouldn't be added to a
driver but rather to the common 802.11 include
file that has all frame definitions. Thus, just
remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-30 08:57:13 -07:00
Don Fry 16b80b714f 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>
2011-04-30 08:56:59 -07:00
Don Fry 9d143e9a0d 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>
2011-04-30 08:56:45 -07:00
Wey-Yi Guy b4ed221dab iwlagn: new 105 series device
Correction for new 105 series devices

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-30 08:55:16 -07:00
Johannes Berg d2690c0db7 iwlagn: use proper good CRC threshold behaviour
New microcode versions use the good CRC threshold
field differently, as a flag, and in that case we
should set it to 1/0 instead of 1/65535 for an
active/passive scan.

The new behaviour is advertised by the uCode with
a feature flag.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-30 08:40:14 -07:00
Wey-Yi Guy c1821c95c1 iwlagn: connect and disconnect sequence for RXON
No functional changes, separate the connect and disconnect sequences in
RXON commit function, easier to read and understand.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-30 08:40:04 -07:00
Wey-Yi Guy 89e746b244 iwlagn: remove 5000 from rxon_assoc structure
The data structure is shared by all _agn devices, remove the reference to 5000

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-30 08:39:53 -07:00
Wey-Yi Guy c3f6e9cff9 iwlagn: make rxon_assoc static function
Move rxon_assoc to static function from ops

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-30 08:39:44 -07:00
Johannes Berg e43e85c40d iwlagn: refactor restart
The WoWLAN resume code will have to essentially
do a restart, but without going through the work
struct. To support that, refactor the restart by
splitting out the preparation code into a new
function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-30 08:39:30 -07:00
Johannes Berg 4119904f3e iwlagn: introduce silent grabbing of NIC access
There are a few cases like the WoWLAN support
I'm writing that require attempting to access
the NIC when it is known that it might not be
accessible, e.g. after the system woke up and
the platform might have reset the device.

To avoid messages in this case, introduce the
new function iwl_grab_nic_access_silent(), it
will only return an error status.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-30 08:39:22 -07:00
Johannes Berg 9d39e5bad7 iwlagn: avoid hangs when restarting device
If a device error happens while the uCode is
being loaded or initialised, we will attempt
to restart the device (which will likely fail
again, but that's not the issue here). During
this new restart, we turn off the device, but
as the uCode failed to initialise it already
is turned off. As a consequence, grabbing NIC
access will fail and cause excessive messages
and hangs.

To fix this issue, introduce a new status bit
and only attempt to reprogram the device when
it isn't already disabled.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-30 08:39:12 -07:00
Stanislaw Gruszka 75d80cadf4 iwlagn: fix tx power initialization
Since

commit f844a709a7
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date:   Fri Jan 28 16:47:44 2011 +0100

    iwlwifi: do not set tx power when channel is changing

we set device tx power during initialization to priv->tx_power_next,
which itself is initialized to minimum power. That changed
default behaviour of driver. Previously we initialized device to
transmit at maximum available power by default. Patch change again
to previous behaviour and cleanup tx power initialization.

Fortunately this is not critical fix, as mac80211 layer setup
tx power lately to 14dB, hence device does not operate at minimal
transmit power all the time.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-29 15:36:13 -04:00
Stanislaw Gruszka bfd36103ec iwlagn: fix "Received BA when not expected"
Need to use broadcast sta_id for management frames, otherwise we broke
BA session in the firmware and get messages like that:

"Received BA when not expected"

or (on older kernels):

"BA scd_flow 0 does not match txq_id 10"

This fix regression introduced in 2.6.35 during station management
code rewrite by:

commit 2a87c26bbe
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Fri Apr 30 11:30:45 2010 -0700

    iwlwifi: use iwl_find_station less

Patch partially resolve:
https://bugzilla.kernel.org/show_bug.cgi?id=16691
However, there are still 11n performance problems on 4965 and 5xxx
devices that need to be investigated.

Cc: stable@kernel.org # 2.6.35+
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-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-04-29 15:24:15 -04:00
John W. Linville 429576b97c Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-04-26 15:39:10 -04:00
David S. Miller 2bd93d7af1 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Resolved logic conflicts causing a build failure due to
drivers/net/r8169.c changes using a patch from Stephen Rothwell.

Signed-off-by: David S. Miller <davem@davemloft.net>
2011-04-26 12:16:46 -07:00
Joe Perches 85ee7a1d39 treewide: cleanup continuations and remove logging message whitespace
Using C line continuation inside format strings is error prone.
Clean up the unintended whitespace introduced by misuse of \.
Neaten correctly used line continations as well for consistency.

drivers/scsi/arcmsr/arcmsr_hba.c has these errors as well,
but arcmsr needs a lot more work and the driver should likely be
moved to staging instead.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-26 10:24:37 +02:00
Jiri Kosina 07f9479a40 Merge branch 'master' into for-next
Fast-forwarded to current state of Linus' tree as there are patches to be
applied for files that didn't exist on the old branch.
2011-04-26 10:22:59 +02:00
Stanislaw Gruszka 2624e96ce1 iwlwifi: fix possible data overwrite in hcmd callback
My commit 3598e1774c
"iwlwifi: fix enqueue hcmd race conditions" move hcmd callback after
command queue reclaim, to avoid call it with hcmd_lock. But since
queue read index was updated, cmd data can be overwritten. Fix problem
by calling callback before taking hcmd_lock and queue reclaim.

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-25 14:50:15 -04:00
John W. Linville cfef6047c4 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts:
	drivers/net/wireless/iwlwifi/iwl-core.c
	drivers/net/wireless/rt2x00/rt2x00queue.c
	drivers/net/wireless/rt2x00/rt2x00queue.h
2011-04-25 14:34:25 -04:00
David S. Miller 1ed3aad141 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-04-22 13:21:38 -07:00
Johannes Berg 4cd2bf76a4 iwlagn: remove hw_ready variable
This variable is only ever checked right after
the function that sets it, but the same function
will also return the status, so we can pass it
through instead of checking hw_ready later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:21:23 -07:00
Johannes Berg dbf28e21ca iwlagn: combine firmware code/data
On new hardware, ucode images always come in
pairs: code and data. Therefore, combine the
variables into an appropriate struct and use
that when both code and data are needed.

Also, combine allocation and copying so that
we have less code in total.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:21:18 -07:00
Johannes Berg ca7966c88e iwlagn: implement synchronous firmware load
The current firmware loading mechanism in
iwlwifi is very hard to follow, and thus
hard to maintain. To make it easier, make
the firmware loading synchronous.

For now, as a side effect, this removes a
number of retry possibilities we had. It
isn't typical for this to fail, but if it
does happen we restart from scratch which
this also makes easier to do should it be
necessary.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:18:48 -07:00
Johannes Berg e74fe2330a iwlagn: leave notification waits on firmware errors
When the firmware encounters an error while the
driver is waiting for a notification, it will
never get that notification. Therefore, instead
of timing out, bail out on errors when waiting
for notifications.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:03:03 -07:00
Johannes Berg a8674a1efc iwlagn: make iwlagn_wait_notification return error code
We're unlikely to care about the actual time spent
waiting, so make the function return an error code
which is less error prone in coding new uses.

Also, while at it, mark __must_check.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:55 -07:00
Johannes Berg 09f18afe76 iwlagn: extend notification wait function
A notification wait function is called with the
command, but currently has no way of passing
data back to the caller -- fix that by adding a
void pointer to the function that can be used
between the caller and the function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:47 -07:00
Johannes Berg 3e14c1fd75 iwlagn: refactor up path
Starting the device consists of many things,
refactor out enabling the hardware and also
return -ERFKILL when the rfkill signal is
found to be asserted (which makes more sense
anyway, but is also required now to make the
__iwl_up function return right away.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:39 -07:00
Johannes Berg bc4f8adac6 iwlagn: refactor down path
The iwl_down path really consists of multiple things,
refactor out the hardware resetting (including, of
course, related software state like irqs).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:34 -07:00
Johannes Berg 1a10f43313 iwlagn: clean up some exit code
There's no point in running through iwl_down()
when we never registered with mac80211, as it
just cleans up internal structures that were
never initialised in this case. Therefore we
can also remove the special handling for this
case from __iwl_down().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:26 -07:00
Johannes Berg e46f6538c2 iwlagn: simplify error table reading
The current code to read the error table header
just hardcodes all the offsets, which is a bit
hard to understand. We can read in the entire
header (as much as we need) into a structure,
and then take the data from there, which makes
it easier to understand. To read a bigger blob
we also don't need to grab NIC access for each
word read, making the code more efficient.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-22 10:02:19 -07:00
Stanislaw Gruszka b25026981a iwlwifi: fix skb usage after free
Since

commit a120e912eb
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date:   Fri Feb 19 15:47:33 2010 -0800

    iwlwifi: sanity check before counting number of tfds can be free

we use skb->data after calling ieee80211_tx_status_irqsafe(), which
could free skb instantly.

On current kernels I do not observe practical problems related with
bug, but on 2.6.35.y it cause random system hangs when stressing
wireless link.

Cc: stable@kernel.org # 2.6.32+
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-20 16:05:59 -04:00
Wey-Yi Guy f212b43c4e iwlagn: remove led_ops
No longer use, remove it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-18 09:36:30 -07:00
Wey-Yi Guy e339807d97 iwlagn: remove legacy ops
No longer used by _agn devices, remove it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-18 09:34:55 -07:00
Wey-Yi Guy 119ea186ca 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>
2011-04-18 09:34:06 -07:00
Wey-Yi Guy 5cab35e7f4 iwlagn: no 5.2GHz/HT40 support for bgn devices
For bgn devices, there were no HT40 channels value in EEPROM

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-18 09:31:29 -07:00
Wey-Yi Guy f42e766281 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>
2011-04-18 09:30:09 -07:00
Wey-Yi Guy b7af6a9969 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>
2011-04-18 09:27:30 -07:00
Johannes Berg b4ebd28f23 iwlagn: use huge command for beacon
When testing some new P2P code, Angie found that the
driver might crash because the beacon command ended
up being bigger than a regular command. This is quite
obvious -- a normal command is limited to roughly 360
bytes but a beacon may be much larger of course.

To fix this, use the huge command buffer.

Reported-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-18 09:26:12 -07:00
Johannes Berg 7b21f00ee6 iwlagn: verify that huge commands are synchronous
Since huge commands all share a single buffer,
there can only be a single one in flight at a
time since otherwise they'd overwrite each
other. This is true in the driver now, but it
seems like a possible source of bugs, so add
a test to verify that huge commands are always
sent synchronously.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-18 09:23:45 -07:00
Johannes Berg 3e41ace5de iwlagn: remove most BUG_ON instances
There are a number of things in the driver that
may result in a BUG(), which is suboptimal since
it's hard to get debugging information out of
the driver in that case and the user experience
is also not good :-)

Almost all BUG_ON instances can be converted to
WARN_ON with a few lines of appropriate error
handling, so do that instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-18 09:14:30 -07:00
Wey-Yi Guy e79b1ca75b 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>
2011-04-18 08:47:43 -07:00
Daniel Halperin 7caa2316bf iwlwifi: fix frame injection for HT channels
For some reason, sending QoS configuration causes transmission to stop
after a single frame on HT channels when not associated. Removing the
extra QoS configuration has no effect on station mode, and fixes
injection mode.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-18 08:15:26 -07:00
John W. Linville 252f4bf400 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts:
	drivers/net/wireless/ath/ar9170/main.c
	drivers/net/wireless/ath/ar9170/phy.c
	drivers/net/wireless/zd1211rw/zd_rf_rf2959.c
2011-04-12 16:18:44 -04:00
David S. Miller 0e10b33a05 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 2011-04-11 12:53:51 -07:00
Linus Torvalds c44eaf41a5 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: (34 commits)
  net: Add support for SMSC LAN9530, LAN9730 and LAN89530
  mlx4_en: Restoring RX buffer pointer in case of failure
  mlx4: Sensing link type at device initialization
  ipv4: Fix "Set rt->rt_iif more sanely on output routes."
  MAINTAINERS: add entry for Xen network backend
  be2net: Fix suspend/resume operation
  be2net: Rename some struct members for clarity
  pppoe: drop PPPOX_ZOMBIEs in pppoe_flush_dev
  dsa/mv88e6131: add support for mv88e6085 switch
  ipv6: Enable RFS sk_rxhash tracking for ipv6 sockets (v2)
  be2net: Fix a potential crash during shutdown.
  bna: Fix for handling firmware heartbeat failure
  can: mcp251x: Allow pass IRQ flags through platform data.
  smsc911x: fix mac_lock acquision before calling smsc911x_mac_read
  iwlwifi: accept EEPROM version 0x423 for iwl6000
  rt2x00: fix cancelling uninitialized work
  rtlwifi: Fix some warnings/bugs
  p54usb: IDs for two new devices
  wl12xx: fix potential buffer overflow in testmode nvs push
  zd1211rw: reset rx idle timer from tasklet
  ...
2011-04-11 07:27:24 -07:00
Justin P. Mattock 6eab04a876 treewide: remove extra semicolons
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2011-04-10 17:01:05 +02:00
Johannes Berg 6fc3ba9999 iwlagn: downgrade warning on unknown TLV
If we maintain API properly, then there isn't
really a reason to warn about this since we'll
just be adding things that are safe to ignore,
so downgrade the warning to debug info level.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08 08:19:11 -07:00
Johannes Berg 0da0e5bf15 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>
2011-04-08 08:19:00 -07:00
Wey-Yi Guy 703bc583cb 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>
2011-04-08 08:02:03 -07:00
Wey-Yi Guy ae89726a02 iwlagn: tx power calib always done in firmware
Remove the config flag for tx power calib

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08 08:01:55 -07:00
Wey-Yi Guy 23c0fcc66b iwlagn: all _agn devices support power save mode
Remove broken_power_save checking

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08 08:01:46 -07:00
Wey-Yi Guy 8ff84a2c99 iwlagn: more cleanup to remove unused reference
More cleanup code, no functional changes

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08 08:01:37 -07:00
Wey-Yi Guy 15ade3ca64 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>
2011-04-08 08:01:18 -07:00
Wey-Yi Guy 6bb64697ed iwlagn: remove more reference to legacy devices
Remove the reference to both 3945 and 4965 in LED code

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08 08:01:00 -07:00
Wey-Yi Guy ee3cd7e04c iwlagn: cleanup to remove the reference for 3945
More clean up after driver split

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08 08:00:46 -07:00
Wey-Yi Guy ab4bf5ef5a iwlagn: remove unused 3945 define
3945 no longer apply

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08 08:00:30 -07:00
Wey-Yi Guy ece3cd2e8f iwlagn: no 3945 define needed
Remove 3945 define

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08 08:00:19 -07:00
Wey-Yi Guy dcf6640f0f iwlagn: PAPD read for 2000 series devices
For 2000 series NICs, disable OTP refresh in order to read correct
PAPD table from high OTP block

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08 08:00:11 -07:00
Johannes Berg a2b76b3b31 iwlwifi: fix bugs in change_interface
If change_interface gets invoked during a firmware
restart, it may crash; prevent that from happening
by checking if ctx->vif is assigned.

Additionally, in my initial commit I forgot to set
the vif->p2p variable correctly, so fix that too.

Cc: stable@kernel.org [2.6.38+]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08 07:59:53 -07:00
Garen Tamrazian 68b993118f iwlagn: fix radar frame rejection
The microcode may sometimes reject TX frames when
on a radar channel even after we associated as it
clears information during association and needs to
receive a new beacon before allowing that channel
again. This manifests itself as a TX status value
of TX_STATUS_FAIL_PASSIVE_NO_RX. So in this case,
stop the corresponding queue and give the frame
back to mac80211 for retransmission. We start the
queue again when a beacon from the AP is received
which will make the regulatory enforcement in the
device allow transmitting again.

Signed-off-by: Garen Tamrazian <garenx.tamrazian@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
2011-04-08 07:59:37 -07:00
Wey-Yi Guy 3ecccbcd3c 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>
2011-04-08 07:59:25 -07:00
root 1d5cc5559a 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>
2011-04-08 07:59:01 -07:00
John W. Linville b37e3b6d64 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
Conflicts:
	drivers/net/wireless/rtlwifi/efuse.c
	drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
	net/bluetooth/mgmt.c
2011-04-07 16:45:40 -04:00
Johannes Berg 02a7fa00a6 iwlagn: move IO functions out of line
This generates a massive reduction in module size:
with debug:
   text	   data	    bss	    dec	    hex	filename
 670300	  13136	    420	 683856	  a6f50	iwlagn.ko (before)
 388347	  13136	    408	 401891	  621e3	iwlagn.ko (after)

without debug:
   text	   data	    bss	    dec	    hex	filename
 528575	  13072	    420	 542067	  84573	iwlagn.ko (before)
 294192	  13072	    408	 307672	  4b1d8	iwlagn.ko (after)

This also removes all the IO debug functionality since
it can easily be replaced by tracing, and makes the
code unnecessarily complex.

I haven't done any CPU utilisation measurements, but
given that the hotpaths don't use much IO it is not
likely to have a negative impact; in fact, the size
reduction will reduce cache pressure which possibly
improves performance.

Finally, an unused function or two were removed.

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 15:52:28 -04:00
Johannes Berg 519d8abd35 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>
2011-04-07 15:52:28 -04:00
Johannes Berg 0e5884458e iwlagn: remove rxb page bookkeeping
We never use the value in alloc_rxb_page,
so there's no point in keeping it either.

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 15:51:40 -04:00
Johannes Berg c2974a1d18 iwlagn: remove rev_id
The rev_id variable is only printed, we
don't need to store 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>
2011-04-07 15:51:40 -04:00
Johannes Berg e98a130259 iwlagn: remove hw_rev
The hw_rev variable is used only during init,
so there's no need to keep it around.

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 15:51:39 -04:00
Johannes Berg bc25593063 iwlagn: remove hw_wa_rev
The variable is never used.

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 15:51:39 -04:00
Johannes Berg 917b6777b4 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>
2011-04-07 15:51:39 -04:00
Johannes Berg 17445b8c44 iwlagn: init cmd_queue earlier
We know after loading the ucode whether it will
support PAN or not, so we can also initialise
the cmd_queue variable much earlier.

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 15:51:39 -04:00
Johannes Berg d7d5783c66 iwlagn: clean up alive handling
Devices newer than 4965 don't actually send
two different versions of the ALIVE command,
so we always had a bug here since before this
patch we copy more data than we got. Remove
the iwl_init_alive_resp struct and don't use
it.

Since we also really don't need to track all
the data received in ALIVE as we only use the
error and log event tables later, we can also
save space by just keeping those and not more
data around in memory.

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 15:51:38 -04:00
Johannes Berg 3d09cdff23 iwlagn: fix ucode verify message
My previous patch left a message talking about
bootstrap, but that's clearly bogus.

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 15:51:38 -04:00
Johannes Berg 3997ff39fa iwlagn: add feature flags
Some new devices and microcode files will a greater
variety of features, so the TLV-per-feature approach
we took before will quickly make things harder to
manage and increase the file size.

Add a new TLV that has feature flags. Currently, it
will contain:
 1) a PAN feature flag, which moves from a separate
    TLV
 2) a new BT stats bit that indicates whether the
    microcode image uses bluetooth statistics
 3) a new MFP flag for management frame protection
    which can be enabled once the device/microcode
    supports 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>
2011-04-07 15:51:38 -04:00
Wey-Yi Guy 7415952ff7 iwlagn: check more error return code
In alive notify, we should check return code instead of assume everything ok

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-07 15:51:38 -04:00
Wey-Yi Guy 901069c714 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>
2011-04-07 15:51:37 -04:00
Johannes Berg 6009c39c6f iwlagn: remove ucode_data_backup
This was used only on 4965 in conjunction with
the bootstrap 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-04-07 15:51:37 -04:00
Johannes Berg e649437fd6 iwlagn: centralize and fix ucode restart
The ucode restart has to take into account a number
of things, like clearing the HCMD_ACTIVE and other
status bits, and waking up the wait_command_queue.
Currently, however, there are a number of places
that neither do that, nor actually set the FW error
bit that leads to proper restart handling, which
means that in those cases things will probably just
hang completely.

To clean this up, make all ucode restart go through
a single function, except for the cases where it's
called during firmware loading.

Also fix a bug in wimax coexist restart avoidance,
it needs to first clear the status bits (and it has
to clear the HCMD_ACTIVE one as well) and then wake
up anything waiting on wait_command_queue.

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 15:51:37 -04:00
Johannes Berg 1fc352765f 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>
2011-04-07 15:51:36 -04:00
Johannes Berg 35b1d92dfb iwlagn: verify specific ucode
When we loaded a ucode, there's no point in
checking any one that is present, we know
which one is supposed to be present so also
verify that it is exactly the right one.

That also simplifies the code and makes it
faster since it doesn't have to check all.

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 15:51:36 -04:00
Johannes Berg fb66216f9e iwlagn: simplify ucode check code
The code in iwlcore_verify_inst_sparse really
doesn't need to keep track of the number of
errors it encountered since a single one is
fatal.

Also, the code in iwl_verify_inst_full is just
used to print out some things, so rename it to
iwl_print_inst and don't give it a return code
and just make it print out the values.

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 15:51:36 -04:00
Wey-Yi Guy 36127db02e iwlagn: return send calibration result
In alive notification call, return the status from iwl_send_calib_results()

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-07 15:51:35 -04:00
Johannes Berg 08960dea6c iwlagn: remove pointless return variables
A number of places just use a variable to return
it right away, which is useless, so let's remove
the variables 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>
2011-04-07 15:51:35 -04:00
Wey-Yi Guy 4de10b1880 iwlagn: remove more 3945/4965 related defines
After driver split, remove unused #defines

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-07 15:51:35 -04:00
Johannes Berg 7102762ef0 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>
2011-04-07 15:51:35 -04:00
Johannes Berg 2dedbf58b2 iwlagn: make mac80211 handlers static
Now that these handlers are no longer shared
between 4965 and agn, they 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-04-07 15:49:42 -04:00
Johannes Berg 3240cab3dd iwlagn: clean up some 3945/4965 remnants
When the driver was split, a bunch of definitions
for the 3945 and 4965 devices stayed around, but
they're now useless so remove (some of) them.

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 15:49:41 -04:00
Johannes Berg 68e022dfeb iwlagn: remove unused variable
Some code was removed, but a variable it used
and that is now unused stayed around, kill 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>
2011-04-07 15:49:41 -04:00
Stanislaw Gruszka 8447c163af iwlwifi: remove sync_cmd_mutex
We now use priv->mutex to serialize sync command, remove old
priv->sync_cmd_mutex and add assertion that priv->mutex must be locked.

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 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
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03: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