Home | History | Annotate | Download | only in isa
History log of /src/sys/dev/isa/com_isa.c
RevisionDateAuthorComments
 1.41  08-Dec-2018  thorpej Clean up initialization of com_regs structure, in preparation for
some additional changers.
 1.40  18-Oct-2016  jdolecek branches: 1.40.14; 1.40.16;
provide intr xname
 1.39  24-Feb-2010  dyoung branches: 1.39.20; 1.39.38; 1.39.42;
A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.
 1.38  08-Jan-2010  dyoung branches: 1.38.2;
Expand PMF_FN_* macros.
 1.37  23-Nov-2009  rmind Remove some unecessary includes sys/user.h header.
 1.36  12-Nov-2009  dyoung Call the common detach routine, com_detach(), and get out on error,
before starting the bus-specific detachment.

com_activate() is going away, so don't use it any more.
 1.35  02-Apr-2009  dyoung During shutdown, detach devices in an orderly fashion.

Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.

Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks. For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.

Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown. Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags. Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).

Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.

Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag. The default for kern.detachall is 0. SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.

This is a work in progress. In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.

Also commit some changes that are not easily untangled from the rest:

(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.

(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs. Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.
 1.34  28-Apr-2008  martin branches: 1.34.8; 1.34.14;
Remove clause 3 and 4 from TNF licenses
 1.33  14-Mar-2008  cube branches: 1.33.2; 1.33.4;
Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend). Use proper types and ansify where appropriate.
 1.32  29-Feb-2008  dyoung Use pmf_device_register1() instead of shutdownhook_establish() to
register com_cleanup() as the shutdown hook.

Add a generic suspend routine. Suspend and resume com@isa.

Protect against dereferencing a NULL softc in comioctl().

Destroy both a mutex and a callout in com_detach().

Cosmetic: use aprint_*_dev(). Use PMF_FN_ARGS, PMF_FN_PROTO.
 1.31  28-Feb-2008  dyoung Use device_t and accessors.
 1.30  14-Dec-2007  dyoung branches: 1.30.2; 1.30.6;
Add a resume handler for com@isa, using Jared McNeill's suggested
code from current-users. com@acpi, et cetera, remain to be done.
 1.29  19-Oct-2007  ad branches: 1.29.4; 1.29.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.28  10-Jan-2007  cube branches: 1.28.6; 1.28.18; 1.28.20; 1.28.24;
Make COM_HAYESP compile again. It assumes no register mapping is needed.
 1.27  16-Nov-2006  christos __unused removal on arguments; approved by core.
 1.26  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.25  13-Jul-2006  gdamore branches: 1.25.4; 1.25.6;
Add an option COM_REGMAP to allow com(4) to use an array of register indices.
This allows us to convert aucom to just another com attachment, and cleanup
some code in the com_arbus.c.

Additionally, we use a common com_cleanup routine rather than having a
zillion copies of it in the attachment points.

This has been tested on a number architectures, and it has been shown to get
close to comparable performance when COM_REGMAP is defined, and comparable
when it is not defined.

Approved by core@. Fixes PR port-evbmips/32362.
 1.24  11-Dec-2005  christos branches: 1.24.4; 1.24.8; 1.24.16;
merge ktrace-lwp.
 1.23  04-Feb-2005  perry branches: 1.23.6;
de-__P
 1.22  14-Sep-2004  drochner branches: 1.22.4; 1.22.6;
Separate the namespace for default (ie unspecified) locators used
by the isa.c bus driver and the "address/whatever not specified"
argument passed to leaf device drivers.
The former is "ISACF_XXX_DEFAULT" as generaterd by config(8), the latter
"ISA_UNKNOWN_XXX", defined in isavar.h.
This way we save a dependency of every ISA device driver on "locators.h".
 1.21  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.20  02-Oct-2002  thorpej branches: 1.20.6;
Fix sizeof and whitespace bug from the script I'm using to do the
CFATTACH_DECL conversion. (Grumble.)
 1.19  02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.18  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.17  07-Jan-2002  thorpej branches: 1.17.6;
Overhaul of the ISA autoconfiguration code to support direct
configuration of devices logically attached to the ISA bus:

* Change the isa_attach_args to have arrays of io, mem, irq, drq
resources.
* Add a "pnpnames" and a linked list of "pnpcompatnames" to the
isa_attach_args. If either of these members are non-NULL,
direct configuration of the bus is being performed. Add an
ISA_DIRECT_CONFIG() macro to test for this.
* Drivers are not allowed to modify the isa_attach_args unless
direct configuration is not being performed and the probe fucntion
is returning success.
* Adapt device drivers -- currently, all driver probe routines return
"no match" if ISA_DIRECT_CONFIG() evaluates to true.
 1.16  15-Nov-2001  lukem don't need <sys/types.h> when including <sys/param.h>
 1.15  13-Nov-2001  lukem add RCSID
 1.14  29-Mar-2000  simonb branches: 1.14.6; 1.14.8;
Don't need to include <sys/conf.h> here.
 1.13  16-Sep-1998  is branches: 1.13.12;
Garbage collect unused 3rd parameter to comprobe1().
 1.12  15-Aug-1998  mycroft Assign my copyrights to TNF.
 1.11  09-Jun-1998  thorpej Nuke __BROKEN_INDIRECT_CONFIG.
 1.10  20-Oct-1997  thorpej Don't panic if we fail to remap i/o or mem space in the attach function.
Instead, print a diagnostic and return. (Some drivers do this already.)

Also, normalize the diagnostic message, and fix some places where the
printfs were getting ugly.
 1.9  19-Oct-1997  thorpej Make sure the i/o and/or mem addresses aren't wildcarded (i.e. -1) before
using the address in a bus_space_map() call.
 1.8  16-Oct-1997  thorpej Adjust for the new "com" driver home.
 1.7  15-Oct-1997  thorpej Pulldown from marc-pcmcia branch.
 1.6  16-Sep-1997  is Support for the upcoming NetBSD/Amiga Hypercom driver family:
* support chip clocks != COM_FREQ, by introducing sc_frequency (for the
mainline code) and adding a frequency parameter right after the rate
parameter to comcnattach() and com_kgdb_attach().
- Make com_isa and com_multi initialize sc_frequency to COM_FREQ.
- Make i386/machdep.c and alpha/dec_xxx.c call com*attach() with the freq.
parameter.
* supio_attach_args get two more fields: a sc_ipl and a sc_arg, both ints.
- com_supio uses the first for interupt establishment (all childs will, as
soon as they exist) and the 2nd for sc_frequency.
- drsupio passes sc_ipl alway as 5, and for the "com"s, sc_arg as 16*115200
- hyper will pass sc_ipl as 6, and sc_arg as 16 * 460800
 1.5  23-Aug-1997  drochner Use the new com_is_console() to decide if the port is already initialized.
 1.4  16-Aug-1997  drochner Bring back the "comconsattached" flag. It is necessary for starred
com devices (on non "__BROKEN_INDIRECT_CONFIG" ISA).
 1.3  12-Aug-1997  drochner KGDB improvements:
-Separate KGDB port initialization and softc related stuff to allow
KGDB to be attached in early system startup, before autoconfiguration.
-Export the variables needed by md code to hand-craft bus tag/handle.
-Fix initialization to enable interrupt by line break.
-Call DDB/KGDB at line break (move DDB call from the softirq handler
to the hard handler because it should work without a tty attached too).
 1.2  24-May-1997  thorpej branches: 1.2.4;
Where _is_ that brick when you need it?!
 1.1  04-Apr-1997  mycroft New version of com driver. Uses a different queueing mechanism and a split
hardware/software interrupt mechanism for improved performance. Many odd
protocols bugs also fixed.
 1.2.4.5  16-Oct-1997  thorpej Sync w/ trunk.
 1.2.4.4  15-Oct-1997  thorpej Move a few bus-specific things into bus-specific softc structures and
nesting a com_softc within them.
 1.2.4.3  22-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.4.2  27-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.2.4.1  23-Aug-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.12.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.14.8.2  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.14.8.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.14.6.5  18-Oct-2002  nathanw Catch up to -current.
 1.14.6.4  28-Feb-2002  nathanw Catch up to -current.
 1.14.6.3  11-Jan-2002  nathanw More catchup.
 1.14.6.2  08-Jan-2002  nathanw Catch up to -current.
 1.14.6.1  14-Nov-2001  nathanw Catch up to -current.
 1.17.6.1  06-Apr-2002  eeh Attach through devprops instead of aux.
 1.20.6.4  04-Feb-2005  skrll Sync with HEAD.
 1.20.6.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.20.6.2  18-Sep-2004  skrll Sync with HEAD.
 1.20.6.1  03-Aug-2004  skrll Sync with HEAD
 1.22.6.1  12-Feb-2005  yamt sync with head.
 1.22.4.1  29-Apr-2005  kent sync with -current
 1.23.6.5  17-Mar-2008  yamt sync with head.
 1.23.6.4  21-Jan-2008  yamt sync with head
 1.23.6.3  27-Oct-2007  yamt sync with head.
 1.23.6.2  26-Feb-2007  yamt sync with head.
 1.23.6.1  30-Dec-2006  yamt sync with head.
 1.24.16.4  17-Jun-2006  gdamore Undo the undo. Restore COM_INIT_REGS.
 1.24.16.3  17-Jun-2006  gdamore Back out COM_INIT_REGS.
 1.24.16.2  16-Jun-2006  gdamore Adapt to KNF. Note tested yet.
 1.24.16.1  15-Jun-2006  gdamore Adapt to new com framework.
 1.24.8.1  11-Aug-2006  yamt sync with head
 1.24.4.1  09-Sep-2006  rpaulo sync with head
 1.25.6.2  10-Dec-2006  yamt sync with head.
 1.25.6.1  22-Oct-2006  yamt sync with head
 1.25.4.2  12-Jan-2007  ad Sync with head.
 1.25.4.1  18-Nov-2006  ad Sync with head.
 1.28.24.1  25-Oct-2007  bouyer Sync with HEAD.
 1.28.20.3  23-Mar-2008  matt sync with HEAD
 1.28.20.2  09-Jan-2008  matt sync with HEAD
 1.28.20.1  06-Nov-2007  matt sync with HEAD
 1.28.18.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.28.6.1  23-Oct-2007  ad Sync with head.
 1.29.8.1  02-Jan-2008  bouyer Sync with HEAD
 1.29.4.1  26-Dec-2007  ad Sync with head.
 1.30.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.30.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.30.2.1  24-Mar-2008  keiichi sync with head.
 1.33.4.3  11-Mar-2010  yamt sync with head
 1.33.4.2  04-May-2009  yamt sync with head.
 1.33.4.1  16-May-2008  yamt sync with head.
 1.33.2.1  18-May-2008  yamt sync with head.
 1.34.14.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.34.8.1  28-Apr-2009  skrll Sync with HEAD.
 1.38.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.39.42.1  04-Nov-2016  pgoyette Sync with HEAD
 1.39.38.1  05-Dec-2016  skrll Sync with HEAD
 1.39.20.1  03-Dec-2017  jdolecek update from HEAD
 1.40.16.1  10-Jun-2019  christos Sync with HEAD
 1.40.14.1  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts

RSS XML Feed