platform/kernel/linux-rpi.git
9 years agoath9k: Setup MCI statistics properly
Sujith Manoharan [Mon, 16 Feb 2015 05:19:58 +0000 (10:49 +0530)]
ath9k: Setup MCI statistics properly

Use a subroutine to enable MCI debug statistics
if it is present in the global configuration.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix MCI TX control
Sujith Manoharan [Mon, 16 Feb 2015 05:19:57 +0000 (10:49 +0530)]
ath9k: Fix MCI TX control

This patch makes sure that the antenna configuration
is used properly when setting AR_MCI_TX_CTRL.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Handle 2-ANT AR9565 in MCI reset
Sujith Manoharan [Mon, 16 Feb 2015 05:19:56 +0000 (10:49 +0530)]
ath9k: Handle 2-ANT AR9565 in MCI reset

The value programmed in the BTCOEX control register
is different for each chip. This patch adds support
for 2-ANT, 1-ANT solutions based on AR9565.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add new MCI configuration parameters
Sujith Manoharan [Mon, 16 Feb 2015 05:19:55 +0000 (10:49 +0530)]
ath9k: Add new MCI configuration parameters

Several new MCI parameters need to be handled for
new chips, add them.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Remove useless check in MCI reset
Sujith Manoharan [Mon, 16 Feb 2015 05:19:54 +0000 (10:49 +0530)]
ath9k: Remove useless check in MCI reset

If we fail to allocate the sched/gpm buffers when
initializing MCI, we bail out properly. Checking
them in ar9003_mci_reset() is unnecessary, so remove it.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Move MCI registers to reg_mci.h
Sujith Manoharan [Mon, 16 Feb 2015 05:19:53 +0000 (10:49 +0530)]
ath9k: Move MCI registers to reg_mci.h

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoiwlegacy: 4965-rs: Remove bogus colon after newline from debug message
Geert Uytterhoeven [Tue, 3 Mar 2015 10:58:13 +0000 (11:58 +0100)]
iwlegacy: 4965-rs: Remove bogus colon after newline from debug message

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoMerge tag 'iwlwifi-next-for-kalle-2015-03-01' of https://git.kernel.org/pub/scm/linux...
Kalle Valo [Tue, 3 Mar 2015 11:49:36 +0000 (13:49 +0200)]
Merge tag 'iwlwifi-next-for-kalle-2015-03-01' of https://git./linux/kernel/git/iwlwifi/iwlwifi-next

* add triggers for firmware dump collection
* remove support for -9.ucode
* new statitics API
* rate control improvements

9 years agobcma: enable support for PCIe Gen 2 host devices
Rafał Miłecki [Sun, 8 Feb 2015 16:11:50 +0000 (17:11 +0100)]
bcma: enable support for PCIe Gen 2 host devices

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: support bringing up bus hosted on PCIe Gen 2
Rafał Miłecki [Sun, 8 Feb 2015 16:11:49 +0000 (17:11 +0100)]
bcma: support bringing up bus hosted on PCIe Gen 2

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: change IRQ control function to accept bus as an argument
Rafał Miłecki [Sun, 8 Feb 2015 16:11:48 +0000 (17:11 +0100)]
bcma: change IRQ control function to accept bus as an argument

It doesn't operate on PCI core, but PCI host device, so there is no
point of passing core related struct.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: add helpers bringing PCIe hosted bus up / down
Rafał Miłecki [Sun, 8 Feb 2015 16:11:47 +0000 (17:11 +0100)]
bcma: add helpers bringing PCIe hosted bus up / down

Bringing PCIe hosted bus up requires operating on host-related core.
Since we plan to support PCIe Gen 2 devices we should provide a helper
picking the correct one (PCIE or PCIE2).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: respect reason when deleting (deauthenticating) STA
Rafał Miłecki [Sun, 8 Feb 2015 10:51:47 +0000 (11:51 +0100)]
brcmfmac: respect reason when deleting (deauthenticating) STA

Starting with kernel 3.19 reason is provided by cfg80211.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoiwlwifi: mvm: don't override passive dwell in case of fragmented scan
David Spinadel [Tue, 17 Feb 2015 10:45:21 +0000 (12:45 +0200)]
iwlwifi: mvm: don't override passive dwell in case of fragmented scan

Currently scan params structure has only active or passive dwell time
fields, passive one is used for fragmented scans too. FW needs the
passive dwell time even when performing fragmented scan for calculating
time between channels. Add a separate parameter for fragmented dwell time
and pass both fragmented and passive to FW.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add trigger for firmware dump upon low RSSI
Emmanuel Grumbach [Tue, 3 Feb 2015 12:29:36 +0000 (14:29 +0200)]
iwlwifi: mvm: add trigger for firmware dump upon low RSSI

Lots of issues can be caught when the RSSI drops. Add the
ability to collect the firmware data at that point.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add trigger for firmware dump upon statistics
Emmanuel Grumbach [Tue, 10 Feb 2015 13:26:57 +0000 (15:26 +0200)]
iwlwifi: mvm: add trigger for firmware dump upon statistics

It can be very useful to monitor the statistics and trigger
a firmware dump when a certain value hits a certain offset.
Since the statistics are huge, add a generic trigger. When
the DWORD at offset X reaches value Y.

Since there is another trigger before this one I can't add
right now because of a dependency on mac80211, add a
reserved entry to keep the enum in place.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: restart firmware recording when no configuration is set
Emmanuel Grumbach [Sun, 15 Feb 2015 15:16:16 +0000 (17:16 +0200)]
iwlwifi: mvm: restart firmware recording when no configuration is set

Sometimes the firmware will have a hard coded configuration.
In this case, the driver won't find any configuration
in the firmware file, and it will have to re-start
recording in case it has been stopped. This can't be done
by the configuration host command since there is no such
host command configured. Do that with the registers instead.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add trigger for firmware dump upon command response
Emmanuel Grumbach [Tue, 10 Feb 2015 08:49:20 +0000 (10:49 +0200)]
iwlwifi: mvm: add trigger for firmware dump upon command response

This will allow to collect the data as soon the firmware
sends a specific notification of command response.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add trigger for firmware dump upon channel switch
Emmanuel Grumbach [Tue, 10 Feb 2015 08:49:51 +0000 (10:49 +0200)]
iwlwifi: mvm: add trigger for firmware dump upon channel switch

We fire the trigger when the channel switch starts, but
the delay is configurable. That makes is easier to catch
channel switches that fail.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add trigger for firmware dump upon missed beacons
Emmanuel Grumbach [Mon, 2 Feb 2015 10:44:23 +0000 (12:44 +0200)]
iwlwifi: mvm: add trigger for firmware dump upon missed beacons

Missing beacons is a good indication that something is going
wrong in the firmware. Add a trigger to be able to collect
data when we start missing beacons with a configurable
threshold.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add the cause of the firmware dump in the dump
Emmanuel Grumbach [Thu, 29 Jan 2015 12:58:20 +0000 (14:58 +0200)]
iwlwifi: mvm: add the cause of the firmware dump in the dump

Now that the firmware dump can be triggered by events in
the code and not only the user or an firmware ASSERT, we
need a way to know why the firmware dump was triggered.
Add a section in the dump file for that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add framework for triggers for fw dump
Emmanuel Grumbach [Thu, 29 Jan 2015 12:58:06 +0000 (14:58 +0200)]
iwlwifi: mvm: add framework for triggers for fw dump

Most of the time, the issues we want to debug with the
firmware dump mechanism are transient. It is then very
hard to stop the recording on time and get meaningful
data.
In order to solve this, I add here an infrastucture
of triggers. The user will supply a list of triggers
that will start / stop the recording. We have two types
of triggers: start and stop. Start triggers can start a
specific configuration. The stop triggers will be able to
kick the collection of the data with the currently running
configuration. These triggers are given to the driver by
the .ucode file - just like the configuration.

In the next patches, I'll add triggers in the code.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: use only 40 ms for fragmented scan
David Spinadel [Sun, 15 Feb 2015 12:45:33 +0000 (14:45 +0200)]
iwlwifi: mvm: use only 40 ms for fragmented scan

20 ms fragments are no longer required by system.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: allow to force the Rx chains from debugfs
Emmanuel Grumbach [Sun, 8 Feb 2015 08:56:43 +0000 (10:56 +0200)]
iwlwifi: mvm: allow to force the Rx chains from debugfs

This is useful to debug weird antenna problems.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: add new TLV capability flag for BT PLCR
Emmanuel Grumbach [Thu, 12 Feb 2015 10:33:09 +0000 (12:33 +0200)]
iwlwifi: add new TLV capability flag for BT PLCR

Packet Level Co-Running is a BT Coex feature which is
supported on certain devices only, hence the need for
a TLV flag for it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: don't iterate interfaces to disconnect in net-detect
Luciano Coelho [Fri, 13 Feb 2015 19:37:09 +0000 (21:37 +0200)]
iwlwifi: mvm: don't iterate interfaces to disconnect in net-detect

We shouldn't call iwl_mvm_d3_disconnect_iter() on the running
interfaces when we are woken up due to net-detect, because it doesn't
make sense.  Additionally, this seems to set the
IEEE80211_SDATA_DISCONNECT_RESUME flag that will cause a disconnection
on the next resume (if a normal WoWLAN is used).

To solve this, skip the iteration loop when net-detect is set.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reported-by: Samuel Tan <samueltan@chromium.org>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: new Alive / error table API
Emmanuel Grumbach [Tue, 3 Feb 2015 18:11:48 +0000 (20:11 +0200)]
iwlwifi: mvm: new Alive / error table API

The new API slightly changes the layout of the version of
the firmware - prepare for that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: support beacon statistics for BSS client
Johannes Berg [Wed, 21 Jan 2015 20:41:29 +0000 (21:41 +0100)]
iwlwifi: mvm: support beacon statistics for BSS client

Report the average beacon signal and the number of received beacons as
measured by the firmware.

Since the firmware just counts, and doesn't reset the counter at all,
clear it in the firmware whenever we associate. However, accumulate it
over firmware restart.

Since clearing the statistics in the firmware will also clear the ones
for the radio statistics, add those to the accumulator when cleared.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: don't write to DBGC_OUT_CTRL when stopping the recording
Eran Harary [Tue, 10 Feb 2015 07:25:50 +0000 (09:25 +0200)]
iwlwifi: mvm: don't write to DBGC_OUT_CTRL when stopping the recording

Due to HW bug in the DBGC when driver want to stop the dbg recording it
should wait 100us before collecting the data instead of write 0 to
DBGC_OUT_CTRL.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: remove deprecated scan API code
Luciano Coelho [Tue, 10 Feb 2015 11:03:38 +0000 (13:03 +0200)]
iwlwifi: mvm: remove deprecated scan API code

The legacy scan API is deprecated and not used anymore with 10 and
higher firmware versions.  Since we deprecated firmware version 9, we
can remove a whole lot of unused code.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: deprecate -9.ucode for 3160 / 7260 / 7265
Luciano Coelho [Tue, 10 Feb 2015 11:54:08 +0000 (13:54 +0200)]
iwlwifi: deprecate -9.ucode for 3160 / 7260 / 7265

This firmware is not supported anymore.  Stop loading this firmware.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: support radio statistics as global survey
Johannes Berg [Wed, 14 Jan 2015 17:12:41 +0000 (18:12 +0100)]
iwlwifi: mvm: support radio statistics as global survey

Export the radio statistics from the statistics v10 API (if the
firmware also has the capability to fill these statistics) using
the global survey data facility.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add statistics API version 10
Johannes Berg [Wed, 14 Jan 2015 16:58:57 +0000 (17:58 +0100)]
iwlwifi: mvm: add statistics API version 10

New firmware versions will report statistics using a new version 10
of the API, instead of the current version 8. Add support for this.
This enables getting beacon and radio statistics.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: pcie: apply destination before releasing reset
Emmanuel Grumbach [Wed, 4 Feb 2015 14:35:03 +0000 (16:35 +0200)]
iwlwifi: pcie: apply destination before releasing reset

This allows to use the firmware debugging system even when
the configuration values are set hard coded in the firmware.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: remove unused function in BT coex
Eyal Shapira [Mon, 9 Feb 2015 13:18:49 +0000 (15:18 +0200)]
iwlwifi: mvm: remove unused function in BT coex

Cleanup unused code.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: fix BT coex shared antenna activity check
Eyal Shapira [Mon, 9 Feb 2015 13:18:17 +0000 (15:18 +0200)]
iwlwifi: mvm: fix BT coex shared antenna activity check

The shared antenna should be forbidden to use only if there's
high BT activity. Comparing to BT_OFF was effectively causing
us to always forbid using the shared antenna for SISO. This
leads to degraded performance in scenarios where the shared
antenna would have better performance.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: rs: print single stream params via debugfs
Eyal Shapira [Mon, 2 Feb 2015 10:46:22 +0000 (12:46 +0200)]
iwlwifi: mvm: rs: print single stream params via debugfs

Add this to the info printed when reading rate_scale_table.
Useful for debugging.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: rs: avoid ss_force from being reset after tx idle
Eyal Shapira [Mon, 2 Feb 2015 10:14:54 +0000 (12:14 +0200)]
iwlwifi: mvm: rs: avoid ss_force from being reset after tx idle

ss_force is a debugging option to force a certain single stream
tx mode. It's not useful if it gets reset after tx idle. Fix that.
While at it also make sure any code touching ss_force will only
get compiled if debugfs support is configured.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: increase the number of PAPD channel groups to 9
Eran Harary [Tue, 3 Feb 2015 13:53:29 +0000 (15:53 +0200)]
iwlwifi: mvm: increase the number of PAPD channel groups to 9

Newer devices have more PAPD channel groups.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: consider TDLS queues as used during drain
Arik Nemtsov [Wed, 21 Jan 2015 09:50:31 +0000 (11:50 +0200)]
iwlwifi: mvm: consider TDLS queues as used during drain

When a TDLS station is being drained its Tx queues are still in use. Don't
allocate them to a different station in the meantime.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: rs: disable MIMO for low latency P2P
Eyal Shapira [Sun, 1 Feb 2015 19:46:00 +0000 (21:46 +0200)]
iwlwifi: mvm: rs: disable MIMO for low latency P2P

Due to issues with Miracast adapters MIMO reception disable
use of MIMO when for low latency P2P traffic.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: rs: adapt rate matching to new STBC/BFER
Eyal Shapira [Thu, 29 Jan 2015 23:38:29 +0000 (01:38 +0200)]
iwlwifi: mvm: rs: adapt rate matching to new STBC/BFER

Once the FW supports autonomous decision between STBC/BFER/SISO
we no longer set the STBC bit and ANT_AB in the rate table.
However the FW rate in the tx response will have the STBC
or BFER bit set and the antennas set to ANT_AB in case these
were chosen by it. This will cause us to discard any such
response as unmatching the current LQ table and thus break
the rs search cycle completely.
Fix this by relaxing the rate matching in case we're working
with the new API and STBC/BFER are used.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: rs: fix BT Coex check to look at the correct ant
Eyal Shapira [Mon, 2 Feb 2015 13:21:27 +0000 (15:21 +0200)]
iwlwifi: mvm: rs: fix BT Coex check to look at the correct ant

The check to avoid the shared antenna was passed the wrong
antenna parameter. It should have checked whether the antenna of
the next column we're considering is allowed and instead it was
passed the current antenna.
This could lead to a wrong choice of the next column in the rs
algorithm and non optimal performance.

Fixes: commit 219fb66b49fac64bb ("iwlwifi: mvm: rs - don't use the shared antenna when BT load is high")
Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agowil6210: track privacy connection attribute
Vladimir Kondratiev [Sun, 15 Feb 2015 12:02:37 +0000 (14:02 +0200)]
wil6210: track privacy connection attribute

For the STA interface, track 'privacy'.
Refactor safety checks to:
- always print connection params
- always check IE size validity
- require RSN IE for secure connection

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: rename 'secure_pcp' to 'privacy'
Vladimir Kondratiev [Sun, 15 Feb 2015 12:02:36 +0000 (14:02 +0200)]
wil6210: rename 'secure_pcp' to 'privacy'

Make this field to track privacy attribute for all interface types

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: Fix division by zero in wil_vring_debugfs_show
Boris Sorochkin [Sun, 15 Feb 2015 12:02:35 +0000 (14:02 +0200)]
wil6210: Fix division by zero in wil_vring_debugfs_show

On some platforms get_cycles() implemented to allways return 0.
On such platforms "Division by zero" bug was triggered.

Signed-off-by: Boris Sorochkin <boriss@codeaurora.org>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: Change of threshold for tx vring idleness measurement
Vladimir Shulman [Sun, 15 Feb 2015 12:02:34 +0000 (14:02 +0200)]
wil6210: Change of threshold for tx vring idleness measurement

Change threshold to be variable debugfs entry from hard-coded 0.
Default threshold value is 16 descriptors because HW is capable
of fetching up to 16 descriptors at once.

Signed-off-by: Vladimir Shulman <qca_shulmanv@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: branch prediction hints
Vladimir Kondratiev [Sun, 15 Feb 2015 12:02:33 +0000 (14:02 +0200)]
wil6210: branch prediction hints

Mark expected branches using likely()/unlikely().
Do it on high performance route - data path and interrupts

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: enable fix for HW bug in 802.11->803.3 transform
Vladimir Kondratiev [Sun, 15 Feb 2015 12:02:32 +0000 (14:02 +0200)]
wil6210: enable fix for HW bug in 802.11->803.3 transform

In the old hardware, bug existed that caused DA and SA for every
Rx packet to be swapped in the AP mode.
New hardware has fix for this bug. Enable this fix in the
hardware.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: remove support for old hardware
Vladimir Kondratiev [Sun, 15 Feb 2015 12:02:31 +0000 (14:02 +0200)]
wil6210: remove support for old hardware

Hardware older than Sparrow B0 obsolete.
There is no WiFi product that uses this hardware.
Recent firmware does not support it either.

Remove driver support.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: boot loader
Vladimir Kondratiev [Sun, 15 Feb 2015 12:02:30 +0000 (14:02 +0200)]
wil6210: boot loader

Introduce boot loader. Instead of the operational firmware,
very small boot loader is burned to the on-board flash. Boot loader
initializes hardware upon reset, and prepares for low power mode.
Boot loader reports MAC address and detects radio chip connected.

Driver loads firmware only when bringing up interface. All information
required to set up network interface, most important is MAC address,
reported by the boot loader

The firmware composed of 2 files:
- wil6210.fw - firmware itself (compiled code + data)
- wil6210.board - board file (various board and radio dependent
  calibrations and parameters)

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: fix usb tx data payload offset issue
Zhaoyang Liu [Fri, 13 Feb 2015 15:08:16 +0000 (20:38 +0530)]
mwifiex: fix usb tx data payload offset issue

Commit 84b313b35f8158d7 ("mwifiex: make tx packet 64 byte DMA aligned")
induced payload offset issue for USB interface.

There is no USB interface header for tx packets, so there's no need to
pull interface length while processing tx skb.

This patch fixes this issue.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: DMA alignment for RX packets
Avinash Patil [Fri, 13 Feb 2015 12:11:08 +0000 (17:41 +0530)]
mwifiex: DMA alignment for RX packets

This patch adds support for DMA alignment of sk_buffs
allocated for RX.
Patch also adds support to modify skb allocation flags.

Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: modify TX buff size for SD8887
Avinash Patil [Wed, 11 Feb 2015 17:42:27 +0000 (23:12 +0530)]
mwifiex: modify TX buff size for SD8887

FW crash has been observed while running iperf TX with SD8887
devices. This is because of invalid TX buffer setting. SD8887
supports 2K buffer sizes. This patch fixes this issue.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: change datatype to bool for device capability flags
Avinash Patil [Wed, 11 Feb 2015 17:42:26 +0000 (23:12 +0530)]
mwifiex: change datatype to bool for device capability flags

This patch changes datatypes for device capability flags to bool.
Patch also aggregates these variables at single place.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: do not process mgmt rx on uninitialized interface
Avinash Patil [Wed, 11 Feb 2015 17:42:25 +0000 (23:12 +0530)]
mwifiex: do not process mgmt rx on uninitialized interface

This patch fixes a crash which was happening because of RX of
management frames on uninitialzed interface. Now we drop management
frames for interfaces where cfg80211 has not registered any management
subtype reception or interface has no NL80211 iftype set.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: more_task flag for main_process
Shengzhen Li [Wed, 11 Feb 2015 17:42:24 +0000 (23:12 +0530)]
mwifiex: more_task flag for main_process

This patch handles a corner case where TX packet would remain in
driver queue till next packet comes in.
Here is sequence:
1. TX packet is queued via hard_start_xmit and main_work is queued
2. SDIO interrupt comes in which directly call mwifiex_main_process.
This starts executing main superloop.
3. Now work from step1 is scheduled but at first check itself it sees
mwifiex_processing is set and exits.
4. Now if superloop from step2 has passed TX processing part of superloop
this packet would remain in queue until next packet/command/SDIO interrupt
arrives and queues main_work.

This patch fixes this corner case by defining more_task flag which is set when
mwifiex_processing is found to be true. At end of superloop we again check if
more_task flag is set and if set, execute superloop again.

Signed-off-by: Shengzhen Li <szli@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agolibertas: remove unnecessary check before calling debugfs_remove
Bas Peters [Wed, 11 Feb 2015 08:33:06 +0000 (09:33 +0100)]
libertas: remove unnecessary check before calling debugfs_remove

Debugfs_remove will check for error or NULL for us, so it is not
necessary to do this here.

Signed-off-by: Bas Peters <baspeters93@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: Modify some USB de-initialize code.
Taehee Yoo [Tue, 10 Feb 2015 16:40:30 +0000 (01:40 +0900)]
rtlwifi: Modify some USB de-initialize code.

Delete SET_USB_STOP macro and rtl_usb_deinit because
those are called twice in USB de-initialize routine.
Add some de-initialize workqueue function in USB disconnect routine.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k_htc: Add new USB ID
Leon Nardella [Sat, 7 Feb 2015 19:10:07 +0000 (17:10 -0200)]
ath9k_htc: Add new USB ID

This device is a dongle made by Philips to enhance their TVs with wireless capabilities,
but works flawlessly on any upstream kernel, provided that the ath9k_htc module is attached to it.
It's correctly recognized by lsusb as "0471:209e Philips (or NXP) PTA01 Wireless Adapter" and the
patch has been tested on real hardware.

Signed-off-by: Leon Nardella <leon.nardella@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: Clear ACM_CTRL AC3_VO bit correctly
Jes Sorensen [Fri, 6 Feb 2015 22:24:32 +0000 (17:24 -0500)]
rtlwifi: Clear ACM_CTRL AC3_VO bit correctly

All hw driver components in the rtlwifi driver, except for the
rtl8192de component has this bug. They would clear BE bit in the
ACM_CTRL register instead of the VO bit when processing the VO queue.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: Fix escan timer causing oops.
Hante Meuleman [Fri, 6 Feb 2015 17:36:47 +0000 (18:36 +0100)]
brcmfmac: Fix escan timer causing oops.

In some rare circumstances the escan protection timer can expire
before the setup completed (due to long timeouts on IOCTL). This
patch avoids this situation by setting the timer after the setup
completed correctly.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: Dont sleep when ctrl frames to transmit.
Hante Meuleman [Fri, 6 Feb 2015 17:36:46 +0000 (18:36 +0100)]
brcmfmac: Dont sleep when ctrl frames to transmit.

The SDIO watchdog will put the device in sleep mode when there is
no activity for some time and nothing to do anymore. This check
is incomplete and should also check if there is a control frame
to transmit.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: make sdio suspend wait for threads to freeze
Arend van Spriel [Fri, 6 Feb 2015 17:36:45 +0000 (18:36 +0100)]
brcmfmac: make sdio suspend wait for threads to freeze

Borrowed the idea of the PM freezer to make sdio suspend wait for
watchdog and DPC thread to freeze at a safe point in their thread
routine. The suspend takes 20-25 msec.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
9 years agobrcmfmac: add debugfs file containing revision info
Arend van Spriel [Fri, 6 Feb 2015 17:36:44 +0000 (18:36 +0100)]
brcmfmac: add debugfs file containing revision info

Make the revision info visible in debugfs. The new debugfs
file is named 'revinfo'.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
9 years agobrcmfmac: Remove error print for invalid key index.
Hante Meuleman [Fri, 6 Feb 2015 17:36:43 +0000 (18:36 +0100)]
brcmfmac: Remove error print for invalid key index.

When a key is set or cleared with an unsupported key index then
brcmfmac will print an error. With most wpa_supplicants this is
happening a lot. The error print is confusing and not needed.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: use helper function for changing SDIO state
Arend van Spriel [Fri, 6 Feb 2015 17:36:42 +0000 (18:36 +0100)]
brcmfmac: use helper function for changing SDIO state

Changing the SDIO state of the driver involves changing the bus
interface state. Adding a helper function makes sure that knowledge
is in one place.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
9 years agomwifiex: use alloc_workqueue's format strings capabilities for WQ names
Avinash Patil [Fri, 6 Feb 2015 14:28:05 +0000 (19:58 +0530)]
mwifiex: use alloc_workqueue's format strings capabilities for WQ names

alloc_workqueue() has string format formation ability e.g. wqname%ifname
will be treated as wqnameifname. Use this and remove string operations
while defining strings for workqueue names.

Reported-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcm80211: drop unreachable else case
Nicholas Mc Guire [Fri, 6 Feb 2015 13:26:50 +0000 (08:26 -0500)]
brcm80211: drop unreachable else case

the if/elseif/else is exhaustive - there is no 4th case given the
  rssi_ctrl_mask = RADIO_2055_NBRSSI_SEL | RADIO_2055_WBRSSI_G1_SEL |
  RADIO_2055_WBRSSI_G2_SEL;
so this unreachable else case (dead code) can be dropped.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: use msecs_to_jiffies for time conversion
Nicholas Mc Guire [Fri, 6 Feb 2015 10:26:45 +0000 (05:26 -0500)]
brcmfmac: use msecs_to_jiffies for time conversion

This is only an API consolidation and should make things more readable
it replaces var * HZ / 1000 by msecs_to_jiffies(var).

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Restart TSF2 timers on wakeup
Sujith Manoharan [Thu, 5 Feb 2015 04:52:44 +0000 (10:22 +0530)]
ath9k: Restart TSF2 timers on wakeup

When coming out of WoW sleep, check and restart
timers based on TSF2.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Clear additional WoW events
Sujith Manoharan [Thu, 5 Feb 2015 04:52:43 +0000 (10:22 +0530)]
ath9k: Clear additional WoW events

The events for patterns 8..15 need to be
cleared on wakeup.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Handle additional patterns on wakeup
Sujith Manoharan [Thu, 5 Feb 2015 04:52:42 +0000 (10:22 +0530)]
ath9k: Handle additional patterns on wakeup

Handle the user-configured patterns in the range 8..15
when waking up and update wow_status correctly.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Check MCI PowerSave state
Sujith Manoharan [Thu, 5 Feb 2015 04:52:41 +0000 (10:22 +0530)]
ath9k: Check MCI PowerSave state

The power save state of MCI has to be disabled
when enabling WoW sleep, check this properly.
ar9003_mci_state() doesn't handle MCI_STATE_GET_WLAN_PS_STATE
right now, but this will be done later when proper
support for MCI/PS is added.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add new MCI states
Sujith Manoharan [Thu, 5 Feb 2015 04:52:40 +0000 (10:22 +0530)]
ath9k: Add new MCI states

Several new MCI states have to handled,
add them to the list.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Set keep awake timer
Sujith Manoharan [Thu, 5 Feb 2015 04:52:39 +0000 (10:22 +0530)]
ath9k: Set keep awake timer

When MCI is enabled and WoW sleep is enabled,
make sure that the RTC keep awake timer is set
with the required value. This is also required
when the AR_WA is programmed.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix descriptors for keep-alive frame
Sujith Manoharan [Thu, 5 Feb 2015 04:52:38 +0000 (10:22 +0530)]
ath9k: Fix descriptors for keep-alive frame

Along with AR9462, AR9565 also has an extra field
in the TX descriptor which needs to be zeroed out
for the keep alive frame. This makes the earlier
REG_WRITE redundant, so it can be removed.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Wed, 25 Feb 2015 23:13:07 +0000 (18:13 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2015-02-24

This series contains updates to i40e and i40evf only, which bumps their
versions to i40e 1.2.9 and i40evf 1.2.3.

Paul fixes i40e_debug_aq() for big endian machines by adding the
appropriate LExx_TO_CPU wrappers.

Catherine adds a requested speed variable to the link_status to store the
last speeds we requested from the firmware and use the advertised speed
settings in get_settings in ethtool now that we have it.  Due to the
new code addition, she also refactors get_settings to improve readability
and to accommodate some of the longer lines of code by adding two
functions i40e_get_settings_link_up() and i40e_get_settings_link_down().

Carolyn adds a struct to the VSI struct to keep track of RXNFC settings
done via ethtool.  Adds more information to the interrupt vector
names, specifically to the VF misc vector name so that we can distinguish
between all the interrupts.

Ashish enables the i40evf driver to enable debug prints via ethtool.

Mitch updates i40e to enable packet split only when IOMMU is in use,
since it shows a distinct advantage over the single-buffer path
because it minimizes DMA mapping and unmapping.  Also adds the receive
routine in use to the features log message to be able to print the
receive packet split status.

Greg adds the ability to get, set and commit permanently the NPAR
partition BW configuration through configfs.  Enables an application
to query the i40e driver's private flags to get the status of NPAR
enablement via ethtool.

Neerav adds support for bridge offload ndo_ops getlink and setlink
to enable bridge hardware mode as per the mode set via IFLA_BRIDGE_MODE.
The support is only enabled in the case of a PF VSI and not available for
any other VSI type.

Kevin fixes i40e by ensuring the BUF and FLAG_RD flags are set for
indirect admin queue command.

Vasu updates the driver to setup FCoE netdev device type as "fcoe", so that
it shows up in sysfs as FCoE device.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: dsa: Introduce dsa_is_port_initialized
Guenter Roeck [Wed, 25 Feb 2015 07:02:02 +0000 (23:02 -0800)]
net: dsa: Introduce dsa_is_port_initialized

To avoid race conditions when using the ds->ports[] array,
we need to check if the accessed port has been initialized.
Introduce and use helper function dsa_is_port_initialized
for that purpose and use it where needed.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'sf2_hwbridge'
David S. Miller [Wed, 25 Feb 2015 22:04:15 +0000 (17:04 -0500)]
Merge branch 'sf2_hwbridge'

Florian Fainelli says:

====================
net: dsa: integration with SWITCHDEV for HW bridging

This patch set provides the DSA and SWITCHDEV integration bits together and
modifies the bcm_sf2 driver accordingly such that it works properly with HW
bridging.

Changes in v3:

- add back the null pointer check in dsa_slave_br_port_mask from Guenter
- slightly rework patch 1 commit message not to mention the function name
  we add in patch 2

Changes in v2:

- avoid a race condition in how DSA network devices are created, patch from
  Guenter Roeck
- provide a consistent and work STP state once a port leaves the bridge
- retain a bridge device pointer to properly flag port/bridge membership
- properly flush the ARL (Address Resolution Logic) in bcm_sf2.c
- properly retain port membership when individually bringing devices up/down
  while they are members of a bridge

We discussed on the mailing-list the possibility of standardizing a "fdb_flush"
operation for DSA switch drivers, looking at the Marvell and Broadcom switches,
I am not convinced this is practical or diserable as the terminologies vary
here, but there is nothing preventing us from doing it later.

Many thanks to Guenter and Andrew for both testing and providing feedback.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: dsa: bcm_sf2: add HW bridging support
Florian Fainelli [Tue, 24 Feb 2015 21:15:34 +0000 (13:15 -0800)]
net: dsa: bcm_sf2: add HW bridging support

Implement the bridge join, leave and set_stp callbacks by making that
we do the following:

- when a port joins the bridge, all existing ports in the bridge get
  their VLAN control register updated with that joining port
- the joining port is including all existing bridge ports in its own
  VLAN control register

The leave operation is fairly similar, special care must be taken to
make sure that port leaving the bridging is not removing itself from its
own VLAN control register.

Since the various BR_* states apply directly to our HW semantics, we
just need to translate these constants into their corresponding HW
settings, and voila!

We make sure to trigger a fast-ageing process for ports that are
joining/leaving the bridge and transition from incompatible states, this
is equivalent to triggering an ARL flush for that port.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: dsa: integrate with SWITCHDEV for HW bridging
Florian Fainelli [Tue, 24 Feb 2015 21:15:33 +0000 (13:15 -0800)]
net: dsa: integrate with SWITCHDEV for HW bridging

In order to support bridging offloads in DSA switch drivers, select
NET_SWITCHDEV to get access to the port_stp_update and parent_get_id
NDOs that we are required to implement.

To facilitate the integratation at the DSA driver level, we implement 3
types of operations:

- port_join_bridge
- port_leave_bridge
- port_stp_update

DSA will resolve which switch ports that are currently bridge port
members as some Switch hardware/drivers need to know about that to limit
the register programming to just the relevant registers (especially for
slow MDIO buses).

We also take care of setting the correct STP state when slave network
devices are brought up/down while being bridge members.

Finally, when a port is leaving the bridge, we make sure we set in
BR_STATE_FORWARDING state, otherwise the bridge layer would leave it
disabled as a result of having left the bridge.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: dsa: Ensure that port array elements are initialized before being used
Guenter Roeck [Tue, 24 Feb 2015 21:15:32 +0000 (13:15 -0800)]
net: dsa: Ensure that port array elements are initialized before being used

A network device notifier can be called for one or more of the created
slave devices before all slave devices have been registered. This can
result in a mismatch between ds->phys_port_mask and the registered devices
by the time the call is made, and it can result in a slave device being
added to a bridge before its entry in ds->ports[] has been initialized.

Rework the initialization code to initialize entries in ds->ports[] in
dsa_slave_create. With this change, dsa_slave_create no longer needs
to return slave_dev but can return an error code instead.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoi40e/i40evf: Update driver versions
Sravanthi Tangeda [Fri, 6 Feb 2015 08:52:21 +0000 (08:52 +0000)]
i40e/i40evf: Update driver versions

Bump i40e to 1.2.9 and i40evf 1.2.3

Also update the copyright year.

Change-ID: I345d777e94abd0acffe6a28793f675d251a86299
Signed-off-by: Sravanthi Tangeda <sravanthi.tangeda@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40evf: Add more info to interrupt vector names
Carolyn Wyborny [Fri, 6 Feb 2015 08:52:20 +0000 (08:52 +0000)]
i40evf: Add more info to interrupt vector names

This patch adds the netdev name to the VF misc vector name.  Without
this patch, all the interrupts show the same info, so it difficult to
distinguish them.

Change-ID: I247828697e1373ecfb5f8dc1bc9618e98a7f4942
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: Use ethtool private flags to display NPAR status
Greg Rose [Fri, 6 Feb 2015 08:52:19 +0000 (08:52 +0000)]
i40e: Use ethtool private flags to display NPAR status

Allow an application to query the i40e driver's private flags to get the
status of NPAR enablement.  This will be used by applications to determine
if there are NPAR specific features available.

Change-ID: Ia6d9477a48f9c4cb41ca022bd433f77da3f2146c
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: Set FLAG_RD when sending buffer FW must read
Kevin Scott [Fri, 6 Feb 2015 08:52:18 +0000 (08:52 +0000)]
i40e: Set FLAG_RD when sending buffer FW must read

Set FLAG_RD for send_driver_version AQ command.

Change-ID: I8253051eff85a1d4b5a4e12ce0395b65ceb91e62
Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: print Rx packet split status
Mitch Williams [Fri, 6 Feb 2015 08:52:17 +0000 (08:52 +0000)]
i40e: print Rx packet split status

Add the RX routine in use to the features log message.

Change-ID: Ifbbf28fb7f42b9a3d2828586488e9e6331107dd5
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: setup FCoE device type
Vasu Dev [Mon, 9 Feb 2015 18:00:30 +0000 (18:00 +0000)]
i40e: setup FCoE device type

Setup FCoE netdev device type as "fcoe", so that it shows up in
sysfs as FCoE device.

Change-ID: Ie13a1a332dba4d5802586926104ee01ef20da44f
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: Set BUF flag for Set Version AQ command
Kevin Scott [Fri, 6 Feb 2015 08:52:15 +0000 (08:52 +0000)]
i40e: Set BUF flag for Set Version AQ command

BUF flag must be set for indirect AQ command.

Change-ID: I6819718a47baf69d1a91ebaed89f735ed6e86025
Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: Add support for getlink, setlink ndo ops
Neerav Parikh [Fri, 6 Feb 2015 08:52:14 +0000 (08:52 +0000)]
i40e: Add support for getlink, setlink ndo ops

Add support for bridge offload ndo_ops getlink and setlink to
enable bridge hardware mode as per the mode set via IFLA_BRIDGE_MODE.
The support is only enabled in case of a PF VSI and not available for
any other VSI type.

By default the i40e driver inserts a bridge as part of the bring-up
when a FDIR type VSI and/or a FCoE VSI is created. This bridge is
created in VEB mode by default i.e. after creating the bridge using
"Add VEB" AQ command the loopback for the PF's default VSI is enabled.

The patch adds capability where all the VSIs created as downlink to
the bridge inherits the loopback property and enables loopback only
if the uplink bridge is operating in VEB mode.
Hence, there is no need to explicitly enable loopback as part of
allocating resources for SR-IOV VFs and call to do that has been
removed.

In case a user-request is made either via "bridge" utility or using
the bridge netlink interface that requires to change the hardware
bridge mode then that would require a PF reset and rebuild of the
switch hierarchy.

Also update the copyright year.

Change-ID: I4d78fc1c83158efda29ba7be92239b74f75d6d25
Signed-off-by: Neerav Parikh <neerav.parikh@intel.com>
Tested-By: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: Implement configfs for NPAR BW configuration
Greg Rose [Fri, 6 Feb 2015 08:52:13 +0000 (08:52 +0000)]
i40e: Implement configfs for NPAR BW configuration

Add configfs controls to get, set and commit NPAR BW configurations.

We export three controls:
min_bw - Can take a value from 0 to 100 inclusive
max_bw - Can take a value from 1 to 100 inclusive
commit - A write-only control that accepts only a value of 1 and will
cause the BW settings to be permanently committed to NVM so
that they are persistent across power cycles and system
resets

The BW values are relative and are expressed as percentages.  For more
information on the interpretation of the BW settings see the Dell
specifications for NPAR.

Also update the copyright year.

Change-ID: Id7496ca65630b5037e32ba6a5a748fbc1632881b
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-By: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: Add NPAR BW get and set functions
Greg Rose [Fri, 6 Feb 2015 08:52:12 +0000 (08:52 +0000)]
i40e: Add NPAR BW get and set functions

We need to be able to get, set and commit permanently the NPAR
partition BW configuration through configfs.  These are necessary
precursor functions for that feature.

Also update the copyright year.

Change-ID: I9d5ca160a9288145f1dd2042994028679fff55f3
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: enable packet split only when IOMMU present
Mitch Williams [Fri, 6 Feb 2015 08:52:11 +0000 (08:52 +0000)]
i40e: enable packet split only when IOMMU present

When an IOMMU is in use, the packet split receive path shows a distinct
advantage over the single-buffer path because it minimizes DMA mapping
and unmapping. However, this is not an advantage for systems with no
IOMMU. At init time, check to see if an IOMMU is enabled and enable
packet split receives.

Change-ID: I4f70d2e9c31bbea3dc8fd0c5734959a6e6602210
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40evf: allow enabling of debug prints via ethtool
Ashish Shah [Fri, 6 Feb 2015 08:52:10 +0000 (08:52 +0000)]
i40evf: allow enabling of debug prints via ethtool

Copy setting from ethtool to the HW specific struct to actually
enable prints.  Change print from i40e to i40evf to differentiate
drivers in bare metal scenarios.

Also update the copyright year.

Change-ID: I06fee26247299a08f2e1c70fc811a9ea0931c4dd
Signed-off-by: Ashish Shah <ashish.n.shah@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: Add method to keep track of current rxnfc settings
Carolyn Wyborny [Fri, 6 Feb 2015 08:52:09 +0000 (08:52 +0000)]
i40e: Add method to keep track of current rxnfc settings

This patch adds a struct to the VSI struct to keep track of rxnfc
settings done via ethtool.  Without this patch, the device can only
list the options available, not the current settings and this is not
clear to the user.  Without current settings, the available settings
never changing looks like a bug.

Also update the copyright year.

Change-ID: I087bbfdb33b330496a671630a7586773e3b3e589
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: Use advertised speed settings in ethtool and refactor get_settings
Catherine Sullivan [Fri, 6 Feb 2015 08:52:08 +0000 (08:52 +0000)]
i40e/i40evf: Use advertised speed settings in ethtool and refactor get_settings

Add a requested speed variable to the link_status struct to store the
last speeds we requested from the firmware (the speeds the FW will be
advertising with if autoneg is enabled).

Use the advertised speed settings in get_settings in ethtool now that
we have it.  Also set the requested speed settings in set_settings in
ethtool as they are requested and initialize them in probe based on what
the firmware remembers as the last requested speeds.

To accommodate some longer lines in this new code, and improve
readability I have added two functions i40e_get_settings_link_up
and i40e_get_settings_link_down which get_settings now calls first.
It then does all of the settings that happen regardless of link
state. Some PHY types that supported the same settings were also combined.

Also update the copyright year.

Change-ID: Ica0c5ac81b6069ea6a7406fce7482f7816d4455c
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: Fix output of i40e_debug_aq() for big endian machines
Paul M Stillwell Jr [Fri, 6 Feb 2015 08:52:07 +0000 (08:52 +0000)]
i40e/i40evf: Fix output of i40e_debug_aq() for big endian machines

The function i40e_debug_aq() prints information helpful in debugging
admin queue commands, but it doesn't do so correctly on big endian machines.
This patch adds the appropriate LExx_TO_CPU wrappers for big endian
architectures.

Also update the copyright year.

Change-ID: I4b2dc229ed5bf6dfe35632a58cddf53c21aff4b0
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agonet: via-rhine: add BQL support
Tino Reichardt [Tue, 24 Feb 2015 18:28:01 +0000 (10:28 -0800)]
net: via-rhine: add BQL support

Add Byte Queue Limits (BQL) support to via-rhine driver.

[edumazet] tweaked patch and changed TX_RING_SIZE from 16 to 64

Signed-off-by: Tino Reichardt <milky-kernel@mcmilk.de>
Tested-by: Jamie Gloudon <jamie.gloudon@gmail.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoipv6: remove dead debug code from ip6_tunnel.c
Ian Morris [Tue, 24 Feb 2015 12:01:25 +0000 (12:01 +0000)]
ipv6: remove dead debug code from ip6_tunnel.c

The IP6_TNL_TRACE macro is no longer used anywhere in the code so remove definition.

Signed-off-by: Ian Morris <ipm@chirality.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>