diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:49:45 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:49:45 +0000 |
commit | 2c3c1048746a4622d8c89a29670120dc8fab93c4 (patch) | |
tree | 848558de17fb3008cdf4d861b01ac7781903ce39 /drivers/staging/rtl8723bs/core/rtw_debug.c | |
parent | Initial commit. (diff) | |
download | linux-2c3c1048746a4622d8c89a29670120dc8fab93c4.tar.xz linux-2c3c1048746a4622d8c89a29670120dc8fab93c4.zip |
Adding upstream version 6.1.76.upstream/6.1.76upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/staging/rtl8723bs/core/rtw_debug.c')
-rw-r--r-- | drivers/staging/rtl8723bs/core/rtw_debug.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/drivers/staging/rtl8723bs/core/rtw_debug.c b/drivers/staging/rtl8723bs/core/rtw_debug.c new file mode 100644 index 000000000..5354fdd11 --- /dev/null +++ b/drivers/staging/rtl8723bs/core/rtw_debug.c @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: GPL-2.0 +/****************************************************************************** + * + * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. + * + ******************************************************************************/ + +#include <drv_types.h> +#include <rtw_debug.h> +#include <hal_btcoex.h> + +#include <rtw_version.h> + +static void dump_4_regs(struct adapter *adapter, int offset) +{ + u32 reg[4]; + int i; + + for (i = 0; i < 4; i++) + reg[i] = rtw_read32(adapter, offset + i); + + netdev_dbg(adapter->pnetdev, "0x%03x 0x%08x 0x%08x 0x%08x 0x%08x\n", + i, reg[0], reg[1], reg[2], reg[3]); +} + +void mac_reg_dump(struct adapter *adapter) +{ + int i; + + netdev_dbg(adapter->pnetdev, "======= MAC REG =======\n"); + + for (i = 0x0; i < 0x800; i += 4) + dump_4_regs(adapter, i); +} + +void bb_reg_dump(struct adapter *adapter) +{ + int i; + + netdev_dbg(adapter->pnetdev, "======= BB REG =======\n"); + + for (i = 0x800; i < 0x1000 ; i += 4) + dump_4_regs(adapter, i); +} + +static void dump_4_rf_regs(struct adapter *adapter, int path, int offset) +{ + u8 reg[4]; + int i; + + for (i = 0; i < 4; i++) + reg[i] = rtw_hal_read_rfreg(adapter, path, offset + i, + 0xffffffff); + + netdev_dbg(adapter->pnetdev, "0x%02x 0x%08x 0x%08x 0x%08x 0x%08x\n", + i, reg[0], reg[1], reg[2], reg[3]); +} + +void rf_reg_dump(struct adapter *adapter) +{ + int i, path = 0; + + netdev_dbg(adapter->pnetdev, "======= RF REG =======\n"); + + netdev_dbg(adapter->pnetdev, "RF_Path(%x)\n", path); + for (i = 0; i < 0x100; i++) + dump_4_rf_regs(adapter, path, i); +} |