summaryrefslogtreecommitdiffstats
path: root/sys/dev/sio/sio.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Only try to flush the FIFO of 500 characters, return EIO if that fails.phk2002-08-281-1/+6
| | | | | This at least prevents the total hang of the machine when I open a PCCARD sio device on -current, but it does not solve the problem.
* set siocnunit to the correct value. This fixes the freeze on boot forn_hibma2002-06-231-2/+4
| | | | | | alphas. Submitted by: Bernd Walter <ticso@cicely5.cicely.de>
* Make this compile on Alpha.n_hibma2002-06-221-2/+2
|
* Make the speed used by gdb over serial settable in the kernel configuration.n_hibma2002-06-181-21/+49
| | | | | | This facilitates the use in circumstances where you are using a serial console as well. GDB doesn't support anything higher than 9600 baud (19k2 if you are lucky), but the console does.
* Simplify the RFC2783 and PPS_SYNC timestamp collection API.phk2002-04-261-7/+2
|
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-1/+2
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-3/+3
| | | | | | | | | | | | 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@
* Support more than 32 sio unit numbers. The maximum unit number is nowbde2002-03-311-8/+12
| | | | | | | | | | | (65536 * 32 - 1), but MAKEDEV only supports up to (32 * 32 -1). Device names use the unit number in base 32 for all "digits". This required fixing an old bug in MAKEDEV:ttyminor(). Its arg was the global $unit instead of $1. Reminded by: Valentin K. Ponomarenko <valka@krog.ukrtel.net> MFC-after: 1 week
* Hacks for measuring interrupt latency. Interrupt latency can bebde2002-03-311-2/+42
| | | | | | | | | | | | | | measured accurately for periodic interrupts provided the interrupts don't need to be serviced very quickly to keep their period almost constant. sio output interrupts have this property (interrupt service can be delayed for up to 1 character time without the period changing). This is non-optional and undocumented so that it can be added and removed easily. It has no significant effect unless it is enabled by hacking on a variable using a debugger. Hardclock and statclock interrupts would work even better for this, at least on i386's, provided their interrupt handlers are fast (as they are in -current but not in -stable or in my version of -current).
* Include <machine/limits.h> for definition of ULONG_MAX.mike2002-03-251-0/+1
|
* Fixed some style bugs in the removal of __P(()). The main ones werebde2002-03-231-18/+18
| | | | | | not removing tabs before "__P((", and not outdenting continuation lines to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting and/or rewrap the whole prototype in some cases.
* Remove __P.alfred2002-03-201-23/+23
|
* Add device ID for Xircom modem. Also add work around from gwk@sgi.comimp2002-03-161-2/+9
| | | | | | | | to put the device into 8 bit mode a second time. This appears to have no ill effects on other devices, and appears to be necessary for the xircom modem. Submitted by: gwk@sgi.com, many others that found his patch in the archives.
* Until I can figure out how to live without the volatile qualifier onimp2002-02-261-1/+1
| | | | comdefaultrate, comment out the support for machdep.conspeed for now.
* Add an experimental tunable: machdep.conspeed.imp2002-02-261-0/+1
| | | | # I'm not sure where to document this.
* Add support for different serial clock frequencies and not just thejhay2002-01-301-63/+89
| | | | | | | standard one of 1.8432MHz. This will be used by the puc (PCI "universal" communication card) device driver. Reviewed by: bde
* Cosmetic fix: Not every machine that uses the sio driver has a BIOS.bmah2002-01-171-1/+1
| | | | Pointed out by: imp
* While I'm not sure that I like the wording of the BIOS message in theimp2002-01-171-1/+2
| | | | | | | | | | previous commit, it should always print due to lack of {} around the second line in the if statement. The message should likely say something more like "There's no hardware responding at this IRQ. Device not present (or disbaled)," but that is too long. We generally don't give elementary advise in device driver messages anyway. Be that as it may, the problem with it printing all the time should be corrected.
* Make sio device probe messages less misleading, for the case thatbmah2002-01-171-1/+4
| | | | | | | | a port is either disabled or not responding. PR: 33963 Submitted by: Kevin Oberman <oberman@es.net> MFC after: 2 weeks
* Change the preemption code for software interrupt thread schedules andjhb2002-01-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mutex releases to not require flags for the cases when preemption is not allowed: The purpose of the MTX_NOSWITCH and SWI_NOSWITCH flags is to prevent switching to a higher priority thread on mutex releease and swi schedule, respectively when that switch is not safe. Now that the critical section API maintains a per-thread nesting count, the kernel can easily check whether or not it should switch without relying on flags from the programmer. This fixes a few bugs in that all current callers of swi_sched() used SWI_NOSWITCH, when in fact, only the ones called from fast interrupt handlers and the swi_sched of softclock needed this flag. Note that to ensure that swi_sched()'s in clock and fast interrupt handlers do not switch, these handlers have to be explicitly wrapped in critical_enter/exit pairs. Presently, just wrapping the handlers is sufficient, but in the future with the fully preemptive kernel, the interrupt must be EOI'd before critical_exit() is called. (critical_exit() can switch due to a deferred preemption in a fully preemptive kernel.) I've tested the changes to the interrupt code on i386 and alpha. I have not tested ia64, but the interrupt code is almost identical to the alpha code, so I expect it will work fine. PowerPC and ARM do not yet have interrupt code in the tree so they shouldn't be broken. Sparc64 is broken, but that's been ok'd by jake and tmm who will be fixing the interrupt code for sparc64 shortly. Reviewed by: peter Tested on: i386, alpha
* Fixed locking bugs in rev.1.346:bde2001-12-281-2/+6
| | | | | | | | | | | | | | | (1) Don't attempt aquire the non-recursive lock sio_lock recursively. Doing so caused unbounded recursion in some setups. E.g., if DDB, BREAK_TO_DEBUGGER and WITNESS are configured; if the debugger is entered using a break, then WITNESS will actually detect the invalid recursion and will add to it attempting to print a message about it. (2) Don't use sio_lock before it has been initialized. The old check (sio_inited != 0) didn't work when sio_inited was boolean because sio_inited was set too early, and became just wrong when sio_inited was changed to a tri-state variable in rev.1.348. Reported and fixed in another way by: fenner (1)
* Fix typo first, then controvert.tanimura2001-12-241-1/+1
|
* Back out an inappropriate backout. If Anyone wants to set the FIFOdillon2001-12-231-1/+6
| | | | | | level that high they should first fix the problems with the system that cause silo overflows. It is far more important for the serial device to work.
* Backed out previous unapproved commit.bde2001-12-231-6/+1
|
* This problem has been in the serial driver for years, and I occassionallydillon2001-12-231-1/+6
| | | | | | | | see people trip over it. Do not set the FIFO trigger to just before it would otherwise overflow. Give it a little more slop so characters aren't lost if the interrupt is delayed by other system activities. MFC maybe: 7 days
* bde suggests that sio really wants to manage its own softc. Thisimp2001-11-261-7/+149
| | | | | | | | | allows us to move the sio softc data structure back into sio.c and reduce the complexity of the non sio.c sio files. Submitted by: bde # I didn't fix the locking issues that bruce also submitted.
* cn_tab no longer exists, use cnadd() to add a console device. Note thatjlemon2001-10-241-1/+1
| | | | this may result in duplicate console output in some cases.
* Add a siocnterm function for the CONS_DRIVER function vector.jlemon2001-10-231-1/+9
|
* Break out the bus front ends into their own files. Rewriteimp2001-10-231-418/+14
| | | | | | | | | | | sio_pccard_detach to use new siodetach. Add an extra arg to sioprobe to tell driver to probe/not probe the device for IRQs. This incorporates most of Bruce's review material. I'm at a good checkpoint, but there will be more to come based on bde's further reviews. Reviewed by: bde
* First commit after a repo copy of isa/sio* -> dev/sio:imp2001-10-221-1/+1
| | | | | | | | | | Move sio from isa/sio.c to dev/sio/sio.c. The next step is to break out the front end attachments, improve support for these parts on different busses, and maybe, if we're lucky, merging in pc98 support. It will also be MI and live in conf/files rather than files.*. Approved by: bde Tested with: i386, pc98
* - Make the sio_inited handling more properly MP safe.jhb2001-10-201-2/+6
| | | | | - If we are booting with a serial console, then pass the MTX_QUIET flag to mtx_init of the sio lock as otherwise KTR_VERBOSE simply doesn't work.
* Add support for 28800 baud to sio.jlemon2001-09-291-0/+1
| | | | | PR: 30906 Submitted by: "Daniel O'Connor" <darius@chowder.dons.net.au>
* Gate low level console output on mtx_lock_spin(&sio_lock), if thejlemon2001-09-271-0/+4
| | | | | | sio_lock has been initialized. This prevents the low level console output (kernel printf) from clobbering the sio settings if the system happens to be in the middle of comstart().
* Tweak so I can use a serial console on ia64.dfr2001-09-221-1/+1
|
* Recognize two cheap PCI 16550 devices :murray2001-09-161-2/+4
| | | | | | | CyberSerial (1-port) 16550 Oxford Semiconductor Dual Port 16550 Sort the list of PCI devices while I'm here.
* KSE Milestone 2julian2001-09-121-10/+10
| | | | | | | | | | | | | | 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
* Add a missing newline to an error message.dd2001-09-091-1/+1
| | | | | PR: 30436 Submitted by: Joerg Lehners <Lehners@Informatik.Uni-Oldenburg.DE>
* Add ID for the Best Data Smart One 56SPS Voice modem.murray2001-08-311-0/+1
| | | | | PR: kern/24851 Submitted by: Daniel Rudy <dcrudy@aol.com>
* Add OMRON ME5614ISA PnP modem.murray2001-08-311-0/+1
| | | | | PR: kern/22801 Submitted by: Ryuzo Okada <R.Okada@mm.neweb.ne.jp>
* Add PCI device IDs for Kuotech dual port serial cards.murray2001-08-311-0/+2
| | | | | | | Also give example of the flags needed to use these cards. PR: kern/21242 Submitted by: Shigeki Moride <moride@portside.net>
* Add ACPI attachments.msmith2001-08-301-0/+1
|
* Fix the so-called "half-baked-probe" code that I wrote a long time agoimp2001-08-161-0/+2
| | | | | | | | | | | | | | to properly clear the interrupt register on the no error case. Also, set the mcr register to zero when we find we can't support the chip. This fixes the hang on sio driver attach problem in the new pci pccard code that some people have reported. At least on my machine. I'd like to get this into 4.4. Submitted by: bde PR: kern/29742 MFC after: 1 day
* The serial console break-to-debugger support only functioned whileiedowse2001-06-201-1/+21
| | | | | | | | | | | | | | the console device was open. At other times, the interrupts that are used to detect the break signal or ~^B sequence were disabled, so these events would not be noticed until the next open (e.g. the next kernel printf). This was mainly a problem while there was no getty running on the console, such as during bootup or shutdown. For serial consoles with break-to-debugger support, we now enable the generation of interrupts at attach time, and we leave them enabled while the device is closed. Reviewed by: bde (I've since made chages as per his suggestions)
* Close the line displine on detach. Lots of folks have submittd this, andimp2001-06-051-1/+4
| | | | | | | I think bde even reviewed it once. Also, change the name of ActionTEC pat to more generic Lucent Kermit chip. Add stub for Xircom card. Add cardbus attachment too.
* Move out the files from src/sys/isa/ic/ to src/sys/dev/ic/, so theyjoerg2001-06-041-2/+2
| | | | | | | | | | can be made userland-visible as <dev/ic/...>. Also, those files are not supposed to contain any bus-specific details at all, so placing them under .../isa/ has been a misnomer from the beginning. The files in src/sys/dev/ic/ have been repo-copied from their old location (this commit is a forced null commit there to record this message).
* add Dualmode Zoom/FaxModem 56K (internal) Model 2919sanpei2001-05-261-0/+1
| | | | | PR: kern/27476 Submitted by: Eric Beyer <lnxfrk@earthlink.net>
* Add SmartLink 5634PCV SurfRidersanpei2001-05-201-0/+1
| | | | | PR: kern/26952 Submitted by: Simon Dick <simond@irrelevant.org>
* Remove unneeded includes of sys/ipl.h and machine/ipl.h.jhb2001-05-151-1/+0
|
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-8/+10
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Send the remains (such as I have located) of "block major numbers" tophk2001-03-261-1/+0
| | | | the bit-bucket.
OpenPOWER on IntegriCloud