diff options
| author | Adrian Chadd <adrian@FreeBSD.org> | 2013-05-08 20:46:54 +0000 |
|---|---|---|
| committer | Adrian Chadd <adrian@FreeBSD.org> | 2013-05-08 20:46:54 +0000 |
| commit | a48a9355ef875dfdcf5759a4fb401b4d3b83a36c (patch) | |
| tree | f46e6a9e51654bb8eb5453d71ae3f0af8f087b23 /sys/dev/etherswitch/etherswitch.h | |
| parent | b96e78e02cf491d1ec1976b239bff22600bb655c (diff) | |
Notes
Diffstat (limited to 'sys/dev/etherswitch/etherswitch.h')
| -rw-r--r-- | sys/dev/etherswitch/etherswitch.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/sys/dev/etherswitch/etherswitch.h b/sys/dev/etherswitch/etherswitch.h index b57003927944..bb0167b6ae91 100644 --- a/sys/dev/etherswitch/etherswitch.h +++ b/sys/dev/etherswitch/etherswitch.h @@ -25,18 +25,47 @@ struct etherswitch_phyreg { }; typedef struct etherswitch_phyreg etherswitch_phyreg_t; -#define ETHERSWITCH_NAMEMAX 64 +#define ETHERSWITCH_NAMEMAX 64 +#define ETHERSWITCH_VLAN_ISL (1 << 0) /* ISL */ +#define ETHERSWITCH_VLAN_PORT (1 << 1) /* Port based vlan */ +#define ETHERSWITCH_VLAN_DOT1Q (1 << 2) /* 802.1q */ +#define ETHERSWITCH_VLAN_DOT1Q_4K (1 << 3) /* 4k support on 802.1q */ +#define ETHERSWITCH_VLAN_DOUBLE_TAG (1 << 4) /* Q-in-Q */ +#define ETHERSWITCH_VLAN_CAPS_BITS \ +"\020\1ISL\2PORT\3DOT1Q\4DOT1Q4K\5QinQ" struct etherswitch_info { int es_nports; int es_nvlangroups; char es_name[ETHERSWITCH_NAMEMAX]; + uint32_t es_vlan_caps; }; typedef struct etherswitch_info etherswitch_info_t; +#define ETHERSWITCH_CONF_FLAGS (1 << 0) +#define ETHERSWITCH_CONF_MIRROR (1 << 1) +#define ETHERSWITCH_CONF_VLAN_MODE (1 << 2) + +struct etherswitch_conf { + uint32_t cmd; /* What to configure */ + uint32_t vlan_mode; /* Switch VLAN mode */ +}; +typedef struct etherswitch_conf etherswitch_conf_t; + +#define ETHERSWITCH_PORT_CPU (1 << 0) +#define ETHERSWITCH_PORT_STRIPTAG (1 << 1) +#define ETHERSWITCH_PORT_ADDTAG (1 << 2) +#define ETHERSWITCH_PORT_FIRSTLOCK (1 << 3) +#define ETHERSWITCH_PORT_DROPUNTAGGED (1 << 4) +#define ETHERSWITCH_PORT_DOUBLE_TAG (1 << 5) +#define ETHERSWITCH_PORT_INGRESS (1 << 6) +#define ETHERSWITCH_PORT_FLAGS_BITS \ +"\020\1CPUPORT\2STRIPTAG\3ADDTAG\4FIRSTLOCK\5DROPUNTAGGED\6QinQ\7INGRESS" + struct etherswitch_port { int es_port; int es_pvid; + uint32_t es_flags; union { struct ifreq es_uifr; struct ifmediareq es_uifmr; @@ -66,5 +95,7 @@ typedef struct etherswitch_vlangroup etherswitch_vlangroup_t; #define IOETHERSWITCHSETVLANGROUP _IOW('i', 7, etherswitch_vlangroup_t) #define IOETHERSWITCHGETPHYREG _IOWR('i', 8, etherswitch_phyreg_t) #define IOETHERSWITCHSETPHYREG _IOW('i', 9, etherswitch_phyreg_t) +#define IOETHERSWITCHGETCONF _IOR('i', 10, etherswitch_conf_t) +#define IOETHERSWITCHSETCONF _IOW('i', 11, etherswitch_conf_t) #endif |
