39535125255d9170d5965a08b46c6f22ad814690
[openwrt/staging/chunkeey.git] / target / linux / realtek / files-5.4 / drivers / net / dsa / rtl83xx / rtl83xx.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #ifndef _NET_DSA_RTL83XX_H
4 #define _NET_DSA_RTL83XX_H
5
6 #include <net/dsa.h>
7 #include "rtl838x.h"
8
9
10 #define RTL8380_VERSION_A 'A'
11 #define RTL8390_VERSION_A 'A'
12 #define RTL8380_VERSION_B 'B'
13
14 struct fdb_update_work {
15 struct work_struct work;
16 struct net_device *ndev;
17 u64 macs[];
18 };
19
20 #define MIB_DESC(_size, _offset, _name) {.size = _size, .offset = _offset, .name = _name}
21 struct rtl83xx_mib_desc {
22 unsigned int size;
23 unsigned int offset;
24 const char *name;
25 };
26
27 void __init rtl83xx_storm_control_init(struct rtl838x_switch_priv *priv);
28
29 /* RTL838x-specific */
30 u32 rtl838x_hash(struct rtl838x_switch_priv *priv, u64 seed);
31 irqreturn_t rtl838x_switch_irq(int irq, void *dev_id);
32 void rtl8380_get_version(struct rtl838x_switch_priv *priv);
33 void rtl838x_vlan_profile_dump(int index);
34 int rtl83xx_dsa_phy_read(struct dsa_switch *ds, int phy_addr, int phy_reg);
35
36 /* RTL839x-specific */
37 u32 rtl839x_hash(struct rtl838x_switch_priv *priv, u64 seed);
38 irqreturn_t rtl839x_switch_irq(int irq, void *dev_id);
39 void rtl8390_get_version(struct rtl838x_switch_priv *priv);
40 void rtl839x_vlan_profile_dump(int index);
41 int rtl83xx_dsa_phy_write(struct dsa_switch *ds, int phy_addr, int phy_reg, u16 val);
42
43 #endif /* _NET_DSA_RTL83XX_H */
44