rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
|
|
|
|
/* Copyright(c) 2018-2019 Realtek Corporation
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/debugfs.h>
|
|
|
|
#include <linux/seq_file.h>
|
|
|
|
#include "main.h"
|
rtw88: add a debugfs entry to dump coex's info
Add a new entry "coex_info" in debugfs to dump coex's states for
us to debug on coex's issues.
The basic concept for co-existence (coex, usually for WiFi + BT)
is to decide a strategy based on the current status of WiFi and
BT. So, it means the WiFi driver requires to gather information
from BT side and choose a strategy (TDMA/table/HW settings).
Althrough we can easily check the current status of WiFi, e.g.,
from kernel log or just dump the hardware registers, it is still
very difficult for us to gather so many different types of WiFi
states (such as RFE config, antenna, channel/band, TRX, Power
save). Also we will need BT's information that is stored in
"struct rtw_coex". So it is necessary for us to have a debugfs
that can dump all of the WiFi/BT information required.
Note that to debug on coex related issues, we usually need a
longer period of time of coex_info dump every 2 seconds (for
example, 30 secs, so we should have 15 times of coex_info's
dump).
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200313033008.20070-2-yhchuang@realtek.com
2020-03-12 23:30:06 -04:00
|
|
|
#include "coex.h"
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
#include "sec.h"
|
|
|
|
#include "fw.h"
|
|
|
|
#include "debug.h"
|
2019-07-16 01:28:20 -04:00
|
|
|
#include "phy.h"
|
rtw88: 8822c: support FW crash dump when FW crash
Although FW crash logs are already supported for dumping in driver, the
logs may not be sufficient to analyze field issues. To improve this part,
we add a support to dump FW memory.
When driver receives FW crash notifications, driver uses DDMA, which is a
HW ability, to copy specified FW memory to FW fifo. Driver can then dump
these information from FW fifo. With this support, not only FW crash log
but also specified FW memory will be dumped while FW crash. Besides,
specified registers are also dumped.
This feature is implemeted on 8822C first due to difference of FW layouts
between ICs. In addition, we add a debugfs to trigger FW crash. It can
simulate the process of crash, dump and reset. Through it, we can also
check if a reset is ongoing.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210309060121.9099-1-pkshih@realtek.com
2021-03-09 01:01:21 -05:00
|
|
|
#include "reg.h"
|
2021-05-27 23:29:00 -04:00
|
|
|
#include "ps.h"
|
rtw88: upgrade rtw_regulatory mechanism and mapping
Mapping table from country code to rtw_regulatory, which manages tx power
limit according to countries, is updated. And mapping architecture is also
upgraded. For more precise control on tx power limit, it allows different
rtw_regulatory for different bands logically. Besides, a helper function
to query rtw_regulatory for current band under current country is provided.
For older chips, some newly added rtw_regulatory may not be configured.
To avoid that those chips have no limit on some countries mapping to a
newer rtw_regulatory after table update, a backward selection mechanism
of rtw_regulatory is introduced. It can help chips use a rtw_regulatory
which has been configured as an alternative of a newer one which is not
configured.
In addition, rtw88 actually doesn't manage channel plans by itself.
Instead, it follows them from stack. So, correct some naming about
chplan with regd, and remove the unnecessary channel control for now.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210830072014.12250-2-pkshih@realtek.com
2021-08-30 03:20:11 -04:00
|
|
|
#include "regd.h"
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
#ifdef CONFIG_RTW88_DEBUGFS
|
|
|
|
|
|
|
|
struct rtw_debugfs_priv {
|
|
|
|
struct rtw_dev *rtwdev;
|
|
|
|
int (*cb_read)(struct seq_file *m, void *v);
|
|
|
|
ssize_t (*cb_write)(struct file *filp, const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff);
|
|
|
|
union {
|
|
|
|
u32 cb_data;
|
|
|
|
u8 *buf;
|
|
|
|
struct {
|
|
|
|
u32 page_offset;
|
|
|
|
u32 page_num;
|
|
|
|
} rsvd_page;
|
|
|
|
struct {
|
|
|
|
u8 rf_path;
|
|
|
|
u32 rf_addr;
|
|
|
|
u32 rf_mask;
|
|
|
|
};
|
|
|
|
struct {
|
|
|
|
u32 addr;
|
|
|
|
u32 len;
|
|
|
|
} read_reg;
|
2021-04-18 20:37:48 -04:00
|
|
|
struct {
|
|
|
|
u8 bit;
|
|
|
|
} dm_cap;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-04-18 20:37:48 -04:00
|
|
|
static const char * const rtw_dm_cap_strs[] = {
|
|
|
|
[RTW_DM_CAP_NA] = "NA",
|
|
|
|
[RTW_DM_CAP_TXGAPK] = "TXGAPK",
|
|
|
|
};
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
static int rtw_debugfs_single_show(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
|
|
|
|
return debugfs_priv->cb_read(m, v);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t rtw_debugfs_common_write(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = filp->private_data;
|
|
|
|
|
|
|
|
return debugfs_priv->cb_write(filp, buffer, count, loff);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t rtw_debugfs_single_write(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
|
|
|
|
|
|
|
return debugfs_priv->cb_write(filp, buffer, count, loff);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debugfs_single_open_rw(struct inode *inode, struct file *filp)
|
|
|
|
{
|
|
|
|
return single_open(filp, rtw_debugfs_single_show, inode->i_private);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debugfs_close(struct inode *inode, struct file *filp)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct file_operations file_ops_single_r = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.open = rtw_debugfs_single_open_rw,
|
|
|
|
.read = seq_read,
|
|
|
|
.llseek = seq_lseek,
|
2019-09-04 10:16:01 -04:00
|
|
|
.release = single_release,
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
static const struct file_operations file_ops_single_rw = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.open = rtw_debugfs_single_open_rw,
|
|
|
|
.release = single_release,
|
|
|
|
.read = seq_read,
|
|
|
|
.llseek = seq_lseek,
|
|
|
|
.write = rtw_debugfs_single_write,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct file_operations file_ops_common_write = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.write = rtw_debugfs_common_write,
|
|
|
|
.open = simple_open,
|
|
|
|
.release = rtw_debugfs_close,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int rtw_debugfs_get_read_reg(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
u32 val, len, addr;
|
|
|
|
|
|
|
|
len = debugfs_priv->read_reg.len;
|
|
|
|
addr = debugfs_priv->read_reg.addr;
|
|
|
|
switch (len) {
|
|
|
|
case 1:
|
|
|
|
val = rtw_read8(rtwdev, addr);
|
|
|
|
seq_printf(m, "reg 0x%03x: 0x%02x\n", addr, val);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
val = rtw_read16(rtwdev, addr);
|
|
|
|
seq_printf(m, "reg 0x%03x: 0x%04x\n", addr, val);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
val = rtw_read32(rtwdev, addr);
|
|
|
|
seq_printf(m, "reg 0x%03x: 0x%08x\n", addr, val);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debugfs_get_rf_read(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
u32 val, addr, mask;
|
|
|
|
u8 path;
|
|
|
|
|
|
|
|
path = debugfs_priv->rf_path;
|
|
|
|
addr = debugfs_priv->rf_addr;
|
|
|
|
mask = debugfs_priv->rf_mask;
|
|
|
|
|
2022-12-02 03:12:16 -05:00
|
|
|
mutex_lock(&rtwdev->mutex);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
val = rtw_read_rf(rtwdev, path, addr, mask);
|
2022-12-02 03:12:16 -05:00
|
|
|
mutex_unlock(&rtwdev->mutex);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
seq_printf(m, "rf_read path:%d addr:0x%08x mask:0x%08x val=0x%08x\n",
|
|
|
|
path, addr, mask, val);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-11-28 21:05:06 -05:00
|
|
|
static int rtw_debugfs_get_fix_rate(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
|
|
|
u8 fix_rate = dm_info->fix_rate;
|
|
|
|
|
|
|
|
if (fix_rate >= DESC_RATE_MAX) {
|
|
|
|
seq_printf(m, "Fix rate disabled, fix_rate = %u\n", fix_rate);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
seq_printf(m, "Data frames fixed at desc rate %u\n", fix_rate);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
static int rtw_debugfs_copy_from_user(char tmp[], int size,
|
|
|
|
const char __user *buffer, size_t count,
|
|
|
|
int num)
|
|
|
|
{
|
|
|
|
int tmp_len;
|
|
|
|
|
2020-12-03 03:43:37 -05:00
|
|
|
memset(tmp, 0, size);
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
if (count < num)
|
|
|
|
return -EFAULT;
|
|
|
|
|
|
|
|
tmp_len = (count > size - 1 ? size - 1 : count);
|
|
|
|
|
2023-04-26 13:02:20 -04:00
|
|
|
if (copy_from_user(tmp, buffer, tmp_len))
|
|
|
|
return -EFAULT;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
tmp[tmp_len] = '\0';
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t rtw_debugfs_set_read_reg(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
char tmp[32 + 1];
|
|
|
|
u32 addr, len;
|
|
|
|
int num;
|
2023-04-26 13:02:21 -04:00
|
|
|
int ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
2023-04-26 13:02:21 -04:00
|
|
|
ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 2);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
num = sscanf(tmp, "%x %x", &addr, &len);
|
|
|
|
|
|
|
|
if (num != 2)
|
2023-04-26 13:02:21 -04:00
|
|
|
return -EINVAL;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
if (len != 1 && len != 2 && len != 4) {
|
|
|
|
rtw_warn(rtwdev, "read reg setting wrong len\n");
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
debugfs_priv->read_reg.addr = addr;
|
|
|
|
debugfs_priv->read_reg.len = len;
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debugfs_get_dump_cam(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
u32 val, command;
|
|
|
|
u32 hw_key_idx = debugfs_priv->cb_data << RTW_SEC_CAM_ENTRY_SHIFT;
|
|
|
|
u32 read_cmd = RTW_SEC_CMD_POLLING;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
seq_printf(m, "cam entry%d\n", debugfs_priv->cb_data);
|
|
|
|
seq_puts(m, "0x0 0x1 0x2 0x3 ");
|
|
|
|
seq_puts(m, "0x4 0x5\n");
|
|
|
|
mutex_lock(&rtwdev->mutex);
|
|
|
|
for (i = 0; i <= 5; i++) {
|
|
|
|
command = read_cmd | (hw_key_idx + i);
|
|
|
|
rtw_write32(rtwdev, RTW_SEC_CMD_REG, command);
|
|
|
|
val = rtw_read32(rtwdev, RTW_SEC_READ_REG);
|
|
|
|
seq_printf(m, "%8.8x", val);
|
|
|
|
if (i < 2)
|
|
|
|
seq_puts(m, " ");
|
|
|
|
}
|
|
|
|
seq_puts(m, "\n");
|
|
|
|
mutex_unlock(&rtwdev->mutex);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debugfs_get_rsvd_page(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
u8 page_size = rtwdev->chip->page_size;
|
|
|
|
u32 buf_size = debugfs_priv->rsvd_page.page_num * page_size;
|
|
|
|
u32 offset = debugfs_priv->rsvd_page.page_offset * page_size;
|
|
|
|
u8 *buf;
|
|
|
|
int i;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
buf = vzalloc(buf_size);
|
|
|
|
if (!buf)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2020-09-25 02:12:17 -04:00
|
|
|
ret = rtw_fw_dump_fifo(rtwdev, RTW_FW_FIFO_SEL_RSVD_PAGE, offset,
|
|
|
|
buf_size, (u32 *)buf);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
if (ret) {
|
|
|
|
rtw_err(rtwdev, "failed to dump rsvd page\n");
|
|
|
|
vfree(buf);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0 ; i < buf_size ; i += 8) {
|
|
|
|
if (i % page_size == 0)
|
|
|
|
seq_printf(m, "PAGE %d\n", (i + offset) / page_size);
|
2022-06-03 08:56:48 -04:00
|
|
|
seq_printf(m, "%8ph\n", buf + i);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
}
|
|
|
|
vfree(buf);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t rtw_debugfs_set_rsvd_page(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
char tmp[32 + 1];
|
|
|
|
u32 offset, page_num;
|
|
|
|
int num;
|
2023-04-26 13:02:21 -04:00
|
|
|
int ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
2023-04-26 13:02:21 -04:00
|
|
|
ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 2);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
num = sscanf(tmp, "%d %d", &offset, &page_num);
|
|
|
|
|
|
|
|
if (num != 2) {
|
|
|
|
rtw_warn(rtwdev, "invalid arguments\n");
|
2021-03-15 05:23:37 -04:00
|
|
|
return -EINVAL;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
debugfs_priv->rsvd_page.page_offset = offset;
|
|
|
|
debugfs_priv->rsvd_page.page_num = page_num;
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t rtw_debugfs_set_single_input(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
|
|
|
u32 input;
|
2023-04-26 13:02:21 -04:00
|
|
|
int ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
2024-01-10 08:29:28 -05:00
|
|
|
ret = kstrtou32_from_user(buffer, count, 0, &input);
|
2023-04-26 13:02:21 -04:00
|
|
|
if (ret)
|
|
|
|
return ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
debugfs_priv->cb_data = input;
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t rtw_debugfs_set_write_reg(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = filp->private_data;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
char tmp[32 + 1];
|
|
|
|
u32 addr, val, len;
|
|
|
|
int num;
|
2023-04-26 13:02:21 -04:00
|
|
|
int ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
2023-04-26 13:02:21 -04:00
|
|
|
ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 3);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
/* write BB/MAC register */
|
|
|
|
num = sscanf(tmp, "%x %x %x", &addr, &val, &len);
|
|
|
|
|
|
|
|
if (num != 3)
|
2023-04-26 13:02:21 -04:00
|
|
|
return -EINVAL;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
switch (len) {
|
|
|
|
case 1:
|
|
|
|
rtw_dbg(rtwdev, RTW_DBG_DEBUGFS,
|
|
|
|
"reg write8 0x%03x: 0x%08x\n", addr, val);
|
|
|
|
rtw_write8(rtwdev, addr, (u8)val);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
rtw_dbg(rtwdev, RTW_DBG_DEBUGFS,
|
|
|
|
"reg write16 0x%03x: 0x%08x\n", addr, val);
|
|
|
|
rtw_write16(rtwdev, addr, (u16)val);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
rtw_dbg(rtwdev, RTW_DBG_DEBUGFS,
|
|
|
|
"reg write32 0x%03x: 0x%08x\n", addr, val);
|
|
|
|
rtw_write32(rtwdev, addr, (u32)val);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
rtw_dbg(rtwdev, RTW_DBG_DEBUGFS,
|
|
|
|
"error write length = %d\n", len);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
2020-07-17 02:49:37 -04:00
|
|
|
static ssize_t rtw_debugfs_set_h2c(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = filp->private_data;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
char tmp[32 + 1];
|
|
|
|
u8 param[8];
|
|
|
|
int num;
|
2023-04-26 13:02:21 -04:00
|
|
|
int ret;
|
2020-07-17 02:49:37 -04:00
|
|
|
|
2023-04-26 13:02:21 -04:00
|
|
|
ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 3);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
2020-07-17 02:49:37 -04:00
|
|
|
|
|
|
|
num = sscanf(tmp, "%hhx,%hhx,%hhx,%hhx,%hhx,%hhx,%hhx,%hhx",
|
|
|
|
¶m[0], ¶m[1], ¶m[2], ¶m[3],
|
|
|
|
¶m[4], ¶m[5], ¶m[6], ¶m[7]);
|
|
|
|
if (num != 8) {
|
2022-02-17 22:55:27 -05:00
|
|
|
rtw_warn(rtwdev, "invalid H2C command format for debug\n");
|
2020-07-17 02:49:37 -04:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2022-12-02 03:12:17 -05:00
|
|
|
mutex_lock(&rtwdev->mutex);
|
2020-07-17 02:49:37 -04:00
|
|
|
rtw_fw_h2c_cmd_dbg(rtwdev, param);
|
2022-12-02 03:12:17 -05:00
|
|
|
mutex_unlock(&rtwdev->mutex);
|
2020-07-17 02:49:37 -04:00
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
static ssize_t rtw_debugfs_set_rf_write(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = filp->private_data;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
char tmp[32 + 1];
|
|
|
|
u32 path, addr, mask, val;
|
|
|
|
int num;
|
2023-04-26 13:02:21 -04:00
|
|
|
int ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
2023-04-26 13:02:21 -04:00
|
|
|
ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 4);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
num = sscanf(tmp, "%x %x %x %x", &path, &addr, &mask, &val);
|
|
|
|
|
|
|
|
if (num != 4) {
|
|
|
|
rtw_warn(rtwdev, "invalid args, [path] [addr] [mask] [val]\n");
|
2023-04-26 13:02:21 -04:00
|
|
|
return -EINVAL;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
}
|
|
|
|
|
2022-12-02 03:12:16 -05:00
|
|
|
mutex_lock(&rtwdev->mutex);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
rtw_write_rf(rtwdev, path, addr, mask, val);
|
2022-12-02 03:12:16 -05:00
|
|
|
mutex_unlock(&rtwdev->mutex);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
rtw_dbg(rtwdev, RTW_DBG_DEBUGFS,
|
|
|
|
"write_rf path:%d addr:0x%08x mask:0x%08x, val:0x%08x\n",
|
|
|
|
path, addr, mask, val);
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ssize_t rtw_debugfs_set_rf_read(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
char tmp[32 + 1];
|
|
|
|
u32 path, addr, mask;
|
|
|
|
int num;
|
2023-04-26 13:02:21 -04:00
|
|
|
int ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
2023-04-26 13:02:21 -04:00
|
|
|
ret = rtw_debugfs_copy_from_user(tmp, sizeof(tmp), buffer, count, 3);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
num = sscanf(tmp, "%x %x %x", &path, &addr, &mask);
|
|
|
|
|
|
|
|
if (num != 3) {
|
|
|
|
rtw_warn(rtwdev, "invalid args, [path] [addr] [mask] [val]\n");
|
2023-04-26 13:02:21 -04:00
|
|
|
return -EINVAL;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
debugfs_priv->rf_path = path;
|
|
|
|
debugfs_priv->rf_addr = addr;
|
|
|
|
debugfs_priv->rf_mask = mask;
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
2021-11-28 21:05:06 -05:00
|
|
|
static ssize_t rtw_debugfs_set_fix_rate(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
|
|
|
u8 fix_rate;
|
|
|
|
int ret;
|
|
|
|
|
2024-01-10 08:29:28 -05:00
|
|
|
ret = kstrtou8_from_user(buffer, count, 0, &fix_rate);
|
2023-04-26 13:02:21 -04:00
|
|
|
if (ret)
|
|
|
|
return ret;
|
2021-11-28 21:05:06 -05:00
|
|
|
|
|
|
|
dm_info->fix_rate = fix_rate;
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
static int rtw_debug_get_mac_page(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
u32 page = debugfs_priv->cb_data;
|
|
|
|
int i, n;
|
|
|
|
int max = 0xff;
|
|
|
|
|
2020-08-26 05:33:52 -04:00
|
|
|
rtw_read32(rtwdev, debugfs_priv->cb_data);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
for (n = 0; n <= max; ) {
|
|
|
|
seq_printf(m, "\n%8.8x ", n + page);
|
|
|
|
for (i = 0; i < 4 && n <= max; i++, n += 4)
|
|
|
|
seq_printf(m, "%8.8x ",
|
|
|
|
rtw_read32(rtwdev, (page | n)));
|
|
|
|
}
|
|
|
|
seq_puts(m, "\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debug_get_bb_page(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
u32 page = debugfs_priv->cb_data;
|
|
|
|
int i, n;
|
|
|
|
int max = 0xff;
|
|
|
|
|
2020-08-26 05:33:52 -04:00
|
|
|
rtw_read32(rtwdev, debugfs_priv->cb_data);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
for (n = 0; n <= max; ) {
|
|
|
|
seq_printf(m, "\n%8.8x ", n + page);
|
|
|
|
for (i = 0; i < 4 && n <= max; i++, n += 4)
|
|
|
|
seq_printf(m, "%8.8x ",
|
|
|
|
rtw_read32(rtwdev, (page | n)));
|
|
|
|
}
|
|
|
|
seq_puts(m, "\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debug_get_rf_dump(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
u32 addr, offset, data;
|
|
|
|
u8 path;
|
|
|
|
|
2022-12-02 03:12:16 -05:00
|
|
|
mutex_lock(&rtwdev->mutex);
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
|
|
|
|
seq_printf(m, "RF path:%d\n", path);
|
|
|
|
for (addr = 0; addr < 0x100; addr += 4) {
|
|
|
|
seq_printf(m, "%8.8x ", addr);
|
|
|
|
for (offset = 0; offset < 4; offset++) {
|
|
|
|
data = rtw_read_rf(rtwdev, path, addr + offset,
|
|
|
|
0xffffffff);
|
|
|
|
seq_printf(m, "%8.8x ", data);
|
|
|
|
}
|
|
|
|
seq_puts(m, "\n");
|
|
|
|
}
|
|
|
|
seq_puts(m, "\n");
|
|
|
|
}
|
|
|
|
|
2022-12-02 03:12:16 -05:00
|
|
|
mutex_unlock(&rtwdev->mutex);
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-16 01:28:20 -04:00
|
|
|
static void rtw_print_cck_rate_txt(struct seq_file *m, u8 rate)
|
|
|
|
{
|
|
|
|
static const char * const
|
|
|
|
cck_rate[] = {"1M", "2M", "5.5M", "11M"};
|
|
|
|
u8 idx = rate - DESC_RATE1M;
|
|
|
|
|
|
|
|
seq_printf(m, " CCK_%-5s", cck_rate[idx]);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rtw_print_ofdm_rate_txt(struct seq_file *m, u8 rate)
|
|
|
|
{
|
|
|
|
static const char * const
|
|
|
|
ofdm_rate[] = {"6M", "9M", "12M", "18M", "24M", "36M", "48M", "54M"};
|
|
|
|
u8 idx = rate - DESC_RATE6M;
|
|
|
|
|
|
|
|
seq_printf(m, " OFDM_%-4s", ofdm_rate[idx]);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rtw_print_ht_rate_txt(struct seq_file *m, u8 rate)
|
|
|
|
{
|
|
|
|
u8 mcs_n = rate - DESC_RATEMCS0;
|
|
|
|
|
|
|
|
seq_printf(m, " MCS%-6u", mcs_n);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void rtw_print_vht_rate_txt(struct seq_file *m, u8 rate)
|
|
|
|
{
|
|
|
|
u8 idx = rate - DESC_RATEVHT1SS_MCS0;
|
|
|
|
u8 n_ss, mcs_n;
|
|
|
|
|
|
|
|
/* n spatial stream */
|
|
|
|
n_ss = 1 + idx / 10;
|
|
|
|
/* MCS n */
|
|
|
|
mcs_n = idx % 10;
|
|
|
|
seq_printf(m, " VHT%uSMCS%u", n_ss, mcs_n);
|
|
|
|
}
|
|
|
|
|
rtw88: add phy_info debugfs to show Tx/Rx physical status
This commit adds several Tx/Rx physical information to phy_info
debugfs for 8822B/8822C. By this debugfs, we can know physical
information, such as Tx/Rx rate, RSSI, EVM,SNR, etc. The
information is gotten from the packets of Tx/Rx path. It has
no impact for the performance of 8822B/8822C.
In the fields, we may meet different kinds of problems, but
we may have no professional instrument to check them. At
this moment, this debugfs is a good tool, and it may provide
useful information for debug.
Signed-off-by: Tsang-Shian Lin <thlin@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>
2019-10-22 06:04:20 -04:00
|
|
|
static void rtw_print_rate(struct seq_file *m, u8 rate)
|
|
|
|
{
|
|
|
|
switch (rate) {
|
|
|
|
case DESC_RATE1M...DESC_RATE11M:
|
|
|
|
rtw_print_cck_rate_txt(m, rate);
|
|
|
|
break;
|
|
|
|
case DESC_RATE6M...DESC_RATE54M:
|
|
|
|
rtw_print_ofdm_rate_txt(m, rate);
|
|
|
|
break;
|
|
|
|
case DESC_RATEMCS0...DESC_RATEMCS15:
|
|
|
|
rtw_print_ht_rate_txt(m, rate);
|
|
|
|
break;
|
|
|
|
case DESC_RATEVHT1SS_MCS0...DESC_RATEVHT2SS_MCS9:
|
|
|
|
rtw_print_vht_rate_txt(m, rate);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
seq_printf(m, " Unknown rate=0x%x\n", rate);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-25 02:12:19 -04:00
|
|
|
#define case_REGD(src) \
|
|
|
|
case RTW_REGD_##src: return #src
|
|
|
|
|
|
|
|
static const char *rtw_get_regd_string(u8 regd)
|
|
|
|
{
|
|
|
|
switch (regd) {
|
|
|
|
case_REGD(FCC);
|
|
|
|
case_REGD(MKK);
|
|
|
|
case_REGD(ETSI);
|
|
|
|
case_REGD(IC);
|
|
|
|
case_REGD(KCC);
|
|
|
|
case_REGD(ACMA);
|
|
|
|
case_REGD(CHILE);
|
|
|
|
case_REGD(UKRAINE);
|
|
|
|
case_REGD(MEXICO);
|
|
|
|
case_REGD(CN);
|
|
|
|
case_REGD(WW);
|
|
|
|
default:
|
|
|
|
return "Unknown";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-16 01:28:20 -04:00
|
|
|
static int rtw_debugfs_get_tx_pwr_tbl(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
struct rtw_hal *hal = &rtwdev->hal;
|
2022-08-09 04:41:02 -04:00
|
|
|
u8 path, rate, bw, ch, regd;
|
2019-07-16 01:28:20 -04:00
|
|
|
struct rtw_power_params pwr_param = {0};
|
2022-08-09 04:41:02 -04:00
|
|
|
|
|
|
|
mutex_lock(&rtwdev->mutex);
|
|
|
|
bw = hal->current_band_width;
|
|
|
|
ch = hal->current_channel;
|
|
|
|
regd = rtw_regd_get(rtwdev);
|
2019-07-16 01:28:20 -04:00
|
|
|
|
2021-11-28 21:06:26 -05:00
|
|
|
seq_printf(m, "channel: %u\n", ch);
|
|
|
|
seq_printf(m, "bandwidth: %u\n", bw);
|
2020-09-25 02:12:19 -04:00
|
|
|
seq_printf(m, "regulatory: %s\n", rtw_get_regd_string(regd));
|
rtw88: support SAR via kernel common API
Register cfg80211_sar_capa with type NL80211_SAR_TYPE_POWER and four
frequency ranges for configurations in unit of 0.25 dBm. And handle
callback set_sar_specs.
Originally, TX power has three main parameters, i.e. power base,
power by rate, and power limit. The formula can be simply considered
as TX power = power base + min(power by rate, power limit). With the
support of SAR which can be treated as another power limit, there is
one more parameter for TX power. And the formula will evolve into
TX power = power base + min(power by rate, power limit, power sar).
Besides, debugfs tx_pwr_tbl is also refined to show SAR information.
The following is an example for the difference.
Before supporting SAR,
-----------------------------------
...
path rate pwr base (byr lmt ) rem
A CCK_1M 66(0x42) 78 -12 ( 12 -12) 0
A CCK_2M 66(0x42) 78 -12 ( 8 -12) 0
...
-----------------------------------
After supporting SAR and making some configurations,
-----------------------------------
...
path rate pwr base (byr lmt sar ) rem
A CCK_1M 62(0x3e) 78 -16 ( 12 -12 -16) 0
A CCK_2M 62(0x3e) 78 -16 ( 8 -12 -16) 0
...
-----------------------------------
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211220093656.65312-1-pkshih@realtek.com
2021-12-20 04:36:56 -05:00
|
|
|
seq_printf(m, "%-4s %-10s %-9s %-9s (%-4s %-4s %-4s) %-4s\n",
|
|
|
|
"path", "rate", "pwr", "base", "byr", "lmt", "sar", "rem");
|
2019-07-16 01:28:20 -04:00
|
|
|
|
|
|
|
mutex_lock(&hal->tx_power_mutex);
|
|
|
|
for (path = RF_PATH_A; path <= RF_PATH_B; path++) {
|
|
|
|
/* there is no CCK rates used in 5G */
|
|
|
|
if (hal->current_band_type == RTW_BAND_5G)
|
|
|
|
rate = DESC_RATE6M;
|
|
|
|
else
|
|
|
|
rate = DESC_RATE1M;
|
|
|
|
|
|
|
|
/* now, not support vht 3ss and vht 4ss*/
|
|
|
|
for (; rate <= DESC_RATEVHT2SS_MCS9; rate++) {
|
|
|
|
/* now, not support ht 3ss and ht 4ss*/
|
|
|
|
if (rate > DESC_RATEMCS15 &&
|
|
|
|
rate < DESC_RATEVHT1SS_MCS0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
rtw_get_tx_power_params(rtwdev, path, rate, bw,
|
|
|
|
ch, regd, &pwr_param);
|
|
|
|
|
|
|
|
seq_printf(m, "%4c ", path + 'A');
|
rtw88: add phy_info debugfs to show Tx/Rx physical status
This commit adds several Tx/Rx physical information to phy_info
debugfs for 8822B/8822C. By this debugfs, we can know physical
information, such as Tx/Rx rate, RSSI, EVM,SNR, etc. The
information is gotten from the packets of Tx/Rx path. It has
no impact for the performance of 8822B/8822C.
In the fields, we may meet different kinds of problems, but
we may have no professional instrument to check them. At
this moment, this debugfs is a good tool, and it may provide
useful information for debug.
Signed-off-by: Tsang-Shian Lin <thlin@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>
2019-10-22 06:04:20 -04:00
|
|
|
rtw_print_rate(m, rate);
|
rtw88: support SAR via kernel common API
Register cfg80211_sar_capa with type NL80211_SAR_TYPE_POWER and four
frequency ranges for configurations in unit of 0.25 dBm. And handle
callback set_sar_specs.
Originally, TX power has three main parameters, i.e. power base,
power by rate, and power limit. The formula can be simply considered
as TX power = power base + min(power by rate, power limit). With the
support of SAR which can be treated as another power limit, there is
one more parameter for TX power. And the formula will evolve into
TX power = power base + min(power by rate, power limit, power sar).
Besides, debugfs tx_pwr_tbl is also refined to show SAR information.
The following is an example for the difference.
Before supporting SAR,
-----------------------------------
...
path rate pwr base (byr lmt ) rem
A CCK_1M 66(0x42) 78 -12 ( 12 -12) 0
A CCK_2M 66(0x42) 78 -12 ( 8 -12) 0
...
-----------------------------------
After supporting SAR and making some configurations,
-----------------------------------
...
path rate pwr base (byr lmt sar ) rem
A CCK_1M 62(0x3e) 78 -16 ( 12 -12 -16) 0
A CCK_2M 62(0x3e) 78 -16 ( 8 -12 -16) 0
...
-----------------------------------
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211220093656.65312-1-pkshih@realtek.com
2021-12-20 04:36:56 -05:00
|
|
|
seq_printf(m, " %3u(0x%02x) %4u %4d (%4d %4d %4d) %4d\n",
|
2019-07-16 01:28:20 -04:00
|
|
|
hal->tx_pwr_tbl[path][rate],
|
|
|
|
hal->tx_pwr_tbl[path][rate],
|
|
|
|
pwr_param.pwr_base,
|
rtw88: support SAR via kernel common API
Register cfg80211_sar_capa with type NL80211_SAR_TYPE_POWER and four
frequency ranges for configurations in unit of 0.25 dBm. And handle
callback set_sar_specs.
Originally, TX power has three main parameters, i.e. power base,
power by rate, and power limit. The formula can be simply considered
as TX power = power base + min(power by rate, power limit). With the
support of SAR which can be treated as another power limit, there is
one more parameter for TX power. And the formula will evolve into
TX power = power base + min(power by rate, power limit, power sar).
Besides, debugfs tx_pwr_tbl is also refined to show SAR information.
The following is an example for the difference.
Before supporting SAR,
-----------------------------------
...
path rate pwr base (byr lmt ) rem
A CCK_1M 66(0x42) 78 -12 ( 12 -12) 0
A CCK_2M 66(0x42) 78 -12 ( 8 -12) 0
...
-----------------------------------
After supporting SAR and making some configurations,
-----------------------------------
...
path rate pwr base (byr lmt sar ) rem
A CCK_1M 62(0x3e) 78 -16 ( 12 -12 -16) 0
A CCK_2M 62(0x3e) 78 -16 ( 8 -12 -16) 0
...
-----------------------------------
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211220093656.65312-1-pkshih@realtek.com
2021-12-20 04:36:56 -05:00
|
|
|
min3(pwr_param.pwr_offset,
|
|
|
|
pwr_param.pwr_limit,
|
|
|
|
pwr_param.pwr_sar),
|
rtw88: 8723d: Add power tracking
When chip's temperature is changed, RF characters are changed. To keep the
characters to be consistent, 8723d uses thermal meter to assist in
calibrating LCK, IQK, crystal and TX power.
A base thermal value is programmed in efuse, all calibration data in
MP process is based on this thermal value. So we calucate the delta of
thermal value between the base value, and use this delta to reference XTAL
and TX power offset tables to know how much we need to adjust.
For IQK and LCK, driver checks if delta of thermal value is over 8, then
they are triggered.
For crystal adjustment, when delta of thermal value is changed, we check
XTAL tables to get offset of XTAL value. If thermal value is larger than
base value, positive table (_p as suffix) is used. Otherwise, we use
negative table (_n as suffix). Then, we add offset to XTAL default value
programmed in efuse, and write sum value to register.
To compensate TX power, there are two hierarchical tables. First level use
delta of thermal value to access eight tables to yield delta of TX power
index. Then, plus base TX power index to get index of BB swing table
(second level tables) where register value is induced.
BB swing table can't deal with all cases, if index of BB swing table is
over the size of the table. In this case, TX AGC is used to compensate the
remnant part. Assume 'upper' is the upper bound of BB swing table, and
'target' is the desired index. Then, we can illustrate them as
compensation method BB swing TX AGC
------------------- -------- --------------
target > upper upper target - upper
target < 0 0 target
otherwise target 0
For debug purpose, add a column 'rem' to tx_pwr_tbl entry, and it looks
like
path rate pwr base (byr lmt ) rem
A CCK_1M 32(0x20) 34 -2 ( 0 -2) 0
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>
Link: https://lore.kernel.org/r/20200512102621.5148-4-yhchuang@realtek.com
2020-05-12 06:26:15 -04:00
|
|
|
pwr_param.pwr_offset, pwr_param.pwr_limit,
|
rtw88: support SAR via kernel common API
Register cfg80211_sar_capa with type NL80211_SAR_TYPE_POWER and four
frequency ranges for configurations in unit of 0.25 dBm. And handle
callback set_sar_specs.
Originally, TX power has three main parameters, i.e. power base,
power by rate, and power limit. The formula can be simply considered
as TX power = power base + min(power by rate, power limit). With the
support of SAR which can be treated as another power limit, there is
one more parameter for TX power. And the formula will evolve into
TX power = power base + min(power by rate, power limit, power sar).
Besides, debugfs tx_pwr_tbl is also refined to show SAR information.
The following is an example for the difference.
Before supporting SAR,
-----------------------------------
...
path rate pwr base (byr lmt ) rem
A CCK_1M 66(0x42) 78 -12 ( 12 -12) 0
A CCK_2M 66(0x42) 78 -12 ( 8 -12) 0
...
-----------------------------------
After supporting SAR and making some configurations,
-----------------------------------
...
path rate pwr base (byr lmt sar ) rem
A CCK_1M 62(0x3e) 78 -16 ( 12 -12 -16) 0
A CCK_2M 62(0x3e) 78 -16 ( 8 -12 -16) 0
...
-----------------------------------
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211220093656.65312-1-pkshih@realtek.com
2021-12-20 04:36:56 -05:00
|
|
|
pwr_param.pwr_sar,
|
rtw88: 8723d: Add power tracking
When chip's temperature is changed, RF characters are changed. To keep the
characters to be consistent, 8723d uses thermal meter to assist in
calibrating LCK, IQK, crystal and TX power.
A base thermal value is programmed in efuse, all calibration data in
MP process is based on this thermal value. So we calucate the delta of
thermal value between the base value, and use this delta to reference XTAL
and TX power offset tables to know how much we need to adjust.
For IQK and LCK, driver checks if delta of thermal value is over 8, then
they are triggered.
For crystal adjustment, when delta of thermal value is changed, we check
XTAL tables to get offset of XTAL value. If thermal value is larger than
base value, positive table (_p as suffix) is used. Otherwise, we use
negative table (_n as suffix). Then, we add offset to XTAL default value
programmed in efuse, and write sum value to register.
To compensate TX power, there are two hierarchical tables. First level use
delta of thermal value to access eight tables to yield delta of TX power
index. Then, plus base TX power index to get index of BB swing table
(second level tables) where register value is induced.
BB swing table can't deal with all cases, if index of BB swing table is
over the size of the table. In this case, TX AGC is used to compensate the
remnant part. Assume 'upper' is the upper bound of BB swing table, and
'target' is the desired index. Then, we can illustrate them as
compensation method BB swing TX AGC
------------------- -------- --------------
target > upper upper target - upper
target < 0 0 target
otherwise target 0
For debug purpose, add a column 'rem' to tx_pwr_tbl entry, and it looks
like
path rate pwr base (byr lmt ) rem
A CCK_1M 32(0x20) 34 -2 ( 0 -2) 0
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>
Link: https://lore.kernel.org/r/20200512102621.5148-4-yhchuang@realtek.com
2020-05-12 06:26:15 -04:00
|
|
|
pwr_param.pwr_remnant);
|
2019-07-16 01:28:20 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mutex_unlock(&hal->tx_power_mutex);
|
2022-08-09 04:41:02 -04:00
|
|
|
mutex_unlock(&rtwdev->mutex);
|
2019-07-16 01:28:20 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-11-25 21:10:51 -05:00
|
|
|
void rtw_debugfs_get_simple_phy_info(struct seq_file *m)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
struct rtw_hal *hal = &rtwdev->hal;
|
|
|
|
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
|
|
|
struct rtw_traffic_stats *stats = &rtwdev->stats;
|
|
|
|
|
|
|
|
seq_printf(m, "%-40s = %ddBm/ %d\n", "RSSI/ STA Channel",
|
|
|
|
dm_info->rssi[RF_PATH_A] - 100, hal->current_channel);
|
|
|
|
|
|
|
|
seq_printf(m, "TP {Tx, Rx} = {%u, %u}Mbps\n",
|
|
|
|
stats->tx_throughput, stats->rx_throughput);
|
|
|
|
|
|
|
|
seq_puts(m, "[Tx Rate] = ");
|
|
|
|
rtw_print_rate(m, dm_info->tx_rate);
|
|
|
|
seq_printf(m, "(0x%x)\n", dm_info->tx_rate);
|
|
|
|
|
|
|
|
seq_puts(m, "[Rx Rate] = ");
|
|
|
|
rtw_print_rate(m, dm_info->curr_rx_rate);
|
|
|
|
seq_printf(m, "(0x%x)\n", dm_info->curr_rx_rate);
|
|
|
|
}
|
|
|
|
|
rtw88: add phy_info debugfs to show Tx/Rx physical status
This commit adds several Tx/Rx physical information to phy_info
debugfs for 8822B/8822C. By this debugfs, we can know physical
information, such as Tx/Rx rate, RSSI, EVM,SNR, etc. The
information is gotten from the packets of Tx/Rx path. It has
no impact for the performance of 8822B/8822C.
In the fields, we may meet different kinds of problems, but
we may have no professional instrument to check them. At
this moment, this debugfs is a good tool, and it may provide
useful information for debug.
Signed-off-by: Tsang-Shian Lin <thlin@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>
2019-10-22 06:04:20 -04:00
|
|
|
static int rtw_debugfs_get_phy_info(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
|
|
|
struct rtw_traffic_stats *stats = &rtwdev->stats;
|
|
|
|
struct rtw_pkt_count *last_cnt = &dm_info->last_pkt_count;
|
|
|
|
struct rtw_efuse *efuse = &rtwdev->efuse;
|
|
|
|
struct ewma_evm *ewma_evm = dm_info->ewma_evm;
|
|
|
|
struct ewma_snr *ewma_snr = dm_info->ewma_snr;
|
|
|
|
u8 ss, rate_id;
|
|
|
|
|
|
|
|
seq_puts(m, "==========[Common Info]========\n");
|
|
|
|
seq_printf(m, "Is link = %c\n", rtw_is_assoc(rtwdev) ? 'Y' : 'N');
|
|
|
|
seq_printf(m, "Current CH(fc) = %u\n", rtwdev->hal.current_channel);
|
|
|
|
seq_printf(m, "Current BW = %u\n", rtwdev->hal.current_band_width);
|
|
|
|
seq_printf(m, "Current IGI = 0x%x\n", dm_info->igi_history[0]);
|
2022-02-14 19:48:50 -05:00
|
|
|
seq_printf(m, "TP {Tx, Rx} = {%u, %u}Mbps\n",
|
rtw88: add phy_info debugfs to show Tx/Rx physical status
This commit adds several Tx/Rx physical information to phy_info
debugfs for 8822B/8822C. By this debugfs, we can know physical
information, such as Tx/Rx rate, RSSI, EVM,SNR, etc. The
information is gotten from the packets of Tx/Rx path. It has
no impact for the performance of 8822B/8822C.
In the fields, we may meet different kinds of problems, but
we may have no professional instrument to check them. At
this moment, this debugfs is a good tool, and it may provide
useful information for debug.
Signed-off-by: Tsang-Shian Lin <thlin@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>
2019-10-22 06:04:20 -04:00
|
|
|
stats->tx_throughput, stats->rx_throughput);
|
2022-02-14 19:48:50 -05:00
|
|
|
seq_printf(m, "1SS for TX and RX = %c\n\n", rtwdev->hal.txrx_1ss ?
|
|
|
|
'Y' : 'N');
|
rtw88: add phy_info debugfs to show Tx/Rx physical status
This commit adds several Tx/Rx physical information to phy_info
debugfs for 8822B/8822C. By this debugfs, we can know physical
information, such as Tx/Rx rate, RSSI, EVM,SNR, etc. The
information is gotten from the packets of Tx/Rx path. It has
no impact for the performance of 8822B/8822C.
In the fields, we may meet different kinds of problems, but
we may have no professional instrument to check them. At
this moment, this debugfs is a good tool, and it may provide
useful information for debug.
Signed-off-by: Tsang-Shian Lin <thlin@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>
2019-10-22 06:04:20 -04:00
|
|
|
|
|
|
|
seq_puts(m, "==========[Tx Phy Info]========\n");
|
|
|
|
seq_puts(m, "[Tx Rate] = ");
|
|
|
|
rtw_print_rate(m, dm_info->tx_rate);
|
|
|
|
seq_printf(m, "(0x%x)\n\n", dm_info->tx_rate);
|
|
|
|
|
|
|
|
seq_puts(m, "==========[Rx Phy Info]========\n");
|
|
|
|
seq_printf(m, "[Rx Beacon Count] = %u\n", last_cnt->num_bcn_pkt);
|
|
|
|
seq_puts(m, "[Rx Rate] = ");
|
|
|
|
rtw_print_rate(m, dm_info->curr_rx_rate);
|
|
|
|
seq_printf(m, "(0x%x)\n", dm_info->curr_rx_rate);
|
|
|
|
|
|
|
|
seq_puts(m, "[Rx Rate Count]:\n");
|
|
|
|
seq_printf(m, " * CCK = {%u, %u, %u, %u}\n",
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE1M],
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE2M],
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE5_5M],
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE11M]);
|
|
|
|
|
|
|
|
seq_printf(m, " * OFDM = {%u, %u, %u, %u, %u, %u, %u, %u}\n",
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE6M],
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE9M],
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE12M],
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE18M],
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE24M],
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE36M],
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE48M],
|
|
|
|
last_cnt->num_qry_pkt[DESC_RATE54M]);
|
|
|
|
|
|
|
|
for (ss = 0; ss < efuse->hw_cap.nss; ss++) {
|
|
|
|
rate_id = DESC_RATEMCS0 + ss * 8;
|
|
|
|
seq_printf(m, " * HT_MCS[%u:%u] = {%u, %u, %u, %u, %u, %u, %u, %u}\n",
|
|
|
|
ss * 8, ss * 8 + 7,
|
|
|
|
last_cnt->num_qry_pkt[rate_id],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 1],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 2],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 3],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 4],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 5],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 6],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 7]);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (ss = 0; ss < efuse->hw_cap.nss; ss++) {
|
|
|
|
rate_id = DESC_RATEVHT1SS_MCS0 + ss * 10;
|
|
|
|
seq_printf(m, " * VHT_MCS-%uss MCS[0:9] = {%u, %u, %u, %u, %u, %u, %u, %u, %u, %u}\n",
|
|
|
|
ss + 1,
|
|
|
|
last_cnt->num_qry_pkt[rate_id],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 1],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 2],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 3],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 4],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 5],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 6],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 7],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 8],
|
|
|
|
last_cnt->num_qry_pkt[rate_id + 9]);
|
|
|
|
}
|
|
|
|
|
|
|
|
seq_printf(m, "[RSSI(dBm)] = {%d, %d}\n",
|
|
|
|
dm_info->rssi[RF_PATH_A] - 100,
|
|
|
|
dm_info->rssi[RF_PATH_B] - 100);
|
|
|
|
seq_printf(m, "[Rx EVM(dB)] = {-%d, -%d}\n",
|
|
|
|
dm_info->rx_evm_dbm[RF_PATH_A],
|
|
|
|
dm_info->rx_evm_dbm[RF_PATH_B]);
|
|
|
|
seq_printf(m, "[Rx SNR] = {%d, %d}\n",
|
|
|
|
dm_info->rx_snr[RF_PATH_A],
|
|
|
|
dm_info->rx_snr[RF_PATH_B]);
|
|
|
|
seq_printf(m, "[CFO_tail(KHz)] = {%d, %d}\n",
|
|
|
|
dm_info->cfo_tail[RF_PATH_A],
|
|
|
|
dm_info->cfo_tail[RF_PATH_B]);
|
|
|
|
|
|
|
|
if (dm_info->curr_rx_rate >= DESC_RATE11M) {
|
|
|
|
seq_puts(m, "[Rx Average Status]:\n");
|
|
|
|
seq_printf(m, " * OFDM, EVM: {-%d}, SNR: {%d}\n",
|
|
|
|
(u8)ewma_evm_read(&ewma_evm[RTW_EVM_OFDM]),
|
|
|
|
(u8)ewma_snr_read(&ewma_snr[RTW_SNR_OFDM_A]));
|
|
|
|
seq_printf(m, " * 1SS, EVM: {-%d}, SNR: {%d}\n",
|
|
|
|
(u8)ewma_evm_read(&ewma_evm[RTW_EVM_1SS]),
|
|
|
|
(u8)ewma_snr_read(&ewma_snr[RTW_SNR_1SS_A]));
|
|
|
|
seq_printf(m, " * 2SS, EVM: {-%d, -%d}, SNR: {%d, %d}\n",
|
|
|
|
(u8)ewma_evm_read(&ewma_evm[RTW_EVM_2SS_A]),
|
|
|
|
(u8)ewma_evm_read(&ewma_evm[RTW_EVM_2SS_B]),
|
|
|
|
(u8)ewma_snr_read(&ewma_snr[RTW_SNR_2SS_A]),
|
|
|
|
(u8)ewma_snr_read(&ewma_snr[RTW_SNR_2SS_B]));
|
|
|
|
}
|
|
|
|
|
|
|
|
seq_puts(m, "[Rx Counter]:\n");
|
|
|
|
seq_printf(m, " * CCA (CCK, OFDM, Total) = (%u, %u, %u)\n",
|
|
|
|
dm_info->cck_cca_cnt,
|
|
|
|
dm_info->ofdm_cca_cnt,
|
|
|
|
dm_info->total_cca_cnt);
|
|
|
|
seq_printf(m, " * False Alarm (CCK, OFDM, Total) = (%u, %u, %u)\n",
|
|
|
|
dm_info->cck_fa_cnt,
|
|
|
|
dm_info->ofdm_fa_cnt,
|
|
|
|
dm_info->total_fa_cnt);
|
|
|
|
seq_printf(m, " * CCK cnt (ok, err) = (%u, %u)\n",
|
|
|
|
dm_info->cck_ok_cnt, dm_info->cck_err_cnt);
|
|
|
|
seq_printf(m, " * OFDM cnt (ok, err) = (%u, %u)\n",
|
|
|
|
dm_info->ofdm_ok_cnt, dm_info->ofdm_err_cnt);
|
|
|
|
seq_printf(m, " * HT cnt (ok, err) = (%u, %u)\n",
|
|
|
|
dm_info->ht_ok_cnt, dm_info->ht_err_cnt);
|
|
|
|
seq_printf(m, " * VHT cnt (ok, err) = (%u, %u)\n",
|
|
|
|
dm_info->vht_ok_cnt, dm_info->vht_err_cnt);
|
rtw88: add a debugfs entry to dump coex's info
Add a new entry "coex_info" in debugfs to dump coex's states for
us to debug on coex's issues.
The basic concept for co-existence (coex, usually for WiFi + BT)
is to decide a strategy based on the current status of WiFi and
BT. So, it means the WiFi driver requires to gather information
from BT side and choose a strategy (TDMA/table/HW settings).
Althrough we can easily check the current status of WiFi, e.g.,
from kernel log or just dump the hardware registers, it is still
very difficult for us to gather so many different types of WiFi
states (such as RFE config, antenna, channel/band, TRX, Power
save). Also we will need BT's information that is stored in
"struct rtw_coex". So it is necessary for us to have a debugfs
that can dump all of the WiFi/BT information required.
Note that to debug on coex related issues, we usually need a
longer period of time of coex_info dump every 2 seconds (for
example, 30 secs, so we should have 15 times of coex_info's
dump).
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200313033008.20070-2-yhchuang@realtek.com
2020-03-12 23:30:06 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debugfs_get_coex_info(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
|
2022-12-02 03:12:18 -05:00
|
|
|
mutex_lock(&rtwdev->mutex);
|
rtw88: add a debugfs entry to dump coex's info
Add a new entry "coex_info" in debugfs to dump coex's states for
us to debug on coex's issues.
The basic concept for co-existence (coex, usually for WiFi + BT)
is to decide a strategy based on the current status of WiFi and
BT. So, it means the WiFi driver requires to gather information
from BT side and choose a strategy (TDMA/table/HW settings).
Althrough we can easily check the current status of WiFi, e.g.,
from kernel log or just dump the hardware registers, it is still
very difficult for us to gather so many different types of WiFi
states (such as RFE config, antenna, channel/band, TRX, Power
save). Also we will need BT's information that is stored in
"struct rtw_coex". So it is necessary for us to have a debugfs
that can dump all of the WiFi/BT information required.
Note that to debug on coex related issues, we usually need a
longer period of time of coex_info dump every 2 seconds (for
example, 30 secs, so we should have 15 times of coex_info's
dump).
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200313033008.20070-2-yhchuang@realtek.com
2020-03-12 23:30:06 -04:00
|
|
|
rtw_coex_display_coex_info(rtwdev, m);
|
2022-12-02 03:12:18 -05:00
|
|
|
mutex_unlock(&rtwdev->mutex);
|
rtw88: add a debugfs entry to dump coex's info
Add a new entry "coex_info" in debugfs to dump coex's states for
us to debug on coex's issues.
The basic concept for co-existence (coex, usually for WiFi + BT)
is to decide a strategy based on the current status of WiFi and
BT. So, it means the WiFi driver requires to gather information
from BT side and choose a strategy (TDMA/table/HW settings).
Althrough we can easily check the current status of WiFi, e.g.,
from kernel log or just dump the hardware registers, it is still
very difficult for us to gather so many different types of WiFi
states (such as RFE config, antenna, channel/band, TRX, Power
save). Also we will need BT's information that is stored in
"struct rtw_coex". So it is necessary for us to have a debugfs
that can dump all of the WiFi/BT information required.
Note that to debug on coex related issues, we usually need a
longer period of time of coex_info dump every 2 seconds (for
example, 30 secs, so we should have 15 times of coex_info's
dump).
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200313033008.20070-2-yhchuang@realtek.com
2020-03-12 23:30:06 -04:00
|
|
|
|
rtw88: add phy_info debugfs to show Tx/Rx physical status
This commit adds several Tx/Rx physical information to phy_info
debugfs for 8822B/8822C. By this debugfs, we can know physical
information, such as Tx/Rx rate, RSSI, EVM,SNR, etc. The
information is gotten from the packets of Tx/Rx path. It has
no impact for the performance of 8822B/8822C.
In the fields, we may meet different kinds of problems, but
we may have no professional instrument to check them. At
this moment, this debugfs is a good tool, and it may provide
useful information for debug.
Signed-off-by: Tsang-Shian Lin <thlin@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>
2019-10-22 06:04:20 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-03-12 23:30:07 -04:00
|
|
|
static ssize_t rtw_debugfs_set_coex_enable(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
struct rtw_coex *coex = &rtwdev->coex;
|
|
|
|
bool enable;
|
|
|
|
int ret;
|
|
|
|
|
2024-01-10 08:29:28 -05:00
|
|
|
ret = kstrtobool_from_user(buffer, count, &enable);
|
2023-04-26 13:02:21 -04:00
|
|
|
if (ret)
|
|
|
|
return ret;
|
2020-03-12 23:30:07 -04:00
|
|
|
|
|
|
|
mutex_lock(&rtwdev->mutex);
|
2021-01-12 04:50:40 -05:00
|
|
|
coex->manual_control = !enable;
|
2020-03-12 23:30:07 -04:00
|
|
|
mutex_unlock(&rtwdev->mutex);
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debugfs_get_coex_enable(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
struct rtw_coex *coex = &rtwdev->coex;
|
|
|
|
|
|
|
|
seq_printf(m, "coex mechanism %s\n",
|
2020-11-09 03:59:04 -05:00
|
|
|
coex->manual_control ? "disabled" : "enabled");
|
2020-03-12 23:30:07 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
rtw88: support adaptivity for ETSI/JP DFS region
Add Energy Detected CCA (EDCCA) mechanism to detect energy on the channel.
And EDCCA support adaptivity mode now. From MIC Ordinance Regulating Radio
Equipment article 49.20, ETSI EN-300-328 and EN-301-893, the device should
be able to dynamically pause TX activity when energy detected on the air.
According to ETSI/JP DFS region, driver will set corresponding threshold
and stop TX activity if the detected energy exceeds the threshold. For now,
we support it on 8822b and 8822c first.
By default, EDCCA mechanism is turned on. For ETSI/JP DFS region, it will
turn to adaptivity mode. However, with adaptivity, if environment is too
noisy, TX may often be halted. So, a debugfs for EDCCA is added. It can
show what EDCCA mode is used currently. And EDCCA mechanism can be turned
on/off through the debugfs while debugging.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210830072014.12250-4-pkshih@realtek.com
2021-08-30 03:20:13 -04:00
|
|
|
static ssize_t rtw_debugfs_set_edcca_enable(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
bool input;
|
|
|
|
int err;
|
|
|
|
|
|
|
|
err = kstrtobool_from_user(buffer, count, &input);
|
|
|
|
if (err)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
rtw_edcca_enabled = input;
|
|
|
|
rtw_phy_adaptivity_set_mode(rtwdev);
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debugfs_get_edcca_enable(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
|
|
|
|
|
|
|
seq_printf(m, "EDCCA %s: EDCCA mode %d\n",
|
|
|
|
rtw_edcca_enabled ? "enabled" : "disabled",
|
|
|
|
dm_info->edcca_mode);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
rtw88: 8822c: support FW crash dump when FW crash
Although FW crash logs are already supported for dumping in driver, the
logs may not be sufficient to analyze field issues. To improve this part,
we add a support to dump FW memory.
When driver receives FW crash notifications, driver uses DDMA, which is a
HW ability, to copy specified FW memory to FW fifo. Driver can then dump
these information from FW fifo. With this support, not only FW crash log
but also specified FW memory will be dumped while FW crash. Besides,
specified registers are also dumped.
This feature is implemeted on 8822C first due to difference of FW layouts
between ICs. In addition, we add a debugfs to trigger FW crash. It can
simulate the process of crash, dump and reset. Through it, we can also
check if a reset is ongoing.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210309060121.9099-1-pkshih@realtek.com
2021-03-09 01:01:21 -05:00
|
|
|
static ssize_t rtw_debugfs_set_fw_crash(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
bool input;
|
|
|
|
int ret;
|
|
|
|
|
2024-01-10 08:29:28 -05:00
|
|
|
ret = kstrtobool_from_user(buffer, count, &input);
|
2023-04-26 13:02:21 -04:00
|
|
|
if (ret)
|
|
|
|
return ret;
|
rtw88: 8822c: support FW crash dump when FW crash
Although FW crash logs are already supported for dumping in driver, the
logs may not be sufficient to analyze field issues. To improve this part,
we add a support to dump FW memory.
When driver receives FW crash notifications, driver uses DDMA, which is a
HW ability, to copy specified FW memory to FW fifo. Driver can then dump
these information from FW fifo. With this support, not only FW crash log
but also specified FW memory will be dumped while FW crash. Besides,
specified registers are also dumped.
This feature is implemeted on 8822C first due to difference of FW layouts
between ICs. In addition, we add a debugfs to trigger FW crash. It can
simulate the process of crash, dump and reset. Through it, we can also
check if a reset is ongoing.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210309060121.9099-1-pkshih@realtek.com
2021-03-09 01:01:21 -05:00
|
|
|
|
|
|
|
if (!input)
|
|
|
|
return -EINVAL;
|
|
|
|
|
2021-05-27 23:29:00 -04:00
|
|
|
if (test_bit(RTW_FLAG_RESTARTING, rtwdev->flags))
|
|
|
|
return -EINPROGRESS;
|
|
|
|
|
|
|
|
mutex_lock(&rtwdev->mutex);
|
|
|
|
rtw_leave_lps_deep(rtwdev);
|
2021-10-01 04:23:01 -04:00
|
|
|
set_bit(RTW_FLAG_RESTART_TRIGGERING, rtwdev->flags);
|
rtw88: 8822c: support FW crash dump when FW crash
Although FW crash logs are already supported for dumping in driver, the
logs may not be sufficient to analyze field issues. To improve this part,
we add a support to dump FW memory.
When driver receives FW crash notifications, driver uses DDMA, which is a
HW ability, to copy specified FW memory to FW fifo. Driver can then dump
these information from FW fifo. With this support, not only FW crash log
but also specified FW memory will be dumped while FW crash. Besides,
specified registers are also dumped.
This feature is implemeted on 8822C first due to difference of FW layouts
between ICs. In addition, we add a debugfs to trigger FW crash. It can
simulate the process of crash, dump and reset. Through it, we can also
check if a reset is ongoing.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210309060121.9099-1-pkshih@realtek.com
2021-03-09 01:01:21 -05:00
|
|
|
rtw_write8(rtwdev, REG_HRCV_MSG, 1);
|
2021-05-27 23:29:00 -04:00
|
|
|
mutex_unlock(&rtwdev->mutex);
|
rtw88: 8822c: support FW crash dump when FW crash
Although FW crash logs are already supported for dumping in driver, the
logs may not be sufficient to analyze field issues. To improve this part,
we add a support to dump FW memory.
When driver receives FW crash notifications, driver uses DDMA, which is a
HW ability, to copy specified FW memory to FW fifo. Driver can then dump
these information from FW fifo. With this support, not only FW crash log
but also specified FW memory will be dumped while FW crash. Besides,
specified registers are also dumped.
This feature is implemeted on 8822C first due to difference of FW layouts
between ICs. In addition, we add a debugfs to trigger FW crash. It can
simulate the process of crash, dump and reset. Through it, we can also
check if a reset is ongoing.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210309060121.9099-1-pkshih@realtek.com
2021-03-09 01:01:21 -05:00
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debugfs_get_fw_crash(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
|
2021-10-01 04:23:01 -04:00
|
|
|
seq_printf(m, "%d\n",
|
|
|
|
test_bit(RTW_FLAG_RESTART_TRIGGERING, rtwdev->flags) ||
|
|
|
|
test_bit(RTW_FLAG_RESTARTING, rtwdev->flags));
|
rtw88: 8822c: support FW crash dump when FW crash
Although FW crash logs are already supported for dumping in driver, the
logs may not be sufficient to analyze field issues. To improve this part,
we add a support to dump FW memory.
When driver receives FW crash notifications, driver uses DDMA, which is a
HW ability, to copy specified FW memory to FW fifo. Driver can then dump
these information from FW fifo. With this support, not only FW crash log
but also specified FW memory will be dumped while FW crash. Besides,
specified registers are also dumped.
This feature is implemeted on 8822C first due to difference of FW layouts
between ICs. In addition, we add a debugfs to trigger FW crash. It can
simulate the process of crash, dump and reset. Through it, we can also
check if a reset is ongoing.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210309060121.9099-1-pkshih@realtek.com
2021-03-09 01:01:21 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-11-01 22:24:54 -04:00
|
|
|
static ssize_t rtw_debugfs_set_force_lowest_basic_rate(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
bool input;
|
|
|
|
int err;
|
|
|
|
|
|
|
|
err = kstrtobool_from_user(buffer, count, &input);
|
|
|
|
if (err)
|
|
|
|
return err;
|
|
|
|
|
|
|
|
if (input)
|
|
|
|
set_bit(RTW_FLAG_FORCE_LOWEST_RATE, rtwdev->flags);
|
|
|
|
else
|
|
|
|
clear_bit(RTW_FLAG_FORCE_LOWEST_RATE, rtwdev->flags);
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debugfs_get_force_lowest_basic_rate(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
|
|
|
|
seq_printf(m, "force lowest basic rate: %d\n",
|
|
|
|
test_bit(RTW_FLAG_FORCE_LOWEST_RATE, rtwdev->flags));
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-04-18 20:37:48 -04:00
|
|
|
static ssize_t rtw_debugfs_set_dm_cap(struct file *filp,
|
|
|
|
const char __user *buffer,
|
|
|
|
size_t count, loff_t *loff)
|
|
|
|
{
|
|
|
|
struct seq_file *seqpriv = (struct seq_file *)filp->private_data;
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = seqpriv->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
2024-01-10 08:29:28 -05:00
|
|
|
int ret, bit;
|
2021-04-18 20:37:48 -04:00
|
|
|
bool en;
|
|
|
|
|
2024-01-10 08:29:28 -05:00
|
|
|
ret = kstrtoint_from_user(buffer, count, 10, &bit);
|
|
|
|
if (ret)
|
|
|
|
return ret;
|
2021-04-18 20:37:48 -04:00
|
|
|
|
|
|
|
en = bit > 0;
|
|
|
|
bit = abs(bit);
|
|
|
|
|
|
|
|
if (bit >= RTW_DM_CAP_NUM) {
|
|
|
|
rtw_warn(rtwdev, "unknown DM CAP %d\n", bit);
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (en)
|
|
|
|
dm_info->dm_flags &= ~BIT(bit);
|
|
|
|
else
|
|
|
|
dm_info->dm_flags |= BIT(bit);
|
|
|
|
|
|
|
|
debugfs_priv->dm_cap.bit = bit;
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void dump_gapk_status(struct rtw_dev *rtwdev, struct seq_file *m)
|
|
|
|
{
|
|
|
|
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
|
|
|
struct rtw_gapk_info *txgapk = &rtwdev->dm_info.gapk;
|
|
|
|
int i, path;
|
|
|
|
u32 val;
|
|
|
|
|
|
|
|
seq_printf(m, "\n(%2d) %c%s\n\n", RTW_DM_CAP_TXGAPK,
|
|
|
|
dm_info->dm_flags & BIT(RTW_DM_CAP_TXGAPK) ? '-' : '+',
|
|
|
|
rtw_dm_cap_strs[RTW_DM_CAP_TXGAPK]);
|
|
|
|
|
2022-12-02 03:12:16 -05:00
|
|
|
mutex_lock(&rtwdev->mutex);
|
|
|
|
|
2021-04-18 20:37:48 -04:00
|
|
|
for (path = 0; path < rtwdev->hal.rf_path_num; path++) {
|
|
|
|
val = rtw_read_rf(rtwdev, path, RF_GAINTX, RFREG_MASK);
|
|
|
|
seq_printf(m, "path %d:\n0x%x = 0x%x\n", path, RF_GAINTX, val);
|
|
|
|
|
|
|
|
for (i = 0; i < RF_HW_OFFSET_NUM; i++)
|
|
|
|
seq_printf(m, "[TXGAPK] offset %d %d\n",
|
|
|
|
txgapk->rf3f_fs[path][i], i);
|
|
|
|
seq_puts(m, "\n");
|
|
|
|
}
|
2022-12-02 03:12:16 -05:00
|
|
|
mutex_unlock(&rtwdev->mutex);
|
2021-04-18 20:37:48 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static int rtw_debugfs_get_dm_cap(struct seq_file *m, void *v)
|
|
|
|
{
|
|
|
|
struct rtw_debugfs_priv *debugfs_priv = m->private;
|
|
|
|
struct rtw_dev *rtwdev = debugfs_priv->rtwdev;
|
|
|
|
struct rtw_dm_info *dm_info = &rtwdev->dm_info;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
switch (debugfs_priv->dm_cap.bit) {
|
|
|
|
case RTW_DM_CAP_TXGAPK:
|
|
|
|
dump_gapk_status(rtwdev, m);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
for (i = 1; i < RTW_DM_CAP_NUM; i++) {
|
|
|
|
seq_printf(m, "(%2d) %c%s\n", i,
|
|
|
|
dm_info->dm_flags & BIT(i) ? '-' : '+',
|
|
|
|
rtw_dm_cap_strs[i]);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
debugfs_priv->dm_cap.bit = RTW_DM_CAP_NA;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
#define rtw_debug_impl_mac(page, addr) \
|
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_mac_ ##page = { \
|
|
|
|
.cb_read = rtw_debug_get_mac_page, \
|
|
|
|
.cb_data = addr, \
|
|
|
|
}
|
|
|
|
|
|
|
|
rtw_debug_impl_mac(0, 0x0000);
|
|
|
|
rtw_debug_impl_mac(1, 0x0100);
|
|
|
|
rtw_debug_impl_mac(2, 0x0200);
|
|
|
|
rtw_debug_impl_mac(3, 0x0300);
|
|
|
|
rtw_debug_impl_mac(4, 0x0400);
|
|
|
|
rtw_debug_impl_mac(5, 0x0500);
|
|
|
|
rtw_debug_impl_mac(6, 0x0600);
|
|
|
|
rtw_debug_impl_mac(7, 0x0700);
|
|
|
|
rtw_debug_impl_mac(10, 0x1000);
|
|
|
|
rtw_debug_impl_mac(11, 0x1100);
|
|
|
|
rtw_debug_impl_mac(12, 0x1200);
|
|
|
|
rtw_debug_impl_mac(13, 0x1300);
|
|
|
|
rtw_debug_impl_mac(14, 0x1400);
|
|
|
|
rtw_debug_impl_mac(15, 0x1500);
|
|
|
|
rtw_debug_impl_mac(16, 0x1600);
|
|
|
|
rtw_debug_impl_mac(17, 0x1700);
|
|
|
|
|
|
|
|
#define rtw_debug_impl_bb(page, addr) \
|
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_bb_ ##page = { \
|
|
|
|
.cb_read = rtw_debug_get_bb_page, \
|
|
|
|
.cb_data = addr, \
|
|
|
|
}
|
|
|
|
|
|
|
|
rtw_debug_impl_bb(8, 0x0800);
|
|
|
|
rtw_debug_impl_bb(9, 0x0900);
|
|
|
|
rtw_debug_impl_bb(a, 0x0a00);
|
|
|
|
rtw_debug_impl_bb(b, 0x0b00);
|
|
|
|
rtw_debug_impl_bb(c, 0x0c00);
|
|
|
|
rtw_debug_impl_bb(d, 0x0d00);
|
|
|
|
rtw_debug_impl_bb(e, 0x0e00);
|
|
|
|
rtw_debug_impl_bb(f, 0x0f00);
|
|
|
|
rtw_debug_impl_bb(18, 0x1800);
|
|
|
|
rtw_debug_impl_bb(19, 0x1900);
|
|
|
|
rtw_debug_impl_bb(1a, 0x1a00);
|
|
|
|
rtw_debug_impl_bb(1b, 0x1b00);
|
|
|
|
rtw_debug_impl_bb(1c, 0x1c00);
|
|
|
|
rtw_debug_impl_bb(1d, 0x1d00);
|
|
|
|
rtw_debug_impl_bb(1e, 0x1e00);
|
|
|
|
rtw_debug_impl_bb(1f, 0x1f00);
|
|
|
|
rtw_debug_impl_bb(2c, 0x2c00);
|
|
|
|
rtw_debug_impl_bb(2d, 0x2d00);
|
|
|
|
rtw_debug_impl_bb(40, 0x4000);
|
|
|
|
rtw_debug_impl_bb(41, 0x4100);
|
|
|
|
|
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_rf_dump = {
|
|
|
|
.cb_read = rtw_debug_get_rf_dump,
|
|
|
|
};
|
|
|
|
|
2019-07-16 01:28:20 -04:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_tx_pwr_tbl = {
|
|
|
|
.cb_read = rtw_debugfs_get_tx_pwr_tbl,
|
|
|
|
};
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_write_reg = {
|
|
|
|
.cb_write = rtw_debugfs_set_write_reg,
|
|
|
|
};
|
|
|
|
|
2020-07-17 02:49:37 -04:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_h2c = {
|
|
|
|
.cb_write = rtw_debugfs_set_h2c,
|
|
|
|
};
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_rf_write = {
|
|
|
|
.cb_write = rtw_debugfs_set_rf_write,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_rf_read = {
|
|
|
|
.cb_write = rtw_debugfs_set_rf_read,
|
|
|
|
.cb_read = rtw_debugfs_get_rf_read,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_read_reg = {
|
|
|
|
.cb_write = rtw_debugfs_set_read_reg,
|
|
|
|
.cb_read = rtw_debugfs_get_read_reg,
|
|
|
|
};
|
|
|
|
|
2021-11-28 21:05:06 -05:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_fix_rate = {
|
|
|
|
.cb_write = rtw_debugfs_set_fix_rate,
|
|
|
|
.cb_read = rtw_debugfs_get_fix_rate,
|
|
|
|
};
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_dump_cam = {
|
|
|
|
.cb_write = rtw_debugfs_set_single_input,
|
|
|
|
.cb_read = rtw_debugfs_get_dump_cam,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_rsvd_page = {
|
|
|
|
.cb_write = rtw_debugfs_set_rsvd_page,
|
|
|
|
.cb_read = rtw_debugfs_get_rsvd_page,
|
|
|
|
};
|
|
|
|
|
rtw88: add phy_info debugfs to show Tx/Rx physical status
This commit adds several Tx/Rx physical information to phy_info
debugfs for 8822B/8822C. By this debugfs, we can know physical
information, such as Tx/Rx rate, RSSI, EVM,SNR, etc. The
information is gotten from the packets of Tx/Rx path. It has
no impact for the performance of 8822B/8822C.
In the fields, we may meet different kinds of problems, but
we may have no professional instrument to check them. At
this moment, this debugfs is a good tool, and it may provide
useful information for debug.
Signed-off-by: Tsang-Shian Lin <thlin@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>
2019-10-22 06:04:20 -04:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_phy_info = {
|
|
|
|
.cb_read = rtw_debugfs_get_phy_info,
|
|
|
|
};
|
|
|
|
|
2020-03-12 23:30:07 -04:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_coex_enable = {
|
|
|
|
.cb_write = rtw_debugfs_set_coex_enable,
|
|
|
|
.cb_read = rtw_debugfs_get_coex_enable,
|
|
|
|
};
|
|
|
|
|
rtw88: add a debugfs entry to dump coex's info
Add a new entry "coex_info" in debugfs to dump coex's states for
us to debug on coex's issues.
The basic concept for co-existence (coex, usually for WiFi + BT)
is to decide a strategy based on the current status of WiFi and
BT. So, it means the WiFi driver requires to gather information
from BT side and choose a strategy (TDMA/table/HW settings).
Althrough we can easily check the current status of WiFi, e.g.,
from kernel log or just dump the hardware registers, it is still
very difficult for us to gather so many different types of WiFi
states (such as RFE config, antenna, channel/band, TRX, Power
save). Also we will need BT's information that is stored in
"struct rtw_coex". So it is necessary for us to have a debugfs
that can dump all of the WiFi/BT information required.
Note that to debug on coex related issues, we usually need a
longer period of time of coex_info dump every 2 seconds (for
example, 30 secs, so we should have 15 times of coex_info's
dump).
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200313033008.20070-2-yhchuang@realtek.com
2020-03-12 23:30:06 -04:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_coex_info = {
|
|
|
|
.cb_read = rtw_debugfs_get_coex_info,
|
|
|
|
};
|
|
|
|
|
rtw88: support adaptivity for ETSI/JP DFS region
Add Energy Detected CCA (EDCCA) mechanism to detect energy on the channel.
And EDCCA support adaptivity mode now. From MIC Ordinance Regulating Radio
Equipment article 49.20, ETSI EN-300-328 and EN-301-893, the device should
be able to dynamically pause TX activity when energy detected on the air.
According to ETSI/JP DFS region, driver will set corresponding threshold
and stop TX activity if the detected energy exceeds the threshold. For now,
we support it on 8822b and 8822c first.
By default, EDCCA mechanism is turned on. For ETSI/JP DFS region, it will
turn to adaptivity mode. However, with adaptivity, if environment is too
noisy, TX may often be halted. So, a debugfs for EDCCA is added. It can
show what EDCCA mode is used currently. And EDCCA mechanism can be turned
on/off through the debugfs while debugging.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210830072014.12250-4-pkshih@realtek.com
2021-08-30 03:20:13 -04:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_edcca_enable = {
|
|
|
|
.cb_write = rtw_debugfs_set_edcca_enable,
|
|
|
|
.cb_read = rtw_debugfs_get_edcca_enable,
|
|
|
|
};
|
|
|
|
|
rtw88: 8822c: support FW crash dump when FW crash
Although FW crash logs are already supported for dumping in driver, the
logs may not be sufficient to analyze field issues. To improve this part,
we add a support to dump FW memory.
When driver receives FW crash notifications, driver uses DDMA, which is a
HW ability, to copy specified FW memory to FW fifo. Driver can then dump
these information from FW fifo. With this support, not only FW crash log
but also specified FW memory will be dumped while FW crash. Besides,
specified registers are also dumped.
This feature is implemeted on 8822C first due to difference of FW layouts
between ICs. In addition, we add a debugfs to trigger FW crash. It can
simulate the process of crash, dump and reset. Through it, we can also
check if a reset is ongoing.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210309060121.9099-1-pkshih@realtek.com
2021-03-09 01:01:21 -05:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_fw_crash = {
|
|
|
|
.cb_write = rtw_debugfs_set_fw_crash,
|
|
|
|
.cb_read = rtw_debugfs_get_fw_crash,
|
|
|
|
};
|
|
|
|
|
2021-11-01 22:24:54 -04:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_force_lowest_basic_rate = {
|
|
|
|
.cb_write = rtw_debugfs_set_force_lowest_basic_rate,
|
|
|
|
.cb_read = rtw_debugfs_get_force_lowest_basic_rate,
|
|
|
|
};
|
|
|
|
|
2021-04-18 20:37:48 -04:00
|
|
|
static struct rtw_debugfs_priv rtw_debug_priv_dm_cap = {
|
|
|
|
.cb_write = rtw_debugfs_set_dm_cap,
|
|
|
|
.cb_read = rtw_debugfs_get_dm_cap,
|
|
|
|
};
|
|
|
|
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
#define rtw_debugfs_add_core(name, mode, fopname, parent) \
|
|
|
|
do { \
|
|
|
|
rtw_debug_priv_ ##name.rtwdev = rtwdev; \
|
2023-09-19 01:06:50 -04:00
|
|
|
if (IS_ERR(debugfs_create_file(#name, mode, \
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
parent, &rtw_debug_priv_ ##name,\
|
2023-09-19 01:06:50 -04:00
|
|
|
&file_ops_ ##fopname))) \
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
pr_debug("Unable to initialize debugfs:%s\n", \
|
|
|
|
#name); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define rtw_debugfs_add_w(name) \
|
|
|
|
rtw_debugfs_add_core(name, S_IFREG | 0222, common_write, debugfs_topdir)
|
|
|
|
#define rtw_debugfs_add_rw(name) \
|
|
|
|
rtw_debugfs_add_core(name, S_IFREG | 0666, single_rw, debugfs_topdir)
|
|
|
|
#define rtw_debugfs_add_r(name) \
|
|
|
|
rtw_debugfs_add_core(name, S_IFREG | 0444, single_r, debugfs_topdir)
|
|
|
|
|
|
|
|
void rtw_debugfs_init(struct rtw_dev *rtwdev)
|
|
|
|
{
|
2019-08-22 07:37:28 -04:00
|
|
|
struct dentry *debugfs_topdir;
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
debugfs_topdir = debugfs_create_dir("rtw88",
|
|
|
|
rtwdev->hw->wiphy->debugfsdir);
|
|
|
|
rtw_debugfs_add_w(write_reg);
|
|
|
|
rtw_debugfs_add_rw(read_reg);
|
|
|
|
rtw_debugfs_add_w(rf_write);
|
|
|
|
rtw_debugfs_add_rw(rf_read);
|
2021-11-28 21:05:06 -05:00
|
|
|
rtw_debugfs_add_rw(fix_rate);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
rtw_debugfs_add_rw(dump_cam);
|
|
|
|
rtw_debugfs_add_rw(rsvd_page);
|
rtw88: add phy_info debugfs to show Tx/Rx physical status
This commit adds several Tx/Rx physical information to phy_info
debugfs for 8822B/8822C. By this debugfs, we can know physical
information, such as Tx/Rx rate, RSSI, EVM,SNR, etc. The
information is gotten from the packets of Tx/Rx path. It has
no impact for the performance of 8822B/8822C.
In the fields, we may meet different kinds of problems, but
we may have no professional instrument to check them. At
this moment, this debugfs is a good tool, and it may provide
useful information for debug.
Signed-off-by: Tsang-Shian Lin <thlin@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>
2019-10-22 06:04:20 -04:00
|
|
|
rtw_debugfs_add_r(phy_info);
|
rtw88: add a debugfs entry to dump coex's info
Add a new entry "coex_info" in debugfs to dump coex's states for
us to debug on coex's issues.
The basic concept for co-existence (coex, usually for WiFi + BT)
is to decide a strategy based on the current status of WiFi and
BT. So, it means the WiFi driver requires to gather information
from BT side and choose a strategy (TDMA/table/HW settings).
Althrough we can easily check the current status of WiFi, e.g.,
from kernel log or just dump the hardware registers, it is still
very difficult for us to gather so many different types of WiFi
states (such as RFE config, antenna, channel/band, TRX, Power
save). Also we will need BT's information that is stored in
"struct rtw_coex". So it is necessary for us to have a debugfs
that can dump all of the WiFi/BT information required.
Note that to debug on coex related issues, we usually need a
longer period of time of coex_info dump every 2 seconds (for
example, 30 secs, so we should have 15 times of coex_info's
dump).
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Chris Chiu <chiu@endlessm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200313033008.20070-2-yhchuang@realtek.com
2020-03-12 23:30:06 -04:00
|
|
|
rtw_debugfs_add_r(coex_info);
|
2020-03-12 23:30:07 -04:00
|
|
|
rtw_debugfs_add_rw(coex_enable);
|
2020-07-17 02:49:37 -04:00
|
|
|
rtw_debugfs_add_w(h2c);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
rtw_debugfs_add_r(mac_0);
|
|
|
|
rtw_debugfs_add_r(mac_1);
|
|
|
|
rtw_debugfs_add_r(mac_2);
|
|
|
|
rtw_debugfs_add_r(mac_3);
|
|
|
|
rtw_debugfs_add_r(mac_4);
|
|
|
|
rtw_debugfs_add_r(mac_5);
|
|
|
|
rtw_debugfs_add_r(mac_6);
|
|
|
|
rtw_debugfs_add_r(mac_7);
|
|
|
|
rtw_debugfs_add_r(bb_8);
|
|
|
|
rtw_debugfs_add_r(bb_9);
|
|
|
|
rtw_debugfs_add_r(bb_a);
|
|
|
|
rtw_debugfs_add_r(bb_b);
|
|
|
|
rtw_debugfs_add_r(bb_c);
|
|
|
|
rtw_debugfs_add_r(bb_d);
|
|
|
|
rtw_debugfs_add_r(bb_e);
|
|
|
|
rtw_debugfs_add_r(bb_f);
|
|
|
|
rtw_debugfs_add_r(mac_10);
|
|
|
|
rtw_debugfs_add_r(mac_11);
|
|
|
|
rtw_debugfs_add_r(mac_12);
|
|
|
|
rtw_debugfs_add_r(mac_13);
|
|
|
|
rtw_debugfs_add_r(mac_14);
|
|
|
|
rtw_debugfs_add_r(mac_15);
|
|
|
|
rtw_debugfs_add_r(mac_16);
|
|
|
|
rtw_debugfs_add_r(mac_17);
|
|
|
|
rtw_debugfs_add_r(bb_18);
|
|
|
|
rtw_debugfs_add_r(bb_19);
|
|
|
|
rtw_debugfs_add_r(bb_1a);
|
|
|
|
rtw_debugfs_add_r(bb_1b);
|
|
|
|
rtw_debugfs_add_r(bb_1c);
|
|
|
|
rtw_debugfs_add_r(bb_1d);
|
|
|
|
rtw_debugfs_add_r(bb_1e);
|
|
|
|
rtw_debugfs_add_r(bb_1f);
|
|
|
|
if (rtwdev->chip->id == RTW_CHIP_TYPE_8822C) {
|
|
|
|
rtw_debugfs_add_r(bb_2c);
|
|
|
|
rtw_debugfs_add_r(bb_2d);
|
|
|
|
rtw_debugfs_add_r(bb_40);
|
|
|
|
rtw_debugfs_add_r(bb_41);
|
|
|
|
}
|
|
|
|
rtw_debugfs_add_r(rf_dump);
|
2019-07-16 01:28:20 -04:00
|
|
|
rtw_debugfs_add_r(tx_pwr_tbl);
|
rtw88: support adaptivity for ETSI/JP DFS region
Add Energy Detected CCA (EDCCA) mechanism to detect energy on the channel.
And EDCCA support adaptivity mode now. From MIC Ordinance Regulating Radio
Equipment article 49.20, ETSI EN-300-328 and EN-301-893, the device should
be able to dynamically pause TX activity when energy detected on the air.
According to ETSI/JP DFS region, driver will set corresponding threshold
and stop TX activity if the detected energy exceeds the threshold. For now,
we support it on 8822b and 8822c first.
By default, EDCCA mechanism is turned on. For ETSI/JP DFS region, it will
turn to adaptivity mode. However, with adaptivity, if environment is too
noisy, TX may often be halted. So, a debugfs for EDCCA is added. It can
show what EDCCA mode is used currently. And EDCCA mechanism can be turned
on/off through the debugfs while debugging.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210830072014.12250-4-pkshih@realtek.com
2021-08-30 03:20:13 -04:00
|
|
|
rtw_debugfs_add_rw(edcca_enable);
|
rtw88: 8822c: support FW crash dump when FW crash
Although FW crash logs are already supported for dumping in driver, the
logs may not be sufficient to analyze field issues. To improve this part,
we add a support to dump FW memory.
When driver receives FW crash notifications, driver uses DDMA, which is a
HW ability, to copy specified FW memory to FW fifo. Driver can then dump
these information from FW fifo. With this support, not only FW crash log
but also specified FW memory will be dumped while FW crash. Besides,
specified registers are also dumped.
This feature is implemeted on 8822C first due to difference of FW layouts
between ICs. In addition, we add a debugfs to trigger FW crash. It can
simulate the process of crash, dump and reset. Through it, we can also
check if a reset is ongoing.
Signed-off-by: Zong-Zhe Yang <kevin_yang@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/20210309060121.9099-1-pkshih@realtek.com
2021-03-09 01:01:21 -05:00
|
|
|
rtw_debugfs_add_rw(fw_crash);
|
2021-11-01 22:24:54 -04:00
|
|
|
rtw_debugfs_add_rw(force_lowest_basic_rate);
|
2021-04-18 20:37:48 -04:00
|
|
|
rtw_debugfs_add_rw(dm_cap);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* CONFIG_RTW88_DEBUGFS */
|
|
|
|
|
|
|
|
#ifdef CONFIG_RTW88_DEBUG
|
|
|
|
|
2023-11-22 01:14:29 -05:00
|
|
|
void rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask,
|
|
|
|
const char *fmt, ...)
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
{
|
|
|
|
struct va_format vaf = {
|
|
|
|
.fmt = fmt,
|
|
|
|
};
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
va_start(args, fmt);
|
|
|
|
vaf.va = &args;
|
|
|
|
|
|
|
|
if (rtw_debug_mask & mask)
|
|
|
|
dev_printk(KERN_DEBUG, rtwdev->dev, "%pV", &vaf);
|
|
|
|
|
|
|
|
va_end(args);
|
|
|
|
}
|
2023-11-22 01:14:29 -05:00
|
|
|
EXPORT_SYMBOL(rtw_dbg);
|
rtw88: new Realtek 802.11ac driver
This is a new mac80211 driver for Realtek 802.11ac wireless network chips.
rtw88 now supports RTL8822BE/RTL8822CE now, with basic station mode
functionalities. The firmware for both can be found at linux-firmware.
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
For RTL8822BE: rtw88/rtw8822b_fw.bin
For RTL8822CE: rtw88/rtw8822c_fw.bin
And for now, only PCI buses (RTL8xxxE) are supported. We will add support
for USB and SDIO in the future. The bus interface abstraction can be seen
in this driver such as hci.h. Most of the hardware setting are the same
except for some TRX path or probing setup should be separated.
Supported:
* Basic STA/AP/ADHOC mode, and TDLS (STA is well tested)
Missing feature:
* WOW/PNO
* USB & SDIO bus (such as RTL8xxxU/RTL8xxxS)
* BT coexistence (8822B/8822C are combo ICs)
* Multiple interfaces (for now single STA is better supported)
* Dynamic hardware calibrations (to improve/stabilize performance)
Potential problems:
* static calibration spends too much time, and it is painful for
driver to leave IDLE state. And slows down associate process.
But reload function are under development, will be added soon!
* TRX statictics misleading, as we are not reporting status correctly,
or say, not reporting for "every" packet.
The next patch set should have BT coexistence code since RTL8822B/C are
combo ICs, and the driver for BT can be found after Linux Kernel v4.20.
So it is better to add it first to make WiFi + BT work concurrently.
Although now rtw88 is simple but we are developing more features for it.
Even we want to add support for more chips such as RTL8821C/RTL8814B.
Finally, rtw88 has many authors, listed alphabetically:
Ping-Ke Shih <pkshih@realtek.com>
Tzu-En Huang <tehuang@realtek.com>
Yan-Hsuan Chuang <yhchuang@realtek.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-26 08:17:37 -04:00
|
|
|
|
|
|
|
#endif /* CONFIG_RTW88_DEBUG */
|