drives require ST_Q_SNS_HLP, they also wrongly accept a blocksize of
1024 in the first place (for a QIC-150 cartridge), but complain later
about it. The hack is to only probe for 512 for them.
Reorder the entries in st_decide_mode() so that QIC >= 525 is properly
accepted as variable blocksize.
. remove some unused variables
. declare worminit() right this time, it's actually extern (?)
. use wormminphys(), now that it's already there (hope i've got this right)
Also declared worminit() to avoid a compiler warning. Seems that the
other SCSI drivers don't declare XXinit() yet, so perhaps we'd also
create a typedef for these func's.
The worm driver is alpha-usable! I've stuffed everything that is
needed into the kernel driver, including the logic to select
between different vendor's quirks.
Disclaimer: this has by now _only_ been tested on a heavily tweaked
2.0.5R system. I've done my best to retrofit it into -current, but
i don't have a chance yet to test it in a -current environment.
quite work yet, so the heart of it is disabled.
Added bdev and cdev args to dsopen().
drivers:
Fixed device names, links, minor numbers and modes.
wd.c:
Started actually supporting devfs.
diskslice.h:
Added devfs tokens to structs (currently 576 of them per disk! :-().
subr_diskslice.c:
Create devfs entries in dsopen() and (unsuccessfully) attempt to make
them go away at the right times. DEVFS is #undefed at the start so
that this shouldn't cause problems.
This makes it sorta usable, just for my ``proof-of-concept'' Perl
script i've been posting to freebsd-scsi. The driver will be
overhauled further, this is just to provide Jordan with a base to
perform testing of his own with his HP burner. Use entirely at your
own risk, expect a bunch of misburnt CD-R's when using it already in
this very green stage.
Note that by now the driver will only work when the CD-R has already
been in the drive at boot time.
obtained by the MOSE SENSE command. SONY drives are too stupid to eat
their own food.
Submitted by: stu@solaris.com (Stu Phillips)
While i was at it, i've removed two bogus channel numbers in the``set
mono'' command, that kept my Toshiba drive complaining.
Also remove Julian's misspelling of `stereo'.
Unstaticize a function in scsi/scsi_base that was used, with an undocumented
option.
My last count on the LINT kernel shows:
Total symbols: 3647
unref symbols: 463
undef symbols: 4
1 ref symbols: 1751
2 ref symbols: 485
Approaching the pain threshold now.
seems to work hre just fine though I can't check every file
that changed due to limmited h/w, however I've checked enught to be petty
happy withe hte code..
WARNING... struct lkm[mumble] has changed
so it might be an idea to recompile any lkm related programs
It will need to be changed
but it's the better starting point..
also add '?' to wildcarding in SCSI identification of devices..
so we can catch all PIONEER CD 6??* devices instead of having
separate entries for the 600, 602, 604X, 624X etc..
it's getting so we should have a small regexp routine in the kernel
maybe just a little one.. matching CDX-6[0-9][0-9][ A-Z] would be better
there will be drastic changes in this
but this is the best starting point..
most devsw referenced functions are now static, as they are
in the same file as their devsw structure. I've also added DEVFS
support for nearly every device in the system, however
many of the devices have 'incorrect' names under DEVFS
because I couldn't quickly work out the correct naming conventions.
(but devfs won't be coming on line for a month or so anyhow so that doesn't
matter)
If you "OWN" a device which would normally have an entry in /dev
then search for the devfs_add_devsw() entries and munge to make them right..
check out similar devices to see what I might have done in them in you
can't see what's going on..
for a laugh compare conf.c conf.h defore and after... :)
I have not doen DEVFS entries for any DISKSLICE devices yet as that will be
a much more complicated job.. (pass 5 :)
pass 4 will be to make the devsw tables of type (cdevsw * )
rather than (cdevsw)
seems to work here..
complaints to the usual places.. :)
to get the definitions of TRUE and FALSE which happen to be defined in
a deeply nested include.
Added nearby #includes of <sys/conf.h> where appropriate.
sscselect(). Use the standard dummies nostrategy(), noread(),
nowrite() and noselect() instead.
sscread() and sscwrite() returned bogus errnos. It isn't possible
to return an error from a select routine so noselect() is just as
bogus as sscselect() (it's equivalent to nullselect()).
That's EVERY SINGLE driver that has an entry in conf.c..
my next trick will be to define cdevsw[] and bdevsw[]
as empty arrays and remove all those DAMNED defines as well..
Each of these drivers has a SYSINIT linker set entry
that comes in very early.. and asks teh driver to add it's own
entry to the two devsw[] tables.
some slight reworking of the commits from yesterday (added the SYSINIT
stuff and some usually wrong but token DEVFS entries to all these
devices.
BTW does anyone know where the 'ata' entries in conf.c actually reside?
seems we don't actually have a 'ataopen() etc...
If you want to add a new device in conf.c
please make sure I know
so I can keep it up to date too..
as before, this is all dependent on #if defined(JREMOD)
(and #ifdef DEVFS in parts)
Convert the remaining sysctl stuff to the new way of doing things.
the devconf stuff is the reason for the large number of files.
Cleaned up some compiler warnings while I were there.
replacing them with TAILQ's as appropriate. The SCSI code is the
first to be changed -- until the changes are complete, both b_act and
b_actf will be in the buf structure. b_actf will eventually be removed.
These functions went away:
enosys (hasn't been used for some time)
enxio
enodev
enoioctl (was used only once, actually for a vop)
if_tun.c:
Continued cleaning up...
conf.h:
Probably fixed the type of d_reset_t. It is hard to tell the correct
type because there are no non-dummy device reset functions.
Removed last vestige of ambiguous sleep message strings.
to <machine/conf.h>. conf.h was mechanically generated by
`grep ^d_ conf.c >conf.h'. This accounts for part of its ugliness. The
prototypes should be moved back to the driver sources when the functions
are staticalized.
magneto-optical devices, it's scope can (and should) be widened to
cover all removable type 0 (direct) devices as well, since this class
of devices is sharing the same principles. Things like suport for
media eject etc. will be supported later. (Shunsuke is also working
on the problems arising out of the use of media with physical block
size != 512 bytes (which is not uncommon for MODs).
Submitted by: akiyama@kme.mei.co.jp (Shunsuke Akiyama)
itself. Will do this after this commit.)
Make scsiconf more flexible about recognizing ``foreign'' devices.
This part needs to be rewritten some day to allow for matches whithou
strict version number checks, but either Julian as Peter seem to be
too busy right now, so i'm finally commiting the version that's
working for me stable now for several months, as an interim
workaround.
Submitted by: akiyama@kme.mei.co.jp (Shunsuke Akiyama)
sometime around 1.51, the check for minphys dissappeared out of
transfers for disks..
we weren't hecking that the adapter could handle a transfer of
the size we were requesting..
Peter!?
:)
this explains the rash of failures I've seen reported recently
with "too many DMA segments" on raw devices
(added one for st as well)
o don't use polled mode after the device probe phase
o don't biodone() a NULL buffer pointer
o increase the timeout for scsi_read_capacity(); WORMs are slooow
o make WORMMs known to scsiconf at all
This brings the driver in a state where it at least doesn't
immediately panic, nor hangs the controller any more. Unfortunately,
at least the YAMAHA CDR100 i've been testing with answered my write
attempts with an "Incorrect command sequence" response. Perhaps other
CD burners might work however.
Reviewed by: dufault
This change forces the controller drivers to allocate a scsibus_data struct
via a call to scsi_alloc_bus(), fill in the adapter_link field, and optionally
modify any other fields of the struct. Scsi_alloc_bus() initializes all fields
to the default, so the changes in most drivers are very minimal. For drivers
that support Wide controllers, the maxtarg field will have to be updated to
allow probing of all targets (for an example, look at the aic7xxx driver).
Scsi_attachdevs() now takes a scsibus_data* as its argument instead of an
sc_link*. This allows us to expand the role of the scsibus_data struct for
other bus level configuration setings (max number of transactions, current
transaction opennings, etc for better tagged queuing support).
Reviewed by: Rodney Grimes <rgrimes>, Peter Dufault <dufault>, Julian Elischer <julian>
for the kernel, but gcc provides an inline version of it if the
kernel is compiled with -O.
The inline memcmp() is OK for small compares and is better than
the dumb kernel bcmp() in all cases, but it has been hiding the
library memcmp() which is 4 times faster for large compares.
This is performed by using a line similar to:
controller scbus0 at ahc0 bus 1
to wire scbus0 to the second bus on an adaptec 2742T controller.
Reviewed by: Peter Dufault(dufault@hda.com), Rod Grimes(rgrimes@FreeBSD.org)
probes). Apart from there being no reason to set SCSI_NOSLEEP on every
tape command, this prevents controller drivers from sleeping when resources
are fully utilized causing unecessary "Oops not queued" errors. This is
only noticed for controllers that can run out of resources like the
27/2842 adaptec controllers. Before this fix, it is almost impossible to
perform extended tape operations if more than one scsi disk is on the
bus with the tape drive with these controllers. This does not address a
similar problem that could occur if devices are probed while other targets
are active since SCSI_NOSLEEP will still be set in that case.
>Synopsis: Booting w/scsi tape in drive causes first use to fail
Booting with a tape in a SCSI tape drive will cause the first
use of the tape to fail with the following message:
st0: bad request, must be between 0 and 0.
Submitted by: mpp@legarto.minn.net (Mike Pritchard)
loading kernel
worm.o: Undefined symbol `_STUNIT' referenced from text segment
I copied the STUNIT definition from the old scsiconf.c into this file to
work around this problem.
Added CONTROL device that only does user-ioctl and nothing else;
Added protection so user-ioctl requires write access;
Clean up scsiconf.h a little. It needs more work.
user-level part has already been commited.)
Note that i've lost the "official" code for this; it went into the
system after 1.1.5.1. The commited code is my own version, but it has
proven to work for me for more than a year now.
flags parameter to all xxstart routines so that the correct information can
be passed down into the device specific routines. This is needed to ensure
that ccb/scb allocation routines don't hang.
Submitted by: John Dyson
function calls. Broken tracking of open partitions gets fixed as a side
effect. Races in sdopen() and sdioctl() become more numerous than before.
Close the device in sdsize(). Media removal could not have worked right
when unused swap devices were held open. There may now be a problem
with used swap devices not being held open.
Fix ancient operator precedence bug in sddump(). It may have been
possible to attempt dumping to unloaded media.
Remove NetBSD ifdefs. We're too different now, and the NetBSD driver was
already too different for them to be relevant.
Remove support for soft write protection. There are no ioctls to set it,
and this driver never set it either. It was used in the wd driver to
disable writing to unlabelled disk, but we want to support writing to
foreign partitions on unlabeled disks.
Clean up some formatting and restore some old-style function headers.
sd.c: Julian's removal of subdriver requests
st.c, scsi_tape.h: Julian's suport of compressed tape drives
Note: compressed tape drives are still not working fully.
scsiconf.h, scsi_base.c, scsi_driver.c: address problems in probes
and error console logs
Fix it so that calls to extend_get won't dereference 0 when "swap
on sd.." calls sdsize() on systems with no SCSI devices.
This probably really fixes Poul's "boot with no SCSI" problem.
tape drive. I traced it to sys/scsi/scsi_base.c where some code were added
to print the return values of the sense command. My tape drive returned a
extended flags value of 0x20, so the key that is the lower 4 bits, is 0.
The code uses "key-1" to index into a table and then the kernel go to never-
never land.
Here is a fix for this. Will somebody please apply it?
Submitted by: John Hay
Reenabled "SCIOCOMAND" ioctl.
Restructured so low level drivers can easily request retries.
Added preliminary fixed SCSI devices (should be revisited before 2.1)
Added "ssc" device that can have its' (HBA, ID, LUN) set via ioctl.
Change the sc_link structure from 8 targets with 8 lun's to
16 targets with 8 lun's. Wide scsi and the ncr 825 does support 16 targets.
scsiconf.c:
move the addition of the trailing NUL's out of a then clause, they are also
needed in the else clause for an unknown device.
scsi adapter. Let it work on every adapter. Someone want to rewrite
this to be coupled with the adapter specification in the config file,
so that you can say which adapters need it ?