C H A P T E R  4

Setting Parameters

This chapter describes three methods to configure the qfe driver parameters. This chapter contains the following sections:


Parameter Setting Options

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. If you want to test parameter settings, use the ndd utility described in Setting Parameters Using ndd . With ndd, the parameters are effective until you reboot the system.

To configure the qfe driver parameters for all devices in the system so that the parameter values are always in effect (even after rebooting the system), enter the parameter values in the /etc/system file. When the system is rebooted, it reads the /etc/system file and sets the parameter values in that file.. Setting Parameters in the /etc/system File describes this option.

To set the parameters for a particular device in the system, set the parameters in the qfe.conf file in the /kernel/drv directory. The parameters set in the qfe.conf file have precedence over the parameters set in the /etc/system file and override the parameters set in the /etc/system file. The parameters values set in qfe.conf are always in effect (even after rebooting the system). Setting Parameters Using the qfe.conf File describes this option.


Setting Parameters Using ndd

Use the ndd utility to configure parameters that are valid until you reboot the system. The ndd utility supports any networking driver, which 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 the qfe device, you must specify the device instance for the utility if there is more than one SUNW,qfe device.



Note - If there is only one SUNW,qfe device, the device is automatically chosen by the ndd utility.




procedure icon  t 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.

You should see the full path names of the qfe devices, similar to the following examples:

For Sun Quad FastEthernet PCI adapter:

/pci@1f,2000/pci@2/SUNW,qfe@0,1
/pci@1f,2000/pci@2/SUNW,qfe@1,1
/pci@1f,2000/pci@2/SUNW,qfe@2,1
/pci@1f,2000/pci@2/SUNW,qfe@3,1

For Sun Quad FastEthernet SBus adapter:

/sbus@1f,0/SUNW,qfe@1,8c30000
/sbus@1f,0/SUNW,qfe@1,8c20000
/sbus@1f,0/SUNW,qfe@1,8c10000
/sbus@1f,0/SUNW,qfe@1,8c00000

2. Use that instance number to select the device as follows:

% ndd -set /dev/qfe instance instance#

The device remains selected until you change the selection.

Non-Interactive and Interactive Modes

You can use the ndd utility in two modes:

In non-interactive 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.)

Using the ndd Utility in Non-Interactive Mode

This section describes how to modify a parameter value and how to display a parameter value.

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

Using 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? (Enter the  parameter name  or ? to view all parameters)

After you enter the parameter name, the ndd utility prompts you for the parameter value (see TABLE 3-2 through TABLE 3-9 ).

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

(See TABLE 3-2 through TABLE 3-9 for parameter descriptions.)

CODE EXAMPLE 4-1 Example of Listing All Parameters Supported by the qfe Driver
example# 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)
example# 

Setting Forced Mode

The following procedure describes how to set forced mode. When the SUNW,qfe device is in forced mode it is not capable of auto-negotiation.


procedure icon  t To Select One Local Transceiver Capability and Setting Forced Mode

1. Select one of the transceiver capabilities 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. The permitted values are as follows:

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 Using the ndd Utility in Non-Interactive Mode in this chapter.

Setting Auto-Negotiation Mode


procedure icon  t To Set the Mode to Auto-Negotiation

1. Select at least one of the five transceiver capabilities 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 Using the ndd Utility in Interactive Mode in this chapter.


Setting Parameters in the /etc/system File

To configure 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 4-1 lists the variables you need to set in the /etc/system file.

TABLE 4-1 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 Chapter 3 , are applicable to all SUNW,qfe devices on the system. See TABLE 3-2 through TABLE 3-9 for parameter descriptions. An example follows.


procedure icon  t To Set the ipg1 to 10 and ipg2 to 5 When Rebooting

1. As superuser, add the following lines to the /etc/system file:

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

2. Save the /etc/system file.

3. Save all files and exit all programs. Exit the windowing system.

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

The system is halted and then rebooted.


Setting Parameters Using the qfe.conf File

You can also specify the properties described in the section, Setting Parameters in the /etc/system File ," in this chapter on a per-device basis by creating the qfe.conf file in the /kernel/drv directory. The properties set in the qfe.conf file will override the parameters set in the /etc/system file. Use qfe.conf 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. An example follows:


procedure icon  t To Set ipg1 to 20 and ipg2 to 10 in SBus Slot 0xe

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 name
( 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. As superuser, create the qfe.conf file in the /kernel/drv directory using a text editor and add lines similar to the following to the file:

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

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

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

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

    These parameters are set to 20 and 10, respectively, in this example. The ipg parameters are defined in Driver Parameter Values and Definitions ..

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

4. Save the qfe.conf file.

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

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

Setting Driver Parameters for PCI-Bus qfe Interfaces Using qfe.conf


procedure icon   To Configure Driver Parameters on a Sun Quad FastEthernet PCI Adapter

1. Obtain the hardware path name for the qfe devices in the device tree.

Typically this path name and the associated instance number will be present in the
/etc/path_to_inst file. For example, on a Sun Ultra 30 UPA/PCI system in which one Sun Quad FastEthernet Device Driver PCI card is installed, the /etc/path_to_inst file will have the following entries (in addition to entries for other devices)

"/pci@1f,2000/network@1,1" 0 "qfe" 
"/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"

:

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:

In the second line in the previous example:

2. Set the ipg1 and ipg2 parameters for the above two 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;

Note that for the motherboard device, the SUNW,qfe device is used even though the path name uses the name network . The SUNW,qfe device name is the value of the compatible property for this device.

3. Save the /kernel/drv/qfe.conf file.

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

5. As superuser, halt and reboot the system by typing init 6.