History log of /freebsd-9.3-release/sys/dev/ppbus/ppbconf.h
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 188093 03-Feb-2009 jhb

Trim what we expose to userland in <dev/ppbus/ppbconf.h> to just the
constants used for the ppi(4) ioctls for bits in the control and status
registers.

Reviewed by: db


# 187576 21-Jan-2009 jhb

Add locking to ppc and ppbus and mark the whole lot MPSAFE:
- 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 :-(


# 185003 16-Nov-2008 jhb

Various whitespace and style fixes.


# 184130 21-Oct-2008 jhb

Several cleanups to remove the need for explicit unit numbers and a few
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@


# 183053 15-Sep-2008 jhb

Rework the handling of interrupt handlers for children of ppc and ppbus:
- Retire IVARs for passing IRQs around. Instead, ppbus and ppc now allow
child devices to access the interrupt by via a rid 0 IRQ resource
using bus_alloc_resource_any().
- ppc creates its own interrupt event to manage the interrupt handlers of
child devices. ppc does not allow child devices to use filters. It
could allow this if needed, but none of the current drivers use them
and it adds a good bit of complication. It uses
intr_event_execute_handlers() to fire the child device interrupt handlers
from its threaded interrupt handler.
- Remove the ppbus_dummy_intr() hack. Now the ppc device always has an
interrupt handler registered and we no longer bounce all the way up to
nexus to manage adding/removing ppbus child interrupt handlers. Instead,
the child handlers are added and removed to the private interrupt event
in the ppc device.


# 175222 10-Jan-2008 jhb

Work around problems with the ppbus(4)'s interesting way of managing
interrupt handlers for child devices by adding a dummy handler that is
always present so that the underlying interrupt thread is always around
avoiding panics from stray interrupts.

MFC after: 3 days


# 118607 07-Aug-2003 jhb

Consistently use the BSD u_int and u_short instead of the SYSV uint and
ushort. In most of these files, there was a mixture of both styles and
this change just makes them self-consistent.

Requested by: bde (kern_ktrace.c)


# 59712 27-Apr-2000 n_hibma

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>


# 55939 13-Jan-2000 nsouch

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).


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 49549 08-Aug-1999 phk

Passing the unit number to an interrupt routing is kind of narrowminded,
add a way to get the entire struct ppb_device back.


# 45342 05-Apr-1999 peter

Make ppbus compile under egcs. I'm not sure about this casting-to-union-
-containing-the-type stuff, but gcc seemed to do it implicitly..


# 43433 30-Jan-1999 nsouch

Distinguish EPP address/data register. Add EPP address register access to ppi.

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>


# 43293 27-Jan-1999 dillon

Fix PPBPRI #define - it was missing parenthesis which messed up a
call to tsleep() in dev/ppbus/ppbconf.c. Also fixup initializers.


# 42482 10-Jan-1999 nsouch

Fix broken low level ppb_rxxx() return type: char becomes u_char.

Submitted by: Bruce Evans <bde@zeta.org.au>

Some ppb bootup printfs simplified.


# 42475 10-Jan-1999 nsouch

Major ppbus commit with:

+ 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.


# 39520 20-Sep-1998 nsouch

- port of vpo code to CAM

- 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


# 39134 13-Sep-1998 nsouch

ppbus enhanced to support ZIP+ : 1284 code added, microseq improved +
some bugs corrected in vpoio.


# 38061 03-Aug-1998 msmith

Major ppbus updates from the author.

- ppbus now supports PLIP via the if_plip driver
- ieee1284 infrastructure added, including parallel-port PnP
- port microsequencer added, for scripting the sort of port I/O
that is common with parallel devices without endless calls up and down
through the driver structure.
- improved bus ownership behaviour among the ppbus-using drivers.
- improved I/O chipset feature detection

The vpo driver is now implemented using the microsequencer, leading to
some performance improvements as well as providing an extensive example
of its use.

Reviewed by: msmith
Submitted by: Nicolas Souchu <Nicolas.Souchu@prism.uvsq.fr>


# 36739 07-Jun-1998 phk

This is a prototype implementation of the draft-mogul-pps-api-##.txt
paper.

It will be updated along with the draft and possible subsequent
standard.

The ppbus based pps driver is updated to implement this API.


# 29020 01-Sep-1997 bde

Oops, the previous change applied a reversed patch.


# 28980 31-Aug-1997 bde

Removed unused #includes. The !KERNEL case may be more broken than before.


# 28978 31-Aug-1997 bde

Added #include of <sys/queue.h> to make this self-sufficient.
Includers of this file apparently didn't know that <sys/queue.h>
was a prerequisite and include a semi-random collection headers
until one happened to include it.


# 28257 16-Aug-1997 msmith

Sync with ppbus-970815 from the author :
- interrupt-driven printing now works (nlpt)
- Rearrangement of bus-related functions into ppb_base/ppbconf
- Addition of ieee1284 interface functions, preliminary parallel-port
PnP support

Submitted by: Nicolas Souchu <Nicolas.Souchu@prism.uvsq.fr>


# 28219 14-Aug-1997 msmith

New directory and drivers for Parallel Port Bus devices.
Submitted by: Nicolas Souchu <Nicolas.Souchu@prism.uvsq.fr>