firefly-linux-kernel-4.4.55.git
12 years agoath6kl: issue wmi disconnect after notifying cfg80211
Thomas Pedersen [Wed, 16 May 2012 20:41:13 +0000 (13:41 -0700)]
ath6kl: issue wmi disconnect after notifying cfg80211

ath6kl would issue a wmi disconnect command in response to a remote
disconnect and return early without notifying cfg80211, only sending a
cfg80211_disconnected (with reason code always 3) in response to the
second disconnect firmware event.

Pass the right reason code to cfg80211 on the first disconnect instead.

This fixes at least one bug where a p2p client would stop trying to
connect after receiving a stale RSN deauth which was reported to
cfg80211 as GO leaving BSS.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Include match ssid list in scheduled scan
Naveen Singh [Wed, 16 May 2012 10:29:00 +0000 (13:29 +0300)]
ath6kl: Include match ssid list in scheduled scan

Scheduled scan implementation was only taking probed list into
consideration. The matched list was dropped. This would cause
FW not to report the AP as the list never had that AP's SSID
populated. This was causing long connection time when supplicant
would just issue a wild card SSID in probed list. As a part of
this implementation, ath6kl driver would create a complete list
by taking both probed and matched list and pass it to FW. FW would
probe for the SSID that it needs to and would match against the
relevant SSIDS that is been configured.

kvalo: whitespace changes, less indentation in the for loop, use ++

Signed-off-by: Naveen Singh <navesing@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: enable enhanced bmiss detection
Thomas Pedersen [Tue, 15 May 2012 07:09:23 +0000 (00:09 -0700)]
ath6kl: enable enhanced bmiss detection

Enable enhanced bmiss detection if the firmware supports it. This
feature is only enabled on some firmwares since it comes with a power
cost.

Also add a few missing command ids to keep the enums straight.

kvalo: fix a compiler with ath6kl_err(), add few empty lines

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Add wow multicast firmware capability support
Naveen Gangadharan [Fri, 11 May 2012 21:19:09 +0000 (14:19 -0700)]
ath6kl: Add wow multicast firmware capability support

Infrastructure to enable Multicast WOW support based on
firmware capability added to the driver.This enables
different customers or chips to control this feature based
on firmware capability.

kvalo: Firmware capability infrastructure for multicast wow feature,
indetation fixes.

Signed-off-by: Naveen Gangadharan <ngangadh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Use correct max-scan-SSIDs limit
Jouni Malinen [Wed, 9 May 2012 19:14:51 +0000 (22:14 +0300)]
ath6kl: Use correct max-scan-SSIDs limit

The currently used firmware images support 16 SSIDs in the scan
request (indexes 0..15), so update the host driver to use the same
limit to allow some more SSIDs to be scanned per request. In addition,
change the max-index to max-SSIDs to make it easier to understand the
implementation and fix couple of off-by-one checks that could limit
the maximum number of entries too strictly.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl_sdio: Fix the EAPOL out of order issue
Vivek Natarajan [Wed, 2 May 2012 09:25:25 +0000 (14:55 +0530)]
ath6kl_sdio: Fix the EAPOL out of order issue

Send the EAPOL and management frames in the same AC_VO queue. The issue
happens when the AP supports QOS, the management frames are sent to AC_VO
queue and EAP frame goes to AC_BE queue. Even though the EAP frame is
queued before the DEAUTH management frame, as they are queued on different
h/w queues, order of delivery between these frames cannot be controlled.

This fixes the connection failure seen in P2P case.

Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Complete failed tx packet in ath6kl_htc_tx_from_queue()
Vasanthakumar Thiagarajan [Thu, 26 Apr 2012 14:56:14 +0000 (20:26 +0530)]
ath6kl: Complete failed tx packet in ath6kl_htc_tx_from_queue()

Return status of ath6kl_htc_tx_issue() is ignored in
ath6kl_htc_tx_from_queue(), but failed tx packet is
is not cleaned up. To fix memory leak in this case, call
completion with error. Also, throw an error debug message
when tx fails in ath6kl_sdio_write_async() due to shortage
in bus request buffer.

kvalo: change the error message to WARN_ON_ONCE()

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Update netstats for some of the tx failrues in ath6kl_data_tx()
Vasanthakumar Thiagarajan [Thu, 26 Apr 2012 14:56:13 +0000 (20:26 +0530)]
ath6kl: Update netstats for some of the tx failrues in ath6kl_data_tx()

There are few cases where the tx skb is dropped but netstats is
not updated, fix this.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: assign Tx packet drop threshold per endpoint on htc pipe layer
Kevin Fang [Fri, 27 Apr 2012 01:18:02 +0000 (09:18 +0800)]
ath6kl: assign Tx packet drop threshold per endpoint on htc pipe layer

On the htc mbox layer, it will assign each endpoint (AC) with a
different Tx-packet-drop threshold, so lower priority AC is more
likely to drop packets and the cookies become more available to higher
priority AC.

On the htc pipe layer, assign the tx packet drop threshold as well, it
will let AC to drop packets when cookies below the tx packet drop
threshold.

Signed-off-by: Kevin Fang <kevin.fang@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: handle background(BK) stream properly on htc mbox layer
Kevin Fang [Fri, 27 Apr 2012 01:18:01 +0000 (09:18 +0800)]
ath6kl: handle background(BK) stream properly on htc mbox layer

When a STA sends huge BK QoS data frame first and then sends BE/VI/VO
QoS data frame, the corresponding throughput becomes much lower than
that without sends BK QoS data frame before.

The root cause is that when station send BK stream, the tx credits of
BK stream don't return back to higher priority QoS stream such as BE,
VI, and VO stream. This patch will handle BK stream properly, when
there is higher priority QoS stream, it will seek tx credits from BK
stream properly.

Signed-off-by: Kevin Fang <kevin.fang@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Fix bss filter setting while scanning
Vasanthakumar Thiagarajan [Wed, 25 Apr 2012 07:09:06 +0000 (12:39 +0530)]
ath6kl: Fix bss filter setting while scanning

bss filter is configured to allow the frames from all the bss other
than the currenly connected one, this is done when a scan is requested
in connected state. There is no reason to filter out the currently
connected bss, configure the filter to allow all the bss. This would
fix the reporting of stale rssi of the current bss while scanning.

Reported-by: Naveen singh <navesing@qca.qualcomm.com>
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Don't advertise HT capability for incapable firmware
Vasanthakumar Thiagarajan [Wed, 25 Apr 2012 07:08:18 +0000 (12:38 +0530)]
ath6kl: Don't advertise HT capability for incapable firmware

With firmwares which do not support rsn capability override
(ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE) from host would
cause 4-way handshake failure when HT cap is advertised.
To fix this, do not advertise HT cap with cfg80211 for
those fw.

kvalo: fix a checkpatch warning

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Multicast filter support in wow suspend and non-suspend
Naveen Gangadharan [Fri, 20 Apr 2012 19:46:56 +0000 (12:46 -0700)]
ath6kl: Multicast filter support in wow suspend and non-suspend

This patch enables all multicast packets in non suspend mode
and enable multicast filtering in wow suspend mode. This also
fixes a bug in multicast where the driver assumed disable
multicast-all command disabled/filtered all multicast
packets, which was wrong assumption, because firmware will
apply the programmed filter.

Multicast requirements
 - Enable forward all multicast packets(no filtering) in
      non suspend mode.
 - Enable multicast filtering in wow suspend mode for both
      AP and CLIENT.

kvalo: fix a checkpatch warning and drop unrelated newline removal

Signed-off-by: Naveen Gangadharan <ngangadh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: check for sband existence when creating scan cmd
Thomas Pedersen [Tue, 24 Apr 2012 19:50:41 +0000 (12:50 -0700)]
ath6kl: check for sband existence when creating scan cmd

The patch "ath6kl: support fw reporting phy capabilities" gave the
firmware the ability to disable certain wiphy supported bands. Check if
this is the case in ath6kl_wmi_beginscan_cmd to avoid dereferencing a
NULL pointer.

kvalo: change the patch so that there's no code between declarations

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: include in.h explicitly
Luis R. Rodriguez [Tue, 24 Apr 2012 02:58:50 +0000 (19:58 -0700)]
ath6kl: include in.h explicitly

Do not assume anyone before us includes it for us.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: unblock fwlog_block_read() on exit
Thomas Pedersen [Fri, 20 Apr 2012 18:33:07 +0000 (11:33 -0700)]
ath6kl: unblock fwlog_block_read() on exit

Complete the waiting fwlog_block_read on debugfs cleanup, otherwise
userspace and module unload might softlock.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: fix an indenting issue
Dan Carpenter [Fri, 20 Apr 2012 06:44:44 +0000 (09:44 +0300)]
ath6kl: fix an indenting issue

This is supposed to be pushed in one indent level.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: change || to &&
Dan Carpenter [Fri, 20 Apr 2012 06:43:28 +0000 (09:43 +0300)]
ath6kl: change || to &&

The original conditions are always true.  I think && was intended here,
but I don't have the hardware to test.  Could you take a look?

kvalo: Chilam confirmed that the fix is valid

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: disallow WoW with multiple vifs
Thomas Pedersen [Thu, 19 Apr 2012 23:29:19 +0000 (16:29 -0700)]
ath6kl: disallow WoW with multiple vifs

The ath6kl fw does not have enough memory to support the WoW filters of
more than one vif. Disallow WoW suspend if this is the case.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: only restore supported HT caps
Thomas Pedersen [Thu, 19 Apr 2012 22:31:57 +0000 (15:31 -0700)]
ath6kl: only restore supported HT caps

Now that we know the supported PHY capabilities, only restore supported
bands / HT capabilities in firmware when stopping AP.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: support fw reporting phy capabilities
Thomas Pedersen [Thu, 19 Apr 2012 22:31:56 +0000 (15:31 -0700)]
ath6kl: support fw reporting phy capabilities

Currently the supported bands are just hard coded in the driver.
However, the ath6kl FW will include its 11n and band capabilites in a
WMI_READY event. Handle this and report capabilites to cfg80211
accordingly.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl clear the MMC_PM_KEEP_POWER for cutpower case
Ming Jiang [Wed, 18 Apr 2012 01:25:04 +0000 (09:25 +0800)]
ath6kl clear the MMC_PM_KEEP_POWER for cutpower case

ath6kl: If wow deepsleep pno suspend failure driver will choose cutpower.
in this scenario MMC_PM_KEEP_POWER should be cleared so that mmc will power
off the ar6000

kvalo: remove extra parenthesis

Signed-off-by: Ming Jiang <mjiang@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Configure probed SSID list consistently
Jouni Malinen [Mon, 16 Apr 2012 16:28:03 +0000 (19:28 +0300)]
ath6kl: Configure probed SSID list consistently

Set max_scan_ssids and max_sched_scan_ssids to same value. These use the
same probed SSID list, so there is no point in using different maximum
number of SSIDs.

Clear probed SSID entries that are not used. This was already done for
sched_scan, but not for scan. Be consistent and clear the table for both
cases to avoid leaving bogus entries.

In addition, share the same function for setting the probed SSIDs for
scan and sched_scan paths. This fixes setting of wildcard SSID flag
(ANY_SSID_FLAG) and changes the scan path to use probed SSID index
consistently (i.e., start with 0 similarly to sched_scan; firmware
will handle the needed internal mapping).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Remove incorrect Probe Response offload support for Interworking
Jouni Malinen [Mon, 16 Apr 2012 16:25:35 +0000 (19:25 +0300)]
ath6kl: Remove incorrect Probe Response offload support for Interworking

ath6kl does not support Probe Response offloading for Interworking (IEEE
802.11u), so remove the incorrectly added capability flag for it.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Fix bug in bg scan configuration in schedule scan
Subramania Sharma Thandaveswaran [Mon, 16 Apr 2012 10:39:57 +0000 (16:09 +0530)]
ath6kl: Fix bug in bg scan configuration in schedule scan

Background scan interval should not be modified while starting
schedule scanning as it changes the bg scan interval when connected to AP.
Use the currently configured interval instead.

kvalo: improve commit log

Signed-off-by: Subramania Sharma <sharmat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Retain bg scan period value modified by the user
Raja Mani [Mon, 16 Apr 2012 10:39:56 +0000 (16:09 +0530)]
ath6kl: Retain bg scan period value modified by the user

Added a new member bg_scan_period in struct ath6kl_vif
to retain background scan period value configured via debugfs
entry 'bgscan_interval'. This backup is needed in schedule scan
path while configuring scan parameters.

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: list_first_entry() is never NULL
Dan Carpenter [Fri, 13 Apr 2012 19:27:18 +0000 (22:27 +0300)]
ath6kl: list_first_entry() is never NULL

We can remove the NULL check here.  It triggers a Smatch warning because
list_first_entry() never is NULL and people who check for it normally
intend to check for list_empty() instead.  In these cases however,
we've already verified that the lists are not empty.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Normalize use of FW_DIR
Tim Gardner [Fri, 13 Apr 2012 17:17:27 +0000 (11:17 -0600)]
ath6kl: Normalize use of FW_DIR

kvalo: do the same changes for ar6004 hw1.2 as well

Cc: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: allow deepsleep_suspend function when wlan interface down
Ming Jiang [Fri, 13 Apr 2012 13:09:25 +0000 (21:09 +0800)]
ath6kl: allow deepsleep_suspend function when wlan interface down

Aafter wlan interface is down WLAN_ENABLED flags will be cleared and
deepsleep_suspend function will be blocked in this senario. This patch
allows deepsleep_suspend function when wlan interface down by removed
the WLAN_ENABLED flag checking.

kvalo: fix commit log

Signed-off-by: Ming Jiang <mjiang@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Fix system crash sometimes for USB hotplug
Ray Chen [Thu, 12 Apr 2012 12:48:34 +0000 (20:48 +0800)]
ath6kl: Fix system crash sometimes for USB hotplug

System crash because of NULL pointer reference due to
cleanup_scatter is not implemented for USB.

Signed-off-by: Ray Chen <raychen@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: merge split format strings into one
Kalle Valo [Thu, 12 Apr 2012 08:02:18 +0000 (11:02 +0300)]
ath6kl: merge split format strings into one

Found by checkpatch:

WARNING: quoted string split across lines

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: fix memory leak in ath6kl_fwlog_block_read()
Jesper Juhl [Wed, 11 Apr 2012 20:41:36 +0000 (22:41 +0200)]
ath6kl: fix memory leak in ath6kl_fwlog_block_read()

If, in
drivers/net/wireless/ath/ath6kl/debug.c::ath6kl_fwlog_block_read(),
the call to wait_for_completion_interruptible() returns -ERESTARTSYS
then we'll return without freeing the (as yet unused) memory we
allocated for 'buf' - thus leaking it.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Add AR6004 1.2 support for USB and SDIO
Ray Chen [Wed, 11 Apr 2012 02:03:13 +0000 (10:03 +0800)]
ath6kl: Add AR6004 1.2 support for USB and SDIO

Add the necessary change for AR6004 1.2 chip support

Signed-off-by: Ray Chen <raychen@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Configure 0 as rsn cap when it is not there in rsn ie
Vasanthakumar Thiagarajan [Tue, 10 Apr 2012 08:57:47 +0000 (14:27 +0530)]
ath6kl: Configure 0 as rsn cap when it is not there in rsn ie

Currently rsn capability is not set when it is not available in
rsn IE. Set it to 0 in firmware when it is not there in the ie to
make sure host and target are consistent.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: Fix possible unaligned memory access in ath6kl_get_rsn_capab()
Vasanthakumar Thiagarajan [Tue, 10 Apr 2012 08:05:47 +0000 (13:35 +0530)]
ath6kl: Fix possible unaligned memory access in ath6kl_get_rsn_capab()

alignment is not taken care in accessing pairwise cipher and AKM suite
count which are parsed from rsn ie. Fix this alignment issue.

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoath6kl: handle concurrent AP-STA channel switches
Thomas Pedersen [Fri, 6 Apr 2012 20:35:48 +0000 (13:35 -0700)]
ath6kl: handle concurrent AP-STA channel switches

If an ath6kl AP vif is beaconing on one channel, and a STA vif
associates on a different channel, a WMI_DISCONNECT event will be sent
to the AP vif. Make the AP vif follow the STA interface, and notify
userspace.

kvalo: fix a sparse warning with vif->next_chan

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
12 years agoMerge remote branch 'wireless-next/master' into ath6kl-next
Kalle Valo [Thu, 12 Apr 2012 06:45:11 +0000 (09:45 +0300)]
Merge remote branch 'wireless-next/master' into ath6kl-next

12 years agort2x00: do not generate seqno in h/w if QOS is disabled
Stanislaw Gruszka [Mon, 2 Apr 2012 11:21:06 +0000 (13:21 +0200)]
rt2x00: do not generate seqno in h/w if QOS is disabled

This is workaround H/W or F/W bug, see in code comments. Without the fix
ping can receive duplicated ICMP frames while associated with legacy AP.

Reported-by: Walter Goldens <goldenstranger@yahoo.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonet/wireless: ipw2x00: remove ssid_context struct
Stanislav Yakovlev [Sat, 7 Apr 2012 21:31:21 +0000 (17:31 -0400)]
net/wireless: ipw2x00: remove ssid_context struct

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 agonet/wireless: ipw2x00: remove unused libipw_measurement_report struct
Stanislav Yakovlev [Sat, 7 Apr 2012 08:44:40 +0000 (04:44 -0400)]
net/wireless: ipw2x00: remove unused libipw_measurement_report struct

and all referenced structs and corresponding enums because the driver
does not use it.

Note: keep libipw_info_element struct since it is still in use.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211: add channel switch notify event
Thomas Pedersen [Fri, 6 Apr 2012 20:35:47 +0000 (13:35 -0700)]
cfg80211: add channel switch notify event

The firmware may decide to switch channels while already beaconing, e.g.
in response to a cfg80211 connect request on a different vif. Add this
event to notify userspace when an AP or GO interface has successfully
migrated to a new channel, so it can update its configuration
accordingly.

Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath5k: Remove extraneous statements from ath5k_hw_proc_4word_tx_status and ath5k_hw_p...
Qasim Javed [Fri, 6 Apr 2012 01:40:15 +0000 (20:40 -0500)]
ath5k: Remove extraneous statements from ath5k_hw_proc_4word_tx_status and ath5k_hw_proc_2word_status.

Signed-off-by: Qasim Javed <qasimj@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211/mac80211: enable proper device_set_wakeup_enable handling
Johannes Berg [Wed, 4 Apr 2012 13:05:25 +0000 (15:05 +0200)]
cfg80211/mac80211: enable proper device_set_wakeup_enable handling

In WoWLAN, we only get the triggers when we actually get
to suspend. As a consequence, drivers currently don't
know that the device should enable wakeup. However, the
device_set_wakeup_enable() API is intended to be called
when the wakeup is enabled, not later when needed.

Add a new set_wakeup() call to cfg80211 and mac80211 to
allow drivers to properly call device_set_wakeup_enable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agowireless: Remove unnecessary ; from while (0) macros
Joe Perches [Tue, 3 Apr 2012 21:46:49 +0000 (14:46 -0700)]
wireless: Remove unnecessary ; from while (0) macros

Semicolons are not necessary after macros that end in while (0).
Remove them.

Simplify the macros with tests of
do { if (foo>size) memset1; else memset2;} while (0);
to a single line memset(,,min_t(size_t, foo, size))

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Add more recv stats.
Ben Greear [Tue, 3 Apr 2012 16:18:59 +0000 (09:18 -0700)]
ath9k: Add more recv stats.

This adds counters in various places that can drop packets on
rx without otherwise incrementing a counter.  It also counts
some non-error cases, such as becons and fragments received.

Should help with figuring out where packets are (and are not)
dropped.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Add tx-failed counter.
Ben Greear [Tue, 3 Apr 2012 16:16:55 +0000 (09:16 -0700)]
ath9k: Add tx-failed counter.

This counts any failure during getting packets into
the DMA buffers, including out-of-memory, etc.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: update to DFS pattern detector interface
Zefir Kurtisi [Tue, 3 Apr 2012 15:15:51 +0000 (17:15 +0200)]
ath9k: update to DFS pattern detector interface

Follow updates in DFS pattern detector interface:
a) use given pulse event structure
b) adapt to boolean return value of add_pulse()

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: add DFS pattern detector instance to ath_softc
Zefir Kurtisi [Tue, 3 Apr 2012 15:15:50 +0000 (17:15 +0200)]
ath9k: add DFS pattern detector instance to ath_softc

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: add DFS pattern detector
Zefir Kurtisi [Tue, 3 Apr 2012 15:15:49 +0000 (17:15 +0200)]
ath9k: add DFS pattern detector

This adds a DFS pattern detector to ath9k. It is fed with pulse events
by the radar pulse detector and reports in place whether a pattern
was detected. On detection, the result is reported as radar event to
the DFS management component in the upper layer.

Currently the ETSI DFS domain is supported with detector lines for
the patterns defined by EN-301-893 v1.5.1. Support for FCC and JP
will be added gradually.

To include the pattern detector, ath9k must be built with support
for DFS certified config flag set (CONFIG_ATH9K_DFS_CERTIFIED).

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: clean up an ieee80211_do_open error path
Johannes Berg [Tue, 3 Apr 2012 12:45:54 +0000 (14:45 +0200)]
mac80211: clean up an ieee80211_do_open error path

Eliad's comment prompted me to look closer at
the error paths in ieee80211_do_open() and I
found one that should use the error labels.

Also add a comment about the clear_bit since
in many error cases the bit hasn't been set.

Cc: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: add improved HW queue control
Johannes Berg [Tue, 3 Apr 2012 14:28:50 +0000 (16:28 +0200)]
mac80211: add improved HW queue control

mac80211 currently only supports one hardware queue
per AC. This is already problematic for off-channel
uses since if we go off channel while the BE queue
is full and then try to send an off-channel frame
the frame will never go out. This will become worse
when we support multi-channel since then a queue on
one channel might be full, but we have to stop the
software queue for all channels. That is obviously
not desirable.

To address this problem allow drivers to register
more hardware queues, and allow them to map them to
virtual interfaces. When they stop a hardware queue
the corresponding AC software queues on the correct
interfaces will be stopped as well. Additionally,
there's an off-channel queue to solve that problem
and a per-interface after-DTIM beacon queue. This
allows drivers to manage software queues closer to
how the hardware works.

Currently, there's a limit of 16 hardware queues.
This may or may not be sufficient, we can adjust it
as needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: add explicit monitor interface if needed
Johannes Berg [Tue, 3 Apr 2012 12:35:57 +0000 (14:35 +0200)]
mac80211: add explicit monitor interface if needed

The queue mapping redesign that I'm planning to do
will break pure injection unless we handle monitor
interfaces explicitly. One possible option would
be to have the driver tell mac80211 about monitor
mode queues etc., but that would duplicate the API
since we already need to have queue assignments
handled per virtual interface.

So in order to solve this, have a virtual monitor
interface that is added whenever all active vifs
are monitors. We could also use the state of one
of the monitor interfaces, but managing that would
be complicated, so allocate separate state.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: manage AP netdev carrier state
Johannes Berg [Tue, 3 Apr 2012 08:24:00 +0000 (10:24 +0200)]
mac80211: manage AP netdev carrier state

The AP netdev is really only active when beaconing, so
manage the carrier state accordingly. Also do that for
VLAN interfaces enslaved to a given AP interface.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Check basic rates when peering
Ashok Nagarajan [Tue, 3 Apr 2012 04:21:22 +0000 (21:21 -0700)]
mac80211: Check basic rates when peering

Section 13.2.3 of IEEE 80211s standard requires BSSBasicRateSet of mesh nodes
to be identical to establish peer link.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Modify sta_get_rates to give basic rates
Ashok Nagarajan [Tue, 3 Apr 2012 04:21:21 +0000 (21:21 -0700)]
mac80211: Modify sta_get_rates to give basic rates

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Indicate basic rates when adding rate IEs
Ashok Nagarajan [Tue, 3 Apr 2012 04:21:20 +0000 (21:21 -0700)]
mac80211: Indicate basic rates when adding rate IEs

Basic rates are added with supported rates IE and extended supported
rates IE.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Use mandatory rates as basic rates when starting mesh
Ashok Nagarajan [Tue, 3 Apr 2012 04:21:19 +0000 (21:21 -0700)]
mac80211: Use mandatory rates as basic rates when starting mesh

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2x00: configure different txdesc parameters for non HT channel
Stanislaw Gruszka [Wed, 4 Apr 2012 14:15:33 +0000 (16:15 +0200)]
rt2x00: configure different txdesc parameters for non HT channel

This is needed when we are concted to non 11n AP.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agob43: claim support for IBSS RSN
Antonio Quartulli [Sat, 31 Mar 2012 21:35:40 +0000 (00:35 +0300)]
b43: claim support for IBSS RSN

The driver now claims to support IBSS/RSN. Group key configuration in hardware
is skipped. Software encryption is used for multicast communications.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years ago{nl,cfg}80211: Support for mesh synchronization
Javier Cardona [Sat, 31 Mar 2012 18:31:33 +0000 (11:31 -0700)]
{nl,cfg}80211: Support for mesh synchronization

Report Toffset to userspace.
Let userspace select the mesh synchronization method.

Signed-off-by: Marco Porsch <marco.porsch@s2005.tu-chemnitz.de>
Signed-off-by: Pavel Zubarev <pavel.zubarev@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Implement mesh synchronization framework
Javier Cardona [Sat, 31 Mar 2012 18:31:32 +0000 (11:31 -0700)]
mac80211: Implement mesh synchronization framework

This patch adds MBSS extensible synchronization framework (Sec.
13.13.2 of IEEE Std. 802.11-2012).

The framework is implemented via an ops table which defines the
following functions:

    rx_bcn_presp() - this is called every time a mesh beacon is
received.
    adjust_tbtt() - this is called immediately before a beacon is about
to be transmitted.

The default neighbor offset synchronization defined in the standard is
implemented.  We also provide template functions for vendor specific
methods.

When neighbor offset synchronization is active (which is the default)
mesh neighbors in the same MBSS will track timing offsets to each other
and compensate clock drift.

In our tests we observed that this mesh synchronization implementation
successfully corrected drifts between stations of ~2PPM while
introducing a jitter of ~20us.

It is also possible to test this framework on mac80211_hwsim simulated
phys to see how it behaves under different topologies, over poor links,
etc.

Signed-off-by: Marco Porsch <marco.porsch@s2005.tu-chemnitz.de>
Signed-off-by: Pavel Zubarev <pavel.zubarev@gmail.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Allow tsf increments via debugfs
Javier Cardona [Sat, 31 Mar 2012 18:31:31 +0000 (11:31 -0700)]
mac80211: Allow tsf increments via debugfs

Reading and writing back the tsf value via tsf is too slow if one wants
to make small increments to this timer.  With this change you can use
the syntax "+=<some value>" or "-=<some value>" to add or substract a
value from the tsf counter.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211_hwsim: Fill timestamp beacon at the time it is transmitted
Javier Cardona [Sat, 31 Mar 2012 18:31:30 +0000 (11:31 -0700)]
mac80211_hwsim: Fill timestamp beacon at the time it is transmitted

Generate more acurate tsf values in hwsim by setting the tsf value on
trasmitted beacons immediately before they are moved to the rx path.
Also, adjust the beacon timestamp to be the time at which the first byte
of the timestamp is transmitted.

With these changes the observed tsf offset between two hwsim/mesh peers
is 0 (unless the offset is modified via debugfs)

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: sanity check for null SSID
Stanislaw Gruszka [Thu, 29 Mar 2012 14:30:41 +0000 (16:30 +0200)]
mac80211: sanity check for null SSID

While associated we should never have empty SSID, but life can be full
of surprises, and is allways better to print a warning than crash.

Before memcpy() in ieee80211_probereq_get() check ssid_len instead of
ssid pointer, sice pointer it always passed by "ssidie + 2" expression
to send probe functions, so practically never can be NULL.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: use IEEE80211_NUM_ACS
Johannes Berg [Wed, 28 Mar 2012 09:04:29 +0000 (11:04 +0200)]
mac80211: use IEEE80211_NUM_ACS

When comparing hw->queues to determine if the
device is QoS capable, use IEEE80211_NUM_ACS
instead of just 4.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: lazily stop queues in add_pending
Johannes Berg [Wed, 28 Mar 2012 09:04:28 +0000 (11:04 +0200)]
mac80211: lazily stop queues in add_pending

When adding pending SKBs there's no need to
stop all queues, we only need to stop those
that we're adding frames to. Implement that
by lazily stopping a queue as we add an SKB.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: debounce queue stop/wake
Johannes Berg [Wed, 28 Mar 2012 09:04:27 +0000 (11:04 +0200)]
mac80211: debounce queue stop/wake

When the queue status changes we need to do a fair
bit of work, so ignore no-op changes early.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: decouple # of netdev queues from HW queues
Johannes Berg [Wed, 28 Mar 2012 09:04:26 +0000 (11:04 +0200)]
mac80211: decouple # of netdev queues from HW queues

When we get more hardware queues, we'll still want
to only have netdev queues per AC, so set it up in
that way. If the hardware doesn't support QoS (by
not supporting at least 4 queues) the netdevs get
a single queue only (this is no change in behavior
as there are no drivers with 2 or 3 queues today.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: refuse TX queue configuration on non-QoS HW
Johannes Berg [Wed, 28 Mar 2012 09:04:25 +0000 (11:04 +0200)]
mac80211: refuse TX queue configuration on non-QoS HW

Drivers that don't support QoS also don't support
setting up their ACs, catch that early. While at
it, remove the input check since cfg80211 does it
now.

Also fix up the restart code to not try to set up
the queues in this case.

Finally also change the tx_conf array to have
IEEE80211_NUM_ACS entries instead of # of queues
since that's what it really needs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocfg80211/nl80211: clarify TX queue API
Johannes Berg [Wed, 28 Mar 2012 09:04:24 +0000 (11:04 +0200)]
cfg80211/nl80211: clarify TX queue API

With the plan to change mac80211's queue API to
not map ACs to queues 1:1, it seems necessary to
clarify some APIs that act on ACs rather than on
queues to spell that out explicitly. Do this.

Also verify that the AC number given is valid.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: remove antenna_sel_tx TX info field
Johannes Berg [Wed, 28 Mar 2012 09:04:23 +0000 (11:04 +0200)]
mac80211: remove antenna_sel_tx TX info field

This field is never set to anything non-zero in
mac80211, so we should be able to remove it.
Unfortunately though, the iwlwifi and iwlegacy
drivers use it for their internal TX status
processing (which shouldn't be using the rate
control API to start with), so add a new field
"status.antenna" for them, at least for now.

In the future, I plan to use the new field to
hold the hardware queue, while the SKB's queue
mapping holds the AC.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: notify driver of rate control updates
Johannes Berg [Fri, 30 Mar 2012 06:43:32 +0000 (08:43 +0200)]
mac80211: notify driver of rate control updates

Devices that have internal rate control need to be
notified when the bandwidth or SMPS state changes
just like external rate control algorithms get a
notification now.

Add this notification and clarify the change bits
while at it, the HT_CHANGED bit really meant only
bandwidth changed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: remove queue stop on rate control update
Johannes Berg [Wed, 28 Mar 2012 08:58:38 +0000 (10:58 +0200)]
mac80211: remove queue stop on rate control update

We currently stop the queue when changing the rate
control between 20/40 MHz in the BSS. This seems to
have been necessary when we actually changed the
channel, but now that we just update the station it
doesn't seem right any more. Remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: remove channel type argument from rate_update
Johannes Berg [Wed, 28 Mar 2012 08:58:37 +0000 (10:58 +0200)]
mac80211: remove channel type argument from rate_update

The channel type argument to the rate_update()
callback isn't really the correct way to give
the rate control algorithm about the desired
RX bandwidth of the peer.

Remove this argument, and instead update the
STA capabilities with 20/40 appropriately. The
SMPS update done by this callback works in the
same way, so this makes the callback cleaner.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: set HT channel before association
Johannes Berg [Wed, 28 Mar 2012 08:58:36 +0000 (10:58 +0200)]
mac80211: set HT channel before association

Changing the channel type during operation is
confusing to some drivers and will be hard to
handle in multi-channel scenarios. Instead of
changing the channel, set it to the right HT
channel before authenticating/associating and
don't change it -- just update the 20/40 MHz
restrictions in rate control as needed when
changed by the AP.

This also fixes a problem that Paul missed in
his fix for the "regulatory makes us deaf"
issue -- when we couldn't use 40 MHz we still
associated saying we were using 40 MHz, which
could in similarly broken APs make us never
even connect successfully.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: use AC constants
Johannes Berg [Tue, 27 Mar 2012 12:18:40 +0000 (14:18 +0200)]
mac80211: use AC constants

Use the AC constants instead of hard-coding
the numbers with comments.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: inline ieee80211_add_pending_skbs
Johannes Berg [Tue, 27 Mar 2012 12:18:39 +0000 (14:18 +0200)]
mac80211: inline ieee80211_add_pending_skbs

This is a trivial wrapper function, inline it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: make ieee80211_downgrade_queue static
Johannes Berg [Tue, 27 Mar 2012 12:18:38 +0000 (14:18 +0200)]
mac80211: make ieee80211_downgrade_queue static

There's no reason for it to not be static.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: clean up uAPSD TX code
Johannes Berg [Tue, 27 Mar 2012 12:18:37 +0000 (14:18 +0200)]
mac80211: clean up uAPSD TX code

Clean up the code formatting and also replace
the constant 0 by IEEE80211_AC_VO.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix mesh TX coding style
Johannes Berg [Tue, 27 Mar 2012 12:18:36 +0000 (14:18 +0200)]
mac80211: fix mesh TX coding style

Fix bad indentation & pointless if nesting.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomwifiex: don't use IEEE80211_MAX_QUEUES
Johannes Berg [Tue, 27 Mar 2012 12:07:59 +0000 (14:07 +0200)]
mwifiex: don't use IEEE80211_MAX_QUEUES

IEEE80211_MAX_QUEUES is an internal mac80211 value,
it is not guaranteed to be always 4. The firmware
API in mwifiex almost certainly doesn't care about
mac80211 changing though, so mwifiex shouldn't use
this value.

Maybe it should use IEEE80211_NUM_ACS instead and
that is what I'm doing here as at least that value
will probably never change, but maybe it should
have its own define instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: don't always advertise remain-on-channel
Johannes Berg [Mon, 26 Mar 2012 16:47:18 +0000 (18:47 +0200)]
mac80211: don't always advertise remain-on-channel

Not all devices are really capable of implementing
remain-on-channel, even if it is implemented in SW,
as they can't necessarily deal with channel changes
while associated.

Remove the WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL and add
it only if either the driver has remain_on_channel
implemented in the driver/device.

Also add it to all drivers that advertise P2P right
now since those definitely have to have it working.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agortlwifi: Add missing DMA buffer unmapping for PCI drivers
Larry Finger [Mon, 26 Mar 2012 15:48:20 +0000 (10:48 -0500)]
rtlwifi: Add missing DMA buffer unmapping for PCI drivers

In https://bugzilla.kernel.org/show_bug.cgi?id=42976, a system with driver
rtl8192se used as an AP suffers from "Out of SW-IOMMU space" errors. These
are caused by the DMA buffers used for beacons never being unmapped.

This bug was also reported at
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/961618

Reported-and-Tested-by: Da Xue <da@lessconfused.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: Add pr_fmt
Joe Perches [Mon, 26 Mar 2012 15:27:40 +0000 (08:27 -0700)]
iwlwifi: Add pr_fmt

Prefix dmesg output with "iwlwifi: " by
adding #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: fix unused variable warning
Oliver Hartkopp [Sun, 25 Mar 2012 06:43:24 +0000 (08:43 +0200)]
iwlwifi: fix unused variable warning

In the case of disabled CONFIG_IWLWIFI_DEBUGFS option the compiler complains
about the unused variable 'img'. Fix this by moving the 'img' definition.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath5k: Introduce _ath5k_printk to reduce code/text
Joe Perches [Mon, 19 Mar 2012 00:30:53 +0000 (17:30 -0700)]
ath5k: Introduce _ath5k_printk to reduce code/text

Macros can be converted to functions to reduce overall object size.

Convert the ATH5K_PRINTK macro to use _ath5k_printk.

Allyesconfig size is reduced ~10%

$ size drivers/net/wireless/ath/ath5k/built-in.o*
   text    data     bss     dec     hex filename
 211557    2032   40672  254261   3e135 drivers/net/wireless/ath/ath5k/built-in.o.new
 235412    2032   47296  284740   45844 drivers/net/wireless/ath/ath5k/built-in.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath: Add and use pr_fmt, convert printks to pr_<level>
Joe Perches [Mon, 19 Mar 2012 00:30:52 +0000 (17:30 -0700)]
ath: Add and use pr_fmt, convert printks to pr_<level>

Use a more current logging style.
Make sure all output is prefixed appropriately.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: split POWER_PMI status bit
Don Fry [Thu, 15 Mar 2012 20:27:06 +0000 (13:27 -0700)]
iwlwifi: split POWER_PMI status bit

Move the POWER_PMI to the op_mode where it is changed.  The trans needs
to check it frequently, so shadow the status in the trans and update it
in trans when it infrequently changes.

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 FW_ERROR to priv
Don Fry [Thu, 15 Mar 2012 20:27:05 +0000 (13:27 -0700)]
iwlwifi: move FW_ERROR to priv

The op_mode should check for FW_ERROR before calling send_cmd.  This
removes the need to test for FW_ERROR in the trans layer.

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: remove firmware info from iwl_shared
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:27:04 +0000 (13:27 -0700)]
iwlwifi: remove firmware info from iwl_shared

With error logging now completely handled in
the op_mode, the transport layer does not
need to know information about the loaded
firmware.

Remove this state information from the
iwl_shared data structure.

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: move iwl_get_single_channel_number and mark it static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:27:03 +0000 (13:27 -0700)]
iwlwifi: move iwl_get_single_channel_number and mark it static

iwl_get_single_channel_number is used only in
iwl-scan.c, move it there and mark it static.

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: move iwl_full_rxon_required and mark it static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:27:02 +0000 (13:27 -0700)]
iwlwifi: move iwl_full_rxon_required and mark it static

iwl_full_rxon_required is used only in
iwl-agn-rxon.c. Move it there and mark it
static.

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: move iwl_check_rxon_cmd and mark it static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:27:01 +0000 (13:27 -0700)]
iwlwifi: move iwl_check_rxon_cmd and mark it static

iwl_check_rxon_cmd is used only in
iwl-agn-rxon.c. Move it there and mark it
static.

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: move iwl_set_rxon_hwcrypto and mark it static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:27:00 +0000 (13:27 -0700)]
iwlwifi: move iwl_set_rxon_hwcrypto and mark it static

iwl_set_rxon_hwcrypto is used only in
iwl-agn-rxon.c. Move it there and mark it
static.

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: Move iwl_send_rxon_timing and make it static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:59 +0000 (13:26 -0700)]
iwlwifi: Move iwl_send_rxon_timing and make it static

iwl_send_rxon_timing is used only in
iwl-agn-rxon.c, move it there and mark it
static.

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: move iwl_init_geos to iwl-agn.c
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:58 +0000 (13:26 -0700)]
iwlwifi: move iwl_init_geos to iwl-agn.c

This is used only in one file, move it there
and make it static.

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: move ucode_type from shared to op_mode
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:57 +0000 (13:26 -0700)]
iwlwifi: move ucode_type from shared to op_mode

This variable holds the ucode currently
running on the device; which is determined by
op_mode, so move this parameter there.

Also, the name of the variable is a bit
misleading, so rename it to cur_ucode.

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: move ucode error log reporting to op_mode
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:56 +0000 (13:26 -0700)]
iwlwifi: move ucode error log reporting to op_mode

Error log reporting does not belong to the
transport layer, but to the op_mode loading
the ucode, as it is the entity which knows
about the ucode loaded, and what the error
information means.

Move device logging pointers from the
transport layer to op_mode.

With this change, transport layer only
reports an error to the op_mode, which will
figure out what to do with the error. This
causes the driver to now dump out error logs
when the command queue is stuck as well.

Also, move the debugfs entry for event logs
out of the transport layer and into 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: make iwl_nic_error static
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:55 +0000 (13:26 -0700)]
iwlwifi: make iwl_nic_error static

iwl_nic_error is used in iwl-agn.c only, move
it there and make it static.

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: use iwlagn_fw_error instead of iwl_nic_error
Meenakshi Venkataraman [Thu, 15 Mar 2012 20:26:54 +0000 (13:26 -0700)]
iwlwifi: use iwlagn_fw_error instead of iwl_nic_error

In the process, make iwlagn_fw_error
a non-static function, as it is used
by more than one file.

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>