Commit Graph

436 Commits

Author SHA1 Message Date
Poul-Henning Kamp
1930e303cf Deorbit COMPAT_SUNOS.
We inherited this from the sparc32 port of BSD4.4-Lite1.  We have neither
a sparc32 port nor a SunOS4.x compatibility desire these days.
2004-06-11 11:16:26 +00:00
Poul-Henning Kamp
13e84a71e0 Centralize the line discipline optimization determination in a function
called ttyldoptim().

Use this function from all the relevant drivers.

I belive no drivers finger linesw[] directly anymore, paving the way for
locking and refcounting.
2004-06-04 21:55:55 +00:00
Poul-Henning Kamp
fe3ec6224a Manual edits to change linesw[]-frobbing to ttyld_*() calls. 2004-06-04 20:04:52 +00:00
Poul-Henning Kamp
2140d01b27 Machine generated patch which changes linedisc calls from accessing
linesw[] directly to using the ttyld...() functions

The ttyld...() functions ar inline so there is no performance hit.
2004-06-04 16:02:56 +00:00
Poul-Henning Kamp
e451f9b758 Make the remaining serial drivers call ttyioctl() rather than calling
the linedisc directly.
2004-06-04 08:02:37 +00:00
Poul-Henning Kamp
be9bd88238 There is no need to explicitly call the stop function. In all likelyhood
->l_close() did it and ttyclose certainly will.
2004-06-01 11:57:15 +00:00
Poul-Henning Kamp
a1cda79464 There is no need to explicitly call ttwakeup() and ttwwakeup() after
ttyclose() has been called.  It's already been done once by ttyclose,
and probably once by the line-discipline too.
2004-06-01 11:38:06 +00:00
Poul-Henning Kamp
bda4474a59 ttyclose() increments t_gen. Remove redundant increments in drivers. 2004-06-01 10:15:56 +00:00
Doug Ambrisko
a00d3e6140 Remove new options and my prevention of system freeze when the sio probe
returns okay when HW probe fails.  This happens when comconsole flag is
set but VGA console is used instead.

Back out requested by:  bde (He will be looking at other solutions from scratch)
2004-05-03 22:35:28 +00:00
Doug Ambrisko
33c5911242 Some enhancements and bug fix.
-  Define option FORCECONSPEED to force the serial console to
        be CONSPEED.  I've run into a lot of boards in which
        the detect for prior speed doesn't work and ends up with
        broken console since it is at the wrong speed.
     -  If a serial port is marked as a console, but console=vidconsole
        and if the serial ports doesn't exist it will be probed and
        attached at a 8250 chip.  Then writes to that will freeze the
        system.
     -  Add an option flags 0x400000 to mark this as a potential
        comconsole in-case the one flaged with 0x10 does not exist
        in the system.

This makes it easier to deploy on systems with one or two serial ports.

Obtained from:	IronPort
2004-04-30 21:16:52 +00:00
Warner Losh
d8af98c29e Back out last bad commit (again!) 2004-04-07 21:56:20 +00:00
Warner Losh
f36cfd49ad Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson
2004-04-07 20:46:16 +00:00
Warner Losh
9394a7383e Last change was a bogus 2004-04-07 05:30:54 +00:00
Warner Losh
2fcbca0d85 Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson
2004-04-07 05:00:01 +00:00
Nate Lawson
1040ccf4a9 Back out code for auto-gdb detection that accidentally leaked into the
bus_alloc_resource_any commit.

Submitted by:	bde
Pointy-hat:	njl
2004-03-18 02:36:41 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
8e1f1df080 Device megapatch 3/6:
Add missing D_TTY flags to various drivers.

Complete asserts that dev_t's passed to ttyread(), ttywrite(),
ttypoll() and ttykqwrite() have (d_flags & D_TTY) and a struct tty
pointer.

Make ttyread(), ttywrite(), ttypoll() and ttykqwrite() the default
cdevsw methods for D_TTY drivers and remove the explicit initializations
in various drivers cdevsw structures.
2004-02-21 20:41:11 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
Ruslan Ermilov
b659f64e82 Fixed a memory leak.
Submitted by:	Stanford Metacompilation research group
2004-01-18 12:26:33 +00:00
Bruce Evans
ab99f13b16 Fixed breakage of a check for boolean true by misusing NULL in rev.1.407.
This became fatal when the type of NULL was changed recently.
2003-12-24 04:11:10 +00:00
Bruce Evans
c0952034c3 Tweaked the siointr1() so that it works better at 921600 bps, especially
with multiple ports on a shared interrupt demultiplexed by the puc_intr()
handler.

siointr1() first read as much input as possible and then checked all
possibly-relevant status registers, partly for robustness and partly
for historical reasons.  This is very bad if it is called for every
port sharing an interrupt like puc_intr() does.  It can spend too long
reading all the input for some ports when the interrupt is for a more
urgent event on another, or just too long checking all the status
registers when there are lots of ports.  The inter-character time is
too long for reading all the input even when the interrupt is for a
transmitter interrupt on the same port, and at 921600 bps the inter-char
time is 10.85 usec and was often exceeded with just 2 ports, leaving
the transmitters idle for about 6% of the time.

The tweak is to break out of the read loop after reading 1 char if
output can be done.  This avoids most of the idle transmitter time for
2 active ports at 921600 bps bidirectional on the test system.  It
also reduces overhead by about 20%.  More complete fixes use the
programmable tx low watermark on 16950's and reduce overhead by another
65%.
2003-11-17 07:21:19 +00:00
Bruce Evans
b9c29fa9ae Don't waste so much space for the latency debugging buffer. Its size
will now need editing except for spot checks.

Changed this buffer from a circular one to a linear one.  This is more
useful for some cases and the sysctl that prints it doesn't support
circular buffers.

Fixed (output) formatting bugs in this sysctl.  An off by 1 error caused
a garbage byte to be returned after annotation of large deltas, and
a race with the writer sometimes caused premature string termination.
2003-11-16 23:05:52 +00:00
Bruce Evans
90796c0860 Removed some nearly dead code in comparam(). We don't need to recover
from fiddling with CS_TTGO since fiddling with CS_TTGO was removed in
rev.1.218 of the i386/isa version (which was merged with loss of history
in rev.1.223 of this version).
2003-09-28 13:12:26 +00:00
Bruce Evans
5da172697f Cleaned up and fixed setting of speeds in comparam():
- Removed conversion of a zero input speed to the output speed.  This
  has been done better in ttioctl() since rev.1.108 of kern/tty.c
  almost 5 years ago.  comparam() did the conversion incompletely for
  the case where the output speed is also zero.  It had complications
  to avoid using zero speeds, but would still have used a zero input
  speed for setting watermarks if kern/tty.c had passed one.
- Never permit the input speed to be different from the output speed.
  There was no validity check on the input speed for the case of a zero
  output speed.  Then we didn't change the physical speeds, but we used
  the unvalidated input speed for setting watermarks and didn't return
  an error, so ttioctl() stored the unvalidated input speed in the tty
  struct where it could cause problems later.
- Removed complications that were to avoid using a divisor of 0.  The
  divisor is now always valid if the speed is accepted.
2003-09-27 11:13:59 +00:00
Poul-Henning Kamp
edafc5663e Fix compilation on alpha. 2003-09-26 21:36:01 +00:00
Bruce Evans
3a6a55a60b Use the correct speed in the delay for the transmission of a character
in the loopback test in the probe.  The delay was too short for consoles
at speeds lower than about 3200 bps.  This shouldn't have caused many
problems, since such low speeds are rare and the probe is forced to
succeed for consoles.
2003-09-26 11:36:09 +00:00
Poul-Henning Kamp
c5c8f9652b Adhere to the new console API:
Initialize cn_name
   Use cn_unit for internal housekeeping.
   Forget about cn_dev.
2003-09-26 07:29:34 +00:00
Bruce Evans
ca77329ecc Fixed most of the remaining style bugs in rev.1.194. Mainly better
wording in comments.
2003-09-18 07:46:40 +00:00
Bruce Evans
aca282e269 Miscellaneous minor style fixes (mainly for unsorting of the flags access
macros).
2003-09-17 17:26:00 +00:00
Bruce Evans
42d3393791 Fixed bitrot in the probe in revs.1.127, 1.165 and 1.169. The
COM_NOFIFO() and COM_ESP cases are supposed to be a subsets of the
plain 16550A case, but 16650-related changes made the former fall into
the latter and then both fall into general code for printing the tx
fifo size.  This mainly caused hard to parse boot messages like:
"sio0: type 16550A fifo disabled lookalike with 1 bytes FIFO".
COM_NOFIFO() on an ESP port gave a larger mess whose extent is not
clear.

Fixed some nearby style bugs.
2003-09-17 16:44:02 +00:00
Bruce Evans
cd3aaf0e7c Cleaned up initialization of hardware flow control for 16650As. Use
defined values instead of hard-coded values.  Don't repeat the register
access part of the code 4 times times or triple-space statements.  This
fixes half of the style bugs in rev.1.172.

Hardware flow control of 16650As is still officially unsupported.  I
was mistaken about it being broken.  It is broken in 16650s but is
fixed in 16650As except for the maximum trigger level (which is no
longer used).  Testing of the 16650's broken hardware flow control
watermarks by programming them on 16950s showed that their effects are
not too bad if the fifo size and trigger level are reasonably large
(16 is much better than 8).
2003-09-17 14:05:16 +00:00
Bruce Evans
7c24ca50f8 Quick fix for a pessimization in rev.1.194. An extra i/o instruction
was added to the fast path to support the COM_IIR_RXRDYBUG() case even
when that case is not configured.  This increased the relative overhead
of sio input by almost 25% in the worst case and by 2-3% in the usual
case (usually only about 0.2% absolute per port at 115200 bps).  The
quick fix is to significantly pessimize only the COM_IIR_RXRDYBUG()
case.
2003-09-15 13:49:18 +00:00
Nate Lawson
b5b965a529 Remove a duplicate comment.
Pointed out by:	bde
2003-08-28 03:54:49 +00:00
Nate Lawson
6e433dcdea Use the db_alt_break() state machine instead of rolling our own. This
brings sio(4) in-line with zs(4) et al.
2003-08-26 05:37:48 +00:00
David E. O'Brien
945ff31afa Use __FBSDID().
Also some minor style cleanups.
2003-08-24 18:03:45 +00:00
John Baldwin
8a9bc9c03b - Use the new resource_disabled() helper function to see if devices are
disabled.
- Change the apm driver to match the acpi driver's behavior by checking to
  see if the device is disabled in the identify routine instead of in the
  probe routine.  This way if the device is disabled it is never created.

Note that a few places (ips(4), Alpha SMP) used "disable" instead of
"disabled" for their hint names, and these hints must be changed to
"disabled".  If this is a big problem, resource_disabled() can always be
changed to honor both names.
2003-07-02 16:09:02 +00:00
Scott Long
87947cad18 Track the resource id of the memory port instead of just assuming that
it is 0x0.  Cardbus-based sio/modem cards can now be ejected without
panic'ing.
2003-06-09 21:25:14 +00:00
Poul-Henning Kamp
0623afde6f Remove extra unused variable.
Found by:       FlexeLint
2003-05-31 18:39:29 +00:00
David E. O'Brien
7aaa845578 Revert rev 1.396 -- it broke the Alpha kernel build. 2003-05-05 09:09:16 +00:00
Peter Wemm
8c027ecbba Eliminate a compiler warning with gcc3.3 on AMD64, where speed is
a 32 bit int which can never be > ULONG_MAX / 8.  Its an 'always true'
warning.
2003-04-30 21:39:28 +00:00
Mark Murray
51da11a27a Fix some easy, global, lint warnings. In most cases, this means
making some local variables static. In a couple of cases, this means
removing an unused variable.
2003-04-30 12:57:40 +00:00
Alexander Kabaev
104a9b7e3e Deprecate machine/limits.h in favor of new sys/limits.h.
Change all in-tree consumers to include <sys/limits.h>

Discussed on:	standards@
Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
2003-04-29 13:36:06 +00:00
Maxim Sobolev
2d95f7d4a9 Brucify.
Requested and reviewed by:	bde
MFC after:	2 weeks
2003-03-18 21:26:28 +00:00
Maxim Sobolev
71fbba351a Remove duplicate line introduced in the previous commit.
Submitted by:	bde
MFC after:	2 weeks
2003-03-15 18:49:41 +00:00
Maxim Sobolev
084254f807 - Add minimal support for TI16754 4xUART chip into sio(4) driver and remove
now unnecessary hack from the previous commit;
- Add support for Interrupt Latch Register (ILR) into puc(4). So far only
  ILRs compatible with specifications from Digi International are supported.
  Support for other types of ILRs could be easily added later;
- Correct clock frequency for IC Book Labs Dreadnought x16 Lite board;
- Enable ILR detection/usage for IC Book Labs Dreadnought x16 boards.

Sponsored by:   IC Book Labs
MFC after:      2 weeks
2003-03-15 16:25:40 +00:00
Maxim Sobolev
a2a101e766 Add initial support for IC Book Labs Dreadnought x16 Pro 16-ports card. Since
this card is based on 16750 UART, modify sio(4) a bit to ignore 16750-specific
7th bit of MCR when probing card. This allows card to be detected and attached
as 16550A-compatible device. More work needs to be done in order to enable
nice 16750-specific features such as larger fifo buffer and higher speeds.

Sponsored by:	IC Book Labs
MFC after:	2 weeks
2003-03-12 17:20:24 +00:00
Poul-Henning Kamp
182a9f7455 Make nokqfilter() return the correct return value.
Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers.
2003-03-03 16:24:47 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Poul-Henning Kamp
59c5c475f1 Typo, I must have hit xZZ in vi(1). 2003-02-27 12:53:21 +00:00