Linux Kernel
3.7.1
|
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/bug.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/iommu.h>
#include <linux/idr.h>
#include <linux/notifier.h>
#include <linux/err.h>
Go to the source code of this file.
Data Structures | |
struct | iommu_group |
struct | iommu_device |
struct | iommu_group_attribute |
Macros | |
#define | pr_fmt(fmt) "%s: " fmt, __func__ |
#define | IOMMU_GROUP_ATTR(_name, _mode, _show, _store) |
#define | to_iommu_group_attr(_attr) container_of(_attr, struct iommu_group_attribute, attr) |
#define | to_iommu_group(_kobj) container_of(_kobj, struct iommu_group, kobj) |
Functions | |
: Optional name to associate with group, visible in sysfs | |
iommu_group_alloc - Allocate a new group This function is called by an iommu driver to allocate a new iommu group. The iommu group represents the minimum granularity of the iommu. Upon successful return, the caller holds a reference to the supplied group in order to hold the group until devices are added. Use iommu_group_put() to release this extra reference count, allowing the group to be automatically reclaimed once it has no devices or external references. | |
struct iommu_group * | iommu_group_alloc (void) |
EXPORT_SYMBOL_GPL (iommu_group_alloc) | |
void * | iommu_group_get_iommudata (struct iommu_group *group) |
EXPORT_SYMBOL_GPL (iommu_group_get_iommudata) | |
void | iommu_group_set_iommudata (struct iommu_group *group, void *iommu_data, void(*release)(void *iommu_data)) |
EXPORT_SYMBOL_GPL (iommu_group_set_iommudata) | |
#define IOMMU_GROUP_ATTR | ( | _name, | |
_mode, | |||
_show, | |||
_store | |||
) |
#define to_iommu_group | ( | _kobj | ) | container_of(_kobj, struct iommu_group, kobj) |
#define to_iommu_group_attr | ( | _attr | ) | container_of(_attr, struct iommu_group_attribute, attr) |
bus_set_iommu - set iommu-callbacks for the bus : bus. : the callbacks provided by the iommu-driver
This function is called by an iommu driver to set the iommu methods used for a particular bus. Drivers for devices on that bus can use the iommu-api after these ops are registered. This special function is needed because IOMMUs are usually devices on the bus itself, so the iommu drivers are not initialized when the bus is set up. With this function the iommu-driver can set the iommu-ops afterwards.
EXPORT_SYMBOL_GPL | ( | iommu_group_alloc | ) |
EXPORT_SYMBOL_GPL | ( | iommu_group_get_iommudata | ) |
EXPORT_SYMBOL_GPL | ( | iommu_group_set_iommudata | ) |
EXPORT_SYMBOL_GPL | ( | iommu_group_set_name | ) |
EXPORT_SYMBOL_GPL | ( | iommu_group_add_device | ) |
EXPORT_SYMBOL_GPL | ( | iommu_group_remove_device | ) |
EXPORT_SYMBOL_GPL | ( | iommu_group_for_each_dev | ) |
EXPORT_SYMBOL_GPL | ( | iommu_group_get | ) |
EXPORT_SYMBOL_GPL | ( | iommu_group_put | ) |
EXPORT_SYMBOL_GPL | ( | iommu_group_register_notifier | ) |
EXPORT_SYMBOL_GPL | ( | iommu_group_unregister_notifier | ) |
EXPORT_SYMBOL_GPL | ( | iommu_group_id | ) |
EXPORT_SYMBOL_GPL | ( | bus_set_iommu | ) |
EXPORT_SYMBOL_GPL | ( | iommu_present | ) |
EXPORT_SYMBOL_GPL | ( | iommu_set_fault_handler | ) |
EXPORT_SYMBOL_GPL | ( | iommu_domain_alloc | ) |
EXPORT_SYMBOL_GPL | ( | iommu_domain_free | ) |
EXPORT_SYMBOL_GPL | ( | iommu_attach_device | ) |
EXPORT_SYMBOL_GPL | ( | iommu_detach_device | ) |
EXPORT_SYMBOL_GPL | ( | iommu_attach_group | ) |
EXPORT_SYMBOL_GPL | ( | iommu_detach_group | ) |
EXPORT_SYMBOL_GPL | ( | iommu_iova_to_phys | ) |
EXPORT_SYMBOL_GPL | ( | iommu_domain_has_cap | ) |
EXPORT_SYMBOL_GPL | ( | iommu_map | ) |
EXPORT_SYMBOL_GPL | ( | iommu_unmap | ) |
EXPORT_SYMBOL_GPL | ( | iommu_domain_get_attr | ) |
EXPORT_SYMBOL_GPL | ( | iommu_domain_set_attr | ) |
int iommu_attach_device | ( | struct iommu_domain * | domain, |
struct device * | dev | ||
) |
int iommu_attach_group | ( | struct iommu_domain * | domain, |
struct iommu_group * | group | ||
) |
void iommu_detach_device | ( | struct iommu_domain * | domain, |
struct device * | dev | ||
) |
void iommu_detach_group | ( | struct iommu_domain * | domain, |
struct iommu_group * | group | ||
) |
|
read |
void iommu_domain_free | ( | struct iommu_domain * | domain | ) |
int iommu_domain_get_attr | ( | struct iommu_domain * | domain, |
enum iommu_attr | attr, | ||
void * | data | ||
) |
int iommu_domain_has_cap | ( | struct iommu_domain * | domain, |
unsigned long | cap | ||
) |
int iommu_domain_set_attr | ( | struct iommu_domain * | domain, |
enum iommu_attr | attr, | ||
void * | data | ||
) |
int iommu_group_add_device | ( | struct iommu_group * | group, |
struct device * | dev | ||
) |
|
read |
|
read |
void* iommu_group_get_iommudata | ( | struct iommu_group * | group | ) |
int iommu_group_id | ( | struct iommu_group * | group | ) |
void iommu_group_put | ( | struct iommu_group * | group | ) |
int iommu_group_register_notifier | ( | struct iommu_group * | group, |
struct notifier_block * | nb | ||
) |
iommu_group_register_notifier - Register a notifier for group changes : the group to watch : notifier block to signal
This function allows iommu group users to track changes in a group. See include/linux/iommu.h for actions sent via this notifier. Caller should hold a reference to the group throughout notifier registration.
void iommu_group_set_iommudata | ( | struct iommu_group * | group, |
void * | iommu_data, | ||
void(*)(void *iommu_data) | release | ||
) |
iommu_group_set_iommudata - set iommu_data for a group : the group : new data : release function for iommu_data
iommu drivers can store data in the group for use when doing iommu operations. This function provides a way to set the data after the group has been allocated. Caller should hold a group reference.
int iommu_group_set_name | ( | struct iommu_group * | group, |
const char * | name | ||
) |
int iommu_group_unregister_notifier | ( | struct iommu_group * | group, |
struct notifier_block * | nb | ||
) |
phys_addr_t iommu_iova_to_phys | ( | struct iommu_domain * | domain, |
unsigned long | iova | ||
) |
int iommu_map | ( | struct iommu_domain * | domain, |
unsigned long | iova, | ||
phys_addr_t | paddr, | ||
size_t | size, | ||
int | prot | ||
) |
void iommu_set_fault_handler | ( | struct iommu_domain * | domain, |
iommu_fault_handler_t | handler, | ||
void * | token | ||
) |
iommu_set_fault_handler() - set a fault handler for an iommu domain : iommu domain : fault handler : user data, will be passed back to the fault handler
This function should be used by IOMMU users which want to be notified whenever an IOMMU fault happens.
The fault handler itself should return 0 on success, and an appropriate error code otherwise.
size_t iommu_unmap | ( | struct iommu_domain * | domain, |
unsigned long | iova, | ||
size_t | size | ||
) |
subsys_initcall | ( | iommu_init | ) |