summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_bus.c
Commit message (Collapse)AuthorAgeFilesLines
* kill dead codesam2005-02-231-7/+1
| | | | Noticed by: Coverity Prevent analysis tool
* Maxunit is inclusive so fix off-by-one in previous commit.njl2005-02-081-1/+1
|
* Update device_find_child(9) to return the first matching child if unitnjl2005-02-081-5/+15
| | | | | | is set to -1. Reviewed by: dfr, imp
* Correct a minr whitespace inconsistency introduced in revision 1.159:rwatson2005-01-291-1/+1
| | | | add a tab between #define and DF_REBID instead of a space.
* Introduce bus_free_resource. It is a convenience function which wrapsimp2005-01-191-0/+8
| | | | bus_release_resource by grabbing the rid from the resource.
* Implement device_quiesce. This method means 'you are about to beimp2004-12-311-0/+101
| | | | | | | | unloaded, cleanup, or return ebusy of that's inconvenient.' The default module hanlder for newbus will now call this when we get a MOD_QUIESCE event, but in the future may call this at other times. This shouldn't change any actual behavior until drivers start to use it.
* Add the devclass_get_count(9) function and man page. It gets a count ofnjl2004-12-081-7/+19
| | | | | | | the number of devices in a devclass and is a subset of devclass_get_devices(9). Reviewed by: imp, dfr
* When panicing in device_unbusy(), actually tell what device has the issue.obrien2004-12-051-1/+2
|
* Start to add GIANT_REQUIRED; macros in places where giant is requiredimp2004-12-051-0/+6
| | | | | | | | | and that I've verified things seem to basically work. I was able to boot and hot plug usb devices. Please let me know if this causes problems for anybody. The push down of giant has proceeded to the point that this will start to matter more and more.
* Don't print the singularly unhelpful message:phk2004-11-031-1/+1
| | | | | | unknown: not probled (disabled) During verbose boot.
* Update flags patch for the !ISA case.njl2004-10-141-5/+14
| | | | | | | | | | | | * Get flags first, in case there is no devclass. * Reset flags after each probe in case the next driver has no hints so it doesn't inherit the old ones. * Set them again before the winning probe. Tested ok both with and without ACPI for ISA device flags. Reviewed by: imp MFC after: 1 day
* Set flags for devices before probing them. In the non-ISA case, flags setnjl2004-10-131-1/+5
| | | | | | | via hints were not getting passed to the child. PR: kern/72489 MFC after: 1 day
* Fix BUS_DEBUG caseimp2004-08-301-1/+1
|
* Initial support (disabled) for rebidding devices. I've been runningimp2004-08-291-4/+36
| | | | | | | | | | this in my tree for a while and in its disabled state there are no issues. It isn't enabled yet because some drivers (in acpi) have side effects in their probe routines that need to be resolved in some manner before this can be turned on. The consensus at the last developer's summit was to provide a static method for each driver class that will return characteristics of the driver, one of which is if can be reprobed idempotently.
* MFp4: Merge in the patches, submitted long ago by someone whose emailimp2004-08-291-12/+26
| | | | | | | | | address I've lost, that move the location information to the atttach routine as well. While one could use devinfo to get this data, that is difficult and error prone and subject to races for short lived devices. Would make a good MT5 candidate.
* Set the description to NULL in the right detach routine. This shouldimp2004-08-241-1/+1
| | | | | keep dangling pointers to strings in loaded modules from hanging around after the drivers are unloaded.
* 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)
OpenPOWER on IntegriCloud