9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] Fields in /net/ether0/ifstats
@ 2024-05-02 20:41 Rocky Hotas
  2024-05-02 20:58 ` adventures in9
  0 siblings, 1 reply; 4+ messages in thread
From: Rocky Hotas @ 2024-05-02 20:41 UTC (permalink / raw)
  To: 9front

Hello!

The file /net/ether0/ifstats in the Ethernet device interface gives some
information about the device and the packets.

Are its fields documented somewhere? I tried googling them, but with no
results.

In particular, what is the contents of `eeprom' and `phy'? What do they
represent?

Bye,

Rocky

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9front] Fields in /net/ether0/ifstats
  2024-05-02 20:41 [9front] Fields in /net/ether0/ifstats Rocky Hotas
@ 2024-05-02 20:58 ` adventures in9
  2024-05-03  9:30   ` Rocky Hotas
  0 siblings, 1 reply; 4+ messages in thread
From: adventures in9 @ 2024-05-02 20:58 UTC (permalink / raw)
  To: 9front

The /net/etherN/ifstats file is particular to each driver.  So to
understand it you would have to read the code for that particular
driver.

The exception is for wifi, where it is used for scans and what AP you
are connected to.

/net/etherN/stats is set by the OS.  It is mentioned in ether(3), but
not much because it is pretty self explanatory.


On Thu, May 2, 2024 at 1:43 PM Rocky Hotas <rockyhotas@firemail.cc> wrote:
>
> Hello!
>
> The file /net/ether0/ifstats in the Ethernet device interface gives some
> information about the device and the packets.
>
> Are its fields documented somewhere? I tried googling them, but with no
> results.
>
> In particular, what is the contents of `eeprom' and `phy'? What do they
> represent?
>
> Bye,
>
> Rocky

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: [9front] Fields in /net/ether0/ifstats
  2024-05-02 20:58 ` adventures in9
@ 2024-05-03  9:30   ` Rocky Hotas
  2024-05-03  9:55     ` Rocky Hotas
  0 siblings, 1 reply; 4+ messages in thread
From: Rocky Hotas @ 2024-05-03  9:30 UTC (permalink / raw)
  To: 9front; +Cc: adventuresin9

On mag 02 13:58, adventures in9 wrote:
> The /net/etherN/ifstats file is particular to each driver.  So to
> understand it you would have to read the code for that particular
> driver.

Ok! I found several files in the sourcecode.

In 9front/sys/src/9/pc:

  ether2000.c
  ether2114x.c
  ether589.c
  ...

Then, 9front/sys/src/9/port/ethermii.c.

Probably ethermii.c is common to them, while those in
9front/sys/src/9/pc are the actual drivers. If so, how can I determine
which is the driver currently in use?

> The exception is for wifi, where it is used for scans and what AP you
> are connected to.

In this case it is a cable (Ethernet) connection.

Thank you!

Rocky

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: Re: [9front] Fields in /net/ether0/ifstats
  2024-05-03  9:30   ` Rocky Hotas
@ 2024-05-03  9:55     ` Rocky Hotas
  0 siblings, 0 replies; 4+ messages in thread
From: Rocky Hotas @ 2024-05-03  9:55 UTC (permalink / raw)
  To: 9front; +Cc: adventuresin9

On mag 03 11:30, Rocky Hotas wrote:
> If so, how can I determine
> which is the driver currently in use?

Some updates: `pci -v' shows

Intel Corporation 82540EM Gigabit Ethernet Controller

whose driver is

9front/sys/src/9/pc/etherigbe.c

Probably `eeprom' and `phy' in /net/ether0/ifstats represent the
contents of registers. From the sourcecode etherigbe.c I can not
immediately determine how they are printed, but I'll try to figure it
out.

Thanks for your hints!

Rocky

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-03  9:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-02 20:41 [9front] Fields in /net/ether0/ifstats Rocky Hotas
2024-05-02 20:58 ` adventures in9
2024-05-03  9:30   ` Rocky Hotas
2024-05-03  9:55     ` Rocky Hotas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).