Linux Kernel
3.7.1
|
#include <linux/device.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/string.h>
#include <linux/mutex.h>
#include "base.h"
#include "power/power.h"
Go to the source code of this file.
Macros | |
#define | to_bus_attr(_attr) container_of(_attr, struct bus_attribute, attr) |
#define | to_drv_attr(_attr) container_of(_attr, struct driver_attribute, attr) |
#define to_bus_attr | ( | _attr | ) | container_of(_attr, struct bus_attribute, attr) |
#define to_drv_attr | ( | _attr | ) | container_of(_attr, struct driver_attribute, attr) |
int __bus_register | ( | struct bus_type * | bus, |
struct lock_class_key * | key | ||
) |
int bus_add_driver | ( | struct device_driver * | drv | ) |
int bus_create_file | ( | struct bus_type * | bus, |
struct bus_attribute * | attr | ||
) |
|
read |
bus_find_device - device iterator for locating a particular device. : bus type : Device to begin with : Data to pass to match function : Callback function to check device
This is similar to the bus_for_each_dev() function above, but it returns a reference to a device that is 'found' for later use, as determined by the callback.
The callback should return 0 if the device doesn't match and non-zero if it does. If the callback returns non-zero, this function will return to the caller and not iterate over any more devices.
int bus_for_each_drv | ( | struct bus_type * | bus, |
struct device_driver * | start, | ||
void * | data, | ||
int(*)(struct device_driver *, void *) | fn | ||
) |
int bus_register_notifier | ( | struct bus_type * | bus, |
struct notifier_block * | nb | ||
) |
bus_remove_device - remove device from bus : device to be removed
void bus_remove_driver | ( | struct device_driver * | drv | ) |
void bus_remove_file | ( | struct bus_type * | bus, |
struct bus_attribute * | attr | ||
) |
int bus_unregister_notifier | ( | struct bus_type * | bus, |
struct notifier_block * | nb | ||
) |
device_reprobe - remove driver for a device and probe for a new driver : the device to reprobe
This function detaches the attached driver (if any) for the given device and restarts the driver probing process. It is intended to use if probing criteria changed during a devices lifetime and driver attachment should change accordingly.
EXPORT_SYMBOL_GPL | ( | bus_create_file | ) |
EXPORT_SYMBOL_GPL | ( | bus_remove_file | ) |
EXPORT_SYMBOL_GPL | ( | bus_for_each_dev | ) |
EXPORT_SYMBOL_GPL | ( | bus_find_device | ) |
EXPORT_SYMBOL_GPL | ( | bus_find_device_by_name | ) |
EXPORT_SYMBOL_GPL | ( | subsys_find_device_by_id | ) |
EXPORT_SYMBOL_GPL | ( | bus_for_each_drv | ) |
EXPORT_SYMBOL_GPL | ( | bus_rescan_devices | ) |
EXPORT_SYMBOL_GPL | ( | device_reprobe | ) |
EXPORT_SYMBOL_GPL | ( | __bus_register | ) |
EXPORT_SYMBOL_GPL | ( | bus_unregister | ) |
EXPORT_SYMBOL_GPL | ( | bus_register_notifier | ) |
EXPORT_SYMBOL_GPL | ( | bus_unregister_notifier | ) |
EXPORT_SYMBOL_GPL | ( | bus_get_kset | ) |
EXPORT_SYMBOL_GPL | ( | bus_get_device_klist | ) |
EXPORT_SYMBOL_GPL | ( | bus_sort_breadthfirst | ) |
EXPORT_SYMBOL_GPL | ( | subsys_dev_iter_init | ) |
EXPORT_SYMBOL_GPL | ( | subsys_dev_iter_next | ) |
EXPORT_SYMBOL_GPL | ( | subsys_dev_iter_exit | ) |
EXPORT_SYMBOL_GPL | ( | subsys_interface_register | ) |
EXPORT_SYMBOL_GPL | ( | subsys_interface_unregister | ) |
EXPORT_SYMBOL_GPL | ( | subsys_system_register | ) |
void subsys_dev_iter_exit | ( | struct subsys_dev_iter * | iter | ) |
void subsys_dev_iter_init | ( | struct subsys_dev_iter * | iter, |
struct bus_type * | subsys, | ||
struct device * | start, | ||
const struct device_type * | type | ||
) |
subsys_dev_iter_init - initialize subsys device iterator : subsys iterator to initialize : the subsys we wanna iterate over : the device to start iterating from, if any : device_type of the devices to iterate over, NULL for all
Initialize subsys iterator such that it iterates over devices of . If is set, the list iteration will start there, otherwise if it is NULL, the iteration starts at the beginning of the list.
|
read |
subsys_dev_iter_next - iterate to the next device : subsys iterator to proceed
Proceed to the next device and return it. Returns NULL if iteration is complete.
The returned device is referenced and won't be released till iterator is proceed to the next device or exited. The caller is free to do whatever it wants to do with the device including calling back into subsys code.
|
read |
subsys_find_device_by_id - find a device with a specific enumeration number : subsystem : index 'id' in struct device : device to check first
Check the hint's next object and if it is a match return it directly, otherwise, fall back to a full list search. Either way a reference for the returned object is taken.
int subsys_interface_register | ( | struct subsys_interface * | sif | ) |
void subsys_interface_unregister | ( | struct subsys_interface * | sif | ) |
subsys_system_register - register a subsystem at /sys/devices/system/ : system subsystem : default attributes for the root device
All 'system' subsystems have a /sys/devices/system/<name> root device with the name of the subsystem. The root device can carry subsystem- wide attributes. All registered devices are below this single root device and are named after the subsystem with a simple enumeration number appended. The registered devices are not explicitely named; only 'id' in the device needs to be set.
Do not use this interface for anything new, it exists for compatibility with bad ideas only. New subsystems should use plain subsystems; and add the subsystem-wide attributes should be added to the subsystem directory itself and not some create fake root-device placed in /sys/devices/system/<name>.