summaryrefslogtreecommitdiff
path: root/sys/dev/sio/sio.c
Commit message (Collapse)AuthorAgeFilesLines
* Use generic tty code instead of local stuff.Poul-Henning Kamp2004-10-131-521/+79
| | | | | | | NB: device names are now consistent: {cua,tty}d$(port)[.lock,.init] Notes: svn path=/head/; revision=136478
* Use ttyconsolemode() to set the console tty modes.Poul-Henning Kamp2004-10-121-8/+1
| | | | Notes: svn path=/head/; revision=136450
* MFpc98: Check a pointer is NULL, remove unused variable.Yoshihiro Takahashi2004-09-201-3/+4
| | | | Notes: svn path=/head/; revision=135516
* Fix an issue with ng_tty which (ab)used the tty->t_sc field which isPoul-Henning Kamp2004-09-171-4/+6
| | | | | | | | | reserved for the device drivers: Add a t_lsc field for line discipline private use. Notes: svn path=/head/; revision=135406
* Use ttyalloc() instead of ttymalloc(NULL)Poul-Henning Kamp2004-09-171-1/+1
| | | | Notes: svn path=/head/; revision=135367
* Allocate tty at attach time rather than open time.Poul-Henning Kamp2004-09-161-49/+43
| | | | | | | | | | | Use the init/lock*in/out fields in struct tty and remove them from our softc. Use tty->t_sc to find out softc when convenient. Mostly OK'ed by: bde Notes: svn path=/head/; revision=135329
* If you insert a pccard modem and then eject it, you get a panic. ThisWarner Losh2004-07-221-1/+2
| | | | | | | | | | happens because the sio device was never opened and com->tp is therefore NULL. ttygone can't swallow a NULL, so guard against that possibility. Other places in this function make similar checks, so I believe this is correct. Notes: svn path=/head/; revision=132561
* Preparation commit for the tty cleanups that will follow in the nearPoul-Henning Kamp2004-07-151-2/+2
| | | | | | | | | | | | future: rename ttyopen() -> tty_open() and ttyclose() -> tty_close(). We need the ttyopen() and ttyclose() for the new generic cdevsw functions for tty devices in order to have consistent naming. Notes: svn path=/head/; revision=132226
* Introduce ttygone() which indicates that the hardware is detached.Poul-Henning Kamp2004-07-111-38/+5
| | | | | | | Move dtrwait logic to the generic TTY level. Notes: svn path=/head/; revision=131981
* Update for the KDB framework. Sanitize the alpha console code now thatMarcel Moolenaar2004-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. Notes: svn path=/head/; revision=131939
* Define the tty methods as typedefs.Poul-Henning Kamp2004-06-301-3/+2
| | | | | | | | | Change the return type for t_break to void. Add t_ioctl (more about this later). Notes: svn path=/head/; revision=131373
* - Shorten the names for the TTY related swi interrupt handlers as theJohn Baldwin2004-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) Notes: svn path=/head/; revision=131242
* Guard against us having no tty pointer.Poul-Henning Kamp2004-06-271-1/+2
| | | | Notes: svn path=/head/; revision=131185
* Pick the hotchar out of the tty structure instead of caching privatePoul-Henning Kamp2004-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. Notes: svn path=/head/; revision=131134
* Use generic support for modemcontrol and BREAK ioctls.Poul-Henning Kamp2004-06-251-79/+64
| | | | Notes: svn path=/head/; revision=131094
* Remove the TIOCDCDTIMESTAMP option.Poul-Henning Kamp2004-06-221-12/+0
| | | | | | | | The RFC-2783 PPS-API (<sys/timepps.h>) provides better and more configurable service. Notes: svn path=/head/; revision=130938
* Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES.Poul-Henning Kamp2004-06-211-0/+4
| | | | Notes: svn path=/head/; revision=130892
* Give control devices their own cdevsw{} so that we can eliminate themPoul-Henning Kamp2004-06-211-51/+111
| | | | | | | | | from the trafic functions. Do not use com_addr() when we don't need it. Notes: svn path=/head/; revision=130872
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-6/+6
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Deorbit COMPAT_SUNOS.Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=130344
* Centralize the line discipline optimization determination in a functionPoul-Henning Kamp2004-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. Notes: svn path=/head/; revision=130096
* Manual edits to change linesw[]-frobbing to ttyld_*() calls.Poul-Henning Kamp2004-06-041-2/+2
| | | | Notes: svn path=/head/; revision=130095
* Machine generated patch which changes linedisc calls from accessingPoul-Henning Kamp2004-06-041-8/+8
| | | | | | | | | linesw[] directly to using the ttyld...() functions The ttyld...() functions ar inline so there is no performance hit. Notes: svn path=/head/; revision=130077
* Make the remaining serial drivers call ttyioctl() rather than callingPoul-Henning Kamp2004-06-041-8/+3
| | | | | | | the linedisc directly. Notes: svn path=/head/; revision=130057
* There is no need to explicitly call the stop function. In all likelyhoodPoul-Henning Kamp2004-06-011-1/+0
| | | | | | | ->l_close() did it and ttyclose certainly will. Notes: svn path=/head/; revision=129939
* There is no need to explicitly call ttwakeup() and ttwwakeup() afterPoul-Henning Kamp2004-06-011-2/+0
| | | | | | | | ttyclose() has been called. It's already been done once by ttyclose, and probably once by the line-discipline too. Notes: svn path=/head/; revision=129937
* ttyclose() increments t_gen. Remove redundant increments in drivers.Poul-Henning Kamp2004-06-011-1/+0
| | | | Notes: svn path=/head/; revision=129934
* Remove new options and my prevention of system freeze when the sio probeDoug Ambrisko2004-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) Notes: svn path=/head/; revision=128899
* Some enhancements and bug fix.Doug 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 Notes: svn path=/head/; revision=128781
* Back out last bad commit (again!)Warner Losh2004-04-071-12/+1
| | | | Notes: svn path=/head/; revision=128020
* Remove advertising clause from University of California Regent'sWarner Losh2004-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 Notes: svn path=/head/; revision=128019
* Last change was a bogusWarner Losh2004-04-071-12/+1
| | | | Notes: svn path=/head/; revision=127979
* Remove advertising clause from University of California Regent'sWarner Losh2004-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 Notes: svn path=/head/; revision=127977
* Back out code for auto-gdb detection that accidentally leaked into theNate Lawson2004-03-181-17/+5
| | | | | | | | | | bus_alloc_resource_any commit. Submitted by: bde Pointy-hat: njl Notes: svn path=/head/; revision=127157
* Convert callers to the new bus_alloc_resource_any(9) API.Nate Lawson2004-03-171-7/+18
| | | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde Notes: svn path=/head/; revision=127135
* Device megapatch 4/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126080
* Device megapatch 3/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126078
* Device megapatch 1/6:Poul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126076
* Fixed a memory leak.Ruslan Ermilov2004-01-181-1/+3
| | | | | | | Submitted by: Stanford Metacompilation research group Notes: svn path=/head/; revision=124669
* Fixed breakage of a check for boolean true by misusing NULL in rev.1.407.Bruce Evans2003-12-241-2/+2
| | | | | | | This became fatal when the type of NULL was changed recently. Notes: svn path=/head/; revision=123796
* Tweaked the siointr1() so that it works better at 921600 bps, especiallyBruce Evans2003-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%. Notes: svn path=/head/; revision=122844
* Don't waste so much space for the latency debugging buffer. Its sizeBruce Evans2003-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. Notes: svn path=/head/; revision=122819
* Removed some nearly dead code in comparam(). We don't need to recoverBruce Evans2003-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). Notes: svn path=/head/; revision=120553
* Cleaned up and fixed setting of speeds in comparam():Bruce Evans2003-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. Notes: svn path=/head/; revision=120505
* Fix compilation on alpha.Poul-Henning Kamp2003-09-261-1/+1
| | | | Notes: svn path=/head/; revision=120495
* Use the correct speed in the delay for the transmission of a characterBruce Evans2003-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. Notes: svn path=/head/; revision=120468
* Adhere to the new console API:Poul-Henning Kamp2003-09-261-15/+21
| | | | | | | | | Initialize cn_name Use cn_unit for internal housekeeping. Forget about cn_dev. Notes: svn path=/head/; revision=120457
* Fixed most of the remaining style bugs in rev.1.194. Mainly betterBruce Evans2003-09-181-30/+32
| | | | | | | wording in comments. Notes: svn path=/head/; revision=120189
* Miscellaneous minor style fixes (mainly for unsorting of the flags accessBruce Evans2003-09-171-13/+10
| | | | | | | macros). Notes: svn path=/head/; revision=120175
* Fixed bitrot in the probe in revs.1.127, 1.165 and 1.169. TheBruce Evans2003-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. Notes: svn path=/head/; revision=120173