Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
iso-resources.c File Reference
#include <linux/device.h>
#include <linux/firewire.h>
#include <linux/firewire-constants.h>
#include <linux/export.h>
#include <linux/jiffies.h>
#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include "iso-resources.h"

Go to the source code of this file.

Functions

int fw_iso_resources_init (struct fw_iso_resources *r, struct fw_unit *unit)
 
 EXPORT_SYMBOL (fw_iso_resources_init)
 
void fw_iso_resources_destroy (struct fw_iso_resources *r)
 
 EXPORT_SYMBOL (fw_iso_resources_destroy)
 
int fw_iso_resources_allocate (struct fw_iso_resources *r, unsigned int max_payload_bytes, int speed)
 
 EXPORT_SYMBOL (fw_iso_resources_allocate)
 
int fw_iso_resources_update (struct fw_iso_resources *r)
 
 EXPORT_SYMBOL (fw_iso_resources_update)
 
void fw_iso_resources_free (struct fw_iso_resources *r)
 
 EXPORT_SYMBOL (fw_iso_resources_free)
 

Function Documentation

EXPORT_SYMBOL ( fw_iso_resources_init  )
EXPORT_SYMBOL ( fw_iso_resources_destroy  )
EXPORT_SYMBOL ( fw_iso_resources_allocate  )
EXPORT_SYMBOL ( fw_iso_resources_update  )
EXPORT_SYMBOL ( fw_iso_resources_free  )
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.