Shahar Patury [Tue, 22 Dec 2015 12:30:06 +0000 (14:30 +0200)]
wlcore/wl18xx: fw logger over sdio
Enable the FW Logger to work over the SDIO interface in addition to over UART
interface. In the new design we use fw internal memory instead of packet ram
that was used in older (wl12xx) design. This change reduces the impact on TP
and stability.
A new event was added to notify fw logger is ready for reading. Dynamic
configuration to debugfs was added as well.
Signed-off-by: Shahar Patury <shaharp@ti.com> Signed-off-by: Guy Mishol <guym@ti.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Rafał Miłecki [Thu, 17 Dec 2015 19:53:54 +0000 (20:53 +0100)]
bcma: use module_init for the main part of bus initialization
So far we were using fs_initcall. It was (and still is) needed because
struct bus_type has to be registered early. However main bus
initialization has to happen later as it requires SPROM which depends on
NVRAM which depends on mtd.
Solve it by using fs_initcall only for bus_register call and module_init
for the rest. It affects bcma only when built-in obviously.
This was tested with BCM4706 and BCM5357C0 (BCM47XX), BCM4708A0
(ARCH_BCM_5301X) and BCM43225 (PCIe card with bcma as module).
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Larry Finger [Mon, 21 Dec 2015 23:05:08 +0000 (17:05 -0600)]
rtlwifi: rtl_pci: Fix kernel panic
In commit 38506ecefab9 (rtlwifi: rtl_pci: Start modification for new
drivers), a bug was introduced that causes a NULL pointer dereference.
As this bug only affects the infrequently used RTL8192EE and only under
low-memory conditions, it has taken a long time for the bug to show up.
The bug was reported on the linux-wireless mailing list and also at
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/ as
bug #1527603 (kernel crashes due to rtl8192ee driver on ubuntu 15.10).
Fixes: 38506ecefab9 ("rtlwifi: rtl_pci: Start modification for new drivers") Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amitkumar Karwar [Wed, 16 Dec 2015 12:21:44 +0000 (04:21 -0800)]
mwifiex: add missing check for PCIe8997 chipset
This patch ensures mwifiex_pcie_txbd_empty() does take care
of 8997 chipset.
Fixes: 6d85ef00d9dfe ("mwifiex: add support for 8997 chipset") Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amitkumar Karwar [Wed, 16 Dec 2015 12:21:43 +0000 (04:21 -0800)]
mwifiex: fix PCIe register information for 8997 chipset
This patch corrects some information in mwifiex_pcie_card_reg()
structure for 8997 chipset
Fixes: 6d85ef00d9dfe ("mwifiex: add support for 8997 chipset") Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Shengzhen Li <szli@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Two of the module parameter descriptions show incorrect default values.
In addition the value for software encryption is not transferred to
the locations used by the driver.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
In this driver, parameters disable_watchdog and sw_crypto are never
copied into the locations used in the main code. While modifying the
parameter handling, the copying of parameter msi_support is moved to
be with the rest.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Larry Finger [Mon, 14 Dec 2015 22:34:33 +0000 (16:34 -0600)]
rtlwifi: rtl8821ae: Fix errors in parameter initialization
This driver failed to copy parameters sw_crypto and disable_watchdog into
the locations actually used by the driver. In addition, msi_support was
initialized three times and one of them used the wrong variable. The
initialization of parameter int_clear was moved so that it is near that
of the rest of the parameters.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Larry Finger [Mon, 14 Dec 2015 22:34:32 +0000 (16:34 -0600)]
rtlwifi: rtl8723ae: Fix initialization of module parameters
This driver has some errors in the handling of module parameters. These
include missing initialization for parameters msi_support and
disable_watchdog. In addition, neither of these parameters nor sw_crypto
are transferred into the locations used by the driver. A final fix is
adding parameter msi to the module named and description macros.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This driver has a number of errors in the module initialization. These
include the following:
Parameter msi_support is stored in two places - one is removed.
Paramters sw_crypto and disable_watchdog were never stored in the final
locations, nor were they initialized properly.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
chunfan chen [Mon, 14 Dec 2015 12:15:15 +0000 (04:15 -0800)]
mwifiex: fix WPA connection problem
Device fails to connect to some AP's configured in WPA
security mode. Currently IE buffer parsing logic in driver
expects WPA IE to be present at the beginning of IE buffer.
Otherwise connection is failed with 'incompatible network
setting' error.
This patch fixes the problem by improving IE buffer parsing
logic.
Signed-off-by: chunfan chen <jeffc@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amitkumar Karwar [Mon, 14 Dec 2015 12:15:11 +0000 (04:15 -0800)]
mwifiex: fix AMPDU not setup on TDLS link problem
Sometimes AP sends TDLS setup response as AMSDU packet.
As driver doesn't parse it and update peer station's 11n
capability in this case, AMPDU doesn't get setup.
This patch calls mwifiex_process_tdls_action_frame() in
AMSDU Rx path to fix the problem.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Cathy Luo <cluo@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Xinming Hu [Mon, 14 Dec 2015 12:15:07 +0000 (04:15 -0800)]
mwifiex: abort cac in del_station() handler
When hostapd is killed with Ctrl+C before cac get completed,
stop_ap handler will not be called, thus priv->wdev.cac_started
flag remains set.
Hostapd restart attempt will be failed in this case with device
busy error. This patch aborts cac in del_station handler to
handle this corner case.
Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Xinming Hu [Mon, 14 Dec 2015 12:15:05 +0000 (04:15 -0800)]
mwifiex: fix bug for wildcard-prefix wowlan pattern
Wildcard prefix bytes are ignored while downloading packet
pattern to firmware. As packet offset is not adjusted
accordingly firmware end up matching the pattern at wrong
offset. The packet offset is corrected in this patch.
Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Kalle Valo [Tue, 29 Dec 2015 16:44:19 +0000 (18:44 +0200)]
Merge tag 'iwlwifi-next-for-kalle-2015-12-21' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
* Make scan parameters low latency aware (Avi Stern)
* Fix in the NL80211_FEATURE_FULL_AP_CLIENT_STATE state case (Ayala)
* Fix enable injection mode (Chaya Rachel)
* Various cleanups (Dan / Julia / myself)
* Allow to stay more time on popular channels (David Spinadel)
* Bug fixes for D0i3 (Eliad / Luca)
* Fixes for GO uAPSD (myself)
* Start of TSO support (myself)
* Rate control bug fixes (Eyal / Gregory)
* Start the work on 9000 devices (Johannes / Sara / Oren)
* Start the work on a new Tx queue allocation model (Liad)
* Debug infrastructure enhancements (Golan)
Eliad Peller [Wed, 11 Nov 2015 15:23:59 +0000 (17:23 +0200)]
iwlwifi: update key params on d0i3 entrance/exit
In order to let the fw do offloading properly, we need
to provide various key data (e.g. PN).
Configure the params on d0i3 entrance, and update them
back on d0i3 exit.
Since d3 code is now called in d0i3 which requires runtime
pm only, make d3.0 depend on CONFIG_PM (rather than
CONFIG_PM_SLEEP), and add required #ifdefs and wrappers
where needed, so both CONFIG_PM=n and CONFIG_PM_RUNTIME=n
configurations will build correctly.
Ayala Beker [Tue, 15 Dec 2015 22:32:07 +0000 (00:32 +0200)]
iwlwifi: mvm: Change number of associated stations when station becomes associated
Currently, the number of associated stations gets updated when adding
a new station or removing it. This is incorrect as it's possible that
a station was inserted before it was associated
Fix this by increasing/decreasing ap_assoc_sta_count whenever
a station transitions in/out the associated state.
These registers can help to debug PHY issues. Since this
adds a significant amount of work to the debug collection
phase, dump the periphery registers only if the firmware
is stopped.
Sara Sharon [Tue, 1 Dec 2015 11:48:18 +0000 (13:48 +0200)]
iwlwifi: mvm: infrastructure for frame-release message
Incoming hardware will send frame release notifications to
the reorder buffer in order to update with the BA session
status and up to date NSSN.
This patch enables the API.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Johannes Berg [Fri, 11 Dec 2015 08:36:10 +0000 (09:36 +0100)]
iwlwifi: mvm: change iwl_mvm_get_key_sta_id() to return the station
The code in iwl_mvm_update_tkip_key() is now pretty much duplicated
with the code in iwl_mvm_get_key_sta_id() doing the station ID lookup
again after it was already done. Change iwl_mvm_get_key_sta_id() to
iwl_mvm_get_key_sta(), returning the mvm_sta pointer, to allow that
duplicate code to be removed.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Currently when creating a new vif in monitor mode the driver doesn't
allocate a specific station. This causes that in the situation that
tx traffic is injected, the tx queues are not scheduled,
with the result of a TFD queue hang.
Fix that by allocating a station and ensuring its tx queues
are scheduled.
This fixes https://bugzilla.kernel.org/show_bug.cgi?id=104591
David Spinadel [Sun, 22 Nov 2015 14:37:36 +0000 (16:37 +0200)]
iwlwifi: mvm: add extended dwell time
When doing active scan on crowded channels we are likely to miss probe
responses due to collisions. To overcome this issue we use an extended
dwell time on channels 1, 6 and 11; this dwell time is set to 100.
In case of fragmented scan extended dwell time is the maximum out of
channel time - 44 msec. Fragmented active scan will be addressed later.
Extended dwell time isn't used in sched scan or p2p find.
Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Golan Ben-Ami [Mon, 30 Nov 2015 12:30:21 +0000 (14:30 +0200)]
iwlwifi: mvm: support description for user triggered fw dbg collection
Add to the user triggered fw debug collection support for describing
the reason of the trigger.
This could be useful for identifying a dump by a unique id, passed as
a description.
Sara Sharon [Thu, 19 Nov 2015 11:12:15 +0000 (13:12 +0200)]
iwlwifi: mvm: enable L3 filtering
Firmware will support filtering multicast L3 packets.
The L3 filtering is configured by the WOWLAN_CONFIG command.
All flags should be enabled by default.
Older firmware is not affected as it does not look into
this field.
Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Luca Coelho [Tue, 10 Nov 2015 23:06:17 +0000 (01:06 +0200)]
iwlwifi: mvm: refactor the way fw_key_table is handled
Instead of keeping the fw_key_table bits set when the keys are removed
(i.e. in D3 entry or HW_RESTART flows), clear them and set them again
only when the keys have been successfully re-added. This makes the
bitmask more closely tied to the actual firmware programming.
When the op_mode sends an skb whose payload is bigger than
MSS, PCIe will create an A-MSDU out of it. PCIe assumes
that the skb that is coming from the op_mode can fit in one
A-MSDU. It is the op_mode's responsibility to make sure
that this guarantee holds.
Additional headers need to be built for the subframes.
The TSO core code takes care of the IP / TCP headers and
the driver takes care of the 802.11 subframe headers.
These headers are stored on a per-cpu page that is re-used
for all the packets handled on that same CPU. Each skb
holds a reference to that page and releases the page when
it is reclaimed. When the page gets full, it is released
and a new one is allocated.
Since any SKB that doesn't go through the fast-xmit path
of mac80211 will be segmented, we can assume here that the
packet is not WEP / TKIP and has a proper SNAP header.
iwlwifi: mvm: prepare the code towards TSO implementation
Differentiate between the cases where the skb is a large
send and the other cases.
Advertise TSO even if, at this stage, skb_gso_segment will
be called and it will do all the work.
iwlwifi: pcie: allow to pretend to have Tx CSUM for debug
Allow to configure the driver to pretend to have TX CSUM
offload support. This will be useful to test the TSO flows
that will come in further patches.
This configuration is disabled by default.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Rafał Miłecki [Wed, 9 Dec 2015 22:36:51 +0000 (23:36 +0100)]
ssb: pick SoC invariants code from MIPS BCM47xx arch
There is code in ssb fetching "invariants" that is basically a set of
board specific data. Every host requires its own implementation of
reading function. In ssb we have support for PCI, PCMCIA & SDIO.
For some (historical?) reason code reading "invariants" for SoC was
placed in arch code and provided by a callback. This is not needed
nowadays, so lets move that into ssb. This way we keep all "invariants"
functions in a single module making code cleaner.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Sara Sharon [Thu, 19 Nov 2015 09:53:49 +0000 (11:53 +0200)]
iwlwifi: mvm: change protocol offload flows
RFC4862 states that "In all cases, a node MUST NOT respond to
a Neighbor Solicitation for a tentative address".
Currently the driver configures the NS offload and does not wait
for address to become permanent, thus violating the RFC.
Just removing the address from the address list is not good enough
for all cases, since the NS messages are needed for the duplicate
address detection and should not be discarded.
For d0i3 disable NS offload. Put tentative address in the address
list so the NS packet will not be filtered out by ucode.
For D3 the platform will not wake from NS packets - so enable
NS offload while removing the tentative address from the list.
Given that now NS offload might be disabled, and that the ucode
uses the IP data for other puroposes (L3 filtering) add two
independent flags indicating if IPv4\IPv6 data is valid.
Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Golan Ben-Ami [Sun, 30 Aug 2015 14:41:36 +0000 (17:41 +0300)]
iwlwifi: expose fw usniffer mode to more utilities
Today, in order to configure fw in usniffer mode, the ucode
must have the corresponding tlv, which is revealed to the driver
while parsing the ucode.
Expose the mode of the usniffer to other utilities in the driver
(other than the ucode parser) by passing back a pointer to the value.
This can be very useful for allowing configuring the fw dbg data
using an external configuration file, because this configuration
depends on the fw usniffer mode.
Peter Oh [Thu, 3 Dec 2015 17:50:55 +0000 (09:50 -0800)]
ath10k: allow Mesh Point to install peer security key
Mesh Point requires peer security key install when running
in secured mode since it's a type of peer links, otherwise peer
link will be removed due to key install failure.
MFP feature set is required to run Mesh in secured mode and
QCA988X firmware, 10.2.4.70.14-2 and above, is the only one
supporting secured Mesh at this moment.
Signed-off-by: Peter Oh <poh@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Johannes Berg [Fri, 11 Dec 2015 08:06:25 +0000 (09:06 +0100)]
iwlwifi: mvm: protect RCU dereference in iwl_mvm_get_key_sta_id
Properly protect the RCU dereference in iwl_mvm_get_key_sta_id() when
coming from iwl_mvm_update_tkip_key() which cannot hold the mvm->mutex
by moving the call into the RCU critical section.
Modify the check to use rcu_dereference_check() to permit this.
Fixes: 9513c5e18a0d ("iwlwifi: mvm: Avoid dereferencing sta if it was already flushed") Reported-by: Laura Abbott <labbott@redhat.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Johannes Berg [Thu, 3 Dec 2015 16:26:59 +0000 (17:26 +0100)]
iwlwifi: separate firmware version for 7260 devices
The 7260 devices aren't going to be updated for completely new
firmware versions any more (only bugfixes), and haven't been
since API version 17. Encode that in the data structures to
avoid trying to load FW images that will never exist.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
iwlwifi: replace d0i3_mode and wowlan_d0i3 with more generic variables
The d0i3_mode variable is used to distinguish between transports that
handle d0i3 entry during suspend by themselves (i.e. the slave
transports) and those which rely on the op_mode layer to do it. The
reason why the former do it by themselves is that they need to
transition from d0i3 in runtime_suspend into d0i3 in system-wide
suspend and this transition needs to happen before the op_mode's
suspend flow is called.
The wowlan_d0i3 element is also a bit confusing, because it just
reflects the wowlan->any value for the trans to understand. This is a
bit unclear in the code and not generic enough for future use.
To make it clearer and to generalize the platform power mode settings,
introduce two variables to indicate the platform power management
modes used by the transport.
Additionally, in order not to take too big a step in one patch, treat
this new variables semantically in the same way as the old d0i3_mode
element, introducing a iwl_mvm_enter_d0i3_on_suspend() function to
help with that.
This commit also adds the foundation for a new concept where the
firmware configuration state (i.e. D0, D3 or D0i3) is abstracted from
the platform PM mode we are in (i.e. runtime suspend or system-wide
suspend).
Eliad Peller [Thu, 10 Dec 2015 13:47:11 +0000 (15:47 +0200)]
iwlwifi: avoid d0i3 commands when no/init ucode is loaded
d0i3 commands are not supported in the init image, so take
a reference to ensure we don't enter d0i3 during init image,
and additional checks to prevent d0i3 commands when no
fw image is loaded.
Add a few WARN_ON_ONCE to the d0i3 enter/exit commands
to ensure we send d0i3 commands only when the normal
ucode is loaded.
iwlwifi: mvm: close the SP if we send fewer frames than expected in SP
When we have holes in the BA window, there might be frames
that have been ACKed between the read and the right
pointers. This means that these frames won't be scheduled
again by the SCD and the firwmare won't see them.
This invalidates the number of frames we tell the firmware
to send. When we detect this case, tell mac80211 to close
the SP and to send an EOSP so that the firmware can be in
sync.
Merge tag 'mac80211-next-for-davem-2015-12-07' into next
This pull request got a bit bigger than I wanted, due to
needing to reshuffle and fix some bugs. I merged mac80211
to get the right base for some of these changes.
* new mac80211 API for upcoming driver changes: EOSP handling,
key iteration
* scan abort changes allowing to cancel an ongoing scan
* VHT IBSS 80+80 MHz support
* re-enable full AP client state tracking after fixes
* various small fixes (that weren't relevant for mac80211)
* various cleanups
iwlwifi: block the queues when we send ADD_STA for uAPSD
We send an ADD_STA to instruct the firmware to release
frames despite the peer being in PS.
Since the ADD_STA command and the Tx frame that comes
immediately afterwards can be reordered by the DMA engine,
we need to block the Tx queues until the firmware replies
with the ADD_STA response.
iwlwifi: trans: support a callback for ASYNC commands
This allows the op_mode to request from the transport to
call a callback when an ASYNC commands is completed by
the firmware. The same callback will be called for all the
commands. Pass the command whose response triggers the
callback as a parameter to the callback itself.
iwlwifi: pcie: allow the op_mode to block the tx queues
In certain flows (see next patches), the op_mode may need to
block the Tx queues for a short period. Provide an API for
that. The transport is in charge of counting the number of
times the queues are blocked since the op_mode may block the
queues several times in a row before unblocking them.
Eliad Peller [Sun, 15 Nov 2015 13:44:17 +0000 (15:44 +0200)]
iwlwifi: mvm: check iwl_mvm_wowlan_config_key_params() return value
commit 9a4c830007817e ("iwlwifi: mvm: refactor d3 key
update functions") refactored some code into
iwl_mvm_wowlan_config_key_params() function, but the
return value was never checked, and not all the function
flows returned valid values. fix it.
Eliad Peller [Wed, 9 Dec 2015 14:33:20 +0000 (16:33 +0200)]
iwlwifi: mvm: cleanup roc te on restart cleanup
iwl_mvm_restart_cleanup() calls ieee80211_remain_on_channel_expired()
on cleanup, but it doesn't clean the actual roc time
events, resulting in failure of further ROC attempts.
Refactor iwl_mvm_stop_roc() a bit, and add a new function
to only cleanup the roc time events (without sending further
commands).
Curly braces are NOT intended, the extra tab was added by mistake in
commit 1a616dd2f171 ('iwlwifi: dump prph registers in a common place
for all transports').
type=cleanup
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Johannes Berg [Fri, 17 Apr 2015 14:39:12 +0000 (16:39 +0200)]
iwlwifi: dvm: advertise NETIF_F_SG
If the transport supports it, advertise NETIF_F_SG to mac80211 to
be able to use frag SKBs. This will already improve performance by
allowing software GSO to be used.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Johannes Berg [Fri, 17 Apr 2015 14:39:12 +0000 (16:39 +0200)]
iwlwifi: mvm: advertise NETIF_F_SG
If the transport supports it, advertise NETIF_F_SG to mac80211 to
be able to use frag SKBs. This will already improve performance by
allowing software GSO to be used.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Eyal Shapira [Thu, 19 Nov 2015 16:37:31 +0000 (18:37 +0200)]
iwlwifi: mvm: rs: fix a potential out of bounds access
Klocwork pointed these out. There is a theoretical possibility
that rate->index might be set to IWL_RATE_INVALID (15).
This could trigger an out of bounds access on ht_vht_rates or
legacy_rates arrays. Fix it by adding some checks.
Avraham Stern [Thu, 26 Nov 2015 09:22:33 +0000 (11:22 +0200)]
iwlwifi: mvm: configure scheduled scan according to traffic conditions
Change scan configuration (dwell time, suspend time etc.) according
to traffic conditions. This is useful for scans that are managed by
the FW (e.g. scheduled scan).
iwlwifi: mvm: set default new STA as non-aggregated
When sending the first ADD_STA HCMD for a STA, the %add_modify
field indicates an addition of a STA and not a modification
of one. In such a case, all fields of the HCMD are used to
initialize the corresponding fields in the FW, regardless of
what bits are set in %modify_mask.
Set the %tid_disable_tx field to mvm_sta->tid_disable_agg in
iwl_mvm_sta_send_to_fw(). If the STA is only updated this will
have no effect, but if it is added - it will make sure the
STA starts with the correct queues - if any - configured as
non-aggregated by default (until told otherwise).
Gregory Greenman [Tue, 24 Nov 2015 17:13:27 +0000 (19:13 +0200)]
iwlwifi: mvm: add an option to start rs from HT/VHT rates
Extend the configurable option of setting initial rate to RSSI based.
Make the initial rate to be set to VHT/HT SISO or legacy depending on
the AP capabilities.
Miaoqing Pan [Fri, 9 Oct 2015 09:06:45 +0000 (17:06 +0800)]
ath9k: feeding entropy in kernel from ADC capture
This patch is derived from
commit 6301566e0b2d ("ath9k: export HW random number generator"),
We evaluated the entropy of the ADC data on QCA9531, QCA9561, QCA955x,
and AR9340, and it has sufficient quality random data (at least 10 bits
and up to 22 bits of min-entropy for a 32-bit value). We conservatively
assume the min-entropy is 10 bits out of 32 bits. Thus, ATH9K_RNG_BUF_SIZE
is set to 320 (u32) i.e., 1.25 kilobytes of data is inserted to fill up
the pool as soon as the entropy counter becomes 896/4096 (set by random.c).
Since ADC was not designed to be a dedicated HW RNG, we do not want to bind
it to /dev/hwrng framework directly. This patch feeds the entropy directly
from the WiFi driver to the input pool. The ADC register output is only
used as a seed for the Linux entropy pool. No conditioning is needed,
since all the conditioning is performed by the pool itself.
Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Uri Mashiach [Thu, 10 Dec 2015 13:12:56 +0000 (15:12 +0200)]
wlcore/wl12xx: spi: fix oops on firmware load
The maximum chunks used by the function is
(SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE + 1).
The original commands array had space for
(SPI_AGGR_BUFFER_SIZE / WSPI_MAX_CHUNK_SIZE) commands.
When the last chunk is used (len > 4 * WSPI_MAX_CHUNK_SIZE), the last
command is stored outside the bounds of the commands array.
Oops 5 (page fault) is generated during current wl1271 firmware load
attempt:
root@debian-armhf:~# ifconfig wlan0 up
[ 294.312399] Unable to handle kernel paging request at virtual address 00203fc4
[ 294.320173] pgd = de528000
[ 294.323028] [00203fc4] *pgd=00000000
[ 294.326916] Internal error: Oops: 5 [#1] SMP ARM
[ 294.331789] Modules linked in: bnep rfcomm bluetooth ipv6 arc4 wl12xx
wlcore mac80211 musb_dsps cfg80211 musb_hdrc usbcore usb_common
wlcore_spi omap_rng rng_core musb_am335x omap_wdt cpufreq_dt thermal_sys
hwmon
[ 294.351838] CPU: 0 PID: 1827 Comm: ifconfig Not tainted 4.2.0-00002-g3e9ad27-dirty #78
[ 294.360154] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 294.366557] task: dc9d6d40 ti: de550000 task.ti: de550000
[ 294.372236] PC is at __spi_validate+0xa8/0x2ac
[ 294.376902] LR is at __spi_sync+0x78/0x210
[ 294.381200] pc : [<c049c760>] lr : [<c049ebe0>] psr: 60000013
[ 294.381200] sp : de551998 ip : de5519d8 fp : 00200000
[ 294.393242] r10: de551c8c r9 : de5519d8 r8 : de3a9000
[ 294.398730] r7 : de3a9258 r6 : de3a9400 r5 : de551a48 r4 : 00203fbc
[ 294.405577] r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : de3a9000
[ 294.412420] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM
Segment user
[ 294.419918] Control: 10c5387d Table: 9e528019 DAC: 00000015
[ 294.425954] Process ifconfig (pid: 1827, stack limit = 0xde550218)
[ 294.432437] Stack: (0xde551998 to 0xde552000)
...
[ 294.883613] [<c049c760>] (__spi_validate) from [<c049ebe0>]
(__spi_sync+0x78/0x210)
[ 294.891670] [<c049ebe0>] (__spi_sync) from [<bf036598>]
(wl12xx_spi_raw_write+0xfc/0x148 [wlcore_spi])
[ 294.901661] [<bf036598>] (wl12xx_spi_raw_write [wlcore_spi]) from
[<bf21c694>] (wlcore_boot_upload_firmware+0x1ec/0x458 [wlcore])
[ 294.914038] [<bf21c694>] (wlcore_boot_upload_firmware [wlcore]) from
[<bf24532c>] (wl12xx_boot+0xc10/0xfac [wl12xx])
[ 294.925161] [<bf24532c>] (wl12xx_boot [wl12xx]) from [<bf20d5cc>]
(wl1271_op_add_interface+0x5b0/0x910 [wlcore])
[ 294.936364] [<bf20d5cc>] (wl1271_op_add_interface [wlcore]) from
[<bf15c4ac>] (ieee80211_do_open+0x44c/0xf7c [mac80211])
[ 294.947963] [<bf15c4ac>] (ieee80211_do_open [mac80211]) from
[<c0537978>] (__dev_open+0xa8/0x110)
[ 294.957307] [<c0537978>] (__dev_open) from [<c0537bf8>]
(__dev_change_flags+0x88/0x148)
[ 294.965713] [<c0537bf8>] (__dev_change_flags) from [<c0537cd0>]
(dev_change_flags+0x18/0x48)
[ 294.974576] [<c0537cd0>] (dev_change_flags) from [<c05a55a0>]
(devinet_ioctl+0x6b4/0x7d0)
[ 294.983191] [<c05a55a0>] (devinet_ioctl) from [<c0517040>]
(sock_ioctl+0x1e4/0x2bc)
[ 294.991244] [<c0517040>] (sock_ioctl) from [<c017d378>]
(do_vfs_ioctl+0x420/0x6b0)
[ 294.999208] [<c017d378>] (do_vfs_ioctl) from [<c017d674>]
(SyS_ioctl+0x6c/0x7c)
[ 295.006880] [<c017d674>] (SyS_ioctl) from [<c000f4c0>]
(ret_fast_syscall+0x0/0x54)
[ 295.014835] Code: e1550004e24440340a00007de5953018 (e5942008)
[ 295.021544] ---[ end trace 66ed188198f4e24e ]---
Signed-off-by: Uri Mashiach <uri.mashiach@compulab.co.il> Acked-by: Igor Grinberg <grinberg@compulab.co.il> Cc: stable@vger.kernel.org Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Arend van Spriel [Thu, 10 Dec 2015 12:43:09 +0000 (13:43 +0100)]
brcmfmac: add 43242 device id for LG dongle
Got a hint on IRC that a 43242 dongle for LG smart TV's works with
brcmfmac:
> Hello - I recently got a LG AN-WF500 wireless dongle for LG's SmartTVs.
> From the information I gathered it uses a Broadcom chipset BCM43242.
> The device should have been supported by brcmfmac kernel driver if it used
> USB IDs 0a5c:bd1f.
> My device however identifies itself as "ID 043e:3101 LG Electronics USA, Inc.".
> I then tried adding the USB ID to the driver with
> "echo "043e 3101" > /sys/bus/usb/drivers/brcmfmac/new_id" and it just works.
> The kernel provides the following information.
> [15958.851291] usb 3-1.1.3: new high-speed USB device number 53 using ehci-pci
> [15958.946723] usb 3-1.1.3: New USB device found, idVendor=043e, idProduct=3101
> [15958.946728] usb 3-1.1.3: New USB device strings: Mfr=1, Product=4, SerialNumber=3
> [15958.946731] usb 3-1.1.3: Product: Composite Wireless Adapter
> [15958.946733] usb 3-1.1.3: Manufacturer: Broadcom
> [15958.946735] usb 3-1.1.3: SerialNumber: 28458
Reported-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Kosuke Tatsukawa [Thu, 10 Dec 2015 12:43:08 +0000 (13:43 +0100)]
brcmfmac: fix waitqueue_active without memory barrier in brcmfmac driver
brcmf_msgbuf_ioctl_resp_wake() seems to be missing a memory barrier
which might cause the waker to not notice the waiter and miss sending a
wake_up as in the following figure.
brcmf_msgbuf_ioctl_resp_wake brcmf_msgbuf_ioctl_resp_wait
------------------------------------------------------------------------
if (waitqueue_active(&msgbuf->ioctl_resp_wait))
/* The CPU might reorder the test for
the waitqueue up here, before
prior writes complete */
/* wait_event_timeout */
/* __wait_event_timeout */
/* ___wait_event */
prepare_to_wait_event(&wq, &__wait,
state);
if (msgbuf->ctl_completed)
...
msgbuf->ctl_completed = true;
schedule_timeout(__ret))
------------------------------------------------------------------------
There are three other place in drivers/net/wireless/brcm80211/brcmfmac/
which have similar code. The attached patch removes the call to
waitqueue_active() leaving just wake_up() behind. This fixes the
problem because the call to spin_lock_irqsave() in wake_up() will be an
ACQUIRE operation.
I found this issue when I was looking through the linux source code
for places calling waitqueue_active() before wake_up*(), but without
preceding memory barriers, after sending a patch to fix a similar
issue in drivers/tty/n_tty.c (Details about the original issue can be
found here: https://lkml.org/lkml/2015/9/28/849).
Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Kosuke Tatsukawa <tatsu@ab.jp.nec.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Arend van Spriel [Thu, 10 Dec 2015 12:43:06 +0000 (13:43 +0100)]
brcmfmac: no interface combination check for single interface
The interface combinations are intended for use-case in which the driver
handles multiple interface concurrently. This means that the combinations
do not need to be checked when there is only a single interface active.
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: Kalle Valo <kvalo@codeaurora.org>