Commit Graph

84 Commits

Author SHA1 Message Date
phk
6eb6a7debf Remove devconf, it never grew up to be of any use. 1996-09-06 23:09:20 +00:00
phk
33ff4b4097 Make a "DWIM" function for adding [bc]devsw entries for bdev drivers.
Saves about 280 butes of source per driver, 56 bytes in object size
and another 56 bytes moves from data to bss.

No functional change intended nor expected.

GENERIC should be about one k smaller now :-)
1996-07-23 21:52:43 +00:00
bde
935d63e48b Removed unused #includes of <i386/isa/icu.h> and <i386/isa/icu.h>. icu.h
is only used by the icu support modules and by a few drivers that know
too much about the icu (most only use it to convert `n' to `IRQn').  isa.h
is only used by ioconf.c and by a few drivers that know too much about
isa addresses (a few have to, because config is deficient).
1996-06-18 01:22:40 +00:00
gpalmer
b7df1cd597 Clean up -Wunused warnings.
Reviewed by:		bde
1996-06-12 05:11:41 +00:00
bde
06e2a1902e Fixed group and permissions for devfs devices (group operator was games;
permissions 0640 was 0600).
1996-06-08 09:18:27 +00:00
phk
286d237ebb Forget that TAILQ's must be init'ed. 1996-05-03 16:49:14 +00:00
phk
5e64b9ee40 Move from the old buf.b_actf to the new TAILQ(buf.b_act). 1996-05-03 14:57:27 +00:00
bde
fcad1c3534 Removed now-unused #includes of <machine/cpu.h>. They were for bootverbose
being declared in the wrong place.
1996-04-07 17:32:42 +00:00
scrappy
00f73c3d68 Switched from using devfs_add_sw() to using devfs_add_swf()
Reviewed by:	julian@freebsd.org
1996-03-28 14:29:52 +00:00
ache
4891c87bd7 Fix/cleanup raw partition open/close code 1996-03-17 13:33:42 +00:00
ache
5d63304ebe Fix re-sense code
Remove unused part of close code
1996-02-27 19:08:39 +00:00
ache
4f48ed5b2e rmcd0c: now several ioctls (eject/close/debug/reset/etc.) works
even not CD sensed. Open of this device without CD sensed allowed too.
Other ioctls re-sense CD for this device.
1996-02-27 18:53:50 +00:00
ache
023fba51be Implement CDIOCSTART 1996-02-13 02:32:36 +00:00
ache
b07c6e9555 Implement CD_MEDIA_CATALOG request for read_subchannel
Obtained from: NetBSD
1996-02-03 14:33:56 +00:00
ache
15bb6222c4 Detect yet one kind of device (taken from NetBSD)
Use more accurate TOC size calculation
1996-02-03 00:06:49 +00:00
ache
7719c10ba0 Implement PREVENT & CLOSE ioctls 1996-02-02 22:08:28 +00:00
ache
5531a66d7a Remove close tray on open - works very bad with xcdplayer 1996-02-02 21:18:02 +00:00
ache
500c7e6626 Calculate TOC size to match what scsi cd says.
Exchange control<->addr_type fields
1996-02-02 20:50:04 +00:00
ache
1e7f96b14a Implement PLAYBLOCKS ioctl, add argument checking to other PLAY* ioctls
Obtained from: NetBSD (partially)
1996-02-01 19:15:41 +00:00
ache
35b6cfc9fb Return to #pragma pack(4) after header is done
Obtained from: NetBSD
1996-02-01 17:19:46 +00:00
ache
c85561752c Fix TOC size calculation: old code assing volume size here 1996-02-01 16:51:53 +00:00
ache
2f0ae9091b Audio part: various improvements from NetBSD driver
Convert LBA to network order now
1996-01-30 23:27:20 +00:00
ache
2484a93ae4 READTOCENTRYS: protect against stack overflow when incorrect data
stored in CD's TOC
1996-01-30 13:15:28 +00:00
ache
018f8b73d4 Don't generate EINVAL for data_len too big in READTOCENTRYS, it
reduces automatically to reasonable value in the code below
1996-01-30 12:07:15 +00:00
ache
5cf5dc1c1b Fix audio part, especially READTOCENTRYS inspired by NetBSD driver
and my own ideas
1996-01-30 10:31:12 +00:00
joerg
f94995c9bc Hide the probe warnings behind `bootverbose'. 1996-01-23 22:55:08 +00:00
phk
fcefdce434 Make bin2bcd and bcd2bin global macroes instead of having local
implementations all over the place.
1996-01-15 10:28:44 +00:00
phk
b297af2609 Typo in my last commit. 1995-12-22 15:52:07 +00:00
phk
74eca218ef Remove crufty "pg" function. 1995-12-22 13:09:39 +00:00
bde
e0d6813568 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:44:58 +00:00
phk
d15f2efb88 Staticize and cleanup. 1995-12-10 13:40:44 +00:00
phk
34914741e3 Julian forgot to make the *devsw structures static. 1995-12-08 23:23:00 +00:00
julian
2a6a55ef99 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
julian
6458dd5afd 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
6c979de707 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
julian
c69a51501b the second set of changes in a move towards getting devices to be
totally dynamic.

this is only the devices in i386/isa
I'll do more tomorrow.
they're completely masked by #ifdef JREMOD at this stage...
the eventual aim is that every driver will do a SYSINIT
at startup BEFORE the probes, which will effectively
link it into the devsw tables etc.

If I'd thought about it more I'd have put that in in this set (damn)
The ioconf lines generated by config will also end up in the
device's own scope as well, so ioconf.c will eventually be gutted
the SYSINIT call to the driver will include a phase where the
driver links it's ioconf line into a chain of such. when this phase is done
then the user can modify them with the boot: -c
config menu if he wants, just like now..
config will put the config lines out in the .h file
(e.g. in aha.h will be the addresses for the aha driver to look.)
as I said this is a very small first step..
the aim of THIS set of edits is to not have to edit conf.c at all when
adding a new device.. the tabe will be a simple skeleton..

when this is done, it will allow other changes to be made,
all teh time still having a fully working kernel tree,
but the logical outcome is the complete REMOVAL of the devsw tables.

By the end of this, linked in drivers will be exactly the same as
run-time loaded drivers, except they JUST HAPPEN to already be linked
and present at startup..
the SYSINIT calls will be the equivalent of the "init" call
made to a newly loaded driver in every respect.

For this edit,
each of the files has the following code inserted into it:

obviously, tailored to suit..
----------------------somewhere at the top:
#ifdef JREMOD
#include <sys/conf.h>
#define CDEV_MAJOR 13
#define BDEV_MAJOR 4
static void 	sd_devsw_install();
#endif /*JREMOD */
---------------------somewhere that's run during bootup: EVENTUALLY a SYSINIT
#ifdef JREMOD
        sd_devsw_install();
#endif /*JREMOD*/
-----------------------at the bottom:
#ifdef JREMOD
struct bdevsw sd_bdevsw =
	{ sdopen,	sdclose,	sdstrategy,	sdioctl,	/*4*/
	  sddump,	sdsize,		0 };

struct cdevsw sd_cdevsw =
	{ sdopen,	sdclose,	rawread,	rawwrite,	/*13*/
	  sdioctl,	nostop,		nullreset,	nodevtotty,/* sd */
	  seltrue,	nommap,		sdstrategy };

static sd_devsw_installed = 0;

static void 	sd_devsw_install()
{
	dev_t descript;
	if( ! sd_devsw_installed ) {
		descript = makedev(CDEV_MAJOR,0);
		cdevsw_add(&descript,&sd_cdevsw,NULL);
#if defined(BDEV_MAJOR)
		descript = makedev(BDEV_MAJOR,0);
		bdevsw_add(&descript,&sd_bdevsw,NULL);
#endif /*BDEV_MAJOR*/
		sd_devsw_installed = 1;
	}
}
#endif /* JREMOD */
1995-11-28 09:42:06 +00:00
bde
1bc5fa9c2e 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
phk
2d769fd93f Remove unused functions and variables, make things static, and other cleanups. 1995-10-28 15:39:31 +00:00
bde
c788cf6955 Fix benign type mismatches in devsw functions. 82 out of 299 devsw
functions were wrong.
1995-09-08 11:09:15 +00:00
joerg
9250a2f9a8 Increase the DELAY_GETREPLY to 5000000. Not dangerous, this is
actually a timeout only.  The existing behaviour caused a

  mcd0: timeout getreply

at halt/reboot time.

Submitted by:	graichen@sirius.physik.fu-berlin.de (Thomas Graichen)
1995-08-15 19:56:59 +00:00
rgrimes
b6f07b22b2 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
rgrimes
04efbd5263 Fix -Wformat warnings from LINT kernel. 1995-05-11 19:26:53 +00:00
rgrimes
ff32d1dc9a Rewrite the MCD_TRACE macro to be a varargs macro so that the extraneous
arguments to printf could be fixed.

Correct all but 1 -Wformat warning.  Some would have caused garbage to
be printed due to missing args!
1995-05-09 11:39:40 +00:00
wollman
71d2138200 Add a class field to devconf and mst drivers.
For those where it was easy, drivers were also fixed to call
dev_attach() during probe rather than attach (in keeping with the
new design articulated in a mail message five months ago).  For
a few that were really easy, correct state tracking was added as well.
The `fd' driver was fixed to correctly fill in the description.
The CPU identify code was fixed to attach a `cpu' device.  The code
was also massively reordered to fill in cpu_model with somethingremotely
resembling what identifycpu() prints out.  A few bytes saved by using
%b to format the features list rather than lots of ifs.
1995-04-12 20:48:13 +00:00
bde
2ebb4e5ed8 Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) that I didn't notice when I fixed
"all" such warnings before.
1995-03-28 07:58:53 +00:00
ache
f6e15b7791 READSUBCHANNEL:
complete implementation of CD_MSF_FORMAT
implement CD_LBA_FORMAT
Issue STOP before reading toc entries
1995-02-23 17:40:16 +00:00
ache
47db45199e Increase retry count while reading toc, old one
isn't enough for spin up
1995-02-22 02:12:10 +00:00
ache
cc62209afd Implement tray closing and tray locking
Fix first open fails bug
1995-02-22 01:11:36 +00:00
ache
0e787e38ea Use double speed read for FX001D, now this drive
becomes two times faster than in old variant.
Get rid of false "media changed" errors during large disk transfers
1995-01-30 06:44:40 +00:00
ache
281863776f Merge several probe diagnostics into one.
Adjust for newer model for all non-LUxxx too.
FLAGS status register names cleanup
1994-12-24 13:24:02 +00:00