summaryrefslogtreecommitdiff
path: root/sys/dev/sio/sio.c
Commit message (Collapse)AuthorAgeFilesLines
* Send the remains (such as I have located) of "block major numbers" toPoul-Henning Kamp2001-03-261-1/+0
| | | | | | | the bit-bucket. Notes: svn path=/head/; revision=74810
* Add GVC1601 - Rockwell V.34 Plug & Play ModemMIHIRA Sanpei Yoshiro2001-03-071-0/+1
| | | | | | | | PR: kern/25204 Submitted by: Victor Ivanov <v0rbiz@icon.bg> Notes: svn path=/head/; revision=73961
* Add IOD0081 - I-O DATA DEVICE,INC. IFML-560MIHIRA Sanpei Yoshiro2001-03-071-0/+1
| | | | | | | | PR: kern/25173 Submitted by: Yohsuke Fujikawa <yohsuke@mx2.nisiq.net> Notes: svn path=/head/; revision=73960
* Extend kqueue down to the device layer.Jonathan Lemon2001-02-151-2/+3
| | | | | | | Backwards compatible approach suggested by: peter Notes: svn path=/head/; revision=72521
* RIP <machine/lock.h>.Mark Murray2001-02-111-4/+0
| | | | | | | | | | Some things needed bits of <i386/include/lock.h> - cy.c now has its own (only) copy of the COM_(UN)LOCK() macros, and IMASK_(UN)LOCK() has been moved to <i386/include/apic.h> (AKA <machine/apic.h>). Reviewed by: jhb Notes: svn path=/head/; revision=72358
* - Catch up to the new swi API changes:John Baldwin2001-02-091-12/+12
| | | | | | | | | | - Use swi_* function names. - Use void * to hold cookies to handlers instead of struct intrhand *. - In sio.c, use 'driver_name' instead of "sio" as the name of the driver lock to minimize diffs with cy(4). Notes: svn path=/head/; revision=72238
* Change and clean the mutex lock interface.Bosko Milekic2001-02-091-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order) Notes: svn path=/head/; revision=72200
* Remove count for NSIO. The only places it was used it were incorrect.Peter Wemm2001-01-311-1/+0
| | | | | | | (alpha-gdbstub.c got sync'ed up a bit with the i386 version) Notes: svn path=/head/; revision=71880
* Add OZO8008 - Zoom (33.6k Modem).Seigo Tanimura2000-12-261-0/+1
| | | | | | | | PR: kern/23336 Submitted by: Paulo Menezes <root@samurai.dee.uc.pt> Notes: svn path=/head/; revision=70356
* Convert the sio driver to use a spin mutex instead of a s_lock. This isJohn Baldwin2000-12-181-123/+58
| | | | | | | | | going to hurt sio(4) performance for the time being. As we get closer to release and have more of the kernel unlocked we can come back to doing arcane optimizations to workaround the limitations of the sio hardware. Notes: svn path=/head/; revision=70174
* - Overhaul the software interrupt code to use interrupt threads for eachJohn Baldwin2000-10-251-11/+15
| | | | | | | | | | | | | | | | | | | | | | type of software interrupt. Roughly, what used to be a bit in spending now maps to a swi thread. Each thread can have multiple handlers, just like a hardware interrupt thread. - Instead of using a bitmask of pending interrupts, we schedule the specific software interrupt thread to run, so spending, NSWI, and the shandlers array are no longer needed. We can now have an arbitrary number of software interrupt threads. When you register a software interrupt thread via sinthand_add(), you get back a struct intrhand that you pass to sched_swi() when you wish to schedule your swi thread to run. - Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit more intuitive. Also, prefix all the members of struct intrhand with 'ih_'. - Make swi_net() a MI function since there is now no point in it being MD. Submitted by: cp Notes: svn path=/head/; revision=67551
* Add MAE0021 - Jetstream Int V.90 56k Voice Series 2.Seigo Tanimura2000-10-101-0/+1
| | | | | | | | PR: i386/19920 Submitted by: Peter Ortner <port@iname.com> Notes: svn path=/head/; revision=66920
* Use schedsofttty() again so that siopoll() gets scheduled as designedBruce Evans2000-10-081-5/+0
| | | | | | | (SMPng casualty in rev.1.308 with wrong fix in rev.1.310). Notes: svn path=/head/; revision=66822
* - Heavyweight interrupt threads on the alpha for device I/O interrupts.John Baldwin2000-10-051-1/+1
| | | | | | | | | | | | | | - Make softinterrupts (SWI's) almost completely MI, and divorce them completely from the x86 hardware interrupt code. - The ihandlers array is now gone. Instead, there is a MI shandlers array that just contains SWI handlers. - Most of the former machine/ipl.h files have moved to a new sys/ipl.h. - Stub out all the spl*() functions on all architectures. Submitted by: dfr Notes: svn path=/head/; revision=66698
* - Wrap functions and variables that aren't used in the alpha console probeJohn Baldwin2000-09-221-7/+26
| | | | | | | | | with #ifndef __alpha__/#endif - Add function prototypes for functions used during the alpha console probe and gdb port setup inside of #ifdef __alpha__/#endif. Notes: svn path=/head/; revision=66230
* - Remove the inthand2_t type and use the equivalent driver_intr_t type fromJohn Baldwin2000-09-131-0/+1
| | | | | | | | | | | | | | | | newbus for referencing device interrupt handlers. - Move the 'struct intrec' type which describes interrupt sources into sys/interrupt.h instead of making it just be a x86 structure. - Don't create 'ithd' and 'intrec' typedefs, instead, just use 'struct ithd' and 'struct intrec' - Move the code to translate new-bus interrupt flags into an interrupt thread priority out of the x86 nexus code and into a MI ithread_priority() function in sys/kern/kern_intr.c. - Remove now-uneeded x86-specific headers from sys/dev/ata/ata-all.c and sys/pci/pci_compat.c. Notes: svn path=/head/; revision=65822
* Add a nasty hack to get remote kernel gdb working from ddb. ddb wouldJohn Baldwin2000-09-111-0/+9
| | | | | | | | | | complain before that a suitable gdb port had not been setup because gdbdev was NULL. This abuses the fact that the gdb port is hard-coded to the address normally assigned to sio1 and thus hard-codes in sio1 as the gdb port. Yuck. Notes: svn path=/head/; revision=65714
* Back out my previous commit as well as some SMPng changes to revert theJohn Baldwin2000-09-081-17/+28
| | | | | | | | | | siosetwater() function to its previous behavior of always disabling interrupts and obtaining the com_lock before returning. Requested by: bde (in principle) Notes: svn path=/head/; revision=65605
* siointr1: Schedule soft interrupt when needed. This fixes the "noGreg Lehey2000-09-081-0/+2
| | | | | | | | | | interrupt" problem people had seen with SMPng. Approved by: jasone Tested by: bp Notes: svn path=/head/; revision=65602
* Fix a problem where we would recursively try to get the com lock withinJohn Baldwin2000-09-081-6/+9
| | | | | | | | | comparam when calling siosetwater(). Noticed by: bp Notes: svn path=/head/; revision=65596
* Major update to the way synchronization is done in the kernel. HighlightsJason Evans2000-09-071-40/+115
| | | | | | | | | | | | | | | | | | include: * Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The alpha port is still in transition and currently uses both.) * Per-CPU idle processes. * Interrupts are run in their own separate kernel threads and can be preempted (i386 only). Partially contributed by: BSDi (BSD/OS) Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh Notes: svn path=/head/; revision=65557
* Add ZTIA001 - Zoom Internal V90 Faxmodem.Sheldon Hearn2000-09-051-0/+1
| | | | | | | | PR: 21028 Submitted by: Glenn Johnson <glennpj@charter.net> Notes: svn path=/head/; revision=65469
* Add Boca K56Flex PnP modem.Sheldon Hearn2000-09-041-0/+1
| | | | | | | | PR: 21000 Submitted by: Andrew Sparrow <spadger@best.com> Notes: svn path=/head/; revision=65438
* Call destroy_dev() when sio devices go away.Poul-Henning Kamp2000-08-271-6/+12
| | | | Notes: svn path=/head/; revision=65131
* Add another USR modem.Peter Wemm2000-08-151-0/+1
| | | | | | | | PR: 20621 Submitted by: Masanori Taira <mtaira@logicaleffect.com> Notes: svn path=/head/; revision=64688
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.Poul-Henning Kamp2000-07-041-1/+1
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=62573
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:Poul-Henning Kamp2000-07-031-1/+1
| | | | | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS) Notes: svn path=/head/; revision=62454
* Add option ALT_BREAK_TO_DEBUGGER.Paul Saab2000-06-141-0/+29
| | | | | | | | | | | Implement the Solaris way to break into DDB over a serial console instead of sending a break. Sending the character sequence CR ~ ^b will break the kernel into DDB (if DDB is enabled). Reviewed by: peter Notes: svn path=/head/; revision=61649
* Add SUP1670 - Supra 336i V+ Intl. Since we update the PnP IDsSeigo Tanimura2000-05-261-0/+1
| | | | | | | | | | | | more frequently than the core part of the sio driver, it might be good to move the PnP IDs to sio_isapnp.h or something like that. PR: i386/18828 Submitted by: J.P. King <jpk28@cam.ac.uk> Notes: svn path=/head/; revision=60947
* Add RSS0262 - 5614Jx3[G] V90+K56Flex Modem.Seigo Tanimura2000-05-191-0/+1
| | | | | | | | PR: kern/18168 Submitted by: Tony Voet <voet@engineer.com> Notes: svn path=/head/; revision=60708
* Add ACH2012 - 5634BTS 56K Video Ready Modem.Seigo Tanimura2000-05-191-0/+1
| | | | | | | | PR: kern/17351 Submitted by: Eric D. Futch <efutch@nyct.net> Notes: svn path=/head/; revision=60696
* Add a couple of new PnP IDs.Seigo Tanimura2000-05-181-0/+2
| | | | | | | | | | | | | o OZO800f - Zoom 2812 (56k Modem) PR: kern/18603 Submitted by: Matt Loschert <loschert@servint.com> o DAV0336 - DAVICOM 336PNP MODEM PR: kern/18608 Submitted by: Martijn Plak <martijn@be3.com> Notes: svn path=/head/; revision=60674
* Use bus_space stuff except where it needs high performance.Yoshihiro Takahashi2000-05-121-79/+82
| | | | | | | Reviewed by: bde Notes: svn path=/head/; revision=60471
* Add the logical ID of FUJITSU Modem 33600 PNP/I2.Seigo Tanimura2000-05-021-0/+1
| | | | | | | | PR: kern/18257 Submitted by: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp> Notes: svn path=/head/; revision=59888
* Add support for pci modems. ONLY CONTROLLER BASED MODEMS. ThisWarner Losh2000-04-011-14/+122
| | | | | | | | | | | | | | | doesn't support winmodems, softmodems, hcf or any other modem that relies on the host to do any sort of soft control for any aspect of the modem's function. There are two modems known to work: 3COM FaxModem PCI. ActionTec 56k VoiceMessaging PCI Modem and the following modem might work Multitech PCI FaxModem (not sure about this) and the serial pci cards might work too. I have neither these hardware items so I can't add support for them. Notes: svn path=/head/; revision=58885
* Recognize USR3050 "U.S. Robotics 56K FAX INT" fax modem.Peter Wemm2000-03-311-0/+1
| | | | | | | | PR: 17702 Submitted by: Scot W. Hetzel <hetzels@westbend.net> Notes: svn path=/head/; revision=58848
* Isolate the Timecounter internals in their own two files.Poul-Henning Kamp2000-03-201-0/+1
| | | | | | | | | | | | | | | | | | Make the public interface more systematically named. Remove the alternate method, it doesn't do any good, only ruins performance. Add counters to profile the usage of the 8 access functions. Apply the beer-ware to my code. The weird +/- counts are caused by two repocopies behind the scenes: kern/kern_clock.c -> kern/kern_tc.c sys/time.h -> sys/timetc.h (thanks peter!) Notes: svn path=/head/; revision=58377
* Fix crashes on card eject for pccard modems. We check for NULL whenWarner Losh2000-03-111-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | we get the com address. If so, we go ahead and return. Bruce thinks there's a bug in the pccard layer that it terminates devices with extreme prejustice rather than letting them deside for themselves when to terminate (and he's likely right). This fix doesn't change that, but instead works around it by checking for NULL pointers at more places than before. The detach routine still calls functions at interrupt level that aren't reentrant. In theory this could cause a problem, but none showed up in practice. Future versions should correct this problem, likely by making the detach process a thread/process at the pccard level. NEWCARD will do this, and the current pccard layer should likely be modified to that as well, should it live long enough. A few style nits of the same form that were in my original patch sent off to bde were also fixed as part of this process. Mostly use of !ptr and return ENOPARENS. This should prevent a crash on suspend with an active ppp link as well, but that wasn't tested. Reviewed by: bde Approved by: jkh Notes: svn path=/head/; revision=57915
* Recognize another modem, "PMC2430 - Pace 56 Voice Internal Modem"Peter Wemm2000-03-051-0/+1
| | | | | | | Submitted by: Mark Ovens <mark@ukug.uk.freebsd.org> Notes: svn path=/head/; revision=57769
* Fix two more problems with freeing the softc data manually. subr_bus.cPeter Wemm2000-03-021-2/+0
| | | | | | | | | | | | is responsible for this and this will lead to malloc 'freeing already free' type panics. One was in the probe code, the other was in the pccard eject? code. Not explicitly approved by: jkh (but the first is fallout from subr_bus.c rev 1.54 which was an approved commit, the second is the same problem) Notes: svn path=/head/; revision=57680
* Fixed regressions in rev.1.274:Bruce Evans2000-02-151-11/+15
| | | | | | | | | | | | | | | | | | | 1) Non-AST4 multiport cards were broken by bypassing the code that changes `idev' to the multiport master device. 2) AST4 multiport cards apparently were broken by inverting the test for the master device having an irq. 3) Error handling for nonexistent master devices was broken by removing a check for a null pointer. 4) `int' error codes returned by bus_get_resource() were assigned directly to the boolean variable com->no_irq. Probably harmless, since the boolean is implemented as a u_char. Submitted by: part 1) by Chris Radek <cradek@in221.inetnebr.com> part 2) by yokota Approved by: jkh Notes: svn path=/head/; revision=57234
* "Completed" the previous fix. Return ENOMEM on memory allocation failureBruce Evans2000-01-291-1/+8
| | | | | | | | in sioattach(), not ENXIO. Free resources before returning early in sioprobe() and sioattach(). Notes: svn path=/head/; revision=56788
* Return ENXIO on error, not 0. Seems to have been skipped when convertingNick Hibma2000-01-231-1/+1
| | | | | | | | | to newbus. Reviewed by: bde Notes: svn path=/head/; revision=56461
* Add another four device ID's for isa pnp modems. The USR's seem to usePeter Wemm2000-01-181-0/+7
| | | | | | | | | | the same vendor and logical ID. The rest I am not sure whether they are vendor or logical, but it won't hurt if I've put a vendor ID here as merely will not match. These came from the old sio-pnp code, hence the uncertainty about which ID it is. Notes: svn path=/head/; revision=56229
* Make this compile on alphaAndrew Gallatin2000-01-131-1/+1
| | | | Notes: svn path=/head/; revision=55868
* Add a new mechanism, cndbctl(), to tell the console driver thatKazutaka YOKOTA2000-01-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | ddb is entered. Don't refer to `in_Debugger' to see if we are in the debugger. (The variable used to be static in Debugger() and wasn't updated if ddb is entered via traps and panic anyway.) - Don't refer to `in_Debugger'. - Add `db_active' to i386/i386/db_interface.d (as in alpha/alpha/db_interface.c). - Remove cnpollc() stub from ddb/db_input.c. - Add the dbctl function to syscons, pcvt, and sio. (The function for pcvt and sio is noop at the moment.) Jointly developed by: bde and me (The final version was tweaked by me and not reviewed by bde. Thus, if there is any error in this commit, that is entirely of mine, not his.) Some changes were obtained from: NetBSD Notes: svn path=/head/; revision=55823
* Recognize the GVC0505 (GVC 56k Faxmodem) as a sio device.Peter Wemm1999-12-271-0/+1
| | | | | | | Obtained from: Dan J Fraser <dfraser@capybara.org> (for NetBSD) Notes: svn path=/head/; revision=55124
* Extract a list of extra isa pnp modem ID's from NetBSD and OpenBSD. SomePeter Wemm1999-12-211-7/+47
| | | | | | | | | | of these are bound to have a PNP05xx compatid, but there's no easy way to tell. Since it's just an ID list and uses the pnp header's description strings rather than encoding strings here, it doesn't seem to be too expensive to err on the safe side. Notes: svn path=/head/; revision=54944
* Add SUP2070 (Diamond SupraExpress 56i)Peter Wemm1999-12-201-0/+2
| | | | | | | | | | Submitted by: Kenneth Wayne Culver <culverk@wam.umd.edu> Add MOT4560 Obtained from: wollman Notes: svn path=/head/; revision=54920
* o Make pccard work at all by including card.hWarner Losh1999-12-101-12/+18
| | | | | | | | | | | | | | | | o fix return type of sio_pccard_detach o don't free softc in deatch, since that is done by newbus o disconnect interrupt we used to have. Add cookie to com so that we can tear down the interrupt on unload o Set gone earlier, but likely doesn't matter This makes sio pccards work again. Cards that are active when ejects may not work (but they might, softc goes away quickly). These changes are unreviewed by bde. I'll make any style changes he wants. Notes: svn path=/head/; revision=54386