devcfg(1M)devcfg(1M)NAMEdevcfg - general purpose driver configuration utility
SYNOPSIS
/usr/etc/devcfg [-v] -d dev_path [-s] -f config_file
/usr/etc/devcfg [-v] -d dev_path -c-f config_file
/usr/etc/devcfg [-v] -d dev_path -g
/usr/etc/devcfg [-v] -d dev_path -a device_id label=value
DESCRIPTIONdevcfg is a general purpose configuration utility. It can set, report
and modify configuration parameters for any device driver which supports
the devcfg ioctl call and uses a configuration file in the format
described below (see CONFIGURATION FILE FORMAT).
OPTIONS
MODES: devcfg operates in one of four modes: Set, Check, Get or Add, as
specified by the -s, -c, -g and -a command line switches, respectively.
If more than one of these switches exist, the last one is used and the
previous values are ignored.
-s Set mode. The specified configuration file is parsed by devcfg, and
verified for correct syntax, as defined in CONFIGURATION FILE FORMAT
below. If no syntax errors are detected, devcfg passes the file's
contents to the driver. It is the driver's responsibility to verify
all device identifiers, labels and values - devcfg performs syntax
checking only.
If the driver detects an unknown device identifier, unknown
parameter label, illegal parameter value, or any other configuration
error, an informative error message is output and the new
configuration is ignored. If no errors were detected by the driver,
it saves the configuration as its "Current configuration" (see Get
mode) so that it can be "applied" to the devices under its control.
The exact definition of "applying" a configuration is driver-
dependant. The Tigon3 driver (tg) for example, might not update an
interface's hardware register to its Current configuration value
until the next time the interface is initialized via ifconfig.
-c Check mode. Both devcfg and the driver check the specified
configuration file for errors (as in Set mode), but the
configuration file is then discarded, even if there were no errors.
The "Current configuration" saved by the driver (see Get mode) does
not change, and the new configuration is not "applied" by the
driver.
This is intended to be used as a sanity check when editing a
configuration file.
Page 1
devcfg(1M)devcfg(1M)-g Get mode. The "Current configuration" (if any) is retrieved from
the driver and written to standard output in a format suitable to be
redirected to a file and subsequently sent back to the driver in Set
mode.
Note that if a configuration file is first sent to the driver in Set
mode, then retrieved in Get mode, there will be some (non-
functional) differences. Specifically, all comment lines will be
stripped off, and the label=value lines within each block will
probably be reordered.
This is useful to verify that the driver has saved a previously set
configuration. It can also be used to save, in a reusable form, a
configuation which was interactively edited while in Add mode.
-a device_id label=value
Add mode. Add or modify a single configuration parameter in the
driver's "Current configuration". The -a switch must be immediately
followed by a dev_id device identifier and label=value pair, in that
order.
The device_id device identifier string specifies the device on which
the change is to be performed. Each driver defines its own scheme
for assigning device identifier strings and associating them to
their associated devices. The Tigon3 driver, for example,
recognizes the network interface name (e.g. "tg3") as a valid device
identifier associated with its device with a unit number of 3.
The label=value pair specifies the configuration parameter to be
added or modified, and the value that the parameter is to be set to.
For example,
devcfg-a tg2 coal_usecs_rx=100
will modify the receive coalescence timeout value to 100 usecs on
the Tigon3 driver's "tg2" interface.
-v Verbose mode. Debug messages will be displayed when the config file
is being parsed.
-d dev_path
The path to the driver's device special file in the hardware graph
which is to receive all DEVCFG ioctl calls. This path is driver-
dependant (e.g. /hw/net/if_tg).
-f config_file
Path to the configuration file to be scanned in Set or Check mode.
This argument is ignored in Get or Add mode.
Page 2
devcfg(1M)devcfg(1M)CONFIGURATION FILE FORMAT
A devcfg configuration file consists of one or more blocks of parameter
definitions, delimited by curly braces and optionally separated by blank
and/or comment lines. Comment lines begin with a '#'. All whitespace on
a line is treated the same (indentation is not significant).
Each block consists of one or more DEVICE: lines, followed by a line
containing just a left curly brace, followed by one or more parameter
definitions in label=value format, followed by a line containing just a
right curly brace.
The DEVICE: line(s) which precede each block specifies which device(s)
the enclosed configuration parameters apply to. Each DEVICE: line
contains a "device identifier" which specifies one or more devices to be
associated with that block. This device identifier is associated with
one or more devices in a driver-dependant manner. In the sample
configuration file below for example, the Tigon3 driver recognizes a
special device identifier of "defaults", which is associated with any of
its devices which does not explicitly on its own DEVICE: line.
SAMPLE CONFIGURATION FILE:
# Tigon3 Gigabit Ethernet controller custom
# configuration.
# Specify default configuration, to be applied
# to interfaces which don't have their own block.
DEVICE: defaults
{
autoneg=ON
link_pref=AUTO
flow_ctrl=ON
# (Remaining definitions deleted for brevity)
}
# Lock tg1 and tg3 interfaces down to 100 Mbps
# full duplex, with flow control disabled.
DEVICE: tg1
DEVICE: tg3
{
autoneg=FALSE
link_pref=100_FULL
flow_ctrl=OFF
}
SEE ALSOtgconfig(1M).
Page 3