summaryrefslogtreecommitdiffstats
path: root/sys/dev/ppbus/immio.c
Commit message (Collapse)AuthorAgeFilesLines
* Add locking to ppc and ppbus and mark the whole lot MPSAFE:jhb2009-01-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - To avoid having a bunch of locks that end up always getting acquired as a group, give each ppc(4) device a mutex which it shares with all the child devices including ppbus(4), lpt(4), plip(4), etc. This mutex is then used for all the locking. - Rework the interrupt handling stuff yet again. Now ppbus drivers setup their interrupt handler during attach and tear it down during detach like most other drivers. ppbus(4) only invokes the interrupt handler of the device that currently owns the bus (if any) when an interrupt occurs, however. Also, interrupt handlers in general now accept their softc pointers as their argument rather than the device_t. Another feature of the ppbus interrupt handlers is that they are called with the parent ppc device's lock already held. This minimizes the number of lock operations during an interrupt. - Mark plip(4), lpt(4), pcfclock(4), ppi(4), vpo(4) MPSAFE. - lpbb(4) uses the ppc lock instead of Giant. - Other plip(4) changes: - Add a mutex to protect the global tables in plip(4) and free them on module unload. - Add a detach routine. - Split out the init/stop code from the ioctl routine into separate functions. - Other lpt(4) changes: - Use device_printf(). - Use a dedicated callout for the lptout timer. - Allocate the I/O buffers at attach and detach rather than during open and close as this simplifies the locking at the cost of 1024+32 bytes when the driver is attached. - Other ppi(4) changes: - Use an sx lock to serialize open and close. - Remove unused HADBUS flag. - Add a detach routine. - Use a malloc'd buffer for each read and write to avoid races with concurrent read/write. - Other pps(4) changes: - Use a callout rather than a callout handle with timeout(). - Conform to the new ppbus requirements (regular mutex, non-filter interrupt handler). pps(4) is probably going to have to become a standalone driver that doesn't use ppbus(4) to satisfy it's requirements for low latency as a result. - Use an sx lock to serialize open and close. - Other vpo(4) changes: - Use the parent ppc device's lock to create the CAM sim instead of Giant. - Other ppc(4) changes: - Fix ppc_isa's detach method to detach instead of calling attach. Tested by: no one :-(
* Various whitespace and style fixes.jhb2008-11-161-18/+23
|
* Several cleanups to remove the need for explicit unit numbers and a fewjhb2008-10-211-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | other fixes: - Add pointers back to device_t objects in softc structures instead of storing the unit and using devclass_get_device(). - Add 'lpbb', 'pcf', 'pps', and 'vpo' child devices to every 'ppbus' device instead of just the first one. - Store softc pointers in si_drv1 of character devices instead of pulling the unit number from the minor number and using devclass_get_softc() and devclass_get_device(). - Store the LP_BYPASS flag in si_drv2 instead of encoding it in the minor number. - Destroy character devices for lpt(4) when detaching the device. - Use bus_print_child_footer() instead of duplicating it in ppbus_print_child() and fix ppbus_print_child()'s return value. - Remove unused AVM ivar from ppbus. - Don't store the 'mode' ivar in the ppbus ivars since we always fetch it from the parent anyway. - Try to detach all the child devices before deleting them in ppbus_detach(). - Use pause() instead of a tsleep() on a dummy address when polling the ppbus. - Use if_printf() and device_printf() instead of explicit names with unit numbers. Silence on: current@
* bandaid assumption that char is signedsam2005-12-211-1/+1
| | | | MFC after: 1 week
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* Translate various ppbus sequences into microsequences to limitnsouch2001-06-231-66/+74
| | | | | | overhead of abstraction layers. Submitted by: jcm@FreeBSD-uk.eu.org
* Discard extra status information if -1. This has been breaking thensouch2001-01-251-0/+5
| | | | | | PS/2 mode for ZIP+ drives for a long time. Thanks Jonathon. Submitted by: j mckitrick <jcm@FreeBSD-uk.eu.org>
* Cleanup and improve mode detection. Now, you should get what you actuallynsouch2001-01-021-61/+41
| | | | | | | 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).
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Remove unneeded #include <sys/kernel.h>phk2000-04-291-1/+0
|
* Remove unneeded <sys/buf.h> includes.phk2000-04-181-1/+0
| | | | | Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks by 924 bytes.
* Port of ppbus standalone framework to the newbus system.nsouch2000-01-141-69/+77
| | | | | | | | | | | | | | | | | | | | | 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).
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-4/+4
| | | | | | 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.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Make ppbus compile under egcs. I'm not sure about this casting-to-union-peter1999-04-051-3/+5
| | | | -containing-the-type stuff, but gcc seemed to do it implicitly..
* Distinguish EPP address/data register. Add EPP address register access to ppi.nsouch1999-01-301-12/+12
| | | | | | | | Change microseq offsets. Previously, offsets of the program counter where added to the index of the current microinstruction. Make them rely on the index of the next executed microinstruction. Suggested by: Luigi Rizzo <luigi@labinfo.iet.unipi.it>
* Major ppbus commit with:nsouch1999-01-101-1/+3
| | | | | | | | | | | | | | | | | | | + ECP parallel port chipset FIFO detection + DMA+FIFO parallel I/O handled as chipset specific + nlpt updated in order to use the above enhanced parallel I/O. Use 'lptcontrol -e' to use enhanced I/O + Various options documented in LINT + Full IEEE1284 NIBBLE and BYTE modes support. See ppbus(4) for an overview of the IEEE1284 standard + Detection of PnP parallel devices at boot + Read capability added to nlpt driver to get IEEE1284 compliant printer status with a simple 'cat /dev/lpt0' + IEEE1284 peripheral emulation added to BYTE mode. Two computers may dialog according to IEEE1284 signaling method. See PERIPH_1284 option and /sys/dev/ppbus/ppi.c All this code is supposed to provide basic functions for IEEE1284 programming. ppi.c and nlpt.c may act as examples.
* lpbb is the official Philips parallel I2C interface. lpbb.c contains onlynsouch1998-10-311-7/+15
| | | | | | basic i/o functions, bit-banging mechanism is implemented by dev/iicbus/iicbb.c immio.c: some bootverbose logs to watch zip+ connect/disconnect process
* abort imm init if can't disconnect from drivensouch1998-10-021-1/+2
|
* - port of vpo code to CAMnsouch1998-09-201-28/+50
| | | | | | | | - ppbus was released before checking if still in disk_mode by vpoio and immio: the microseq (in_disk_mode) was never executed. Fixed. - nlptintr() renamed to nlpt_intr(). spltty() inserted in nlptintr() before nlpt_intr() call
* Lowlevel i/o routines for ZIP+ support. Mostly written with microseqnsouch1998-09-131-0/+771
mechanism
OpenPOWER on IntegriCloud