Linux Kernel
3.7.1
|
Go to the source code of this file.
Data Structures | |
struct | fw_iso_resources |
Functions | |
int | fw_iso_resources_init (struct fw_iso_resources *r, struct fw_unit *unit) |
void | fw_iso_resources_destroy (struct fw_iso_resources *r) |
int | fw_iso_resources_allocate (struct fw_iso_resources *r, unsigned int max_payload_bytes, int speed) |
int | fw_iso_resources_update (struct fw_iso_resources *r) |
void | fw_iso_resources_free (struct fw_iso_resources *r) |
int fw_iso_resources_allocate | ( | struct fw_iso_resources * | r, |
unsigned int | max_payload_bytes, | ||
int | speed | ||
) |
fw_iso_resources_allocate - allocate isochronous channel and bandwidth : the resource manager : the amount of data (including CIP headers) per packet : the speed (e.g., SCODE_400) at which the packets will be sent
This function allocates one isochronous channel and enough bandwidth for the specified packet size.
Returns the channel number that the caller must use for streaming, or a negative error code. Due to potentionally long delays, this function is interruptible and can return -ERESTARTSYS. On success, the caller is responsible for calling fw_iso_resources_update() on bus resets, and fw_iso_resources_free() when the resources are not longer needed.
Definition at line 106 of file iso-resources.c.
void fw_iso_resources_destroy | ( | struct fw_iso_resources * | r | ) |
fw_iso_resources_destroy - destroy a resource manager : the resource manager that is no longer needed
Definition at line 41 of file iso-resources.c.
void fw_iso_resources_free | ( | struct fw_iso_resources * | r | ) |
fw_iso_resources_free - frees allocated resources : the resource manager
This function deallocates the channel and bandwidth, if allocated.
Definition at line 212 of file iso-resources.c.
int fw_iso_resources_init | ( | struct fw_iso_resources * | r, |
struct fw_unit * | unit | ||
) |
fw_iso_resources_init - initializes a &struct fw_iso_resources : the resource manager to initialize : the device unit for which the resources will be needed
If the device does not support all channel numbers, change ->channels_mask after calling this function.
Definition at line 26 of file iso-resources.c.
int fw_iso_resources_update | ( | struct fw_iso_resources * | r | ) |
fw_iso_resources_update - update resource allocations after a bus reset : the resource manager
This function must be called from the driver's .update handler to reallocate any resources that were allocated before the bus reset. It is safe to call this function if no resources are currently allocated.
Returns a negative error code on failure. If this happens, the caller must stop streaming.
Definition at line 165 of file iso-resources.c.