xref: /linux/drivers/net/dsa/realtek/rtl8365mb_vlan.h (revision 9da2c8672f77108a1f09232320f22225ab53dde9)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* VLAN configuration interface for the rtl8365mb switch family
3  *
4  * Copyright (C) 2022 Alvin Šipraga <alsi@bang-olufsen.dk>
5  *
6  */
7 
8 #ifndef _REALTEK_RTL8365MB_VLAN_H
9 #define _REALTEK_RTL8365MB_VLAN_H
10 
11 #include <linux/types.h>
12 
13 #include "realtek.h"
14 
15 enum rtl8365mb_frame_ingress {
16 	RTL8365MB_FRAME_TYPE_ANY_FRAME = 0,
17 	RTL8365MB_FRAME_TYPE_TAGGED_ONLY,
18 	RTL8365MB_FRAME_TYPE_UNTAGGED_ONLY,
19 };
20 
21 int rtl8365mb_vlan_port_get_pvid(struct realtek_priv *priv, int port,
22 				 u16 *pvid);
23 int
24 rtl8365mb_vlan_port_get_framefilter(struct realtek_priv *priv,
25 				    int port,
26 				    enum rtl8365mb_frame_ingress *frame_type);
27 int
28 rtl8365mb_vlan_port_set_framefilter(struct realtek_priv *priv,
29 				    int port,
30 				    enum rtl8365mb_frame_ingress frame_type);
31 int rtl8365mb_vlan_4k_port_add(struct dsa_switch *ds, int port,
32 			       const struct switchdev_obj_port_vlan *vlan,
33 			       struct netlink_ext_ack *extack);
34 int rtl8365mb_vlan_4k_port_del(struct dsa_switch *ds, int port,
35 			       const struct switchdev_obj_port_vlan *vlan);
36 int rtl8365mb_vlan_pvid_port_set(struct dsa_switch *ds, int port, u16 vid,
37 				 struct netlink_ext_ack *extack);
38 int rtl8365mb_vlan_pvid_port_clear(struct dsa_switch *ds, int port, u16 vid);
39 #endif /* _REALTEK_RTL8365MB_VLAN_H */
40