Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
mariux64
/
linux
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
2
Pull requests
0
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
6d4ff8a
Documentation
LICENSES
arch
block
certs
crypto
drivers
accel
accessibility
acpi
amba
android
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cdrom
cdx
char
clk
clocksource
comedi
connector
counter
cpufreq
cpuidle
crypto
cxl
dax
dca
devfreq
dio
dma-buf
dma
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio
gpu
greybus
hid
hsi
hte
hv
hwmon
hwspinlock
hwtracing
i2c
i3c
idle
iio
infiniband
input
interconnect
iommu
ipack
irqchip
isdn
leds
macintosh
mailbox
mcb
md
media
memory
memstick
message
mfd
misc
mmc
most
mtd
mux
net
appletalk
arcnet
bonding
caif
can
dsa
ethernet
fddi
fjes
hamradio
hippi
hyperv
ieee802154
ipa
ipvlan
mctp
mdio
netdevsim
pcs
phy
plip
ppp
pse-pd
slip
team
thunderbolt
usb
vmxnet3
vxlan
wan
wireguard
wireless
admtek
ath
atmel
broadcom
cisco
intel
intersil
legacy
marvell
mediatek
mt76
mt7601u
Kconfig
Makefile
core.c
debugfs.c
dma.c
dma.h
eeprom.c
eeprom.h
init.c
initvals.h
initvals_phy.h
mac.c
mac.h
main.c
mcu.c
mcu.h
mt7601u.h
phy.c
regs.h
trace.c
trace.h
tx.c
usb.c
usb.h
util.c
Kconfig
Makefile
microchip
purelifi
quantenna
ralink
realtek
rsi
silabs
st
ti
virtual
zydas
Kconfig
Makefile
wwan
xen-netback
Kconfig
LICENSE.SRC
Makefile
Space.c
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
loopback.c
macsec.c
macvlan.c
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c
tun.c
veth.c
virtio_net.c
vrf.c
vsockmon.c
xen-netfront.c
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
parisc
parport
pci
pcmcia
peci
perf
phy
pinctrl
platform
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390
sbus
scsi
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging
target
tc
tee
thermal
thunderbolt
tty
ufs
uio
usb
vdpa
vfio
vhost
video
virt
virtio
vlynq
w1
watchdog
xen
zorro
Kconfig
Makefile
fs
include
init
io_uring
ipc
kernel
lib
mm
net
rust
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
drivers
/
net
/
wireless
/
mediatek
/
mt7601u
/
debugfs.c
Copy path
Blame
Blame
Latest commit
Wang Jikai
and
Kalle Valo
wifi: mt7601u: delete dead code checking debugfs returns
May 5, 2023
f3dc7bb
·
May 5, 2023
History
History
138 lines (109 loc) · 3.95 KB
Breadcrumbs
linux
/
drivers
/
net
/
wireless
/
mediatek
/
mt7601u
/
debugfs.c
Top
File metadata and controls
Code
Blame
138 lines (109 loc) · 3.95 KB
Raw
// SPDX-License-Identifier: GPL-2.0-only /* * Copyright (C) 2014 Felix Fietkau <nbd@openwrt.org> * Copyright (C) 2015 Jakub Kicinski <kubakici@wp.pl> */ #include <linux/debugfs.h> #include "mt7601u.h" #include "eeprom.h" static int mt76_reg_set(void *data, u64 val) { struct mt7601u_dev *dev = data; mt76_wr(dev, dev->debugfs_reg, val); return 0; } static int mt76_reg_get(void *data, u64 *val) { struct mt7601u_dev *dev = data; *val = mt76_rr(dev, dev->debugfs_reg); return 0; } DEFINE_DEBUGFS_ATTRIBUTE(fops_regval, mt76_reg_get, mt76_reg_set, "0x%08llx\n"); static int mt7601u_ampdu_stat_show(struct seq_file *file, void *data) { struct mt7601u_dev *dev = file->private; int i, j; #define stat_printf(grp, off, name) \ seq_printf(file, #name ":\t%llu\n", dev->stats.grp[off]) stat_printf(rx_stat, 0, rx_crc_err); stat_printf(rx_stat, 1, rx_phy_err); stat_printf(rx_stat, 2, rx_false_cca); stat_printf(rx_stat, 3, rx_plcp_err); stat_printf(rx_stat, 4, rx_fifo_overflow); stat_printf(rx_stat, 5, rx_duplicate); stat_printf(tx_stat, 0, tx_fail_cnt); stat_printf(tx_stat, 1, tx_bcn_cnt); stat_printf(tx_stat, 2, tx_success); stat_printf(tx_stat, 3, tx_retransmit); stat_printf(tx_stat, 4, tx_zero_len); stat_printf(tx_stat, 5, tx_underflow); stat_printf(aggr_stat, 0, non_aggr_tx); stat_printf(aggr_stat, 1, aggr_tx); stat_printf(zero_len_del, 0, tx_zero_len_del); stat_printf(zero_len_del, 1, rx_zero_len_del); #undef stat_printf seq_puts(file, "Aggregations stats:\n"); for (i = 0; i < 4; i++) { for (j = 0; j < 8; j++) seq_printf(file, "%08llx ", dev->stats.aggr_n[i * 8 + j]); seq_putc(file, '\n'); } seq_printf(file, "recent average AMPDU len: %d\n", atomic_read(&dev->avg_ampdu_len)); return 0; } DEFINE_SHOW_ATTRIBUTE(mt7601u_ampdu_stat); static int mt7601u_eeprom_param_show(struct seq_file *file, void *data) { struct mt7601u_dev *dev = file->private; struct mt7601u_rate_power *rp = &dev->ee->power_rate_table; struct tssi_data *td = &dev->ee->tssi_data; int i; seq_printf(file, "RF freq offset: %hhx\n", dev->ee->rf_freq_off); seq_printf(file, "RSSI offset: %hhx %hhx\n", dev->ee->rssi_offset[0], dev->ee->rssi_offset[1]); seq_printf(file, "Reference temp: %hhx\n", dev->ee->ref_temp); seq_printf(file, "LNA gain: %hhx\n", dev->ee->lna_gain); seq_printf(file, "Reg channels: %hhu-%d\n", dev->ee->reg.start, dev->ee->reg.start + dev->ee->reg.num - 1); seq_puts(file, "Per rate power:\n"); for (i = 0; i < 2; i++) seq_printf(file, "\t raw:%02hhx bw20:%02hhx bw40:%02hhx\n", rp->cck[i].raw, rp->cck[i].bw20, rp->cck[i].bw40); for (i = 0; i < 4; i++) seq_printf(file, "\t raw:%02hhx bw20:%02hhx bw40:%02hhx\n", rp->ofdm[i].raw, rp->ofdm[i].bw20, rp->ofdm[i].bw40); for (i = 0; i < 4; i++) seq_printf(file, "\t raw:%02hhx bw20:%02hhx bw40:%02hhx\n", rp->ht[i].raw, rp->ht[i].bw20, rp->ht[i].bw40); seq_puts(file, "Per channel power:\n"); for (i = 0; i < 7; i++) seq_printf(file, "\t tx_power ch%u:%02hhx ch%u:%02hhx\n", i * 2 + 1, dev->ee->chan_pwr[i * 2], i * 2 + 2, dev->ee->chan_pwr[i * 2 + 1]); if (!dev->ee->tssi_enabled) return 0; seq_puts(file, "TSSI:\n"); seq_printf(file, "\t slope:%02hhx\n", td->slope); seq_printf(file, "\t offset=%02hhx %02hhx %02hhx\n", td->offset[0], td->offset[1], td->offset[2]); seq_printf(file, "\t delta_off:%08x\n", td->tx0_delta_offset); return 0; } DEFINE_SHOW_ATTRIBUTE(mt7601u_eeprom_param); void mt7601u_init_debugfs(struct mt7601u_dev *dev) { struct dentry *dir; dir = debugfs_create_dir("mt7601u", dev->hw->wiphy->debugfsdir); debugfs_create_u8("temperature", 0400, dir, &dev->raw_temp); debugfs_create_u32("temp_mode", 0400, dir, &dev->temp_mode); debugfs_create_u32("regidx", 0600, dir, &dev->debugfs_reg); debugfs_create_file("regval", 0600, dir, dev, &fops_regval); debugfs_create_file("ampdu_stat", 0400, dir, dev, &mt7601u_ampdu_stat_fops); debugfs_create_file("eeprom_param", 0400, dir, dev, &mt7601u_eeprom_param_fops); }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
You can’t perform that action at this time.