Commit Graph

140 Commits

Author SHA1 Message Date
Peter Wemm
daefef7cae Fix warnings due to macro varargs. 2002-05-24 06:32:18 +00:00
Poul-Henning Kamp
7bf758bff0 Simplify the RFC2783 and PPS_SYNC timestamp collection API. 2002-04-26 20:24:28 +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
Nicolas Souchu
c17d43407f Major rework of the iicbus/smbus framework:
- VIA chipset SMBus controllers added
	- alpm driver updated
	- Support for dynamic modules added
	- bktr FreeBSD smbus updated but not tested
	- cleanup
2002-03-23 15:49:15 +00:00
Peter Wemm
0d87e7d007 Fix some gcc-3.1+ warnings:
warning: deprecated use of label at end of compound statement
umass.c:2626:46: multi-line string literals are deprecated
2002-03-19 23:20:21 +00:00
Warner Losh
d7e53105ec Make this driver a better citizen by moving dev creation and
other initialization into attach from probe.  Also hide a few
printfs behind a bootverbose.

approved in principle by: phk
2001-12-19 19:37:31 +00:00
David E. O'Brien
6e551fb628 Update to C99, s/__FUNCTION__/__func__/,
also don't use ANSI string concatenation.
2001-12-10 08:09:49 +00:00
Poul-Henning Kamp
bd61b8e81d Give the pps driver an additional 8 inputs if we can persuade the
ppc to go into EPP mode.  These 8 inputs are timestamped in polled
loop so their resolution will be nanoseconds but their granularity
will only be 1/hz.
2001-09-22 16:34:59 +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
Nicolas Souchu
334a17f09a Translate various ppbus sequences into microsequences to limit
overhead of abstraction layers.

Submitted by:	jcm@FreeBSD-uk.eu.org
2001-06-23 06:51:52 +00:00
Peter Wemm
1ae2c6005e -Wunused cleanup 2001-06-12 07:01:27 +00:00
Poul-Henning Kamp
77a7881dac Style fixes from Sascha
PR:		16551
Submitted by:	Sascha Schumann <sascha@schumann.cx>
2001-06-06 21:00:01 +00:00
Alfred Perlstein
8cf6ffcf6d make code use strxxx() calls
Glanced at by: imp
2001-04-01 07:36:28 +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
Nicolas Souchu
a138e28335 Discard extra status information if -1. This has been breaking the
PS/2 mode for ZIP+ drives for a long time. Thanks Jonathon.

Submitted by:	j mckitrick <jcm@FreeBSD-uk.eu.org>
2001-01-25 13:07:55 +00:00
Nicolas Souchu
adb50a3799 Cleanup and improve mode detection. Now, you should get what you actually
want according to the modes set with the ppc(4) flags. Especially, it
should fix some problems with mode detection of parallel chipsets
configured to EPP but which have timing troubles with the drives. In such
a case, the driver should now fall back to slower modes (PS2, NIBBLE).
2001-01-02 21:29:06 +00:00
David Malone
7cc0979fd6 Convert more malloc+bzero to malloc+M_ZERO.
Submitted by:	josh@zipperup.org
Submitted by:	Robert Drehmel <robd@gmx.net>
2000-12-08 21:51:06 +00:00
Poul-Henning Kamp
959b7375ed Staticize some malloc M_ instances. 2000-12-08 20:09:00 +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
Jonathan Lemon
df5e198723 Lock down the network interface queues. The queue mutex must be obtained
before adding/removing packets from the queue.  Also, the if_obytes and
if_omcasts fields should only be manipulated under protection of the mutex.

IF_ENQUEUE, IF_PREPEND, and IF_DEQUEUE perform all necessary locking on
the queue.  An IF_LOCK macro is provided, as well as the old (mutex-less)
versions of the macros in the form _IF_ENQUEUE, _IF_QFULL, for code which
needs them, but their use is discouraged.

Two new macros are introduced: IF_DRAIN() to drain a queue, and IF_HANDOFF,
which takes care of locking/enqueue, and also statistics updating/start
if necessary.
2000-11-25 07:35:38 +00:00
Poul-Henning Kamp
db7e3af111 Remove unneeded #include <machine/clock.h> 2000-10-15 14:19:01 +00:00
Doug Rabson
530f610f02 A quote from the ia64 compiler:
`char' is promoted to `int' when passed through `...'
	(so you should pass `int' not `char' to `va_arg')
2000-10-10 14:18:50 +00:00
Nick Hibma
ef36241a4a Remove an unused variable warning. 2000-07-18 20:16:36 +00:00
Nick Hibma
677cec5b04 Fix the detection of parallel port Zip drives.
Submitted by:	j mckitrick <jcm@freebsd-uk.eu.org>
Reviewed by:	nsouchu
2000-07-18 20:16:16 +00:00
Peter Wemm
52044d2673 Unused include: #include "pps.h" 2000-06-10 11:14:19 +00:00
David E. O'Brien
907774ca1a Match the include protection with the install location. 2000-05-20 05:45:04 +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
Nick Hibma
c47eb96cb5 If PERIPH_1284 is not defined, don't even bother calling the BUS_*_INTR
functions.

If it is defined, check whether bus_alloc_resource has succeeded. If it
hasn't, it is in polled mode. Mike Nowlin reports that this change makes
the geek port (whatever _that_ is :-) work again on his machine.

Submitted by:	Mike Nowlin <mike@argos.org>
2000-05-07 20:46:49 +00:00
Nick Hibma
0c42807c05 Confusing comment. 2000-05-05 14:10:25 +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
Poul-Henning Kamp
eb95c536ad Remove unneeded #include <sys/kernel.h> 2000-04-29 15:36:14 +00:00
Nick Hibma
7fe1aaca86 make the example compile again.
The makefile contains a reference to /sys/dev/ppbus. What really should
be done is copy the header files to /usr/include/sys/dev/ppbus.

PR:	            kern/16767
Submitted by:	   Jin Guojun (FTG staff) <jin@gracie.lbl.gov>
2000-04-27 21:08:24 +00:00
Poul-Henning Kamp
3389ae9350 Remove ~25 unneeded #include <sys/conf.h>
Remove ~60 unneeded #include <sys/malloc.h>
2000-04-19 14:58:28 +00:00
Poul-Henning Kamp
ed6aff7387 Remove unneeded <sys/buf.h> includes.
Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks
by 924 bytes.
2000-04-18 15:15:39 +00:00
Doug Rabson
f7b7769172 * Factor out the object system from new-bus so that it can be used by
non-device code.
* Re-implement the method dispatch to improve efficiency. The new system
  takes about 40ns for a method dispatch on a 300Mhz PII which is only
  10ns slower than a direct function call on the same hardware.

This changes the new-bus ABI slightly so make sure you re-compile any
driver modules which you use.
2000-04-08 14:17:18 +00:00
Jonathan Lemon
9c117130a5 If we can't allocate an IRQ resource, fail in the attach routine. 2000-04-07 00:09:24 +00:00
Nick Hibma
9011b59b70 Add automatic rescan on connect. This happens already if the drive is
connected during boot and the vpo module is in the kernel/loaded.

In the case where the module is loaded at some later stage with kldload,
the CAM bus is now rescanned as well.
2000-04-04 22:15:13 +00:00
Poul-Henning Kamp
91266b96c4 Isolate the Timecounter internals in their own two files.
Make the public interface more systematically named.

Remove the alternate method, it doesn't do any good, only ruins performance.

Add counters to profile the usage of the 8 access functions.

Apply the beer-ware to my code.

The weird +/- counts are caused by two repocopies behind the scenes:
	kern/kern_clock.c -> kern/kern_tc.c
	sys/time.h -> sys/timetc.h
(thanks peter!)
2000-03-20 14:09:06 +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
Sheldon Hearn
4ca7c740a6 Fix buffer overrun in pcfclock_read(). The submitter is the original
author of the affected code.

PR:		16552
Submitted by:	Sascha Schumann <sascha@schumann.cx>
Approved by:	jkh
2000-02-20 09:08:33 +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
Jordan K. Hubbard
6417807e8b Add parallel port clock driver.
Submitted by:	Sascha Schumann <sascha@schumann.cx>
2000-01-19 18:19:16 +00:00
Peter Wemm
99904c75f7 Make this compile - missing ")"; 2000-01-14 15:54:45 +00:00
Nicolas Souchu
bdcee5cff6 ppi needs to use a bus method to get this rather than peering inside the
1284 stuff.

Submitted by: Peter Wemm <peter@netplex.com.au>
2000-01-14 08:03:15 +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
Eivind Eklund
6852838006 Incorrect NULL -> 0 1999-12-20 17:50:24 +00:00