summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_bus.c
Commit message (Collapse)AuthorAgeFilesLines
* Add doxygen doc comments for most of newbus and the BUS interface.dfr2004-07-181-46/+919
|
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-151-0/+5
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Hide struct resource and struct rman. You must defineimp2004-06-301-0/+1
| | | | | | __RMAN_RESOURCE_VISIBLE to see inside these now. Reviewed by: dfr, njl (not njr)
* Include more information about the device in the devadded andimp2004-06-301-2/+38
| | | | | | | | devremoved events. This reduces the races around these events. We now include the pnp info in both. This lets one do more interesting thigns with devd on device insertion. Submitted by: Bernd Walter
* Turns out that jhb didn't really like this. And nate pointed out thatimp2004-06-281-2/+2
| | | | | | it wasn't a good idea to have the test for NULL on only a limited subset. Go back because I'm not sure adding NULL to all the others is a good idea.
* Allow dev to be NULL and assume that a device is not alive or notimp2004-06-281-2/+2
| | | | | | attached. Reviewed by: njl(?) and jhb
* Do the dreaded s/dev_t/struct cdev */phk2004-06-161-6/+6
| | | | Bump __FreeBSD_version accordingly.
* When we don't have any meaningful value to print for the device sysctlmux2004-06-051-8/+4
| | | | | | | | | tree, output an empty string instead of "?". This is already what happened with DEVICE_SYSCTL_LOCATION and DEVICE_SYSCTL_PNPINFO. This makes the output of "sysctl dev" much nicer (it won't display those empty sysctls). Reviewed by: des
* Add a devclass level to the dev sysctl tree, in order to support per-des2004-06-041-10/+64
| | | | | | class variables in addition to per-device variables. In plain English, this means that dev.foo0.bar is now called dev.foo.0.bar, and it is possible to to have dev.foo.bar as well.
* As discussed on arch@, flatten the device sysctl tree to make itmux2004-06-021-13/+12
| | | | | more convenient to deal with. The notion of hierarchy is however preserved by adding a new %parent node.
* Sysctl hw.bus.devctl_disable shouldn't be writtable from inside a jail.pjd2004-05-261-3/+2
| | | | Approved by: imp
* As previously threatened, give each device its own sysctl context anddes2004-05-251-29/+153
| | | | | subtree (under the new dev top-level node). This should greatly simplify drivers which need per-device sysctl variables (such as ndis).
* Don't print out 'GIANT-LOCKED' for INTR_FAST drivers.scottl2004-04-011-1/+1
|
* Conform to local file sytle and prefer (a && (b & flag)).imp2004-03-241-1/+1
|
* Change the !MPSAFE boot string to something that doesn't potentiallyobrien2004-03-231-1/+1
| | | | scare users that the kernel won't run on MP systems.
* Rather than display which interrupts are MPSAFE, display those that aren't.obrien2004-03-221-1/+3
| | | | | This way we can take stock of the work to be done. boot -v will note those interrupts that are MPSAFE.
* Whitespace cleanupdes2004-02-241-4/+4
|
* Device megapatch 4/6:phk2004-02-211-0/+2
| | | | | | | | Introduce d_version field in struct cdevsw, this must always be initialized to D_VERSION. Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
* o make debug_mpsafenet globally visiblesam2003-11-051-10/+0
| | | | | | | | o move it from subr_bus.c to netisr.c where it more properly belongs o add NET_PICKUP_GIANT and NET_DROP_GIANT macros that will be used to grab Giant as needed when MPSAFE operation is enabled Supported by: FreeBSD Foundation
* Minor style(9) nitimp2003-11-051-8/+8
|
* disable MPSAFE network drivers; we aren't ready yet`sam2003-11-041-1/+1
|
* Add a temporary mechanism to disble INTR_MPSAFE from network interfacesam2003-10-291-0/+13
| | | | | drivers. This is prepatory to running more parts of the network system w/o Giant.
* Convenience functions to generate notifications from the kernel. The ACPIimp2003-10-241-19/+61
| | | | | | code will start using these shortly. Reviewed by: njl
* * Add multiple inheritance to kobj. Each class can have zero or more basedfr2003-10-161-66/+102
| | | | | | | | | | | | | | | | | | | | | | | | classes and if a method is not found in a given class, its base classes are searched (in the order they were declared). This search is recursive, i.e. a method may be define in a base class of a base class. * Change the kobj method lookup algorithm to one which is SMP-safe. This relies only on the constraint that an observer of a sequence of writes of pointer-sized values will see exactly one of those values, not a mixture of two or more values. This assumption holds for all processors which FreeBSD supports. * Add locking to kobj class initialisation. * Add a simpler form of 'inheritance' for devclasses. Each devclass can have a parent devclass. Searches for drivers continue up the chain of devclasses until either a matching driver is found or a devclass is reached which has no parent. This can allow, for instance, pci drivers to match cardbus devices (assuming that cardbus declares pci as its parent devclass). * Increment __FreeBSD_version. This preserves the driver API entirely except for one minor feature used by the ISA compatibility shims. A workaround for ISA compatibility will be committed separately. The kobj and newbus ABI has changed - all modules must be recompiled.
* With DIAGNOSTICS, sometimes we get weird crashes when some driverimp2003-10-141-3/+4
| | | | | | | | accesses softc after it is freed. Use a different malloc type for softc than the rest of the bus code to make it more clear when these things happen that it is the driver that's at fault, not the bus code. Suggested by: sam and/or phk (I think)
* Introduce BUS_CONFIG_INTR(). The method allows devices to tell parentsmarcel2003-09-101-0/+11
| | | | | | | | | about interrupt trigger mode and interrupt polarity. This allows ACPI for example to pass interrupt resource information up the hierarchy. The default implementation of the method therefore is to pass the request to the parent. Reviewed by: jhb, njl
* Print a message at boot for interrupt handlers created with INTR_MPSAFEsam2003-09-051-4/+14
| | | | | | and/or INTR_FAST. This belongs elsehwere and perhaps under bootverbose; I'm committing it for now as it's uesful to know which drivers have been converted and which have not.
* Use __FBSDID().obrien2003-06-111-2/+3
|
* Fix some easy, global, lint warnings. In most cases, this meansmarkm2003-04-301-2/+2
| | | | | making some local variables static. In a couple of cases, this means removing an unused variable.
* 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.
OpenPOWER on IntegriCloud