summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_bus.c
Commit message (Collapse)AuthorAgeFilesLines
* Create a new function, device_is_attached(), that is likeimp2003-04-211-0/+6
| | | | | | device_is_alive() that tells us if the device has successfully attached. device_is_alive just tells us that the device has successfully probed.
* Fix /dev/devctl's implementation of poll. We should only be settingimp2003-04-211-11/+5
| | | | | | | | the poll bits when there's actually something in the queue. Otherwise, select always returned '2' when there were no items to be read, and '3' when there were. This would preclude being able to read in a threaded (libc_r) program, as well as checking to see if there were pending events or not.
* Lock the process before sending it a SIGIO. Not doing so is a panic(2)jhb2003-04-021-2/+7
| | | | implementation with INVARIANTS.
* Make sure we actually have a dev before dereferencing in case someonealfred2003-03-131-1/+1
| | | | | botches and sends us a NULL pointer. The other code in this file seems to expect it to be able to handle it behaving this way.
* Gigacommit to improve device-driver source compatibility betweenphk2003-03-031-13/+7
| | | | | | | | | | | | | 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)
* Fix comment about what we do when there are no listeners.imp2003-01-191-13/+3
|
* Don't forget to disconnect object from class.davidxu2003-01-151-2/+3
|
* Don't record thread pointer, it's not permanent in process life cycle,davidxu2003-01-101-6/+6
| | | | use process pointer instead.
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-2/+2
| | | | especially in troff files.
* Use 0600 for permissions for /dev/devctl until it is cloneable.imp2003-01-011-1/+2
| | | | | | Use UID_ROOT and GID_WHEEL rather than 0. Prompted by: rwatson
* devd kernel improvements:imp2002-11-301-21/+38
| | | | | | | | | | | | | 1) Record all device events when devctl is enabled, rather than just when devd has devctl open. This is necessary to prevent races between when a device arrives, and when devd starts. 2) Add hw.bus.devctl_disable to disable devctl, this can also be set as a tunable. 3) Fix async support. Reset nonblocking and async_td in open. remove async flags. 4) Free all memory when devctl is disabled. Approved by: re (blanket)
* Use %z to quiet a warning.jhb2002-11-071-1/+1
|
* Use ; not , as statement separator in PDEBUG() macro.phk2002-10-151-5/+4
| | | | | | | | | | | Ignoring a NULL dev in device_set_ivars() sounds wrong, KASSERT it to non-NULL instead. Do the same for device_get_ivars() for reasons of symmetry, though it probably would have yielded a panic anyway, this gives more precise diagnostics. Absentmindedly nodded OK to by: jhb
* Introducing /dev/devctl. This device reports events in theimp2002-10-071-2/+326
| | | | | | | configuration device hierarchy. Device arrival, departure and not matched are presently reported. This will be the basis for devd, which I still need to polish a little more before I commit it. If you don't use /dev/devctl, it will be a noop.
* Two minor bugfixes:imp2002-10-071-0/+3
| | | | | | o Allow the bus_debug variable to be set via the bus.debug tunable. o Return pnpinfo and location info via the devinfo interface to userland. devinfo(8) needs to be updated to print it.
* Add wrappers around the newly created bus_child_pnpinfo_str andimp2002-10-071-2/+28
| | | | bus_child_location_str.
* Minor string handling cleanup that I've had in my tree for a while:imp2002-10-071-21/+20
| | | | | | Don't use snprintf where strlcpy() will do the job. Also, a NUL is '\0' not 0 in our style (C doesn't care), so spell it like. Remove useless {} and () in the general area of this change.
* Don't need to NUL terminate after snprintfimp2002-10-071-1/+0
|
* Absorb <sys/bus_private.h> into kern/subr_bus.c to prevent misunderstandings.phk2002-10-021-1/+75
| | | | | Suggested by: bde Approved by: dfr
* Move includ of <sys/bus_priate.h> later to get semantic identity ofphk2002-09-281-1/+1
| | | | | | | | device_t the same throughout kernel. This is a very fine point of C which fortunatly does not make any difference in normal circumstances but which due to the pervasiveness of device_t in the kernel can make a lint barf a lot.
* Add additional information returned to userland by the device queryingimp2002-09-141-0/+5
| | | | | | | | | | | | | functions. We add pnpinfo, locationinfo, devflags (the newbus flags on the device), flags (the flags that device_get_flags returns) and state to the list of things we return. pnpinfo and locationinfo are place holders at the moment that will be filled in by the device's parent (optionally). Userland programs will likely use this information from time to time and take appropriate actions. Improvements to devinfo to follow.
* Fixed style bugs in resource_list_add_next().bde2002-09-121-5/+5
|
* Include <vm/uma.h> instead of depending on namespace pollution inbde2002-09-111-7/+10
| | | | | | | <sys/malloc.h>. Sorted includes as much as possible. Removed banal comment(s) attached to includes.
* Add bus_child_present and the child_present method to bus_if.mimp2002-07-211-0/+26
|
* Don't call malloc(9) to allocate zero bytes softc data for devices.phk2002-04-231-1/+1
|
* Add resource_list_add_next() which returns the RID for the resource added.mdodd2002-03-291-0/+13
|
* Don't (blindly) truncate the unit number to 4 digits when formatting thebde2002-03-061-1/+3
| | | | string returned by device_get_nameunit().
* Fixed 3 regressions in rev.1.99 (clobbering of the English fix in rev.1.98,bde2002-02-261-3/+4
| | | | and 2 unformattings).
* Hide "bla bla exists, skipping it" behind bootverbose.sos2002-02-261-4/+4
|
* Fixed an apparent typo ("-" before ":") and an English error (commabde2001-12-281-4/+4
| | | | | | | splice) in the "already exists" message. Fixed some minor style bugs (KNFization to "return (foo)" had rotted in 2 out of 177 cases).
* Add a generic __BUS_ACCESSOR macro to construct ivar accessor functions,tmm2001-12-211-2/+30
| | | | | | | and a generic resource_list_print_type() function to print all resouces of a certain type in a resource list. Use ulmin()/ulmax() instead of min()/max() in two places to handle u_longs correctly.
* Update to C99, s/__FUNCTION__/__func__/.obrien2001-12-101-1/+1
|
* o No need to set values to 0 when we utilize M_ZEROarr2001-11-051-2/+0
| | | | Approved by: peter
* Don't hide the failure to allocate device behind boot verbose. It isimp2001-11-021-3/+2
| | | | | | | still telling us of real problems so should remain until it stops doing that. Submitted by: OGAWA Takaya <t-ogawa@triaez.kaisei.org>
* Add new interface functionache2001-11-011-0/+10
| | | | | int devclass_find_free_unit(devclass_t dc, int unit); which return first free unit in given class starting from 'unit'.
* 1) In devclass_alloc_unit(), skip duplicated wired devices (i.e. with fixedache2001-10-281-8/+8
| | | | | | | | | | | | | | number) instead of allocating next free unit for them. If someone needs fixed place, he must specify it correctly. "Allocating next" is especially bad because leads to double device detection and to "repeat make_dev panic" as result. This can happens if the same devices present somewhere on PCI bus, hints and ACPI. Making them present in one place only not always possible, "sc" f.e. can't be removed from hints, it results to no console at all. 2) In make_device(), detect when devclass_add_device() fails, free dev and return. I.e. add missing error checking. This part needed to finish fix in 1), but must be done this way in anycase, with old variant too.
* Move the hints gunk to a seperate file. It isn't really part of thepeter2001-07-141-299/+0
| | | | newbus structure (no more than subr_rman.c is anyway).
* Go back to having either static OR dynamic hints, with fallbackpeter2001-07-141-17/+42
| | | | | | | | support. Trying to fix the merged set where dynamic overrode static was getting more and more complicated by the day. This should fix the duplicate atkbd, psm, fd* etc in GENERIC. (which paniced the alpha, but not the i386)
* Hints overhaul:peter2001-06-121-465/+274
| | | | | | | | | - Replace some very poorly thought out API hacks that should have been fixed a long while ago. - Provide some much more flexible search functions (resource_find_*()) - Use strings for storage instead of an outgrowth of the rather inconvenient temporary ioconf table from config(). We already had a fallback to using strings before malloc/vm was running anyway.
* Unset the devclass if the attach fails and the devclass was not set ton_hibma2001-01-081-0/+4
| | | | | | begin with. Reviewed by: dfr
* Make this file conform mostly to style(9):imp2001-01-051-947/+939
| | | | | | | | | | | | | | | | | | | o Use 8 space hard tabs o Eliminate trailing white space (while I'm here, just in a couple of places) o wrap mostly at 80 columns (printf literal strings being the notable exception) o use return (foo) consistantly o use 0 vs NULL more consistantly o use queue(3) xxx_FOREACH macros where appropriate (some places used it before, others didn't). o use BSD line continuation parameters Pendants will likely notice minor style(9) violations, but for the most part the file now looks much much closer to style(9) and is mostly self-consistant. Approved in principle by: dfr Reviewed by: md5 (no changes to the .o)
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-14/+7
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Staticize some malloc M_ instances.phk2000-12-081-1/+1
|
* Alter the return value and arguments of the GET_RESOURCE_LIST bus method.mdodd2000-11-281-23/+17
| | | | | | | Alter consumers of this method to conform to the new convention. Minor cosmetic adjustments to bus.h. This isn't of concern as this interface isn't in use yet.
* In preparation for deprecating CIRCLEQ macros in favor of TAILQmckusick2000-11-141-4/+2
| | | | | | | macros which provide the same functionality and are a bit more efficient, convert use of CIRCLEQ's in resource manager to TAILQ's. Approved by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
* Implement a trivial but effective interface for obtaining the kernel'smsmith2000-11-091-142/+213
| | | | | | | | device tree and resource manager contents. This is the kernel side of the upcoming libdevinfo, which will expose this information to userspace applications in a trivial fashion. Remove the now-obsolete DEVICE_SYSCTLS code.
* Add new bus method 'GET_RESOURCE_LIST' and appropriate genericmdodd2000-10-181-0/+92
| | | | | | | | | | implementation. Add bus_generic_rl_{get,set,delete,release,alloc}_resource() functions which provide generic operations for devices using resource list style resource management. This should simplify a number of bus drivers. Further commits to follow.
* Initialize 'hints_loaded' to 0.mdodd2000-09-171-1/+1
| | | | This allows static hints to work properly.
* When we are picking the next available unit number, specifically saypeter2000-09-051-3/+3
| | | | | what we picked. Otherwise it is anybody's guess as to where the device ended up.
* * Remove a bogus call to kobj_init() from make_device().dfr2000-08-281-3/+6
| | | | * Add a non-empty implementation of root_print_child().
OpenPOWER on IntegriCloud