summaryrefslogtreecommitdiffstats
path: root/sys/kern/device_if.m
Commit message (Collapse)AuthorAgeFilesLines
* Import the 'iflib' API library for network drivers. From the author:scottl2016-05-181-0/+26
| | | | | | | | | | | | | | | "iflib is a library to eliminate the need for frequently duplicated device independent logic propagated (poorly) across many network drivers." Participation is purely optional. The IFLIB kernel config option is provided for drivers that want to transition between legacy and iflib modes of operation. ixl and ixgbe driver conversions will be committed shortly. We hope to see participation from the Broadcom and maybe Chelsio drivers in the near future. Submitted by: mmacy@nextbsd.org Reviewed by: gallatin Differential Revision: D5211
* Change the default method for device_quiesce() to return 0 instead ofjhb2015-01-081-1/+1
| | | | | | | | | EOPNOTSUPP. The current behavior can mask real quiesce errors since devclass_quiesce_driver() stops iterating over drivers as soon as it gets an error (incluiding EOPNOTSUPP), but the caller it returns the error to explicitly ignores EOPNOTSUPP. Reviewed by: imp
* Revert r239178 and implement two new functions, namelyhselasky2012-08-151-11/+0
| | | | | | | | | | | "device_free_softc()" and "device_claim_softc()", to allow USB serial drivers refcounting the softc. These functions are used to grab the softc from auto-free and to free the softc back to the correct malloc type, respectivly. Discussed with: jhb MFC after: 2 weeks
* Add new device method to free the automaticallyhselasky2012-08-101-0/+11
| | | | | | | | | | | | | | | allocated softc structure which is returned by device_get_softc(). This method can be used to easily implement softc refcounting. This can be desirable when the softc has memory references which are controlled by userspace handles for example. This solves the problem of blocking the caller of device_detach() for a non-deterministic time. Discussed with: kib, ed MFC after: 2 weeks
* Update comments for DEVICE_PROBE() to reflect that BUS_PROBE_DEFAULT isjhb2011-05-241-9/+11
| | | | | | | | | now the preferred typical return value from a probe routine. Discourage the use of 0 (BUS_PROBE_SPECIFIC) as it should be used very rarely. Point the reader to the DEVICE_PROBE(9) manpage for more detailed notes on possible probe return values. Submitted by: Philip Soeberg philip-dev of soeberg net
* /* -> /*- for copyright notices, minor format tweaks as necessaryimp2005-01-061-1/+1
|
* Implement device_quiesce. This method means 'you are about to beimp2004-12-311-0/+31
| | | | | | | | 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.
* Minor formatting fixes for lines > 80 charactersimp2004-08-121-22/+23
|
* Expand and rewrite documentation using doxygen markup so that we candfr2004-07-111-49/+206
| | | | generate funky web pages from it.
* * Factor out the object system from new-bus so that it can be used bydfr2000-04-081-0/+2
| | | | | | | | | | non-device code. * Re-implement the method dispatch to improve efficiency. The new system takes about 40ns for a method dispatch on a 300Mhz PII which is only 10ns slower than a direct function call on the same hardware. This changes the new-bus ABI slightly so make sure you re-compile any driver modules which you use.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Update the comments on values than can be returned by DEVICE_PROBE.n_hibma1999-06-171-8/+9
| | | | | | DEVICE_PROBE can return priorities. Reviewed by: Doug Rabson <dfr@nlsystems.com>
* * Define a new static method DEVICE_IDENTIFY which is called to add devicedfr1999-05-141-1/+9
| | | | | | | | | | instances to a parent bus. * Define a new method BUS_ADD_CHILD which can be called from DEVICE_IDENTIFY to add new instances. * Add a generic implementation of DEVICE_PROBE which calls DEVICE_IDENTIFY for each driver attached to the parent's devclass. * Move the hint-based isa probe from the isa driver to a new isahint driver which can be shared between i386 and alpha.
* * Augment the interface language to allow arbitrary C code to be 'passeddfr1999-05-101-5/+38
| | | | | | | | | | through' to the C compiler. * Allow the interface to specify a default implementation for methods. * Allow 'static' methods which are not device specific. * Add a simple scheme for probe routines to return a priority value. To make life simple, priority values are negative numbers (positive numbers are standard errno codes) with zero being the highest priority. The driver which returns the highest priority will be chosen for the device.
* My changes to the new device interface:wollman1998-11-141-1/+15
| | | | | | | | | | | | | | - Interface wth the new resource manager. - Allow for multiple drivers implementing a single devclass. - Remove ordering dependencies between header files. - Style cleanup. - Add DEVICE_SUSPEND and DEVICE_RESUME methods. - Move to a single-phase interrupt setup scheme. Kernel builds on the Alpha are brken until Doug gets a chance to incorporate these changes on that side. Agreed to in principle by: dfr
* Add semicolon to INTERFACE declarationsnsouch1998-11-081-2/+2
|
* [Add missing files from previous commit]dfr1998-06-141-0/+69
Major changes to the generic device framework for FreeBSD/alpha: * Eliminate bus_t and make it possible for all devices to have attached children. * Support dynamically extendable interfaces for drivers to replace both the function pointers in driver_t and bus_ops_t (which has been removed entirely. Two system defined interfaces have been defined, 'device' which is mandatory for all devices and 'bus' which is recommended for all devices which support attached children. * In addition, the alpha port defines two simple interfaces 'clock' for attaching various real time clocks to the system and 'mcclock' for the many different variations of mc146818 clocks which can be attached to different alpha platforms. This eliminates two more function pointer tables in favour of the generic method dispatch system provided by the device framework. Future device interfaces may include: * cdev and bdev interfaces for devfs to use in replacement for specfs and the fixed interfaces bdevsw and cdevsw. * scsi interface to replace struct scsi_adapter (not sure how this works in CAM but I imagine there is something similar there). * various tailored interfaces for different bus types such as pci, isa, pccard etc.
OpenPOWER on IntegriCloud