Lines Matching defs:device

61 typedef TAILQ_HEAD(device_list, device) device_list_t;
75 * @brief Implementation of device.
77 struct device {
79 * A device is a kernel object. The first field must be the
87 TAILQ_ENTRY(device) link; /**< list of devices in parent */
88 TAILQ_ENTRY(device) devlink; /**< global device list membership */
89 device_t parent; /**< parent of this device */
93 * Details of this device.
96 devclass_t devclass; /**< current device class */
101 device_state_t state; /**< current device state */
103 u_int flags; /**< internal device flags */
115 #define DEVICENAME(d) ((d)? device_get_name(d): "no device")
157 static TAILQ_HEAD(,device) bus_data_devices;
174 * @brief Return the name of the device's devclass or @c NULL if there
224 * method on the root bus to kick off a new device tree scan for each
273 * @brief Find or create a device class
275 * If a device class with the name @p classname exists, return it,
276 * otherwise if @p create is non-zero create and return a new device
324 * device_probe_child() if a device exists for which there is no
341 * @brief Create a device class
343 * If a device class with the name @p classname exists, return it,
344 * otherwise create and return a new device class.
355 * @brief Find a device class
357 * If a device class with the name @p classname exists, return it,
369 * @brief Register that a device driver has been added to a devclass
371 * Register that a device driver has been added to a devclass. This
416 * @brief Add a device driver to a device class
418 * Add a device driver to a devclass. This is normally called
455 * of a device using this driver.
476 * @brief Register that a device driver has been deleted from a devclass
478 * Register that a device driver has been removed from a devclass.
483 * will return an error if a device fails to detach.
547 * @brief Delete a device driver from a device class
549 * Delete a device driver from a devclass. This is normally called
554 * device. If one of the detach calls fails, the driver will not be
603 * @brief Quiesces a set of device drivers from a device class
605 * Quiesce a device driver from a devclass. This is normally called
610 * device.
696 * @brief Find a device given a unit number
701 * @returns the device with the given unit number or @c
702 * NULL if there is no such device
713 * @brief Find the softc field of a device given a unit number
718 * @returns the softc field of the device with the given
720 * device
917 /* Ask the parent bus if it wants to wire this device. */
921 /* If we were given a wired unit number, check for existing device */
930 /* Unwired device, find the next available slot for it */
933 /* If this device slot is already in use, skip it. */
1002 * @brief Set the device's description
1015 * @brief Set the device's description
1018 * the device description is generated, (e.g. with sprintf()).
1027 * @brief Return the device's description string
1036 * @brief Return the device's softc field
1048 * @brief Set the device's softc field
1095 * @brief Get the device's ivars field
1097 * The ivars field is used by the parent device to store per-device
1098 * state (e.g. the physical location of the device or a list of
1110 * @brief Set the device's ivars field
1121 * @brief Return the device's state
1130 * @brief Set the DF_ENABLED flag for the device
1139 * @brief Clear the DF_ENABLED flag for the device
1148 * @brief Increment the busy counter for the device
1154 panic("device_busy: called for unattached device");
1163 * @brief Decrement the busy counter for the device
1170 panic("device_unbusy: called for non-busy device %s",
1182 * @brief Set the DF_QUIET flag for the device
1191 * @brief Clear the DF_QUIET flag for the device
1200 * @brief Return non-zero if the DF_QUIET flag is set on the device
1209 * @brief Return non-zero if the DF_ENABLED flag is set on the device
1218 * @brief Return non-zero if the device was successfully probed
1227 * @brief Return non-zero if the device currently has a driver
1237 * @brief Return non-zero if the device is currently suspended.
1248 * @brief Return a string containing the device's devclass name
1249 * followed by an ascii representation of the device's unit number
1260 * @brief Add a device to a devclass
1262 * A unit number is allocated for the device (using the device's
1263 * preferred unit number if any) and the device is registered in the
1264 * devclass. This allows the device to be looked up by its unit
1268 * @param dev the device to add
1307 * @brief Delete a device from a devclass
1309 * The device is removed from the devclass's device list and its unit
1313 * @param dev the device to delete
1326 panic("devclass_delete_device: inconsistent device class");
1339 * @brief Make a new device and add it as a child of @p parent
1341 * @param parent the parent of the new device
1342 * @param name the devclass name of the new device or @c NULL
1344 * @parem unit the unit number of the new device of @c -1 to
1347 * @returns the new device
1360 printf("make_device: can't find device class %s\n",
1368 dev = bsd_malloc(sizeof(struct device), 0, M_NOWAIT|M_ZERO);
1408 * @brief Print a description of a device.
1424 * @brief Create a new device
1426 * This creates a new device and adds it as a child of an existing
1427 * parent device. The new device will be added after the last existing
1430 * @param dev the device which will be the parent of the
1431 * new child device
1432 * @param name devclass name for new device or @c NULL if not
1434 * @param unit unit number for new device or @c -1 if not
1437 * @returns the new device
1460 * @brief Create a new device
1462 * This creates a new device and adds it as a child of an existing
1463 * parent device. The new device will be added after the last existing
1466 * @param dev the device which will be the parent of the
1467 * new child device
1472 * @param name devclass name for new device or @c NULL if not
1474 * @param unit unit number for new device or @c -1 if not
1477 * @returns the new device
1488 ("child device with wildcard name and specific unit number"));
1502 * The device 'place' is the first device whose order is
1509 * any existing device. Add the child to the tail of the list.
1521 * @brief Delete a device
1523 * This function deletes a device along with all of its children. If
1524 * the device currently has a driver attached to it, the device is
1527 * @param dev the parent device
1528 * @param child the device to delete
1565 * @brief Delete all children devices of the given device, if any.
1567 * This function deletes all children devices of the given device, if
1568 * any, using the device_delete_child() function for each device it
1569 * finds. If a child device cannot be deleted, this function will
1572 * @param dev the parent device
1575 * @retval non-zero a device would not detach
1598 * @brief Probe a device and attach a driver if possible
1624 * @brief Attach a device driver to a device
1628 * device's sysctl tree, optionally prints a description of the device
1629 * and queues a notification event for user-based device management
1635 * @param dev the device to initialise
1674 * 4 bits per device is a reasonable value for desktop and server
1698 * @brief Probe a device, and return this status.
1700 * This function is the core of the device autoconfiguration
1701 * system. Its purpose is to select a suitable driver for a device and
1705 * best value. This driver is then attached to the device using
1709 * the parent device's devclass. If the device was originally created
1716 * @param dev the device to initialise
1761 * @param dev the device to quiesce
1782 * @brief Notify a device of system shutdown
1785 * device currently has an attached driver.
1811 * a bus (i.e. a device which has other devices attached to it). It
1812 * calls the DEVICE_IDENTIFY() method of each driver in the device's
1845 * a bus. It calls device_probe_and_attach() for each of the device's
1865 * a bus. It calls device_detach() for each of the device's
1893 * for a bus. It calls device_shutdown() for each of the device's
1913 * @brief Default function for suspending a child device.
1931 * @brief Default function for resuming a child device.
1949 * for a bus. It calls DEVICE_SUSPEND() for each of the device's
1985 * a bus. It calls DEVICE_RESUME() on each of the device's children.
2042 * This function prints out the VM domain for the given device.
2106 * walks the list of devices for this bus. If a device is already
2107 * attached, then it calls BUS_NEW_PASS() on that device. If the
2108 * device is not already attached, it attempts to attach a driver to
2209 * @brief Print the name of the device followed by a colon and a space
2224 * @brief Return the device's unit number.
2261 * @brief Set the devclass of a device
2277 printf("device_set_devclass: device class already set\n");
2292 * @brief Detach a driver from a device
2297 * notification event for user-based device management services and
2298 * cleans up the device's sysctl tree.
2300 * @param dev the device to un-initialise
2318 device_printf(dev, "device in attaching state! Deferring detach.\n");
2348 * @brief Return the parent of a device
2357 * @brief Print the name of the device followed by a colon, a space
2377 * @brief Set the driver of a device
2380 * @retval EBUSY the device already has a driver attached
2435 panic("device_probe_child: parent device has no devclass");
2475 /* Fetch any flags for the device before probing. */
2488 * no higher match for this device.
2548 * If this device was attached, and we were asked to
2604 * @brief Return the current devclass for the device or @c NULL if
2798 * device_probe_and_attach() for each child of the @c root0 device.
2812 * @brief Module handler for registering device drivers
2814 * This module handler is used to automatically register device
2892 indentprintf(("device %d: <%s> %sparent,%schildren,%s%s%s%s%s,%sivars,%ssoftc,busy=%d\n",
2924 /* print the device and all its children (indented) */
2940 /* print the device and all its children (indented) */