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
7776e33
Documentation
LICENSES
arch
block
certs
crypto
drivers
accessibility
acpi
amba
android
ata
atm
auxdisplay
base
bcma
block
bluetooth
bus
cdrom
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
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
b53
hirschmann
microchip
mv88e6xxx
ocelot
qca
sja1105
xrs700x
Kconfig
Makefile
bcm_sf2.c
bcm_sf2.h
bcm_sf2_cfp.c
bcm_sf2_regs.h
dsa_loop.c
dsa_loop.h
dsa_loop_bdinfo.c
lan9303-core.c
lan9303.h
lan9303_i2c.c
lan9303_mdio.c
lantiq_gswip.c
lantiq_pce.h
mt7530.c
mt7530.h
mv88e6060.c
mv88e6060.h
qca8k.c
qca8k.h
realtek-smi-core.c
realtek-smi-core.h
rtl8366.c
rtl8366rb.c
vitesse-vsc73xx-core.c
vitesse-vsc73xx-platform.c
vitesse-vsc73xx-spi.c
vitesse-vsc73xx.h
ethernet
fddi
fjes
hamradio
hippi
hyperv
ieee802154
ipa
ipvlan
mctp
mdio
netdevsim
pcs
phy
plip
ppp
slip
team
usb
vmxnet3
wan
wireguard
wireless
wwan
xen-netback
Kconfig
LICENSE.SRC
Makefile
Space.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
thunderbolt.c
tun.c
veth.c
virtio_net.c
vrf.c
vsockmon.c
vxlan.c
xen-netfront.c
nfc
ntb
nubus
nvdimm
nvme
nvmem
of
opp
parisc
parport
pci
pcmcia
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
uio
usb
vdpa
vfio
vhost
video
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen
zorro
Kconfig
Makefile
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Breadcrumbs
linux
/
drivers
/
net
/
dsa
/
realtek-smi-core.h
Blame
Blame
Latest commit
History
History
146 lines (128 loc) · 4.25 KB
Breadcrumbs
linux
/
drivers
/
net
/
dsa
/
realtek-smi-core.h
Top
File metadata and controls
Code
Blame
146 lines (128 loc) · 4.25 KB
Raw
/* SPDX-License-Identifier: GPL-2.0+ */ /* Realtek SMI interface driver defines * * Copyright (C) 2017 Linus Walleij <linus.walleij@linaro.org> * Copyright (C) 2009-2010 Gabor Juhos <juhosg@openwrt.org> */ #ifndef _REALTEK_SMI_H #define _REALTEK_SMI_H #include <linux/phy.h> #include <linux/platform_device.h> #include <linux/gpio/consumer.h> #include <net/dsa.h> struct realtek_smi_ops; struct dentry; struct inode; struct file; struct rtl8366_mib_counter { unsigned int base; unsigned int offset; unsigned int length; const char *name; }; /** * struct rtl8366_vlan_mc - Virtual LAN member configuration */ struct rtl8366_vlan_mc { u16 vid; u16 untag; u16 member; u8 fid; u8 priority; }; struct rtl8366_vlan_4k { u16 vid; u16 untag; u16 member; u8 fid; }; struct realtek_smi { struct device *dev; struct gpio_desc *reset; struct gpio_desc *mdc; struct gpio_desc *mdio; struct regmap *map; struct mii_bus *slave_mii_bus; unsigned int clk_delay; u8 cmd_read; u8 cmd_write; spinlock_t lock; /* Locks around command writes */ struct dsa_switch *ds; struct irq_domain *irqdomain; bool leds_disabled; unsigned int cpu_port; unsigned int num_ports; unsigned int num_vlan_mc; unsigned int num_mib_counters; struct rtl8366_mib_counter *mib_counters; const struct realtek_smi_ops *ops; int vlan_enabled; int vlan4k_enabled; char buf[4096]; void *chip_data; /* Per-chip extra variant data */ }; /** * struct realtek_smi_ops - vtable for the per-SMI-chiptype operations * @detect: detects the chiptype */ struct realtek_smi_ops { int (*detect)(struct realtek_smi *smi); int (*reset_chip)(struct realtek_smi *smi); int (*setup)(struct realtek_smi *smi); void (*cleanup)(struct realtek_smi *smi); int (*get_mib_counter)(struct realtek_smi *smi, int port, struct rtl8366_mib_counter *mib, u64 *mibvalue); int (*get_vlan_mc)(struct realtek_smi *smi, u32 index, struct rtl8366_vlan_mc *vlanmc); int (*set_vlan_mc)(struct realtek_smi *smi, u32 index, const struct rtl8366_vlan_mc *vlanmc); int (*get_vlan_4k)(struct realtek_smi *smi, u32 vid, struct rtl8366_vlan_4k *vlan4k); int (*set_vlan_4k)(struct realtek_smi *smi, const struct rtl8366_vlan_4k *vlan4k); int (*get_mc_index)(struct realtek_smi *smi, int port, int *val); int (*set_mc_index)(struct realtek_smi *smi, int port, int index); bool (*is_vlan_valid)(struct realtek_smi *smi, unsigned int vlan); int (*enable_vlan)(struct realtek_smi *smi, bool enable); int (*enable_vlan4k)(struct realtek_smi *smi, bool enable); int (*enable_port)(struct realtek_smi *smi, int port, bool enable); int (*phy_read)(struct realtek_smi *smi, int phy, int regnum); int (*phy_write)(struct realtek_smi *smi, int phy, int regnum, u16 val); }; struct realtek_smi_variant { const struct dsa_switch_ops *ds_ops; const struct realtek_smi_ops *ops; unsigned int clk_delay; u8 cmd_read; u8 cmd_write; size_t chip_data_sz; }; /* SMI core calls */ int realtek_smi_write_reg_noack(struct realtek_smi *smi, u32 addr, u32 data); int realtek_smi_setup_mdio(struct realtek_smi *smi); /* RTL8366 library helpers */ int rtl8366_mc_is_used(struct realtek_smi *smi, int mc_index, int *used); int rtl8366_set_vlan(struct realtek_smi *smi, int vid, u32 member, u32 untag, u32 fid); int rtl8366_set_pvid(struct realtek_smi *smi, unsigned int port, unsigned int vid); int rtl8366_enable_vlan4k(struct realtek_smi *smi, bool enable); int rtl8366_enable_vlan(struct realtek_smi *smi, bool enable); int rtl8366_reset_vlan(struct realtek_smi *smi); int rtl8366_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering, struct netlink_ext_ack *extack); int rtl8366_vlan_add(struct dsa_switch *ds, int port, const struct switchdev_obj_port_vlan *vlan, struct netlink_ext_ack *extack); int rtl8366_vlan_del(struct dsa_switch *ds, int port, const struct switchdev_obj_port_vlan *vlan); void rtl8366_get_strings(struct dsa_switch *ds, int port, u32 stringset, uint8_t *data); int rtl8366_get_sset_count(struct dsa_switch *ds, int port, int sset); void rtl8366_get_ethtool_stats(struct dsa_switch *ds, int port, uint64_t *data); extern const struct realtek_smi_variant rtl8366rb_variant; #endif /* _REALTEK_SMI_H */
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
139
140
141
142
143
144
145
146
You can’t perform that action at this time.