Tech Note 013
Title: Using the sgen device driver utility on Sun Solaris version 8+
Updated: October 2006
 

PLEASE NOTE:

THIS TECH NOTE AND THE METHODS OUTLINED HEREIN REPLACE THE PREVIOUS METHODS FOR BUILDING DEVICE DRIVERS ON SOLARIS INSTALLATIONS RUNNING AN EARLIER VERSION THAN SOLARIS 8 (i.e. ST AND DS DRIVERS)

Overview
The Sun sgen driver ships with the basic OS in Solaris version 8 and later. In FlashNet terms, it replaces the old st and ds drivers that have been used in prior versions of Solaris (ds and st can still be used in Solaris 8 and 9 without issue if required, but sgen should be the preferred method).

sgen works in a broadly similar fashion to the st driver, in that you must enter the relevant information about the devices into a configuration file, and then run a utility that uses this configuration file to build the actual drivers. sgen is able to build drivers for many different kinds of device (including both changers and drives), and hence you only need to use the sgen utility to build drivers for all. Drivers are then built in individual directories in /dev/scsi according to device type.

The examples detailed below all use scsi devices. Remember that if you are using fibre channel devices, you'll need to include separate entries in the sgen.conf file for all relevant lun addresses for an ID.

Example

In this example, we'll add a changer and 2 drives. The changer is scsi id 6 and the drives are scsi ids 1 and 2.

1 Edit the file /kernel/drv/sgen.conf. A sample file appears below:

#
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#
# Portions Copyright (c) Siemens 1999
# All rights reserved.
#
#ident "@(#)sgen.conf 1.1 99/09/23 SMI"
#
#
# WARNING: enabling this driver may impact the security and data integrity of
# devices on your system. Please refer to sgen(7d) for details.
#
# sgen may be configured to bind to SCSI devices exporting a particular device
# type, using the device-type-config-list, which is a ',' delimited list of
# strings.
#
device-type-config-list=
# "direct" (type 0x00)
# "sequential" (type 0x01)
# "printer" (type 0x02)
# "processor" (type 0x03)
# "worm" (type 0x04)
# "rodirect" (type 0x05)
# "scanner" (type 0x06)
# "optical" (type 0x07)
# "changer" (type 0x08)
# "comm" (type 0x09)
# "prepress1" (type 0x0A)
# "prepress2" (type 0x0B)
# "array_ctrl" (type 0x0C)
# "ses" (type 0x0D)
# "rbc" (type 0x0E)
# "ocrw" (type 0x0F)
# "bridge" (type 0x10)
# "type_0x<typenum>" (types 0x11-0x1e are undefined by SCSI-3)
# "type_unknown" (type 0x1f)
#
# In addition to binding to device types, sgen can be configured to bind to one
# or more particular devices. The latter is accomplished by specifying the
# Vendor and Product IDs returned by the device in response to the SCSI INQUIRY
# command. This is accomplished by specifying pairs of Vendor ID and Product ID
# strings in the inquiry-config-list property, below. "*" may be substituted
# for the vendor ID as a wildcard. See sgen(7D) for details and extended usage
# examples.
#
# USAGE EXAMPLE
#
# In this example, sgen is configured to bind to all scanner and ocrw devices in
# the system, as well as the UltraToast 4000 from ACME, and the PowerToast
# series of devices, regardless of vendor.
#
#device-type-config-list="scanner", "ocrw";
#
#inquiry-config-list= "ACME", "UltraToast 4000",
# "*", "PowerToast";#
# After configuring the device-type-config-list and/or the inquiry-config-list,
# the administrator must uncomment those target/lun pairs at which there are
# devices for sgen to control. If it is expected that devices controlled by
# sgen will be hotplugged or added into the system later, it is recommended
# that all of the following lines be uncommented.
#name="sgen" class="scsi" target=0 lun=0;
#name="sgen" class="scsi" target=0 lun=1;
#name="sgen" class="scsi" target=0 lun=2;
#name="sgen" class="scsi" target=0 lun=3;
#name="sgen" class="scsi" target=1 lun=0;
#name="sgen" class="scsi" target=2 lun=0;
#name="sgen" class="scsi" target=3 lun=0;
#name="sgen" class="scsi" target=4 lun=0;
#name="sgen" class="scsi" target=5 lun=0;
#name="sgen" class="scsi" target=6 lun=0;
#name="sgen" class="scsi" target=7 lun=0;
#name="sgen" class="scsi" target=8 lun=0;
#name="sgen" class="scsi" target=9 lun=0;
#name="sgen" class="scsi" target=10 lun=0;
#name="sgen" class="scsi" target=11 lun=0;
#name="sgen" class="scsi" target=12 lun=0;
#name="sgen" class="scsi" target=13 lun=0;
#name="sgen" class="scsi" target=14 lun=0;
#name="sgen" class="scsi" target=15 lun=0;

The sgen.conf file consists of two major sections - the device type config list and the scsi addresses. To enable the sgen utility to build drivers for the relevant devices, you have to edit the file to include the type of device(s) for which you want drivers, and the scsi addresses of those devices.

To create a list of device types, edit the line
device-type-config-list=
so that the device types appear in a list directly after this line (be sure to get the syntax of the entry correct):
device-type-config-list="sequential","changer";

Sequential is used for drives, changer for autochangers.

Next, you have to uncomment the lines of the relevant scsi ids from the list at the bottom of the file. You can of course merely use the scsi ids of the individual devices thus:
#name="sgen" class="scsi" target=0 lun=0;
name="sgen" class="scsi" target=0 lun=1;
name="sgen" class="scsi" target=0 lun=2;
#name="sgen" class="scsi" target=0 lun=3;
#name="sgen" class="scsi" target=1 lun=0;
#name="sgen" class="scsi" target=2 lun=0;
#name="sgen" class="scsi" target=3 lun=0;
#name="sgen" class="scsi" target=4 lun=0;
#name="sgen" class="scsi" target=5 lun=0;
name="sgen" class="scsi" target=6 lun=0;
#name="sgen" class="scsi" target=7 lun=0;
#name="sgen" class="scsi" target=8 lun=0;
#name="sgen" class="scsi" target=9 lun=0;
#name="sgen" class="scsi" target=10 lun=0;
#name="sgen" class="scsi" target=11 lun=0;
#name="sgen" class="scsi" target=12 lun=0;
#name="sgen" class="scsi" target=13 lun=0;
#name="sgen" class="scsi" target=14 lun=0;
#name="sgen" class="scsi" target=15 lun=0;

Note the lines for scsi ids 1, 2 and 6 have been uncommented (the # at the start of the line has been removed).

However, it is usually a good idea to uncomment all of the scsi ids. This will build device files for each scsi id, which means that you can add devices, change the ids of the current devices etc without having to rebuild the sgen drivers.

 
2 When you have edited and saved the sgen.conf file, you can use add_drv sgen to build the drivers. In some cases, you may need to remove existing device drivers first. To do this, run rem_drv sgen, then add_drv sgen.
 
Running add_drv sgen builds device drivers for each of the device types listed in sgen.conf. Each device type has its own directory in /dev/scsi, so using the example above, after add_drv sgen has been run, /dev/scsi/sequential and /dev/scsi/changer would be created. The actual device files would reside in these directories, and it is these that should be specified for each relevant device in the Flashnet UI.
 

 ==END==

>> top