Naive question: 2.2.x or 2.4.x drvconfig equivalent in the w

Gregory Hosler gregory.hosler at eno.ericsson.se
Tue Jul 17 01:24:27 PDT 2001


On 17-Jul-01 Vincent Cojot wrote:
> 
> Hello Gregory,
> 
>       First, I'd like to thank everyone on the list for all of the
> answers that I got.. "add-single-device" isn't quite like drvconfig -i sd
> but it will do the job.. :) Also, I am by no means knowledgeable about
> SCSI in general and SCSI protocols in particular so I might have assumed
> that a scsi bus reset would do a scsi bus scan (I have seen that happen a
> few times but perhaps it was also some time ago..).  Perhaps I'm also
> confused about the exact significance of these scsi methods.. Are bus
> scans and resets not closely related to eachother? That is, can you force
> a bus scan without a bus reset, for example?

When a scsi driver loads, either in kernel init, or when the driver itself
is loaded (e.g. insmod in Linux), the driver will send a "test unit ready"
to each possible lun on the scsi chain. It then makes note of what devices are
available, and adds these to the scsi device list (/proc/scsi/scsi). As far as
I am aware, this is ONLY done when the driver initializes itself, though the
last time I spent alot of time in the scsi layer (i.e. above the driver layer)
was circa 1.0 / 1.2, and some things have changed since then.

A scsi bus reset is a scsi command, usually issued by the driver when a timeout
or other error condition occur. The intent is to clear the scsi bus of any
possible outstanding i/o, so that the driver has a clean/known synchronization
point with the devices.

I understand that there is now a ioctl command that can be used to issue a bus
reset. Without looking at the code, I don't really know whether that particular
ioctl performs, or causes to be performed, a scsi bus scan. Unless the scsi
layer code was rewritten so that the bus scan code can be called from other
than initialization, I would not expect (without lookiong at the code) that
the reset ioctl does a bus scan.

I do know that when a driver is insmod'ed, that driver will scan it's
scsi bus and add it's drivers to the scsi devices (/proc/scsi/scsi) - I believe
that the rmmod will similiarily remove them, but I'm not so positive about that.
Aside from this scan, I'm not so sure that there is presently a method to
rescan a scsi bus.

rgds,

-Greg

> On Tue, 17 Jul 2001, Gregory Hosler wrote:
> 
>> I'm not so sure that I would blindly assume that a scsi bus reset would
>> blissfully do a scsi bus scan. I haven't looked at the code in quite a few
>> years, but the early incarnations of the scsi layer didn't do a bus rescan
>> when the bus was reset.
>>
>> What would be really nice would be the equivalent of support for
>> hot-plugable
>> as applied to scsi. AFAIAA this is not in either 2.2 or 2.4.
>>
>> regards,
>>
>> -Greg
>>
>>
>> On 16-Jul-01 Mike Brown wrote:
>> >> Is there a device-specific (perhaps?) way to force a bus reset?
>> >
>> > Take a look at <linux>/include/scsi/sg.h
>> >
>> > One of the ioctl()'s is defined as:
>> >
>> >#define SG_SCSI_RESET 0x2284
>> >
>> > with subcommands:
>> >
>> >#define         SG_SCSI_RESET_NOTHING   0
>> >#define         SG_SCSI_RESET_DEVICE    1
>> >#define         SG_SCSI_RESET_BUS       2
>> >#define         SG_SCSI_RESET_HOST      3
>> >
>> > I gather you could get the job done via something like:
>> >
>> >#define MY_SG_DEV "/dev/sg0"
>> >
>> > int fd = open (MY_SG_DEV, O_RDWR);
>> >
>> > ioctl (fd, SG_SCSI_RESET, SG_SCSI_RESET_BUS);
>> >
>> >
>> > -Michael F. Brown, UMass Lowell Computer Science
>> >
>> > email:  mbrown at cs.uml.edu
>> >
>> > "Windows is a 32 bit patch to a 16 bit GUI based on an 8 bit
>> >  operating system."        -FAQs (from #linux on efnet)
>> >
>> >
>> > To Unsubscribe: send mail to majordomo at FreeBSD.org
>> > with "unsubscribe aic7xxx" in the body of the message
>>
>> ----------------------------------
>> E-Mail: Gregory Hosler <gregory.hosler at eno.ericsson.se>
>> Date: 17-Jul-01
>> Time: 11:19:37
>>
>>    You can release software that's good, software that's inexpensive, or
>>    software that's available on time.  You can usually release software
>>    that has 2 of these 3 attributes -- but not all 3.
>>
>> ----------------------------------
>>
> 
> ,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,
> Vincent S. Cojot, Computer Engineering. STEP project. _.,-*~'`^`'~*-,._.,-*~
> Ecole Polytechnique de Montreal, Comite Micro-Informatique. _.,-*~'`^`'~*-,.
> Linux Xview/OpenLook resources page _.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'
> http://step.polymtl.ca/~coyote  _.,-*~'`^`'~*-,._ coyote at step.polymtl.ca
> 
> They cannot scare me with their empty spaces
> Between stars - on stars where no human race is
> I have it in me so much nearer home
> To scare myself with my own desert places.       - Robert Frost

----------------------------------
E-Mail: Gregory Hosler <gregory.hosler at eno.ericsson.se>
Date: 17-Jul-01
Time: 16:29:08

   You can release software that's good, software that's inexpensive, or
   software that's available on time.  You can usually release software
   that has 2 of these 3 attributes -- but not all 3.

----------------------------------

To Unsubscribe: send mail to majordomo at FreeBSD.org
with "unsubscribe aic7xxx" in the body of the message




More information about the aic7xxx mailing list