Commit Graph

33 Commits

Author SHA1 Message Date
phk
1dfc2c167f Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by:    FlexeLint warning #512
2002-09-28 17:15:38 +00:00
archie
7a233d4c9f Replace (ab)uses of "NULL" where "0" is really meant. 2002-08-22 21:24:01 +00:00
brian
602660491c Make delay iteration counts a function of hz as the delay period in each
loop is inversly proportional to hz.

This makes things more sane for configurations with hz != 100.

Cosmetic: Make the loops look similar to the loops in digi.c
2002-04-17 15:28:41 +00:00
brian
2761b16daf Make delay iteration counts a function of hz as the delay period in each
loop is inversly proportional to hz.

This makes things more sane for configurations with hz > 100.

Submitted by:	Peter Jeremy <peter.jeremy@alcatel.com.au>
2002-04-17 15:13:52 +00:00
brian
509170f4fd Yet another adjustment of digi_delay(). The delay is now consistent
irrespective of whether tsleep() or DELAY() is used.
2002-04-10 14:32:55 +00:00
brian
ee1c37fb35 Change more uses of tsleep() to digi_delay() and make the loop counts more
sane.
2002-04-10 12:03:36 +00:00
brian
ef68f6f3c9 Add a digi_delay() function and use it instead of tsleep() when polling
the card for command completion.

digi_delay() uses either tsleep() or DELAY() depending on the value of
``cold''.

Pointed in the right direction by: jhb
2002-04-10 03:13:28 +00:00
brian
38fc52afea Use the PCI port for pci cards, not just for PCIXR cards.
Add the card name to the error message for the first initialisation
failure, giving us more info about what was actually discovered.

This code has been tested by Robert Suetterlin <robert@mpe.mpg.de>
to work on a PCI Xem card.
2002-04-10 01:15:23 +00:00
brian
8ad55476a0 Change linker_reference_module() so that it's passed a struct
mod_depend * (which may be NULL).  The only consumer of this
function at the moment is digi_loadmoduledata(), and that passes
a NULL mod_depend *.

In linker_reference_module(), check to see if we've already got
the required module loaded.  If we have, bump the reference count
and return that, otherwise continue the module search as normal.
2002-04-10 01:13:57 +00:00
brian
bb6d0ad187 Add some missing MODULE_VERSIONs
Without these, the kern_linker interface doesn't record these pseudo-drivers,
making them unavailable via modlist_lookup2*().
2002-04-10 01:12:55 +00:00
jhb
dc2e474f79 Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@
2002-04-01 21:31:13 +00:00
jhb
6d47f88e6c Use suser() instead of checking cr_uid against 0 directly. 2002-03-26 18:01:38 +00:00
peter
8fc732f958 Fix warnings. The driver would be more useful with a DRIVER_MODULE()
entry so that it actually can do something.
2002-02-27 23:47:45 +00:00
bde
4323174252 #include "opt_compat.h" so that the support for old ioctls can actually
be compiled.  Old tty ioctls are still used (possibly ifdef'ed) in at
least the following programs in the src tree:
  atc des ee fontedit gdb gdbserver lock ntp perl5 tcsh telnet top vttest

rp.c:
Unremoved used variables so that the support for old ioctls actually
compiles.

Not tested at runtime by:	bde
2002-02-15 08:28:34 +00:00
msmith
7ff97afb06 Staticise the con_bios and digi_devclass variables, since they aren't needed
by anything else.
2002-01-08 10:24:34 +00:00
arr
34eecfd781 - Fix a bunch of malloc calls where the M_FLAG is incorrectly used; it
should be M_WAITOK.

Spotted by: des
2001-12-07 17:59:15 +00:00
phk
a027fe1776 devsw_add() and cdevsw_remove() are no longer needed. 2001-11-04 15:52:44 +00:00
brian
74ff6b8f7e Send a .4 second BREAK rather than a .25 second break so that
we're at least consistent with what tcsendbreak(3) is documented
to do.

MFC after: 2 weeks

Note, the MFC will be to sys/dev/dgb/dgm.c on the RELENG_4 branch
2001-09-23 20:03:40 +00:00
julian
5596676e6c 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
brian
f1ae94cd5c Allow individual ports to use alternate pin settings (swap dsr & cd)
via the new DIGIIO_SETALTPIN ioctl, and allow the port's ALTPIN setting
to be queried via DIGIIO_GETALTPIN.

The initial state and lock devices are normally used to set and/or
lock ALTPIN settings although the device itself may also be used.

ALTPIN settings are applied per-device and apply to both the callin
and callout device at the same time.
2001-06-20 14:52:08 +00:00
brian
9d7cdee0ca Use linker_reference_module() instead of hard-coding the digi_*
module path.
2001-06-18 15:10:20 +00:00
brian
9e23c5414a Credit John Prince and Eric Hernes for their work. 2001-06-18 15:02:33 +00:00
brian
7fdccd5e4c MALLOC -> malloc, FREE -> free 2001-05-22 18:10:57 +00:00
brian
71a548c10f #include <digi/*.h> -> #include <dev/digi/*.h>
Suggested by: bde
2001-05-19 17:06:48 +00:00
brian
197d190ffb Fairwell digiio.h (moved to src/sys/sys) 2001-05-19 09:40:10 +00:00
brian
ef009d9e42 digiio.h has moved to /usr/include/sys 2001-05-19 09:28:59 +00:00
brian
853c35eea7 digiModel_t -> enum digi_model
Remove a forgotton and unused structure.
2001-05-17 01:42:18 +00:00
brian
b824fbe47c Remove all the mutex stuff - suggested by jhb
Tidy up includes, credit Slawa Olhovchenkov, John Prince and Eric Hernes
for their efforts and add a couple of missing parenthesis around return
expressions.
2001-05-08 07:55:33 +00:00
brian
11b8508fbe sys/mutex.h requires sys/lock.h for LINT
Re-spotted by: phk
2001-05-07 23:52:08 +00:00
brian
b4e77391c3 Change COM_LOCK/COM_UNLOCK to a regular mutex - still conditional on
SMP being defined.
2001-05-07 11:13:11 +00:00
brian
a1f1a879b5 Make LINT compile again.
Spotted by:	phk
2001-05-06 21:03:37 +00:00
brian
db1670b796 Only define DEBUG if it's undefined. This should eventually go, but
can stay for now in case of problems.
2001-05-02 01:47:34 +00:00
brian
d56c2badd6 Add a ``digi'' driver.
This driver supports PCI Xr-based and ISA Xem Digiboard cards.
dgm will go away soon if there are no problems reported.  For now,
configuring dgm into your kernel warns that you should be using
digi.  This driver is probably close to supporting Xi, Xe and Xeve
cards, but I wouldn't expect them to work properly (hardware
donations welcome).

The digi_* pseudo-drivers are not drivers themselves but contain
the BIOS and FEP/OS binaries for various digiboard cards and are
auto-loaded and auto-unloaded by the digi driver at initialisation
time.  They *may* be configured into the kernel, but waste a lot
of space if they are.  They're intended to be left as modules.

The digictl program is (mainly) used to re-initialise cards that
have external port modules attached such as the PC/Xem.
2001-05-02 01:08:09 +00:00