Writing Device Drivers

Kernel Statistics for Solaris Ethernet Drivers

The kstat interface described in the following table is an effective way to obtain Ethernet physical layer statistics from the driver. Ethernet drivers should export these statistics to guide users in better diagnosis and repair of Ethernet physical layer problems. With exception of link_up, all statistics have a default value of 0 when not present. The value of the link_up statistic should be assumed to be 1.

The following example gives all the shared link setup. In this case mii is used to filter statistics.

kstat ce:0:mii:link_*
Table 22–2 Ethernet MII/GMII Physical Layer Interface Kernel Statistics

Kstat Variable 

Type 

Description 

xcvr_addr

KSTAT_DATA_UINT32

Provides the MII address of the transceiver that is currently in use. 

  • (0) - (31) are for the MII address of the physical layer device in use for a given Ethernet device.

  • (-1) is used where there is no externally accessible MII interface, and therefore the MII address is undefined or irrelevant.

xcvr_id

KSTAT_DATA_UINT32

Provides the specific vendor ID or device ID of the transceiver that is currently in use. 

xcvr_inuse

KSTAT_DATA_UINT32

Indicates the type of transceiver that is currently in use. The IEEE aPhytType enumerates the following set:

  • (0) other undefined

  • (1) no MII interface is present, but no transceiver is connected

  • (2) 10 Mbits/s Clause 7 10 Mbits/s Manchester

  • (3) 100BASE-T4 Clause 23 100 Mbits/s 8B/6T

  • (4) 100BASE-X Clause 24 100 Mbits/s 4B/5B

  • (5) 100BASE-T2 Clause 32 100 Mbits/s PAM5X5

  • (6) 1000BASE-X Clause 36 1000 Mbits/s 8B/10B

  • (7) 1000BASE-T Clause 40 1000 Mbits/s 4D-PAM5

This set is smaller than the set specified by ifMauType, which is defined to include all of the above plus their half duplex/full duplex options. Since this information can be provided by the cap_* statistics, the missing definitions can be derived from the combination of xcvr_inuse and cap_* to provide all the combinations of ifMayType.

cap_1000fdx

KSTAT_DATA_CHAR

Indicates the device is 1 Gbits/s full duplex capable. 

cap_1000hdx

KSTAT_DATA_CHAR

Indicates the device is 1 Gbits/s half duplex capable. 

cap_100fdx

KSTAT_DATA_CHAR

Indicates the device is 100 Mbits/s full duplex capable. 

cap_100hdx

KSTAT_DATA_CHAR

Indicates the device is 100 Mbits/s half duplex capable. 

cap_10fdx

KSTAT_DATA_CHAR

Indicates the device is 10 Mbits/s full duplex capable. 

cap_10hdx

KSTAT_DATA_CHAR

Indicates the device is 10 Mbits/s half duplex capable. 

cap_asmpause

KSTAT_DATA_CHAR

Indicates the device is capable of asymmetric pause Ethernet flow control. 

cap_pause

KSTAT_DATA_CHAR

Indicates the device is capable of symmetric pause Ethernet flow control when cap_pause is set to 1 and cap_asmpause is set to 0. When cap_asmpause is set to 1, cap_pause has the following meaning:

  • cap_pause = 0 Transmit pauses based on receive congestion.

  • cap_pause = 1 Receive pauses and slow down transmit to avoid congestion.

cap_rem_fault

KSTAT_DATA_CHAR

Indicates the device is capable of remote fault indication. 

cap_autoneg

KSTAT_DATA_CHAR

Indicates the device is capable of auto-negotiation. 

adv_cap_1000fdx

KSTAT_DATA_CHAR

Indicates the device is advertising 1 Gbits/s full duplex capability. 

adv_cap_1000hdx

KSTAT_DATA_CHAR

Indicates the device is advertising 1 Gbits/s half duplex capability. 

adv_cap_100fdx

KSTAT_DATA_CHAR

Indicates the device is advertising 100 Mbits/s full duplex capability. 

adv_cap_100hdx

KSTAT_DATA_CHAR

Indicates the device is advertising 100 Mbits/s half duplex capability. 

adv_cap_10fdx

KSTAT_DATA_CHAR

Indicates the device is advertising 10 Mbits/s full duplex capability. 

adv_cap_10hdx

KSTAT_DATA_CHAR

Indicates the device is advertising 10 Mbits/s half duplex capability. 

adv_cap_asmpause

KSTAT_DATA_CHAR

Indicates the device is advertising the capability of asymmetric pause Ethernet flow control. 

adv_cap_pause

KSTAT_DATA_CHAR

Indicates the device is advertising the capability of symmetric pause Ethernet flow control when adv_cap_pause is set to 1 and adv_cap_asmpause is set to 0. When adv_cap_asmpause is set to 1, adv_cap_pause has the following meaning:

  • adv_cap_pause = 0 Transmit pauses based on receive congestion.

  • adv_cap_pause = 1 Receive pauses and slow down transmit to avoid congestion.

adv_rem_fault

KSTAT_DATA_CHAR

Indicates the device is experiencing a fault that it is going to forward to the link partner. 

adv_cap_autoneg

KSTAT_DATA_CHAR

Indicates the device is advertising the capability of auto-negotiation. 

lp_cap_1000fdx

KSTAT_DATA_CHAR

Indicates the link partner device is 1 Gbits/s full duplex capable. 

lp_cap_1000hdx

KSTAT_DATA_CHAR

Indicates the link partner device is 1 Gbits/s half duplex capable. 

lp_cap_100fdx

KSTAT_DATA_CHAR

Indicates the link partner device is 100 Mbits/s full duplex capable. 

lp_cap_100hdx

KSTAT_DATA_CHAR

Indicates the link partner device is 100 Mbits/s half duplex capable. 

lp_cap_10fdx

KSTAT_DATA_CHAR

Indicates the link partner device is 10 Mbits/s full duplex capable. 

lp_cap_10hdx

KSTAT_DATA_CHAR

Indicates the link partner device is 10 Mbits/s half duplex capable. 

lp_cap_asmpause

KSTAT_DATA_CHAR

Indicates the link partner device is capable of asymmetric pause Ethernet flow control. 

lp_cap_pause

KSTAT_DATA_CHAR

Indicates the link partner device is capable of symmetric pause Ethernet flow control when lp_cap_pause is set to 1 and lp_cap_asmpause is set to 0. When lp_cap_asmpause is set to 1, lp_cap_pause has the following meaning:

  • lp_cap_pause = 0 Link partner will transmit pauses based on receive congestion.

  • lp_cap_pause = 1 Link partner will receive pauses and slow down transmit to avoid congestion.

lp_rem_fault

KSTAT_DATA_CHAR

Indicates the link partner is experiencing a fault with the link. 

lp_cap_autoneg

KSTAT_DATA_CHAR

Indicates the link partner device is capable of auto-negotiation. 

link_asmpause

KSTAT_DATA_CHAR

Indicates the link is operating with asymmetric pause Ethernet flow control. 

link_pause

KSTAT_DATA_CHAR

Indicates the resolution of the pause capability. Indicates the link is operating with symmetric pause Ethernet flow control when link_pause is set to 1 and link_asmpause is set to 0. When link_asmpause is set to 1 and is relative to a local view of the link, link_pause has the following meaning:

  • link_pause = 0 This station will transmit pauses based on receive congestion.

  • link_pause = 1 This station will receive pauses and slow down transmit to avoid congestion.

link_duplex

KSTAT_DATA_CHAR

Indicates the link duplex. 

  • link_duplex = 0 Link is down and duplex is unknown.

  • link_duplex = 1 Link is up and in half duplex mode.

  • link_duplex = 2 Link is up and in full duplex mode.

link_up

KSTAT_DATA_CHAR

Indicates whether the link is up or down. 

  • link_up = 0 Link is down.

  • link_up = 1 Link is up.