From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110274 invoked by alias); 25 Sep 2019 07:04:02 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 110256 invoked by uid 10080); 25 Sep 2019 07:04:01 -0000 Date: Wed, 25 Sep 2019 07:04:00 -0000 Message-ID: <20190925070401.110255.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Add SIOCGIFDOWNREASON. X-Act-Checkin: newlib-cygwin X-Git-Author: kib X-Git-Refname: refs/heads/master X-Git-Oldrev: 1b356361196fe3095717c91b669976bb91e998ec X-Git-Newrev: 7e9b1550fd1c9690bc560404388ba4907d10996a X-SW-Source: 2019-q3/txt/msg00044.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7e9b1550fd1c9690bc560404388ba4907d10996a commit 7e9b1550fd1c9690bc560404388ba4907d10996a Author: kib Date: Tue Sep 17 18:49:13 2019 +0000 Add SIOCGIFDOWNREASON. The ioctl(2) is intended to provide more details about the cause of the down for the link. Eventually we might define a comprehensive list of codes for the situations. But interface also allows the driver to provide free-form null-terminated ASCII string to provide arbitrary non-formalized information. Sample implementation exists for mlx5(4), where the string is fetched from firmware controlling the port. Reviewed by: hselasky, rrs Sponsored by: Mellanox Technologies MFC after: 1 week Differential revision: https://reviews.freebsd.org/D21527 Diff: --- newlib/libc/sys/rtems/include/net/if.h | 12 +++++++++++- newlib/libc/sys/rtems/include/sys/sockio.h | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/newlib/libc/sys/rtems/include/net/if.h b/newlib/libc/sys/rtems/include/net/if.h index a5539bd..c7c5e86 100644 --- a/newlib/libc/sys/rtems/include/net/if.h +++ b/newlib/libc/sys/rtems/include/net/if.h @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * @(#)if.h 8.1 (Berkeley) 6/10/93 - * $FreeBSD: head/sys/net/if.h 340968 2018-11-26 13:42:18Z markj $ + * $FreeBSD: head/sys/net/if.h 352458 2019-09-17 18:49:13Z kib $ */ #ifndef _NET_IF_H_ @@ -585,6 +585,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 */ #ifndef _KERNEL diff --git a/newlib/libc/sys/rtems/include/sys/sockio.h b/newlib/libc/sys/rtems/include/sys/sockio.h index 786202a..7f33ffa 100644 --- a/newlib/libc/sys/rtems/include/sys/sockio.h +++ b/newlib/libc/sys/rtems/include/sys/sockio.h @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * @(#)sockio.h 8.1 (Berkeley) 3/28/94 - * $FreeBSD: head/sys/sys/sockio.h 331622 2018-03-27 15:29:32Z kib $ + * $FreeBSD: head/sys/sys/sockio.h 352458 2019-09-17 18:49:13Z kib $ */ #ifndef _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_ */