pandora-kernel.git
12 years agomwifiex: correction in structure name passed to sizeof()
Amitkumar Karwar [Wed, 14 Mar 2012 02:36:49 +0000 (19:36 -0700)]
mwifiex: correction in structure name passed to sizeof()

"hscfg" is declared as struct mwifiex_ds_hs_cfg. Use same structure
name for calculating it's size.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: fix checkpatch --strict warnings/errors Part 9
Yogesh Ashok Powar [Wed, 14 Mar 2012 02:22:42 +0000 (19:22 -0700)]
mwifiex: fix checkpatch --strict warnings/errors Part 9

For files sta_rx.c, sta_tx.c, txrx.c, util.c and wmm.c

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: fix checkpatch --strict warnings/errors Part 8
Yogesh Ashok Powar [Wed, 14 Mar 2012 02:22:41 +0000 (19:22 -0700)]
mwifiex: fix checkpatch --strict warnings/errors Part 8

For files sta_event.c and sta_ioctl.c

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: fix checkpatch --strict warnings/errors Part 7
Yogesh Ashok Powar [Wed, 14 Mar 2012 02:22:40 +0000 (19:22 -0700)]
mwifiex: fix checkpatch --strict warnings/errors Part 7

For sta_cmd.c and sta_cmdresp.c

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: fix checkpatch --strict warnings/errors Part 6
Yogesh Ashok Powar [Wed, 14 Mar 2012 02:22:39 +0000 (19:22 -0700)]
mwifiex: fix checkpatch --strict warnings/errors Part 6

For file sdio.c

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: fix checkpatch --strict warnings/errors Part 5
Yogesh Ashok Powar [Wed, 14 Mar 2012 02:22:38 +0000 (19:22 -0700)]
mwifiex: fix checkpatch --strict warnings/errors Part 5

For file scan.c

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: fix checkpatch --strict warnings/errors Part 4
Yogesh Ashok Powar [Wed, 14 Mar 2012 02:22:37 +0000 (19:22 -0700)]
mwifiex: fix checkpatch --strict warnings/errors Part 4

For files main.c, main.h and pcie.c

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: fix checkpatch --strict warnings/errors Part 3
Yogesh Ashok Powar [Wed, 14 Mar 2012 02:22:36 +0000 (19:22 -0700)]
mwifiex: fix checkpatch --strict warnings/errors Part 3

For files fw.h, init.c and join.c

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: fix checkpatch --strict warnings/errors Part 2
Yogesh Ashok Powar [Wed, 14 Mar 2012 02:22:35 +0000 (19:22 -0700)]
mwifiex: fix checkpatch --strict warnings/errors Part 2

For files cfg80211.c, cfp.c, and cmdevt.c

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: fix checkpatch --strict warnings/errors Part 1
Yogesh Ashok Powar [Wed, 14 Mar 2012 02:22:34 +0000 (19:22 -0700)]
mwifiex: fix checkpatch --strict warnings/errors Part 1

For files 11n.c, 11n.h, 11n_aggr.c, 11n_rxreorder.c

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Don't let regulatory make us deaf
Paul Stewart [Tue, 13 Mar 2012 14:46:18 +0000 (07:46 -0700)]
mac80211: Don't let regulatory make us deaf

When regulatory information changes our HT behavior (e.g,
when we get a country code from the AP we have just associated
with), we should use this information to change the power with
which we transmit, and what channels we transmit.  Sometimes
the channel parameters we derive from regulatory information
contradicts the parameters we used in association.  For example,
we could have associated specifying HT40, but the regulatory
rules we apply may forbid HT40 operation.

In the situation above, we should reconfigure ourselves to
transmit in HT20 only, however it makes no sense for us to
disable receive in HT40, since if we associated with these
parameters, the AP has every reason to expect we can and
will receive packets this way.  The code in mac80211 does
not have the capability of sending the appropriate action
frames to signal a change in HT behaviour so the AP has
no clue we can no longer receive frames encoded this way.
In some broken AP implementations, this can leave us
effectively deaf if the AP never retries in lower HT rates.

This change breaks up the channel_type parameter in the
ieee80211_enable_ht function into a separate receive and
transmit part.  It honors the channel flags set by regulatory
in order to configure the rate control algorithm, but uses
the capability flags to configure the channel on the radio,
since these were used in association to set the AP's transmit
rate.

Signed-off-by: Paul Stewart <pstew@chromium.org>
Cc: Sam Leffler <sleffler@chromium.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Luis R Rodriguez <mcgrof@frijolero.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: rename bss_conf timestamp to last_tsf
Johannes Berg [Tue, 13 Mar 2012 13:29:30 +0000 (14:29 +0100)]
mac80211: rename bss_conf timestamp to last_tsf

This value is not really very useful by itself,
yet some drivers (including iwlwifi until I can
figure out what it should do) use it. At least
rename it to "last_tsf" to indicate the meaning
and add a note that it may be really old.

I suspect the value may become useful combined
with the rx_status->mactime, but we don't (yet)
store that value and pass it to the driver.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: clarify timestamp in cfg80211_inform_bss
Johannes Berg [Tue, 13 Mar 2012 12:57:04 +0000 (13:57 +0100)]
cfg80211: clarify timestamp in cfg80211_inform_bss

This is intended to be the timestamp sent by the
peer in the beacon/probe response, not any form
of host timestamp. Clarify the documentation and
variable names.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrmc80211: dont use jiffies for BSS TSF
Johannes Berg [Tue, 13 Mar 2012 12:57:03 +0000 (13:57 +0100)]
brmc80211: dont use jiffies for BSS TSF

The cfg80211_inform_bss() timestamp argument is
intended to be the TSF, not any form of host
timestamp.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoDocumentation: make exists consistent
Yegor Yefremov [Tue, 13 Mar 2012 09:57:51 +0000 (10:57 +0100)]
Documentation: make exists consistent

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: rename fuctions and variables for better readability
Yogesh Ashok Powar [Tue, 13 Mar 2012 02:35:13 +0000 (19:35 -0700)]
mwifiex: rename fuctions and variables for better readability

Renaming the long fuctions and variable names from 11n_rxreoder.c
file to shorter ones for better readability.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: rearrange if and else blocks to avoid extra indentation
Yogesh Ashok Powar [Tue, 13 Mar 2012 02:35:12 +0000 (19:35 -0700)]
mwifiex: rearrange if and else blocks to avoid extra indentation

This adds better readability.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: use usleep_range instead of udelay
Yogesh Ashok Powar [Tue, 13 Mar 2012 02:35:11 +0000 (19:35 -0700)]
mwifiex: use usleep_range instead of udelay

For the delay of 10 uSec or more usleep_range is prefered.
Unlike udelay, sleep_range avoids large number of undesired
interrupts.

Ref Documentation/timers/timers-howto.txt

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: merge functions to derive cfp by chan & freq in one
Yogesh Ashok Powar [Tue, 13 Mar 2012 02:35:10 +0000 (19:35 -0700)]
mwifiex: merge functions to derive cfp by chan & freq in one

There exist different functions with very long names
to derive the channel frequency and power tripplet
based on band and channel/freq.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: rearrange switch statement
Yogesh Ashok Powar [Tue, 13 Mar 2012 02:35:09 +0000 (19:35 -0700)]
mwifiex: rearrange switch statement

Fixing coding style by rearranging the switch statement

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: rename long function names to shorter ones
Yogesh Ashok Powar [Tue, 13 Mar 2012 02:35:08 +0000 (19:35 -0700)]
mwifiex: rename long function names to shorter ones

This saves some space and adds better readability.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: linearize SKBs as needed for crypto
Johannes Berg [Mon, 12 Mar 2012 12:49:14 +0000 (13:49 +0100)]
mac80211: linearize SKBs as needed for crypto

Not linearizing every SKB will help actually pass
non-linear SKBs all the way up when on an encrypted
connection. For now, linearize TKIP completely as
it is lower performance and I don't quite grok all
the details.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: move RX WEP weak IV counting
Johannes Berg [Mon, 12 Mar 2012 12:49:13 +0000 (13:49 +0100)]
mac80211: move RX WEP weak IV counting

This is better done inside the WEP decrypt
function where it doesn't have to check all
the conditions any more since they've been
tested already.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agob43: Load firmware from a work queue and not from the probe routine
Larry Finger [Fri, 9 Mar 2012 04:27:46 +0000 (22:27 -0600)]
b43: Load firmware from a work queue and not from the probe routine

Recent changes in udev are causing problems for drivers that load firmware
from the probe routine. As b43 has such a structure, it must be changed.
As this driver loads more than 1 firmware file, changing to the asynchronous routine
request_firmware_nowait() would be complicated. In this implementation, the probe
routine starts a queue that calls the firmware loading routines.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agob43legacy: Load firmware from work queue instead of from probe routine
Larry Finger [Fri, 9 Mar 2012 04:25:57 +0000 (22:25 -0600)]
b43legacy: Load firmware from work queue instead of from probe routine

Recent changes in udev are causing problems for drivers that load firmware
from the probe routine. As b43legacy has such a structure, it must be changed.
As this driver loads 3 or 4 firmware files, changing to the asynchronous routine
request_firmware_nowait() would be complicated. In this implementation, the probe
routine starts a work queue that calls the firmware loading routines.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMerge branch 'for-linville' of git://github.com/kvalo/ath6kl
John W. Linville [Tue, 13 Mar 2012 18:45:40 +0000 (14:45 -0400)]
Merge branch 'for-linville' of git://github.com/kvalo/ath6kl

12 years agoath6kl: fix debug.c file mode
Kalle Valo [Tue, 13 Mar 2012 12:36:27 +0000 (14:36 +0200)]
ath6kl: fix debug.c file mode

Commit 7504a3e1 ("ath6kl: add padding to firmware log records") accidentally
changed debug.c mode from 100644 to 100755. Revert that back to original.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: use max_t() in ath6kl_cfg80211_connect()
Kalle Valo [Mon, 12 Mar 2012 11:23:23 +0000 (13:23 +0200)]
ath6kl: use max_t() in ath6kl_cfg80211_connect()

ath6kl/cfg80211.c:589: WARNING: max() should probably be
max_t(u16, vif->listen_intvl_t, ATH6KL_MAX_WOW_LISTEN_INTL)

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: fix open parenthesis alignment in ath6kl_sdio_suspend()
Kalle Valo [Mon, 12 Mar 2012 11:23:14 +0000 (13:23 +0200)]
ath6kl: fix open parenthesis alignment in ath6kl_sdio_suspend()

ath6kl/sdio.c:875: CHECK: Alignment should match open parenthesis

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: replace strict_strtoul() with kstrtoul()
Kalle Valo [Mon, 12 Mar 2012 11:23:03 +0000 (13:23 +0200)]
ath6kl: replace strict_strtoul() with kstrtoul()

Recommended by checkpatch.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: fix regression in ath6kl_upload_board_file()
Kalle Valo [Mon, 12 Mar 2012 11:22:54 +0000 (13:22 +0200)]
ath6kl: fix regression in ath6kl_upload_board_file()

My patch 24fc32b3 ("ath6kl: add ath6kl_bmi_write_hi32()") caused a regression
in ath6kl_upload_board_file() and the board_address variable was not
properly initialised in some cases:

ath6kl/init.c:1068:6: warning: ‘board_address’ may be used uninitialized
in this function

Most likely this broke ar6004 support but I can't test that right now.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agomac80211: set basic rates earlier
Johannes Berg [Thu, 8 Mar 2012 14:02:08 +0000 (15:02 +0100)]
mac80211: set basic rates earlier

The authentication and association handshake
already happens in the context of the new BSS,
and the basic rates are needed at least for
the ACK response frame to the authentication
or association response frames. Therefore the
basic rates should already be configured into
the driver when those frames are sent.

Change the logic to set up the basic rates in
the connection preparation that happens for
authentication and association (if needed).

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: refactor common auth/assoc setup code
Johannes Berg [Thu, 8 Mar 2012 14:02:07 +0000 (15:02 +0100)]
mac80211: refactor common auth/assoc setup code

As associating is possible without first authenticating
(for FT over DS) association also has to be able to
switch to the right channel, insert the station entry
etc. Factor out this common code into a new function
called ieee80211_prep_connection().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: remove spurious BSSID change flag
Johannes Berg [Thu, 8 Mar 2012 14:02:06 +0000 (15:02 +0100)]
mac80211: remove spurious BSSID change flag

The BSSID has been set a lot earlier already and
didn't change again in ieee80211_set_associated().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: simplify wmm check during association
Johannes Berg [Thu, 8 Mar 2012 14:02:05 +0000 (15:02 +0100)]
mac80211: simplify wmm check during association

Instead of setting assoc_data->wmm_used solely
based on the BSS also take into account our own
capabilities and later check those.

Also rename "wmm_used" and "uapsd_used" to just
"wmm" and "uapsd".

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: simplify HT checks
Johannes Berg [Thu, 8 Mar 2012 14:02:04 +0000 (15:02 +0100)]
mac80211: simplify HT checks

Always set/use IEEE80211_STA_DISABLE_11N instead
of duplicating the queue, WMM and HT checks in
all places.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: move misplaced comment
Johannes Berg [Thu, 8 Mar 2012 14:02:03 +0000 (15:02 +0100)]
mac80211: move misplaced comment

Looks like some changes in this area moved
the code but not the comment that belongs
to the code, move it to the right place.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: Add bool mvm_ucode to iwl_fw
David Spinadel [Sat, 10 Mar 2012 21:00:15 +0000 (13:00 -0800)]
iwlwifi: Add bool mvm_ucode to iwl_fw

mvm_ucode is true when mvm TLVs arive.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: change struct iwl_fw
David Spinadel [Sat, 10 Mar 2012 21:00:14 +0000 (13:00 -0800)]
iwlwifi: change struct iwl_fw

Change iwl_fw struct to hold an array of fw_img instead of
three separated instances.

Change fw_img to hold an array of fw_desc instead of two
separate descriptors for instructions and data.

Change load_given_ucode, load_section, verification functions
etc. to support this structure.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: Add TLVs and fields for 16.0 uCode
David Spinadel [Sat, 10 Mar 2012 21:00:13 +0000 (13:00 -0800)]
iwlwifi: Add TLVs and fields for 16.0 uCode

New TLVs for ucode sections that are not known as
instruction or data.

New TLVs for phy-configuration and default calibrations.

Add default calib and phy config fields to iwl_fw.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: more modularity in fw images and sections
David Spinadel [Sat, 10 Mar 2012 21:00:12 +0000 (13:00 -0800)]
iwlwifi: more modularity in fw images and sections

Changed iwl_firmware_pieces structure to support an array of
separate images, and an array of sections for each image.

In fw_sec and fw_desc structures, added a field for
offset from the HW address, to support 16.0 uCode that
provides an offset instead of any other data about the section.
This field is filled with default values when parsing instruction
or data section.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: explicitly track whether INIT uCode was run
David Spinadel [Sat, 10 Mar 2012 21:00:11 +0000 (13:00 -0800)]
iwlwifi: explicitly track whether INIT uCode was run

Remove IWL_UCODE_NONE from enum iwl_ucode_type which,
by being the default value in 0-initialized memory,
implicitly allowed us to track whether any uCode had
ever been loaded successfully (which would have been
the INIT uCode) and instead explicitly track whether
or not INIT uCode has been run.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: avoid some operations if no uCode loaded
David Spinadel [Sat, 10 Mar 2012 21:00:10 +0000 (13:00 -0800)]
iwlwifi: avoid some operations if no uCode loaded

Printing the SRAM and similar testmode operations could
be triggered when no uCode is loaded; prevent those
invalid operations by tracking whether uCode is loaded.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move wait_command_queue from shared to trans
Meenakshi Venkataraman [Sat, 10 Mar 2012 21:00:09 +0000 (13:00 -0800)]
iwlwifi: move wait_command_queue from shared to trans

This wait queue really belongs to the transport
layer, as it is used for sending synchronous
commands to the HW.

However, only op_mode knows about errors and
exceptional conditions, so make this queue
accessible by the op_mode.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: convert bad state message into warning
Johannes Berg [Sat, 10 Mar 2012 21:00:08 +0000 (13:00 -0800)]
iwlwifi: convert bad state message into warning

Looking at logs, I see that we did get the bad
state message a few times for some reason, but
it doesn't indicate why or where it came from,
so make it a warning in order to identify 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>
12 years agoiwlwifi: abstract out missing SEQ_RX_FRAME workaround
Johannes Berg [Sat, 10 Mar 2012 21:00:07 +0000 (13:00 -0800)]
iwlwifi: abstract out missing SEQ_RX_FRAME workaround

Mohammed Shafi ran into [1] the SEQ_RX_FRAME workaround
warning with a statistics notification, this means we
can't just remove it as we'd hoped.

Abstract it out so that the higher layer can configure
this as a kind of "filter" in the transport.

[1] http://mid.gmane.org/CAD2nsn1_DzbRHuSbS_1rFNzuux_9pW1-pABEasQ01_y7-ndO5w@mail.gmail.com

Reported-by: Mohammed Shafi <shafi.wireless@gmail.com>
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>
12 years agoiwlwifi: remove TX hex debug
Johannes Berg [Sat, 10 Mar 2012 21:00:06 +0000 (13:00 -0800)]
iwlwifi: remove TX hex debug

Tracing is much better for this, so
remove the hex printk debug for the
TX command.

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>
12 years agoath9k: fix going to full-sleep on PS idle
Felix Fietkau [Sat, 10 Mar 2012 12:57:04 +0000 (13:57 +0100)]
ath9k: fix going to full-sleep on PS idle

The check for PS_WAIT_FOR_TX_ACK was inverted, the hardware should only go
to full sleep if no tx is pending.

Reported-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Fix mactime from being clobbered in rx_status
Ashok Nagarajan [Sat, 10 Mar 2012 02:57:39 +0000 (18:57 -0800)]
ath9k: Fix mactime from being clobbered in rx_status

mactime was being overwritten by the function ath9k_rx_skb_preprocess. Fixed by
memsetting rx_status in ath_rx_tasklet.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: configure bss info at assoc notification
Rajkumar Manoharan [Fri, 9 Mar 2012 23:36:49 +0000 (05:06 +0530)]
ath9k: configure bss info at assoc notification

The proper place to configure bss info is at assoc notification. So that
ath9k continues to work if the supirous bssid notification will be
removed in future.

Cc: Johannes Berg <johannes@sipsolutions.net>
Reported-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: add auth/assoc/deauth flow diagram
Johannes Berg [Fri, 9 Mar 2012 16:25:33 +0000 (17:25 +0100)]
mac80211: add auth/assoc/deauth flow diagram

I've been working on some documentation, so let's
add this diagram to the kernel tree where at least
it has a chance of being maintained :-)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2x00: Fix beacon skew in rt2800pci
Helmut Schaa [Fri, 9 Mar 2012 14:31:50 +0000 (15:31 +0100)]
rt2x00: Fix beacon skew in rt2800pci

rt2800pci is suffering from beacon skew in AP mode. Some powersaving
clients (like VOIP phones) are getting into trouble after some time
when the beacon skew is getting too big.

The ralink legacy drivers contain a function that indicates that the
beacon timer is off by 1us per tbtt. And this function works around
that by reducing the beacon interval for every 64th beacon transmission
by 64us (the smallest possible value). Do the same in rt2800pci.

This allows proper powersaving when rt2800pci is used in AP mode.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Disable MCS > 7 in minstrel_ht when STA uses static SMPS
Helmut Schaa [Fri, 9 Mar 2012 13:13:45 +0000 (14:13 +0100)]
mac80211: Disable MCS > 7 in minstrel_ht when STA uses static SMPS

Disable multi stream rates (MCS > 7) when a STA is in static SMPS mode
since it has only one active rx chain. Hence, it doesn't even make
sense to sample multi stream rates.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: set channel back after disassociating
Johannes Berg [Fri, 9 Mar 2012 12:12:35 +0000 (13:12 +0100)]
mac80211: set channel back after disassociating

As we've discussed, we want to avoid channel changes
while associated. While the part when we actually
associate needs a bit more work, the bit that happens
on disassociating can be changed quite easily. Move
the channel type change later in the disassociate
process to set the channel only after the driver was
told that it's now disassociated.

As the driver could expect powersave to be enabled
only when associated, this thus results in splitting
the config call, but overall what happens makes more
sense this way.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: remove tx_sync
Johannes Berg [Fri, 9 Mar 2012 11:49:21 +0000 (12:49 +0100)]
mac80211: remove tx_sync

When the station state callback was added, this
was no longer needed in theory. With the iwlwifi
changes to remove use of it landing, we can kill
the entire tx-sync framework again, RIP.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: Fix enabling of MCI and RTT
Mohammed Shafi Shajakhan [Fri, 9 Mar 2012 06:31:55 +0000 (12:01 +0530)]
ath9k_hw: Fix enabling of MCI and RTT

tested in AR9462 Rev:2, both hardware capability flag are set

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonet/wireless: ipw2x00: remove unused definitions for regulatory domain
Stanislav Yakovlev [Fri, 9 Mar 2012 00:06:50 +0000 (19:06 -0500)]
net/wireless: ipw2x00: remove unused definitions for regulatory domain

ipw2200 driver does not use these defines, it uses geo struct instead.
Therefore remove them from its header.

Note: we keep them in the ipw2100 driver's header, because the driver
still uses them.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Add wiphy name to log messages.
Ben Greear [Thu, 8 Mar 2012 18:20:55 +0000 (10:20 -0800)]
ath9k: Add wiphy name to log messages.

On systems with multiple NICs, it's nice to know which
one is producing warnings.  Here is an example of the
new ouput:

ath: wiphy0: Failed to stop TX DMA, queues=0x005!

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211_hwsim: Fix set mactime on receiver hwsim radio
Ashok Nagarajan [Thu, 8 Mar 2012 17:27:34 +0000 (09:27 -0800)]
mac80211_hwsim: Fix set mactime on receiver hwsim radio

The patch "mac80211_hwsim:  Add tsf to beacons, probe responses and radiotap
header" was setting the mactime on wrong hwsim radio. This patch fixes it.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Limit TID buffering during BA session setup/teardown
Helmut Schaa [Wed, 7 Mar 2012 16:20:30 +0000 (17:20 +0100)]
mac80211: Limit TID buffering during BA session setup/teardown

While setting up or tearing down a BA session mac80211 is buffering
pending frames for the according TID. However, there's currently no
limit on how many frames are buffered possibly leading to an out-of-
memory situation. This can happen on systems with little memory when
the CPU is fully loaded since the BA session work is executed in
process context while frames can still come via softirq.

Apply a limitation to the TIDs pending queue to avoid consuming
too much memory in this situation.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: Add background scan period attribute.
Bala Shanmugam [Wed, 7 Mar 2012 11:57:12 +0000 (17:27 +0530)]
cfg80211: Add background scan period attribute.

Receive background scan period as part of connect
command and pass the same to the driver.

Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Fix BTCOEX shutdown
Sujith Manoharan [Mon, 12 Mar 2012 02:21:07 +0000 (07:51 +0530)]
ath9k: Fix BTCOEX shutdown

Flush MCI profiles only if MCI is being actually used.
This fixes a panic on driver unload when non-MCI devices
are being used and btcoex_enable is set.

BUG: unable to handle kernel NULL pointer dereference at           (null)
IP: [<ffffffffa06296d2>] ath_mci_flush_profile+0x12/0x100 [ath9k]
Call Trace:
[<ffffffffa061befe>] ath9k_stop_btcoex+0x5e/0x80 [ath9k]
[<ffffffffa061ed57>] ath9k_stop+0xb7/0x230 [ath9k]
[<ffffffffa0533f30>] ieee80211_stop_device+0x50/0x180 [mac80211]
[<ffffffffa051f0cf>] ieee80211_do_stop+0x2af/0x6a0 [mac80211]
[<ffffffffa051f4da>] ieee80211_stop+0x1a/0x20 [mac80211]
[<ffffffff81365d96>] __dev_close_many+0x86/0xe0
[<ffffffff81365ee0>] dev_close_many+0xa0/0x110
[<ffffffff81366038>] rollback_registered_many+0xe8/0x260
[<ffffffff813661cb>] unregister_netdevice_many+0x1b/0x80
[<ffffffffa051e950>] ieee80211_remove_interfaces+0xd0/0x110 [mac80211]
[<ffffffffa050c133>] ieee80211_unregister_hw+0x53/0x120 [mac80211]
[<ffffffffa061d5a4>] ath9k_deinit_device+0x44/0x70 [ath9k]
[<ffffffffa062c1d4>] ath_pci_remove+0x54/0xa0 [ath9k]
[<ffffffff81267c46>] pci_device_remove+0x46/0x110
[<ffffffff8131021c>] __device_release_driver+0x7c/0xe0
[<ffffffff81310960>] driver_detach+0xd0/0xe0
[<ffffffff81310078>] bus_remove_driver+0x88/0xe0
[<ffffffff81311122>] driver_unregister+0x62/0xa0
[<ffffffff81268004>] pci_unregister_driver+0x44/0xc0
[<ffffffffa062c8b5>] ath_pci_exit+0x15/0x20 [ath9k]
[<ffffffffa063205d>] ath9k_exit+0x15/0x31 [ath9k]
[<ffffffff810b92cc>] sys_delete_module+0x18c/0x270
[<ffffffff814373dd>] ? retint_swapgs+0x13/0x1b
[<ffffffff8124828e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff81437de9>] system_call_fastpath+0x16/0x1b

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath6kl: Fix merge error in ath6kl_set_ies()
Aarthi Thiruvengadam [Thu, 8 Mar 2012 20:25:02 +0000 (12:25 -0800)]
ath6kl: Fix merge error in ath6kl_set_ies()

Portion of the commit id 080eec4fb4 ("ath6kl: Clear the IE in firmware
if not set") was overwritten by mistake due to a merge
conflict. This patch fixes the code back to how it should be.

kvalo: more details to the commit log

Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoiwlwifi: fix the delta for remove max_txq_num patch
Wey-Yi Guy [Fri, 9 Mar 2012 19:13:40 +0000 (11:13 -0800)]
iwlwifi: fix the delta for remove max_txq_num patch

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

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: fix cmd_queue number merge
Wey-Yi Guy [Fri, 9 Mar 2012 18:12:42 +0000 (10:12 -0800)]
iwlwifi: fix cmd_queue number merge

iwlwifi: move command queue number out of the iwl_shared struct
move the cmd_queue out of iwl_shared struct, but for some reason the
patch is half done and fail compile

Here is the fix

John, could you apply this patch to wireless-next to address the issue
Thanks

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: restore PAN support
Emmanuel Grumbach [Wed, 7 Mar 2012 17:52:41 +0000 (09:52 -0800)]
iwlwifi: restore PAN support

in iwlwifi: move setting up fw parameters

Meenakshi moved code up to configure the transport layer, but this
code read the sku before it was set (from the EEPROM). This killed
P2P.
Only the ucode_flags are needed to configure the transport layer, not
the sku which _must_ be set after the EEPROM is read.

We need to reconfigure the transport in case the EEPROM disabled PAN
support. This is not the nicest thing to do, but we have no choice.
Document that we are allowed to configure the transport several times
before start_fw, but not after.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move command queue number out of the iwl_shared struct
Meenakshi Venkataraman [Thu, 8 Mar 2012 19:29:12 +0000 (11:29 -0800)]
iwlwifi: move command queue number out of the iwl_shared struct

The command queue number is required by the transport
layer, but it can be determined only by the op mode.
Move this parameter to the dvm op mode, and configure
the transport layer using an API.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: correction in number of bitrates
Amitkumar Karwar [Thu, 8 Mar 2012 03:36:07 +0000 (19:36 -0800)]
mwifiex: correction in number of bitrates

In recent commit "mwifiex: correct bitrates advertised..", we have
removed 22Mbps and 72Mbps bitrates from supported bitrate array.
It means number of bitrates has reduced from 14 to 12.

Initialize ".n_bitrates" to array size instead of hardcoding it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonet/wireless: ipw2x00: remove WEXT_USECHANNELS define
Stanislav Yakovlev [Thu, 8 Mar 2012 00:32:40 +0000 (19:32 -0500)]
net/wireless: ipw2x00: remove WEXT_USECHANNELS define

Driver does not use it any more.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: update ieee80211_tx_rate_control kerneldoc
Simon Wunderlich [Wed, 7 Mar 2012 20:31:13 +0000 (21:31 +0100)]
mac80211: update ieee80211_tx_rate_control kerneldoc

 * add entry for rate_idx_mcs_mask
 * fix order of entries to represent the structs' order

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: correct status bit refactoring errors
Don Fry [Wed, 7 Mar 2012 17:52:43 +0000 (09:52 -0800)]
iwlwifi: correct status bit refactoring errors

I missed a couple of status bits in my refactoring changes.  This
fixes the ones I missed.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: don't delete AP station directly
Johannes Berg [Wed, 7 Mar 2012 17:52:42 +0000 (09:52 -0800)]
iwlwifi: don't delete AP station directly

With the mac80211 deauth sequence changes, the
station is deleted before the device is set
unassociated. This can cause the device to get
confused as it expects the station to be there
while the associated bit is set.

To fix this, do not delete the AP station from
the device when mac80211 asks for deletion,
instead just mark it as unused and rely on the
unassociated RXON to drop it from the station
database in the device.

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>
12 years agoiwlwifi: make iwl_init_context static
Johannes Berg [Wed, 7 Mar 2012 17:52:40 +0000 (09:52 -0800)]
iwlwifi: make iwl_init_context static

It's not needed anywhere but during init.

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>
12 years agoiwlwifi: remove messages from queue wake/stop
Johannes Berg [Wed, 7 Mar 2012 17:52:39 +0000 (09:52 -0800)]
iwlwifi: remove messages from queue wake/stop

The only reason we ever stop/wake queues at
the transport level is now that they become
full (or non-full), so the messages aren't
useful any more -- remove 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>
12 years agoiwlwifi: more status bit factoring
Don Fry [Wed, 7 Mar 2012 17:52:37 +0000 (09:52 -0800)]
iwlwifi: more status bit factoring

Continue splitting the status bits between transport and op_mode.
All but a few are separated.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move setting up fw parameters
Meenakshi Venkataraman [Wed, 7 Mar 2012 17:52:36 +0000 (09:52 -0800)]
iwlwifi: move setting up fw parameters

Gather parameters required to configure the
transport layer before invoking the transport
configuration API.

Change-Id: I5b39da284af6d9b5432a08911b4e1173a4d7207d
Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: configure transport layer from dvm op mode
Meenakshi Venkataraman [Wed, 7 Mar 2012 17:52:35 +0000 (09:52 -0800)]
iwlwifi: configure transport layer from dvm op mode

Introduce the iwl_trans_config struct which contains
state variables that only the op mode can determine,
but which the transport layer needs to know.

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: log stop / wake queues
Emmanuel Grumbach [Wed, 7 Mar 2012 17:52:34 +0000 (09:52 -0800)]
iwlwifi: log stop / wake queues

There were a few missing occurences when we get PASSIVE_NO_RX
notification.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: make tx_cmd_pool kmem cache global
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:33 +0000 (09:52 -0800)]
iwlwifi: make tx_cmd_pool kmem cache global

Otherwise we are not able to run more than one device per driver:

[   24.743045] kmem_cache_create: duplicate cache iwl_dev_cmd
[   24.743051] Pid: 3165, comm: NetworkManager Not tainted 3.3.0-rc2-wl+ #5
[   24.743054] Call Trace:
[   24.743066]  [<ffffffff811717d5>] kmem_cache_create+0x655/0x700
[   24.743101]  [<ffffffffa03b9f8b>] iwl_alive_notify+0x1cb/0x1f0 [iwlwifi]
[   24.743111]  [<ffffffffa03ba442>] iwl_load_ucode_wait_alive+0x1b2/0x220 [iwlwifi]
[   24.743142]  [<ffffffffa03ba893>] iwl_run_init_ucode+0x73/0x100 [iwlwifi]
[   24.743152]  [<ffffffffa03b8fa1>] __iwl_up+0x81/0x220 [iwlwifi]
[   24.743161]  [<ffffffffa03b91c0>] iwlagn_mac_start+0x80/0x190 [iwlwifi]
[   24.743188]  [<ffffffffa03307b3>] ieee80211_do_open+0x293/0x770 [mac80211]

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
12 years agoiwlwifi: separate status to priv and trans
Don Fry [Wed, 7 Mar 2012 17:52:32 +0000 (09:52 -0800)]
iwlwifi: separate status to priv and trans

The shared status bits are a mixture of transport and op mode bits.
Some are used just by one or the other, some are shared.  Begin the
de-tangling of these bits.

Signed-off-by: Don Fry <donald.h.fry@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: add option to test MFP
David Spinadel [Wed, 7 Mar 2012 17:52:31 +0000 (09:52 -0800)]
iwlwifi: add option to test MFP

Add a Kconfig symbol to enable MFP for testing even
if the firmware file doesn't advertise it.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: fixed testmode notifications length
Amit Beka [Wed, 7 Mar 2012 17:52:30 +0000 (09:52 -0800)]
iwlwifi: fixed testmode notifications length

The length of iwl_rx_packet doesn't include the
dword for the length itself, so add it manually.

Signed-off-by: Amit Beka <amit.beka@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: add testmode command for rx forwarding
Amit Beka [Wed, 7 Mar 2012 17:52:29 +0000 (09:52 -0800)]
iwlwifi: add testmode command for rx forwarding

Added a testmode command which tells iwl_rx_dispatch
to send the RX both as a notification to nl80211 and
with the registered RX handlers.

This is used for monitoring RX from userspace while preserving
the regular flows in the driver.

Signed-off-by: Amit Beka <amit.beka@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: reintroduce iwl_enable_rfkill_int
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:28 +0000 (09:52 -0800)]
iwlwifi: reintroduce iwl_enable_rfkill_int

If device is disabled by rfkill switch, do not enable all interrupts,
but only CSR_INT_BIT_RF_KILL to receive rfkill state change. Unblocking
other interrupts might cause problems, since driver can not be prepared
for receive them.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
12 years agoiwlwifi: print DMA stop timeout error only if it happened
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:27 +0000 (09:52 -0800)]
iwlwifi: print DMA stop timeout error only if it happened

iwl_poll_direct_bit() return negative error value on timeout,
positive values do not indicate an error.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
12 years agoiwlwifi: use writeb,writel,readl directly
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:26 +0000 (09:52 -0800)]
iwlwifi: use writeb,writel,readl directly

That change will save us some CPU cycles at run time. Having port-based
I/O seems to be not possible for PCIe devices.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
12 years agoiwlwifi: cleanup/fix memory barriers
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:25 +0000 (09:52 -0800)]
iwlwifi: cleanup/fix memory barriers

wmb(), rmb() are not needed when writel(), readl() are used as
accessors for MMIO. We use them indirectly via iowrite32(),
ioread32().

What is needed mmiowb(), for synchronizing writes coming from
different CPUs on PCIe bridge (see in patch comments). This
fortunately is not needed on x86, where mmiowb() is just
defined as compiler barrier. As iwlwifi devices are most likely
not used on anything other than x86, this is not so important
fix.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
12 years agoiwlwifi: always check if got h/w access before write
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:24 +0000 (09:52 -0800)]
iwlwifi: always check if got h/w access before write

Before we write to the device registers always check if
iwl_grap_nic_access() was successful.

On the way change return type of grab_nic_access() to bool, and add
likely()/unlikely() statement.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
12 years agoiwlwifi: dump stack when fail to gain access to the device
Stanislaw Gruszka [Wed, 7 Mar 2012 17:52:23 +0000 (09:52 -0800)]
iwlwifi: dump stack when fail to gain access to the device

Print dump stack when the device is not responding. This should give
some more clue about the reason of failure. Also change the message we
print, since "MAC in deep sleep" is kinda confusing.

On the way add unlikely(), as fail to gain NIC access is hmm ...
unlikely.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
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>
12 years agoiwlwifi: return error if loading uCode failed
Johannes Berg [Wed, 7 Mar 2012 17:52:22 +0000 (09:52 -0800)]
iwlwifi: return error if loading uCode failed

In "iwlwifi: consolidate the start_device flow"
the code flow changed and the firmware is now
loaded by the transport layer, but the change
unfortunately lost error checking -- restore.

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>
12 years agoiwlwifi: remove unused max_nrg_cck from sensitivity and constify
Johannes Berg [Wed, 7 Mar 2012 17:52:21 +0000 (09:52 -0800)]
iwlwifi: remove unused max_nrg_cck from sensitivity and constify

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

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: make EEPROM enhanced TX power a bool
Johannes Berg [Wed, 7 Mar 2012 17:52:20 +0000 (09:52 -0800)]
iwlwifi: make EEPROM enhanced TX power a bool

There's no need to carry around the function
pointer when a boolean indicating that the
EEPROM stores enhanced TX power information
is sufficient.

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>
12 years agoiwlwifi: move BT/HT params to shared
Johannes Berg [Wed, 7 Mar 2012 17:52:19 +0000 (09:52 -0800)]
iwlwifi: move BT/HT params to shared

Hardware parameters will be shared, so
move the definitions into the shared
header file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: remove BT handlers from lib_ops
Johannes Berg [Wed, 7 Mar 2012 17:52:18 +0000 (09:52 -0800)]
iwlwifi: remove BT handlers from lib_ops

There's no need to have operations for
these as they simply depend on whether
the device has built-in bluetooth, so
just duplicate the information already
there (whether bt_params is present or
not).

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>
12 years agoiwlwifi: transport's tx_agg_disable must be atomic
Johannes Berg [Wed, 7 Mar 2012 17:52:17 +0000 (09:52 -0800)]
iwlwifi: transport's tx_agg_disable must be atomic

At least as long as it is called from the reclaim
flow (iwlagn_check_ratid_empty) it must be atomic.

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>
12 years agoiwlwifi: redesign PASSIVE_NO_RX workaround
Johannes Berg [Wed, 7 Mar 2012 17:52:16 +0000 (09:52 -0800)]
iwlwifi: redesign PASSIVE_NO_RX workaround

The PASSIVE_NO_RX workaround currently crosses
through the op_mode and transport layers, which
is a bit odd. This also isn't necessary, if the
transport simply reports when queues are full
(or no longer full) the op_mode can keep track
of this state, and report to mac80211 only what
*it* thinks is appropriate. What is appropriate
can then be based on whether queues should be
stopped to wait for RX or not.

This significantly simplifies the transport API,
it no longer needs to expose anything to stop a
queue, nor to wake "any" queue, this can all be
handled in the upper layer completely.

Also simplify the handling to not be dependent
on the context, that makes little sense as the
queues are shared and both contexts have to be
on the same channel anyway.

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>
12 years agoiwlwifi: remove unused argument from iwlagn_suspend
Johannes Berg [Wed, 7 Mar 2012 17:52:15 +0000 (09:52 -0800)]
iwlwifi: remove unused argument from iwlagn_suspend

There's not much point in passing priv and
hw pointers since they can be derived from
each other, and the function doesn't use
the hw pointer anyway. Remove 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>
12 years agoiwlwifi: remove two unused arguments in testmode
Johannes Berg [Wed, 7 Mar 2012 17:52:14 +0000 (09:52 -0800)]
iwlwifi: remove two unused arguments in testmode

The dump functions never access the incoming
attributes, so don't pass 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>
12 years agoiwlwifi: remove unused argument from iwl_init_hw_rates
Johannes Berg [Wed, 7 Mar 2012 17:52:13 +0000 (09:52 -0800)]
iwlwifi: remove unused argument from iwl_init_hw_rates

The function never uses the priv argument as it
only fills in the passed data, so remove the
argument.

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>
12 years agoiwlwifi: move iwl_sta_id_or_broadcast to user
Johannes Berg [Wed, 7 Mar 2012 17:52:12 +0000 (09:52 -0800)]
iwlwifi: move iwl_sta_id_or_broadcast to user

There's only one user, so the function
can be moved into the correct file. It
also loses an argument along the way.

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>