Re: [Qemu-devel] [PATCH v2 1/3] scripts/update-linux-headers: add ethtool.h and update to 4.16.0-rc4

2018-03-09 Thread Michael S. Tsirkin
On Wed, Mar 07, 2018 at 10:25:39PM -0500, Jason Baron wrote:
> A subsequent patch to add support for setting linkspeed/duplex in
> virtio-net, requires a few definitions from ethtool.h, which ends up
> pulling in kernel.h and sysinfo.h as well.
> 
> Signed-off-by: Jason Baron 
> Cc: "Michael S. Tsirkin" 
> Cc: Jason Wang 
> Cc: virtio-...@lists.oasis-open.org

I will drop unrelated stuff and just update files we need.

> ---
>  include/standard-headers/linux/ethtool.h | 1821 
> ++
>  include/standard-headers/linux/input.h   |4 +-
>  include/standard-headers/linux/kernel.h  |   15 +
>  include/standard-headers/linux/sysinfo.h |   25 +
>  linux-headers/asm-x86/kvm_para.h |1 +
>  linux-headers/linux/kvm.h|2 +
>  scripts/update-linux-headers.sh  |   11 +-
>  7 files changed, 1876 insertions(+), 3 deletions(-)
>  create mode 100644 include/standard-headers/linux/ethtool.h
>  create mode 100644 include/standard-headers/linux/kernel.h
>  create mode 100644 include/standard-headers/linux/sysinfo.h
> 
> diff --git a/include/standard-headers/linux/ethtool.h 
> b/include/standard-headers/linux/ethtool.h
> new file mode 100644
> index 000..94aacb7
> --- /dev/null
> +++ b/include/standard-headers/linux/ethtool.h
> @@ -0,0 +1,1821 @@
> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
> +/*
> + * ethtool.h: Defines for Linux ethtool.
> + *
> + * Copyright (C) 1998 David S. Miller (da...@redhat.com)
> + * Copyright 2001 Jeff Garzik 
> + * Portions Copyright 2001 Sun Microsystems (thoc...@sun.com)
> + * Portions Copyright 2002 Intel (eli.kuperm...@intel.com,
> + *christopher.le...@intel.com,
> + *scott.feld...@intel.com)
> + * Portions Copyright (C) Sun Microsystems 2008
> + */
> +
> +#ifndef _LINUX_ETHTOOL_H
> +#define _LINUX_ETHTOOL_H
> +
> +#include "net/eth.h"
> +
> +#include "standard-headers/linux/kernel.h"
> +#include "standard-headers/linux/types.h"
> +#include "standard-headers/linux/if_ether.h"
> +
> +#include  /* for INT_MAX */
> +
> +/* All structures exposed to userland should be defined such that they
> + * have the same layout for 32-bit and 64-bit userland.
> + */
> +
> +/**
> + * struct ethtool_cmd - DEPRECATED, link control and status
> + * This structure is DEPRECATED, please use struct ethtool_link_settings.
> + * @cmd: Command number = %ETHTOOL_GSET or %ETHTOOL_SSET
> + * @supported: Bitmask of %SUPPORTED_* flags for the link modes,
> + *   physical connectors and other link features for which the
> + *   interface supports autonegotiation or auto-detection.
> + *   Read-only.
> + * @advertising: Bitmask of %ADVERTISED_* flags for the link modes,
> + *   physical connectors and other link features that are
> + *   advertised through autonegotiation or enabled for
> + *   auto-detection.
> + * @speed: Low bits of the speed, 1Mb units, 0 to INT_MAX or SPEED_UNKNOWN
> + * @duplex: Duplex mode; one of %DUPLEX_*
> + * @port: Physical connector type; one of %PORT_*
> + * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not
> + *   applicable.  For clause 45 PHYs this is the PRTAD.
> + * @transceiver: Historically used to distinguish different possible
> + *   PHY types, but not in a consistent way.  Deprecated.
> + * @autoneg: Enable/disable autonegotiation and auto-detection;
> + *   either %AUTONEG_DISABLE or %AUTONEG_ENABLE
> + * @mdio_support: Bitmask of %ETH_MDIO_SUPPORTS_* flags for the MDIO
> + *   protocols supported by the interface; 0 if unknown.
> + *   Read-only.
> + * @maxtxpkt: Historically used to report TX IRQ coalescing; now
> + *   obsoleted by  ethtool_coalesce.  Read-only; deprecated.
> + * @maxrxpkt: Historically used to report RX IRQ coalescing; now
> + *   obsoleted by  ethtool_coalesce.  Read-only; deprecated.
> + * @speed_hi: High bits of the speed, 1Mb units, 0 to INT_MAX or 
> SPEED_UNKNOWN
> + * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of
> + *   %ETH_TP_MDI_*.  If the status is unknown or not applicable, the
> + *   value will be %ETH_TP_MDI_INVALID.  Read-only.
> + * @eth_tp_mdix_ctrl: Ethernet twisted pair MDI(-X) control; one of
> + *   %ETH_TP_MDI_*.  If MDI(-X) control is not implemented, reads
> + *   yield %ETH_TP_MDI_INVALID and writes may be ignored or rejected.
> + *   When written successfully, the link should be renegotiated if
> + *   necessary.
> + * @lp_advertising: Bitmask of %ADVERTISED_* flags for the link modes
> + *   and other link features that the link partner advertised
> + *   through autonegotiation; 0 if unknown or not applicable.
> + *   Read-only.
> + *
> + * The link speed in Mbps is split between @speed and @speed_hi.  Use
> + * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to
> + * access it.
> + *
> + * If autonegotiation is disabled, the speed and @duplex represent the
> + * 

[Qemu-devel] [PATCH v2 1/3] scripts/update-linux-headers: add ethtool.h and update to 4.16.0-rc4

2018-03-07 Thread Jason Baron via Qemu-devel
A subsequent patch to add support for setting linkspeed/duplex in
virtio-net, requires a few definitions from ethtool.h, which ends up
pulling in kernel.h and sysinfo.h as well.

Signed-off-by: Jason Baron 
Cc: "Michael S. Tsirkin" 
Cc: Jason Wang 
Cc: virtio-...@lists.oasis-open.org
---
 include/standard-headers/linux/ethtool.h | 1821 ++
 include/standard-headers/linux/input.h   |4 +-
 include/standard-headers/linux/kernel.h  |   15 +
 include/standard-headers/linux/sysinfo.h |   25 +
 linux-headers/asm-x86/kvm_para.h |1 +
 linux-headers/linux/kvm.h|2 +
 scripts/update-linux-headers.sh  |   11 +-
 7 files changed, 1876 insertions(+), 3 deletions(-)
 create mode 100644 include/standard-headers/linux/ethtool.h
 create mode 100644 include/standard-headers/linux/kernel.h
 create mode 100644 include/standard-headers/linux/sysinfo.h

diff --git a/include/standard-headers/linux/ethtool.h 
b/include/standard-headers/linux/ethtool.h
new file mode 100644
index 000..94aacb7
--- /dev/null
+++ b/include/standard-headers/linux/ethtool.h
@@ -0,0 +1,1821 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+/*
+ * ethtool.h: Defines for Linux ethtool.
+ *
+ * Copyright (C) 1998 David S. Miller (da...@redhat.com)
+ * Copyright 2001 Jeff Garzik 
+ * Portions Copyright 2001 Sun Microsystems (thoc...@sun.com)
+ * Portions Copyright 2002 Intel (eli.kuperm...@intel.com,
+ *christopher.le...@intel.com,
+ *scott.feld...@intel.com)
+ * Portions Copyright (C) Sun Microsystems 2008
+ */
+
+#ifndef _LINUX_ETHTOOL_H
+#define _LINUX_ETHTOOL_H
+
+#include "net/eth.h"
+
+#include "standard-headers/linux/kernel.h"
+#include "standard-headers/linux/types.h"
+#include "standard-headers/linux/if_ether.h"
+
+#include  /* for INT_MAX */
+
+/* All structures exposed to userland should be defined such that they
+ * have the same layout for 32-bit and 64-bit userland.
+ */
+
+/**
+ * struct ethtool_cmd - DEPRECATED, link control and status
+ * This structure is DEPRECATED, please use struct ethtool_link_settings.
+ * @cmd: Command number = %ETHTOOL_GSET or %ETHTOOL_SSET
+ * @supported: Bitmask of %SUPPORTED_* flags for the link modes,
+ * physical connectors and other link features for which the
+ * interface supports autonegotiation or auto-detection.
+ * Read-only.
+ * @advertising: Bitmask of %ADVERTISED_* flags for the link modes,
+ * physical connectors and other link features that are
+ * advertised through autonegotiation or enabled for
+ * auto-detection.
+ * @speed: Low bits of the speed, 1Mb units, 0 to INT_MAX or SPEED_UNKNOWN
+ * @duplex: Duplex mode; one of %DUPLEX_*
+ * @port: Physical connector type; one of %PORT_*
+ * @phy_address: MDIO address of PHY (transceiver); 0 or 255 if not
+ * applicable.  For clause 45 PHYs this is the PRTAD.
+ * @transceiver: Historically used to distinguish different possible
+ * PHY types, but not in a consistent way.  Deprecated.
+ * @autoneg: Enable/disable autonegotiation and auto-detection;
+ * either %AUTONEG_DISABLE or %AUTONEG_ENABLE
+ * @mdio_support: Bitmask of %ETH_MDIO_SUPPORTS_* flags for the MDIO
+ * protocols supported by the interface; 0 if unknown.
+ * Read-only.
+ * @maxtxpkt: Historically used to report TX IRQ coalescing; now
+ * obsoleted by  ethtool_coalesce.  Read-only; deprecated.
+ * @maxrxpkt: Historically used to report RX IRQ coalescing; now
+ * obsoleted by  ethtool_coalesce.  Read-only; deprecated.
+ * @speed_hi: High bits of the speed, 1Mb units, 0 to INT_MAX or SPEED_UNKNOWN
+ * @eth_tp_mdix: Ethernet twisted-pair MDI(-X) status; one of
+ * %ETH_TP_MDI_*.  If the status is unknown or not applicable, the
+ * value will be %ETH_TP_MDI_INVALID.  Read-only.
+ * @eth_tp_mdix_ctrl: Ethernet twisted pair MDI(-X) control; one of
+ * %ETH_TP_MDI_*.  If MDI(-X) control is not implemented, reads
+ * yield %ETH_TP_MDI_INVALID and writes may be ignored or rejected.
+ * When written successfully, the link should be renegotiated if
+ * necessary.
+ * @lp_advertising: Bitmask of %ADVERTISED_* flags for the link modes
+ * and other link features that the link partner advertised
+ * through autonegotiation; 0 if unknown or not applicable.
+ * Read-only.
+ *
+ * The link speed in Mbps is split between @speed and @speed_hi.  Use
+ * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to
+ * access it.
+ *
+ * If autonegotiation is disabled, the speed and @duplex represent the
+ * fixed link mode and are writable if the driver supports multiple
+ * link modes.  If it is enabled then they are read-only; if the link
+ * is up they represent the negotiated link mode; if the link is down,
+ * the speed is 0, %SPEED_UNKNOWN or the highest enabled speed and
+ * @duplex is