Commit Graph

175 Commits

Author SHA1 Message Date
Bruce Evans
f54d2260b4 Replaced odsize by generic nopsize.
Staticized.

Added prototypes.
1995-12-10 20:19:32 +00:00
Bruce Evans
658a9cba7e Replaced cdsize by generic nopsize.
Added prototypes.

Declared statics consistently.
1995-12-10 20:02:47 +00:00
Bruce Evans
4439655d52 Replaced nxdump by nodump (if the dump function gets called, then the
device must be configured, so ENXIO is a bogus errno).

Replaced zerosize by nopsize.  zerosize was a temporary alias.
1995-12-10 19:53:42 +00:00
Bruce Evans
bb51c61fdf Removed unused functions sudump() and supsize().
Added `extern' to misplaced public prototypes.
1995-12-10 14:57:04 +00:00
Julian Elischer
76092b8329 Make NEW_SCSICONF the default way of doing things
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..
1995-12-10 10:58:30 +00:00
Bruce Evans
1f598ab9bc Restored used variable `name[32]' (used by DEVFS).
Completed function declarations and/or added prototypes.
1995-12-10 01:47:34 +00:00
Poul-Henning Kamp
b2c3ac73a8 scsi_tape.h had some old cruft that looked like missing typedefs or
something.  Cleanup  some lint in sd.c and st.c.
1995-12-09 20:42:38 +00:00
Poul-Henning Kamp
d2f265fab8 Julian forgot to make the *devsw structures static. 1995-12-08 23:23:00 +00:00
Julian Elischer
87f6c6625d Pass 3 of the great devsw changes
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.. :)
1995-12-08 11:19:42 +00:00
David Greenman
efeaf95a41 Untangled the vm.h include file spaghetti. 1995-12-07 12:48:31 +00:00
Bruce Evans
86a1c05db0 Removed unnecessary #includes of <sys/user.h>. Some of these were just
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.
1995-12-06 23:44:23 +00:00
Bruce Evans
7c3bc2bfe9 Removed dummy routines sscstrategy(), sscread(), sscwrite() and
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()).
1995-12-05 19:36:47 +00:00
Julian Elischer
d3004119ff fix a couple of stuffups in the worm driver and in other associated scsi files 1995-12-05 07:14:27 +00:00
Julian Elischer
e862f24129 If the open fails, don't mark the device as open (duh!)
symptom:.. once an open of a 'can only open it once' device fails..
you can never open it again, as it was marked open but wasn't open..
1995-12-05 04:41:20 +00:00
Paul Traina
dedbc6f872 Fix support for QIC_3080 drives...it 1/2 worked before. 1995-11-30 07:43:47 +00:00
Julian Elischer
7198bf4725 If you're going to mechanically replicate something in 50 files
it's best to not have a (compiles cleanly) typo in it! (sigh)
1995-11-29 14:41:20 +00:00
Julian Elischer
53ac6efbd8 OK, that's it..
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)
1995-11-29 10:49:16 +00:00
Bruce Evans
f30e535f00 Completed function declarations, added prototypes and removed redundant
declarations.
1995-11-21 15:14:28 +00:00
Bruce Evans
512fef80a9 Completed function declarations and/or added prototypes. 1995-11-21 12:55:26 +00:00
Bruce Evans
d9c15605e3 Fixed replication error so that this compiles again.
Removed bogus comment and useless braces.
1995-11-21 08:35:49 +00:00
Poul-Henning Kamp
4b2af45f4b Mega commit for sysctl.
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.
1995-11-20 12:42:39 +00:00
David Greenman
fb27490243 Trim #includes to those that are necessary; other cosmetic changes. 1995-11-20 02:12:34 +00:00
John Dyson
68a2196fad First set of changes to eliminate the ad-hoc device buffer queues,
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.
1995-11-19 22:22:35 +00:00
Satoshi Asami
e77a9fca43 Minor aesthetics (changed "." to space in "cd present.[a x b records]"
and removed extraneous newline after "can't get the size").
1995-11-15 03:27:14 +00:00
David Greenman
98ce50c997 Set B_BUSY on the private buffer to avoid a panic in biodone when the
I/O completes. Bug apparantly seen when attempting to format SCSI disks.

Submitted by:	Peter Dufault <dufault@hda.com>
1995-11-10 14:54:16 +00:00
David Greenman
9b36d4e667 Initialize the 3 remaining elements of the scsi_cmd struct rather than
bzeroing the whole thing in sdstart().
1995-11-06 08:19:24 +00:00
Bruce Evans
8b25681eb5 Replaced bogus macros for dummy devswitch entries by functions.
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.
1995-11-06 00:36:19 +00:00
Bruce Evans
4fda91c705 Moved prototypes for devswitch functions from conf.c and driver sources
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.
1995-11-04 13:25:33 +00:00
Bruce Evans
dd1642c2c4 Fixed the type of sscstrategy() (return void).
Removed sscdump() (it was never used).
Removed sscpsize() (it was never used, and returned a bogus value (ENXIO = 6
means a size of 6)).
1995-11-04 11:12:41 +00:00
Joerg Wunsch
b372e37cdf The "od" driver. While the name is suggesting the use for
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)
1995-10-31 17:25:58 +00:00
Joerg Wunsch
f60e6466c4 Include the "od" driver. (Oops, forgot to cvs add the driver file
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)
1995-10-31 17:21:00 +00:00
Poul-Henning Kamp
7503109d24 Make a lot of things static. 1995-10-21 23:13:11 +00:00
Julian Elischer
234d1b32a8 oops currupted a line by hitting the wrong key..
fix it
1995-10-12 02:05:47 +00:00
Julian Elischer
827d45ab08 Ack!
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)
1995-10-12 02:02:03 +00:00
Joerg Wunsch
b629f8ebbe Some bug fixes for the worm driver:
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
1995-10-09 15:15:01 +00:00
Peter Dufault
84f1508aea Say so if a sense code is vendor specific. 1995-10-01 15:19:05 +00:00
Justin T. Gibbs
07b1c6b3c9 Remove hard coded assumption that SCSI busses have 7 targets.
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>
1995-08-23 23:03:34 +00:00
Bruce Evans
bf25be48a5 Make everything except the unsupported network sources compile cleanly
with -Wnested-externs.
1995-08-16 16:14:28 +00:00
David Greenman
0640d91d78 Set bp->b_actf=NULL for paranoia sake. 1995-08-07 11:56:31 +00:00
Bruce Evans
73145c38cc Change memcmp() to bcmp(). memcmp() isn't declared or implemented
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.
1995-07-25 22:09:06 +00:00
Justin T. Gibbs
31acd246c0 Allow the specification of the controller bus when wiring down scsi buses.
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)
1995-07-17 23:38:16 +00:00
Justin T. Gibbs
ffc2aaf2d8 Do not set SCSI_NOSLEEP on every tape command (the exception being during
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.
1995-07-16 09:13:14 +00:00
Bruce Evans
d3ebcaeb6b Fix benign function type mismatch. 1995-07-13 16:08:57 +00:00
Joerg Wunsch
6aeb10f748 PR #kern/572:
>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)
1995-07-09 08:14:24 +00:00
Atsushi Murai
634ccfcbf6 Bestmatch check for cd-drive always faild due to additional space
on manufacture and  other items. So it's never probe as MORE_LUNS
after frist SONY entry....
1995-06-14 12:28:32 +00:00
Rodney W. Grimes
9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
Rodney W. Grimes
b2b795f07c Fix -Wformat warnings from LINT kernel. 1995-05-11 19:26:53 +00:00
John Dyson
40ab35ce04 Added bounce support for user scsi requests.
Reviewed by:	David Greenman
1995-05-09 02:38:15 +00:00
Bruce Evans
d9bf888a1b sdsize() didn't open a device often enough. This caused swap partitions on
slices other than the first slice looked at to be unavailable for swapping.
1995-05-08 16:53:33 +00:00
Peter Dufault
386d2d2de0 Change defintion of unit to minor(dev). Sorry for not
having this in my local build.  Thanks to gpalmer.
1995-05-03 23:53:32 +00:00