Commit Graph

34 Commits

Author SHA1 Message Date
Olivier Houchard
0f2f1f7124 Do not bzero() the softc, as newbus does it for us. 2004-07-09 16:56:46 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Guido van Rooij
a5c7e3bb70 Prevent the strange situation that after each load/unload of a ppbus
device, the device is probed multiple times (so each device is
detected N times after unloading/loading the module N-1 times).

The real fix is (quote Doug and Warner):
> : In an ideal world, there should be some kind of BUS_UNIDENTIFY method
> : which a driver could use to delete the devices it created in
> : BUS_IDENTIFY.
>
> Or the bus would have a driver deleted routine that got called and it
> would remove all instances of the devclass attached to it.

Reviewed by:	Doug Rabson & Warner Losh
2004-03-18 21:10:11 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
David E. O'Brien
aad970f1fe Use __FBSDID().
Also some minor style cleanups.
2003-08-24 17:55:58 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Dag-Erling Smørgrav
521f364b80 More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9). 2003-03-02 16:54:40 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
John Baldwin
9e14a48a03 - Make 'irq' intptr_t instead of uintptr_t so it handles a value of -1
properly.
- Add a cast to quiet a printf warning.
2002-11-07 17:20:58 +00:00
Bernd Walter
338cad62ab This makes ppbus childs like lpt and ppi succesfully connect to more
than just the first ppbus.
The child drivers always tried to attach unit 0.

Reviewed by:	gallatin
Approved by:	gallatin
2002-04-07 22:06:20 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Poul-Henning Kamp
f83880518b Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.
2001-03-26 12:41:29 +00:00
Poul-Henning Kamp
7891600907 Don't use a private malloc(9) type for something this M_DEVBUFish.
Noticed long time ago by:	bde
2000-12-07 22:33:12 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
David E. O'Brien
74cf6eb61b Rather than use a MD lpt.h, we now use the MI lptio.h. 2000-05-19 18:23:48 +00:00
Poul-Henning Kamp
5856c95848 Don't use getebuf() unless you really need a struct buf. Malloc will
do fine in this case.
2000-05-05 07:50:53 +00:00
Brian Feldman
3841bf81f7 I _HATE_ crashes. The lptread() call needs to check LP_BYPASS, because
if one tries to use read() on an LP_BYPASS'd dev_t, the softc will be
initialized mainly with NULLs, so...
2000-03-15 03:23:04 +00:00
Peter Wemm
84a5b01504 Fix two warnings. 2000-02-13 03:03:31 +00:00
Nicolas Souchu
249a96889e Fix system hang when printer locks on missing paper
(also called the "printer fiasco")

Approved by: jkh
2000-02-08 21:46:27 +00:00
Doug Rabson
150630c449 Make this lot build on alpha. 2000-01-25 22:23:48 +00:00
Peter Wemm
0f063508d7 Some newbus-inspired tidy-ups. Use device_identify() rather than scanning
the resource table to locate children.  The 'at ppbus?' can go again.
Remove a few #if Nxxx > 0' type things, config arranges this for us.
Move the newbus method glue next to the DRIVER_MODULE() stuff so we
don't need extra prototypes.
Don't set device descriptions until after the possibility of the probe
returning an error.
Remove all cdevsw_add() calls, all the drivers that did this also use
make_dev() correctly, so it's not required.
A couple of other minor nits.
2000-01-23 14:41:04 +00:00
Nicolas Souchu
0f210c922b Port of ppbus standalone framework to the newbus system.
Note1: the correct interrupt level is invoked correctly for each driver.
       For this purpose, drivers request the bus before being able to
       call BUS_SETUP_INTR and BUS_TEARDOWN_INTR call is forced by the ppbus
       core when drivers release it. Thus, when BUS_SETUP_INTR is called
       at ppbus driver level, ppbus checks that the caller owns the
       bus and stores the interrupt handler cookie (in order to unregister
       it later).

       Printing is impossible while plip link is up is still TRUE.
       vpo (ZIP driver) and lpt are make in such a way that
       using the ZIP and printing concurrently is permitted is also TRUE.

Note2: specific chipset detection is not done by default. PPC_PROBE_CHIPSET
       is now needed to force chipset detection. If set, the flags 0x40
       still avoid detection at boot.

Port of the pcf(4) driver to the newbus system (was previously directly
connected to the rootbus and attached by a bogus pcf_isa_probe function).
2000-01-14 00:18:06 +00:00
Peter Wemm
664a31e496 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 04:46:21 +00:00
Poul-Henning Kamp
d6a0e38a1b Remove five now unused fields from struct cdevsw. They should never
have been there in the first place.  A GENERIC kernel shrinks almost 1k.

Add a slightly different safetybelt under nostop for tty drivers.

Add some missing FreeBSD tags
1999-09-25 18:24:47 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Poul-Henning Kamp
9dcbe2404a Convert DEVFS hooks in (most) drivers to make_dev().
Diskslice/label code not yet handled.

Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers)

Add the correct hook for devfs to kern_conf.c

The net result of this excercise is that a lot less files depends on DEVFS,
and devtoname() gets more sensible output in many cases.

A few drivers had minor additional cleanups performed relating to cdevsw
registration.

A few drivers don't register a cdevsw{} anymore, but only use make_dev().
1999-08-23 20:59:21 +00:00
Peter Wemm
b42a56cd10 GC unused prototype 1999-06-03 22:03:35 +00:00
Poul-Henning Kamp
2447bec829 Simplify cdevsw registration.
The cdevsw_add() function now finds the major number(s) in the
struct cdevsw passed to it.  cdevsw_add_generic() is no longer
needed, cdevsw_add() does the same thing.

cdevsw_add() will print an message if the d_maj field looks bogus.

Remove nblkdev and nchrdev variables.  Most places they were used
bogusly.  Instead check a dev_t for validity by seeing if devsw()
or bdevsw() returns NULL.

Move bdevsw() and devsw() functions to kern/kern_conf.c

Bump __FreeBSD_version to 400006

This commit removes:
        72 bogus makedev() calls
        26 bogus SYSINIT functions

if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.

I4b and vinum not changed.  Patches emailed to authors.  LINT
probably broken until they catch up.
1999-05-31 11:29:30 +00:00
Poul-Henning Kamp
4e2f199e0c This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw".

        Initialize the d_maj and d_bmaj fields.

        The d_reset field was not removed, although it is never used.

I used a program to do most of this, so all the files now use the
same consistent format.  Please keep it that way.

Vinum and i4b not modified, patches emailed to respective authors.
1999-05-30 16:53:49 +00:00
Dmitrij Tejblum
604359cf9b s/static foo_devsw_installed = 0;/static int foo_devsw_installed;/.
(Edited automatically)
1999-04-28 10:54:24 +00:00
Nicolas Souchu
17b5923dbb Move away from lpt.h data structure definition that only lpt.c relies on.
Remove if_plip.c dependency to lpt.h.
1999-02-14 16:19:16 +00:00
Nicolas Souchu
fdf94d1afe Rename nlpt to lpt.
Remove from ppi.c the old depreciated module stuff.
Print info when if_plip can't use interrupts.
1999-02-14 12:00:00 +00:00