Revert "unicode: Don't special case ignorable code points"
[linux.git] / drivers / net / dsa / vitesse-vsc73xx.h
blob3c30e143c14f1b392208a6e619976a16f301072b
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <linux/device.h>
3 #include <linux/etherdevice.h>
4 #include <linux/gpio/driver.h>
6 /* The VSC7395 switch chips have 5+1 ports which means 5 ordinary ports and
7 * a sixth CPU port facing the processor with an RGMII interface. These ports
8 * are numbered 0..4 and 6, so they leave a "hole" in the port map for port 5,
9 * which is invalid.
11 * The VSC7398 has 8 ports, port 7 is again the CPU port.
13 * We allocate 8 ports and avoid access to the nonexistent ports.
15 #define VSC73XX_MAX_NUM_PORTS 8
17 /**
18 * struct vsc73xx_portinfo - port data structure: contains storage data
19 * @pvid_vlan_filtering: pvid vlan number used in vlan filtering mode
20 * @pvid_tag_8021q: pvid vlan number used in tag_8021q mode
21 * @pvid_vlan_filtering_configured: informs if port has configured pvid in vlan
22 * filtering mode
23 * @pvid_tag_8021q_configured: imforms if port have configured pvid in tag_8021q
24 * mode
26 struct vsc73xx_portinfo {
27 u16 pvid_vlan_filtering;
28 u16 pvid_tag_8021q;
29 bool pvid_vlan_filtering_configured;
30 bool pvid_tag_8021q_configured;
33 /**
34 * struct vsc73xx - VSC73xx state container: main data structure
35 * @dev: The device pointer
36 * @reset: The descriptor for the GPIO line tied to the reset pin
37 * @ds: Pointer to the DSA core structure
38 * @gc: Main structure of the GPIO controller
39 * @chipid: Storage for the Chip ID value read from the CHIPID register of the
40 * switch
41 * @addr: MAC address used in flow control frames
42 * @ops: Structure with hardware-dependent operations
43 * @priv: Pointer to the configuration interface structure
44 * @portinfo: Storage table portinfo structructures
45 * @vlans: List of configured vlans. Contains port mask and untagged status of
46 * every vlan configured in port vlan operation. It doesn't cover tag_8021q
47 * vlans.
48 * @fdb_lock: Mutex protects fdb access
50 struct vsc73xx {
51 struct device *dev;
52 struct gpio_desc *reset;
53 struct dsa_switch *ds;
54 struct gpio_chip gc;
55 u16 chipid;
56 u8 addr[ETH_ALEN];
57 const struct vsc73xx_ops *ops;
58 void *priv;
59 struct vsc73xx_portinfo portinfo[VSC73XX_MAX_NUM_PORTS];
60 struct list_head vlans;
61 struct mutex fdb_lock;
64 /**
65 * struct vsc73xx_ops - VSC73xx methods container
66 * @read: Method for register reading over the hardware-dependent interface
67 * @write: Method for register writing over the hardware-dependent interface
69 struct vsc73xx_ops {
70 int (*read)(struct vsc73xx *vsc, u8 block, u8 subblock, u8 reg,
71 u32 *val);
72 int (*write)(struct vsc73xx *vsc, u8 block, u8 subblock, u8 reg,
73 u32 val);
76 /**
77 * struct vsc73xx_bridge_vlan - VSC73xx driver structure which keeps vlan
78 * database copy
79 * @vid: VLAN number
80 * @portmask: each bit represents one port
81 * @untagged: each bit represents one port configured with @vid untagged
82 * @list: list structure
84 struct vsc73xx_bridge_vlan {
85 u16 vid;
86 u8 portmask;
87 u8 untagged;
88 struct list_head list;
91 int vsc73xx_is_addr_valid(u8 block, u8 subblock);
92 int vsc73xx_probe(struct vsc73xx *vsc);
93 void vsc73xx_remove(struct vsc73xx *vsc);
94 void vsc73xx_shutdown(struct vsc73xx *vsc);