summaryrefslogtreecommitdiff
path: root/sys/dev/sio/sio.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Cleaned up initialization of hardware flow control for 16650As. UseBruce Evans2003-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). Notes: svn path=/head/; revision=120159
* Quick fix for a pessimization in rev.1.194. An extra i/o instructionBruce Evans2003-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. Notes: svn path=/head/; revision=120091
* Remove a duplicate comment.Nate Lawson2003-08-281-6/+0
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=119517
* Use the db_alt_break() state machine instead of rolling our own. ThisNate Lawson2003-08-261-32/+14
| | | | | | | brings sio(4) in-line with zs(4) et al. Notes: svn path=/head/; revision=119485
* Use __FBSDID().David E. O'Brien2003-08-241-1/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119419
* - Use the new resource_disabled() helper function to see if devices areJohn Baldwin2003-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. Notes: svn path=/head/; revision=117167
* Track the resource id of the memory port instead of just assuming thatScott Long2003-06-091-3/+6
| | | | | | | | it is 0x0. Cardbus-based sio/modem cards can now be ejected without panic'ing. Notes: svn path=/head/; revision=116120
* Remove extra unused variable.Poul-Henning Kamp2003-05-311-2/+0
| | | | | | | Found by: FlexeLint Notes: svn path=/head/; revision=115481
* Revert rev 1.396 -- it broke the Alpha kernel build.David E. O'Brien2003-05-051-1/+1
| | | | Notes: svn path=/head/; revision=114722
* Eliminate a compiler warning with gcc3.3 on AMD64, where speed isPeter Wemm2003-04-301-1/+5
| | | | | | | | a 32 bit int which can never be > ULONG_MAX / 8. Its an 'always true' warning. Notes: svn path=/head/; revision=114334
* Fix some easy, global, lint warnings. In most cases, this meansMark Murray2003-04-301-1/+1
| | | | | | | | making some local variables static. In a couple of cases, this means removing an unused variable. Notes: svn path=/head/; revision=114293
* Deprecate machine/limits.h in favor of new sys/limits.h.Alexander Kabaev2003-04-291-1/+1
| | | | | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com> Notes: svn path=/head/; revision=114216
* Brucify.Maxim Sobolev2003-03-181-23/+19
| | | | | | | | Requested and reviewed by: bde MFC after: 2 weeks Notes: svn path=/head/; revision=112384
* Remove duplicate line introduced in the previous commit.Maxim Sobolev2003-03-151-1/+0
| | | | | | | | Submitted by: bde MFC after: 2 weeks Notes: svn path=/head/; revision=112275
* - Add minimal support for TI16754 4xUART chip into sio(4) driver and removeMaxim Sobolev2003-03-151-1/+33
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=112270