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

Go to the source code of this file.

Macros

#define IMPR_SPEED_MASK   0xc0000000
 
#define IMPR_SPEED_SHIFT   30
 
#define IMPR_XSPEED_MASK   0x00000060
 
#define IMPR_XSPEED_SHIFT   5
 
#define IMPR_PLUGS_MASK   0x0000001f
 
#define IPCR_ONLINE   0x80000000
 
#define IPCR_BCAST_CONN   0x40000000
 
#define IPCR_P2P_CONN_MASK   0x3f000000
 
#define IPCR_P2P_CONN_SHIFT   24
 
#define IPCR_CHANNEL_MASK   0x003f0000
 
#define IPCR_CHANNEL_SHIFT   16
 

Enumerations

enum  bus_reset_handling { ABORT_ON_BUS_RESET, SUCCEED_ON_BUS_RESET }
 

Functions

int cmp_connection_init (struct cmp_connection *c, struct fw_unit *unit, unsigned int ipcr_index)
 
 EXPORT_SYMBOL (cmp_connection_init)
 
void cmp_connection_destroy (struct cmp_connection *c)
 
 EXPORT_SYMBOL (cmp_connection_destroy)
 
int cmp_connection_establish (struct cmp_connection *c, unsigned int max_payload_bytes)
 
 EXPORT_SYMBOL (cmp_connection_establish)
 
int cmp_connection_update (struct cmp_connection *c)
 
 EXPORT_SYMBOL (cmp_connection_update)
 
void cmp_connection_break (struct cmp_connection *c)
 
 EXPORT_SYMBOL (cmp_connection_break)
 

Macro Definition Documentation

#define IMPR_PLUGS_MASK   0x0000001f

Definition at line 21 of file cmp.c.

#define IMPR_SPEED_MASK   0xc0000000

Definition at line 17 of file cmp.c.

#define IMPR_SPEED_SHIFT   30

Definition at line 18 of file cmp.c.

#define IMPR_XSPEED_MASK   0x00000060

Definition at line 19 of file cmp.c.

#define IMPR_XSPEED_SHIFT   5

Definition at line 20 of file cmp.c.

#define IPCR_BCAST_CONN   0x40000000

Definition at line 24 of file cmp.c.

#define IPCR_CHANNEL_MASK   0x003f0000

Definition at line 27 of file cmp.c.

#define IPCR_CHANNEL_SHIFT   16

Definition at line 28 of file cmp.c.

#define IPCR_ONLINE   0x80000000

Definition at line 23 of file cmp.c.

#define IPCR_P2P_CONN_MASK   0x3f000000

Definition at line 25 of file cmp.c.

#define IPCR_P2P_CONN_SHIFT   24

Definition at line 26 of file cmp.c.

Enumeration Type Documentation

Enumerator:
ABORT_ON_BUS_RESET 
SUCCEED_ON_BUS_RESET 

Definition at line 30 of file cmp.c.

Function Documentation

void cmp_connection_break ( struct cmp_connection c)

cmp_connection_break - break the connection to the target : the connection manager

This function deactives the connection in the target's input plug control register, and frees the isochronous resources of the connection. Before calling this function, the caller should cease transmitting packets.

Definition at line 286 of file cmp.c.

void cmp_connection_destroy ( struct cmp_connection c)

cmp_connection_destroy - free connection manager resources : the connection manager

Definition at line 139 of file cmp.c.

int cmp_connection_establish ( struct cmp_connection c,
unsigned int  max_payload_bytes 
)

cmp_connection_establish - establish a connection to the target : the connection manager : the amount of data (including CIP headers) per packet

This function establishes a point-to-point connection from the local computer to the target by allocating isochronous resources (channel and bandwidth) and setting the target's input plug control register. When this function succeeds, the caller is responsible for starting transmitting packets.

Definition at line 185 of file cmp.c.

int cmp_connection_init ( struct cmp_connection c,
struct fw_unit unit,
unsigned int  ipcr_index 
)

cmp_connection_init - initializes a connection manager : the connection manager to initialize : a unit of the target device : the index of the iPCR on the target device

Definition at line 101 of file cmp.c.

int cmp_connection_update ( struct cmp_connection c)

cmp_connection_update - update the connection after a bus reset : the connection manager

This function must be called from the driver's .update handler to reestablish any connection that might have been active.

Returns zero on success, or a negative error code. On an error, the connection is broken and the caller must stop transmitting iso packets.

Definition at line 238 of file cmp.c.

EXPORT_SYMBOL ( cmp_connection_init  )
EXPORT_SYMBOL ( cmp_connection_destroy  )
EXPORT_SYMBOL ( cmp_connection_establish  )
EXPORT_SYMBOL ( cmp_connection_update  )
EXPORT_SYMBOL ( cmp_connection_break  )