summaryrefslogtreecommitdiff
path: root/sys/dev/sio
Commit message (Collapse)AuthorAgeFilesLines
* Remove sio(4).Gleb Smirnoff2019-11-217-3236/+0
| | | | | | | | | It had been disconnected from build in r181233 in 2008. Reviewed by: imp Notes: svn path=/head/; revision=354929
* Remove All Rights ReservedWarner Losh2019-02-054-4/+4
| | | | | | | | Remove the all rights reserved clause from my copyright, and make other minor tweaks needed where that might have created ambiguity. Notes: svn path=/head/; revision=343811
* Move most of the contents of opt_compat.h to opt_global.h.Brooks Davis2018-04-061-1/+0
| | | | | | | | | | | | | | | | | | | | | opt_compat.h is mentioned in nearly 180 files. In-progress network driver compabibility improvements may add over 100 more so this is closer to "just about everywhere" than "only some files" per the guidance in sys/conf/options. Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h is created on all architectures. Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the set of compiled files. Reviewed by: kib, cem, jhb, jtl Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14941 Notes: svn path=/head/; revision=332122
* kernel: Fix several typos and minor errorsEitan Adler2017-12-271-1/+1
| | | | | | | | | | | - duplicate words - typos - references to old versions of FreeBSD Reviewed by: imp, benno Notes: svn path=/head/; revision=327231
* Create a new ISA_PNP_INFO macro. Use this macro every where we haveWarner Losh2017-12-231-0/+1
| | | | | | | | | | ISA PNP card support (replace by hand version in if_ed). Move module declarations to the end of some files. Fix PCCARD_PNP_INFO to use nitems(). Remove some stale comments about pc98, turns out the comment was simply wrong. Notes: svn path=/head/; revision=327102
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-274-0/+8
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-203-0/+6
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326022
* Renumber copyright clause 4Warner Losh2017-02-283-3/+3
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-284-39/+2
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* sys/dev: use our nitems() macro when it is avaliable through param.h.Pedro F. Giffuni2016-04-191-1/+1
| | | | | | | | | | No functional change, only trivial cases are done in this sweep, Drivers that can get further enhancements will be done independently. Discussed in: freebsd-current Notes: svn path=/head/; revision=298307
* Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().Justin Hibbits2016-02-271-4/+4
| | | | | | | | | | | Most calls to bus_alloc_resource() use "anywhere" as the range, with a given count. Migrate these to use the new bus_alloc_resource_anywhere() API. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D5370 Notes: svn path=/head/; revision=296137
* Pull in r267961 and r267973 again. Fix for issues reported will follow.Hans Petter Selasky2014-06-281-1/+1
| | | | Notes: svn path=/head/; revision=267992
* Revert r267961, r267973:Glen Barber2014-06-271-1/+1
| | | | | | | | | | | | | These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory Notes: svn path=/head/; revision=267985
* Extend the meaning of the CTLFLAG_TUN flag to automatically check ifHans Petter Selasky2014-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel. Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change. MFC after: 2 weeks Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=267961
* Add support for CIR1000 - Cirrus Logic V34 to the sio driverEitan Adler2012-11-131-0/+1
| | | | | | | | | | | PR: kern/44267 Submitted by: Michail Vidiassov <master@iaas.msu.ru> Arrival-Date: Sat Oct 19 07:30:00 PDT 2002 Approved by: cperciva (implicit) MFC after: 1 week Notes: svn path=/head/; revision=242996
* Document some MP assumptions for sio.Warner Losh2012-06-281-0/+5
| | | | | | | Submitted by: bde (years ago) Notes: svn path=/head/; revision=237693
* kern cons: introduce infrastructure for console grabbing by kernelAndriy Gapon2011-12-171-0/+12
| | | | | | | | | | | | | | | At the moment grab and ungrab methods of all console drivers are no-ops. Current intended meaning of the calls is that the kernel takes control of console input. In the future the semantics may be extended to mean that the calling thread takes full ownership of the console (e.g. console output from other threads could be suspended). Inspired by: bde MFC after: 2 months Notes: svn path=/head/; revision=228631
* - add support for Broadcom 802.11bg/EDGE/GPRS CardBus (Serial)Eitan Adler2011-11-151-1/+2
| | | | | | | | | | | | - correct mislabeling of 0x432214e4 device PR: kern/119606 Submitted by: Joe Greco <jgreco@ns.sol.net> Approved by: jhb MFC after: 1 week Notes: svn path=/head/; revision=227532
* Follow up to r225203 refining break-to-debugger run-time configurationRobert Watson2011-08-271-1/+0
| | | | | | | | | | | | | | | improvements: (1) Implement new model in previously missed at91 UART driver (2) Move BREAK_TO_DEBUGGER and ALT_BREAK_TO_DEBUGGER from opt_comconsole.h to opt_kdb.h (spotted by np) (3) Garbage collect now-unused opt_comconsole.h MFC after: 3 weeks Approved by: re (bz) Notes: svn path=/head/; revision=225214
* Attempt to make break-to-debugger and alternative break-to-debugger moreRobert Watson2011-08-261-29/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | accessible: (1) Always compile in support for breaking into the debugger if options KDB is present in the kernel. (2) Disable both by default, but allow them to be enabled via tunables and sysctls debug.kdb.break_to_debugger and debug.kdb.alt_break_to_debugger. (3) options BREAK_TO_DEBUGGER and options ALT_BREAK_TO_DEBUGGER continue to behave as before -- only now instead of compiling in break-to-debugger support, they change the default values of the above sysctls to enable those features by default. Current kernel configurations should, therefore, continue to behave as expected. (4) Migrate alternative break-to-debugger state machine logic out of individual device drivers into centralised KDB code. This has a number of upsides, but also one downside: it's now tricky to release sio spin locks when entering the debugger, so we don't. However, similar logic does not exist in other device drivers, including uart. (5) dcons requires some special handling; unlike other console types, it allows overriding KDB's own debugger selection, so we need a new interface to KDB to allow that to work. GENERIC kernels in -CURRENT will now support break-to-debugger as long as appropriate boot/run-time options are set, which should improve the debuggability of BETA kernels significantly. MFC after: 3 weeks Reviewed by: kib, nwhitehorn Approved by: re (bz) Notes: svn path=/head/; revision=225203
* Based on discussions on the svn-src mailing list, rework r218195:Matthew D Fleming2011-02-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | - entirely eliminate some calls to uio_yeild() as being unnecessary, such as in a sysctl handler. - move should_yield() and maybe_yield() to kern_synch.c and move the prototypes from sys/uio.h to sys/proc.h - add a slightly more generic kern_yield() that can replace the functionality of uio_yield(). - replace source uses of uio_yield() with the functional equivalent, or in some cases do not change the thread priority when switching. - fix a logic inversion bug in vlrureclaim(), pointed out by bde@. - instead of using the per-cpu last switched ticks, use a per thread variable for should_yield(). With PREEMPTION, the only reasonable use of this is to determine if a lock has been held a long time and relinquish it. Without PREEMPTION, this is essentially the same as the per-cpu variable. Notes: svn path=/head/; revision=218424
* remove now-redunant cardbus attachment.Warner Losh2009-03-091-1/+0
| | | | Notes: svn path=/head/; revision=189575
* Allow device hints to wire the unit numbers of devices.John Baldwin2008-11-182-60/+0
| | | | | | | | | | | | | | | | | | | | | | | - An "at" hint now reserves a device name. - A new BUS_HINT_DEVICE_UNIT method is added to the bus interface. When determining the unit number of a device, this method is invoked to let the bus driver specify the unit of a device given a specific devclass. This is the only way a device can be given a name reserved via an "at" hint. - Implement BUS_HINT_DEVICE_UNIT() for the acpi(4) and isa(4) bus drivers. Both of these busses implement this by comparing the resources for a given hint device with the resources enumerated by ACPI/PnPBIOS and wire a unit if the hint resources are a subset of the "real" resources. - Use bus_hinted_children() for adding hinted devices on isa(4) busses now instead of doing it by hand. - Remove the unit kludging from sio(4) as it is no longer necessary. Prodding from: peter, imp OK'd by: marcel MFC after: 1 month Notes: svn path=/head/; revision=185059
* Add a note about a bug in how sio manages its softc. This wasWarner Losh2008-10-081-0/+15
| | | | | | | | discovered by Dorr H. Clark. I'm not at all sure how to fix it, but wanted to document it at the very least... Notes: svn path=/head/; revision=183692
* Expand kdb_alt_break a little, most commonly used with the optionPeter Wemm2008-05-041-3/+23
| | | | | | | | | | | | | | | | | | | | | | ALT_BREAK_TO_DEBUGGER. In addition to "Enter ~ ctrl-B" (to enter the debugger), there is now "Enter ~ ctrl-P" (force panic) and "Enter ~ ctrl-R" (request clean reboot, ala ctrl-alt-del on syscons). We've used variations of this at work. The force panic sequence is best used with KDB_UNATTENDED for when you just want it to dump and get on with it. The reboot request is a safer way of getting into single user than a power cycle. eg: you've hosed the ability to log in (pam, rtld, etc). It gives init the reboot signal, which causes an orderly reboot. I've taken my best guess at what the !x86 and non-sio code changes should be. This also makes sio release its spinlock before calling KDB/DDB. Notes: svn path=/head/; revision=178766
* Add a new 'why' argument to kdb_enter(), and a set of constants to useRobert Watson2007-12-251-2/+4
| | | | | | | | | | | | for that argument. This will allow DDB to detect the broad category of reason why the debugger has been entered, which it can use for the purposes of deciding which DDB script to run. Assign approximate why values to all current consumers of the kdb_enter() interface. Notes: svn path=/head/; revision=174898
* Stop serial console and gdb serial port from getting all screwed up.Julian Elischer2007-12-051-1/+1
| | | | | | | | | PR: 65278 MFC in: 3 days Submitted by: ups@ Notes: svn path=/head/; revision=174283
* Allow the sio acpi attachment to be disabled (ie: use hints only). ThisPeter Wemm2007-11-301-0/+4
| | | | | | | | | | | | | hack means you can get the units and flags to match up more easily with serial consoles on machines with acpi tables that cause the com ports to be probed in the wrong order (and hence get the wrong sio unit number). This replaces the common alternative hack of editing the code to comment out the acpi attachment. This could go away entirely when device wiring patches are committed. Notes: svn path=/head/; revision=174116
* Add sio_puc_kludge_unit() to stop sio devices originating from pucPeter Wemm2007-11-301-0/+29
| | | | | | | | | | stomping on the units intended for the motherboard sio ports. This is no real substitute for the not-yet-committed device wiring enhancements. Code taken from sio's pci attachment. Notes: svn path=/head/; revision=174115
* Spelling fix for interupt -> interruptKevin Lo2007-10-121-1/+1
| | | | Notes: svn path=/head/; revision=172568
* o Revert last. The chip is already supported by puc(4).Maxim Konovalov2007-03-291-1/+0
| | | | | | | Pointed out by: marcel, Joseph Terner Notes: svn path=/head/; revision=168015
* o Add MosChip 9835 PCI Dual UART PCI id.Maxim Konovalov2007-03-281-0/+1
| | | | | | | | | PR: kern/110967 Submitted by: Joseph Terner MFC after: 1 month Notes: svn path=/head/; revision=168002
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-5/+7
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* Only treat positive values as errors...John-Mark Gurney2006-09-141-1/+1
| | | | | | | | Pointed out by: wsk Message-ID: <45060FC4.2090308@gddsn.org.cn> Notes: svn path=/head/; revision=162294
* Restore the status quo before my last commit. Prior to it, sio tookWarner Losh2006-07-171-2/+2
| | | | | | | | | | | | precedence uart. With my last change, it became a tie, and uart seems to always win on my amd64. This was not my intention, so have sio be just a tiny bit more preferred than uart. Note: I'm not making any judgement on the merits of uart winning. I'm just saying that if we want to change it, we do it on purpose. Notes: svn path=/head/; revision=160420
* Have sio return BIS_PROBE_DEFAULT like all the other drivers in theWarner Losh2006-06-301-2/+2
| | | | | | | | | | | | | | | tree... John Baldwin noted that sio might pass values between probe and attach via softc. It appears that sio does leave the hardware in a known state after probing, so other drivers that try to probe might leave it in a worse state. It doesn't seem to pass any data in softc, however, that I could find... I think we should not be probing for anything but nonPnP isa, but that's a change for another day. Submitted by: Frank Behrens PR: 87845 Notes: svn path=/head/; revision=160046
* Eliminate gdb_checkc member from GDB_DBGPORT(), it is never used.Poul-Henning Kamp2006-05-261-8/+2
| | | | | | | | Use polling behaviour for gdb_getc() where convenient, this edges us closer to the console code. Notes: svn path=/head/; revision=158950
* Convert to use CONSOLE_DRIVER() macro:Poul-Henning Kamp2006-05-261-43/+9
| | | | | | | Remove cngetc, rename cncheckc to cngetc (fix GDB console accordingly) Notes: svn path=/head/; revision=158947
* Insert a '_' in the console function names to be more consistent withPoul-Henning Kamp2006-05-261-17/+17
| | | | | | | the future. Notes: svn path=/head/; revision=158943
* Rewrite of puc(4). Significant changes are:Marcel Moolenaar2006-04-281-11/+18
| | | | | | | | | | | | | | | | | | | | | | | o Properly use rman(9) to manage resources. This eliminates the need to puc-specific hacks to rman. It also allows devinfo(8) to be used to find out the specific assignment of resources to serial/parallel ports. o Compress the PCI device "database" by optimizing for the common case and to use a procedural interface to handle the exceptions. The procedural interface also generalizes the need to setup the hardware (program chipsets, program clock frequencies). o Eliminate the need for PUC_FASTINTR. Serdev devices are fast by default and non-serdev devices are handled by the bus. o Use the serdev I/F to collect interrupt status and to handle interrupts across ports in priority order. o Sync the PCI device configuration to include devices found in NetBSD and not yet merged to FreeBSD. o Add support for Quatech 2, 4 and 8 port UARTs. o Add support for a couple dozen Timedia serial cards as found in Linux. Notes: svn path=/head/; revision=158124
* - Use bus_setup_intr() and bus_teardown_intr() to register device driverJohn Baldwin2006-02-221-2/+2
| | | | | | | | | | | | | interrupt handlers rather than BUS_SETUP_INTR() and BUS_TEARDOWN_INTR(). Uses of the BUS_*() versions in the implementation of foo_intr methods in bus drivers were not changed. Mostly this just means that some drivers might start printing diagnostic messages like [FAST] when appropriate as well as honoring mpsafenet=0. - Fix two more of the ppbus drivers' identify routines to function correctly in the mythical case of a machine with more than one ppbus. Notes: svn path=/head/; revision=155921
* Use __DEVOLATILE to cast conspeed.Warner Losh2005-12-071-1/+1
| | | | Notes: svn path=/head/; revision=153195
* Reorganize the interrupt handling code a bit to make a few things cleanerJohn Baldwin2005-10-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and increase flexibility to allow various different approaches to be tried in the future. - Split struct ithd up into two pieces. struct intr_event holds the list of interrupt handlers associated with interrupt sources. struct intr_thread contains the data relative to an interrupt thread. Currently we still provide a 1:1 relationship of events to threads with the exception that events only have an associated thread if there is at least one threaded interrupt handler attached to the event. This means that on x86 we no longer have 4 bazillion interrupt threads with no handlers. It also means that interrupt events with only INTR_FAST handlers no longer have an associated thread either. - Renamed struct intrhand to struct intr_handler to follow the struct intr_foo naming convention. This did require renaming the powerpc MD struct intr_handler to struct ppc_intr_handler. - INTR_FAST no longer implies INTR_EXCL on all architectures except for powerpc. This means that multiple INTR_FAST handlers can attach to the same interrupt and that INTR_FAST and non-INTR_FAST handlers can attach to the same interrupt. Sharing INTR_FAST handlers may not always be desirable, but having sio(4) and uhci(4) fight over an IRQ isn't fun either. Drivers can always still use INTR_EXCL to ask for an interrupt exclusively. The way this sharing works is that when an interrupt comes in, all the INTR_FAST handlers are executed first, and if any threaded handlers exist, the interrupt thread is scheduled afterwards. This type of layout also makes it possible to investigate using interrupt filters ala OS X where the filter determines whether or not its companion threaded handler should run. - Aside from the INTR_FAST changes above, the impact on MD interrupt code is mostly just 's/ithread/intr_event/'. - A new MI ddb command 'show intrs' walks the list of interrupt events dumping their state. It also has a '/v' verbose switch which dumps info about all of the handlers attached to each event. - We currently don't destroy an interrupt thread when the last threaded handler is removed because it would suck for things like ppbus(8)'s braindead behavior. The code is present, though, it is just under #if 0 for now. - Move the code to actually execute the threaded handlers for an interrrupt event into a separate function so that ithread_loop() becomes more readable. Previously this code was all in the middle of ithread_loop() and indented halfway across the screen. - Made struct intr_thread private to kern_intr.c and replaced td_ithd with a thread private flag TDP_ITHREAD. - In statclock, check curthread against idlethread directly rather than curthread's proc against idlethread's proc. (Not really related to intr changes) Tested on: alpha, amd64, i386, sparc64 Tested on: arm, ia64 (older version of patch by cognet and marcel) Notes: svn path=/head/; revision=151658
* Eliminate two unused arguments to ttycreate().Poul-Henning Kamp2005-10-161-1/+1
| | | | Notes: svn path=/head/; revision=151383
* 'PC Card' instead of other variantsWarner Losh2005-09-221-2/+2
| | | | Notes: svn path=/head/; revision=150460
* Last change to this file actually removed the oldcard compat code.Warner Losh2005-09-191-2/+1
| | | | | | | This change removes one last K&Rism. Notes: svn path=/head/; revision=150307
* Make sure that we call if_free(ifp) after bus_teardown_intr. Since weWarner Losh2005-09-191-21/+9
| | | | | | | | | | could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call. Notes: svn path=/head/; revision=150306
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-295-5/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* Oops, revert a commit that snuck in with the earlier critical sectionJohn Baldwin2005-04-051-1/+0
| | | | | | | | | changes. Noticed by: bde Notes: svn path=/head/; revision=144677