platform/kernel/linux-starfive.git
3 years agowl3501: fix typo of 'Networks' in comment
Eric Lin [Wed, 31 Mar 2021 01:04:18 +0000 (09:04 +0800)]
wl3501: fix typo of 'Networks' in comment

Signed-off-by: Eric Lin <dslin1010@gmail.com>
Reported-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210331010418.1632816-2-dslin1010@gmail.com
3 years agorsi: Use resume_noirq for SDIO
Marek Vasut [Sat, 27 Mar 2021 23:59:32 +0000 (00:59 +0100)]
rsi: Use resume_noirq for SDIO

The rsi_resume() does access the bus to enable interrupts on the RSI
SDIO WiFi card, however when calling sdio_claim_host() in the resume
path, it is possible the bus is already claimed and sdio_claim_host()
spins indefinitelly. Enable the SDIO card interrupts in resume_noirq
instead to prevent anything else from claiming the SDIO bus first.

Fixes: 20db07332736 ("rsi: sdio suspend and resume support")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Cc: Angus Ainslie <angus@akkea.ca>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Karun Eagalapati <karun256@gmail.com>
Cc: Martin Kepplinger <martink@posteo.de>
Cc: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Cc: Siva Rebbagondla <siva8118@gmail.com>
Cc: netdev@vger.kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210327235932.175896-1-marex@denx.de
3 years agortw88: update statistics to fw for fine-tuning performance
Po-Hao Huang [Fri, 26 Mar 2021 09:21:47 +0000 (17:21 +0800)]
rtw88: update statistics to fw for fine-tuning performance

Since firmware can't have proper statistics, driver update the statistics
periodically to firmware to assist in tuning performance.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210326092147.30252-1-pkshih@realtek.com
3 years agolibertas: struct lbs_private is declared duplicately
Wan Jiabing [Thu, 25 Mar 2021 06:41:51 +0000 (14:41 +0800)]
libertas: struct lbs_private is declared duplicately

struct lbs_private has been declared at 22nd line.
Remove the duplicate.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210325064154.854245-1-wanjiabing@vivo.com
3 years agobrcmfmac: A typo fix
Bhaskar Chowdhury [Tue, 23 Mar 2021 04:36:57 +0000 (10:06 +0530)]
brcmfmac: A typo fix

s/revsion/revision/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210323043657.1466296-1-unixbhaskar@gmail.com
3 years agorsi: fix comment syntax in file headers
Aditya Srivastava [Mon, 15 Mar 2021 17:32:59 +0000 (23:02 +0530)]
rsi: fix comment syntax in file headers

The opening comment mark '/**' is used for highlighting the beginning of
kernel-doc comments.
There are some files in drivers/net/wireless/rsi which follow this syntax
in their file headers, i.e. start with '/**' like comments, which causes
unexpected warnings from kernel-doc.

E.g., running scripts/kernel-doc -none on drivers/net/wireless/rsi/rsi_coex.h
causes this warning:
"warning: wrong kernel-doc identifier on line:
 * Copyright (c) 2018 Redpine Signals Inc."

Similarly for other files too.

Provide a simple fix by replacing such occurrences with general comment
format, i.e., "/*", to prevent kernel-doc from parsing it.

Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210315173259.8757-1-yashsri421@gmail.com
3 years agoairo: work around stack usage warning
Arnd Bergmann [Tue, 23 Mar 2021 13:16:28 +0000 (14:16 +0100)]
airo: work around stack usage warning

gcc-11 with KASAN on 32-bit arm produces a warning about a function
that needs a lot of stack space:

drivers/net/wireless/cisco/airo.c: In function 'setup_card.constprop':
drivers/net/wireless/cisco/airo.c:3960:1: error: the frame size of 1512 bytes is larger than 1400 bytes [-Werror=frame-larger-than=]

Most of this is from a single large structure that could be dynamically
allocated or moved into the per-device structure.  However, as the callers
all seem to have a fairly well bounded call chain, the easiest change
is to pull out the part of the function that needs the large variables
into a separate function and mark that as noinline_for_stack. This does
not reduce the total stack usage, but it gets rid of the warning and
requires minimal changes otherwise.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210323131634.2669455-1-arnd@kernel.org
3 years agowlcore: fix overlapping snprintf arguments in debugfs
Arnd Bergmann [Tue, 23 Mar 2021 12:57:14 +0000 (13:57 +0100)]
wlcore: fix overlapping snprintf arguments in debugfs

gcc complains about undefined behavior in calling snprintf()
with the same buffer as input and output:

drivers/net/wireless/ti/wl18xx/debugfs.c: In function 'diversity_num_of_packets_per_ant_read':
drivers/net/wireless/ti/wl18xx/../wlcore/debugfs.h:86:3: error: 'snprintf' argument 4 overlaps destination object 'buf' [-Werror=restrict]
   86 |   snprintf(buf, sizeof(buf), "%s[%d] = %d\n",  \
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   87 |     buf, i, stats->sub.name[i]);   \
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ti/wl18xx/debugfs.c:24:2: note: in expansion of macro 'DEBUGFS_FWSTATS_FILE_ARRAY'
   24 |  DEBUGFS_FWSTATS_FILE_ARRAY(a, b, c, wl18xx_acx_statistics)
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/ti/wl18xx/debugfs.c:159:1: note: in expansion of macro 'WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY'
  159 | WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY(diversity, num_of_packets_per_ant,

There are probably other ways of handling the debugfs file, without
using on-stack buffers, but a simple workaround here is to remember the
current position in the buffer and just keep printing in there.

Fixes: bcca1bbdd412 ("wlcore: add debugfs macro to help print fw statistics arrays")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210323125723.1961432-1-arnd@kernel.org
3 years agolibertas: avoid -Wempty-body warning
Arnd Bergmann [Mon, 22 Mar 2021 10:43:34 +0000 (11:43 +0100)]
libertas: avoid -Wempty-body warning

Building without mesh supports shows a couple of warnings with
'make W=1':

drivers/net/wireless/marvell/libertas/main.c: In function 'lbs_start_card':
drivers/net/wireless/marvell/libertas/main.c:1068:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
 1068 |                 lbs_start_mesh(priv);

Change the macros to use the usual "do { } while (0)" instead to shut up
the warnings and make the code a litte more robust.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210322104343.948660-4-arnd@kernel.org
3 years agortl8xxxu: Simplify locking of a skb list accesses
Christophe JAILLET [Mon, 5 Apr 2021 09:09:14 +0000 (11:09 +0200)]
rtl8xxxu: Simplify locking of a skb list accesses

The 'c2hcmd_lock' spinlock is only used to protect some __skb_queue_tail()
and __skb_dequeue() calls.
Use the lock provided in the skb itself and call skb_queue_tail() and
skb_dequeue(). These functions already include the correct locking.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/8bcec6429615aeb498482dc7e1955ce09b456585.1617613700.git.christophe.jaillet@wanadoo.fr
3 years agowilc1000: fix a loop timeout condition
Dan Carpenter [Fri, 19 Mar 2021 14:47:31 +0000 (17:47 +0300)]
wilc1000: fix a loop timeout condition

If the loop fails, the "while(trials--) {" loop will exit with "trials"
set to -1.  The test for that expects it to end with "trials" set to 0
so the warning message will not be printed.

Fix this by changing from a post-op to a pre-op.  This does mean that
we only make 99 attempts instead of 100 but that's okay.

Fixes: f135a1571a05 ("wilc1000: Support chip sleep over SPI")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/YFS5gx/gi70zlIaO@mwanda
3 years agomwifiex: Remove unneeded variable: "ret"
zuoqilin [Wed, 17 Mar 2021 06:33:53 +0000 (14:33 +0800)]
mwifiex: Remove unneeded variable: "ret"

Remove unneeded variable: "ret"

Signed-off-by: zuoqilin <zuoqilin@yulong.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210317063353.1055-1-zuoqilin1@163.com
3 years agortl8xxxu: Fix fall-through warnings for Clang
Gustavo A. R. Silva [Fri, 5 Mar 2021 09:48:50 +0000 (03:48 -0600)]
rtl8xxxu: Fix fall-through warnings for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix
multiple warnings by replacing /* fall through */ comments with
the new pseudo-keyword macro fallthrough; instead of letting the
code fall through to the next case.

Notice that Clang doesn't recognize /* fall through */ comments as
implicit fall-through markings.

Link: https://github.com/KSPP/linux/issues/115
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210305094850.GA141221@embeddedor
3 years agowilc1000: Bring MAC address setting in line with typical Linux behavior
David Mosberger-Tang [Wed, 3 Mar 2021 19:50:07 +0000 (19:50 +0000)]
wilc1000: Bring MAC address setting in line with typical Linux behavior

Linux network drivers normally disallow changing the MAC address when
the interface is up.  This driver has been different in that it allows
to change the MAC address *only* when it's up.  This patch brings
wilc1000 behavior more in line with other network drivers.  We could
have replaced wilc_set_mac_addr() with eth_mac_addr() but that would
break existing documentation on how to change the MAC address.
Likewise, return -EADDRNOTAVAIL (not -EINVAL) when the specified MAC
address is invalid or unavailable.

Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210303194846.1823596-1-davidm@egauge.net
3 years agowilc1000: Add support for enabling CRC
David Mosberger-Tang [Sat, 27 Feb 2021 17:31:38 +0000 (17:31 +0000)]
wilc1000: Add support for enabling CRC

The driver so far has always disabled CRC protection.  This means any
data corruption that occurrs during the SPI transfers could go
undetected.  This patch adds module parameters enable_crc7 and
enable_crc16 to selectively turn on CRC7 (for command transfers) and
CRC16 (for data transfers), respectively.

The default configuration remains unchanged, with both CRC7 and CRC16
off.

The performance impact of CRC was measured by running ttcp -t four
times in a row on a SAMA5 device:

 CRC7 CRC16 Throughput: Standard deviation:
 ---- ----- ----------- -------------------
  off   off 1720  +/- 48 KB/s
   on   off 1658  +/- 58 KB/s
   on    on 1579  +/- 84 KB/s

Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210227172818.1711071-4-davidm@egauge.net
3 years agowilc1000: Check for errors at end of DMA write
David Mosberger-Tang [Sat, 27 Feb 2021 17:29:46 +0000 (17:29 +0000)]
wilc1000: Check for errors at end of DMA write

After a DMA write to the WILC chip, check for and report any errors.

This is based on code from the wilc driver in the linux-at91
repository.

Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210227172818.1711071-3-davidm@egauge.net
3 years agowilc1000: Introduce symbolic names for SPI protocol register
David Mosberger-Tang [Sat, 27 Feb 2021 17:29:22 +0000 (17:29 +0000)]
wilc1000: Introduce symbolic names for SPI protocol register

The WILC1000 protocol control register has bits for enabling the CRCs
(CRC7 for commands and CRC16 for data) and to set the data packet
size.  Define symbolic names for those so the code is more easily
understood.

Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210227172818.1711071-2-davidm@egauge.net
3 years agowilc1000: Make SPI transfers work at 48MHz
David Mosberger-Tang [Sat, 27 Feb 2021 17:29:14 +0000 (17:29 +0000)]
wilc1000: Make SPI transfers work at 48MHz

For CMD_SINGLE_READ and CMD_INTERNAL_READ, WILC may insert one or more
zero bytes between the command response and the DATA Start tag (0xf3).
This behavior appears to be undocumented in "ATWILC1000 USER GUIDE"
(https://tinyurl.com/4hhshdts) but we have observed 1-4 zero bytes
when the SPI bus operates at 48MHz and none when it operates at 1MHz.

This code is derived from the equivalent code of the wilc driver in
the linux-at91 repository.

Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210227172818.1711071-1-davidm@egauge.net
3 years agomwifiex: don't print SSID to logs
Brian Norris [Thu, 25 Feb 2021 02:44:54 +0000 (18:44 -0800)]
mwifiex: don't print SSID to logs

There are a few reasons not to dump SSIDs as-is in kernel logs:

1) they're not guaranteed to be any particular text encoding (UTF-8,
   ASCII, ...) in general
2) it's somewhat redundant; the BSSID should be enough to uniquely
   identify the AP/STA to which we're connecting
3) BSSIDs have an easily-recognized format, whereas SSIDs do not (they
   are free-form)
4) other common drivers (e.g., everything based on mac80211) get along
   just fine by only including BSSIDs when logging state transitions

Additional notes on reason #3: this is important for the
privacy-conscious, especially when providing tools that convey
kernel logs on behalf of a user -- e.g., when reporting bugs. So for
example, it's easy to automatically filter logs for MAC addresses, but
it's much harder to filter SSIDs out of unstructured text.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210225024454.4106485-1-briannorris@chromium.org
3 years agoipw2x00: potential buffer overflow in libipw_wx_set_encodeext()
Dan Carpenter [Wed, 14 Apr 2021 08:29:55 +0000 (11:29 +0300)]
ipw2x00: potential buffer overflow in libipw_wx_set_encodeext()

The "ext->key_len" is a u16 that comes from the user.  If it's over
SCM_KEY_LEN (32) that could lead to memory corruption.

Fixes: e0d369d1d969 ("[PATCH] ieee82011: Added WE-18 support to default wireless extension handler")
Cc: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/YHaoA1i+8uT4ir4h@mwanda
3 years agortlwifi: rtl8192de: Use DEFINE_SPINLOCK() for spinlock
Guobin Huang [Tue, 6 Apr 2021 12:16:46 +0000 (20:16 +0800)]
rtlwifi: rtl8192de: Use DEFINE_SPINLOCK() for spinlock

spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Guobin Huang <huangguobin4@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1617711406-49649-1-git-send-email-huangguobin4@huawei.com
3 years agoqtnfmac: remove meaningless goto statement and labels
wengjianfeng [Tue, 6 Apr 2021 02:52:06 +0000 (10:52 +0800)]
qtnfmac: remove meaningless goto statement and labels

some function's label meaningless, the label statement follows
the goto statement, no other statements, so just remove it.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210406025206.4924-1-samirweng1979@163.com
3 years agortlwifi: Simplify locking of a skb list accesses
Christophe JAILLET [Mon, 5 Apr 2021 07:57:14 +0000 (09:57 +0200)]
rtlwifi: Simplify locking of a skb list accesses

The 'c2hcmd_lock' spinlock is only used to protect some __skb_queue_tail()
and __skb_dequeue() calls.
Use the lock provided in the skb itself and call skb_queue_tail() and
skb_dequeue(). These functions already include the correct locking.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/99cf8894fd52202cb7ce2ec6e3200eef400bc071.1617609346.git.christophe.jaillet@wanadoo.fr
3 years agortlwifi: remove rtl_get_tid_h
Christophe JAILLET [Fri, 2 Apr 2021 17:09:35 +0000 (19:09 +0200)]
rtlwifi: remove rtl_get_tid_h

'rtl_get_tid_h()' is the same as 'ieee80211_get_tid()'.
So this function can be removed to save a line of code.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/db340a67a95c119e4f9ba8fa99aea1c73d0dcfc9.1617383263.git.christophe.jaillet@wanadoo.fr
3 years agortlwifi: rtl8188ee: remove redundant assignment of variable rtlpriv->btcoexist.reg_bt_sco
Yang Li [Wed, 31 Mar 2021 09:13:43 +0000 (17:13 +0800)]
rtlwifi: rtl8188ee: remove redundant assignment of variable rtlpriv->btcoexist.reg_bt_sco

Assigning value "3" to "rtlpriv->btcoexist.reg_bt_sco" here, but that
stored value is overwritten before it can be used.

Coverity reports this problem as
CWE563: A value assigned to a variable is never used.
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c:
rtl8188ee_bt_reg_init

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1617182023-110950-1-git-send-email-yang.lee@linux.alibaba.com
3 years agortlwifi: remove redundant assignment to variable err
Colin Ian King [Sat, 27 Mar 2021 23:00:14 +0000 (23:00 +0000)]
rtlwifi: remove redundant assignment to variable err

Variable err is assigned -ENODEV followed by an error return path
via label error_out that does not access the variable and returns
with the -ENODEV error return code. The assignment to err is
redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210327230014.25554-1-colin.king@canonical.com
3 years agortlwifi: Few mundane typo fixes
Bhaskar Chowdhury [Sat, 20 Mar 2021 19:44:26 +0000 (01:14 +0530)]
rtlwifi: Few mundane typo fixes

s/resovle/resolve/
s/broadcase/broadcast/
s/sytem/system/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210320194426.21621-1-unixbhaskar@gmail.com
3 years agoqtnfmac: remove meaningless labels
wengjianfeng [Tue, 23 Feb 2021 06:57:54 +0000 (14:57 +0800)]
qtnfmac: remove meaningless labels

some function's label meaningless, the return statement follows
the goto statement, so just remove it.

Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
Reviewed-by: Sergey Matyukevich <geomatsi@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210223065754.34392-1-samirweng1979@163.com
3 years agortlwifi: 8821ae: upgrade PHY and RF parameters
Ping-Ke Shih [Fri, 19 Feb 2021 05:26:07 +0000 (13:26 +0800)]
rtlwifi: 8821ae: upgrade PHY and RF parameters

The signal strength of 5G is quite low, so user can't connect to an AP far
away. New parameters with new format and its parser are updated by the commit
84d26fda52e2 ("rtlwifi: Update 8821ae new phy parameters and its parser."), but
some parameters are missing. Use this commit to update to the novel parameters
that use new format.

Fixes: 84d26fda52e2 ("rtlwifi: Update 8821ae new phy parameters and its parser")
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Tested-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210219052607.7323-1-pkshih@realtek.com
3 years agocw1200: Remove unused function pointer typedef wsm_*
Chen Lin [Tue, 16 Feb 2021 04:30:33 +0000 (12:30 +0800)]
cw1200: Remove unused function pointer typedef wsm_*

Remove the 'wsm_*' typedef as it is not used.

Signed-off-by: Chen Lin <chen.lin5@zte.com.cn>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1613449833-4910-1-git-send-email-chen45464546@163.com
3 years agocw1200: Remove unused function pointer typedef cw1200_wsm_handler
Chen Lin [Tue, 16 Feb 2021 03:41:58 +0000 (11:41 +0800)]
cw1200: Remove unused function pointer typedef cw1200_wsm_handler

Remove the 'cw1200_wsm_handler' typedef as it is not used.

Signed-off-by: Chen Lin <chen.lin5@zte.com.cn>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1613446918-4532-1-git-send-email-chen45464546@163.com
3 years agoMerge tag 'iwlwifi-next-for-kalle-2021-04-12-v2' of git://git.kernel.org/pub/scm...
Kalle Valo [Sat, 17 Apr 2021 08:38:01 +0000 (11:38 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2021-04-12-v2' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

iwlwifi patches for v5.13

* Add support for new FTM FW APIs;
* Some CSA fixes;
* Support for new HW family and other HW detection fixes;
* Robustness improvement in the HW detection code;
* One fix in PMF;
* Some new regulatory features;
* Support for passive scan in 6GHz;
* Some improvements in the sync queue implementation;
* Support for new devices;
* Support for a new FW API command version;
* Some locking fixes;
* Bump the FW API version support for AX devices;
* Some other small fixes, clean-ups and improvements.

# gpg: Signature made Wed 14 Apr 2021 12:33:29 PM EEST using RSA key ID 1A3CC5FA
# gpg: Good signature from "Luciano Roth Coelho (Luca) <luca@coelho.fi>"
# gpg:                 aka "Luciano Roth Coelho (Intel) <luciano.coelho@intel.com>"

3 years agoMerge tag 'mt76-for-kvalo-2021-04-12' of https://github.com/nbd168/wireless
Kalle Valo [Sat, 17 Apr 2021 08:34:43 +0000 (11:34 +0300)]
Merge tag 'mt76-for-kvalo-2021-04-12' of https://github.com/nbd168/wireless

mt76 patches for 5.13

* code cleanup
* mt7915/mt7615 decap offload support
* driver fixes
* mt7613 eeprom support
* MCU code unification
* threaded NAPI support
* new device IDs
* mt7921 device reset support
* rx timestamp support

# gpg: Signature made Tue 13 Apr 2021 12:11:25 AM EEST using DSA key ID 02A76EF5
# gpg: Good signature from "Felix Fietkau <nbd@nbd.name>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 75D1 1A7D 91A7 710F 4900  42EF D77D 141D 02A7 6EF5

3 years agoMerge tag 'linux-can-next-for-5.13-20210414' of git://git.kernel.org/pub/scm/linux...
David S. Miller [Wed, 14 Apr 2021 21:37:02 +0000 (14:37 -0700)]
Merge tag 'linux-can-next-for-5.13-20210414' of git://git./linux/kernel/git/mkl/linux-can-next

Marc Kleine-Budde says:

====================
pull-request: can-next 2021-04-14

this is a pull request of a single patch for net-next/master.

Vincent Mailhol's patch fixes a NULL pointer dereference when handling
error frames in the etas_es58x driver, which has been added in the
previous PR.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/packet: remove data races in fanout operations
Eric Dumazet [Wed, 14 Apr 2021 19:36:44 +0000 (12:36 -0700)]
net/packet: remove data races in fanout operations

af_packet fanout uses RCU rules to ensure f->arr elements
are not dismantled before RCU grace period.

However, it lacks rcu accessors to make sure KCSAN and other tools
wont detect data races. Stupid compilers could also play games.

Fixes: dc99f600698d ("packet: Add fanout support.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: "Gong, Sishuai" <sishuai@purdue.edu>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: bridge: propagate error code and extack from br_mc_disabled_update
Florian Fainelli [Wed, 14 Apr 2021 19:22:57 +0000 (22:22 +0300)]
net: bridge: propagate error code and extack from br_mc_disabled_update

Some Ethernet switches might only be able to support disabling multicast
snooping globally, which is an issue for example when several bridges
span the same physical device and request contradictory settings.

Propagate the return value of br_mc_disabled_update() such that this
limitation is transmitted correctly to user-space.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge tag 'mlx5-updates-2021-04-13' of git://git.kernel.org/pub/scm/linux/kernel...
David S. Miller [Wed, 14 Apr 2021 21:14:03 +0000 (14:14 -0700)]
Merge tag 'mlx5-updates-2021-04-13' of git://git./linux/kernel/git/saeed/linux

Saeed Mahameed says:

====================
mlx5-updates-2021-04-13

mlx5 core and netdev driver updates

1) E-Switch updates from Parav,
  1.1) Devlink parameter to control mlx5 metadata enablement for E-Switch
  1.2) Trivial cleanups for E-Switch code
  1.3) Dynamically allocate vport steering namespaces only when required

2) From Jianbo, Use variably sized data structures for Software steering

3) Several minor cleanups
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: enetc: fetch MAC address from device tree
Michael Walle [Wed, 14 Apr 2021 14:48:14 +0000 (16:48 +0200)]
net: enetc: fetch MAC address from device tree

Normally, the bootloader will already initialize the MAC address
registers of the ENETC and the driver will just use them or generate a
random one, if it is not initialized.

Add a new way to provide the MAC address: via device tree. Besides the
usual 'mac-address' property, there is also the possibility to fetch it
via a NVMEM provider. The sl28 board stores the MAC address in the SPI
NOR flash OTP region. Having this will allow linux to fetch the MAC
address from there without being dependent on the bootloader.

No in-tree boards have the device tree properties set, thus for these,
this is a no-op.

Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agosfc: Remove duplicate argument
Wan Jiabing [Wed, 14 Apr 2021 11:06:45 +0000 (19:06 +0800)]
sfc: Remove duplicate argument

Fix the following coccicheck warning:

./drivers/net/ethernet/sfc/enum.h:80:7-28: duplicated argument to |

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoskbuff: revert "skbuff: remove some unnecessary operation in skb_segment_list()"
Paolo Abeni [Wed, 14 Apr 2021 10:48:48 +0000 (12:48 +0200)]
skbuff: revert "skbuff: remove some unnecessary operation in skb_segment_list()"

the commit 1ddc3229ad3c ("skbuff: remove some unnecessary operation
in skb_segment_list()") introduces an issue very similar to the
one already fixed by commit 53475c5dd856 ("net: fix use-after-free when
UDP GRO with shared fraglist").

If the GSO skb goes though skb_clone() and pskb_expand_head() before
entering skb_segment_list(), the latter  will unshare the frag_list
skbs and will release the old list. With the reverted commit in place,
when skb_segment_list() completes, skb->next points to the just
released list, and later on the kernel will hit UaF.

Note that since commit e0e3070a9bc9 ("udp: properly complete L4 GRO
over UDP tunnel packet") the critical scenario can be reproduced also
receiving UDP over vxlan traffic with:

NIC (NETIF_F_GRO_FRAGLIST enabled) -> vxlan -> UDP sink

Attaching a packet socket to the NIC will cause skb_clone() and the
tunnel decapsulation will call pskb_expand_head().

Fixes: 1ddc3229ad3c ("skbuff: remove some unnecessary operation in skb_segment_list()")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoatm: idt77252: remove unused function
Jiapeng Chong [Wed, 14 Apr 2021 07:13:39 +0000 (15:13 +0800)]
atm: idt77252: remove unused function

Fix the following clang warning:

drivers/atm/idt77252.c:1787:1: warning: unused function
'idt77252_fbq_level' [-Wunused-function].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec...
David S. Miller [Wed, 14 Apr 2021 20:15:12 +0000 (13:15 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/klassert/ipsec-next

Steffen Klassert says:

====================
pull request (net-next): ipsec-next 2021-04-14

Not much this time:

1) Simplification of some variable calculations in esp4 and esp6.
   From Jiapeng Chong and Junlin Yang.

2) Fix a clang Wformat warning in esp6 and ah6.
   From Arnd Bergmann.

Please pull or let me know if there are problems.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agor8169: add support for pause ethtool ops
Heiner Kallweit [Wed, 14 Apr 2021 06:23:15 +0000 (08:23 +0200)]
r8169: add support for pause ethtool ops

This adds support for the [g|s]et_pauseparam ethtool ops. It considers
that the chip doesn't support pause frame use in jumbo mode.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next...
David S. Miller [Wed, 14 Apr 2021 19:59:41 +0000 (12:59 -0700)]
Merge branch '10GbE' of git://git./linux/kernel/git/tnguy/next-queue

Tony Nguyen says:

====================
10GbE Intel Wired LAN Driver Updates 2021-04-13

This series contains updates to ixgbe and ixgbevf driver.

Jostar Yang adds support for BCM54616s PHY for ixgbe.

Chen Lin removes an unused function pointer for ixgbe and ixgbevf.

Bhaskar Chowdhury fixes a typo in ixgbe.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: stmmac: Add support for external trigger timestamping
Tan Tee Min [Wed, 14 Apr 2021 00:16:17 +0000 (08:16 +0800)]
net: stmmac: Add support for external trigger timestamping

The Synopsis MAC controller supports auxiliary snapshot feature that
allows user to store a snapshot of the system time based on an external
event.

This patch add supports to the above mentioned feature. Users will be
able to triggered capturing the time snapshot from user-space using
application such as testptp or any other applications that uses the
PTP_EXTTS_REQUEST ioctl request.

Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Tan Tee Min <tee.min.tan@intel.com>
Co-developed-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Signed-off-by: Wong Vee Khee <vee.khee.wong@linux.intel.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agoMerge branch 'marvell-88x2222-improvements'
David S. Miller [Wed, 14 Apr 2021 19:56:44 +0000 (12:56 -0700)]
Merge branch 'marvell-88x2222-improvements'

Ivan Bornyakov says:

====================
net: phy: marvell-88x2222: a couple of improvements

First, there are some SFP modules that only uses RX_LOS for link
indication. Add check that link is operational before actual read of
line-side status.

Second, it is invalid to set 10G speed without autonegotiation,
according to phy_ethtool_ksettings_set(). Implement switching between
10GBase-R and 1000Base-X/SGMII if autonegotiation can't complete but
there is signal in line.

Changelog:
  v1 -> v2:
    * make checking that link is operational more friendly for
      trancievers without SFP cages.
    * split swapping 1G/10G modes into non-functional and functional
      commits for the sake of easier review.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: phy: marvell-88x2222: swap 1G/10G modes on autoneg
Ivan Bornyakov [Tue, 13 Apr 2021 20:54:52 +0000 (23:54 +0300)]
net: phy: marvell-88x2222: swap 1G/10G modes on autoneg

Setting 10G without autonegotiation is invalid according to
phy_ethtool_ksettings_set(). Thus, we need to set it during
autonegotiation.

If 1G autonegotiation can't complete for quite a time, but there is
signal in line, switch line interface type to 10GBase-R, if supported,
in hope for link to be established.

And vice versa. If 10GBase-R link can't be established for quite a time,
and autonegotiation is enabled, and there is signal in line, switch line
interface type to appropriate 1G mode, i.e. 1000Base-X or SGMII, if
supported.

Signed-off-by: Ivan Bornyakov <i.bornyakov@metrotek.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: phy: marvell-88x2222: move read_status after config_aneg
Ivan Bornyakov [Tue, 13 Apr 2021 20:54:51 +0000 (23:54 +0300)]
net: phy: marvell-88x2222: move read_status after config_aneg

No functional changes, just move read link status routines below
autonegotiation configuration to make future functional changes more
distinct.

Signed-off-by: Ivan Bornyakov <i.bornyakov@metrotek.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet: phy: marvell-88x2222: check that link is operational
Ivan Bornyakov [Tue, 13 Apr 2021 20:54:50 +0000 (23:54 +0300)]
net: phy: marvell-88x2222: check that link is operational

Some SFP modules uses RX_LOS for link indication. In such cases link
will be always up, even without cable connected. RX_LOS changes will
trigger link_up()/link_down() upstream operations. Thus, check that SFP
link is operational before actual read link status.

If there is no SFP cage connected to the tranciever, check only PMD
Recieve Signal Detect register.

Signed-off-by: Ivan Bornyakov <i.bornyakov@metrotek.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
3 years agonet/mlx5e: Fix RQ creation flow for queues which doesn't support XDP
Aya Levin [Wed, 7 Apr 2021 11:09:05 +0000 (14:09 +0300)]
net/mlx5e: Fix RQ creation flow for queues which doesn't support XDP

Allow to create an RQ which is not registered as an XDP RQ. For example:
the trap-RQ doesn't register as an XDP RQ.

Fixes: 869c5f926247 ("net/mlx5e: Generalize open RQ")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: Replace spaces with tab at the start of a line
Wenpeng Liang [Thu, 1 Apr 2021 13:07:43 +0000 (21:07 +0800)]
net/mlx5: Replace spaces with tab at the start of a line

There should be no spaces at the start of the line.

Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: Remove return statement exist at the end of void function
Wenpeng Liang [Thu, 1 Apr 2021 13:07:42 +0000 (21:07 +0800)]
net/mlx5: Remove return statement exist at the end of void function

void function return statements are not generally useful.

Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: Add a blank line after declarations
Wenpeng Liang [Thu, 1 Apr 2021 13:07:41 +0000 (21:07 +0800)]
net/mlx5: Add a blank line after declarations

There should be a blank lines after declarations.

Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com>
Signed-off-by: Weihang Li <liweihang@huawei.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: Fix bit-wise and with zero
Colin Ian King [Tue, 6 Apr 2021 16:53:46 +0000 (17:53 +0100)]
net/mlx5: Fix bit-wise and with zero

The bit-wise and of the action field with MLX5_ACCEL_ESP_ACTION_DECRYPT
is incorrect as MLX5_ACCEL_ESP_ACTION_DECRYPT is zero and not intended
to be a bit-flag. Fix this by using the == operator as was originally
intended.

Addresses-Coverity: ("Logically dead code")
Fixes: 7dfee4b1d79e ("net/mlx5: IPsec, Refactor SA handle creation and destruction")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: DR, Alloc cmd buffer with kvzalloc() instead of kzalloc()
Roi Dayan [Mon, 15 Mar 2021 08:22:51 +0000 (10:22 +0200)]
net/mlx5: DR, Alloc cmd buffer with kvzalloc() instead of kzalloc()

The cmd size is 8K so use kvzalloc().

Signed-off-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: DR, Use variably sized data structures for different actions
Jianbo Liu [Thu, 12 Nov 2020 01:32:52 +0000 (01:32 +0000)]
net/mlx5: DR, Use variably sized data structures for different actions

mlx5dr_action is a generally used data structure, and there is an
union for different types of actions in it. The size of mlx5dr_action
is about 72 bytes, but for those actions with fewer fields, most of
the allocated memory is wasted.
Remove this union, and mlx5dr_action becomes a generic action header.
Then actions are dynamically allocated with needed memory, the data
for each action is stored right after the header.

Signed-off-by: Jianbo Liu <jianbol@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: SF, Reuse stored hardware function id
Parav Pandit [Fri, 5 Mar 2021 05:38:02 +0000 (07:38 +0200)]
net/mlx5: SF, Reuse stored hardware function id

SF's hardware function id is already stored in mlx5_sf. Reuse it,
instead of querying the hw table.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: SF, Use device pointer directly
Parav Pandit [Fri, 5 Mar 2021 08:11:21 +0000 (10:11 +0200)]
net/mlx5: SF, Use device pointer directly

At many places in the code, device pointer is directly available. Make
use of it, instead of accessing it from the table.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: E-Switch, Initialize eswitch acls ns when eswitch is enabled
Parav Pandit [Mon, 1 Mar 2021 12:12:13 +0000 (14:12 +0200)]
net/mlx5: E-Switch, Initialize eswitch acls ns when eswitch is enabled

Currently eswitch flow steering (FS) namespace of vport's ingress and
egress ACL are enabled when FS layer is initialized. This is done even
when eswitch is diabled. This demands that total eswitch ports to be
known to FS layer without eswitch in use.

Given the FS core is not dependent on eswitch, make namespace init and
cleanup routines as helper routines to be invoked only when eswitch is
needed.

With this change, ingress and egress ACL namespaces are created only
when eswitch legacy/offloads mode is enabled.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: E-Switch, Move legacy code to a individual file
Parav Pandit [Fri, 26 Feb 2021 12:30:50 +0000 (14:30 +0200)]
net/mlx5: E-Switch, Move legacy code to a individual file

Currently eswitch offers two modes. Legacy and offloads.
Offloads code is already in its own file eswitch_offloads.c

However eswitch.c contains the eswitch legacy code and common
infrastructure  code.

To enable future extensions and to better manage generic common eswitch
infrastructure code, move the legacy code to its own legacy.c file.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: E-Switch, Convert a macro to a helper routine
Parav Pandit [Fri, 26 Feb 2021 12:36:22 +0000 (14:36 +0200)]
net/mlx5: E-Switch, Convert a macro to a helper routine

Convert ESW_ALLOWED macro to a helper routine so that it can be used in
other eswitch files.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: E-Switch Make cleanup sequence mirror of init
Parav Pandit [Tue, 2 Mar 2021 19:39:01 +0000 (21:39 +0200)]
net/mlx5: E-Switch Make cleanup sequence mirror of init

Make cleanup sequence mirror of init sequence for cleaning up reps
and freeing vports.

Also when reps initialization fails, there is no need to perform reps
cleanup.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: E-Switch, Make vport number u16
Parav Pandit [Tue, 2 Mar 2021 19:27:47 +0000 (21:27 +0200)]
net/mlx5: E-Switch, Make vport number u16

Vport number is 16-bit field in hardware. Make it u16.

Move location of vport in the structure so that it reduces a hole
in the structure.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: E-Switch, Skip querying SF enabled bits
Parav Pandit [Mon, 8 Mar 2021 09:50:40 +0000 (11:50 +0200)]
net/mlx5: E-Switch, Skip querying SF enabled bits

With vhca events, SF state is queried through the VHCA events. Device no
longer expects SF bitmap in the query eswitch functions command.

Hence, remove it to simplify the code.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
3 years agonet/mlx5: E-Switch, let user to enable disable metadata
Parav Pandit [Fri, 30 Oct 2020 20:44:16 +0000 (22:44 +0200)]
net/mlx5: E-Switch, let user to enable disable metadata

Currently each packet inserted in eswitch is tagged with a internal
metadata to indicate source vport. Metadata tagging is not always
needed. Metadata insertion is needed for multi-port RoCE, failover
between representors and stacked devices. In many other cases,
metadata enablement is not needed.

Metadata insertion slows down the packet processing rate of the E-switch
when it is in switchdev mode.

Below table show performance gain with metadata disabled for VXLAN
offload rules in both SMFS and DMFS steering mode on ConnectX-5 device.

----------------------------------------------
| steering | metadata | pkt size | rx pps    |
| mode     |          |          | (million) |
----------------------------------------------
| smfs     | disabled | 128Bytes | 42        |
----------------------------------------------
| smfs     | enabled  | 128Bytes | 36        |
----------------------------------------------
| dmfs     | disabled | 128Bytes | 42        |
----------------------------------------------
| dmfs     | enabled  | 128Bytes | 36        |
----------------------------------------------

Hence, allow user to disable metadata using driver specific devlink
parameter. Metadata setting of the eswitch is applicable only for the
switchdev mode.

Example to show and disable metadata before changing eswitch mode:
$ devlink dev param show pci/0000:06:00.0 name esw_port_metadata
pci/0000:06:00.0:
  name esw_port_metadata type driver-specific
    values:
      cmode runtime value true

$ devlink dev param set pci/0000:06:00.0 \
  name esw_port_metadata value false cmode runtime

$ devlink dev eswitch set pci/0000:06:00.0 mode switchdev

Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Vu Pham <vuhuong@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
changelog:
v1->v2:
 - added performance numbers in commit log
 - updated commit log and documentation for switchdev mode
 - added explicit note on when user can disable metadata in
   documentation

3 years agoiwlwifi: dbg: disable ini debug in 9000 family and below
Mukesh Sisodiya [Sun, 11 Apr 2021 10:25:44 +0000 (13:25 +0300)]
iwlwifi: dbg: disable ini debug in 9000 family and below

Yoyo based debug is not applicable to old devices.  As init debug is
enabled by default in the driver, it needs to be disabled to work the
old debug mechanism in old devices.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Fixes: b0d8d2c27007 ("iwlwifi: yoyo: enable yoyo by default")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411132130.805401a1b8ec.I30db38184a418cfc1c5ca1a305cc14a52501d415@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: Change ma product string name
Matti Gottlieb [Sun, 11 Apr 2021 10:25:43 +0000 (13:25 +0300)]
iwlwifi: pcie: Change ma product string name

Change ma product string name to the correct name,
and to reflect the CRF and not the CNV.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411132130.c05b4c55540f.I8dd0361b033f63658999ba53640949701b048f17@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: fw: print out trigger delay when collecting data
Johannes Berg [Sun, 11 Apr 2021 10:25:42 +0000 (13:25 +0300)]
iwlwifi: fw: print out trigger delay when collecting data

It can be confusing to see "Collecting data: ..." followed by
that not actually happening immediately so print out the delay
in that message.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411132130.5bd095dc579a.Id1f3b746ac61497951638ba7ce70fc4b63dd87d1@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: trans/pcie: defer transport initialisation
Johannes Berg [Sun, 11 Apr 2021 10:25:41 +0000 (13:25 +0300)]
iwlwifi: trans/pcie: defer transport initialisation

In a few PCIe devices we may have to swap out the configuration
after we allocate/initialise some parts of the device because
we only know the correct one after reading some registers. This
causes some things such as the byte-count table allocations to
be incorrect, since the configuration is swapped for one with a
bigger queue size.

Fix this by initialising most of the transport much later, only
after the configuration has finally been determined.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411132130.8f5db97db1e4.Ic622da559b586a04ca536a0ec49ed5ecf03a9354@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: bump FW API to 63 for AX devices
Luca Coelho [Sun, 11 Apr 2021 10:25:40 +0000 (13:25 +0300)]
iwlwifi: bump FW API to 63 for AX devices

Start supporting API version 63 for AX devices.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411132130.a588a9dacd98.Ie4f96b8988c2cbd5f096ee64d0eb0f4829d55aee@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: don't WARN if we can't remove a time event
Emmanuel Grumbach [Sun, 11 Apr 2021 10:25:39 +0000 (13:25 +0300)]
iwlwifi: mvm: don't WARN if we can't remove a time event

It is not very useful to WARN if we can't send a host command
The firmware is likely in a bad situation and the fact that
we didn't send the host command has an impact on the firmware
only, not on the driver. The driver could clean up all its
state.

Don't WARN in this case, but just leave a smaller note.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411132130.0324abc169c8.I4f9b769bc38d68f8ed43f77d2cd75e8f1993e964@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: don't disconnect immediately if we don't hear beacons after CSA
Emmanuel Grumbach [Sun, 11 Apr 2021 10:25:38 +0000 (13:25 +0300)]
iwlwifi: mvm: don't disconnect immediately if we don't hear beacons after CSA

When we switch channel, we may miss a few beacons on the
new channel. Don't disconnect if the time event for the
switch ends before we hear the beacons.

Note that this is relevant only for old devices that still
use the TIME_EVENT firmware API for channel switch.

The check that we hear a beacon before the time event
ends was meant to be used for the association time event
and not for the channel switch time event.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411132130.3d710091a0bd.I37a161ffdfb099a10080fbdc3b70a4deb76952e2@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: rs-fw: don't support stbc for HE 160
Mordechay Goodstein [Sun, 11 Apr 2021 09:46:30 +0000 (12:46 +0300)]
iwlwifi: rs-fw: don't support stbc for HE 160

Our HE doesn't support it so never set HE 160 stbc

Fixes: 3e467b8e4cf4 ("iwlwifi: rs-fw: enable STBC in he correctly")
Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124418.550fd1903eb7.I8ddbc2f87044a5ef78d916c9c59be797811a1b7f@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: warn on SKB free w/o op-mode
Johannes Berg [Sun, 11 Apr 2021 09:46:29 +0000 (12:46 +0300)]
iwlwifi: warn on SKB free w/o op-mode

If this ever happens, and it looks like some code in PCIe is
a bit broken and might lead to this, we want to know without
crashing, so add a WARN_ON_ONCE().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124418.a18b7443dc55.Ia29836738acf14a55af5504aba90c6fea9fff785@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: add support for version 3 of LARI_CONFIG_CHANGE command.
Miri Korenblit [Sun, 11 Apr 2021 09:46:28 +0000 (12:46 +0300)]
iwlwifi: mvm: add support for version 3 of LARI_CONFIG_CHANGE command.

Add support for version 3 of the LARI_CONFIG_CHANGE command.
This is needed to support FW API change which is needed
to support 11ax enablement in Russia.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124418.7e68856c8a95.I83acdbe39b63c363cabc04ad42d1d0b9ce98901c@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: add ISR debug info for msix debug
Mordechay Goodstein [Sun, 11 Apr 2021 09:46:27 +0000 (12:46 +0300)]
iwlwifi: pcie: add ISR debug info for msix debug

The debug prints help in case we get timeout on waiting for
hw.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124417.306e2e56d3e8.I72e2977abbb1fddf23b8476bedf6a183fe969ff5@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: merge napi_poll_msix functions
Mordechay Goodstein [Sun, 11 Apr 2021 09:46:26 +0000 (12:46 +0300)]
iwlwifi: pcie: merge napi_poll_msix functions

The only difference between iwl_pcie_napi_poll_msix_shared() and
iwl_pcie_napi_poll_msix() is when we have a shared queue and nothing
in the rx queue.  This case doesn't affect CPU performance, so we can
merge the two functions.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124417.9d1b61ef53a5.I60b33d5379cf7c12f1de30fc3fd4cefc38220141@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: don't lock mutex in RCU critical section
Johannes Berg [Sun, 11 Apr 2021 09:46:25 +0000 (12:46 +0300)]
iwlwifi: mvm: don't lock mutex in RCU critical section

We cannot lock a mutex while we're in an RCU critical section. At
the same time, we're accessing data structures that are protected
by the mvm->mutex anyway, so just move the entire locking here to
use only that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124417.4d27bd36e10e.I1fd8e8fe442c41a5deaa560452b598ed7a60ada5@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: remove PS from lower rates.
Mordechay Goodstein [Sun, 11 Apr 2021 09:46:24 +0000 (12:46 +0300)]
iwlwifi: mvm: remove PS from lower rates.

Power save (PS) should only be enabled when we reach the max phy rate.
Before we reach it (MCS_9) for VHT, we should keep trying to improve the
throughput.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124417.2a2fb9f9c25e.I7c7bbcfbdc1d35d2c3338778fb397dd5b08ea0e8@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: umac error table mismatch
Roee Goldfiner [Sun, 11 Apr 2021 09:46:23 +0000 (12:46 +0300)]
iwlwifi: mvm: umac error table mismatch

umac_error_table In TLV address was read using mask on MSB
but on the same table in alive message it was without which
caused mismatch in devices with different memory region MSB

Signed-off-by: Roee Goldfiner <roee.h.goldfiner@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124417.179fee442115.Ib6eabe86cfda0b6044f07c07448c366b6e07e53d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: queue: avoid memory leak in reset flow
Mordechay Goodstein [Sun, 11 Apr 2021 09:46:22 +0000 (12:46 +0300)]
iwlwifi: queue: avoid memory leak in reset flow

In case the device is stopped any usage of hw queues needs to be
reallocated in fw due to fw reset after device stop, so all driver
internal queue should also be freed, and if we don't free the next usage
would leak the old memory and get in recover flows
"iwlwifi 0000:00:03.0: dma_pool_destroy iwlwifi:bc" warning.

Also warn about trying to reuse an internal allocated queue.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124417.c72d2f0355c4.Ia3baff633b9b9109f88ab379ef0303aa152c16bf@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: don't warn if we can't wait for empty tx queues
Emmanuel Grumbach [Sun, 11 Apr 2021 09:46:21 +0000 (12:46 +0300)]
iwlwifi: don't warn if we can't wait for empty tx queues

If the firmware is dead, the Tx queues won't drain, but
leaving a print in the log is enough, no need to WARN.
If the firmware is dead, we must already have printed enough
information in the log anyway.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124417.9a438b2320a9.I4aa897178df82acefd80173d76dd6849ad1bcdc1@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: remove remaining software checksum code
Johannes Berg [Sun, 11 Apr 2021 09:46:20 +0000 (12:46 +0300)]
iwlwifi: remove remaining software checksum code

After the removal of the software checksum code for the
A-MSDU path that we had for testing, the csum_skb variable
stuck around. Remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124417.280f268ae679.Iad455b6c91e427c9f74963bbd3eb0ce743aaac53@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: remove TCM events
Emmanuel Grumbach [Sun, 11 Apr 2021 09:46:19 +0000 (12:46 +0300)]
iwlwifi: remove TCM events

Nobody uses that in the user space.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210411124417.b6560a5de0cd.I5dac9c60faed7f48b06d352aa2d65bcf8142c2dc@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Use IWL_INFO in fw_reset_handshake()
Ravi Darsi [Wed, 31 Mar 2021 09:14:52 +0000 (12:14 +0300)]
iwlwifi: mvm: Use IWL_INFO in fw_reset_handshake()

Debug message "firmware didn't ACK the reset - continue anyway\n"
in fw_reset_handshake() is classified as error, however this is not
an error as it is ignored. So, change it to info message for proper
classification of debug messages.

Signed-off-by: Ravi Darsi <ravi.darsi@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.449b3092c330.I515edcc41913ca7fbe4a4de923671d120d5618c6@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: refactor ACPI DSM evaluation function
Harish Mitty [Wed, 31 Mar 2021 09:14:51 +0000 (12:14 +0300)]
iwlwifi: mvm: refactor ACPI DSM evaluation function

Instead of implementing the DSM evaluation function in the MVM code,
refactor it so it can be generalized and part of the common ACPI
implementation.

Signed-off-by: Harish Mitty <harish.mitty@intel.com>
[reworded subject and commit message]
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.a24af3551aac.I8e6bd5eb05f853b6331fa4823750f7ba8ffe46e6@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: support BIOS enable/disable for 11ax in Ukraine
Miri Korenblit [Wed, 31 Mar 2021 09:14:50 +0000 (12:14 +0300)]
iwlwifi: mvm: support BIOS enable/disable for 11ax in Ukraine

Read the new BIOS DSM and Pass to FW if to disable\enable
11ax for Ukraine according to the BIOS key. this is
needed to enable OEMs to control enable/disable 11ax in Ukraine

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.055654e7707e.If7eaf9839cd5d59729a235df07e31668b408e740@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: move iwl_configure_rxq to be used by other op_modes
Mordechay Goodstein [Wed, 31 Mar 2021 09:14:49 +0000 (12:14 +0300)]
iwlwifi: move iwl_configure_rxq to be used by other op_modes

All the op_modes need to send this command as well. Instead of
duplicating the code from mvm, put the code in a common place.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.deb71fce883a.I5eef009512f180e5974f3f491ff56c763cdcc878@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: add new so-gf device
ybaruch [Wed, 31 Mar 2021 09:14:48 +0000 (12:14 +0300)]
iwlwifi: add new so-gf device

add new so-gf device to the driver.

Signed-off-by: ybaruch <yaara.baruch@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.d6b0c1f85a7e.I2098ca066607edc48336021ea2e5afdbf8196acf@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: enable PPAG in China
Miri Korenblit [Wed, 31 Mar 2021 09:14:47 +0000 (12:14 +0300)]
iwlwifi: mvm: enable PPAG in China

Add support for ppag in China by reading revision 2 of the ppag table
from ACPI, and passing the data to the FW.
This is needed to enable OEMs to control ppag enablement
in China.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.69af388d0dce.I8cfddf9e6837bf394b00390181b4b774ded19acd@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: Add support for 6GHz passive scan
Ilan Peer [Wed, 31 Mar 2021 09:14:46 +0000 (12:14 +0300)]
iwlwifi: mvm: Add support for 6GHz passive scan

When doing scan while 6GHz channels are not enabled, the 6GHz band
is not scanned. Thus, if there are no APs on the 2GHz and 5GHz bands
(that will allow discovery of geographic location etc. that would
allow enabling the 6GHz channels) but there are non collocated APs
on 6GHz PSC channels these would never be discovered.

To overcome this, FW added support for performing passive UHB scan
in case no APs were discovered during scan on the 2GHz and 5GHz
channels.

Add support for enabling such scan when the following conditions are
met:

- 6GHz channels are supported but not enabled by regulatory.
- Station interface is not associated or less than a defined time
  interval passed from the last resume or HW reset flows.
- At least 4 channels are included in the scan request
- The scan request includes the widlcard SSID.
- At least 50 minutes passed from the last 6GHz passive scan.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.7c7bd00e0aeb.Ib226ad57e416b43a710c36a78a617d4243458b99@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: add ax201 killer device
ybaruch [Wed, 31 Mar 2021 09:14:44 +0000 (12:14 +0300)]
iwlwifi: add ax201 killer device

add new killer devices configurations.

Signed-off-by: ybaruch <yaara.baruch@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.54967363d26d.I5d1a3d810cf6abace51ebb2630d62d891e9fd302@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: when associated with PMF, use protected NDP ranging negotiation
Avraham Stern [Wed, 31 Mar 2021 09:14:43 +0000 (12:14 +0300)]
iwlwifi: mvm: when associated with PMF, use protected NDP ranging negotiation

When associated to the resonder with PMF, request to protect the NDP
ranging negotiation with PMF.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.e7982c72e12b.Ib6db362d01a31132c638e194d49476cd8e3ff430@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: clean up queue sync implementation
Johannes Berg [Wed, 31 Mar 2021 09:14:42 +0000 (12:14 +0300)]
iwlwifi: mvm: clean up queue sync implementation

When we do queue sync, it's confusing that we have the structures
declared in the FW API header files that aren't really firmware,
and the union is also confusing - especially now in the code that
checks the size on the return.

So rework this: change the type of sync and whether to do it in a
synchronous fashion to arguments, and build the data structure in
the function, so we don't need the union.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.f62833fd9893.I612d7ac1c655ec4880329360e15d207698c750bc@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: write queue_sync_state only for sync
Johannes Berg [Wed, 31 Mar 2021 09:14:41 +0000 (12:14 +0300)]
iwlwifi: mvm: write queue_sync_state only for sync

We use mvm->queue_sync_state to wait for synchronous queue sync
messages, but if an async one happens inbetween we shouldn't
clear mvm->queue_sync_state after sending the async one, that
can run concurrently (at least from the CPU POV) with another
synchronous queue sync.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.d11c9bcdb4aa.I0772171dbaec87433a11513e9586d98b5d920b5f@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: responder: support responder config command version 8
Avraham Stern [Tue, 30 Mar 2021 13:25:00 +0000 (16:25 +0300)]
iwlwifi: mvm: responder: support responder config command version 8

Version 8 add NDP ranging parameters configuration, as well as
enable/disable NDP ranging and LMR feedback.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210330162204.ce9570d755d3.Ic81cb8da9aecbbc9edff468cb4ffbb741418cc73@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: mvm: support range request command version 12
Avraham Stern [Tue, 30 Mar 2021 13:24:59 +0000 (16:24 +0300)]
iwlwifi: mvm: support range request command version 12

Version 12 adds configuration of NDP ranging parameters:
- max number of LTF repetitions
- max number of spatial streams
- max total LTFs

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210330162204.2c30c376c5cf.I01460f7277594ee7c98a8e1fe5447c59e70bf073@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: make cfg vs. trans_cfg more robust
Johannes Berg [Tue, 30 Mar 2021 13:24:58 +0000 (16:24 +0300)]
iwlwifi: pcie: make cfg vs. trans_cfg more robust

If we (for example) have a trans_cfg entry in the PCI IDs table,
but then don't find a full cfg entry for it in the info table,
we fall through to the code that treats the PCI ID table entry
as a full cfg entry. This obviously causes crashes later, e.g.
when trying to build the firmware name string.

Avoid such crashes by using the low bit of the pointer as a tag
for trans_cfg entries (automatically using a macro that checks
the type when assigning) and then checking that before trying to
use the data as a full entry - if it's just a partial entry at
that point, fail.

Since we're adding some macro magic, also check that the type is
in fact either struct iwl_cfg_trans_params or struct iwl_cfg,
failing compilation ("initializer element is not constant") if
it isn't.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210330162204.6f69fe6e4128.I921d4ae20ef5276716baeeeda0b001cf25b9b968@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: pcie: clear only FH bits handle in the interrupt
Mordechay Goodstein [Tue, 30 Mar 2021 13:24:57 +0000 (16:24 +0300)]
iwlwifi: pcie: clear only FH bits handle in the interrupt

For simplicity we assume that msix has 2 IRQ lines one used for rx data
called msix_non_share, and another used for one bit flags messages
(alive, hw error, sw error, rx data flag) called msix_share.

Every time the FW has data to send it puts it on the RX queue and HW
turns on the flags in msix_share (inta_fw) indicating about rx data,
and HW sends an interrupt a bit later to the msix_non_share _unless_
the msix_shared RX data bit was cleared.

Currently in the code every time we get an msix_shared we clear all bits
including rx data queue bits.

So we can have a race

----------------------------------------------------
DRIVER        |   HW                |   FW
----------------------------------------------------
- send host cmd to FW  |      |
       |      | - handle message
       |      |   and put a response
       |      |   on the RX queue
       | - RX flag on        |
       |            | - send alive msix
       | - alive flag on     |
       | - interrupt         |
       |   msix_share driver |
- handle msix_shared   |      |
  and clear all flags  |      |
  bits        |      |
       | - don't send an     |
       |   interrupt on      |
       |   msix_non_shared   |
       |   (driver cleared)  |
- driver timeout on    |      |
  waiting for host cmd |      |
  respond        |      |
       |      |
----------------------------------------------------

The change is to clear only the msi_shared flags that are handled in
the msix_shared flow, which will cause the hardware to send an interrupt
on the msix_non_share line as well, when it has data.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210330162204.a1cdda2fa270.I02a82312679f4541f30bb8db8747a797dbb70ee7@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
3 years agoiwlwifi: add 160Mhz to killer 1550 name
ybaruch [Tue, 30 Mar 2021 13:24:56 +0000 (16:24 +0300)]
iwlwifi: add 160Mhz to killer 1550 name

change the name of 1550 killer device to 160Mhz.

Signed-off-by: ybaruch <yaara.baruch@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210330162204.b87618a26ff8.Icf1d9c150ec108f30ce0e72c18b9350da6ae5087@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>