summaryrefslogtreecommitdiff
path: root/sys/dev/sio/sio.c
Commit message (Collapse)AuthorAgeFilesLines
* - 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
* Add initial support for IC Book Labs Dreadnought x16 Pro 16-ports card. SinceMaxim Sobolev2003-03-121-1/+1
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=112154
* Make nokqfilter() return the correct return value.Poul-Henning Kamp2003-03-031-1/+1
| | | | | | | Ditch the D_KQFILTER flag which was used to prevent calling NULL pointers. Notes: svn path=/head/; revision=111821
* Gigacommit to improve device-driver source compatibility betweenPoul-Henning Kamp2003-03-031-14/+10
| | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=111815
* Typo, I must have hit xZZ in vi(1).Poul-Henning Kamp2003-02-271-1/+1
| | | | Notes: svn path=/head/; revision=111616
* Make flags bit 0x10000 mean that PPS timestamping should use thePoul-Henning Kamp2003-02-271-2/+11
| | | | | | | CTS instead of the DCD pin. Notes: svn path=/head/; revision=111613
* Change the console interface to pass a "struct consdev *" instead of aPoul-Henning Kamp2003-02-201-11/+18
| | | | | | | | | | | | dev_t to the method functions. The dev_t can still be found at struct consdev *->cn_dev. Add a void *cn_arg element to struct consdev which the drivers can use for retrieving their softc. Notes: svn path=/head/; revision=111194
* Change "dev_t gdbdev" to "void *gdb_arg", some possible paths for GDBPoul-Henning Kamp2003-02-161-4/+4
| | | | | | | will not have a dev_t. Notes: svn path=/head/; revision=111017
* Remove #include <sys/dkstat.h>Poul-Henning Kamp2003-02-161-1/+0
| | | | Notes: svn path=/head/; revision=111002
* Set si_drv1 to our softc for all the six dev_t's we create for a serial port.Poul-Henning Kamp2003-02-021-0/+2
| | | | Notes: svn path=/head/; revision=110249
* s/modunload/kldunloadWarner Losh2002-10-111-1/+1
| | | | Notes: svn path=/head/; revision=104933
* Be consistent about "static" functions: if the function is markedPoul-Henning Kamp2002-09-281-3/+3
| | | | | | | | | static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512 Notes: svn path=/head/; revision=104094
* Add yet a quick flag to sio: 0x100000 "Scratch pad register missing".Poul-Henning Kamp2002-09-271-6/+5
| | | | | | | | | | The advanced stage of computer assisted hardware design and verification is aptly illustrated by the fact that this is necessary because only the first ports in a single-chip, dual-port async PC-Card product lacks this register. Notes: svn path=/head/; revision=104067
* Move the com_scr register address definition over with the other seven.Poul-Henning Kamp2002-09-221-2/+0
| | | | | | | Approved by: bde Notes: svn path=/head/; revision=103795
* Only try to flush the FIFO of 500 characters, return EIO if that fails.Poul-Henning Kamp2002-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. Notes: svn path=/head/; revision=102542
* set siocnunit to the correct value. This fixes the freeze on boot forNick Hibma2002-06-231-2/+4
| | | | | | | | | alphas. Submitted by: Bernd Walter <ticso@cicely5.cicely.de> Notes: svn path=/head/; revision=98691
* Make this compile on Alpha.Nick Hibma2002-06-221-2/+2
| | | | Notes: svn path=/head/; revision=98619
* Make the speed used by gdb over serial settable in the kernel configuration.Nick 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. Notes: svn path=/head/; revision=98401
* Simplify the RFC2783 and PPS_SYNC timestamp collection API.Poul-Henning Kamp2002-04-261-7/+2
| | | | Notes: svn path=/head/; revision=95523
* Change callers of mtx_init() to pass in an appropriate lock type name. InJohn Baldwin2002-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 Notes: svn path=/head/; revision=93818
* Change the suser() API to take advantage of td_ucred as well as do aJohn Baldwin2002-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@ Notes: svn path=/head/; revision=93593
* Support more than 32 sio unit numbers. The maximum unit number is nowBruce Evans2002-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 Notes: svn path=/head/; revision=93470
* Hacks for measuring interrupt latency. Interrupt latency can beBruce Evans2002-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). Notes: svn path=/head/; revision=93466
* Include <machine/limits.h> for definition of ULONG_MAX.Mike Barcroft2002-03-251-0/+1
| | | | Notes: svn path=/head/; revision=93126
* Fixed some style bugs in the removal of __P(()). The main ones wereBruce Evans2002-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. Notes: svn path=/head/; revision=93010
* Remove __P.Alfred Perlstein2002-03-201-23/+23
| | | | Notes: svn path=/head/; revision=92739
* Add device ID for Xircom modem. Also add work around from gwk@sgi.comWarner Losh2002-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. Notes: svn path=/head/; revision=92401
* Until I can figure out how to live without the volatile qualifier onWarner Losh2002-02-261-1/+1
| | | | | | | comdefaultrate, comment out the support for machdep.conspeed for now. Notes: svn path=/head/; revision=91280
* Add an experimental tunable: machdep.conspeed.Warner Losh2002-02-261-0/+1
| | | | | | | # I'm not sure where to document this. Notes: svn path=/head/; revision=91276
* Add support for different serial clock frequencies and not just theJohn Hay2002-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 Notes: svn path=/head/; revision=89986
* Cosmetic fix: Not every machine that uses the sio driver has a BIOS.Bruce A. Mah2002-01-171-1/+1
| | | | | | | Pointed out by: imp Notes: svn path=/head/; revision=89470
* While I'm not sure that I like the wording of the BIOS message in theWarner Losh2002-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. Notes: svn path=/head/; revision=89463
* Make sio device probe messages less misleading, for the case thatBruce A. Mah2002-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 Notes: svn path=/head/; revision=89447
* Change the preemption code for software interrupt thread schedules andJohn Baldwin2002-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 Notes: svn path=/head/; revision=88900
* Fixed locking bugs in rev.1.346:Bruce Evans2001-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) Notes: svn path=/head/; revision=88582
* Fix typo first, then controvert.Seigo Tanimura2001-12-241-1/+1
| | | | Notes: svn path=/head/; revision=88451
* Back out an inappropriate backout. If Anyone wants to set the FIFOMatthew Dillon2001-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. Notes: svn path=/head/; revision=88433
* Backed out previous unapproved commit.Bruce Evans2001-12-231-6/+1
| | | | Notes: svn path=/head/; revision=88432
* This problem has been in the serial driver for years, and I occassionallyMatthew Dillon2001-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 Notes: svn path=/head/; revision=88431
* bde suggests that sio really wants to manage its own softc. ThisWarner Losh2001-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. Notes: svn path=/head/; revision=86909
* cn_tab no longer exists, use cnadd() to add a console device. Note thatJonathan Lemon2001-10-241-1/+1
| | | | | | | this may result in duplicate console output in some cases. Notes: svn path=/head/; revision=85426