Subject: Re: CCISS support, anyone?
To: Tonnerre LOMBARD <>
From: Manuel Bouyer <>
List: tech-kern
Date: 03/06/2006 12:56:23
On Mon, Mar 06, 2006 at 12:57:06AM +0100, Tonnerre LOMBARD wrote:
> Salut,
> I have already got the majority of the code to compile under NetBSD, but now
> I have a couple of constructs left which I can't seem to translate ad-hoc and 
> especially not in the middle of the night. They are:
>  - timeout_set/timeout_add/timeout_del

In guess these would translate to callout functions, but I don't know what
these timeout functions do exactly

>  - tvtohz

You probably want to use mstohz() here

>  - Returning sense error codes
> Especially the following code is a bit hard to figure out:
> 	xs->sense.error_code = SSD_ERRCODE_VALID | 0x70;
> 	xs->sense.flags = SKEY_ILLEGAL_REQUEST;
> 	xs->sense.add_sense_code = 0x24; /* ill field */

This create a sense condition with a specific error code.
In scsipi I think this would translate to (assuming xs is a struct
xs->sense.scsi_sense.response_code = SSD_ERRCODE_VALID | SSD_RCODE_CURRENT;
xs->sense.scsi_sense.flags = SKEY_ILLEGAL_REQUEST;
xs->sense.scsi_sense.asc = 0x24;
xs->sense.scsi_sense.ascq = 0x0;

also don't forget to set
xs->error = XS_SENSE;
so that scsipi knows it has to look at xs->sense.

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference