summaryrefslogtreecommitdiffstats
path: root/sys/dev/sio/sio.c
Commit message (Collapse)AuthorAgeFilesLines
* Introduce ttygone() which indicates that the hardware is detached.phk2004-07-111-38/+5
| | | | Move dtrwait logic to the generic TTY level.
* Update for the KDB framework. Sanitize the alpha console code now thatmarcel2004-07-101-209/+76
| | | | | | | | | | | | | | | | | | it's in the way even more. Basicly: remove all alpha specific console support from gfb(4), sio(4) and syscons(4). Rewrite the alpha console initialization to be identical to all other platforms. In a nutshell: call cninit(). The platform specific code now only sets or clears RB_SERIAL and thus automaticly causes the right console to be selected. sio.c: o Replace the remote GDB hacks and use the GDB debug port interface instead. o Make debugging code conditional upon KDB instead of DDB. o Call kdb_alt_break() instead of db_alt_break(). o Call kdb_enter() instead of breakpoint(). o Remove the ugly compatibility of using the console as the debug port.
* Define the tty methods as typedefs.phk2004-06-301-3/+2
| | | | | | Change the return type for t_break to void. Add t_ioctl (more about this later).
* - Shorten the names for the TTY related swi interrupt handlers as thejhb2004-06-281-2/+2
| | | | | | | | 'tty:' prefix is largely redundant. - Fix the priority of the low-priority TTY SWIs that are hung off of the softclock thread. Submitted by: bde (2)
* Guard against us having no tty pointer.phk2004-06-271-1/+2
|
* Pick the hotchar out of the tty structure instead of caching privatephk2004-06-261-6/+5
| | | | | | | | copies. No current line disciplines have a dynamically changing hotchar, and expecting to receive anything sensible during a change in ldisc is insane so no locking of the hotchar field is necessary.
* Use generic support for modemcontrol and BREAK ioctls.phk2004-06-251-79/+64
|
* Remove the TIOCDCDTIMESTAMP option.phk2004-06-221-12/+0
| | | | | The RFC-2783 PPS-API (<sys/timepps.h>) provides better and more configurable service.
* Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES.phk2004-06-211-0/+4
|
* Give control devices their own cdevsw{} so that we can eliminate themphk2004-06-211-51/+111
| | | | | | from the trafic functions. Do not use com_addr() when we don't need it.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-6/+6
| | | | Bump __FreeBSD_version accordingly.
* Deorbit COMPAT_SUNOS.phk2004-06-111-2/+2
| | | | | 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.
* Centralize the line discipline optimization determination in a functionphk2004-06-041-24/+4
| | | | | | | | | 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.
* Manual edits to change linesw[]-frobbing to ttyld_*() calls.phk2004-06-041-2/+2
|
* Machine generated patch which changes linedisc calls from accessingphk2004-06-041-8/+8
| | | | | | linesw[] directly to using the ttyld...() functions The ttyld...() functions ar inline so there is no performance hit.
* Make the remaining serial drivers call ttyioctl() rather than callingphk2004-06-041-8/+3
| | | | the linedisc directly.
* There is no need to explicitly call the stop function. In all likelyhoodphk2004-06-011-1/+0
| | | | ->l_close() did it and ttyclose certainly will.
* There is no need to explicitly call ttwakeup() and ttwwakeup() afterphk2004-06-011-2/+0
| | | | | ttyclose() has been called. It's already been done once by ttyclose, and probably once by the line-discipline too.
* ttyclose() increments t_gen. Remove redundant increments in drivers.phk2004-06-011-1/+0
|
* Remove new options and my prevention of system freeze when the sio probeambrisko2004-05-031-76/+49
| | | | | | | 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)
* Some enhancements and bug fix.ambrisko2004-04-301-49/+76
| | | | | | | | | | | | | | | | | | - 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
* Back out last bad commit (again!)imp2004-04-071-12/+1
|
* Remove advertising clause from University of California Regent'simp2004-04-071-5/+12
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Last change was a bogusimp2004-04-071-12/+1
|
* Remove advertising clause from University of California Regent'simp2004-04-071-1/+12
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Back out code for auto-gdb detection that accidentally leaked into thenjl2004-03-181-17/+5
| | | | | | | bus_alloc_resource_any commit. Submitted by: bde Pointy-hat: njl
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-7/+18
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Device megapatch 4/6:phk2004-02-211-1/+2
| | | | | | | | 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.
* Device megapatch 3/6:phk2004-02-211-2/+0
| | | | | | | | | | | | 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.
* Device megapatch 1/6:phk2004-02-211-2/+0
| | | | | | | 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.
* Fixed a memory leak.ru2004-01-181-1/+3
| | | | Submitted by: Stanford Metacompilation research group
* Fixed breakage of a check for boolean true by misusing NULL in rev.1.407.bde2003-12-241-2/+2
| | | | This became fatal when the type of NULL was changed recently.
* Tweaked the siointr1() so that it works better at 921600 bps, especiallybde2003-11-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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%.
* Don't waste so much space for the latency debugging buffer. Its sizebde2003-11-161-10/+8
| | | | | | | | | | | | 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.
* Removed some nearly dead code in comparam(). We don't need to recoverbde2003-09-281-9/+0
| | | | | | 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).
* Cleaned up and fixed setting of speeds in comparam():bde2003-09-271-31/+20
| | | | | | | | | | | | | | | | | - 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.
* Fix compilation on alpha.phk2003-09-261-1/+1
|
* Use the correct speed in the delay for the transmission of a characterbde2003-09-261-1/+4
| | | | | | | 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.
* Adhere to the new console API:phk2003-09-261-15/+21
| | | | | | Initialize cn_name Use cn_unit for internal housekeeping. Forget about cn_dev.
* Fixed most of the remaining style bugs in rev.1.194. Mainly betterbde2003-09-181-30/+32
| | | | wording in comments.
* Miscellaneous minor style fixes (mainly for unsorting of the flags accessbde2003-09-171-13/+10
| | | | macros).
* Fixed bitrot in the probe in revs.1.127, 1.165 and 1.169. Thebde2003-09-171-23/+23
| | | | | | | | | | | | 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.
* Cleaned up initialization of hardware flow control for 16650As. Usebde2003-09-171-25/+11
| | | | | | | | | | | | | | 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).
* Quick fix for a pessimization in rev.1.194. An extra i/o instructionbde2003-09-151-2/+7
| | | | | | | | | 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.
* Remove a duplicate comment.njl2003-08-281-6/+0
| | | | Pointed out by: bde
* Use the db_alt_break() state machine instead of rolling our own. Thisnjl2003-08-261-32/+14
| | | | brings sio(4) in-line with zs(4) et al.
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* - Use the new resource_disabled() helper function to see if devices arejhb2003-07-021-5/+3
| | | | | | | | | | | | 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.
* Track the resource id of the memory port instead of just assuming thatscottl2003-06-091-3/+6
| | | | | it is 0x0. Cardbus-based sio/modem cards can now be ejected without panic'ing.
* Remove extra unused variable.phk2003-05-311-2/+0
| | | | Found by: FlexeLint
OpenPOWER on IntegriCloud