svn commit: r352649 - in stable/11/sys: net sys

Konstantin Belousov kib at FreeBSD.org
Tue Sep 24 06:36:26 UTC 2019


Author: kib
Date: Tue Sep 24 06:36:25 2019
New Revision: 352649
URL: https://svnweb.freebsd.org/changeset/base/352649

Log:
  MFC r352458:
  Add SIOCGIFDOWNREASON.
  
  Sponsored by:	Mellanox Technologies

Modified:
  stable/11/sys/net/if.c
  stable/11/sys/net/if.h
  stable/11/sys/sys/sockio.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/net/if.c
==============================================================================
--- stable/11/sys/net/if.c	Tue Sep 24 06:31:56 2019	(r352648)
+++ stable/11/sys/net/if.c	Tue Sep 24 06:36:25 2019	(r352649)
@@ -2844,6 +2844,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data,
 	case SIOCGIFGENERIC:
 	case SIOCGIFRSSKEY:
 	case SIOCGIFRSSHASH:
+	case SIOCGIFDOWNREASON:
 		if (ifp->if_ioctl == NULL)
 			return (EOPNOTSUPP);
 		error = (*ifp->if_ioctl)(ifp, cmd, data);

Modified: stable/11/sys/net/if.h
==============================================================================
--- stable/11/sys/net/if.h	Tue Sep 24 06:31:56 2019	(r352648)
+++ stable/11/sys/net/if.h	Tue Sep 24 06:36:25 2019	(r352649)
@@ -574,6 +574,16 @@ struct ifrsshash {
 
 #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

Modified: stable/11/sys/sys/sockio.h
==============================================================================
--- stable/11/sys/sys/sockio.h	Tue Sep 24 06:31:56 2019	(r352648)
+++ stable/11/sys/sys/sockio.h	Tue Sep 24 06:36:25 2019	(r352649)
@@ -141,4 +141,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_ */


More information about the svn-src-stable-11 mailing list