]> git.proxmox.com Git - mirror_ubuntu-kernels.git/log
mirror_ubuntu-kernels.git
10 years agoath9k: Handle unsupported MAC versions early
Sujith Manoharan [Sat, 28 Dec 2013 04:17:11 +0000 (09:47 +0530)]
ath9k: Handle unsupported MAC versions early

There is no point in trying to bring up the chip when
the MAC version is not present in the supported list.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Move private HW callbacks to hw-ops.h
Sujith Manoharan [Sat, 28 Dec 2013 04:17:10 +0000 (09:47 +0530)]
ath9k: Move private HW callbacks to hw-ops.h

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove unused functions
Sujith Manoharan [Sat, 28 Dec 2013 04:17:09 +0000 (09:47 +0530)]
ath9k: Remove unused functions

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix "cc_lock" usage
Sujith Manoharan [Thu, 26 Dec 2013 02:44:40 +0000 (08:14 +0530)]
ath9k: Fix "cc_lock" usage

IRQ save/restore is not required for the cycle counters
since they are accessed only from softirq and process context.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Process BB watchdog events in the tasklet
Sujith Manoharan [Tue, 24 Dec 2013 05:14:26 +0000 (10:44 +0530)]
ath9k: Process BB watchdog events in the tasklet

Move the BB processing code to the tasklet and avoid
doing it in the ISR, there is no real benefit and this
makes the ISR less heavy.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove RX Poll
Sujith Manoharan [Tue, 24 Dec 2013 05:14:25 +0000 (10:44 +0530)]
ath9k: Remove RX Poll

This patch removes the convoluted and hacky method of
monitoring for connectivity. We rely on mac80211's connection
loss logic and doing it in the driver is not necessary.

The HW check for MAC/BB hangs is also simplified, there
is no need to have a separate work instance for it.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix baseband watchdog reset
Sujith Manoharan [Tue, 24 Dec 2013 05:14:24 +0000 (10:44 +0530)]
ath9k: Fix baseband watchdog reset

Do a HW reset only for required signatures.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Identify baseband watchdog signatures
Sujith Manoharan [Tue, 24 Dec 2013 05:14:23 +0000 (10:44 +0530)]
ath9k: Identify baseband watchdog signatures

A full HW reset is not required for all baseband watchdog
signatures. Some BB watchdog updates are benign and can
be discarded, some require re-programming of certain registers
and others require a chip reset.

This patch adds a routine to identify such signatures.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix baseband watchdog interrupts
Sujith Manoharan [Tue, 24 Dec 2013 05:14:22 +0000 (10:44 +0530)]
ath9k: Fix baseband watchdog interrupts

Program the required baseband watchdog interrupt
mask to ensure that the correct watchdog interrupts
are raised when the BB is hung for some reason.

Also, use the capability HW_BB_WATCHDOG instead of
relying on other flags.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix PHY restart workaround
Sujith Manoharan [Tue, 24 Dec 2013 05:14:21 +0000 (10:44 +0530)]
ath9k: Fix PHY restart workaround

The PHY restart workaround that handles baseband hangs
for packets with unsupported rates is required only
for a HW bug in AR9300 v2.2. All the subsequent chips in
the AR9003 family do not require this driver fix since
it has been addressed in the HW.

Since the value of the AR_PHY_RESTART register is written
with the default initvals, make sure that PHY restart is
always disabled once this particular BB hang signaure has
been encountered.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix MAC HW hang check for AR9003
Sujith Manoharan [Tue, 24 Dec 2013 05:14:20 +0000 (10:44 +0530)]
ath9k: Fix MAC HW hang check for AR9003

The current method of identifying MAC hangs is
convoluted and also, the signatures are wrong and
don't apply to all the chips in the AR9003 family.
Fix this by cleaning up the code and checking for
the correct hang signatures.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add HW callbacks for MAC/BB hang checks
Sujith Manoharan [Tue, 24 Dec 2013 05:14:19 +0000 (10:44 +0530)]
ath9k: Add HW callbacks for MAC/BB hang checks

This is required for adding separate hang check
routines for AR9002 and AR9003.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Register supported HW hang checks
Sujith Manoharan [Tue, 24 Dec 2013 05:14:18 +0000 (10:44 +0530)]
ath9k: Register supported HW hang checks

HW hang checks have to be done on a per-chip basis.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix max AMPDU size calculation
Sujith Manoharan [Tue, 24 Dec 2013 05:14:17 +0000 (10:44 +0530)]
ath9k: Fix max AMPDU size calculation

The maximum A-MPDU size is calculated in ath_tx_aggr_start(),
so there is no need to do it in node_attach() too. Also, make
sure that the correct size is calculated as described in
8.4.2.58.3.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agonet: wireless: brcm80211: Drop debug version with build date/time
Josh Triplett [Mon, 23 Dec 2013 21:55:03 +0000 (13:55 -0800)]
net: wireless: brcm80211: Drop debug version with build date/time

The kernel already has this information, and individual drivers
shouldn't duplicate that.  This also eliminates the use of __DATE__ and
__TIME__, which make the build non-deterministic.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: fix TSF offset calculation
Felix Fietkau [Fri, 20 Dec 2013 16:02:24 +0000 (17:02 +0100)]
ath9k_hw: fix TSF offset calculation

Since the unit is microseconds and not milliseconds, tv_sec needs to be
multiplied by 1000000, not 1000.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: fix gentimer callback without overflow handler
Felix Fietkau [Fri, 20 Dec 2013 15:18:45 +0000 (16:18 +0100)]
ath9k_hw: fix gentimer callback without overflow handler

If a gentimer has both the trigger and the overflow bits set, only
mask out the trigger bit if an overflow handler is present.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: fix sparse non static symbol warning
Wei Yongjun [Fri, 20 Dec 2013 02:22:51 +0000 (10:22 +0800)]
ath9k: fix sparse non static symbol warning

Fixes the following sparse warning:

drivers/net/wireless/ath/ath9k/spectral.c:500:24: warning:
 symbol 'rfs_spec_scan_cb' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agodrivers/net/wireless/hostap: Integer overflow
Wenliang Fan [Wed, 18 Dec 2013 05:56:12 +0000 (13:56 +0800)]
drivers/net/wireless/hostap: Integer overflow

The local variable 'value' comes from 'extra', a parameter of function
'prism2_ioctl_priv_prism2_param'. If a large number passed to 'value',
there would be an integer overflow in the following line:
local->passive_scan_timer.expires = jiffies +
local->passive_scan_interval * HZ

Signed-off-by: Wenliang Fan <fanwlexca@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Fri, 3 Jan 2014 20:34:41 +0000 (15:34 -0500)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

10 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Fri, 3 Jan 2014 20:25:15 +0000 (15:25 -0500)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

10 years agoiwlwifi: mvm: fix coccinelle warnings
Fengguang Wu [Tue, 31 Dec 2013 09:04:18 +0000 (11:04 +0200)]
iwlwifi: mvm: fix coccinelle warnings

drivers/net/wireless/iwlwifi/mvm/led.c:106:2-3: Unneeded semicolon

 Removes unneeded semicolon.

Generated by: coccinelle/misc/semicolon.cocci

CC: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: Update Copyright to 2014
Emmanuel Grumbach [Mon, 30 Dec 2013 11:15:54 +0000 (13:15 +0200)]
iwlwifi: Update Copyright to 2014

Happy new year!

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: fix a potential NULL deref
Eyal Shapira [Mon, 23 Dec 2013 14:26:41 +0000 (16:26 +0200)]
iwlwifi: mvm: rs: fix a potential NULL deref

Found by klocwork analysis.
mvm could be NULL which may cause a NULL dereference
in a theoretical call flow

rs_fill_lq_cmd(mvm = NULL, ...)
rs_build_rates_table
rs_fill_rates_for_column
ucode_rate_from_rs_rate
IWL_ERR(mvm,...)

No real reason for passing NULL to rs_fill_lq_cmd so fix that.

Reported-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: dynamically update tsf_id
Ilan Peer [Mon, 23 Dec 2013 20:18:02 +0000 (22:18 +0200)]
iwlwifi: mvm: dynamically update tsf_id

Currently, the MAC context tsf_id assignment and the master/slave
relations are determined only when a new vif is added, as part
of the MAC context resource allocation. However, at this stage, the
beacon interval is not known, and thus could not be taken into account
in the master-slave algorithm.

To fix this, recalculate the MAC context tsf_id assignment,
just before the MAC context is activated, i.e., just before
a station VMAC is configured to associated and before an AP
VMAC is started.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: change the parameters for calculating an AP TBTT
Ilan Peer [Tue, 24 Dec 2013 15:17:05 +0000 (17:17 +0200)]
iwlwifi: mvm: change the parameters for calculating an AP TBTT

Change the parameters for calculating an AP TBTT to 64/36 instead of
80/20, to increase the interval between a station vif and an AP
vif TBTT events.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: Fix CSR_RESET operation access type
Eran Harary [Wed, 11 Dec 2013 06:13:50 +0000 (08:13 +0200)]
iwlwifi: pcie: Fix CSR_RESET operation access type

The access to the CSR_RESET reg should be done as a complete
DWORD and not by setting a bit. This is the right way to reset
the device.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Add a missed beacons threshold
Ilan Peer [Tue, 24 Dec 2013 20:08:14 +0000 (22:08 +0200)]
iwlwifi: mvm: Add a missed beacons threshold

Instead of always calling ieee80211_beacon_loss() on every missed
beacons notification, call this function only if the number of
consecutive missed beacons from last rx is higher than a predefined
threshold.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: squash a spurious warning on chnctx change
Arik Nemtsov [Sun, 29 Dec 2013 15:57:53 +0000 (17:57 +0200)]
iwlwifi: mvm: squash a spurious warning on chnctx change

If the channel min-width changes, we can update the PHY ctx, even if
it has multiple references.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: dump to debugfs the SRAM as binary
Emmanuel Grumbach [Tue, 24 Dec 2013 12:58:29 +0000 (14:58 +0200)]
iwlwifi: mvm: dump to debugfs the SRAM as binary

This allows to format it at will using external tools.
Since different teams want it in different formats, dump
the raw data and everyone can play with the data the way
they want.

While at it - make this code slightly more robust by making
the required verification on the offsets / length in the
write handler.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - update channel inihibition for channel 14
Emmanuel Grumbach [Tue, 24 Dec 2013 08:55:24 +0000 (10:55 +0200)]
iwlwifi: mvm: BT Coex - update channel inihibition for channel 14

This channel inhibition for channel 14 was wrong. Fix it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix harmless smatch / coccinelle warnings
Emmanuel Grumbach [Sun, 22 Dec 2013 08:55:47 +0000 (10:55 +0200)]
iwlwifi: mvm: fix harmless smatch / coccinelle warnings

Don't check if mvm->fw->cs is NULL since it can't be.
cs is an array member of iwl_fw, it can't be NULL.

Use memset(ptr, 0, sizeof(*ptr)); instead of
memset(ptr, 0, sizeof(struct ptr_type));

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: disable the device as soon as RFKILL fires
Emmanuel Grumbach [Thu, 19 Dec 2013 20:20:58 +0000 (22:20 +0200)]
iwlwifi: mvm: disable the device as soon as RFKILL fires

The firmware needs to be stopped quickly (100ms) after the
RFKILL interrupt fired. Failing to do so would allow the
firmware to access the radio registers which would lead to
a hardware error.

Before this change, we would kill the firmware only when
mac80211 stops the device which can take a fair amount of
time. Take a shortcut by stopping the device right away
in the interrupt.

This is not relevant if the current firmware is INIT
firmware since that firmware can run while in RFKILL.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: allow the op_mode to call stop_device whenever it wants
Emmanuel Grumbach [Thu, 19 Dec 2013 20:19:17 +0000 (22:19 +0200)]
iwlwifi: pcie: allow the op_mode to call stop_device whenever it wants

Calling stop_device when start_fw wasn't called would issue:
Stopping tx queues that aren't allocated...

Also allow the op_mode to call stop_device and then to
disable the Tx queues - in that case just silently ignore
the disabling on the Tx queues, since the PRPH registers
aren't reachable any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: don't update the op_mode if rfkill hasn't changed
Emmanuel Grumbach [Sun, 22 Dec 2013 13:13:01 +0000 (15:13 +0200)]
iwlwifi: pcie: don't update the op_mode if rfkill hasn't changed

This is useless and introduces a dependency between rfkill
and stop_device - the op_mode can't call stop_device from
the rfkill notification since it would lead to an endless
recursion.
Next patches will need to do so.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: keep the NIC awake when commands are in flight
Emmanuel Grumbach [Sun, 22 Dec 2013 13:09:40 +0000 (15:09 +0200)]
iwlwifi: pcie: keep the NIC awake when commands are in flight

Under very specific circumstances, the firmware might
ignore a host command. This was debugged and we ended up
seeing that the power management hardware was faulty.
In order to workaround this issue, we keep the NIC awake
as long as we have host commands in flight. This will avoid
to put the hardware into buggy condition.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix possible memory leak
Eytan Lifshitz [Wed, 18 Dec 2013 21:05:06 +0000 (23:05 +0200)]
iwlwifi: mvm: fix possible memory leak

In case of invalid section_id, the function returns after
it aleready allocated memory. Fixed by change the order of actions.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix AC / FIFO mapping
Emmanuel Grumbach [Thu, 19 Dec 2013 14:50:49 +0000 (16:50 +0200)]
iwlwifi: mvm: fix AC / FIFO mapping

The AC / fifo mapping was wrong - BE packets landed in VO
FIFO. The iwl_mvm_tx_fifo enumeration isn't in the same
order as ieee80211_ac_numbers enumeration.
Since the firmware relies on fifo / ac mapping - this led
to wrong behavior. E.g. the firmware sends beacon with the
same QoS parameters as VO, and it actually took the
parameters of BK. There are probably more severe issues.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: use don't disable interrupt when rxq->lock is taken
Emmanuel Grumbach [Wed, 11 Dec 2013 08:22:28 +0000 (10:22 +0200)]
iwlwifi: pcie: use don't disable interrupt when rxq->lock is taken

This lock was never acquired in the primary interrupt
handler, but since it was acquired along with irq_lock
which had to disable interrupts, rxq->lock had to disable
interrupts too.
Now that trans_pcie->irq_lock isn't acquired in the primary
interrupt handler, rxq->lock can let interrupt enabled.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: use don't disable interrupt when irq_lock is taken
Emmanuel Grumbach [Wed, 11 Dec 2013 08:22:28 +0000 (10:22 +0200)]
iwlwifi: pcie: use don't disable interrupt when irq_lock is taken

Since we don't take this lock in the primary interrupt
handler, there is no pointin disabling the interrupt
in the critical section protected by trans_pcie->irq_lock.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: move interrupt prints to the common handler
Emmanuel Grumbach [Wed, 11 Dec 2013 07:39:30 +0000 (09:39 +0200)]
iwlwifi: pcie: move interrupt prints to the common handler

Handling interrupt with no cause and printing logs doesn't
need to be ICT / non-ICT specific move this to the common
code.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: no need to save inta in trans_pcie
Emmanuel Grumbach [Wed, 11 Dec 2013 07:24:39 +0000 (09:24 +0200)]
iwlwifi: pcie: no need to save inta in trans_pcie

This was useful when the handling was not in the same
context as the interrupt cause retrieval: we could have
several hard interrupts until the handler gets called.
Since we retrieve the interrupt cause in the handler itself,
there is no need to OR the interrupt causes.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: return inta from iwl_pcie_int_cause_{non_}ict
Emmanuel Grumbach [Wed, 11 Dec 2013 07:20:34 +0000 (09:20 +0200)]
iwlwifi: pcie: return inta from iwl_pcie_int_cause_{non_}ict

These functions are meant to return an interrupt cause and
not an irqreturn_t.
We still return IRQ_HANDLED if we had an error and IRQ_NONE
if our device hasn't fired any interrupt.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoath9k: simplify/fix tx packet TID handling
Felix Fietkau [Thu, 19 Dec 2013 17:01:51 +0000 (18:01 +0100)]
ath9k: simplify/fix tx packet TID handling

mac80211 guarantees that skb->priority is set to the TID, so use it
instead of trying to parse the QoS header manually.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: fix TSF offset precision issue
Felix Fietkau [Thu, 19 Dec 2013 17:01:50 +0000 (18:01 +0100)]
ath9k: fix TSF offset precision issue

Dividing the beacon interval by ATH_BCBUF (8) truncates the result for
the default beacon interval of 100.
Fix the calculation by moving the division after conversion from TU to
microseconds.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: call ath9k_set_tsfadjust from ath9k_beacon_config
Felix Fietkau [Thu, 19 Dec 2013 17:01:49 +0000 (18:01 +0100)]
ath9k: call ath9k_set_tsfadjust from ath9k_beacon_config

Make that function and ath9k_allow_beacon_config static

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: move ath9k_debug_sync_cause out of ath9k_hw
Felix Fietkau [Thu, 19 Dec 2013 17:01:48 +0000 (18:01 +0100)]
ath9k: move ath9k_debug_sync_cause out of ath9k_hw

ath9k_hw should not depend on any ath9k data structures like ath_softc

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobcma: add missing put_device call
Levente Kurusa [Thu, 19 Dec 2013 15:06:52 +0000 (16:06 +0100)]
bcma: add missing put_device call

This is required so that we give up the last reference to the device.

Signed-off-by: Levente Kurusa <levex@linux.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomac80211: Add support for QoS mapping
Kyeyoon Park [Tue, 17 Dec 2013 07:04:43 +0000 (23:04 -0800)]
mac80211: Add support for QoS mapping

Implement set_qos_map() handler for mac80211 to enable QoS mapping
functionality.

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: Add support for QoS mapping
Kyeyoon Park [Tue, 17 Dec 2013 07:01:30 +0000 (23:01 -0800)]
cfg80211: Add support for QoS mapping

This allows QoS mapping from external networks to be implemented as
defined in IEEE Std 802.11-2012, 10.24.9. APs can use this to advertise
DSCP ranges and exceptions for mapping frames to a specific UP over
Wi-Fi.

The payload of the QoS Map Set element (IEEE Std 802.11-2012, 8.4.2.97)
is sent to the driver through the new NL80211_ATTR_QOS_MAP attribute to
configure the local behavior either on the AP (based on local
configuration) or on a station (based on information received from the
AP).

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agonl80211: support vendor-specific events
Johannes Berg [Wed, 18 Dec 2013 13:43:31 +0000 (14:43 +0100)]
nl80211: support vendor-specific events

In addition to vendor-specific commands, also support vendor-specific
events. These must be registered with cfg80211 before they can be used.
They're also advertised in nl80211 in the wiphy information so that
userspace knows can be expected. The events themselves are sent on a
new multicast group called "vendor".

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: add helper functions for tracking P2P NoA state
Felix Fietkau [Mon, 16 Dec 2013 20:49:14 +0000 (21:49 +0100)]
mac80211: add helper functions for tracking P2P NoA state

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: fix iflist_mtx/mtx locking in radar detection
Johannes Berg [Wed, 18 Dec 2013 08:43:33 +0000 (09:43 +0100)]
mac80211: fix iflist_mtx/mtx locking in radar detection

The scan code creates an iflist_mtx -> mtx locking dependency,
and a few other places, notably radar detection, were creating
the opposite dependency, causing lockdep to complain. As scan
and radar detection are mutually exclusive, the deadlock can't
really happen in practice, but it's still bad form.

A similar issue exists in the monitor mode code, but this is
only used by channel-context drivers right now and those have
to have hardware scan, so that also can't happen.

Still, fix these issues by making some of the channel context
code require the mtx to be held rather than acquiring it, thus
allowing the monitor/radar callers to keep the iflist_mtx->mtx
lock ordering.

While at it, also fix access to the local->scanning variable
in the radar code, and document that radar_detect_enabled is
now properly protected by the mtx.

All this would now introduce an ABBA deadlock between the DFS
work cancelling and local->mtx, so change the locking there a
bit to not need to use cancel_delayed_work_sync() but be able
to just use cancel_delayed_work(). The work is also safely
stopped/removed when the interface is stopped, so no extra
changes are needed.

Reported-by: Kalle Valo <kvalo@qca.qualcomm.com>
Tested-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: remove unnecessary iflist_mtx locking
Johannes Berg [Wed, 18 Dec 2013 18:44:59 +0000 (19:44 +0100)]
mac80211: remove unnecessary iflist_mtx locking

The radar detection code changed a few times, and due to
the changes some iflist_mtx locking stayed in that isn't
actually necessary - remove it.

One version of the code needed it because an AP interface's
VLAN list was changed to use this, but then we moved the
list handling outside of the chanctx handling and thus the
locking was no longer needed.

Tested-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: align struct ps_data.tim to unsigned long
Joe Perches [Thu, 19 Dec 2013 00:52:17 +0000 (16:52 -0800)]
mac80211: align struct ps_data.tim to unsigned long

Its address is used as an unsigned long *, so make sure
that the tim u8 array is properly aligned.

Signed-off-by: Joe Perches <joe@perches.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoath9k: Use a subroutine for the AR9330 reset WAR
Sujith Manoharan [Wed, 18 Dec 2013 04:23:27 +0000 (09:53 +0530)]
ath9k: Use a subroutine for the AR9330 reset WAR

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix RTC reset delay
Sujith Manoharan [Wed, 18 Dec 2013 04:23:26 +0000 (09:53 +0530)]
ath9k: Fix RTC reset delay

The delay that is required after issuing a RTC reset
varies for each chip. Handle this properly.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add a delay between RTC reset/clear for AR9003
Sujith Manoharan [Wed, 18 Dec 2013 04:23:25 +0000 (09:53 +0530)]
ath9k: Add a delay between RTC reset/clear for AR9003

The small delay that is present between a RTC reset/clear
operation is required for the chip to settle and this is
needed for all chips, not just the AR9002 family.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix regulatory compliance
Sujith Manoharan [Wed, 18 Dec 2013 04:23:23 +0000 (09:53 +0530)]
ath9k: Fix regulatory compliance

To comply with ETSI regulations, make sure that
the CCA registers are programmed with the threshold
values from the EEPROM/Caldata. A new field is used
to indicate if the card has been calibrated with the
required threshold information.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Update BaseExtension_1 eeprom structure
Sujith Manoharan [Wed, 18 Dec 2013 04:23:22 +0000 (09:53 +0530)]
ath9k: Update BaseExtension_1 eeprom structure

* Add a new field "misc_enable"
* Use int_8 for tempslopextension.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Initialize "switchcomspdt" eeprom field explicitly
Sujith Manoharan [Wed, 18 Dec 2013 04:23:21 +0000 (09:53 +0530)]
ath9k: Initialize "switchcomspdt" eeprom field explicitly

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove unneeded ref. count initialization
Sujith Manoharan [Wed, 18 Dec 2013 04:23:20 +0000 (09:53 +0530)]
ath9k: Remove unneeded ref. count initialization

The interrupt reference counter is always initialized
in ath9k_start().

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Cleanup ath9k.h
Sujith Manoharan [Wed, 18 Dec 2013 04:23:19 +0000 (09:53 +0530)]
ath9k: Cleanup ath9k.h

* Remove unused macros.
* Move definitions to appropriate sections.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Cleanup spectral scan code
Sujith Manoharan [Wed, 18 Dec 2013 04:23:18 +0000 (09:53 +0530)]
ath9k: Cleanup spectral scan code

* Move definitions to spectral.h
* Move processing/debug code to spectral.c

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: update MAINTAINERS
Luis R. Rodriguez [Sat, 14 Dec 2013 19:11:39 +0000 (20:11 +0100)]
wireless: update MAINTAINERS

I've thrown the towel at QCA.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: properly preserve TSF across reset
Felix Fietkau [Sat, 14 Dec 2013 17:03:45 +0000 (18:03 +0100)]
ath9k: properly preserve TSF across reset

The beacon code previously reset TSF on every configuration call, as
some of the code was not prepared to properly calculate nexttbtt based
on current TSF.

This patch adds a common function for calculating nexttbtt and moves the
TSF reset to driver start.

This should improve AP mode compatibility with various stations that
expect the TSF to not randomly jump due to hardware resets.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: clean up station beacon timer API
Felix Fietkau [Sat, 14 Dec 2013 17:03:44 +0000 (18:03 +0100)]
ath9k_hw: clean up station beacon timer API

Remove unused fields, pass timer info in usec instead of TU.
Preparation for fixing nexttbtt calculation

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: remove spur related unused defines
Felix Fietkau [Sat, 14 Dec 2013 17:03:43 +0000 (18:03 +0100)]
ath9k_hw: remove spur related unused defines

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: remove additional_swba_backoff
Felix Fietkau [Sat, 14 Dec 2013 17:03:42 +0000 (18:03 +0100)]
ath9k_hw: remove additional_swba_backoff

It is unused

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: simplify spur channel handling
Felix Fietkau [Sat, 14 Dec 2013 17:03:41 +0000 (18:03 +0100)]
ath9k_hw: simplify spur channel handling

Remove ah->config.spurmode and ah->config.spurchans, always use EEPROM
data.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: remove ah->config.pcie_clock_req
Felix Fietkau [Sat, 14 Dec 2013 17:03:40 +0000 (18:03 +0100)]
ath9k_hw: remove ah->config.pcie_clock_req

It is unused

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: remove defunct ad-hoc mode ATIM window handling code
Felix Fietkau [Sat, 14 Dec 2013 17:03:39 +0000 (18:03 +0100)]
ath9k_hw: remove defunct ad-hoc mode ATIM window handling code

The hardware does not have support for ATIM processing, and the driver
does not set up ah->atim_window anywhere. Additionally, the code can
clobber the timer used by P2P powersave.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: clean up generic timer code
Felix Fietkau [Sat, 14 Dec 2013 17:03:38 +0000 (18:03 +0100)]
ath9k_hw: clean up generic timer code

- Use generic bitops instead of custom hackery
- Move interrupt enable/disable logic from ath9k to ath9k_hw
- Decouple ISR call from btcoex
- Make the overflow callback optional (to prevent IRQ storms)

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: use a software timer for btcoex no_stomp_timer
Felix Fietkau [Sat, 14 Dec 2013 17:03:37 +0000 (18:03 +0100)]
ath9k_hw: use a software timer for btcoex no_stomp_timer

TSF accuracy is not needed here, and there is only one usable generic
timer that is supported by all chips and uses the primary TSF counter.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: add support for reporting per-chain signal strength
Felix Fietkau [Sat, 14 Dec 2013 17:03:36 +0000 (18:03 +0100)]
ath9k: add support for reporting per-chain signal strength

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_common: get rid of an unnecessary variable
Felix Fietkau [Sat, 14 Dec 2013 17:03:35 +0000 (18:03 +0100)]
ath9k_common: get rid of an unnecessary variable

There's no need to truncate curchan->hw_value to u8

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agodrivers: net: Mark functions as static in debug.c
Rashika Kheria [Sat, 14 Dec 2013 12:30:25 +0000 (18:00 +0530)]
drivers: net: Mark functions as static in debug.c

This patch marks the function il_clear_traffic_stats() in debug.c as
static because they are not used outside this file.

Thus, it also removes the following warnings in
wireless/iwlegacy/debug.c:

drivers/net/wireless/iwlegacy/debug.c:35:1: warning: no previous prototype for ‘il_clear_traffic_stats’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agodrivers: net: Mark functions as static in 4965-debug.c
Rashika Kheria [Sat, 14 Dec 2013 12:28:38 +0000 (17:58 +0530)]
drivers: net: Mark functions as static in 4965-debug.c

This patch marks the function il4965_ucode_rx_stats_read(),
il4965_ucode_tx_stats_read() and il4965_ucode_general_stats_read() in
4965-debug.c as static because they are not used outside this file.

Thus, it also removes the following warnings in
wireless/iwlegacy/4965-debug.c:

drivers/net/wireless/iwlegacy/4965-debug.c:59:1: warning: no previous prototype for ‘il4965_ucode_rx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/4965-debug.c:471:1: warning: no previous prototype for ‘il4965_ucode_tx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/4965-debug.c:637:1: warning: no previous prototype for ‘il4965_ucode_general_stats_read’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agodrivers: net: Mark functions as static in 3945-debug.c
Rashika Kheria [Sat, 14 Dec 2013 12:27:14 +0000 (17:57 +0530)]
drivers: net: Mark functions as static in 3945-debug.c

This patch marks the function il3945_ucode_rx_stats_read(),
il3945_ucode_tx_stats_read() and il3945_ucode_general_stats_read() in
3945-debug.c as static because they are not used outside this file.

Thus, it also removes the following warnings in
wireless/iwlegacy/3945-debug.c:

drivers/net/wireless/iwlegacy/3945-debug.c:52:1: warning: no previous prototype for ‘il3945_ucode_rx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/3945-debug.c:317:1: warning: no previous prototype for ‘il3945_ucode_tx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/3945-debug.c:407:1: warning: no previous prototype for ‘il3945_ucode_general_stats_read’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: download per country tx power table to firmware
Bing Zhao [Sat, 14 Dec 2013 02:33:02 +0000 (18:33 -0800)]
mwifiex: download per country tx power table to firmware

When driver gets regulatory domain change notifications or before
associates to an AP with Country IE, the txpwrlimit table stored
in device tree for that country is downloaded to firmware.

The txpwrlimit downloading will happen only at the first time
when the alpha2 country code is changed. World regulatory domain
"00" notification doesn't trigger the downloading. This behavior
is same as domain_info command.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: download cal-data from device-tree to firmware
Bing Zhao [Sat, 14 Dec 2013 02:33:01 +0000 (18:33 -0800)]
mwifiex: download cal-data from device-tree to firmware

Currently only conf file based cal-data downloading is supported.
On embedded platforms a better place to store the cal-data is in
device tree. Add cal-data downloading from device tree to firmware.
Both methods can co-exist.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: remove cfg_data construction
Bing Zhao [Sat, 14 Dec 2013 02:33:00 +0000 (18:33 -0800)]
mwifiex: remove cfg_data construction

The cfg_data buffer will include the cfg_data structure header
(action, type, data_len). This makes it work for all data types
without extra parsing.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: send regulatory domain info to firmware only if alpha2 changed
Bing Zhao [Sat, 14 Dec 2013 02:32:59 +0000 (18:32 -0800)]
mwifiex: send regulatory domain info to firmware only if alpha2 changed

On cfg80211 regulatory domain change, drivers gets alpha2 country
code or "00" in driver's notification handler.

In most cases, the pattern will be US, 00, US, 00, US, 00, US, ...
There is no need to send domain info to firmware in case of "00" or
with the same alpha2 country code.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: fix 5/10MHz channel width initialization on ar9003
Lorenzo Bianconi [Thu, 12 Dec 2013 17:10:16 +0000 (18:10 +0100)]
ath9k: fix 5/10MHz channel width initialization on ar9003

Move ath9k_hw_set_rfmode() after ath9k_hw_process_ini() in order to avoid
AR_PHY_MODE register is overwritten with default values by
ar9003_hw_process_ini()

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_htc: reconfigure led_gpios after resume
Oleksij Rempel [Thu, 12 Dec 2013 14:30:36 +0000 (15:30 +0100)]
ath9k_htc: reconfigure led_gpios after resume

On suspend/resume, firmware will restart and gpios
configuration will be reseted. Restore this
configureation at least for LEDs

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: clarify struct brcmf_sdio_dev::func[0] reference
Arend van Spriel [Thu, 12 Dec 2013 10:59:06 +0000 (11:59 +0100)]
brcmfmac: clarify struct brcmf_sdio_dev::func[0] reference

The struct brcmf_sdio_dev contains array of sdio functions that
are used in the driver. However, during probe func[0] entry was
assigned to the function 1 reference. This was corrected upon
doing the actual I/O access. This patch makes it more clear by
creating the func[0] entry properly and use it as is during
I/O access.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: remove brcmf_sdio_disconnect() function
Arend van Spriel [Thu, 12 Dec 2013 10:59:05 +0000 (11:59 +0100)]
brcmfmac: remove brcmf_sdio_disconnect() function

Instead of calling brcmf_sdio_disconnect() expose brcmf_sdio_remove()
and call it directly.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: use consistent function names in dhd_sdio.c
Arend van Spriel [Thu, 12 Dec 2013 10:59:04 +0000 (11:59 +0100)]
brcmfmac: use consistent function names in dhd_sdio.c

Functions in dhd_sdio.c that are called with struct brcmf_sdio
instance are renamed consistently with brcmf_sdio_ prefix.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Combine protocol push hdr and bus txdata.
Hante Meuleman [Thu, 12 Dec 2013 10:59:03 +0000 (11:59 +0100)]
brcmfmac: Combine protocol push hdr and bus txdata.

For the transmission of data a protocol push hdr is performed
followed by a bus txdata call. For the new protocol msgbuf this
is not workable. Since they are already "loosely" coupled for
bcdc protocol they are combined. This means that txdata will
go "through" the protocol layer and a seperate protocol push
hdr will not be needed anymore.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Add definition of new protocol layer msgbuf.
Hante Meuleman [Thu, 12 Dec 2013 10:59:02 +0000 (11:59 +0100)]
brcmfmac: Add definition of new protocol layer msgbuf.

A new protocol layer msgbuf will be added in the future. This
change makes it possible to select the desired layer by the
bus driver. USB and SDIO will select BCDC. At the moment
nothing is being done with this information.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Fix hex dump for FWIL.
Hante Meuleman [Thu, 12 Dec 2013 10:59:01 +0000 (11:59 +0100)]
brcmfmac: Fix hex dump for FWIL.

The debug function brcmf_dbg_hex_dump API got changed and the
information string should preferably contain a \n at the end
of the string. Update the FWIL so debug output looks better.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Move common BCDC code in single function.
Hante Meuleman [Thu, 12 Dec 2013 10:59:00 +0000 (11:59 +0100)]
brcmfmac: Move common BCDC code in single function.

The BCDC functions query_dcmd and set_dcmd both create a msgbuf to
be sent to dongle this code is very similar and for optimisation
best put in a function.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: reduce function parameters in sdio send/receive calls
Arend van Spriel [Thu, 12 Dec 2013 10:58:59 +0000 (11:58 +0100)]
brcmfmac: reduce function parameters in sdio send/receive calls

The SDIO send and receive functions in bcmsdh.c are always called
with the same parameters. For the driver there is no use-case
to call them otherwise so remove those parameters from function
prototypes.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: use consistent function names in bcmsdh.c
Arend van Spriel [Thu, 12 Dec 2013 10:58:58 +0000 (11:58 +0100)]
brcmfmac: use consistent function names in bcmsdh.c

Functions in bcmsdh.c that are called with struct brcmf_sdio_dev
instance are renamed consistently with brcmf_sdiod_ prefix. Also
removing brcmf_sdioh_attach/detach() functions and merge it with
brcmf_sdiod_probe/remove().

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: remove brcmf_sdio_wdtimer_enable() function
Arend van Spriel [Thu, 12 Dec 2013 10:58:57 +0000 (11:58 +0100)]
brcmfmac: remove brcmf_sdio_wdtimer_enable() function

Instead of using the brcmf_sdio_wdtimer_enable() function
call brcmf_sdbrcm_wd_timer() directly.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: get rid of some void pointer parameters
Arend van Spriel [Thu, 12 Dec 2013 10:58:56 +0000 (11:58 +0100)]
brcmfmac: get rid of some void pointer parameters

In sdio code a couple of functions use a void pointer as argument
type although it should be struct brcmf_sdio. Changing the functions
to have proper type checking.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: remove regs parameter from sdio probe functions
Arend van Spriel [Thu, 12 Dec 2013 10:58:55 +0000 (11:58 +0100)]
brcmfmac: remove regs parameter from sdio probe functions

The chip recognition requires a base address that was provided
to it during the probe. However, the address is a fixed define
value so it is unnecessary to pass through the probe functions.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: remove brcmf_sdio_regrw_helper() from header file
Arend van Spriel [Thu, 12 Dec 2013 10:58:54 +0000 (11:58 +0100)]
brcmfmac: remove brcmf_sdio_regrw_helper() from header file

Make brcmf_sdio_regrw_helper() static removing its use outside of
the bcmsdh.c source file.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: use sdio functions to enable/disable F2
Arend van Spriel [Thu, 12 Dec 2013 10:58:53 +0000 (11:58 +0100)]
brcmfmac: use sdio functions to enable/disable F2

Instead of catching CCCR_IOEx register in F0 write access to
determine whether F2 state needs to change do it with direct
call to sdio_[enable/disable]_func().

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: remove unused struct brcmf_sdio_dev::func_cis_ptr attribute
Arend van Spriel [Thu, 12 Dec 2013 10:58:52 +0000 (11:58 +0100)]
brcmfmac: remove unused struct brcmf_sdio_dev::func_cis_ptr attribute

During the SDIO probe the func_cis_ptr attribute in struct brcmf_sdio_dev
is being determined, but it is never used after that. Removing it also
obsoletes two functions in bcmsdh.c.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>