Arik Nemtsov [Thu, 15 May 2014 14:31:51 +0000 (17:31 +0300)]
iwlwifi: mvm: remove vif argument from power_update_mac
The power update function looks at all current vifs to determine the power
policy. It doesn't use the current vif. Instead the value was overwritten
and used internally.
Luciano Coelho [Tue, 13 May 2014 14:33:38 +0000 (17:33 +0300)]
iwlwifi: mvm: pass force_assoc_off all the way down to avoid hacks
In some cases, we need to force the association to be off in the
MAC_CONTEXT_CMD command we send to the firmware. Instead of having to
hack the vif->bss_conf.assoc value, pass it all the way down the call
chain.
Additionally, for the iwl_mvm_mac_ctxt_add() case, we *always* set
forced_assoc_off to true, so we can remove the hack in the d3 code
that was forcing it to off by hacking the bss_conf.assoc value.
Avri Altman [Tue, 20 May 2014 05:03:24 +0000 (08:03 +0300)]
iwlwifi: mvm: don't filter out the first beacon
Enabling beacon filtering should be done only after a beacon
has been received. Doing that too early will cause
disconnections.
This has already been fixed, but the fix didn't take care
about the case where the beacon is received after the
association, it waited only for association which is not
enough.
iwlwifi: mvm: don't allow diversity if BT Coex / TT forbid it
We should not allow diversity when BT Coex needs the second
antenna. Thermal Throttling can also request to stop using
the second antenna. Honour those requests.
Luciano Coelho [Wed, 14 May 2014 07:01:14 +0000 (10:01 +0300)]
iwlwifi: mvm: update power after phy_ctxt is NULL when unassigning chanctx
iwl_mvm_power_update_mac() (more specifically
iwl_mvm_power_iterator()) relies on the phy_ctxt setting to decide
whether the vif is active or not. When unassigning a chanctx, we
should therefore call iwl_mvm_power_update_mac() after setting
phy_chanctx to NULL.
Johannes Berg [Tue, 13 May 2014 13:25:28 +0000 (15:25 +0200)]
iwlwifi: fix LED support Kconfig dependencies
If DVM or MVM are built-in but LEDS_CLASS isn't then the current
Kconfig will enable LED support and fail the build. Fix this by
making the LED support depend on LEDS_CLASS being built-in or,
if it is modular, only enabling it if iwlwifi also is.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
In the 8000 HW family the register for forcing an NMI has
changed, so this allows to still be able to force an NMI
while taking into account the HW in order to write to the
correct register.
Matt Chen [Thu, 24 Apr 2014 10:43:18 +0000 (18:43 +0800)]
iwlwifi: mvm: add uapsd_disable module parameter
Some APs (e.g. TP-LINK TL-WA801N) are disabling aggregation (downlink
to station) when U-APSD is enabled, resulting in low throughput.
Add a module parameter to allow disabling U-APSD support in the driver.
Also re-enable U-APSD for -9 firmware since the firmare issues were
fixed in this release.
There are devices that won't support U-APSD even with newer
firmware, so bring the TLV flag back to detect those.
Signed-off-by: Matt Chen <matt.chen@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Eran Harary [Sun, 11 May 2014 05:11:34 +0000 (08:11 +0300)]
iwlwifi: allow dynamic configuration of internal memory
New transport need to configure internal memory based on
the data in the (enlarged) alive notification from the
firmware. Add a transport API for this.
Signed-off-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Eran Harary [Sun, 11 May 2014 06:44:17 +0000 (09:44 +0300)]
iwlwifi: mvm: revisit the NVM handling code
Fix a bug in nvm_read_section function if size of the section
is a multiple of 2K:
- if the size of the section is *not* multiple of 2K,
then we will have: read(2K) - return 2K ... read(2K) - return 2K
read(2K) - return the rest (in bytes) and exit the while loop.
- else, if the size of the section is a multiple of 2K,
then we have: read(2K) - return 2K read(2K) - return 2K read(2K) -
return 2K read(2K) - return 0 and exit the while with an error.
We should not return an error in the latter case, because it
might well be that the section was completely read.
Also, we try now to read all the sections as this is needed
for new devices.
Signed-off-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Liad Kaufman [Thu, 8 May 2014 12:24:54 +0000 (15:24 +0300)]
iwlwifi: use dev_printk instead of dev_dbg for debug logs
When calling IWL_DEBUG_*() dev_dbg() is currently used, and this
could result in the log being ignored no matter the internal
loglevel, since dev_dbg() may get turned on or off based on the
dynamic debug mechanism.
Replace the dev_dbg() with dev_printk() since dynamic printing
is pointless as we use our own debug level mechanism and there
is just a single dev_dbg() call in the code.
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
[rephrase commit message a bit] Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Avri Altman [Thu, 8 May 2014 07:06:01 +0000 (10:06 +0300)]
iwlwifi: mvm: Disable uAPSD for a DCM client
A binding object associates virtual MACs to a Phy.
Binding object can ask (and get) air time, thus
allowing several MACs to share the medium.
A binding object can be in either one of 3 states:
1) standalone - A single active MAC
2) Different Channel Mode (DCM) - There are 2 active
MACs or more (not necessarily just clients), but each
has its own channel.
3) Same Channel Mode (SCM) - There are 2 active
MACs or more (not necessarily just clients), that
share the same channel.
This patch introduces an additional condition for enabling uAPSD:
uAPSD should be disabled for a client in DCM.
The reason for that is a low latency issue in Miracast.
iwlwifi: mvm: Add power management support for P2P DCM
If two clients are active while each one is alone on its channel,
and the applicable flags are set, power management should be enabled.
This condition is referred to as Different Channel Mode (DCM).
Up to now, in DCM power management was supported only on BSS.
This patch adds support for P2P power management in DCM as well.
David Spinadel [Thu, 1 May 2014 12:57:22 +0000 (15:57 +0300)]
iwlwifi: mvm: notify sched scan complete from stop routine
Add an option to notify mac80211 about sched scan complete from
iwl_mvm_stop_sched_scan(), to enable this notification when the
stop was called from within the driver.
Signed-off-by: David Spinadel <david.spinadel@intel.com> Reviewed-by: Alexander Bondar <alexander.bondar@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Eran Harary [Wed, 7 May 2014 09:27:10 +0000 (12:27 +0300)]
iwlwifi: 8000: add default NVM file name in family 8000
The 8000 family products need a file on the file system
which is used as NVM. This file is a must, if no filename
is supplied as module parameter, use a default filename.
Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Dor Shaish <dor.shaish@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Johannes Berg [Wed, 7 May 2014 09:47:53 +0000 (11:47 +0200)]
iwlwifi: add missing trailing newlines to debug messages
All messages should have a trailing newline, add all the
missing ones. Also make all messages constants, replacing
the single one that pointlessly used a variable.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
In case RFKILL is in KILL position, the NIC will issue an
interrupt straight away. This interrupt won't be sent
because it is masked in the hardware.
But if our interrupt service routine is called for another
reason (SHARED_IRQ), then we'll look at the interrupt cause
and service it. This can cause bad things if we are not
ready yet.
Explicitly clean the interrupt cause register to make sure
we won't service anything before we are ready to.
Cc: <stable@vger.kernel.org> [3.14] Reported-and-tested-by: Alexander Monakov <amonakov@gmail.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
iwlwifi: mvm: fix sparse warning when _DEBUGFS isn't set
Since the declaration of iwl_mvm_fw_error_rxf_dump and
iwl_mvm_fw_error_sram_dump is under
ifdef CONFIG_IWLWIFI_DEBUGFS, do the same for their
implementation.
Publish WIPHY_FLAG_HAS_CHANNEL_SWITCH if the fw supports
newly introduced IWL_UCODE_TLV_API_CSA_FLOW.
When CSA starts, save the switching vif inside mvm and during the CSA period
configure fw with a new beacon after each beacon transmission in order to
update the csa counters.
Also, handle correctly the CSA unbind-bind flow which is triggered by mac80211
when the actual channel switch happens.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Johannes Berg [Thu, 24 Apr 2014 07:57:40 +0000 (09:57 +0200)]
iwlwifi: pcie: get rid of q->n_bd
This variable always tracks a constant value (256) so there's
no need to have it. Removing it simplifies code generation,
reducing the .text size (by about 240 bytes on x86-64.)
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Johannes Berg [Thu, 24 Apr 2014 14:31:08 +0000 (16:31 +0200)]
iwlwifi: make LED support optional
If there's no LED on the system, it doesn't make a lot of sense
to include close to 4k of LED-related code (mostly in mac80211),
so instead of forcing LED support into the kernel, don't build
iwlwifi/mac80211 LED support if there's no LED class support.
Eran Harary [Mon, 28 Apr 2014 12:22:40 +0000 (15:22 +0300)]
iwlwifi: mvm: select the MAC address according to priority
For family 8000 products, the driver should take the MAC
address from the mac_override section and only if this
section is empty it should take it from the HW section.
Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Eran Harary [Tue, 25 Mar 2014 12:14:44 +0000 (14:14 +0200)]
iwlwifi: mvm: Prioritize external nvm values on top of the OTP values
Read first the nvm sections from the OTP, then read the nvm
sections from the external file and override the OTP values
(if there were any values in the OTP).
Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Dor Shaish <dor.shaish@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Eran Harary [Wed, 23 Apr 2014 07:46:09 +0000 (10:46 +0300)]
iwlwifi: mvm: prevent nic to powered up at driver load
A few devices aren't allowed to be powered up at driver
load time. Add "power_up_nic_in_init" flag to iwl_cfg
structure to customize the load flow according to the
device.
Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
The expected throughput table used when estimating a new column
depends on the channel bandwidth. When switching from legacy to
siso or mimo the wrong expected throughput table was used as it
was chosen based on the the channel bandwidth in legacy which is
always 20Mhz. Instead it should be chosen based on the current sta
bandwidth which could be also 40Mhz or 80Mhz.
When enabling MCS9 this bug leads to a problem where the max
expected throughput of the siso or mimo column is 0 as MCS9 isn't
supported in 20Mhz. This in turns prevents switching to siso or mimo.
Fix this by using the sta bandwidth when deciding which table to choose.
iwlwifi: mvm: rs: don't allow TPC when power save is disabled
Currently we were checking only if the driver power_scheme is set
to CAM. TPC shouldn't be enabled also when disabling powersave on the
interface (e.g. iw wlan0 set power_save off)
which may occur even if power_scheme wasn't set to CAM.
rs_get_best_rate determines the optimal rate to try in a
new Tx column. Currently we were sometimes trying a too high
rate which would lead us to fail and avoid switching to the
new column despite it having a potential to be better.
Change the logic to try and find the first rate which would
exceed the current actual throughput or be more aggressive
if the success ratio is good.
iwlwifi: mvm: rs: revert changes to search cycle rules
Adding more options in the search cycle causes longer
search cycles with additional wondering off to non optimal Tx
configurations. Reduce the Tx configurations searched to
improve throughput in non optimal attenuations.
ath5k: Fix AR5K_PHY_TXPOWER_RATE_MAX register value setting.
I was reading ath5k power setting code and
noticed typing error in ath5k_hw_txpower function.
Invalid value was written to AR5K_PHY_TXPOWER_RATE_MAX
register.
Signed-off-by: Nikolay Ledovskikh <nledovskikh@gmail.com> Acked-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Coverity CID 986698 reports leakage of struct wlcore_platdev_data in the
probe functions of both the SPI/SDIO interfaces. The structure passed to
platform_device_add_data() is dynamically allocated and only freed in the
error paths, however, platform_device_add_data() adds a copy of the platform
specific data to the device. Move the temporary struct that is kmemdup'ed
to the stack. This issue exists since afb43e6d (wlcore: remove if_ops from
platform_data).
Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Adam Lee [Thu, 24 Apr 2014 03:08:44 +0000 (11:08 +0800)]
rtlwifi: rtl8723be: disable MSI interrupts mode
94010fa0dd07e8b904e7c6b6589f15573008ab15 ("rtlwifi: add MSI interrupts
mode support") introduced MSI interrupts mode support, which seemed
safe enough with RTL8188EE and RTL8723BE as RealTek's testing results,
but some users reported their RTL8188EE modules could not connect to
any wireless network after the MSI mode was enabled by Ubuntu 14.04.
So, let's fallback to pin-based mode until rtlwifi's MSI support get
good compatibility.
94010fa0dd07e8b904e7c6b6589f15573008ab15 ("rtlwifi: add MSI interrupts
mode support") introduced MSI interrupts mode support, which seemed
safe enough with RTL8188EE and RTL8723BE as RealTek's testing results,
but some users reported their RTL8188EE modules could not connect to
any wireless network after the MSI mode was enabled by Ubuntu 14.04.
So, let's fallback to pin-based mode until rtlwifi's MSI support get
good compatibility.
cfg80211: Dynamic channel bandwidth changes in AP mode
This extends NL80211_CMD_SET_CHANNEL to allow dynamic channel bandwidth
changes in AP mode (including P2P GO) during a lifetime of the BSS. This
can be used to implement, e.g., HT 20/40 MHz co-existence rules on the
2.4 GHz band.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
ieee80211_assign_chanctx() checks if local->use_chanctx is true, so
the two code block related to ieee80211_assign_chanctx() can be moved
into above if clause, emphasize that these code are executed only if
local->use_chanctx is true.
Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>
[change subject] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
cfg80211: Use 5MHz bandwidth by default when checking usable channels
Current code checks if the 20MHz bandwidth is allowed for
particular channel -- if it is not, the channel is disabled.
Since we need to use 5/10 MHz channels, this code is modified in
the way that the default bandwidth to check is 5MHz. If the
maximum bandwidth allowed by the channel is smaller than 5MHz,
the channel is disabled. Otherwise the channel is used and the
flags are set according to the bandwidth allowed by the channel.
Signed-off-by: Rostislav Lisovy <rostislav.lisovy@fel.cvut.cz> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Since there are frequency bands (e.g. 5.9GHz) allowing channels
with only 10 or 5 MHz bandwidth, this patch adds attributes that
allow keeping track about this information.
When channel attributes are reported to user-space, make sure to
not break old tools, i.e. if the 'split wiphy dump' is enabled,
report the extra attributes (if present) describing the bandwidth
restrictions. If the 'split wiphy dump' is not enabled,
completely omit those channels that have flags set to either
IEEE80211_CHAN_NO_10MHZ or IEEE80211_CHAN_NO_20MHZ.
Add the check for new bandwidth restriction flags in
cfg80211_chandef_usable() to comply with the restrictions.
Signed-off-by: Rostislav Lisovy <rostislav.lisovy@fel.cvut.cz> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Zhao, Gang [Mon, 21 Apr 2014 04:53:05 +0000 (12:53 +0800)]
mac80211: change return value of notifier function
Return NOTIFY_DONE if we don't care this time's notification, return
NOTIFY_OK if we successfully handled this time's notification. That's
the formal way to do it.
Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Zhao, Gang [Mon, 21 Apr 2014 04:53:04 +0000 (12:53 +0800)]
cfg80211: change return value of notifier function
Return NOTIFY_DONE if we don't care this time's notification, return
NOTIFY_OK if we successfully handled this time's notification. That's
the formal way to do it.
Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Zhao, Gang [Mon, 21 Apr 2014 04:53:02 +0000 (12:53 +0800)]
cfg80211: change registered device pointer name
Name "dev" is too common and ambiguous, let all the pointer name
pointing to struct cfg80211_registered_device be "rdev". This can
improve code readability and consistency(since other places have
already called it rdev).
Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Marek Kwaczynski [Mon, 14 Apr 2014 09:27:21 +0000 (11:27 +0200)]
mac80211: add option to generate CCMP IVs only for mgmt frames
Some chips can encrypt managment frames in HW, but
require generated IV in the frame. Add a key flag
that allows us to achieve this.
Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
[use BIT(0) to fill that spot, fix indentation] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Michal Kazior [Wed, 9 Apr 2014 13:29:33 +0000 (15:29 +0200)]
mac80211: compute chanctx refcount on-the-fly
It doesn't make much sense to store refcount in
the chanctx structure. One still needs to hold
chanctx_mtx to get the value safely. Besides,
refcount isn't on performance critical paths.
This will make implementing chanctx reservation
refcounting a little easier.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Michal Kazior [Wed, 9 Apr 2014 13:29:32 +0000 (15:29 +0200)]
mac80211: fix racy usage of chanctx->refcount
Channel context refcount is protected by
chanctx_mtx. Accessing the value without holding
the mutex is racy. RCU section didn't guarantee
anything here.
Theoretically ieee80211_channel_switch() could
fail to see refcount change and read "1" instead
of, e.g. "2". This means mac80211 could accept CSA
even though it shouldn't have.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>