Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
fcoe_ctlr.c File Reference
#include <linux/types.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/timer.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/errno.h>
#include <linux/bitops.h>
#include <linux/slab.h>
#include <net/rtnetlink.h>
#include <scsi/fc/fc_els.h>
#include <scsi/fc/fc_fs.h>
#include <scsi/fc/fc_fip.h>
#include <scsi/fc/fc_encaps.h>
#include <scsi/fc/fc_fcoe.h>
#include <scsi/fc/fc_fcp.h>
#include <scsi/libfc.h>
#include <scsi/libfcoe.h>
#include "libfcoe.h"

Go to the source code of this file.

Macros

#define FCOE_CTLR_MIN_FKA   500 /* min keep alive (mS) */
 
#define FCOE_CTLR_DEF_FKA   FIP_DEF_FKA /* default keep alive (mS) */
 

Functions

void fcoe_ctlr_init (struct fcoe_ctlr *fip, enum fip_state mode)
 
 EXPORT_SYMBOL (fcoe_ctlr_init)
 
void fcoe_ctlr_destroy (struct fcoe_ctlr *fip)
 
 EXPORT_SYMBOL (fcoe_ctlr_destroy)
 
void fcoe_ctlr_link_up (struct fcoe_ctlr *fip)
 
 EXPORT_SYMBOL (fcoe_ctlr_link_up)
 
int fcoe_ctlr_link_down (struct fcoe_ctlr *fip)
 
 EXPORT_SYMBOL (fcoe_ctlr_link_down)
 
int fcoe_ctlr_els_send (struct fcoe_ctlr *fip, struct fc_lport *lport, struct sk_buff *skb)
 
 EXPORT_SYMBOL (fcoe_ctlr_els_send)
 
void fcoe_ctlr_recv (struct fcoe_ctlr *fip, struct sk_buff *skb)
 
 EXPORT_SYMBOL (fcoe_ctlr_recv)
 
int fcoe_ctlr_recv_flogi (struct fcoe_ctlr *fip, struct fc_lport *lport, struct fc_frame *fp)
 
 EXPORT_SYMBOL (fcoe_ctlr_recv_flogi)
 
u64 fcoe_wwn_from_mac (unsigned char mac[MAX_ADDR_LEN], unsigned int scheme, unsigned int port)
 
 EXPORT_SYMBOL_GPL (fcoe_wwn_from_mac)
 
int fcoe_libfc_config (struct fc_lport *lport, struct fcoe_ctlr *fip, const struct libfc_function_template *tt, int init_fcp)
 
 EXPORT_SYMBOL_GPL (fcoe_libfc_config)
 
void fcoe_fcf_get_selected (struct fcoe_fcf_device *fcf_dev)
 
 EXPORT_SYMBOL (fcoe_fcf_get_selected)
 
void fcoe_ctlr_get_fip_mode (struct fcoe_ctlr_device *ctlr_dev)
 
 EXPORT_SYMBOL (fcoe_ctlr_get_fip_mode)
 

Macro Definition Documentation

#define FCOE_CTLR_DEF_FKA   FIP_DEF_FKA /* default keep alive (mS) */

Definition at line 50 of file fcoe_ctlr.c.

#define FCOE_CTLR_MIN_FKA   500 /* min keep alive (mS) */

Definition at line 49 of file fcoe_ctlr.c.

Function Documentation

EXPORT_SYMBOL ( fcoe_ctlr_init  )
EXPORT_SYMBOL ( fcoe_ctlr_destroy  )
EXPORT_SYMBOL ( fcoe_ctlr_link_up  )
EXPORT_SYMBOL ( fcoe_ctlr_link_down  )
EXPORT_SYMBOL ( fcoe_ctlr_els_send  )
EXPORT_SYMBOL ( fcoe_ctlr_recv  )
EXPORT_SYMBOL ( fcoe_ctlr_recv_flogi  )
EXPORT_SYMBOL ( fcoe_fcf_get_selected  )
EXPORT_SYMBOL ( fcoe_ctlr_get_fip_mode  )
EXPORT_SYMBOL_GPL ( fcoe_wwn_from_mac  )
EXPORT_SYMBOL_GPL ( fcoe_libfc_config  )
void fcoe_ctlr_destroy ( struct fcoe_ctlr fip)

fcoe_ctlr_destroy() - Disable and tear down a FCoE controller : The FCoE controller to tear down

This is called by FCoE drivers before freeing the &fcoe_ctlr.

The receive handler will have been deleted before this to guarantee that no more recv_work will be scheduled.

The timer routine will simply return once we set FIP_ST_DISABLED. This guarantees that no further timeouts or work will be scheduled.

Definition at line 265 of file fcoe_ctlr.c.

int fcoe_ctlr_els_send ( struct fcoe_ctlr fip,
struct fc_lport lport,
struct sk_buff skb 
)

fcoe_ctlr_els_send() - Send an ELS frame encapsulated by FIP if appropriate. : FCoE controller. : libfc fc_lport to send from : FCoE ELS frame including FC header but no FCoE headers.

Returns a non-zero error code if the frame should not be sent. Returns zero if the caller should send the frame with FCoE encapsulation.

The caller must check that the length is a multiple of 4. The SKB must have enough headroom (28 bytes) and tailroom (8 bytes). The the skb must also be an fc_frame.

This is called from the lower-level driver with spinlocks held, so we must not take a mutex here.

Definition at line 663 of file fcoe_ctlr.c.

void fcoe_ctlr_get_fip_mode ( struct fcoe_ctlr_device ctlr_dev)

Definition at line 2867 of file fcoe_ctlr.c.

void fcoe_ctlr_init ( struct fcoe_ctlr fip,
enum fip_state  mode 
)

fcoe_ctlr_init() - Initialize the FCoE Controller instance : The FCoE controller to initialize

Definition at line 148 of file fcoe_ctlr.c.

int fcoe_ctlr_link_down ( struct fcoe_ctlr fip)

fcoe_ctlr_link_down() - Stop a FCoE controller : The FCoE controller to be stopped

Returns non-zero if the link was up and now isn't.

Called from the LLD when the network link is not ready. There may be multiple calls while the link is down.

Definition at line 464 of file fcoe_ctlr.c.

void fcoe_ctlr_link_up ( struct fcoe_ctlr fip)

fcoe_ctlr_link_up() - Start FCoE controller : The FCoE controller to start

Called from the LLD when the network link is ready.

Definition at line 408 of file fcoe_ctlr.c.

void fcoe_ctlr_recv ( struct fcoe_ctlr fip,
struct sk_buff skb 
)

fcoe_ctlr_recv() - Receive a FIP packet : The FCoE controller that received the packet : The received FIP packet

This may be called from either NET_RX_SOFTIRQ or IRQ.

Definition at line 1446 of file fcoe_ctlr.c.

int fcoe_ctlr_recv_flogi ( struct fcoe_ctlr fip,
struct fc_lport lport,
struct fc_frame fp 
)

fcoe_ctlr_recv_flogi() - Snoop pre-FIP receipt of FLOGI response : The FCoE controller : The FC frame to snoop

Snoop potential response to FLOGI or even incoming FLOGI.

The caller has checked that we are waiting for login as indicated by fip->flogi_oxid != FC_XID_UNKNOWN.

The caller is responsible for freeing the frame. Fill in the granted_mac address.

Return non-zero if the frame should not be delivered to libfc.

Definition at line 1825 of file fcoe_ctlr.c.

void fcoe_fcf_get_selected ( struct fcoe_fcf_device fcf_dev)

Definition at line 2847 of file fcoe_ctlr.c.

int fcoe_libfc_config ( struct fc_lport lport,
struct fcoe_ctlr fip,
const struct libfc_function_template tt,
int  init_fcp 
)

fcoe_libfc_config() - Sets up libfc related properties for local port : The local port to configure libfc for : The FCoE controller in use by the local port : The libfc function template : If non-zero, the FCP portion of libfc should be initialized

Returns : 0 for success

Definition at line 2818 of file fcoe_ctlr.c.

u64 fcoe_wwn_from_mac ( unsigned char  mac[MAX_ADDR_LEN],
unsigned int  scheme,
unsigned int  port 
)

fcoe_wwn_from_mac() - Converts a 48-bit IEEE MAC address to a 64-bit FC WWN : The MAC address to convert : The scheme to use when converting : The port indicator for converting

Returns: u64 fc world wide name

Definition at line 1892 of file fcoe_ctlr.c.