5 #ifndef __SYS_DEV_ETHERSWITCH_ETHERSWITCH_H
6 #define __SYS_DEV_ETHERSWITCH_ETHERSWITCH_H
8 #include <sys/ioccom.h>
11 extern devclass_t etherswitch_devclass;
12 extern driver_t etherswitch_driver;
15 struct etherswitch_reg {
19 typedef struct etherswitch_reg etherswitch_reg_t;
21 struct etherswitch_phyreg {
26 typedef struct etherswitch_phyreg etherswitch_phyreg_t;
28 #define ETHERSWITCH_NAMEMAX 64
30 struct etherswitch_info {
33 char es_name[ETHERSWITCH_NAMEMAX];
35 typedef struct etherswitch_info etherswitch_info_t;
37 struct etherswitch_port {
42 struct ifmediareq es_uifmr;
44 #define es_ifr es_ifu.es_uifr
45 #define es_ifmr es_ifu.es_uifmr
47 typedef struct etherswitch_port etherswitch_port_t;
49 struct etherswitch_vlangroup {
53 int es_untagged_ports;
56 typedef struct etherswitch_vlangroup etherswitch_vlangroup_t;
58 #define ETHERSWITCH_PORTMASK(_port) (1 << (_port))
60 #define IOETHERSWITCHGETINFO _IOR('i', 1, etherswitch_info_t)
61 #define IOETHERSWITCHGETREG _IOWR('i', 2, etherswitch_reg_t)
62 #define IOETHERSWITCHSETREG _IOW('i', 3, etherswitch_reg_t)
63 #define IOETHERSWITCHGETPORT _IOWR('i', 4, etherswitch_port_t)
64 #define IOETHERSWITCHSETPORT _IOW('i', 5, etherswitch_port_t)
65 #define IOETHERSWITCHGETVLANGROUP _IOWR('i', 6, etherswitch_vlangroup_t)
66 #define IOETHERSWITCHSETVLANGROUP _IOW('i', 7, etherswitch_vlangroup_t)
67 #define IOETHERSWITCHGETPHYREG _IOWR('i', 8, etherswitch_phyreg_t)
68 #define IOETHERSWITCHSETPHYREG _IOW('i', 9, etherswitch_phyreg_t)