Colin Ian King [Sun, 26 Jan 2020 00:09:54 +0000 (00:09 +0000)]
iwlegacy: ensure loop counter addr does not wrap and cause an infinite loop
The loop counter addr is a u16 where as the upper limit of the loop
is an int. In the unlikely event that the il->cfg->eeprom_size is
greater than 64K then we end up with an infinite loop since addr will
wrap around an never reach upper loop limit. Fix this by making addr
an int.
Addresses-Coverity: ("Infinite loop")
Fixes: be663ab67077 ("iwlwifi: split the drivers for agn and legacy devices 3945/4965")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Colin Ian King [Wed, 22 Jan 2020 09:33:40 +0000 (09:33 +0000)]
rtlwifi: btcoex: fix spelling mistake "initilized" -> "initialized"
There is a spelling mistake in one of the fields in the btc_coexist struct,
fix it.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
YueHaibing [Tue, 21 Jan 2020 03:04:28 +0000 (11:04 +0800)]
rtlwifi: rtl8723ae: remove unused variables
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/dm.c:16:18:
warning: ofdmswing_table defined but not used [-Wunused-const-variable=]
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/dm.c:56:17:
warning: cckswing_table_ch1ch13 defined but not used [-Wunused-const-variable=]
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/dm.c:92:17:
warning: cckswing_table_ch14 defined but not used [-Wunused-const-variable=]
These variable is never used, so remove them.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
YueHaibing [Tue, 21 Jan 2020 02:19:24 +0000 (10:19 +0800)]
rtlwifi: rtl8192ee: remove unused variables
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/dm.c:15:18:
warning: ofdmswing_table defined but not used [-Wunused-const-variable=]
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/dm.c:61:17:
warning: cckswing_table_ch1ch13 defined but not used [-Wunused-const-variable=]
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/dm.c:97:17:
warning: cckswing_table_ch14 defined but not used [-Wunused-const-variable=]
These variable is never used, so remove them.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
YueHaibing [Tue, 21 Jan 2020 02:09:58 +0000 (10:09 +0800)]
rtlwifi: rtl8821ae: remove unused variables
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c:142:17:
warning: cckswing_table_ch1ch13 defined but not used [-Wunused-const-variable=]
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c:178:17:
warning: cckswing_table_ch14 defined but not used [-Wunused-const-variable=]
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c:96:18:
warning: ofdmswing_table defined but not used [-Wunused-const-variable=]
These variable is never used, so remove them.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Colin Ian King [Tue, 14 Jan 2020 16:56:01 +0000 (16:56 +0000)]
rtlwifi: rtl8188ee: remove redundant assignment to variable cond
Variable cond is being assigned with a value that is never
read, it is assigned a new value later on. The assignment is
redundant and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Mikhail Karpenko [Thu, 9 Jan 2020 13:17:55 +0000 (16:17 +0300)]
qtnfmac: add support for TWT responder and spatial reuse
Add support for 11ax features: TWT responder and spatial reuse.
Add separate structure for spatial reuse parameters and pass this
structure to firmware along with other parameters in start_ap
command. Pass TWT responder value to firmware. Bump qlink
protocol version.
Signed-off-by: Mikhail Karpenko <mkarpenko@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Sergey Matyukevich [Thu, 9 Jan 2020 13:17:54 +0000 (16:17 +0300)]
qtnfmac: add support for STA HE rates
Add HE rates into STA info. Report HE Rx/Tx MCS if STA supports them.
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Sergey Matyukevich [Thu, 9 Jan 2020 13:17:53 +0000 (16:17 +0300)]
qtnfmac: control qtnfmac wireless interfaces bridging
Bridging qtnfmac interfaces is possible only if the following two
conditions are fulfilled:
- firmware advertises proper support with QLINK_HW_CAPAB_HW_BRIDGE
- kernel is built with CONFIG_NET_SWITCHDEV support
Otherwise adding qtnfmac wireless interfaces into the same bridge
should not be allowed since packets flooded by kernel may break
internal forwarding rules between interfaces.
This patch disables adding qtnfmac wireless interfaces into the
same bridge if no support is provided either by card or by kernel.
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Sergey Matyukevich [Thu, 9 Jan 2020 13:17:52 +0000 (16:17 +0300)]
qtnfmac: add module param to configure DFS offload
Firmware may support DFS offload. However the final decision on whether
to use it or not should be up to the user. So even if firmware supports
DFS offload, it should be enabled only if user explicitly requests it.
For this purpose introduce kernel param dfs_offload which is disabled
by default.
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Sergey Matyukevich [Thu, 9 Jan 2020 13:17:51 +0000 (16:17 +0300)]
qtnfmac: cleanup slave_radar access function
Currently this parameter is global, it is not specific to mac.
So this function does not need any input parameters.
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
yuehaibing [Wed, 8 Jan 2020 13:57:48 +0000 (21:57 +0800)]
brcmfmac: Remove always false 'idx < 0' statement
idx is declared as u32, it will never less than 0.
Signed-off-by: yuehaibing <yuehaibing@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Yan-Hsuan Chuang [Tue, 7 Jan 2020 14:27:29 +0000 (22:27 +0800)]
rtw88: use shorter delay time to poll PS state
When TX packet arrives, driver should leave deep PS state to make
sure the DMA is working. After requested to leave deep PS state,
driver needs to poll the PS state to check if the mode has been
changed successfully. The driver used to check the state of the
hardware every 20 msecs, which means upon the first failure of
state check, the CPU is delayed 20 msecs for next check. This is
harmful for some time-sensitive applications such as media players.
So, use shorter delay time each check from 20 msecs to 100 usecs.
The state should be changed in several tries. But we still need
to reserve ~15 msecs in total in case of the state just took too
long to be changed successfully. If the states of driver and the
hardware is not synchronized, the power state could be locked
forever, which mean we could never enter/leave the PS state.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Yan-Hsuan Chuang [Tue, 7 Jan 2020 08:08:07 +0000 (16:08 +0800)]
rtw88: fix potential NULL skb access in TX ISR
Sometimes the TX queue may be empty and we could possible
dequeue a NULL pointer, crash the kernel. If the skb is NULL
then there is nothing to do, just leave the ISR.
And the TX queue should not be empty here, so print an error
to see if there is anything wrong for DMA ring.
Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver")
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Rafał Miłecki [Thu, 26 Dec 2019 13:30:50 +0000 (14:30 +0100)]
brcmfmac: add initial support for monitor mode
Report monitor interface availability using cfg80211 and support it in
the add_virtual_intf() and del_virtual_intf() callbacks. This new
feature is conditional and depends on firmware flagging monitor packets.
Receiving monitor frames is already handled by the brcmf_netif_mon_rx().
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Rafał Miłecki [Thu, 26 Dec 2019 13:30:49 +0000 (14:30 +0100)]
brcmfmac: simplify building interface combinations
Move similar/duplicated code out of combination specific code blocks.
This simplifies code a bit and allows adding more combinations later.
A list of combinations remains unchanged.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Jean-Philippe Brucker [Thu, 26 Dec 2019 09:20:33 +0000 (10:20 +0100)]
brcmfmac: sdio: Fix OOB interrupt initialization on brcm43362
Commit
262f2b53f679 ("brcmfmac: call brcmf_attach() just before calling
brcmf_bus_started()") changed the initialization order of the brcmfmac
SDIO driver. Unfortunately since brcmf_sdiod_intr_register() is now
called before the sdiodev->bus_if initialization, it reads the wrong
chip ID and fails to initialize the GPIO on brcm43362. Thus the chip
cannot send interrupts and fails to probe:
[ 12.517023] brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout
[ 12.531214] ieee80211 phy0: brcmf_bus_started: failed: -110
[ 12.536976] ieee80211 phy0: brcmf_attach: dongle is not responding: err=-110
[ 12.566467] brcmfmac: brcmf_sdio_firmware_callback: brcmf_attach failed
Initialize the bus interface earlier to ensure that
brcmf_sdiod_intr_register() properly sets up the OOB interrupt.
BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908438
Fixes: 262f2b53f679 ("brcmfmac: call brcmf_attach() just before calling brcmf_bus_started()")
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
zhengbin [Tue, 24 Dec 2019 14:16:06 +0000 (22:16 +0800)]
brcmfmac: use true,false for bool variable
Fixes coccicheck warning:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c:911:2-24: WARNING: Assignment of 0/1 to bool variable
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
zhengbin [Tue, 24 Dec 2019 14:16:02 +0000 (22:16 +0800)]
cw1200: use true,false for bool variable
Fixes coccicheck warning:
drivers/net/wireless/st/cw1200/txrx.c:718:6-16: WARNING: Assignment of 0/1 to bool variable
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
zhengbin [Tue, 24 Dec 2019 14:16:01 +0000 (22:16 +0800)]
rtw88: use true,false for bool variable
Fixes coccicheck warning:
drivers/net/wireless/realtek/rtw88/phy.c:1437:1-24: WARNING: Assignment of 0/1 to bool variable
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amadeusz Sławiński [Mon, 23 Dec 2019 12:37:15 +0000 (13:37 +0100)]
rtlwifi: rtl8821ae: Make functions static & rm sw.h
Some of functions which were exposed in sw.h, are only used in sw.c, so
just make them static. This makes sw.h unnecessary, so remove it.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amadeusz Sławiński [Mon, 23 Dec 2019 12:37:14 +0000 (13:37 +0100)]
rtlwifi: rtl8723be: Make functions static & rm sw.h
Some of functions which were exposed in sw.h, are only used in sw.c, so
just make them static. This makes sw.h unnecessary, so remove it.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amadeusz Sławiński [Mon, 23 Dec 2019 12:37:13 +0000 (13:37 +0100)]
rtlwifi: rtl8723ae: Make functions static & rm sw.h
Some of functions which were exposed in sw.h, are only used in sw.c, so
just make them static. This makes sw.h unnecessary, so remove it.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amadeusz Sławiński [Mon, 23 Dec 2019 12:37:12 +0000 (13:37 +0100)]
rtlwifi: rtl8192se: Remove sw.h header
It has one define, which is already defined in include from reg.h.
All the declared functions are not implemented anywhere, sw.c has
ones with similar names which are already static.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amadeusz Sławiński [Mon, 23 Dec 2019 12:37:11 +0000 (13:37 +0100)]
rtlwifi: rtl8192ee: Make functions static & rm sw.h
Some of functions which were exposed in sw.h, are only used in sw.c, so
just make them static. This makes sw.h unnecessary, so remove it.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amadeusz Sławiński [Mon, 23 Dec 2019 12:37:10 +0000 (13:37 +0100)]
rtlwifi: rtl8192cu: Remove sw.h header
It has one define, which is already defined in include from reg.h.
All functions are declared in their own headers and included in *.c
files belonging to them.
This makes sw.h unnecessary, so we can remove it.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amadeusz Sławiński [Mon, 23 Dec 2019 12:37:09 +0000 (13:37 +0100)]
rtlwifi: rtl8192ce: Make functions static & rm sw.h
Some of functions which were exposed in sw.h, are only used in sw.c, so
just make them static. The rtl92c_init_var_map function is not defined
anywhere, while declared in sw.h. Two other functions are also declared
in phy.h (which is included in sw.c) and their definitions are in phy.c
Overall sw.h is unnecessary and can be removed.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amadeusz Sławiński [Mon, 23 Dec 2019 12:37:08 +0000 (13:37 +0100)]
rtlwifi: rtl8188ee: Make functions static & rm sw.h
Some of functions which were exposed in sw.h, are only used in sw.c, so
just make them static. This makes sw.h unnecessary, so remove it.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amadeusz Sławiński [Mon, 23 Dec 2019 12:37:07 +0000 (13:37 +0100)]
rtlwifi: rtl8192cu: Fix typo
Replace USB_VENDER_ID_REALTEK with USB_VENDOR_ID_REALTEK.
Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Zong-Zhe Yang [Fri, 20 Dec 2019 09:21:56 +0000 (17:21 +0800)]
rtw88: change max_num_of_tx_queue() definition to inline in pci.h
It's more reasonable to define max_num_of_tx_queue() as an inline function.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Yan-Hsuan Chuang [Fri, 20 Dec 2019 09:21:55 +0000 (17:21 +0800)]
rtw88: assign NULL to skb after being kfree()'ed
Should assign NULL to skb after kfree(), in case of driver
trying to free the same skb again.
This could happen if driver failed to allocate an skb when
building reserved page.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Chin-Yen Lee [Fri, 20 Dec 2019 09:21:54 +0000 (17:21 +0800)]
rtw88: use rtw_hci_stop() instead of rtwdev->hci.ops->stop()
Fix typo, should use rtw_hci_stop()
Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Yan-Hsuan Chuang [Fri, 20 Dec 2019 09:21:53 +0000 (17:21 +0800)]
rtw88: remove unused vif pointer in struct rtw_vif
As driver can easily get vif with container_of(), we can
just remove it.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Yan-Hsuan Chuang [Fri, 20 Dec 2019 09:21:52 +0000 (17:21 +0800)]
rtw88: remove unused variable 'in_lps'
Unused, will not be used neither, because the hardware/firmware
can only support one vif for LPS currnetly. If there's more than
one vif, than driver will never enter LPS. So remove it.
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Tzu-En Huang [Fri, 20 Dec 2019 09:21:51 +0000 (17:21 +0800)]
rtw88: remove unused spinlock
dm_lock is never used. Thus, remove this redundant spinlock.
Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Tzu-En Huang [Fri, 20 Dec 2019 09:21:49 +0000 (17:21 +0800)]
rtw88: 8822c: update power sequence to v15
Update card enable power sequence flow, to fix CMD11 fail after
reboot and wrong PLL clock.
Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Ping-Ke Shih [Fri, 20 Dec 2019 09:21:47 +0000 (17:21 +0800)]
rtw88: fix TX secondary channel offset of 40M if current bw is 20M or 40M
TX secondary channel offset is valid only if current bandwidth is 80M,
otherwise leave this value as zero. The wrong value of txsc40 causes
MAC unpredictable behavior.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Ping-Ke Shih [Fri, 20 Dec 2019 09:21:46 +0000 (17:21 +0800)]
rtw88: fix rate mask for 1SS chip
The rate mask is used to tell firmware the supported rate depends on
negotiation. We loop 2 times for all VHT/HT 2SS rate mask first, and then
only keep the part according to chip's NSS.
This commit fixes the logic error of '&' operations for VHT/HT rate, and
we should run this logic before adding legacy rate.
To access HT MCS map, index 0/1 represent MCS 0-7/8-15 respectively. Use
NL80211_BAND_xxx is incorrect, so fix it as well.
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Chin-Yen Lee [Thu, 19 Dec 2019 08:58:16 +0000 (16:58 +0800)]
rtw88: Add wowlan net-detect support
Net-detect is an option of wowlan to allow the device to
be woken up from suspend mode when configured network is detected.
When user enables net-detect and lets the device enter suspend
state, wowlan firmware will periodically scan until beacon or
probe response of configured networks are received.
Between two scans, wowlan firmware keeps wifi chip in idle mode
to reduce power consumption. If configured networks are detected,
wowlan firmware will trigger resume process.
Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Chin-Yen Lee [Thu, 19 Dec 2019 08:58:15 +0000 (16:58 +0800)]
rtw88: Add wowlan pattern match support
Pattern match is an option of wowlan to allow the device
to be woken up from suspend mode when receiving packets
matched user-designed patterns.
The patterns are written into hardware cam in suspend flow
if users have set up them. If packets matched designed
pattern are received, wowlan firmware will get an interrupt
and then wake up the device.
Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Chin-Yen Lee [Thu, 19 Dec 2019 08:58:14 +0000 (16:58 +0800)]
rtw88: support wowlan feature for 8822c
Wake on WLAN(wowlan) is a feature which allows devices
to be woken up from suspend state through wlan events.
When user enables wowlan feature and then let the device
enter suspend state, wowlan firmware will be loaded by
the driver and periodically monitors wifi packets.
Power consumption of wifi chip will be reduced in this
state.
If wowlan firmware detects that specific wlan event
happens, it will issue wakeup signal to trigger resume
process. Driver will load normal firmware and let wifi
chip return to the original state.
Currently supported wlan events include receiving magic packet,
rekey packet and deauth packet, and disconnecting from AP.
Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Chin-Yen Lee [Thu, 19 Dec 2019 08:58:13 +0000 (16:58 +0800)]
rtw88: load wowlan firmware if wowlan is supported
Driver used to download normal firmware only,
but some devices support wowlan and require to
download wowlan firmware when system suspends.
So modify rtw_load_firmware() and its callback to
allow driver to download both normal and wowlan firmware.
Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Yan-Hsuan Chuang [Thu, 19 Dec 2019 08:58:12 +0000 (16:58 +0800)]
rtw88: add interface config for 8822c
Some devices need to configure interface/HCI related reigsters
in power on flow. Add interface_cfg for HCI for the settings.
The driver only supports RTL8822BE/RTL8822CE now, and since
RTL8822BE does not need to configure PCIE, the configuration
is only added for RTL8822CE. Without it, some of the RTL8822CE
device can crash and disconnected to host in suspend/wowlan mode.
Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Chin-Yen Lee [Thu, 19 Dec 2019 08:58:11 +0000 (16:58 +0800)]
rtw88: pci: reset dma when reset pci trx ring
When PCI trx rings are reset, the DMA engine should also be reset.
Otherswise, the rx_tag of rx flow is not synchronous to hw.
Remove DMA reset when rtw_pci_start() as we added it in
rtw_pci_setup().
Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Chin-Yen Lee [Thu, 19 Dec 2019 08:58:10 +0000 (16:58 +0800)]
rtw88: pci: reset ring index when release skbs in tx ring
When skbs queued for each TX ring are relased in PCI stop flow,
the ring index should be reset at the same time.
Signed-off-by: Chin-Yen Lee <timlee@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Nathan Chancellor [Wed, 18 Dec 2019 01:15:46 +0000 (18:15 -0700)]
hostap: Adjust indentation in prism2_hostapd_add_sta
Clang warns:
../drivers/net/wireless/intersil/hostap/hostap_ap.c:2511:3: warning:
misleading indentation; statement is not part of the previous 'if'
[-Wmisleading-indentation]
if (sta->tx_supp_rates & WLAN_RATE_5M5)
^
../drivers/net/wireless/intersil/hostap/hostap_ap.c:2509:2: note:
previous statement is here
if (sta->tx_supp_rates & WLAN_RATE_2M)
^
1 warning generated.
This warning occurs because there is a space before the tab on this
line. Remove it so that the indentation is consistent with the Linux
kernel coding style and clang no longer warns.
Fixes: ff1d2767d5a4 ("Add HostAP wireless driver.")
Link: https://github.com/ClangBuiltLinux/linux/issues/813
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Maital Hahn [Thu, 16 Jan 2020 14:33:53 +0000 (08:33 -0600)]
wlcore: mesh: Add support for RX Broadcast Key
In order to support authentication of equals peers,
need to save RX Broadcast key per peer (on top of 1 TX broadcast key
and unicast key per peer).
Signed-off-by: Maital Hahn <maitalm@ti.com>
Acked-by: Guy Mishol <guym@ti.com>
Signed-off-by: Hari Nagalla <hnagalla@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Ganapathi Bhat [Mon, 13 Jan 2020 10:42:46 +0000 (10:42 +0000)]
MAINTAINERS: update for mwifiex driver maintainers
Remove Nishant Sarmukadam from Maintainer list, as he is no
longer working in NXP.
Signed-off-by: Ganapathi Bhat <ganapathi.bhat@nxp.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Brian Norris [Fri, 6 Dec 2019 19:45:35 +0000 (11:45 -0800)]
mwifiex: drop most magic numbers from mwifiex_process_tdls_action_frame()
Before commit
1e58252e334d ("mwifiex: Fix heap overflow in
mmwifiex_process_tdls_action_frame()"),
mwifiex_process_tdls_action_frame() already had too many magic numbers.
But this commit just added a ton more, in the name of checking for
buffer overflows. That seems like a really bad idea.
Let's make these magic numbers a little less magic, by
(a) factoring out 'pos[1]' as 'ie_len'
(b) using 'sizeof' on the appropriate source or destination fields where
possible, instead of bare numbers
(c) dropping redundant checks, per below.
Regarding redundant checks: the beginning of the loop has this:
if (pos + 2 + pos[1] > end)
break;
but then individual 'case's include stuff like this:
if (pos > end - 3)
return;
if (pos[1] != 1)
return;
Note that the second 'return' (validating the length, pos[1]) combined
with the above condition (ensuring 'pos + 2 + length' doesn't exceed
'end'), makes the first 'return' (whose 'if' can be reworded as 'pos >
end - pos[1] - 2') redundant. Rather than unwind the magic numbers
there, just drop those conditions.
Fixes: 1e58252e334d ("mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame()")
Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Kalle Valo [Sun, 26 Jan 2020 10:10:02 +0000 (12:10 +0200)]
Merge tag 'iwlwifi-next-for-kalle-2020-01-11' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next
First set of patches intended for v5.6
* Support new versions of the FTM FW APIs;
* Fix an old bug in D3 (WoWLAN);
* A couple of fixes/improvements in the receive-buffers code;
* Fix in the debugging where we were skipping one TXQ;
* Support new version of the beacon template FW API;
* Print some extra information when the driver is loaded;
* Some debugging infrastructure (aka. yoyo) updates;
* Support for a new HW version;
* Second phase of device configuration work started;
* Some clean-ups;
Geert Uytterhoeven [Sun, 12 Jan 2020 16:33:54 +0000 (17:33 +0100)]
net: amd: a2065: Use print_hex_dump_debug() helper
Use the print_hex_dump_debug() helper, instead of open-coding the same
operations.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Geert Uytterhoeven [Sun, 12 Jan 2020 16:32:11 +0000 (17:32 +0100)]
net: amd: a2065: Kill Sun LANCE relics
Remove unused fields, copied from the Sun LANCE driver eons ago.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Jakub Kicinski [Sun, 12 Jan 2020 21:05:14 +0000 (13:05 -0800)]
Merge branch 'IXP4xx-networking-cleanups'
Linus Walleij says:
====================
IXP4xx networking cleanups
This is a patch series which jams together Arnds and mine
cleanups for the IXP4xx networking.
I also have patches for device tree support but that
requires more elaborate work, this series is some of
mine and some of Arnds patches that is a good foundation
for his multiplatform work and my device tree work.
These are for application to the networking tree so
that can be taken in one separate sweep.
I have tested the patches for a bit using zeroday builds
and some boots on misc IXP4xx devices and haven't run
into any major problems. We might find some new stuff
as a result from the new compiler coverage.
I had to depromote enabling compiler coverage at one
point in the v2 set because it depended on other patches
making the code more generic.
The change in v3 was simply dropping one offending
patch hardcoding base addresses into the driver.
The change in v4 drops a stable@ tag that was
unnecessary.
This v5 is a rebase of the v4 patch set on top of
net-next.
====================
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Linus Walleij [Sun, 12 Jan 2020 12:04:50 +0000 (13:04 +0100)]
net: ethernet: ixp4xx: Use parent dev for DMA pool
Use the netdevice struct device .parent field when calling
dma_pool_create(): the .dma_coherent_mask and .dma_mask
pertains to the bus device on the hardware (platform)
bus in this case, not the struct device inside the network
device. This makes the pool allocation work.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Linus Walleij [Sun, 12 Jan 2020 12:04:49 +0000 (13:04 +0100)]
ARM/net: ixp4xx: Pass ethernet physical base as resource
In order to probe this ethernet interface from the device tree
all physical MMIO regions must be passed as resources. Begin
this rewrite by first passing the port base address as a
resource for all platforms using this driver, remap it in
the driver and avoid using any reference of the statically
mapped virtual address in the driver.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Linus Walleij [Sun, 12 Jan 2020 12:04:48 +0000 (13:04 +0100)]
net: ehernet: ixp4xx: Use netdev_* messages
Simplify and correct a bunch of messages using printk
directly to use the netdev_* macros. I have not changed
all of them, just the low-hanging fruit.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Linus Walleij [Sun, 12 Jan 2020 12:04:47 +0000 (13:04 +0100)]
net: ethernet: ixp4xx: Use distinct local variable
Use "ndev" for the struct net_device and "dev" for the
struct device in probe() and remove(). Add the local
"dev" pointer for later use in refactoring.
Take this opportunity to fix inverse christmas tree
coding style.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Linus Walleij [Sun, 12 Jan 2020 12:04:46 +0000 (13:04 +0100)]
net: ethernet: ixp4xx: Standard module init
The IXP4xx driver was initializing the MDIO bus before even
probing, in the callbacks supposed to be used for setting up
the module itself, and with the side effect of trying to
register the MDIO bus as soon as this module was loaded or
compiled into the kernel whether the device was discovered
or not.
This does not work with multiplatform environments.
To get rid of this: set up the MDIO bus from the probe()
callback and remove it in the remove() callback. Rename
the probe() and remove() calls to reflect the most common
conventions.
Since there is a bit of checking for the ethernet feature
to be present in the MDIO registering function, making the
whole module not even be registered if we can't find an
MDIO bus, we need something similar: register the MDIO
bus when the corresponding ethernet is probed, and
return -EPROBE_DEFER on the other interfaces until this
happens. If no MDIO bus is present on any of the
registered interfaces we will eventually bail out.
None of the platforms I've seen has e.g. MDIO on EthB
and only uses EthC, there is always a Ethernet hardware
on the NPE (B, C) that has the MDIO bus, we just might
have to wait for it.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Arnd Bergmann [Sun, 12 Jan 2020 12:04:45 +0000 (13:04 +0100)]
ixp4xx_eth: move platform_data definition
The platform data is needed to compile the driver as standalone,
so move it to a global location along with similar files.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Arnd Bergmann [Sun, 12 Jan 2020 12:04:44 +0000 (13:04 +0100)]
ptp: ixp46x: move adjacent to ethernet driver
The ixp46x ptp driver has a somewhat unusual setup, where the ptp
driver and the ethernet driver are in different directories but
access the same registers that are defined a platform specific
header file.
Moving everything into drivers/net/ makes it look more like most
other ptp drivers and allows compile-testing this driver on
other targets.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Arnd Bergmann [Sun, 12 Jan 2020 12:04:43 +0000 (13:04 +0100)]
wan: ixp4xx_hss: prepare compile testing
The ixp4xx_hss driver needs the platform data definition and the
system clock rate to be compiled. Move both into a new platform_data
header file.
This is a prerequisite for compile testing, but turning on compile
testing requires further patches to isolate the SoC headers.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Arnd Bergmann [Sun, 12 Jan 2020 12:04:42 +0000 (13:04 +0100)]
wan: ixp4xx_hss: fix compile-testing on 64-bit
Change the driver to use portable integer types to avoid
warnings during compile testing:
drivers/net/wan/ixp4xx_hss.c:863:21: error: cast to 'u32 *' (aka 'unsigned int *') from smaller integer type 'int' [-Werror,-Wint-to-pointer-cast]
memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4);
^
drivers/net/wan/ixp4xx_hss.c:979:12: error: incompatible pointer types passing 'u32 *' (aka 'unsigned int *') to parameter of type 'dma_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
&port->desc_tab_phys)))
^~~~~~~~~~~~~~~~~~~~
include/linux/dmapool.h:27:20: note: passing argument to parameter 'handle' here
dma_addr_t *handle);
^
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Jonathan Lemon [Thu, 9 Jan 2020 19:23:17 +0000 (11:23 -0800)]
mlx4: Bump up MAX_MSIX from 64 to 128
On modern hardware with a large number of cpus and using XDP,
the current MSIX limit is insufficient. Bump the limit in
order to allow more queues.
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Reviewed-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
David S. Miller [Sat, 11 Jan 2020 22:52:56 +0000 (14:52 -0800)]
Merge branch 'hns3-next'
Huazhong Tan says:
====================
net: hns3: add some misc update about reset issue
This series includes some misc update relating to reset issue.
[patch 1/7] & [patch 2/7] splits hclge_reset()/hclgevf_reset()
into two parts: preparing and rebuilding. Since the procedure
of FLR should be separated out from the reset task([patch 3/7 &
patch 3/7]), then the FLR's processing can reuse these codes.
pci_error_handlers.reset_prepare() is void type function, so
[patch 6/7] & [patch 7/7] factor some codes related to PF
function reset to make the preparing done before .reset_prepare()
return.
BTW, [patch 5/7] enlarges the waiting time of reset for matching
the hardware's.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Huazhong Tan [Sat, 11 Jan 2020 08:33:53 +0000 (16:33 +0800)]
net: hns3: refactor the notification scheme of PF reset
hclge_reset_prepare_down() is only used to inform VF that PF is
going to do function reset, then using hclge_func_reset_sync_vf()
in hclge_reset_prepare_wait() to query whether VF is ready before
asserting PF function reset. To make the code more readable,
this patch uses a new function hclge_function_reset_notify_vf()
to do this job.
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Huazhong Tan [Sat, 11 Jan 2020 08:33:52 +0000 (16:33 +0800)]
net: hns3: modify hclge_func_reset_sync_vf()'s return type to void
When synchronizes with VFs fail before PF function reset,
PF driver should go on its function reset, otherwise it
can not run normally anymore. So, hclge_func_reset_sync_vf()
should not affect the processing of PF reset, this patch
modifies its return type to void.
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Huazhong Tan [Sat, 11 Jan 2020 08:33:51 +0000 (16:33 +0800)]
net: hns3: enlarge HCLGE_RESET_WAIT_CNT
When the load of firmware is high, its reset task may takes
more time(which will be as long as 35 seconds). So this
patch modifies HCLGE_RESET_WAIT_CNT to match the firmware's.
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Huazhong Tan [Sat, 11 Jan 2020 08:33:50 +0000 (16:33 +0800)]
net: hns3: refactor the procedure of VF FLR
Currently, the actual work of VF FLR is handled in the reset task,
which is asynchronous. So in some case, if the preparing and
rebuilding are not done, then the VF FLR will trigger some problems,
for example, makes hardware go into chaos.
So this patch separates the process of VF FLR from reset task, and
adds a semaphore to serialize this reset and others.
When FLR's preparing fails, if there has other higher level reset
pending or failing times less than the HCLGE_FLR_RETRY_CNT, this
preparing should be retried, otherwise it will get into a wrong state.
BTW, while the hardware reports misc interrupt during pcie_flr(),
the driver can not receive this interrupt anymore, so disable it
when hclgevf_flr_prepare() return, and re-enable it when enter
hclgevf_flr_done().
Avoid declaring internal function hclgevf_enable_vector(), this patch
also moves its definition forward, and removes unused enum
hnae3_flr_state.
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Huazhong Tan [Sat, 11 Jan 2020 08:33:49 +0000 (16:33 +0800)]
net: hns3: refactor the precedure of PF FLR
Currently, the actual work of PF FLR is handled in the reset task,
which is asynchronous. So in some case, if the preparing and
rebuilding are not done, then the PF FLR will trigger some problems,
for example, makes hardware go into chaos.
So this patch separates the process of PF FLR from reset task, and
adds a semaphore to serialize this reset and others.
When FLR's preparing fails, if there has other higher level reset
pending or failing times less than the HCLGE_FLR_RETRY_CNT, this
preparing should be retried, otherwise PF and its VF may get into
wrong state.
BTW, while the hardware reports misc interrupt during pcie_flr(),
the driver can not receive this interrupt anymore, so disable it
when hclge_flr_prepare() return, and re-enable it when enter
hclge_flr_done().
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Huazhong Tan [Sat, 11 Jan 2020 08:33:48 +0000 (16:33 +0800)]
net: hns3: split hclgevf_reset() into preparing and rebuilding part
hclgevf_reset() is a little bloated, and the process of VF FLR will
be separated from the reset task later. So this patch splits
hclgevf_reset() into hclgevf_reset_prepare() and hclge_reset_rebuild(),
then FLR can also reuse these two functions. Also moves HNAE3_UP_CLIENT
into hclgevf_reset_stack().
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Huazhong Tan [Sat, 11 Jan 2020 08:33:47 +0000 (16:33 +0800)]
net: hns3: split hclge_reset() into preparing and rebuilding part
hclge_reset() is a little bloated, and the process of PF FLR will
be separated from the reset task later. So this patch splits
hclge_reset() into hclge_reset_prepare() and hclge_reset_rebuild(),
then FLR can also reuse these two functions.
BTW, since hclge_clear_reset_cause() and hclge_reset_prepare_up()
will not affect the device, so in hclge_reset_rebuild(), these
functions are called without rtnl_lock.
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
YueHaibing [Fri, 10 Jan 2020 06:09:08 +0000 (06:09 +0000)]
sfc: remove set but not used variable 'nic_data'
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/net/ethernet/sfc/mcdi_functions.c: In function 'efx_mcdi_ev_init':
drivers/net/ethernet/sfc/mcdi_functions.c:79:28: warning:
variable 'nic_data' set but not used [-Wunused-but-set-variable]
commit
4438b587fe4b ("sfc: move MCDI event queue management code")
introduces this unused variable.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
YueHaibing [Fri, 10 Jan 2020 01:35:17 +0000 (01:35 +0000)]
sfc: remove duplicated include from ef10.c
Remove duplicated include.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jonathan Lemon [Thu, 9 Jan 2020 19:35:42 +0000 (11:35 -0800)]
bnxt: Detach page from page pool before sending up the stack
When running in XDP mode, pages come from the page pool, and should
be freed back to the same pool or specifically detached. Currently,
when the driver re-initializes, the page pool destruction is delayed
forever since it thinks there are oustanding pages.
Fixes: 322b87ca55f2 ("bnxt_en: add page_pool support")
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 11 Jan 2020 01:07:00 +0000 (17:07 -0800)]
Merge branch 'devlink-documentation-refactor'
Jacob Keller says:
====================
devlink documentation refactor
This series updates the devlink documentation, with a few primary goals
* move all of the devlink documentation into a dedicated subfolder
* convert that documentation to the reStructuredText format
* merge driver-specific documentations into a single file per driver
* add missing documentation, including per-driver and devlink generally
For each driver, I took the time to review the code and add further
documentation on the various features it currently supports. Additionally, I
added new documentation files for some of the features such as
devlink-dpipe, devlink-resource, and devlink-regions.
Note for the region snapshot triggering, I kept that as a separate patch as
that is based on work that has not yet been merged to net-next, and may
change.
I also improved the existing documentation for devlink-info and
devlink-param by adding a bit more of an introduction when converting it to
the rst format.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:25 +0000 (14:46 -0800)]
devlink: document region snapshot triggering from userspace
Now that devlink regions can be triggered via
DEVLINK_CMD_REGION_TRIGGER, document this in the devlink-region.rst
file.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:24 +0000 (14:46 -0800)]
devlink: introduce devlink-dpipe.rst documentation file
Primarily based on the DPIPE netdev conference paper, introduce a new
file to document the dpipe interface.
This likely needs further improvement, but is at least a good overall
start.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:23 +0000 (14:46 -0800)]
devlink: add a devlink-resource.rst documentation file
Take the little bit of documentation for resources from various commit
messages and combine it into a new devlink-resource.rst file.
This could probably be expanded on even further by someone with more
knowledge of how the devlink resources work.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:22 +0000 (14:46 -0800)]
devlink: rename and expand devlink-trap-netdevsim.rst
Rename the trap-specific netdevimsim.rst file, and expand it to include
documentation of all the devlink features currently implemented by the
netdevsim driver code.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:21 +0000 (14:46 -0800)]
devlink: add documentation for ionic device driver
The IONIC device driver allocates a devlink and reports versions. Add
documentation for this driver.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Shannon Nelson <snelson@pensando.io>
Acked-by: Shannon Nelson <snelson@pensandi.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:20 +0000 (14:46 -0800)]
devlink: add a file documenting devlink regions
Also document the regions created by the mlx4 driver. This is currently
the only in-tree driver that creates devlink region snapshots.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:19 +0000 (14:46 -0800)]
devlink: add a driver-specific file for the qed driver
The qed driver recently added devlink support with a single devlink
parameter. Add a driver-specific file to document the devlink features
that the qed driver supports.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Ariel Elior <aelior@marvell.com>
Cc: GR-everest-linux-l2@marvell.com
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:18 +0000 (14:46 -0800)]
devlink: add parameter documentation for the mlx4 driver
The mlx5 and mlxsw drivers have driver-specific documentation for the
devlink features they support. No such file was added for mlx4.
Add a file to document the mlx4 devlink support. Initially it contains
only the devlink parameters.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:17 +0000 (14:46 -0800)]
devlink: document info versions for each driver
Add the set of info versions reported by each device driver, including
a description of what the version represents, and what modes (fixed,
running, stored) it reports.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:16 +0000 (14:46 -0800)]
devlink: convert driver-specific files to reStructuredText
Several drivers document what parameters they support in
a devlink-params-*.txt file. This file is supposed to contain both the
list of generic parameters implemented by the driver, as well as a list
of driver-specific parameters and their descriptions.
It would also be good if the driver documentation included other
driver-specific implementations, such as info versions, devlink
regions, and so forth.
Convert all of these documentation files to reStructuredText, and rename
them to just the driver name. Future changes will include other
driver-specific implementations. Each file will contain a table for the
generic parameters implemented, as well as a separate table for the
driver-specific parameters.
Future sections such as for devlink info versions will be added to these
files. This avoids creating additional devlink-<feature>-<driver> files
for each devlink feature, reducing clutter in the documentation folder.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Cc: Tariq Toukan <tariqt@mellanox.com>
Cc: Saeed Mahameed <saeedm@mellanox.com>
Cc: Leon Romanovsky <leonro@mellanox.com>
Cc: Michael Chan <michael.chan@broadcom.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Vivien Didelot <vivien.didelot@gmail.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Cc: Ido Schimmel <idosch@mellanox.com>
Cc: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:15 +0000 (14:46 -0800)]
devlink: mention reloading in devlink-params.rst
Mention that drivers must support devlink-reload in order for driverinit
parameters to function properly
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:14 +0000 (14:46 -0800)]
devlink: add documentation for generic devlink parameters
A few generic devlink parameters have been added, but never documented.
Fix that now.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:13 +0000 (14:46 -0800)]
devlink: convert devlink-params.txt to reStructuredText
Convert the generic parameters descriptions into the reStructuredText
format.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:12 +0000 (14:46 -0800)]
devlink: rename devlink-info-versions.rst and add a header
Rename the devlink-info-versions.rst file to a plain devlink-info.rst
file. Add additional paragraphs explaining what devlink-info is for,
and the expectation that drivers use the generic names where plausible.
Note that drivers which use non-standard info version names ought to
document these in a driver-specific info-versions.rst file.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:11 +0000 (14:46 -0800)]
devlink: convert devlink-health.txt to rst format
Update the devlink-health documentation to use the newer
ReStructuredText format.
Note that it's unclear what OOB stood for, and it has been left as-is
without a proper first-use expansion of the acronym.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:10 +0000 (14:46 -0800)]
devlink: move devlink documentation to subfolder
Combine the documentation for devlink into a subfolder, and provide an
index.rst file that can be used to generally describe devlink.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Thu, 9 Jan 2020 22:46:09 +0000 (14:46 -0800)]
devlink: add macro for "fw.psid"
The "fw.psid" devlink info version is documented in devlink-info.rst,
and used by one driver. However, there is no associated macro for this
firmware version like there is for others. Add one now.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 11 Jan 2020 00:41:35 +0000 (16:41 -0800)]
Merge branch 'r8169-factor-out-chip-specific-PHY-configuration-to-a-separate-source-file'
Heiner Kallweit says:
====================
r8169: factor out chip-specific PHY configuration to a separate source file
Basically every chip version needs its own PHY configuration.
To improve maintainability of the driver move all these PHY
configurations to a separate source file. To allow this we first have
to change all PHY configurations to use phylib functions wherever
possible.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Heiner Kallweit [Thu, 9 Jan 2020 19:34:55 +0000 (20:34 +0100)]
r8169: factor out PHY configuration to r8169_phy_config.c
Move chip-specific PHY configurations to separate source file
r8169_phy_config.c. This improves maintainability of the driver.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Heiner Kallweit [Thu, 9 Jan 2020 19:34:05 +0000 (20:34 +0100)]
r8169: add r8169.h
In preparation of factoring out PHY configuration to a separate source
file move commonly used definitions to new header file r8169.h.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Heiner Kallweit [Thu, 9 Jan 2020 19:33:13 +0000 (20:33 +0100)]
r8169: rename rtl_apply_firmware
Rename rtl_apply_firmware() to r8169_apply_firmware() before exporting
it to avoid namespace clashes with other drivers for Realtek hardware.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Heiner Kallweit [Thu, 9 Jan 2020 19:32:36 +0000 (20:32 +0100)]
r8169: add phydev argument to rtl8168d_apply_firmware_cond
Pass the phy_device as parameter to rtl8168d_apply_firmware_cond(),
this avoids having to access rtl8169_private internals.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Heiner Kallweit [Thu, 9 Jan 2020 19:31:47 +0000 (20:31 +0100)]
r8169: use phy_read/write instead of rtl_readphy/writephy
Replace rtl_writephy and rtl_readphy with the respective phylib
functions.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Heiner Kallweit [Thu, 9 Jan 2020 19:31:10 +0000 (20:31 +0100)]
r8169: replace rtl_w0w1_phy
Replace rtl_w0w1_phy with phylib functions.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Heiner Kallweit [Thu, 9 Jan 2020 19:30:37 +0000 (20:30 +0100)]
r8169: replace rtl_patchphy
Replace rtl_patchphy with phylib functions.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>