Home | History | Annotate | Download | only in dev
History log of /src/sys/arch/hp300/dev/dcm.c
RevisionDateAuthorComments
 1.94  16-Jan-2024  thorpej Several years ago, the interrupt priority levels for devices were "flattened"
such that IPL_BIO, IPL_NET, and IPL_TTY (logical interrupt priority levels)
became aliases of IPL_VM (the logical interrupt priority level above which
memory allocation is not allowed). Unfortuantely, this meant that any
use of these logical interrupt priority levels to differentiate between
different interrupt service routines at the same auto-vectored interrupt
level was pointless... "when everyone is special, no one is".

Before this flattening happened, these distinct logical interrupt priority
levels levels were dynamically mapped to physical auto-vectored interrupt
levels based on which types of devices registered themselves at which auto-
vectored level. Now, splbio(), splnet(), etc. are all equivalent to splvm(),
which effectively blocks all device interrupts.

Switch to using the ISRPRI_* values provided by the common m68k interrupt
dispatch code, which allows interrupt handlers for devices that are more
latency-sensitive to be sorted earlier in the list of handlers at a given
auto-vectored interrupt level, as was originally intended.
 1.93  08-Sep-2023  andvar hp300/dcm(4): set dsp value after sc is initialized.
fixes DCMSTATS enabled build for hp300.
 1.92  21-Apr-2023  tsutsui Remove ancient /* ARGSUSED */ lint comments.
 1.91  15-Jan-2023  tsutsui TAB/space cleanup.
 1.90  10-Apr-2022  andvar fix various typos in comments and output/log messages.
 1.89  29-Dec-2020  tsutsui Use C99 designated initializers for struct consdev.
 1.88  15-Nov-2014  christos branches: 1.88.4; 1.88.10; 1.88.32;
centralize the call unit / dialout macros
 1.87  25-Jul-2014  dholland Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.86  22-May-2014  dholland Use accessor functions for the tty's table of control characters.
(at least from outside the core tty sources)

Move some xon/xoff code from net/ppp_tty.c to kern/tty.c.
 1.85  24-Mar-2014  christos branches: 1.85.2;
- remove unused
- use cpu_{g,s}etmodel
 1.84  16-Mar-2014  dholland Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.83  24-Apr-2011  rmind branches: 1.83.4; 1.83.14; 1.83.18;
Rename ttymalloc() to tty_alloc(), and ttyfree() to tty_free() for
consistency. Remove some unnecessary malloc.h inclusions as well.
 1.82  08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.81  13-Jun-2008  cegger branches: 1.81.18; 1.81.24; 1.81.26;
use device_lookup_private to get softc
 1.80  28-Apr-2008  martin branches: 1.80.2; 1.80.4;
Remove clause 3 and 4 from TNF licenses
 1.79  29-Mar-2008  tsutsui branches: 1.79.2; 1.79.4;
Split device_t/softc, and misc cosmetic changes.
 1.78  19-Nov-2007  ad branches: 1.78.14;
- Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
 1.77  04-Mar-2007  christos branches: 1.77.2; 1.77.18; 1.77.20; 1.77.24; 1.77.26;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.76  01-Oct-2006  elad branches: 1.76.4;
Fix typos (tty -> tp), pointed out by Matt Fleming, thanks!
 1.75  30-Sep-2006  elad Implement the "device" scope.

It uses an authorization wrapper per device class on the system to
ensure type-safety.

For now, it supports only terminal (TTY) devices, and has two actions
for them: "open terminal" and "privileged set". Sample usage has been
added to i386 and hp300 code for reference.

Update documentation.
 1.74  09-Sep-2006  tsutsui branches: 1.74.2;
time.tv_sec -> time_second
 1.73  23-Jul-2006  ad branches: 1.73.4;
Use the LWP cached credentials where sane.
 1.72  21-Jul-2006  tsutsui Some KNF.
 1.71  14-May-2006  elad integrate kauth.
 1.70  29-Mar-2006  thorpej Use device_cfdata().
 1.69  28-Mar-2006  thorpej Use device_unit().
 1.68  11-Dec-2005  christos branches: 1.68.4; 1.68.6; 1.68.8; 1.68.10; 1.68.12;
merge ktrace-lwp.
 1.67  06-Sep-2005  kleink Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges. Noted by David Holland in PR kern/31126.
 1.66  14-Mar-2005  tsutsui branches: 1.66.4;
Include "ioconf.h" for struct cfdriver *_cd decls.
 1.65  28-Aug-2004  thorpej branches: 1.65.4; 1.65.6;
Use ANSI function decls, static, and const.
 1.64  25-Apr-2004  matt Constify the speedtab arrays
 1.63  17-Nov-2003  tsutsui TAB/space cleanup.
 1.62  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.61  29-Jun-2003  fvdl branches: 1.61.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.60  29-Jun-2003  thorpej Adapt to ktrace/lwp changes.
 1.59  24-May-2003  gmcgarry Clean-up the DIO bus. Includes two main changes:

1) Pass address and ipl locators at attachment;
2) Remove hack which made the internal HP-IB controller
look like a DIO device.

The hack to allow the nhpib driver to support internal and DIO
controllers appears to be a leftover from 4.3BD where it was not
possible to have a driver attach to different busses. NetBSD has
supported bus-dependent attachments for a long time.
 1.58  04-May-2003  gmcgarry Fix from Steve Peurifoy in PR#18849:

"Occasionally a blocking open of dcm port 0 will hang in ttyopen()
waiting for carrier detect to be asserted when it's already
present.

The problem is that dcmmint() will return before updating the
value of sc->sc_mcndlast if the device is not open. If carrier
detect drops after the device is closed, sc->sc_mcndlast will
no longer correctly represent the "previous" state of the
signals when the next transition of carrier detect occurs.
A subsequent blocking open will wait forever for an event
which has in fact taken place."
 1.57  06-Mar-2003  thorpej Update for consdev changes.
 1.56  23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.55  20-Oct-2002  gmcgarry Fix flow control in dcmmint() by checking termios control flags for
CCTS_OFLOW rather than tty t_flags. From Steve Peurifoy in PR-18735.
 1.54  02-Oct-2002  thorpej Use CFATTACH_DECL().
 1.53  27-Sep-2002  thorpej Declare all cfattach structures const.
 1.52  06-Sep-2002  gehenna Merge the gehenna-devsw branch into the trunk.

This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
by using this grammer.

- Added the new naming convention.
The name of the device switch must be <prefix>_[bc]devsw for auto-generation
of device switch tables.

- The backward compatibility of loading block/character device
switch by LKM framework is broken. This is necessary to convert
from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
the LKM framework will refer it to assign device major number dynamically.
 1.51  17-Mar-2002  atatat branches: 1.51.4;
Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.50  15-Mar-2002  gmcgarry Add RCSIDs.
 1.49  23-Feb-2002  gmcgarry Unnecessary to cast splx() to void.
 1.48  14-Dec-2001  gmcgarry Update hardware drivers with console attachments to the new console
attachment interface.
 1.47  30-May-2001  lukem branches: 1.47.2; 1.47.4; 1.47.8;
add missing #include "opt_kgdb.h"
 1.46  02-May-2001  scw Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
 1.45  02-Nov-2000  eeh branches: 1.45.2;
Adapt to the new line discipline scheme.
 1.44  28-Mar-1998  thorpej branches: 1.44.14;
Adjust for recent ttyopen() and dialout device changes.
 1.43  12-Jan-1998  thorpej Update for changes to config.
 1.42  04-Oct-1997  thorpej Copyright assigned to The NetBSD Foundation.
 1.41  05-May-1997  thorpej branches: 1.41.4;
Use dio_intr_establish().
 1.40  15-Apr-1997  scottr dcmreadbuf() should not return immediately if the tty hasn't been opened;
this fixes a kgdb goof. Found by inspection.
 1.39  14-Apr-1997  thorpej Update for interrupt function and header name changes.
 1.38  04-Apr-1997  scottr Changes to make a dcm-based console work properly:

- While servicing an rx, tx, or modem status interrupt: if we have a
NULL struct tty * or if the tty isn't open, just return.
- Skip the self test if we are the console; it manages to do funny
things to autoconfig messages. (XXX - this should be fixed)
 1.37  02-Apr-1997  scottr Fix printf() and other warnings when compiled with DEBUG defined.
 1.36  31-Mar-1997  scottr Add prototypes, and make this compile with -Wall. Remove register
modifier from all declarations.

Also, handle sc_flags better so that we don't lose track of the
DCM_ISCONSOLE bit.
 1.35  30-Jan-1997  thorpej - Garbage-collect the old-style configuration glue.
- Make sure we don't get interrupts in dcmselftest().
 1.34  17-Dec-1996  thorpej Snapshot of new config for NetBSD/hp300. This isn't quite finished yet.
We're about 75% there. SCSI and HP-IB are not yet supported in a new
config kernel; some autoconfiguration hackery has to be done there, yet.
These changes are enough to network boot a diskless kernel.

New config glue is enabled with the "NEWCONFIG" kernel option. If that
option is not present, an old config kernel will be built. Any kernel
configured with config(8) will automatically pick up the NEWCONFIG
option from std.hp300.
 1.33  09-Dec-1996  thorpej isrlink() now returns a cookie. We're not interested in the cookie, so
cast to (void).
 1.32  14-Oct-1996  thorpej Set the device class on non-dull devices. This is a transitional thing.
 1.31  13-Oct-1996  christos backout previous kprintf changes
 1.30  11-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.29  02-Sep-1996  mycroft tty stop functions really should return void, not int, and certainly not both.
 1.28  06-Jun-1996  thorpej Add calls to tty_attach() and tty_detach() where appropriate.
 1.27  17-May-1996  thorpej branches: 1.27.4;
Add 2 missing ";"s ... they weren't noticed before because of the
old implementation of DELAY().
 1.26  03-Mar-1996  thorpej Fix logic errors in new console probe code that caused framebuffers
outside of "internal i/o" space to not even have a chance at console-hood.
Fix tested by Thorsten Frueauf <frueauf@ira.uka.de>, and offered with
my sincerest apologies that the bug ever existed in the first place.
 1.25  26-Feb-1996  thorpej Avoid accidentally lowering a devices console priority.
 1.24  24-Feb-1996  thorpej Completely rework how the console is probed. Console probing no longer
requires pre-autoconfigured devices. Fix up some prototypes. Part of the
long journey towards new config. (GETTING THERE!)
 1.23  14-Feb-1996  thorpej All interrupt routines (except the HIL; don't ask) now take a pointer
to a softc, rather than a unit number. Add a "dq_softc" member
to struct devqueue; this is a temporary measure until the
dma/controller/device callback spaghetti is untangled.

YAY! No more need for dcafastservice!

HIL: squish instances of "(void) splhil()" and "(void) spl0();".
 1.22  31-Dec-1995  thorpej Re-work the serial console support a bit; it doesn't depend on statically
allocated softc's now.
 1.21  29-Dec-1995  thorpej Correct some comments about 8-port DCM boards. (Thanks, Mike, for
pointing out the True Nature of The Force...)
 1.20  02-Dec-1995  thorpej Use a "match/attach" rather than "init" scheme for probing devices.
This is a step towards getting the drivers ready for new config.

Clean up namespace, remove several instances of global arrays. Instead,
use a softc to carry state around. Where possible, pass a pointer to
the softc rather than a unit number.

Pointers to hardware and software constructs are now stored per port
in each instance of the softc (one softc per board) rather than indexed
by minor number.
 1.19  04-Oct-1995  thorpej Say what I really meant in a printf()...
 1.18  04-Oct-1995  thorpej Couple of changes:
* Implement TIOC{G,S}FLAGS; ttyflags works now.
* Reset the card on a "fresh open" as a sanity measure.
* Make dcmopen() and dcmclose() a little more like the
corresponding routines in the new dca.c
 1.17  19-Apr-1995  mycroft Kluge the *tty() routines until this port is converted to config.new.
 1.16  10-Apr-1995  mycroft Most of the console functions return void.
 1.15  26-Oct-1994  cgd new RCS ID format.
 1.14  23-May-1994  mycroft Merge with 4.4-Lite.
 1.13  10-Feb-1994  mycroft Add arg to ioctl functions. Clean up #includes.
 1.12  06-Feb-1994  mycroft Remove outdated console handling code.
 1.11  06-Feb-1994  mycroft Use common version of cons.c.
 1.10  30-Jan-1994  mycroft Remove bogus declaration.
 1.9  29-Aug-1993  deraadt tty XXstart() routines return void
 1.8  01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.7  12-Jul-1993  mycroft Change tty code to use clist interface, but with ring buffer implementation.
Also, fix a couple of bugs in tty.c and pccons.c, and some gross kluginess
in the hp300 stuff.
 1.6  07-Jul-1993  deraadt the "struct tty *cn_tty" field in cons.c wasn't being used by anything
 1.5  29-May-1993  cgd fix for t_raw, rather than t_rawq for the tsleeps...
 1.4  27-May-1993  deraadt Changes to hp300 code to support two things:
1. dynamic tty allocation
2. use ring buffers instead of clists
Of course, I can't test it :-)
 1.3  22-May-1993  cgd add include of select.h if necessary for protos, or delete if extraneous
 1.2  18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.1  13-May-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1  13-May-1993  cgd add hp300 kernel files. generic kernel files might need some help...
 1.27.4.1  06-Jun-1996  thorpej Update from trunk:

Add calls to tty_attach() and tty_detach() where appropriate.
 1.41.4.1  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.44.14.1  22-Nov-2000  bouyer Sync with HEAD.
 1.45.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.47.8.7  11-Nov-2002  nathanw Catch up to -current
 1.47.8.6  18-Oct-2002  nathanw Catch up to -current.
 1.47.8.5  17-Sep-2002  nathanw Catch up to -current.
 1.47.8.4  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.47.8.3  28-Feb-2002  nathanw Catch up to -current.
 1.47.8.2  08-Jan-2002  nathanw Catch up to -current.
 1.47.8.1  30-May-2001  nathanw file dcm.c was added on branch nathanw_sa on 2002-01-08 00:24:32 +0000
 1.47.4.2  13-Oct-2001  fvdl Revert the t_dev -> t_devvp change in struct tty. The way that tty
structs are currently used (especially by console ttys) aren't
ready for it, and this will require quite a few changes.
 1.47.4.1  10-Oct-2001  fvdl Convert all remaining devices.
 1.47.2.4  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.47.2.3  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.47.2.2  16-Mar-2002  jdolecek Catch up with -current.
 1.47.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.51.4.1  19-May-2002  gehenna Add device switch.
Replace the access to devsw table and the hard-coded majors with devsw API.
 1.61.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.61.2.6  01-Apr-2005  skrll Sync with HEAD.
 1.61.2.5  24-Jan-2005  skrll Adapt to branch.
 1.61.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.61.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.61.2.2  03-Sep-2004  skrll Sync with HEAD
 1.61.2.1  03-Aug-2004  skrll Sync with HEAD
 1.65.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.65.4.1  29-Apr-2005  kent sync with -current
 1.66.4.4  07-Dec-2007  yamt sync with head
 1.66.4.3  03-Sep-2007  yamt sync with head.
 1.66.4.2  30-Dec-2006  yamt sync with head.
 1.66.4.1  21-Jun-2006  yamt sync with head.
 1.68.12.2  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.68.12.1  31-Mar-2006  tron Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.
 1.68.10.4  13-May-2006  elad sprinkle some #include <sys/kauth.h> in files that use kauth kpi but
don't include it yet. hopefully this will prevent some fallout.
 1.68.10.3  19-Apr-2006  elad sync with head - hopefully this will work
 1.68.10.2  10-Mar-2006  elad generic_authorize() -> kauth_authorize_generic().
 1.68.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.

I expect *some* lossage here...
 1.68.8.4  14-Sep-2006  yamt sync with head.
 1.68.8.3  11-Aug-2006  yamt sync with head
 1.68.8.2  24-May-2006  yamt sync with head.
 1.68.8.1  01-Apr-2006  yamt sync with head.
 1.68.6.2  01-Jun-2006  kardel Sync with head.
 1.68.6.1  22-Apr-2006  simonb Sync with head.
 1.68.4.1  09-Sep-2006  rpaulo sync with head
 1.73.4.1  18-Nov-2006  ad Sync with head.
 1.74.2.1  22-Oct-2006  yamt sync with head
 1.76.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.77.26.1  08-Dec-2007  mjf Sync with HEAD.
 1.77.24.1  21-Nov-2007  bouyer Sync with HEAD
 1.77.20.1  09-Jan-2008  matt sync with HEAD
 1.77.18.1  21-Nov-2007  joerg Sync with HEAD.
 1.77.2.1  03-Dec-2007  ad Sync with HEAD.
 1.78.14.3  29-Jun-2008  mjf Sync with HEAD.
 1.78.14.2  02-Jun-2008  mjf Sync with HEAD.
 1.78.14.1  03-Apr-2008  mjf Sync with HEAD.
 1.79.4.2  04-May-2009  yamt sync with head.
 1.79.4.1  16-May-2008  yamt sync with head.
 1.79.2.2  17-Jun-2008  yamt sync with head.
 1.79.2.1  18-May-2008  yamt sync with head.
 1.80.4.1  18-Jun-2008  simonb Sync with head.
 1.80.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.81.26.1  17-Feb-2011  bouyer Sync with HEAD
 1.81.24.1  06-Jun-2011  jruoho Sync with HEAD.
 1.81.18.2  31-May-2011  rmind sync with head
 1.81.18.1  05-Mar-2011  rmind sync with head
 1.83.18.1  18-May-2014  rmind sync with head
 1.83.14.2  03-Dec-2017  jdolecek update from HEAD
 1.83.14.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.83.4.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.85.2.1  10-Aug-2014  tls Rebase.
 1.88.32.1  03-Jan-2021  thorpej Sync w/ HEAD.
 1.88.10.1  27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.88.4.1  20-Jul-2016  pgoyette Adapt the machine/arch dependent code to the new {b,c}devsw reference
counting.

XXX Most of these will require testing by someone other than myself, as
I have a limited selection of hardware!

RSS XML Feed