openwrt/staging/blogic.git
5 years agoiwlwifi: mvm: look for the first supported channel when add/remove phy ctxt
Tova Mussai [Thu, 4 Jul 2019 11:34:54 +0000 (14:34 +0300)]
iwlwifi: mvm: look for the first supported channel when add/remove phy ctxt

Can't rely that band 2.4 is always supported by the NIC and use the
first channel in this band for the phy ctxt.
Instead, look for the first channel in the first band that is supported

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: allocate bigger nvm data in case of UHB
Tova Mussai [Thu, 4 Jul 2019 10:41:01 +0000 (13:41 +0300)]
iwlwifi: allocate bigger nvm data in case of UHB

In case of Ultra-high-band (UHB), need to allocate nvm data structure in
size of UHB channels array.

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: remove unnecessary IWL_DEVICE_AX200_COMMON definition
Luca Coelho [Wed, 10 Jul 2019 12:00:18 +0000 (15:00 +0300)]
iwlwifi: remove unnecessary IWL_DEVICE_AX200_COMMON definition

Remove the IWL_DEVICE_AX200_COMMON definition, since it's only used
once and relies mostly on IWL_DEVICE_22000_COMMON anyway.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg: align wrt log prints to the same format
Shahar S Matityahu [Mon, 27 May 2019 12:12:52 +0000 (15:12 +0300)]
iwlwifi: dbg: align wrt log prints to the same format

Align wrt log prints to the driver coding style
Remove the ext field from the log and print it at the beginning of the
apply point.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: remove debug flow TLV
Shahar S Matityahu [Sun, 30 Jun 2019 13:36:36 +0000 (16:36 +0300)]
iwlwifi: dbg_ini: remove debug flow TLV

Debug flow TLV was removed from the FW. Remove the TLV from the driver
as well.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: verify debug TLVs at allocation phase
Shahar S Matityahu [Sun, 30 Jun 2019 07:23:26 +0000 (10:23 +0300)]
iwlwifi: dbg_ini: verify debug TLVs at allocation phase

Reimplement debug TLV allocation flow. The driver will check the
validity of the debug TLVs prior allocating space for them.
Any malformed or unsupported TLV will be skipped.
The TLV specific checks will be added in later patches.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: use function to check if ini dbg mode is on
Shahar S Matityahu [Sun, 30 Jun 2019 06:31:22 +0000 (09:31 +0300)]
iwlwifi: dbg_ini: use function to check if ini dbg mode is on

use iwl_trans_dbg_ini_valid function instead of a boolean value check if
dbg_ini mode is on. It is needed for a future patch.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: remove duplicate FW string definitions
Luca Coelho [Mon, 8 Jul 2019 09:20:01 +0000 (12:20 +0300)]
iwlwifi: remove duplicate FW string definitions

The string we define as IWL_22000_HR_B_F0_FW_PRE is duplicate with
IWL_22000_QU_B_HR_B_FW_PRE.  Remove the former to avoid confusion.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: bump FW API to 50 for 22000 series
Luca Coelho [Wed, 10 Apr 2019 06:23:39 +0000 (09:23 +0300)]
iwlwifi: bump FW API to 50 for 22000 series

Start supporting API version 50 for 22000 series.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: api: fix FTM struct documentation
Johannes Berg [Fri, 5 Jul 2019 11:53:30 +0000 (13:53 +0200)]
iwlwifi: api: fix FTM struct documentation

The real name is struct iwl_tof_range_req_ext_cmd, fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: support per-platform antenna gain
Gil Adam [Sun, 16 Jun 2019 10:18:28 +0000 (13:18 +0300)]
iwlwifi: support per-platform antenna gain

TX power limits as defined in the OTP assume the worst case scenario
in terms of the platform's atenna gain, but most platforms are below
that value so they can use more TX power without passing the regulatory
limit. If the platform indicates in the BIOS that it indeed has lower
gain, and the geographic location allows it, higher TX power can be
used. The driver reads the PPAG (Per-Platform Antenna Gain) data from
BIOS (if it exists), validates it and sends the appropriate command to
the FW. This flow happens once at FW init, in case of suspend/resume
there is no need to read again from BIOS as we save those values during
init, so just send the PPAG command again to FW.

Signed-off-by: Gil Adam <gil.adam@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: remove check for lq_sta in __iwl_mvm_rs_tx_status()
Luca Coelho [Tue, 2 Jul 2019 12:18:47 +0000 (15:18 +0300)]
iwlwifi: mvm: remove check for lq_sta in __iwl_mvm_rs_tx_status()

The check is not necessary anymore, because now the struct is not
allocated separately, but is part of the mvmsta struct.  Remove the
check, since it's dead code.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: simplify the channel switch flow for newer firmware
Emmanuel Grumbach [Sun, 30 Jun 2019 12:40:19 +0000 (15:40 +0300)]
iwlwifi: mvm: simplify the channel switch flow for newer firmware

Any firmware that supports the new channel switch flow is
able to close / re-open the queues when needed. It takes
into account the channel switch mode etc...
Don't open / close the queues or enable / disable beacon
abort before and after the channel switch in case the
firmware is able to do this by itself.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: stop passing bogus gfp flags arguments to dma_alloc_coherent
Christoph Hellwig [Fri, 14 Jun 2019 13:47:20 +0000 (15:47 +0200)]
iwlwifi: stop passing bogus gfp flags arguments to dma_alloc_coherent

dma_alloc_coherent is not just the page allocator.  The only valid
arguments to pass are either GFP_ATOMIC or GFP_ATOMIC with possible
modifiers of __GFP_NORETRY or __GFP_NOWARN.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: remove periphery phy and aux regions handling
Shahar S Matityahu [Tue, 18 Jun 2019 05:31:58 +0000 (08:31 +0300)]
iwlwifi: dbg_ini: remove periphery phy and aux regions handling

periphery phy and aux regions should not be collected like periphery mac
region. Remove their handling. The handling will be added in the future
once the FW will support it.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Fixes: 7a14c23dcdee ("iwlwifi: dbg: dump data according to the new ini TLVs")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: use linked list to store debug TLVs
Shahar S Matityahu [Mon, 10 Jun 2019 13:14:20 +0000 (16:14 +0300)]
iwlwifi: dbg_ini: use linked list to store debug TLVs

Use a linked list to maintain the debug TLVs instead of a single buffer.
This way, the driver does not need to iterate over the binary file twice
and allocates smaller chunks of memory. Also, in case one allocation
fails the driver will work with the partial configuration instead of
aborting the entire debug configuration.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: maintain buffer allocations from trans instead of TLVs buffer
Shahar S Matityahu [Thu, 13 Jun 2019 05:29:55 +0000 (08:29 +0300)]
iwlwifi: dbg_ini: maintain buffer allocations from trans instead of TLVs buffer

Maintain DRAM debug buffer status in trans instead of keeping it as
part of the TLVs buffer to avoid allocating extra space for it.
Needed for future changes.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg: add debug periphery registers to 9000 device family
Shahar S Matityahu [Mon, 24 Jun 2019 07:37:05 +0000 (10:37 +0300)]
iwlwifi: dbg: add debug periphery registers to 9000 device family

Add debug HW periphery registers to 9000 device family.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: remove unused regdb_ptrs allocation
Haim Dreyfuss [Thu, 13 Jun 2019 10:10:50 +0000 (13:10 +0300)]
iwlwifi: remove unused regdb_ptrs allocation

regdb_ptrs is not in used anymore, remove it.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg_ini: align dbg tlv functions names to a single format
Shahar S Matityahu [Thu, 13 Jun 2019 12:01:07 +0000 (15:01 +0300)]
iwlwifi: dbg_ini: align dbg tlv functions names to a single format

align the naming to iwl_dbg_tlv_*

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: scan: don't pass large argument by value
Ayala Beker [Mon, 17 Jun 2019 17:15:55 +0000 (20:15 +0300)]
iwlwifi: scan: don't pass large argument by value

Function iwl_mvm_scan_set_legacy_probe_req() second argument
size is too large to be passed by value.
Fix it to be passed by reference.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: remove pm_runtime completely
Emmanuel Grumbach [Thu, 6 Jun 2019 11:56:14 +0000 (14:56 +0300)]
iwlwifi: remove pm_runtime completely

This means:
1) stop calling pm_runtime_resume when starting the hardware
2) removing the unneeded low_power parameter to start / stop hw / fw
   transport ops
3) squashing transport functions that are now the same
   _iwl_trans_pcie_start_hw / iwl_trans_pcie_start_hw

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: remove the d0i3 related module parameters
Emmanuel Grumbach [Thu, 6 Jun 2019 11:24:45 +0000 (14:24 +0300)]
iwlwifi: remove the d0i3 related module parameters

Those are now effectless.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: pcie: remove some more d0i3 code from the transport
Emmanuel Grumbach [Thu, 6 Jun 2019 09:07:30 +0000 (12:07 +0300)]
iwlwifi: pcie: remove some more d0i3 code from the transport

CMD_SEND_IN_IDLE, CMD_MAKE_TRANS_IDLE and CMD_WAKE_UP_TRANS
are not used. Remove them.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: pcie: remove the refs / unrefs from the transport
Emmanuel Grumbach [Thu, 6 Jun 2019 08:44:26 +0000 (11:44 +0300)]
iwlwifi: pcie: remove the refs / unrefs from the transport

This code is now stale

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: remove the opmode's d0i3 handlers
Emmanuel Grumbach [Thu, 6 Jun 2019 08:31:04 +0000 (11:31 +0300)]
iwlwifi: remove the opmode's d0i3 handlers

Remove the now unneeded functions that called those from the
transport layer.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: remove runtime_pm_mode
Emmanuel Grumbach [Thu, 6 Jun 2019 08:27:13 +0000 (11:27 +0300)]
iwlwifi: remove runtime_pm_mode

This is always set to IWL_PLAT_PM_MODE_DISABLED

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: Set w-pointer upon resume according to SN
Alex Malamud [Mon, 10 Jun 2019 12:19:23 +0000 (15:19 +0300)]
iwlwifi: Set w-pointer upon resume according to SN

During D3 state, FW may send packets.
As a result, "write" queue pointer will be incremented by FW.
Upon resume from D3, driver should adjust its shadows of "write" and "read"
pointers to the value reported by FW.

1. Keep TID used during wowlan configuration.
2. Upon resume, set driver's "write" and "read" queue pointers
to the value reported by FW.

Signed-off-by: Alex Malamud <alex.malamud@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: use FW thermal monitoring regardless of CONFIG_THERMAL
Johannes Berg [Tue, 11 Jun 2019 13:38:13 +0000 (15:38 +0200)]
iwlwifi: mvm: use FW thermal monitoring regardless of CONFIG_THERMAL

It doesn't make sense to use the FW thermal monitoring only if we
have CONFIG_THERMAL, because then we use the default thresholds
etc. which may be different from what the firmware implements, as
we don't maintain them in the driver now. Only the CTDP code needs
to actually be under CONFIG_THERMAL.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: name magic numbers with enum
Mordechay Goodstein [Wed, 29 May 2019 12:39:07 +0000 (15:39 +0300)]
iwlwifi: mvm: name magic numbers with enum

It's hard to follow the numbers so rename it with enum

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: scan: add support for new scan request command version
Ayala Beker [Thu, 23 May 2019 22:06:01 +0000 (01:06 +0300)]
iwlwifi: scan: add support for new scan request command version

Scan API was changed to support 6Ghz channels as well.
Support the new version.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: LTR updates
Alex Malamud [Wed, 22 May 2019 10:49:18 +0000 (13:49 +0300)]
iwlwifi: LTR updates

New FW versions introduces LTR feature enablement by default.
For such FW versions, driver (mvm/xvt) should not send
host command to enable LTR feature, also it should be possible to
override LTR configuration through the debugfs.

1. Send LTR feature enablement command only for FW versions
which does not advertises SET_LTR_GEN2 capability.
2. Implement ltr_config file in debugfs for LTR configuration override.

Signed-off-by: Alex Malamud <alex.malamud@intel.com>
5 years agoiwlwifi: remove the code under IWLWIFI_PCIE_RTPM
Emmanuel Grumbach [Thu, 6 Jun 2019 08:22:16 +0000 (11:22 +0300)]
iwlwifi: remove the code under IWLWIFI_PCIE_RTPM

This flag should never be set unless integration work with the
platform is done.  We don't support any platforms officially and don't
plan to do so in the near future, so we can remove this option
entirely in order to avoid having it enabled by mistake.

This has been marked with "depends on EXPERT", so there shouldn't be
many systems running with it set.  And, if there are systems, they
should not be using this flag.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: trans: remove suspending flag
Emmanuel Grumbach [Thu, 6 Jun 2019 08:18:46 +0000 (11:18 +0300)]
iwlwifi: trans: remove suspending flag

This is set but never read.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: remove CMD_HIGH_PRIO
Emmanuel Grumbach [Thu, 6 Jun 2019 08:10:25 +0000 (11:10 +0300)]
iwlwifi: remove CMD_HIGH_PRIO

This flag is never set on any host command. Remove it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: remove last leftovers of d0i3
Emmanuel Grumbach [Thu, 6 Jun 2019 08:06:45 +0000 (11:06 +0300)]
iwlwifi: mvm: remove last leftovers of d0i3

We're now left with a status bit that is never set and a few
other leftovers.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: remove iwl_mvm_update_d0i3_power_mode
Emmanuel Grumbach [Thu, 6 Jun 2019 08:03:01 +0000 (11:03 +0300)]
iwlwifi: mvm: remove iwl_mvm_update_d0i3_power_mode

Also change the signature of the power functions that won't
receive d0i3=true anymore.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: remove d0i3_ap_sta_id
Emmanuel Grumbach [Thu, 6 Jun 2019 08:00:09 +0000 (11:00 +0300)]
iwlwifi: mvm: remove d0i3_ap_sta_id

This variable read, but never set. Remove it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: iwl_mvm_wowlan_config_key_params is for wowlan only
Emmanuel Grumbach [Thu, 6 Jun 2019 07:58:46 +0000 (10:58 +0300)]
iwlwifi: mvm: iwl_mvm_wowlan_config_key_params is for wowlan only

Now that d0i3 is dead, this function can't be called from d0i3
flows. Change its signature and make it static.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: remove the d0i3 entry/exit flow
Emmanuel Grumbach [Thu, 6 Jun 2019 07:47:33 +0000 (10:47 +0300)]
iwlwifi: mvm: remove the d0i3 entry/exit flow

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: remove the tx defer for d0i3
Emmanuel Grumbach [Thu, 6 Jun 2019 07:41:17 +0000 (10:41 +0300)]
iwlwifi: mvm: remove the tx defer for d0i3

This is not needed anymore

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: remove all the d0i3 references
Emmanuel Grumbach [Tue, 11 Jun 2019 10:15:24 +0000 (13:15 +0300)]
iwlwifi: remove all the d0i3 references

As part of the d0i3 removal.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: start to remove the code for d0i3
Emmanuel Grumbach [Thu, 6 Jun 2019 06:52:56 +0000 (09:52 +0300)]
iwlwifi: mvm: start to remove the code for d0i3

For runtime PM to work with d0i3 code, a lot of integration work needs
to be done with the platform (e.g. the out-of-band wake up interrupt)
and we currently don't have any platforms where this integration
happened.  So, this code has been pretty much stale for a while and
when someone enables it, it just breaks things.

Therefore, to simplify the code base and make sure no one enables this
by mistake, we will remove the whole code.

This is only the very start, much more work is needed.
Remove the places where we check iwl_mvm_is_d0i3_supported
but leave all the refs, those will be removed in a different
patch.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: add the skb length to a print
Shaul Triebitz [Tue, 4 Jun 2019 08:50:34 +0000 (11:50 +0300)]
iwlwifi: mvm: add the skb length to a print

When printing a TX, add to the print the length of the frame.
That will help with BSEP (buffer status report poll) tests.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: fix scan config command size
Beker Ayala [Sun, 2 Jun 2019 10:55:44 +0000 (13:55 +0300)]
iwlwifi: mvm: fix scan config command size

Use the actual length of channels array and not the max capable length.

Signed-off-by: Beker Ayala <ayala.beker@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: add ldbg config cmd debug print
Shahar S Matityahu [Thu, 23 May 2019 05:39:27 +0000 (08:39 +0300)]
iwlwifi: add ldbg config cmd debug print

add support to print ldbg command in mvm and xvt mode

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg: support debug recording suspend resume command
Shahar S Matityahu [Sun, 19 May 2019 07:52:59 +0000 (10:52 +0300)]
iwlwifi: dbg: support debug recording suspend resume command

Support the new DBGC_SUSPEND_RESUME command to change the recording state.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg: move debug recording stop from trans to op mode
Shahar S Matityahu [Wed, 22 May 2019 10:47:29 +0000 (13:47 +0300)]
iwlwifi: dbg: move debug recording stop from trans to op mode

The op mode should stop the debug recording and not the transport layer.
Rename iwl_fwrt_stop_device into iwl_fw_dbg_stop_sync and move the debug
stop recording to it.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: dbg: move monitor recording functionality from header file
Shahar S Matityahu [Tue, 21 May 2019 06:42:15 +0000 (09:42 +0300)]
iwlwifi: dbg: move monitor recording functionality from header file

The recording functions are quite big to be inline and the driver should
expose only the stop and restart functions that are allowed to be used
rather then the internal helper functions. Move the functions from the
header file.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: remove unnecessary forward declarations
Johannes Berg [Mon, 20 May 2019 09:26:16 +0000 (11:26 +0200)]
iwlwifi: mvm: remove unnecessary forward declarations

These static functions are only used after their definition,
so we don't need the forward declarations.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: Block 26-tone RU OFDMA transmissions
Ilan Peer [Sun, 19 May 2019 11:56:31 +0000 (14:56 +0300)]
iwlwifi: mvm: Block 26-tone RU OFDMA transmissions

In case that there are OBSS that do not know how to properly
interpret 26-tone RU OFDMA transmissions, instruct the FW not
to use such transmissions.

The check is currently only performed upon association.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: mvm: remove redundant condition in iwl_mvm_set_hw_rfkill_state
Emmanuel Grumbach [Tue, 21 May 2019 19:13:10 +0000 (22:13 +0300)]
iwlwifi: mvm: remove redundant condition in iwl_mvm_set_hw_rfkill_state

If mvm->fwrt.cur_fw_img != IWL_UCODE_INIT, then
rfkill_safe_init_done must be true since
rfkill_safe_init_done is set to true before we start to load
the runtime image.
Remove the redundant condition.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: Send DQA enable command only if TVL is on
Ilia Lin [Tue, 14 May 2019 14:19:06 +0000 (17:19 +0300)]
iwlwifi: Send DQA enable command only if TVL is on

The newer targets don't support the DQA enablement command
and will return error status, while older targets need it.
The feature is defined by the corresponding TLV.
Send the command only if the TLV is enabled.

Signed-off-by: Ilia Lin <ilia.lin@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoiwlwifi: bump FW API to 49 for 22000 series
Luca Coelho [Wed, 10 Apr 2019 06:23:39 +0000 (09:23 +0300)]
iwlwifi: bump FW API to 49 for 22000 series

Start supporting API version 49 for 22000 series.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
5 years agoMerge tag 'mt76-for-kvalo-2019-09-05' of https://github.com/nbd168/wireless
Kalle Valo [Fri, 6 Sep 2019 08:59:32 +0000 (11:59 +0300)]
Merge tag 'mt76-for-kvalo-2019-09-05' of https://github.com/nbd168/wireless

mt76 patches for 5.4

* beacon tx fix for mt76x02
* sparse/checkpatch warning fixes
* DFS pattern detector for mt7615 (DFS channels not enabled yet)
* CSA support for mt7615
* mt7615 cleanup/fixes
* mt7615 rate control improvements
* usb fixes
* mt7615 powersave buffering fix
* new device support for mt76x0
* support for more ciphers in mt7615
* watchdog time fixes
* smart carrier sense on mt7615
* survey support on mt7615
* multiple interfaces on mt76x02u
* calibration data fix for mt7615
* fix for sending BAR after disassoc

5 years agomt76: mt7615: add support to read temperature from mcu
Lorenzo Bianconi [Mon, 2 Sep 2019 12:51:54 +0000 (14:51 +0200)]
mt76: mt7615: add support to read temperature from mcu

Introduce debugfs entry to read device temperature and related cmu
command. Introduce mt7615_mcu_parse_response to parse mcu response
messages and refactor mt7615_mcu_msg_send routine

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: introduce mt7615_txwi_to_txp utility routine
Lorenzo Bianconi [Wed, 28 Aug 2019 09:01:40 +0000 (11:01 +0200)]
mt76: mt7615: introduce mt7615_txwi_to_txp utility routine

Introduce mt7615_txwi_to_txp utility routine to convert mt76_txwi_cache
into mt7615_txp and remove duplicated code

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7603: use devm_platform_ioremap_resource() to simplify code
YueHaibing [Tue, 27 Aug 2019 13:44:45 +0000 (21:44 +0800)]
mt76: mt7603: use devm_platform_ioremap_resource() to simplify code

Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt76x0: remove unneeded return value on set channel
Stanislaw Gruszka [Fri, 23 Aug 2019 08:52:17 +0000 (10:52 +0200)]
mt76: mt76x0: remove unneeded return value on set channel

We allways return 0 from mt76x0_phy_set_channel(), no need to pass
return value upward.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt76x0: remove redundant chandef copy
Stanislaw Gruszka [Fri, 23 Aug 2019 08:52:16 +0000 (10:52 +0200)]
mt76: mt76x0: remove redundant chandef copy

We set dev->mt76.chandef in mt76_set_channel() already.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: make mt76_rx_convert static
Stanislaw Gruszka [Fri, 23 Aug 2019 08:46:12 +0000 (10:46 +0200)]
mt76: make mt76_rx_convert static

mt76_rx_convert() not need to be exported any longer.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: remove offchannel check in tx scheduling
Felix Fietkau [Thu, 22 Aug 2019 08:08:56 +0000 (10:08 +0200)]
mt76: remove offchannel check in tx scheduling

tx queues are already disabled by mac80211 during scanning or other
off-channel activity. There is no need to repeat the check in mt76,
since scheduled queues are selected by mac80211 as well.

Signed-off-by: Balakrishna Bandi <b.balakrishna@globaledgesoft.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: do not send BAR frame on tx aggregation flush stop
Felix Fietkau [Thu, 22 Aug 2019 07:37:41 +0000 (09:37 +0200)]
mt76: do not send BAR frame on tx aggregation flush stop

There is no need to send a BAR frame after stopping aggregation, and doing
so could lead to sending class 3 frames after deauthentication from an AP

Signed-off-by: Balakrishna Bandi <b.balakrishna@globaledgesoft.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: stop rx aggregation on station removal
Felix Fietkau [Mon, 12 Aug 2019 13:48:53 +0000 (15:48 +0200)]
mt76: stop rx aggregation on station removal

Fixes use-after-free issues on forced station removal during hardware restart
on MT76x02

Fixes: aee5b8cf2477 ("mt76: implement A-MPDU rx reordering in the driver code")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: dma: reset q->rx_head on rx reset
Felix Fietkau [Mon, 12 Aug 2019 13:50:59 +0000 (15:50 +0200)]
mt76: dma: reset q->rx_head on rx reset

Fixes rx of the first frame if a fragmented rx was interrupted by the reset

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: apply calibration-free data from OTP
Felix Fietkau [Wed, 21 Aug 2019 13:21:00 +0000 (15:21 +0200)]
mt76: mt7615: apply calibration-free data from OTP

MT7615 chips usually come pre-calibrated, even when used on embedded boards.
In that case, the on-flash EEPROM data needs to be merged with some data
from OTP ROM.
Run this merge if the external EEPROM data is valid and OTP has valid fields.

Tested-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: add default implementation for mt76_sw_scan/mt76_sw_scan_complete
Lorenzo Bianconi [Wed, 21 Aug 2019 08:00:19 +0000 (10:00 +0200)]
mt76: add default implementation for mt76_sw_scan/mt76_sw_scan_complete

Introduce a default implementation for mt76_sw_scan and
mt76_sw_scan_complete in mt76 module and remove duplicated code
since most of the drivers share the same implementation

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: fix some checkpatch warnings
Ryder Lee [Wed, 21 Aug 2019 03:11:15 +0000 (11:11 +0800)]
mt76: fix some checkpatch warnings

This fixes the following checkpatch warnings:
CHECK: Alignment should match open parenthesis
CHECK: No space is necessary after a cast

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: add BIP_CMAC_128 cipher support
Lorenzo Bianconi [Tue, 20 Aug 2019 14:56:25 +0000 (16:56 +0200)]
mt76: mt7615: add BIP_CMAC_128 cipher support

Refactor mt7615_mac_wtbl_set_key and introduce
the following routines in order to configure wtbl entries
and properly add hw support to BIP_CMAC_128 cipher:
- mt7615_mac_wtbl_update_cipher
- mt7615_mac_wtbl_update_pk
- mt7615_mac_wtbl_update_key

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7603: remove unnecessary mcu queue initialization
Lorenzo Bianconi [Fri, 9 Aug 2019 17:25:15 +0000 (19:25 +0200)]
mt76: mt7603: remove unnecessary mcu queue initialization

Remove unnecessary mcu queue initialization in mt7603_dma_init since it
has been already done in mt76_mmio_init

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: move mt76_tx_tasklet in mt76 module
Lorenzo Bianconi [Fri, 9 Aug 2019 17:06:02 +0000 (19:06 +0200)]
mt76: move mt76_tx_tasklet in mt76 module

Move mt76{15,03}_tx_tasklet in mt76_alloc_device in order to be used as
default tx_tasklet initialization. Remove duplicated code in
mt7603/mt7615 drivers

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: enable survey support
Lorenzo Bianconi [Mon, 5 Aug 2019 06:55:53 +0000 (08:55 +0200)]
mt76: mt7615: enable survey support

Introduce channel survey support for mt7615 driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7603: move survey_time in mt76_dev
Lorenzo Bianconi [Mon, 5 Aug 2019 06:55:52 +0000 (08:55 +0200)]
mt76: mt7603: move survey_time in mt76_dev

Move survey_time field in mt76_dev in order to be reused adding survey
support to mt7615 driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt76x02u: enable survey support
Lorenzo Bianconi [Mon, 5 Aug 2019 06:55:51 +0000 (08:55 +0200)]
mt76: mt76x02u: enable survey support

Introduce channel survey support for mt76x2u and mt76x0u drivers

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt76x02u: enable multi-vif support
Lorenzo Bianconi [Fri, 2 Aug 2019 14:36:20 +0000 (16:36 +0200)]
mt76: mt76x02u: enable multi-vif support

Enable multi-interface support for mt76x02u driver. For the moment
allow max two concurrent interfaces in order to preserve enough room
for ps traffic since we are using beacon slots for it.
I have successfully tested the following configuration:
- AP + STA
- AP0 + AP1

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Tested-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt76x02: do not copy beacon skb in mt76x02_mac_set_beacon_enable
Lorenzo Bianconi [Thu, 1 Aug 2019 08:26:23 +0000 (10:26 +0200)]
mt76: mt76x02: do not copy beacon skb in mt76x02_mac_set_beacon_enable

Do not copy beacon skb in mt76x02_mac_set_beacon_enable for usb devices
since it will be done in mt76x02_update_beacon_iter. Moreover squash
mt76x02_mac_set_beacon_enable and __mt76x02_mac_set_beacon_enable since
the latter is run just by mt76x02_mac_set_beacon_enable

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt76x02: introduce mt76x02_pre_tbtt_enable and mt76x02_beacon_enable macros
Lorenzo Bianconi [Thu, 1 Aug 2019 08:26:22 +0000 (10:26 +0200)]
mt76: mt76x02: introduce mt76x02_pre_tbtt_enable and mt76x02_beacon_enable macros

Improve code readability introducing mt76x02_pre_tbtt_enable and
mt76x02_beacon_enable utility macros

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: add Smart Carrier Sense support
Lorenzo Bianconi [Sun, 28 Jul 2019 19:03:18 +0000 (21:03 +0200)]
mt76: mt7615: add Smart Carrier Sense support

Introduce Smart Carrier Sense support in order to tune device
sensitivity according to RTS error rate and False CCA reported by the
radio

Tested-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: rework locking scheme for mt7615_set_channel
Lorenzo Bianconi [Sun, 28 Jul 2019 19:03:17 +0000 (21:03 +0200)]
mt76: mt7615: rework locking scheme for mt7615_set_channel

As already done for mt7603 driver, move mt76.mutex lock inside
mt7615_set_channel since we need to grab mt76.mutex in mt7615_mac_work.
This is a preliminary patch to add Smart Carrier Sense (SCS) support

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: switch to SPDX tag instead of verbose boilerplate text
Ryder Lee [Wed, 24 Jul 2019 08:58:20 +0000 (16:58 +0800)]
mt76: switch to SPDX tag instead of verbose boilerplate text

No functional change intended.

Add SPDX identifiers to all remaining files in /mt76.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt76x02: fix some checkpatch warnings
Ryder Lee [Wed, 24 Jul 2019 08:58:18 +0000 (16:58 +0800)]
mt76: mt76x02: fix some checkpatch warnings

This fixes the following checkpatch warnings:

ERROR: code indent should use tabs where possible
CHECK: Alignment should match open parenthesis
CHECK: No space is necessary after a cast
CHECK: Please don't use multiple blank lines
CHECK: Avoid precedence issues in macro
WARNING: Statements should start on a tabstop
WARNING: Unnecessary space before function pointer arguments

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: fix some checkpatch warnings
Ryder Lee [Wed, 24 Jul 2019 08:58:17 +0000 (16:58 +0800)]
mt76: mt7615: fix some checkpatch warnings

This fixes the following checkpatch warnings:

WARNING: Improper SPDX comment style
Fix blank lines.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7603: fix some checkpatch warnings
Ryder Lee [Wed, 24 Jul 2019 08:58:16 +0000 (16:58 +0800)]
mt76: mt7603: fix some checkpatch warnings

This fixes the following checkpatch warnings:

WARNING: Improper SPDX comment style
CHECK: No space is necessary after a cast

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: Add paragraphs to describe the config symbols fully
Ryder Lee [Wed, 24 Jul 2019 08:58:15 +0000 (16:58 +0800)]
mt76: Add paragraphs to describe the config symbols fully

Update the help text to fix a checkpatch warning:

WARNING: please write a paragraph that describes the config symbol fully

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: update cw_min/max related settings
Ryder Lee [Mon, 22 Jul 2019 08:50:09 +0000 (16:50 +0800)]
mt76: mt7615: update cw_min/max related settings

Add default values of cw_min/max and use fls() for configuration.

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: add 4 WMM sets support
Ryder Lee [Mon, 22 Jul 2019 08:50:08 +0000 (16:50 +0800)]
mt76: mt7615: add 4 WMM sets support

Hardware supports 4 sets of WMM that should be put to good use.
And fix incorrect queue mapping in mt7615_conf_tx().

Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7603: fix watchdog rescheduling in mt7603_set_channel
Lorenzo Bianconi [Thu, 18 Jul 2019 22:50:42 +0000 (00:50 +0200)]
mt76: mt7603: fix watchdog rescheduling in mt7603_set_channel

Convert MT7603_WATCHDOG_TIME in jiffies rescheduling watchdog delayed
work

Fixes: c8846e101502 ("mt76: add driver for MT7603E and MT7628/7688")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: fix MT7615_WATCHDOG_TIME definition
Lorenzo Bianconi [Thu, 18 Jul 2019 22:44:16 +0000 (00:44 +0200)]
mt76: mt7615: fix MT7615_WATCHDOG_TIME definition

Express watchdog timeout in jiffies since it is used directly in
ieee80211_queue_delayed_work

Fixes: 04b8e65922f6 ("mt76: add mac80211 driver for MT7615 PCIe-based chipsets")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: introduce mt76_mmio_read_copy routine
Lorenzo Bianconi [Sat, 13 Jul 2019 15:09:06 +0000 (17:09 +0200)]
mt76: introduce mt76_mmio_read_copy routine

Add mt76_mmio_read_copy routine and the related function pointer in
mt76_bus_ops data structure. mt76_mmio_read_copy will be used to add
BIP_CMAC_128 cipher hw support to mt7615 driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: add set_key_cmd and mt76_wcid to mt7615_mac_wtbl_set_key signature
Lorenzo Bianconi [Sat, 13 Jul 2019 15:09:05 +0000 (17:09 +0200)]
mt76: mt7615: add set_key_cmd and mt76_wcid to mt7615_mac_wtbl_set_key signature

Introduce set_key_cmd and mt76_wcid pointer to mt7615_mac_wtbl_set_key
signature and do not set key to NULL if cmd is DISABLE_KEY.
This is a preliminary patch to add BIP_CMAC_128 hw support to mt7615
driver

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: remove wtbl_sec_key definition
Lorenzo Bianconi [Sat, 13 Jul 2019 15:09:04 +0000 (17:09 +0200)]
mt76: mt7615: remove wtbl_sec_key definition

Get rid of wtbl_sec_key definition since it is no longer used

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: introduce mt7615_mac_wtbl_set_key routine
Lorenzo Bianconi [Sat, 13 Jul 2019 15:09:03 +0000 (17:09 +0200)]
mt76: mt7615: introduce mt7615_mac_wtbl_set_key routine

Add mt7615_mac_wtbl_set_key routine to configure wtbl key parameter
directly from host cpu. This is a preliminary patch to add BIP_CMAC_128
hw support. Moreover add static qualifier to mt7615_mac_get_key_info
routine

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: add mt7615_mac_wtbl_addr routine
Lorenzo Bianconi [Sat, 13 Jul 2019 15:09:02 +0000 (17:09 +0200)]
mt76: mt7615: add mt7615_mac_wtbl_addr routine

Introduce mt7615_mac_wtbl_addr rouinte to compute sta wtbl address.
This is a preliminary patch to update wtbl key directly from host
processor

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: move mt7615_mac_get_key_info in mac.c
Lorenzo Bianconi [Sat, 13 Jul 2019 15:09:01 +0000 (17:09 +0200)]
mt76: mt7615: move mt7615_mac_get_key_info in mac.c

This is a preliminary patch to update wtbl key directly from host
processor

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: add missing register initialization
Felix Fietkau [Tue, 16 Jul 2019 16:12:07 +0000 (18:12 +0200)]
mt76: mt7615: add missing register initialization

- initialize CCA signal source
- initialize clock for band 1 (7615D)
- initialize BAR rate

Reviewed-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt76x0u: add support to TP-Link T2UHP
Lorenzo Bianconi [Fri, 5 Jul 2019 19:01:04 +0000 (21:01 +0200)]
mt76: mt76x0u: add support to TP-Link T2UHP

Introduce support to TP-Link T2UHP
https://wikidevi.com/wiki/TP-LINK_Archer_T2UHP

Tested-by: Sid Hayn <sidhayn@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7615: use params->ssn value directly
Stanislaw Gruszka [Fri, 12 Jul 2019 12:08:00 +0000 (14:08 +0200)]
mt76: mt7615: use params->ssn value directly

There is no point to use pointer to params->ssn.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt7603: use params->ssn value directly
Stanislaw Gruszka [Fri, 12 Jul 2019 12:07:59 +0000 (14:07 +0200)]
mt76: mt7603: use params->ssn value directly

There is no point to use pointer to params->ssn.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: mt76x02: use params->ssn value directly
Stanislaw Gruszka [Fri, 12 Jul 2019 12:07:58 +0000 (14:07 +0200)]
mt76: mt76x02: use params->ssn value directly

There is no point to use pointer to params->ssn.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years agomt76: usb: remove unneeded {put,get}_unaligned
Stanislaw Gruszka [Tue, 9 Jul 2019 15:14:55 +0000 (17:14 +0200)]
mt76: usb: remove unneeded {put,get}_unaligned

Compiler give us guarantees on variables alignment, so use
an variable as buffer when read/write registers and remove
unneeded {put,get}_unaligned.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>