2 * switch.h: Switch configuration API
4 * Copyright (C) 2008 Felix Fietkau <nbd@nbd.name>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 #ifndef _UAPI_LINUX_SWITCH_H
18 #define _UAPI_LINUX_SWITCH_H
20 #include <linux/types.h>
21 #include <linux/netdevice.h>
22 #include <linux/netlink.h>
23 #include <linux/genetlink.h>
25 #include <netlink/netlink.h>
26 #include <netlink/genl/genl.h>
27 #include <netlink/genl/ctrl.h>
50 SWITCH_ATTR_OP_VALUE_INT,
51 SWITCH_ATTR_OP_VALUE_STR,
52 SWITCH_ATTR_OP_VALUE_PORTS,
53 SWITCH_ATTR_OP_VALUE_LINK,
54 SWITCH_ATTR_OP_DESCRIPTION,
63 SWITCH_PORTMAP_SEGMENT,
71 SWITCH_CMD_GET_SWITCH,
73 SWITCH_CMD_LIST_GLOBAL,
74 SWITCH_CMD_GET_GLOBAL,
75 SWITCH_CMD_SET_GLOBAL,
85 enum switch_val_type {
94 /* port nested attributes */
98 SWITCH_PORT_FLAG_TAGGED,
102 /* link nested attributes */
105 SWITCH_LINK_FLAG_LINK,
106 SWITCH_LINK_FLAG_DUPLEX,
107 SWITCH_LINK_FLAG_ANEG,
108 SWITCH_LINK_FLAG_TX_FLOW,
109 SWITCH_LINK_FLAG_RX_FLOW,
111 SWITCH_LINK_FLAG_EEE_100BASET,
112 SWITCH_LINK_FLAG_EEE_1000BASET,
113 SWITCH_LINK_ATTR_MAX,
116 #define SWITCH_ATTR_DEFAULTS_OFFSET 0x1000
119 #endif /* _UAPI_LINUX_SWITCH_H */