Index: head/sys/net/if.h =================================================================== --- head/sys/net/if.h +++ head/sys/net/if.h @@ -585,6 +585,16 @@ #define IFNET_PCP_NONE 0xff /* PCP disabled */ +#define IFDR_MSG_SIZE 64 +#define IFDR_REASON_MSG 1 +#define IFDR_REASON_VENDOR 2 +struct ifdownreason { + char ifdr_name[IFNAMSIZ]; + uint32_t ifdr_reason; + uint32_t ifdr_vendor; + char ifdr_msg[IFDR_MSG_SIZE]; +}; + #endif /* __BSD_VISIBLE */ #ifdef _KERNEL Index: head/sys/net/if.c =================================================================== --- head/sys/net/if.c +++ head/sys/net/if.c @@ -2891,6 +2891,7 @@ case SIOCGIFGENERIC: case SIOCGIFRSSKEY: case SIOCGIFRSSHASH: + case SIOCGIFDOWNREASON: if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); error = (*ifp->if_ioctl)(ifp, cmd, data); Index: head/sys/sys/sockio.h =================================================================== --- head/sys/sys/sockio.h +++ head/sys/sys/sockio.h @@ -143,4 +143,6 @@ #define SIOCGLANPCP _IOWR('i', 152, struct ifreq) /* Get (V)LAN PCP */ #define SIOCSLANPCP _IOW('i', 153, struct ifreq) /* Set (V)LAN PCP */ +#define SIOCGIFDOWNREASON _IOWR('i', 154, struct ifdownreason) + #endif /* !_SYS_SOCKIO_H_ */