Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Sep 2019 06:30:34 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352647 - in stable/12/sys: net sys
Message-ID:  <201909240630.x8O6UYkS021855@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Sep 24 06:30:34 2019
New Revision: 352647
URL: https://svnweb.freebsd.org/changeset/base/352647

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

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

Modified: stable/12/sys/net/if.c
==============================================================================
--- stable/12/sys/net/if.c	Tue Sep 24 06:23:38 2019	(r352646)
+++ stable/12/sys/net/if.c	Tue Sep 24 06:30:34 2019	(r352647)
@@ -2924,6 +2924,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/12/sys/net/if.h
==============================================================================
--- stable/12/sys/net/if.h	Tue Sep 24 06:23:38 2019	(r352646)
+++ stable/12/sys/net/if.h	Tue Sep 24 06:30:34 2019	(r352647)
@@ -581,6 +581,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/12/sys/sys/sockio.h
==============================================================================
--- stable/12/sys/sys/sockio.h	Tue Sep 24 06:23:38 2019	(r352646)
+++ stable/12/sys/sys/sockio.h	Tue Sep 24 06:30:34 2019	(r352647)
@@ -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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909240630.x8O6UYkS021855>