diff options
author | Luiz Souza <luiz@netgate.com> | 2018-03-12 16:56:54 -0300 |
---|---|---|
committer | Luiz Souza <luiz@netgate.com> | 2018-03-12 12:16:41 -0500 |
commit | 67ff878b5e5dabfe5f9c7d93f77f18a87d2a995b (patch) | |
tree | 9aad88899f438d70ec2f9064c0d5fe445e8679d6 /sys | |
parent | 7d8125bc3128984869fd1520d5387ef4d603720d (diff) | |
download | FreeBSD-src-67ff878b5e5dabfe5f9c7d93f77f18a87d2a995b.zip FreeBSD-src-67ff878b5e5dabfe5f9c7d93f77f18a87d2a995b.tar.gz |
Print and allow setting the switch port state.
The port state can be set to: disabled, learning, blocking and forwarding.
(cherry picked from commit 76dbc69beb1365281a904ba531acbcbc607b394e)
(cherry picked from commit 1a4022d9c69dfa01a9bd21805b4c26eb8b4161d9)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/etherswitch/etherswitch.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/etherswitch/etherswitch.h b/sys/dev/etherswitch/etherswitch.h index 81f1e65..4f78763 100644 --- a/sys/dev/etherswitch/etherswitch.h +++ b/sys/dev/etherswitch/etherswitch.h @@ -38,8 +38,9 @@ typedef struct etherswitch_phyreg etherswitch_phyreg_t; #define ETHERSWITCH_CAPS_PORTS_MASK (1 << 0) /* Ports mask */ #define ETHERSWITCH_CAPS_LAGG (1 << 1) /* LAGG support */ +#define ETHERSWITCH_CAPS_PSTATE (1 << 2) /* Port state */ #define ETHERSWITCH_CAPS_BITS \ -"\020\1PORTSMASK\2LAGG" +"\020\1PORTSMASK\2LAGG\3PSTATE" #define MAX_PORTS 1024 #define MAX_PORTS_UINT32 (MAX_PORTS / sizeof(uint32_t)) @@ -77,6 +78,13 @@ typedef struct etherswitch_conf etherswitch_conf_t; "\020\1CPUPORT\2STRIPTAG\3ADDTAG\4FIRSTLOCK\5DROPUNTAGGED\6QinQ\7INGRESS" \ "\10DROPTAGGED" +#define ETHERSWITCH_PSTATE_DISABLED (1 << 0) +#define ETHERSWITCH_PSTATE_BLOCKING (1 << 1) +#define ETHERSWITCH_PSTATE_LEARNING (1 << 2) +#define ETHERSWITCH_PSTATE_FORWARDING (1 << 3) +#define ETHERSWITCH_PSTATE_BITS \ +"\020\1DISABLED\2BLOCKING\3LEARNING\4FORWARDING" + #define ETHERSWITCH_PORT_MAX_LEDS 3 enum etherswitch_port_led { @@ -93,6 +101,7 @@ struct etherswitch_port { int es_pvid; int es_nleds; uint32_t es_flags; + uint32_t es_state; etherswitch_port_led_t es_led[ETHERSWITCH_PORT_MAX_LEDS]; union { struct ifreq es_uifr; |