DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

scsi_dev_cfg(D4osdi)


scsi_dev_cfg -- SCSI peripheral device configuration structure

Syntax

#include "scsi.h"

Description

Each peripheral driver that is mentioned in the mscsi(F)" file can expect to find an array named xxcfg in the kernel, where xx is the driver prefix. This array contains one entry for each xx line in the mscsi(F)" file and provides device-specific information. The entries in the array are in the order of the entries in the mscsi file.

Each entry is of type struct scsi_dev_cfg. The fields in the structure are described below:


int index;
The index of the current element in the array. This is also the ``unit number,'' which is derived from the order of the entries in the mscsi file.

char *dev_name;
The name of the peripheral driver.

dev_t devnum;
The major and minor number of the peripheral driver. The minor number will be 0.

unsigned char ha_num;
The host adapter number of the host adapter to which this device is attached.

unsigned char id;
The SCSI ID of the device's controller.

unsigned char lun;
The SCSI LUN of the device.

unsigned char distributed;
Indicates whether driver is distributed.

int (*adapter_entry)();
The address of the xx_entry routine of the adapter driver that is used to access this device.

struct exten *dext;
Reserved for future use.

If your driver does not conform to the standard naming convention established by the interface, you can manually create your own configuration tables rather than use those that are created automatically by the kernel Link Kit. When creating your own configuration tables, ou must also write your own version of the idscsi(ADM)" program that the Link Kit calls and you must provide driver access information about the device to your users. The Link Kit provides this and should be used to ensure that your driver can be brought up and tested before you create your own system.

Examples

The first example illustrates the definition of an array of ``Stp'' (generic SCSI tape drivers) peripheral drivers using the scsi_dev_cfg structure type.
   struct scsi_dev_cfg Stpcfg[]= {
   /* 0 */ {0x0,
   	"Stp",
   	(dev_t) 0x2e,
   	(unsigned char) 0x0,
   	(unsigned char) 0x2,
   	(unsigned char) 0x0,
   	(unsigned char) 0x0,
   	bhba_entry,
   	&extn[0] },
   /* 1 */ {0x1,
   	"Stp",
   	(dev_t) 0x0,
   	(unsigned char) 0x0,
   	(unsigned char) 0x0,
   	(unsigned char) 0x0,
   	(unsigned char) 0x0,
   	noha_entry,
   	&extn[8] },
   /* 2 */ {0x2,
   	"Stp",
   	(dev_t) 0x0,
   	(unsigned char) 0x0,
   	(unsigned char) 0x0,
   	(unsigned char) 0x0,
   	(unsigned char) 0x0,
   	noha_entry,
   	&extn[9] },
   

... /* 5 */ {0xff}, };

The second example illustrates the definition of an array of ``Sdsk'' (generic SCSI disk drivers) peripheral drivers using the scsi_ha_cfg structure type.
   struct scsi_dev_cfg Sdskcfg[]= {
   /* 0 */ {0x0,
   	"Sdsk",
   	(dev_t) 0x2d,
   	(unsigned char) 0x0,
   	(unsigned char) 0x0,
   	(unsigned char) 0x0,
   	(unsigned char) 0x0,
   	bhba_entry,
   	&extn[1] },
    ...
   /* 6 */ {0xff},
   };

19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005