Commit graph

387706 commits

Author SHA1 Message Date
Andrei Otcheretianski a20fd39866 iwlwifi: mvm: Implement CQM offloading
Use beacon statistics notification to track RSSI.
Notify mac80211 when the tresholds are crossed.
The roaming treshold is configured to be
equal to cqm_thold. If the beacon filtering command
is not supported by fw fall back and use mac80211
mechanism.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-16 12:12:24 +02:00
Luciano Coelho eafe25e0af iwlwifi: return -ENOMEM instead of NULL when OOM in iwl_drv_start()
The callers of iwl_drv_start() are probe functions.  If a probe
function returns 0, it means it succeeded.  So if NULL was returned by
iwl_drv_start(), it would be considered as a success.

Fix this by returning -ENOMEM if the driver struct allocation fails in
iwl_drv_start().

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-16 12:12:03 +02:00
Luciano Coelho 3b1995ad83 iwlwifi: Kconfig: fix help texts wrt 7260 and 3160 devices
Fix the help texts to properly reflect the 7260 and 3160 devices
support.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-16 12:11:47 +02:00
Luciano Coelho 66140adc22 iwlwifi: use a macro for default probe length
Instead of assigning the default max probe length to 200 in the main
code, create a macro for consistency and clarity.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-16 12:11:36 +02:00
Johannes Berg 7abc4632bf iwlwifi: mvm: refactor resume from WoWLAN code
To be able to add more logic to the resume code, refactor it a bit,
moving some status checking/reporting logic into a new function.
The locking becomes a bit odd (one of the new functions now unlocks
the mutex) but this will be required to call new mac80211 APIs in
there later.

Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-16 12:11:20 +02:00
Eyal Shapira 3571ac3370 iwlwifi: mvm: remove unused param of rs_dbgfs_set_mcs
clean it up

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-16 12:10:36 +02:00
Eyal Shapira d972ab31b9 iwlwifi: mvm: remove MIMO3 from rate scale code
Current and future chips supported by mvm will only have a maximum
of 2 antennas so all the MIMO3 related code and states can be dropped.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:23:54 +02:00
Alexander Bondar e3c588ec0d iwlwifi: mvm: Add basic uAPSD client support
Implement basic uAPSD client support adding the following:

- Advertise uAPSD support in HW capabilities
- Set all ACs trigger- and delivery-enabled
- Set max SP length to 2 buffered frames
- Assign QNDP with the highest TID with no mandatory admission
  control required
- Set uAPSD related parameters in Power Table command

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:23:05 +02:00
Eliad Peller faec6f91f5 iwlwifi: mvm: don't clear tbl->win mistakenly
rs_get_tbl_info_from_mcs() mistakenly clears
the rate histories window, overriding its initialization
values (i.e. filling it with 0, instead of -1).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:21:43 +02:00
Eyal Shapira ab055ce9f5 iwlwifi: mvm: remove unused fields of iwl_rs_rate_info
Some more cleanups of unused fields and their initializations.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:21:32 +02:00
Dan Carpenter 2ab9ba0fdf iwlwifi: pcie: returning positive instead of negative
There is a missing '-' character here so we return positive 'ENOMEM'
instead of negative.  The caller doesn't care.  All non-zero returns
are translated to '-ENOMEM' in iwl_pcie_nic_init().

This is just a cleanup.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:21:20 +02:00
Eyal Shapira ab3077009f iwlwifi: mvm: remove rate_scale_data debugfs entry
This isn't very informative and can be deduced from rate_scale_table.
Remove as a preparation for dropping iwl_rs_rate_info.ieee.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:21:09 +02:00
Luciano Coelho 6965a3540a iwlwifi: pcie: don't swallow error codes in iwl_trans_pcie_alloc()
The iwl_trans_pcie_alloc() function doesn't pass up error codes
returned from functions it calls, swallowing them and returning NULL
in all failure cases.  The caller checks if the return value is NULL
and returns -ENOMEM.  This is not correct, because in certain cases
the failure was not due to an OOM situation.

To fix this, modify the iwl_trans_pcie_alloc() function to use
ERR_PTR() to return error codes and clean up the error handling code
a bit.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:20:29 +02:00
Eytan Lifshitz f8f03c3edc iwlwifi: mvm: add support to the new FW time event API
The time event firmware API will change, add the support for that.
Use the new API throughout and convert to the old where needed.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Guy Cohen <guy.cohen@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12 15:19:06 +02:00
Ido Yariv 6e8773c314 iwlwifi: pcie: Remove duplicate code from pcie irq handlers
Instead of having the same code sequentially, fall-through.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-09 14:38:29 +02:00
Ido Yariv 351746c9ad iwlwifi: pcie: Refactor iwl_rxq_space
Simplify iwl_rxq_space to improve readability and reduce
the ambiguity spares to a single element.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-09 14:38:15 +02:00
Ido Yariv a9b2924643 iwlwifi: pcie: Refactor iwl_queue_space
Reduce the ambiguity spares to a single element if the window size is not
smaller than the queue size. If smaller, no spares are required at all.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-09 14:38:01 +02:00
Matti Gottlieb f4f3c65984 iwlwifi: introduce external debug level
This debug level will be used in the future for logging
interaction with external modules.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-09 14:37:33 +02:00
Alexander Bondar 495191c79f iwlwifi: mvm: Fix beacon filtering enablement via debugfs
The code was only enabling it when already enabled, which
obviously can't work.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-09 14:37:10 +02:00
Eliad Peller ef4394b947 iwlwifi: mvm: use designated initialization for some arrays
rs_ht_to_legacy and ant_toggle_lookup are arrays that
represent some state-machine. initialize them explicitly
with designated initialization to make them more clear
and avoid errors.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:35:04 +02:00
Eliad Peller bd3351ba3e iwlwifi: mvm: add some missing cleanups in iwl_mvm_mac_add_interface
iwl_mvm_mac_add_interface() didn't clean up beacon filtering
configuration and ctxt allocation in some error cases.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:34:52 +02:00
Johannes Berg 5fdda0476c iwlwifi: remove transport suspend/resume indirection
There's no reason for the transport to call itself through
indirect function pointers, inline the (little) code there
is and remove the indirection completely.

Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:34:33 +02:00
Eliad Peller 1092b9bc0c iwlwifi: pcie: some little cleanups
do some little cleanups in tx.c - eliminate duplicate checks,
use locally cached fields and predefined macros.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:34:11 +02:00
Eliad Peller e89044d75e iwlwifi: fix some documentation typos
Fix some typos.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:33:58 +02:00
Johannes Berg f5e45f2d96 iwlwifi: mvm: small cleanups in quota management code
Use a C99 initializer to clear the command and move the lockdep
assertion before the restart check. Since this causes problems
with the BUILD_BUG_ON() with some compilers, change that a bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:33:47 +02:00
Avri Altman 17dbe56445 iwlwifi: mvm: fix signal reporting for < 3 antennas
When fewer than three antennas are connected (as is
always the case for the current devices), the signal
strength reporting was wrong; fix it.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:32:38 +02:00
Eyal Shapira 977342bc3d iwlwifi: mvm: remove traffic load monitoring in rs
The traffic load monitoring isn't used anymore to decide whether
a Tx aggregation on a specific TID should be started.
No point in collecting these statistics. Remove the relevant code.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:32:17 +02:00
Johannes Berg eeb89ab1f0 iwlwifi: pcie: fix resume when no opmode is present
If no opmode is present during suspend/resume (i.e. if
the iwldvm or iwlmvm isn't loaded) the driver crashes
during resume, trying to call the rfkill notification.
Avoid that, and also don't enable the rfkill interrupt
in this case (to avoid crashing trying to handle the
interrupt later.)

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:31:05 +02:00
Matti Gottlieb 3848ab6682 iwlwifi: mvm: Add RX statistics debugfs entry
Add a debugfs entry for the RX statistics received from
the firmware.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-06 10:30:21 +02:00
Emmanuel Grumbach 147fc9be81 iwlwifi: mvm: advertise support for DYNAMIC / STATIC SMPS
This feature is fully supported by iwlwmvm, so advertise
it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:08 +02:00
Eytan Lifshitz 6be497f29e iwlwifi: mvm: add high temperature SKU thermal throttling parameters
When the NIC is expected to operate in high temperature,
it is advisable to put more aggresive thermal throttling
parameters, in order to prevent CT-kill.

Signed-off-by: eytan lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:07 +02:00
Johannes Berg 6161b02b93 iwlwifi: list Emmanuel in maintainers file
Wey-Yi has moved on a while ago, but we forgot to update the
maintainers file. Since Emmanuel is de facto maintaining the
driver along with myself now, list him instead.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:06 +02:00
Alexander Bondar 8434925f20 iwlwifi: mvm: Change beacon abort escape time value
Set beacon abort escape timer values - 6 beacons in D0 state,
9 beacons in D3 and D0i3.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:06 +02:00
Eyal Shapira 2f2ad0d072 iwlwifi: remove duplicate rate scale init code
The rate scale windows are cleared twice as part of the init.
Cleanup this duplication in both mvm and dvm.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:05 +02:00
Emmanuel Grumbach 913e25640c iwlwifi: mvm: remove obsolete flag in TX command API
This API isn't valid any more. It wasn't used anyway.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:05 +02:00
Johannes Berg 226eb8cd22 iwlwifi: mvm: report per-chain signal to mac80211
Instead of reporting the maximum signal strength and the
antenna bitmap in the antenna field (which is really just
for radiotap and defined differently), report the signal
strength values per chain and set the chain bitmap.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:04 +02:00
Eran Harary 291aa7c4a4 iwlwifi: mvm: fix debugfs restart if fw_restart is disabled
If fw_restart is disabled, using the fw_restart debugfs
file will enable fw_restart and then send the failing
command, but this still frequently fails restart because
it resets fw_restart afterwards and is thus racy.

Fix this by tracking fw_restart separately and allowing
"always restart", "never restart" and "restart N times".

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:03 +02:00
Hila Gonen 5dca7c241e iwlwifi: mvm: Change beacon filtering command
Change beacon filtering command due to a change in the API.

In case the FW supports the old API, we do not send the
BF HCMD and assume that since the corresponding struct in
the FW is zeroed by default then we don't need to disable
it in the FW actively.

Signed-off-by: Hila Gonen <hila.gonen@intel.com>
Signed-off-by: Dor Shaish <dor.shaish@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:03 +02:00
Emmanuel Grumbach 77740cb433 iwlwifi: mvm: register vif debugfs for AP mode too
The current registered the per-vif debugfs handler for
STA mode only.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
2013-07-31 11:05:02 +02:00
Johannes Berg 99545924a1 iwlwifi: mvm: split constants into separate file
To make maintaining some constant default values in the
driver easier, declare them in a separate file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:02 +02:00
Johannes Berg 7b8359cf2b iwlwifi: mvm: assign quota per virtual interface
Instead of assigning quota per used binding (channel) assign
the same amount of quota for each virtual interface so that
when there are more than two interfaces using more than one
channel, we'll stay on the channels proportionally to the
number of virtual interfaces using the channels.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:01 +02:00
Ilan Peer fd11bd0555 iwlwifi: mvm: Return on inconsistency in add interface
Return in case that HW restart is in progress but the added
interface is not found during the iteration over all the interfaces.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:00 +02:00
Alexander Bondar 0f2ed58e6e iwlwifi: mvm: Change AM->PSM timeout for EAPOL frames
Currently after sending EAPOL frame FW transition to power saving mode
within 10 or 100 msec (as specified by power table command). According
to new requirement this timeout for a specific EAPOL frame must be
controlled by the driver by setting tx_pm_timeout field of TX_CMD to 2
(PM_FRAME_ENUM_MGMT). This value corresponds to 32 msec timeout.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:05:00 +02:00
Johannes Berg 5369d6c167 iwlwifi: mvm: support six IPv6 addresses in D3
Newer firmware supports offloading more IPv6 addresses for NDP,
adjust the code to send the correct command depending on the
firmware capability.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:04:59 +02:00
Matti Gottlieb 88f2fd7300 iwlwifi: mvm: Enable user set TX power
Support Tx power limitations. These limitations can come from
mac80211 for various reasons.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:04:59 +02:00
Johannes Berg ac1ed4163b iwlwifi: mvm: reprobe device on firmware error during restart
If we get a firmware error during restart, we currently abandon any
hope and simply fail, getting stuck until the driver is reloaded.
Unfortunately, there isn't really much else we can do since restart
will likely continue to fail, and asking mac80211 for disconnection
just causes more error.

To allow the user to at least set up the device again completely
from scratch, reprobe the device and in doing so completely destroy
any mac80211/driver state.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:04:58 +02:00
Emmanuel Grumbach 58fa2aad29 iwlwifi: mvm: remove the default calibration values for 7000
The fw is now able to run TX_IQ_SKEW and RX_IQ_SKEW by
itself. No need for default values any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Dor Shaish <dor.shaish@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:04:58 +02:00
Avri Altman a2d7b870d0 iwlwifi: mvm: new api to get signal strength
A new API that replaces the rx signal strength calculation via agc & rssi.
The energy is now calculated outside the driver and transferred by the fw.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-31 11:04:49 +02:00
David Spinadel 26e05cc32d iwlwifi: mvm: enable pre-scan passive to active
Enable passive to active scan feature, on channels that was
active in the past hour.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-25 15:03:40 +02:00
Johannes Berg da4f87f088 iwlwifi: dvm: remove P2P support
We're not planning to support P2P on older devices, so
remove the Kconfig option and associated code for it.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-25 15:02:59 +02:00