Commit Graph

118 Commits

Author SHA1 Message Date
Bruce Evans
29d6b96d69 The ioctl request arg is unsigned long, so don't attempt to pass it
around as signed int.
1998-07-15 09:59:31 +00:00
Julian Elischer
ad27f8d9a5 SLICE probing becomes asynchronous. It can now be triggered by
interupt level events. This needs a lot of cleanup, but has been working
here for a month or two.. originally needed for CAM integration
but that hasn't happenned yet. The probing  state machines for each
handler should be replaced by a more generic state-service. It's
still quite messy in there..
1998-07-13 08:23:05 +00:00
Bruce Evans
a838d83d8f Don't pretend to support ix86's with 7-bit ints by using longs just to
ensure 8-bit variables.  Doing so mainly bogotified some printf formats.
1998-07-11 06:35:39 +00:00
Julian Elischer
f7ea2f55d1 There is no such thing any more as "struct bdevsw".
There is only cdevsw (which should be renamed in a later edit to deventry
or something). cdevsw contains the union of what were in both bdevsw an
cdevsw entries.  The bdevsw[] table stiff exists and is a second pointer
to the cdevsw entry of the device. it's major is in d_bmaj rather than
d_maj. some cleanup still to happen (e.g. dsopen now gets two pointers
to the same cdevsw struct instead of one to a bdevsw and one to a cdevsw).

rawread()/rawwrite() went away as part of this though it's not strictly
the same  patch, just that it involves all the same lines in the drivers.

cdroms no longer have write() entries (they did have rawwrite (?)).
tapes no longer have support for bdev operations.

Reviewed by: Eivind Eklund and Mike Smith
	Changes suggested by eivind.
1998-07-04 22:30:26 +00:00
Doug Rabson
498b291e26 Fix some more ioctls which I missed becausese they were hidden by options
which were not in LINT.
1998-06-07 19:40:41 +00:00
Doug Rabson
ecbb00a262 This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
1998-06-07 17:13:14 +00:00
Julian Elischer
9b7408fe46 There is no dump routine for fd so give it an explicit NULL entry
in the SLICE table.
1998-05-06 23:35:36 +00:00
Julian Elischer
7f2f1b784e Add dump support to the DEVFS/slice code.
now we can actually catch our crashes :-)

Submitted by: Luoqi Chen <luoqi@chen.ml.org> (the man who's everywhere)
1998-05-06 22:14:48 +00:00
Julian Elischer
26d3bf5f1b close() is no longer a SLICE method.
Close is simply an open with no-read and no-write once internal to SLICE
(it still exports a close to the rest of the kernel)
1998-04-22 10:25:27 +00:00
Julian Elischer
3e425b968d Add changes and code to implement a functional DEVFS.
This code will be turned on with the TWO options
DEVFS and SLICE. (see LINT)
Two labels PRE_DEVFS_SLICE and POST_DEVFS_SLICE will deliniate these changes.

/dev will be automatically mounted by init (thanks phk)
on bootup. See /sys/dev/slice/slice.4 for more info.
All code should act the same without these options enabled.

Mike Smith, Poul Henning Kamp, Soeren, and a few dozen others

This code does not support the following:
bad144 handling.
Persistance. (My head is still hurting from the last time we discussed this)
ATAPI flopies are not handled by the SLICE code yet.

When this code is running, all major numbers are arbitrary and COULD
be dynamically assigned. (this is not done, for POLA only)
Minor numbers for disk slices ARE arbitray and dynamically assigned.
1998-04-19 23:32:49 +00:00
Dag-Erling Smørgrav
dc73342347 Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108. 1998-04-17 22:37:19 +00:00
Eivind Eklund
7b778b5e61 Make all file-system (MFS, FFS, NFS, LFS, DEVFS) related option new-style.
This introduce an xxxFS_BOOT for each of the rootable filesystems.
(Presently not required, but encouraged to allow a smooth move of option *FS
to opt_dontuse.h later.)

LFS is temporarily disabled, and will be re-enabled tomorrow.
1998-01-24 02:54:56 +00:00
Poul-Henning Kamp
ab3f746966 In all such uses of struct buf: 's/b_un.b_addr/b_data/g' 1997-12-02 21:07:20 +00:00
Joerg Wunsch
0722d6aba3 Introduce a device flags value of 0x1 to always pretend a 1.44 MB
floppy drive #0, regardless of what the CMOS says.  This is intended
as a bandaid for those plagued with Compaq's idea to not announce the
floppy drive on their `Aero' notebook.

Using the device flags is not very nice (in particular since they
aren't per-drive but per-controller), but still looks a lot better to
me than the disgusting guesswork hack that was recently posted to
-hackers.

Doc update will follow shortly.
1997-10-19 13:12:02 +00:00
Justin T. Gibbs
27651b7faa Fix a call to timeout that wasn't properly saving it's callout handle.
Submitted by:	 durian@plutotech.com
1997-09-23 22:14:43 +00:00
Justin T. Gibbs
02a199102d aha1542.c aic6360.c cy.c fd.c ft.c
if_ie.c if_wl.c if_zp.c isa.c isa_device.h
labpc.c mcd.c ncr5380.c scd.c seagate.c si.c
sio.c tw.c ultra14f.c wcd.c wd.c:

	Update for changes in the callout interface.

apic_vector.s icu_vector.s ipl.s ipl_funcs.c:

	Add CAM software/hardware interrupt support.
1997-09-21 21:41:49 +00:00
Tor Egge
d66c374f58 Enable the FIFO on enhanced floppy controllers. This reduces the
number of dma overruns/underruns for systems under heavy dma load.
As a side effect, broken enhanced floppy controllers that sometimes
don't detect dma overruns/underruns will give less errors.

Reviewed by:	j@uriah.heep.sax.de (J Wunsch)
1997-09-17 20:16:17 +00:00
Joerg Wunsch
d2fb48929a Make FDC_DEBUG a supported option.
Hide the bogus FDC ``chip type'' display behind a (mostly) undocumented
option, since people started to trust the bogus claim.  Once we're going
to handle 2.88 MB controllers, we have to redo the chip detection, by
now just leave it hidden.
1997-09-16 07:45:45 +00:00
Bruce Evans
f71d35e402 Removed unused #includes. 1997-07-20 14:10:18 +00:00
Bruce Evans
fce002fdef Don't include <sys/ioctl.h> in the kernel. Stage 1: don't include
it when it is not used.  In most cases, the reasons for including it
went away when the special ioctl headers became self-sufficient.
1997-03-24 11:25:10 +00:00
Bruce Evans
3ac4d1ef0c Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.
Fixed everything that depended on getting fcntl.h stuff from the wrong
place.  Most things don't depend on file.h stuff at all.
1997-03-23 03:37:54 +00:00
Peter Wemm
6875d25465 Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.
1997-02-22 09:48:43 +00:00
John Dyson
996c772f58 This is the kernel Lite/2 commit. There are some requisite userland
changes, so don't expect to be able to run the kernel as-is (very well)
without the appropriate Lite/2 userland changes.

The system boots and can mount UFS filesystems.

Untested: ext2fs, msdosfs, NFS
Known problems: Incorrect Berkeley ID strings in some files.
		Mount_std mounts will not work until the getfsent
		library routine is changed.

Reviewed by:	various people
Submitted by:	Jeffery Hsu <hsu@freebsd.org>
1997-02-10 02:22:35 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Bruce Evans
d43190805d Disabled half-baked disk statistics support. It didn't actually generate
statistics, so it just wasted scarce disk table slots and screen space.
1996-12-18 17:44:31 +00:00
Joerg Wunsch
bb6382fae2 Fix the broken EOF handling in the floppy driver. The most obvious
appearance of this bug was the malfunctioning -M option in GNU tar (it
worked only by explicitly specifying -L).

Reviewed by:	bde, and partially corrected accoring to his comments

Candidate for 2.2, IMHO even for 2.1.6.
1996-11-02 23:31:11 +00:00
Poul-Henning Kamp
bfbb029d87 Remove devconf, it never grew up to be of any use. 1996-09-06 23:09:20 +00:00
Poul-Henning Kamp
cba8a5ddd3 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
Bruce Evans
cba2a7c614 Staticized a few variables.
Fixed warnings about unused variables.
1996-07-12 07:41:34 +00:00
Poul-Henning Kamp
14212c9d29 Typo. 1996-05-03 20:15:11 +00:00
Poul-Henning Kamp
17542807e5 Move from the old buf.b_actf to the new TAILQ(buf.b_act). 1996-05-03 14:57:27 +00:00
Sujal Patel
100f78bbe0 Update drivers to use isa_dma_acquire() and isa_dma_release()
Reviewed by:	bde
1996-04-08 19:40:57 +00:00
Bruce Evans
3157adc8af 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
Bruce Evans
2151975455 Fixed devfs device names and numbers.
Fixed handling of unknown CMOS types - don't attach unrecognized devices.
1996-04-07 14:46:42 +00:00
Marc G. Fournier
ecd87fe6c3 changed from using dev_link() to devfs_link() 1996-04-02 04:52:03 +00:00
Joerg Wunsch
0e317d05cc Fetch the (dummy) READY CHANGED condition interrupt stati that
happen after an FDC reset.

Submitted by:	bde
1996-03-31 18:04:51 +00:00
Bruce Evans
f85120ac5b Fixed group of some more disk devices.
Fixed devfs function names.
1996-03-29 11:45:12 +00:00
Marc G. Fournier
6e18ce4676 Switched from using devfs_add_sw() to using devfs_add_swf()
Reviewed by:	julian@freebsd.org
1996-03-28 14:29:52 +00:00
Bruce Evans
8335c1b8ae Don't turn off the motor on active drives. The motor timeout may
occur while a command is in progress if the system is overloaded
or was stopped at a debugger breakpoint.
1996-02-25 21:01:31 +00:00
Bruce Evans
c8f2fe8db8 First attempt at creating devfs entries for sliced devices. Doesn't
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.
1996-01-27 04:18:15 +00:00
Bruce Evans
dd87702a51 Allocate DMA bounce buffers only when requested by drivers. Only the
fd and wt drivers need bounce buffers, so this normally saves 32K-1K
of kernel memory.

Keep track of which DMA channels are busy.  isa_dmadone() must now be
called when DMA has finished or been aborted.

Panic for unallocated and too-small (required) bounce buffers.

fd.c:
There will be new warnings about isa_dmadone() not being called after
DMA has been aborted.

sound/dmabuf.c:
isa_dmadone() needs more parameters than are available, so temporarily
use a new interface isa_dmadone_nobounce() to avoid having to worry
about panics for fake parameters.  Untested.
1996-01-27 02:33:48 +00:00
Bruce Evans
f332b8a1d5 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
Poul-Henning Kamp
6f4e0beb7e Staticize and cleanup. 1995-12-10 13:40:44 +00:00
Julian Elischer
4d92e19833 clean a few DEVFS things..
fix a bug where you couldn't place devices in the root directory
of devfs

remove deprecated routines

On my machine devfs now shows:
julian@erf.tfs.com:
julian@erf.tfs.com: ls -RF
bpf0            mem             ptypb           spkr            ttyp8
bpf1            null            ptypc           stderr          ttyp9
bpf2            pcaudio         ptypd           stdin           ttypa
bpf3            pcaudioctl      ptype           stdout          ttypb
console         pt              ptypf           tty             ttypc
cuaa0           ptyp0           random          ttyd0           ttypd
cuaia0          ptyp1           rsd0            ttyid0          ttype
cuala0          ptyp2           rsd1            ttyld0          ttypf
fd/             ptyp3           rvn             ttyp0           tun0
fd0.1440        ptyp4           rworm           ttyp1           urandom
fd1.1200        ptyp5           scsi/           ttyp2           vn
io              ptyp6           sd0             ttyp3           zero
kmem            ptyp7           sd1             ttyp4
lkm             ptyp8           snp0            ttyp5
log             ptyp9           snp1            ttyp6
lpt0            ptypa           snp2            ttyp7

./fd:
0       15      21      28      34      40      47      53      6       9
1       16      22      29      35      41      48      54      60
10      17      23      3       36      42      49      55      61
11      18      24      30      37      43      5       56      62
12      19      25      31      38      44      50      57      63
13      2       26      32      39      45      51      58      7
14      20      27      33      4       46      52      59      8

./scsi:
sctarg  ssc
julian@erf.tfs.com:

which is all devices really there except for disk slices/partitions..
(if I don't have it it's not there, which has GOT to be an improvement..)

no DEVFS fixes from device maintainers yet?
1995-12-09 09:11:25 +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
Julian Elischer
7146c13e43 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
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
Bruce Evans
27513ca73b Fixed (nonexistent) initialization of bp->b_pblkno. disksort() for
floppies must have been random in 2.x since we reintroduced sorting
on b_pblkno on 1995/03/18.  Drivers still initialize b_cylin/b_resid
although this is no longer used.

Removed unused, wrong function fdsize().  (Returning 0 means that the
device exists and has size 0, not that the device doesn't exist.
swaponvp() allows for size 0 by stupidly calling the d_psize function
twice if the size isn't 0.  setdumpdev() doesn't allow for it.)

Continued removing /* ARGSUSED */ from drivers.
1995-11-18 07:48:11 +00:00
Bruce Evans
4ff3de8e80 Added `#include "ioconf.h"' to <machine/conf.h> and cleaned up the
misplaced extern declarations (mostly prototypes of interrupt handlers)
that this exposed.  The prototypes should be moved back to the driver
sources when the functions are staticalized.

Added idempotency guards to <machine/conf.h>.  "ioconf.h" can't be
included when building LKMs so define a wart in bsd.kmod.mk to help
guard against including it.
1995-11-04 17:08:13 +00:00