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

Go to the source code of this file.

Data Structures

struct  fcp_transaction
 

Macros

#define CTS_AVC   0x00
 
#define ERROR_RETRIES   3
 
#define ERROR_DELAY_MS   5
 
#define FCP_TIMEOUT_MS   125
 

Enumerations

enum  fcp_state { STATE_PENDING, STATE_BUS_RESET, STATE_COMPLETE }
 

Functions

int fcp_avc_transaction (struct fw_unit *unit, const void *command, unsigned int command_size, void *response, unsigned int response_size, unsigned int response_match_bytes)
 
 EXPORT_SYMBOL (fcp_avc_transaction)
 
void fcp_bus_reset (struct fw_unit *unit)
 
 EXPORT_SYMBOL (fcp_bus_reset)
 
 module_init (fcp_module_init)
 
 module_exit (fcp_module_exit)
 

Macro Definition Documentation

#define CTS_AVC   0x00

Definition at line 20 of file fcp.c.

#define ERROR_DELAY_MS   5

Definition at line 23 of file fcp.c.

#define ERROR_RETRIES   3

Definition at line 22 of file fcp.c.

#define FCP_TIMEOUT_MS   125

Definition at line 24 of file fcp.c.

Enumeration Type Documentation

enum fcp_state
Enumerator:
STATE_PENDING 
STATE_BUS_RESET 
STATE_COMPLETE 

Definition at line 29 of file fcp.c.

Function Documentation

EXPORT_SYMBOL ( fcp_avc_transaction  )
EXPORT_SYMBOL ( fcp_bus_reset  )
int fcp_avc_transaction ( struct fw_unit unit,
const void command,
unsigned int  command_size,
void response,
unsigned int  response_size,
unsigned int  response_match_bytes 
)

fcp_avc_transaction - send an AV/C command and wait for its response : a unit on the target device : a buffer containing the command frame; must be DMA-able : the size of : a buffer for the response frame : the maximum size of : a bitmap specifying the bytes used to detect the correct response frame

This function sends a FCP command frame to the target and waits for the corresponding response frame to be returned.

Because it is possible for multiple FCP transactions to be active at the same time, the correct response frame is detected by the value of certain bytes. These bytes must be set in before calling this function, and the corresponding bits must be set in .

and can point to the same buffer.

Asynchronous operation (INTERIM, NOTIFY) is not supported at the moment.

Returns the actual size of the response frame, or a negative error code.

Definition at line 69 of file fcp.c.

void fcp_bus_reset ( struct fw_unit unit)

fcp_bus_reset - inform the target handler about a bus reset : the unit that might be used by fcp_avc_transaction()

This function must be called from the driver's .update handler to inform the FCP transaction handler that a bus reset has happened. Any pending FCP transactions are retried.

Definition at line 128 of file fcp.c.

module_exit ( fcp_module_exit  )
module_init ( fcp_module_init  )