Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
fcoe_sysfs.h File Reference
#include <linux/if_ether.h>
#include <linux/device.h>
#include <scsi/fc/fc_fcoe.h>

Go to the source code of this file.

Data Structures

struct  fcoe_sysfs_function_template
 
struct  fcoe_ctlr_device
 
struct  fcoe_fcf_device
 

Macros

#define dev_to_ctlr(d)   container_of((d), struct fcoe_ctlr_device, dev)
 
#define dev_to_fcf(d)   container_of((d), struct fcoe_fcf_device, dev)
 
#define fcoe_fcf_dev_to_ctlr_dev(x)   dev_to_ctlr((x)->dev.parent)
 
#define fcoe_fcf_device_priv(x)   ((x)->priv)
 

Enumerations

enum  fip_conn_type { FIP_CONN_TYPE_UNKNOWN, FIP_CONN_TYPE_FABRIC, FIP_CONN_TYPE_VN2VN }
 
enum  fcf_state { FCOE_FCF_STATE_UNKNOWN, FCOE_FCF_STATE_DISCONNECTED, FCOE_FCF_STATE_CONNECTED, FCOE_FCF_STATE_DELETED }
 

Functions

struct fcoe_ctlr_devicefcoe_ctlr_device_add (struct device *parent, struct fcoe_sysfs_function_template *f, int priv_size)
 
void fcoe_ctlr_device_delete (struct fcoe_ctlr_device *)
 
struct fcoe_fcf_devicefcoe_fcf_device_add (struct fcoe_ctlr_device *, struct fcoe_fcf_device *)
 
void fcoe_fcf_device_delete (struct fcoe_fcf_device *)
 
int __init fcoe_sysfs_setup (void)
 
void __exit fcoe_sysfs_teardown (void)
 

Macro Definition Documentation

#define dev_to_ctlr (   d)    container_of((d), struct fcoe_ctlr_device, dev)

Definition at line 42 of file fcoe_sysfs.h.

#define dev_to_fcf (   d)    container_of((d), struct fcoe_fcf_device, dev)

Definition at line 105 of file fcoe_sysfs.h.

#define fcoe_fcf_dev_to_ctlr_dev (   x)    dev_to_ctlr((x)->dev.parent)

Definition at line 108 of file fcoe_sysfs.h.

#define fcoe_fcf_device_priv (   x)    ((x)->priv)

Definition at line 110 of file fcoe_sysfs.h.

Enumeration Type Documentation

enum fcf_state
Enumerator:
FCOE_FCF_STATE_UNKNOWN 
FCOE_FCF_STATE_DISCONNECTED 
FCOE_FCF_STATE_CONNECTED 
FCOE_FCF_STATE_DELETED 

Definition at line 77 of file fcoe_sysfs.h.

Enumerator:
FIP_CONN_TYPE_UNKNOWN 
FIP_CONN_TYPE_FABRIC 
FIP_CONN_TYPE_VN2VN 

Definition at line 45 of file fcoe_sysfs.h.

Function Documentation

struct fcoe_ctlr_device* fcoe_ctlr_device_add ( struct device parent,
struct fcoe_sysfs_function_template f,
int  priv_size 
)
read

fcoe_ctlr_device_add() - Add a FIP ctlr to sysfs : The parent device to which the fcoe_ctlr instance should be attached : The LLD's FCoE sysfs function template pointer : Size to be allocated with the fcoe_ctlr_device for the LLD

This routine allocates a FIP ctlr object with some additional memory for the LLD. The FIP ctlr is initialized, added to sysfs and then attributes are added to it.

Definition at line 555 of file fcoe_sysfs.c.

void fcoe_ctlr_device_delete ( struct fcoe_ctlr_device ctlr)

fcoe_ctlr_device_delete() - Delete a FIP ctlr and its subtree from sysfs : A pointer to the ctlr to be deleted

Deletes a FIP ctlr and any fcfs attached to it. Deleting fcfs will cause their childen to be deleted as well.

The ctlr is detached from sysfs and it's resources are freed (work q), but the memory is not freed until its last reference is released.

This routine expects no locks to be held before calling.

TODO: Currently there are no callbacks to clean up LLD data for a fcoe_fcf_device. LLDs must keep this in mind as they need to clean up each of their LLD data for all fcoe_fcf_device before calling fcoe_ctlr_device_delete.

Definition at line 632 of file fcoe_sysfs.c.

struct fcoe_fcf_device* fcoe_fcf_device_add ( struct fcoe_ctlr_device ctlr,
struct fcoe_fcf_device new_fcf 
)
read

fcoe_fcf_device_add() - Add a FCoE sysfs fcoe_fcf_device to the system : The fcoe_ctlr_device that will be the fcoe_fcf_device parent : A temporary FCF used for lookups on the current list of fcfs

Expects to be called with the ctlr->lock held

Definition at line 753 of file fcoe_sysfs.c.

void fcoe_fcf_device_delete ( struct fcoe_fcf_device fcf)

fcoe_fcf_device_delete() - Delete a FIP fcf : Pointer to the fcf which is to be deleted

Queues the FIP fcf on the devloss workqueue

Expects the ctlr_attrs mutex to be held for fcf state change.

Definition at line 724 of file fcoe_sysfs.c.

int __init fcoe_sysfs_setup ( void  )

Definition at line 815 of file fcoe_sysfs.c.

void __exit fcoe_sysfs_teardown ( void  )

Definition at line 829 of file fcoe_sysfs.c.