Commit graph

310844 commits

Author SHA1 Message Date
Johannes Berg 463454b5db cfg80211: fix interface combinations check
If a given interface combination doesn't contain
a required interface type then we missed checking
that and erroneously allowed it even though iface
type wasn't there at all. Add a check that makes
sure that all interface types are accounted for.

Cc: stable@kernel.org
Reported-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 14:27:30 -04:00
Johannes Berg 0e1fa7ef25 iwlwifi: unregister LEDs if mac80211 registration fails
Otherwise the LEDs stick around and cause issues the
next time around since they're still there but not
really hooked up.

Cc: stable@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 14:27:30 -04:00
Johannes Berg f69a23b795 iwlwifi: fix double free/complete in firmware loading
Linus reported that due to mac80211 failing to register
the device (due to WoWLAN) his machine crashed etc. as
we double-freed the vmalloc() firmware area. His patch
to fix it was very similar to this one but I noticed
that there's another bug in the area: we complete the
completion before starting, so since we're running in
a work struct context stop() could be called while in
the middle of start() which will almost certainly lead
to issues.

Make a modification similar to his to avoid the double-
free but also move the completion to another spot so it
is only done after start() either finished or failed so
that stop() can have a consistent state.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-05 14:27:29 -04:00
Victor Goldenshtein a4203c6453 wlcore: wait for roc complete only for the first roc command
In some multi role scenarios the driver might send multi
roc requests without sending a croc first, the fw queues
those requests and starts service the next roc request as
soon as the driver sends a croc for the previous one. So,
if the fw rocs on channel X and driver asks to roc also
on channel Y, the fw will not start service Y (and will
not send roc complete event for this request) until the
driver releases the fw with croc X.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:32 +03:00
Victor Goldenshtein e832837bbb wlcore: don't enable BET for high basic rates
The beacon early termination is not relevant for
high basic rates, which doesn't contribute
anything to the PS and only adds unnecessary FW
work.

Enable BET only if the basic rate is less than 9
Mbps.

Signed-off-by: Ziv Riesel <zivriesel@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:32 +03:00
Victor Goldenshtein 461b958fd6 wl18xx: fix fm_coex parameters configuration
Wrong fm_coex parameters were set during wl18xx
init phase, fix it.

Signed-off-by: Ziv Riesel <zivriesel@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:32 +03:00
Victor Goldenshtein 836d3f2058 wl12xx: fix fm_coex parameters configuration
Wrong fm_coex parameters were set during wl12xx
init phase, fix it.

Signed-off-by: Ziv Riesel <zivriesel@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:32 +03:00
Arik Nemtsov 5a344b87ce wlcore: remove duplicate BUG_ON during recovery
This BUG_ON also ignored the INTENDED_FW_RECOVERY flag. This would
result in a BUG() when using the bug_on_recovery module parameter during
multi-role.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Eliad Peller 0c21298435 wlcore: increase WL1271_EVENT_TIMEOUT
In some cases, the ROC_COMPLETE event might exceed the
current timeout (750 msec). Increase it to 1 sec.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Eliad Peller d1bcb53f91 wlcore: flush tx on CHANGE_CHANNEL
On CHANGE_CHANNEL indication, we should flush all the
queued tx frames, so they will be sent on the correct
(current) channel.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Yoni Divinsky feb47eb86b wlcore: fix the CONF_TX_AC_ANY_TID to be 0xff
In the enum conf_tx_ac CONF_TX_AC_ANY_TID should
be 0xff to match the firmware's implementation.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Yoni Divinsky 4a6c789b73 wl12xx: set the irq polarity before loading the fw
The polarity should be set before the firmware is loaded
since the firmware touches the same register. Access
of the firmware and driver to the same register will
cause a collision since there is no exclusion scheme.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Yoni Divinsky 2e42c203a9 wlcore: use psd_type indexing according to spec
In ieee80211.h the uapsd bit mask is defined such that
VO=BIT(0), VI=BIT(1), BK=BIT(2), BE=BIT(3).
The firmware uses the indexing as defined in the ieee80211
spec, meaning that VO=3, VI=2, BK=1, BE=0.

In AP mode when adding peer wlcore needs to convert
the indexing accordingly.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 20:24:31 +03:00
Eliad Peller bfb92ca133 wlcore: set wl->ht_cap per-band
Save the ht_cap IE per-band, so we can configure different
params to BG and A bands (we currently don't support MIMO
on A band)

[Small fix for rx_highest - Arik]

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:09 +03:00
Arik Nemtsov a121a5b8ab wl18xx: add dependency on mac80211
Add a dependency on mac80211 in Kconfig, and also replace some spaces
with tabs.

Reported-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:09 +03:00
Assaf Azulay 0a15d9b589 wlcore: increase number of BA sessions to 3
With the new FW (sigle role X.3.8.0.108, multi role X.5.4.0.21)
we are supporting 3 RX BA sessions, this change is to support this
new ability.

Signed-off-by: Assaf Azulay <assaf@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Igal Chernobelsky 7b052214e5 wlcore: modify bss loss parameters
Modify default parameters to reduce firmware BSS lose
probability in congested environment.

[Applied to 18xx configuration as well - Arik]

Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Eliad Peller b515d83a29 wlcore: flush before stopping AP
Make sure the deauth bcast gets sent

[Make sure we are AP as well before the flush - Arik]

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Eliad Peller 45b60f7ddd wlcore: use correct link for bcast/multicast frames
Multicast management frames (e.g. global deauth)
should be sent out on the bcast link, rather than
the global, which should be used only for pre-added
stations (e.g. for auth/assoc resp).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Arik Nemtsov 6b8bf5bc5e wlcore: fixes for connection_loss_work
We can't use cancel_delayed_work_sync() from functions that take the
wl->mutex, since connection_loss_work also takes the mutex. This might
result in a deadlock. Restructure the code so the work is synchronously
canceled before taking the mutex.
Avoid a bug where we would indefinitely delay the connection loss
indication by re-queuing the connection loss work on consecutive beacon
loss events.

Cc: bartosz.markowski <bartosz.markowski@tieto.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Arik Nemtsov 6e066921b3 wlcore: fix dynamic_ps_timeout time regression
In patch d7b63b9fc7 we have raised the dynamic
PS timeout to 200ms to improve user experience. Re-apply the change,
since it was reverted in the wlcore split.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Eliad Peller 1ab0f21262 wlcore: use the original elp time in forced_ps mode
The dynamic PS timeout is meaningless in forced PS mode.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Arik Nemtsov d35dc739f6 wlcore: fix sparse warnings related to static functions
The "static" modifier was mistakenly forgotten for some functions.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 17:16:08 +03:00
Luciano Coelho b5d6d9b28c wlcore/wl12xx/wl18xx: don't use TX align quirk for wl127x
Commit 4afc37 (wlcore: reorder identify_chip and get_hw_info) broke
support for wl127x chips.

When we moved the identify_chip operation to an earlier stage (ie. to
the probe function), we broke wl127x support because during HW init we
would set the WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN.

To avoid this, set this quirk in the identify_chip operations and only
force it to be unset if the bus module doesn't support it.  We were
doing the opposite and setting the flag if the bus module supports it.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 16:07:16 +03:00
Assaf Azulay 3d62eb5a7e wl18xx: change default tcp_checksum to false
as tcp check sum is going to be removed from firmware, and as
there is a problem with getting dns in security when checksum is
enabled, it was decided to disable it by default.
for none security modes it can be enabled by module paramenter.

Signed-off-by: Assaf Azulay <assaf@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-05 15:59:41 +03:00
Luciano Coelho c5d94169e8 wl18xx: use new fw stats structures
Some of the structures were updated, other structures had a few
missing values and a few new ones were added.  Change the driver
structs accordingly.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:59:10 +03:00
Luciano Coelho 3507efa084 wl18xx: increase tx_ba_win_size to 64
Now the firmware can support TX block ack sessions with 64 frames.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:59:06 +03:00
Luciano Coelho 5a7589be34 wlcore: increase aggregation buffer size by one page
With 4 pages (16Kb), we can't fit 10 frames in the aggregation buffer
during iperf.  This is the optimal for the firmware.  Thus, increase
the buffer size by one page.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:59:02 +03:00
Luciano Coelho ad62d81a9e wlcore/wl12xx/wl18xx: move lower driver debugfs to a subdir
Instead of adding more files from the lower drivers into the same
directory in debugfs as wlcore, we now add a subdirectory for the
lower driver.  This makes things a bit easier, because we can quickly
see where the debugfs entry is implemented and what is specific to the
lower driver.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:59 +03:00
Luciano Coelho 7b03c306da wl18xx: export pwr_limit_reference_11_abg value as a module parameter
Yet another temporary module parameter requested by the firmware team.
This will be replaced by the conf binary.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:54 +03:00
Luciano Coelho 858403ab44 wl18xx: export low/high band component values as module params
We use hardcoded values for the different board types.  In some cases
we may need to override the defaults, so export the values as module
params.  If not defined, the defaults for the specified board type
will be used.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:51 +03:00
Luciano Coelho 5add82edd1 wl18xx: add power limit reference value to mac_and_phy settings
With more recent PHY firmware versions (>8.1.0.0.116), we need to use
the correct value for the pwr_limit_reference_11_abg parameter when
setting the mac_and_phy options.

For now we use a hardcoded 0xc8 as the value.  This will be moved to
the configuration binary when it gets implemented.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:46 +03:00
Luciano Coelho 8334271882 wl18xx: add module parameter to force SISO 20MHz
In some cases it may be useful to force narrow-band SISO channels.
Add a new value to the ht_mode module parameter to force the device to
operate in SISO 20MHz.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:42 +03:00
Luciano Coelho 60462b4885 wlcore: use proper values for supported local rates
We were setting all the rates bits when starting the AP role.  Instead
of doing this, we should set only the rates we really support
(eg. MIMO rates or wide-channel rates).  This commit changes that so
that we always use the default rates (basic rates + MCS0-7) and add
the values returned by the ap_get_mimo_wide_rate_mask operation.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:36 +03:00
Luciano Coelho 174a73034c wl18xx: don't use MIMO when ht_mode is set to wide
If the wl18xx module is loaded with ht_mode=wide (the default), we
shouldn't use MIMO rates when the channel type is not HT40.  Fix this
by checking the ht_mode before deciding which rates to used.
Additionally, set the ht_mode parameter explicitly to "wide" as the
default.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:32 +03:00
Luciano Coelho 06bba80e71 wlcore: print the interrupt status when recovery is triggered
In some cases it may be useful for debugging to check what is the
status of the interrupt register when a hardware recovery happens.
Print the contents of REG_INTERRUPT_NO_CLEAR (aka. HINT_STS_RAW) when
recovery starts.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:28 +03:00
Luciano Coelho 283e8c425f wl18xx: print the PHY firmware version from the private static data
The wl18xx firmware writes the PHY firmware version in the static
data.  Add an operation to parse the static data and print the PHY
firmware version when booting.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:24 +03:00
Luciano Coelho 7140df6e51 wlcore: create private static_data area and add operation to parse it
The wl18xx firmware has more information in the static_data than
wl12xx.  To be able to parse that in an abstracted way, this patch
adds a priv area to the static data struct and an operation that
allows the lower driver to parse it if necessary.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:20 +03:00
Luciano Coelho 8c0ea1021c wl18xx: implement fw status debugfs entries
Implement the operations that are necessary to fetch the
wl18xx-specific FW statistics and export them in debugfs.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:16 +03:00
Luciano Coelho 10b1e8a27a wl12xx: implement fw status debugfs entries
Implement the operations that are necessary to fetch the
wl12xx-specific FW statistics.  Re-add some of the code removed from
wlcore.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:12 +03:00
Luciano Coelho bcca1bbdd4 wlcore: add debugfs macro to help print fw statistics arrays
Add a macro to make it easy to print arrays from the FW statistics
array in debugfs.  At the same time, increase the buffer size so
arrays fit more easily.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:08 +03:00
Luciano Coelho 4987257c30 wlcore: abstract debugfs fw_stats to be handled by the lower drivers
The FW statistics differ from hardware to hardware.  This commit
prepares for hardware-specific implementation of the FW statistics
debugfs entries.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:58:02 +03:00
Luciano Coelho 15e05bc059 wlcore: use all AP basic rates as default
Sometimes we get a BSS_CHANGED_BEACON_ENABLED event before the basic
rates have been properly set.  To avoid problems with the firmware not
expecting to receive frames at rates that are not set during
CMD_START_ROLE, we now start with all basic rates by default.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:58 +03:00
Luciano Coelho 62c2e579e0 wlcore: update beacon and probe_resp templates when rates change
When the data rates change, we get BSS_CHANGED_BASIC_RATES.  At this
point, we should update all the templates to match the new rates.  We
were changing some of the templates, but the beacon and the probe
response templates were missing.

[Remove redundant min_rate variable - Arik]

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:50 +03:00
Luciano Coelho 7ae25da396 wl18xx: disable MCS_13 for wl18xx PG 1.0
There are some problems with MCS_13 in PG 1.0 hardware.  So we disable
it when PG 1.0 is detected.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:45 +03:00
Luciano Coelho 4afc37a0c1 wlcore: reorder identify_chip and get_hw_info
We can do get the HW information and identify the chip already at
probe time.  This makes it easier to mangle with the parameters during
identify chip before registering the hardware with mac80211.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:41 +03:00
Luciano Coelho 73d8a42464 wl18xx: change low_band_component_type value for COM8
Like HDK, COM8 uses 0x06 for the low_band_component_type as well.
Hardcode the value for COM8 until this configuration can be done in
the external configuration binary (to be implemented).

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:36 +03:00
Luciano Coelho 4f64a1e93f wlcore: add space for private area when allocating fw_status
When allocating the fw_status structure, the space for the
lower-driver private area was missing.  This was causing an illegal
write outside the allocated area, which was causing random oopses
around the kernel.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:32 +03:00
Luciano Coelho 4b9d2365d5 wl18xx: changed default board_type to HDK
Since the most common board we're using now is an HDK board, change
the default board_type to hdk.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:27 +03:00
Luciano Coelho 776f030aa0 wl18xx: copy the default configuration before checking the board_type
We were changing the low_band_component_type in the private
configuration structure before copying the default values to it, so
the change was overwritten and only took effect after HW recovery.

Reported-by: Dror Erez <drorer@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-06-05 15:57:20 +03:00