Need help with scsi-generic

David Miller (dmiller@sparks.net)
Wed, 24 Mar 1999 15:42:16 -0500 (EST)


Hi all:)

I'm trying to make a Vela scsi decoder be recognized as a generic scsi
device under RH 5.2 (2.0.36)

The Vela card comes up as a device type 12.

<quick description of symptom>

I've modified drivers/scsi/scsi.c enough to have the card recognized, and
not simply reject it as an unknown device type.

I added it's device type to sg.c as a legitimate type.

But it still isn't coming up as /dev/sga:(

Any general pointers?

</quick description>
<Long lengthy dissertation>

[dmesg output]

(scsi0) Downloading sequencer code... 419 instructions downloaded
scsi0 : Adaptec AHA274x/284x/294x (EISA/VLB/PCI-Fast SCSI) 5.1.2/3.2.4
<Adaptec AHA-294X Ultra SCSI host adapter>
scsi : 1 host.
Vendor: Vela Model: SCSI Decoder 2 Rev: 2w39
Checking type 12 in table
==> Type: VELA MPEG DECODER ANSI SCSI revision: 02
scsi : detected total.
tulip.c:v0.89H 5/23/98 becker@cesdis.gsfc.nasa.gov

The ==> is from my modification

Obviously I've not quite figured out how to make sg_ attach to the deice:(

Here's a list of all I've done.

So far I've:

changed MAX_SCSI_DEVICE_CODE in drivers/scsi/scsi.h to 13

#def'd TYPE_VELA as 12 in scsi.c

updated the scsi_device_types table in scsi.c to include two
"filler" slots and "VELA MPEG DECODER" in the 13'th slot

and added it to: (scsi.c again)
switch (type = (scsi_result[0] & 0x1f)) {
case TYPE_TAPE:
case TYPE_DISK:
case TYPE_MOD:
case TYPE_PROCESSOR:
case TYPE_SCANNER:
case TYPE_MEDIUM_CHANGER:
case TYPE_VELA:
and added it to:

/*
* sd and sr drivers allocate scatterlists.
* sr drivers may allocate for each command 1x2048 or 2x1024 extra
* buffers for 2k sector size and 1k fs.
* sg driver allocates buffers < 4k.
* st driver does not need buffers from the dma pool.
* estimate 4k buffer/command for devices of unknown type (should
panic).
*/
if (SDpnt->type == TYPE_WORM || SDpnt->type == TYPE_ROM ||
SDpnt->type == TYPE_VELA ||
SDpnt->type == TYPE_DISK || SDpnt->type == TYPE_MOD) {
new_dma_sectors += ((host->sg_tablesize *
sizeof(struct scatterlist) + 511) >> 9) *
SDpnt->queue_depth;
if (SDpnt->type == TYPE_WORM || SDpnt->type == TYPE_ROM)
new_dma_sectors += (2048 >> 9) * SDpnt->queue_depth;
}

In sg.c I added TYPE_VELA to:

static int sg_detect(Scsi_Device * SDp){

switch (SDp->type) {
case TYPE_DISK:
case TYPE_VELA:
case TYPE_MOD:
case TYPE_ROM:
case TYPE_WORM:
case TYPE_TAPE: break;
default:
printk("Detected scsi generic sg%c at scsi%d, channel %d, id %d,
lun %d\n",
'a'+sg_template.dev_noticed,
SDp->host->host_no, SDp->channel, SDp->id, SDp->lun);
}
sg_template.dev_noticed++;
return 1;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/