Platform Notes: The Sun Quad FastEthernet Device Driver

Chapter 2 Setting Parameters for the Sun Quad FastEthernet Device Driver

The qfe device driver controls the Sun Quad FastEthernet adapter's SUNW,qfe Ethernet devices. You can manually set the qfe device driver parameters to customize each SUNW,qfe device in your system. This chapter provides an overview of the local transceiver used in the adapter, lists the available qfe device driver parameters, and describes how you can set these parameters.

The Local Transceiver (Internal)

The four SUNW,qfe channels each provide 10BASE-T or 100BASE-TX networking interfaces, using the PCI FastEthernet and Expansion (PFEX) ASIC or the SBus FastEthernet Parallel SCSI (FEPS) ASIC and a local transceiver. The driver automatically sets the link speed to 10 or 100 Mbps and conforms to the 100BASE-T IEEE 802.3u Ethernet standard. The PFEX ASIC provides the PCI interface and Media Access Control (MAC) functions. The FEPS ASIC provides the SBus interface and MAC functions. The local transceiver, which connects to an RJ-45 connector, provides the physical layer functions.

The local transceiver is capable of all the operating speeds and modes listed in "Auto-Negotiation". The local transceiver performs auto-negotiation with the remote end of the link (link partner) to select a common mode of operation.

The local transceiver also supports a forced mode of operation. You can select the speed and mode using the ndd utility, by editing the /etc/system file, or creating a qfe.conf file in the /kernel/drv directory.

Driver Parameter Values and Definitions

This section describes the parameters and settings for the qfe device driver.

Table 2-1 qfe Driver Parameter, Status, and Description

Parameter  

Status 

Description 

transceiver_inuse

Read only 

Defines the current status 

link_status

Read only 

Defines the current status 

link_speed

Read only 

Defines the current status 

link_mode

Read only 

Defines the current status 

ipg1

Read and write 

Inter-packet gap parameter 

ipg2

Read and write 

Inter-packet gap parameter 

use_int_xcvr

Read and write 

Operational mode parameter 

pace_size

Read and write 

Operational mode parameter 

adv_autoneg_cap

Read and write 

Operational mode parameter 

adv_100fdx_cap

Read and write 

Operational mode parameter 

adv_100hdx_cap

Read and write 

Operational mode parameter 

adv_10fdx_cap

Read and write 

Operational mode parameter 

adv_10hdx_cap

Read and write 

Operational mode parameter 

autoneg_cap

Read only 

Local transceiver auto-negotiation capability 

100fdx_cap

Read only 

Local transceiver capability of the hardware 

100hdx_cap

Read only 

Local transceiver capability of the hardware 

10fdx_cap

Read only 

Local transceiver capability of the hardware 

10hdx_cap

Read only 

Local transceiver capability of the hardware 

lp_autoneg_cap

Read only 

Link partner auto-negotiation capability 

lp_100fdx_cap

Read only 

Link partner capability 

lp_100hdx_cap

Read only 

Link partner capability 

lp_10fdx_cap

Read only 

Link partner capability 

lp_10hdx_cap

Read only 

Link partner capability 

instance

Read and write 

Device instance 

lance_mode

Read and write 

Additional delay before transmitting a packet 

ipg0

Read and write 

Additional delay before transmitting a packet 

Defining the Current Status

The read-only parameters described in Table 2-2 explain the operational mode of the interface. These parameters define the current status.

Table 2-2 Read-Only Parameters for Defining the Current Status

Parameter 

Description 

Values 

link_status

Current link status 

0 = Link down 

1 = Link up 

link_speed

Valid only if the link is up 

0 = 10 Mbps 

1 = 100 Mbps 

link_mode

Valid only if the link is up 

0 = Half duplex 

1 = Full duplex 

Inter-Packet Gap Parameters

The PCI FastEthernet and Expansion (PFEX) ASIC and the SBus FastEthernet Parallel SCSI (FEPS) ASIC support the programmable inter-packet gap (IPG) parameters ipg1 and ipg2. The total IPG is the sum of ipg1 and ipg2. The total default IPG is 9.6 microseconds when the link speed set, by the auto-negotiation protocol, is 10 Mbps. When the link speed is 100 Mbps, the total default IPG is 0.96 microseconds.

Table 2-3 lists the default values and allowable values for the IPG parameters, ipg1 and ipg2.

Table 2-3 Read-Write Inter-Packet Gap Parameter Values and Descriptions

Parameter 

Values 

(Byte Time) 

Description 

ipg1

0, 255 

ipg1 = 8 (default at initialization)

ipg2

0, 255 

ipg2 = 4 (default at initialization)

By default, the driver sets ipg1 to 8-byte time and ipg2 to 4-byte time, which are the standard values. (Byte time is the time it takes to transmit one byte on the link, with a link speed of either 100 Mbps or 10 Mbps.)

If your network has systems that use a longer IPG (the sum of ipg1 and ipg2) and if those machines seem to be slow in accessing the network, increase the values of ipg1 and ipg2 to match the longer IPGs of other machines.

Defining an Additional Delay Before Transmitting a Packet Using lance_mode and ipg0

The PCI FastEthernet and Expansion (PFEX) ASIC and the SBus FastEthernet Parallel Port SCSI (FEPS) ASIC support a programmable mode called lance_mode. The ipg0 parameter is associated with lance_mode.

After a packet is received with lance_mode enabled (default) an additional delay is added by setting the ipg0 parameter before transmitting the packet. This delay, set by the ipg0 parameter, is in addition to the delay set by the ipg1 and ipg2 parameters. The additional delay set by ipg0 helps to reduce collisions. Systems that have lance_mode enabled might not have enough time on the network.

If lance_mode is disabled, the value of ipg0 is ignored and no additional delay is set. Only the delays set by ipg1 and ipg2 are used. Disable lance_mode if other systems keep sending a large number of back-to-back packets.

You can add the additional delay by setting the ipg0 parameter from 0 to 31, which is the nibble time delay. Note that nibble time is the time it takes to transfer four bits on the link. If the link speed is 10 Mbps, nibble time is equal to 400 ns. If the link speed is 100 Mbps, nibble time is equal to 40 ns.

For example, if the link speed is 10 Mbps, and you set ipg0 to 20 nibble times, multiply 20 by 400 ns to get 8000 ns. If the link speed is 100 Mbps, and you set ipg0 to 30 nibble times, multiply 30 by 40 ns to get 1200 ns.

Table 2-4 defines the lance_mode and ipg0 parameters.

Table 2-4 Parameters Defining lance_mode and ipg0

Parameter 

Values 

Description 

lance_mode

lance_mode disabled

lance_mode enabled (default)

ipg0

0-31 [The default value is 16 nibble-times, which is 6.4 microseconds for 10 Mbps and 0.64 microseconds for 100 Mbps.]

Additional IPG before transmitting a packet (after receiving a packet) 

Operational Mode Parameters

Table 2-5 describes the operational mode parameters and their default values.

Table 2-5 Operational Mode Parameters

Parameter 

Description 

Values 

adv_autoneg_cap

Local transceiver capability advertised by the hardware 

0 = Forced mode 

1 = Auto-negotiation (default) 

adv_100fdx_cap1

 

Local transceiver capability advertised by the hardware; read/write parameter 

0 = Not 100 Mbit/sec full-duplex capable (default) 

1 = 100 Mbit/sec full-duplex capable (default) 

adv_100hdx_cap1

Local transceiver capability advertised by the hardware; read/write parameter 

0 = Not 100 Mbit/sec half-duplex capable 

1 = 100 Mbit/sec half-duplex capable (default) 

adv_10fdx_cap1

Local transceiver capability advertised by the hardware; read/write parameter 

0 = Not 10 Mbit/sec full-duplex capable (default) 

1 = 10 Mbit/sec full-duplex capable 

adv_10hdx_cap [The priority (in descending order) for these parameters is: adv_100fdx_cap, adv_100hdx_capadv_10fdx_cap, adv_10hdx_cap.]

Local transceiver capability advertised by the hardware; read/write parameter 

0 = Not 10 Mbit/sec half-duplex capable 

1 = 10 Mbit/sec half-duplex capable (default) 

Defining the Number of Back-to-Back Packets to Transmit

The pace_size parameter (see Table 2-6) defines the maximum number of back-to-back packets you can transmit at one time. If the value is zero, there is no limit to the number of back-to-back packets that can be transmitted.

Table 2-6 Back-to-back Packet Transmission Capability

Parameter 

Values 

pace_size

1 to 255 = Number of back-to-back packets transmitted at one time 

 

0 = No limit to the number of back-to-back packets that can be transmitted (default) 

Reporting Transceiver Capabilities

Table 2-7 describes the read-only transceiver capabilities. These parameters define the capabilities of the hardware. The local transceiver can support all of these capabilities.

Table 2-7 Read-Only Transceiver Capabilities

Parameter 

Description 

Values 

autoneg_cap

Local transceiver capability of the hardware 

0 = Not capable of auto-negotiation 

1 = Auto negotiation capable 

100fdx_cap

Local transceiver capability of the hardware; initialized at startup 

0 = Not 100 Mbit/sec full-duplex capable 

1 = 100 Mbit/sec full-duplex capable 

100hdx_cap

Local transceiver capability of the hardware; initialized at startup 

0 = Not 100 Mbit/sec half-duplex capable  

1 = 100 Mbit/sec half-duplex capable 

10fdx_cap

Local transceiver capability of the hardware; initialized at startup 

0 = Not 10 Mbit/sec full-duplex capable 

1 = 10 Mbit/sec full-duplex capable 

10hdx_cap

Local transceiver capability of the hardware; initialized at startup 

0 = Not 10 Mbit/sec half-duplex capable 

1 = 10 Mbit/sec half-duplex capable 

Reporting the Link Partner Capabilities

Table 2-8 describes the read-only link partner capabilities.

Table 2-8 Read-Only Link Partner Capabilities

Parameter 

Values 

lp_autoneg_cap

0 = No auto-negotiation  

1 = Auto-negotiation 

lp_100fdx_cap

0 = No100 Mbit/sec full-duplex transmission 

1 = 100Mbit/sec full-duplex 

lp_100hdx_cap

0 = No 100 Mbit/sec half-duplex transmission 

1 = 100 Mbit/sec half-duplex 

lp_10fdx_cap

0 = No 10 Mbit/sec full-duplex transmission 

1 = 10 Mbit/sec full-duplex 

lp_10hdx_cap

0 = No 10 Mbit/sec half-duplex transmission 

1 = 10 Mbit/sec half-duplex 

If the link partner is not capable of auto-negotiation (when lp_autoneg_cap is 0) the information described in Table 2-8 is not relevant and the parameter value = 0.

If the link partner is capable of auto-negotiation (when lp_autoneg_cap is 1), the speed and mode information are displayed when you use auto-negotiation and get the link partner capabilities.

Setting the qfe Driver Parameters

You can set the qfe device driver parameters in three ways (ndd, /etc/system, and qfe.conf), depending on your needs. To set parameters that are valid until you reboot the system, use the ndd utility. Using ndd is a good way to test parameter settings.

To set parameters so they remain in effect after you reboot the system
  1. Add the parameter values to the /etc/system file when you want to set parameters for all devices in the system.

  2. Create a /kernel/drv/qfe.conf file and add parameter values to the this file when you need to set a particular parameter for a device in the system.

Setting Parameters Using the ndd Utility

Use the ndd utility to set parameters that are valid until you reboot the system. The ndd utility supports any networking driver, that implements the Data Link Provider Interface (DLPI).

The following sections describe how you can use the qfe driver and the ndd utility to modify (with the -set option) or display (without the -set option) the parameters for each SUNW,qfe device.

Identifying Device Instances

Before you use the ndd utility to get or set a parameter for a qfe device, you must specify the device instance for the utility since there will be at least four SUNW,qfe devices.

To Specify the Device Instance for the ndd Utility
  1. Check the /etc/path_to_inst file to identify the instance associated with a particular device.

    For Sun Quad FastEthernet PCI adapter:


    # grep qfe /etc/path_to_inst
    "/pci@1f,2000/pci@2/SUNW,qfe@0,1" 0 "qfe"
    "/pci@1f,2000/pci@2/SUNW,qfe@1,1" 1 "qfe"
    "/pci@1f,2000/pci@2/SUNW,qfe@2,1" 2 "qfe"
    "/pci@1f,2000/pci@2/SUNW,qfe@3,1" 3 "qfe"

    In the preceding example, the four SUNW,qfe@x,1 instances are from a Sun Quad FastEthernet PCI adapter installed in slot 2. For clarity, the instance numbers are bold.

    For Sun Quad FastEthernet SBus adapter:


    # grep qfe /etc/path_to_inst
    "/sbus@1f,0/SUNW,qfe@1,8c10000" 1 "qfe"
    "/sbus@1f,0/SUNW,qfe@1,8c00000" 0 "qfe"
    "/sbus@1f,0/SUNW,qfe@1,8c30000" 3 "qfe"
    "/sbus@1f,0/SUNW,qfe@1,8c20000" 2 "qfe"

    In the preceding example, the four SUNW,qfe@1 instances are from a Sun Quad FastEthernet SBus adapter installed in slot 1. For clarity, the instance numbers are bold.

  2. Use the instance number to select the device.


    # ndd -set /dev/qfe instance instance#
    

    The device remains selected until you change the selection.

Noninteractive and Interactive Modes

You can use the ndd utility in two modes:

In noninteractive mode, you invoke the utility to execute a specific command. Once the command is executed, you exit the utility. In interactive mode, you can use the utility to get or set more than one parameter value. Refer to the ndd(1M) man page for more information.

To Use the ndd Utility in Noninteractive Mode

This section describes how to modify and display parameter values.

  1. To modify a parameter value, use the -set option.

    If you invoke the ndd utility with the -set option, the utility passes value, which must be specified down to the named /dev/qfe driver instance, and assigns it to the parameter:


    # ndd -set /dev/qfe parameter_value

  2. To display the value of a parameter, specify the parameter name (and omit the value).

    When you omit the -set option, a query operation is assumed and the utility queries the named driver instance, retrieves the value associated with the specified parameter, and prints it:


    # ndd /dev/qfe parameter

To Use the ndd Utility in Interactive Mode
  1. To modify a parameter value in interactive mode, specify ndd /dev/qfe, as shown below.

    The ndd utility then prompts you for the name of the parameter:


    # ndd /dev/qfe
    name to get/set? parameter_name_or_?

    After entering the parameter name, or ? to view all parameters, the ndd utility prompts you for the parameter value.

  2. To list all the parameters supported by the qfe driver, type ndd /dev/qfe \?.


    # ndd /dev/qfe \? 
    ?                             (read only)
    transceiver_inuse             (read only)
    link_status                   (read only)
    link_speed                    (read only)
    link_mode                     (read only)
    ipg1                          (read and write)
    ipg2                          (read and write)
    use_int_xcvr                  (read and write)
    pace_size                     (read and write)
    adv_autoneg_cap               (read and write)
    adv_100fdx_cap                (read and write)
    adv_100hdx_cap                (read and write)
    adv_10fdx_cap                 (read and write)
    adv_10hdx_cap                 (read and write)
    autoneg_cap                   (read only)
    100fdx_cap                    (read only)
    100hdx_cap                    (read only)
    10fdx_cap                     (read only)
    10hdx_cap                     (read only)
    lp_autoneg_cap                (read only)
    lp_100fdx_cap                 (read only)
    lp_100hdx_cap                 (read only)
    lp_10fdx_cap                  (read only)
    lp_10hdx_cap                  (read only)
    instance                      (read and write)
    lance_mode                    (read and write)
    ipg0                          (read and write)
    # 

Setting Forced Mode

This section describes how to set forced mode (not capable of auto-negotiation).

To Select One Local Transceiver Capability and Set Forced Mode
  1. Select one of the four capabilities (adv_100fdx_cap, adv_100hdx_cap, adv_10fdx_cap, or adv_10hdx_cap), and set its value to 1.

    If you select more than one of the local transceiver capabilities, the driver selects the one that is highest in the priority order (see the footnote from Table 2-5).

  2. Set the local transceiver capabilities advertised by the hardware to forced mode = 0, which is not capable of auto-negotiation: adv_autoneg_cap 0

    Use the ndd utility as described in "To Use the ndd Utility in Interactive Mode".

Auto-Negotiation Mode

This section describes how to select at least one of the four local transceiver capabilities and set the mode to auto-negotiation.

To Set the Mode to Auto-Negotiation
  1. Select at least one of the five capabilities (adv_100fdx_cap, adv_100hdx_cap, adv_10fdx_cap, adv_10hdx_cap) that you want to advertise to the remote system, and set its value to 1.

  2. Set the local transceiver capabilities advertised by the hardware to 1, the auto-negotiation setting: adv_autoneg_cap 1

    Use the ndd utility as described in "To Use the ndd Utility in Interactive Mode".

Setting Parameters in the /etc/system File

To set the qfe driver parameters for all SUNW,qfe devices in the system so that the parameter variables are always effective (even after rebooting the system), enter the parameter variables in the /etc/system file. When you reboot the system, the system reads the /etc/system file and sets these parameter variables in the qfe module in the operating system kernel.

Table 2-9 lists the variables you can set in the /etc/system file.

Table 2-9 Setting Variables in the /etc/system File

Parameter 

Variable 

ipg1

qfe_ipg1

ipg2

qfe_ipg2

use_int_xcvr

qfe_use_int_xcvr

pace_size

qfe_pace_size

adv_autoneg_cap

qfe_adv_autoneg_cap

adv_100fdx_cap

qfe_adv_100fdx_cap

adv_100hdx_cap

qfe_adv_100hdx_cap

adv_10fdx_cap

qfe_adv_10fdx_cap

adv_10hdx_cap

qfe_adv_10hdx_cap

lance_mode

qfe_lance_mode

ipg0

qfe_ipg0

These parameter values, described in "Driver Parameter Values and Definitions", are applicable to all SUNW,qfe devices on the system.


Note -

In the future, the /etc/system file will not be available. It is not dynamic reconfiguration compatible.


To Set Parameters in the /etc/system File
  1. Become superuser.

  2. Add the appropriate lines to the /etc/system file. For example, to set the ipg1 and ipg2 parameters, make the following changes to the /etc/system file:


    set qfe:qfe_ipg1 = 10
    set qfe:qfe_ipg2 = 5
    

  3. Save the /etc/system file.

  4. Save all files and exit all programs, exit the windowing system.

  5. Reboot the system by typing init 6 at the superuser prompt.

Setting Parameters Using the /kernel/drv/qfe.conf File

You can also specify the properties described in the section, "Setting Parameters in the /etc/system File", on a per-device basis by creating a qfe.conf file in the /kernel/drv directory. The properties set in the qfe.conf file override the parameters set in the /etc/system file. Use a qfe.conf file when you need to set a particular parameter for a device in the system. The parameters you set are read and write parameters that are listed in "Driver Parameter Values and Definitions".

The man pages for prtconf(1M), system(4) and driver.conf(4) include additional details.

To Set Driver Parameters on a Sun Quad FastEthernet PCI adapter
  1. Obtain the hardware path names for the qfe devices in the device tree.

    Typically the path names and the associated instance numbers will be present in the /etc/path_to_inst file.


    # grep qfe /etc/path_to_inst
    "/pci@1f,2000/pci@2/SUNW,qfe@0,1" 4 "qfe"
    "/pci@1f,2000/pci@2/SUNW,qfe@1,1" 5 "qfe"
    "/pci@1f,2000/pci@2/SUNW,qfe@2,1" 6 "qfe"
    "/pci@1f,2000/pci@2/SUNW,qfe@3,1" 7 "qfe"

    • In the above lines:

    • The first part within the double quotes specifies the hardware node name in the device tree.

    • The second number is the instance number.

    • The last part in double quotes is the driver name.

    • In the device path name, the last component after the last / character and before the @ character is the device name.

    • The path name before the last component is the parent name.

    • The comma-separated numbers after the @ character at the end represent the device and function numbers, which are together referred to as unit-address.

    To identify a PCI device unambiguously in the qfe.conf file, use the name, parent name, and the unit-address for the device. Refer to the pci(4) man page for more information about the PCI device specification.

    In the first line of the previous example:

    • Name = SUNW,qfe

    • Parent = /pci@1f,2000/pci@2

    • Unit-address = 0,1

    In the second line in the previous example:

    • Name = SUNW,qfe

    • Parent = /pci@1f,2000/pci@2

    • Unit-address = 1,1

    In the third line in the previous example:

    • Name = SUNW,qfe

    • Parent = /pci@1f,2000/pci@2

    • Unit-address = 2,1

    In the fourth line in the previous example:

    • Name = SUNW,qfe

    • Parent = /pci@1f,2000/pci@2

    • Unit-address = 3,1

    1. For example, set the ipg1 and ipg2 parameters for the above four devices in the /kernel/drv/qfe.conf file.


      name = "SUNW,qfe" parent = "/pci@1f,2000/pci@2" unit-address = "0,1" ipg1=20 ipg2=10;
      name = "SUNW,qfe" parent = "/pci@1f,2000/pci@2" unit-address = "1,1" ipg1=20 ipg2=10;
      name = "SUNW,qfe" parent = "/pci@1f,2000/pci@2" unit-address = "2,1" ipg1=20 ipg2=10;
      name = "SUNW,qfe" parent = "/pci@1f,2000/pci@2" unit-address = "3,1" ipg1=20 ipg2=10;

    2. Save the qfe.conf file.

    3. Save and close all files and programs, and exit the windowing system.

    4. Halt and reboot the system by typing init 6 at the superuser prompt.

To Set Driver Parameters on a Sun Quad FastEthernet SBus adapter
  1. Invoke the prtconf -v command and pipe the output to the more command ( prtconf -v | more ) or redirect the output of the command to a file ( prtconf -v > filename) and print the redirected file.

  2. Find the section in the prtconf -v output for SUNW,qfe,instance #0, or SUNW,qfe,instance #1, and so on.

    The output for SUNW,qfe,instance #0 for a Sun Ultra 1 Creator Series system follows:


    SUNW,qfe, instance #0
                Driver software properties:
                    name <pm_norm_pwr> length <4>
                        value <0x00000001>.
                    name <pm_timestamp> length <4>
                        value <0x30743b26>.
                Register Specifications:
                    Bus Type=0xe, Address=0x8c00000, Size=108
                    Bus Type=0xe, Address=0x8c02000, Size=2000
                    Bus Type=0xe, Address=0x8c04000, Size=2000
                    Bus Type=0xe, Address=0x8c06000, Size=2000
                    Bus Type=0xe, Address=0x8c07000, Size=20

  3. Become superuser.

  4. Create the qfe.conf file in the /kernel/drv directory using a text editor and add lines appropriate for the parameter you are setting. Use the following example for setting ipg1 and ipg2 parameters:

    1. Specify name="qfe" and class="sbus".

    2. Use the reg property to specify the device, 0xe in this case. Use the value following Bus Type in the prtconf -v output.

    3. Type the addresses followed by the specified sizes. Precede each size with 0x and leading zeros, as indicated in the following screen.

    4. Set ipg1 and ipg2. Type a semicolon ( ; ) after the last value.

      In this example, these parameters are set to 20 and 10, respectively.


      name="qfe" class="sbus"
      reg=0xe,0x8c00000,0x00000108,0xe,0x8c02000,0x00002000,0xe,
      0x8c04000,0x00002000,0xe,0x8c06000,0x00002000,0xe,0x8c07000,
      0x00000020
      ipg1=20 ipg2=10;

  5. Save the qfe.conf file.

  6. Save and close all files and exit all programs; exit the windowing system.

  7. Halt and reboot the system by typing init 6 at the # prompt.