Skip to contentSkip to conversation

ethtool documentation

DISCUSSION Abraham vd Merwe 5 participants 8 messages Aug 5, 2002 – Aug 6, 2002

lore
Share & tools
lore
#0 lore raw

Hi!

Is there a document describing the ethtool ioctl's which need to be implemented in each ethernet driver?

Signature · 17 lines
Regards
 Abraham

Superstition, idolatry, and hypocrisy have ample wages, but truth goes
a-begging.
		-- Martin Luther

__________________________________________________________
 Abraham vd Merwe - 2d3D, Inc.

 Device Driver Development, Outsourcing, Embedded Systems

  Cell: +27 82 565 4451         Snailmail:
   Tel: +27 21 761 7549            Block C, Aintree Park
   Fax: +27 21 761 7648            Doncaster Road
 Email: [email protected]         Kenilworth, 7700
  Http: http://www.2d3d.com        South Africa
#1 lore raw
Quoted 4 lines · Abraham vd Merwe

Hi!

Is there a document describing the ethtool ioctl's which need to be implemented in each ethernet driver?

Unfortunately not. There is a distinct lack of network driver docs at the moment... The best documentation is looking at source code of drivers that implement the most ioctls.

Jeff

#2 lore raw
Quoted 7 lines
Quoted 2 lines

Is there a document describing the ethtool ioctl's which need to be implemented in each ethernet driver?

Unfortunately not. There is a distinct lack of network driver docs at the moment... The best documentation is looking at source code of drivers that implement the most ioctls.

I've got a draft of a quick overview doc. I need to add docs for a few of the newer commands, still, and I want to get into the structs for each call in more detail, too. I want to re-examine a few of recent additions, before they become too ubiquitous - am I too late to pipe up for my own aesthetics?

Tim

The ethtool API
08/05/2002

These are the valid parameters to the SIOCETHTOOL ioctl(). Network drivers should support these as much as possible.

ETHTOOL_GSET
ETHTOOL_SSET

Get/set NIC settings. These commands expect a 'struct ethtool_cmd *' argument. This struct includes fields for supported features (speed, duplex, transceiver), advertised features, speed, duplex, port, transceiver, and autonegotiation. If the caller attempts to set an invalid value for any field, return -EINVAL.

ETHTOOL_GDRVINFO

Get driver information. This command expects a 'struct ethtool_drvinfo *' argument. This struct includes the driver identifier as a string, the driver version as a string, bus information for the interface, and length information for other ETHTOOL_* commands.

ETHTOOL_GREGS

Get a register dump from the NIC. This command expects a 'struct ethtool_regs regs *' argument. This struct has a driver-specific version field and a length field. The length field indicates the length of the data field to be populated with register information.

ETHTOOL_GWOL
ETHTOOL_SWOL

Get/set wake-on-lan options for the NIC. These commands expect a 'struct ethtool_wolinfo *' argument. This struct has fields for supprted and active WoL options, and the SecureOn password, if active. If the caller attempts to set an invalid value, return -EINVAL.

ETHTOOL_GMSGLVL
ETHTOOL_SMSGLVL

Get/set the driver message-level value for the NIC. This command expects a 'struct ethtool_value *' argument.

ETHTOOL_NWAY_RST

Force auto-negotiation to restart, if it is enabled. If it is not enabled, return -EINVAL.

ETHTOOL_GLINK

Read the current link status. This command expects a 'struct ethtool_value *' argument.

ETHTOOL_GEEPROM
ETHTOOL_SEEPROM

Get/set EEPROM data. These commands expect a 'struct ethtool_eeprom *' argument. This struct has a magic number, an offset and length pair, and a data field. If the offset+length are longer than the maximum size, the extra is silently ignored.

ETHTOOL_GCOALESCE
ETHTOOL_SCOALESCE

Get/set coalescing parameters. These commands expect a 'struct ethtool_coalesce *' argument. This struct has several fields for configuring coalescing - see ethtool.h for details. If the caller attempts to set an invalid value, return -EINVAL.

ETHTOOL_GRINGPARAM
ETHTOOL_SRINGPARAM

Get/set RX/TX ring parameters. These commands expect a 'struct ethtool_ringparam *' aargument. This struct has fields for several rx pending options, and tx pending. If the caller attempts to set an invalid value, return -EINVAL.

ETHTOOL_GPAUSEPARAM
ETHTOOL_SPAUSEPARAM

Get/set the RX/TX pause parameters. These commands expect a 'struct ethtool_pauseparam *' argument. This struct has fields to enable autonegotiation of pause parameters and to force RX and TX pause control.

ETHTOOL_GRXCSUM
ETHTOOL_SRXCSUM

Get/set the RX hardware checksum capability/flag. These commands expect a 'struct ethtool_value *' argument. If the caller attempts to enable RX hardware checksumming on an interface that does not support it, return -EINVAL.

ETHTOOL_GTXCSUM
ETHTOOL_STXCSUM

Get/set the TX hardware checksum capability/flag. These commands expect a 'struct ethtool_value *' argument. If the caller attempts to enable TX hardware checksumming on an interface that does not support it, return -EINVAL.

ETHTOOL_GSG
ETHTOOL_SSG

Get/set the scatter/gather capability/flag. These commands expect a 'struct ethtool_value *' argument. If the caller attempts to set an invalid value, return -EINVAL.

ETHTOOL_TEST
/* execute NIC self-test, priv. */

ETHTOOL_GSTRINGS
/* get specified string set */

ETHTOOL_PHYS_ID
/* identify the NIC */

ETHTOOL_GSTATS
/* get NIC-specific statistics */

#3 lore raw
Quoted 8 lines · Tim Hockin
Quoted 5 lines
Quoted 2 lines

Is there a document describing the ethtool ioctl's which need to be implemented in each ethernet driver?

Unfortunately not. There is a distinct lack of network driver docs at the moment... The best documentation is looking at source code of drivers that implement the most ioctls.

Quoted 5 lines

I've got a draft of a quick overview doc. I need to add docs for a few of the newer commands, still, and I want to get into the structs for each call in more detail, too. I want to re-examine a few of recent additions, before they become too ubiquitous - am I too late to pipe up for my own aesthetics?

Sure, comments are always welcome.

And if you're bored, IMO putting the docs into Documentation/DocBook is preferred :)

#4 lore raw
Quoted 5 lines · Jeff Garzik
Quoted 2 lines · Tim Hockin

Is there a document describing the ethtool ioctl's which need to be implemented in each ethernet driver?

Unfortunately not. There is a distinct lack of network driver docs at the moment... The best documentation is looking at source code of drivers that implement the most ioctls.

Is there a driver with anything like what you'd consider a canonical (or at least exemplary) implementation of the ethtool ioctls?

Signature · 1 line
/Jonathan Lundell.
#5 lore raw
Quoted 4 lines · Jonathan Lundell
Quoted 2 lines · Jeff Garzik

Tim Hockin wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Is there a document describing the ethtool ioctl's which need to be implemented in each ethernet driver?

Unfortunately not. There is a distinct lack of network driver docs at the moment... The best documentation is looking at source code of drivers that implement the most ioctls.

Is there a driver with anything like what you'd consider a canonical (or at least exemplary) implementation of the ethtool ioctls?

tg3, 8139cp, and natsemi

#6 lore raw
In reply to Tim Hockin

Hi Tim!

Quoted 11 lines

These are the valid parameters to the SIOCETHTOOL ioctl(). Network drivers should support these as much as possible.

ETHTOOL_GSET
ETHTOOL_SSET

Get/set NIC settings. These commands expect a 'struct ethtool_cmd *' argument. This struct includes fields for supported features (speed, duplex, transceiver), advertised features, speed, duplex, port, transceiver, and autonegotiation. If the caller attempts to set an invalid value for any field, return -EINVAL.

What is the difference between the supported and advertising fields? What is MII? (as in the SUPPORTED_MII feature?).

If you can't control the # of ints before Tx/Rx, I take it you can just set those fields to 0?

Quoted 6 lines

ETHTOOL_GDRVINFO

Get driver information. This command expects a 'struct ethtool_drvinfo *' argument. This struct includes the driver identifier as a string, the driver version as a string, bus information for the interface, and length information for other ETHTOOL_* commands.

What do you set the bus_info field to if there is no bus? Where are all these bus types defined? The header file isn't very clear about anything other than pci bus types.

I take it you can just set fw_version to zero length string if it is unknown?

Quoted 7 lines

ETHTOOL_GEEPROM
ETHTOOL_SEEPROM

Get/set EEPROM data. These commands expect a 'struct ethtool_eeprom *' argument. This struct has a magic number, an offset and length pair, and a data field. If the offset+length are longer than the maximum size, the extra is silently ignored.

Wouldn't it have been better to make this 'n character device which can be read from / written to just like a normal file (/dev/nvram-like interface) - that way applications can actually use unused eeprom space.

Quoted 7 lines

ETHTOOL_GCOALESCE
ETHTOOL_SCOALESCE

Get/set coalescing parameters. These commands expect a 'struct ethtool_coalesce *' argument. This struct has several fields for configuring coalescing - see ethtool.h for details. If the caller attempts to set an invalid value, return -EINVAL.

Wtf is coalescing parameters? These commands aren't even defined in the 2.4.18 kernel headers. Is this 2.5.xx additions?

Same goes for the following commands:

Quoted 14 lines

ETHTOOL_GRINGPARAM
ETHTOOL_SRINGPARAM
ETHTOOL_GPAUSEPARAM
ETHTOOL_SPAUSEPARAM
ETHTOOL_GRXCSUM
ETHTOOL_SRXCSUM
ETHTOOL_GTXCSUM
ETHTOOL_STXCSUM
ETHTOOL_GSG
ETHTOOL_SSG
ETHTOOL_TEST
ETHTOOL_GSTRINGS
ETHTOOL_PHYS_ID
ETHTOOL_GSTATS

Signature · 16 lines
Regards
 Abraham

Lying is an indispensable part of making life tolerable.
		-- Bergan Evans

__________________________________________________________
 Abraham vd Merwe - 2d3D, Inc.

 Device Driver Development, Outsourcing, Embedded Systems

  Cell: +27 82 565 4451         Snailmail:
   Tel: +27 21 761 7549            Block C, Aintree Park
   Fax: +27 21 761 7648            Doncaster Road
 Email: [email protected]         Kenilworth, 7700
  Http: http://www.2d3d.com        South Africa
#7 lore raw

From: Abraham vd Merwe <[email protected]>
Date: Tue, 6 Aug 2002 12:17:51 +0200

Wtf is coalescing parameters? These commands aren't even defined in the 2.4.18 kernel headers. Is this 2.5.xx additions?

Same goes for the following commands:

They are all in 2.4.19