Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
fc_lport.c File Reference
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <asm/unaligned.h>
#include <scsi/fc/fc_gs.h>
#include <scsi/libfc.h>
#include <scsi/fc_encode.h>
#include <linux/scatterlist.h>
#include "fc_libfc.h"

Go to the source code of this file.

Data Structures

struct  fc_bsg_info
 

Macros

#define FC_LOCAL_PTP_FID_LO   0x010101
 
#define FC_LOCAL_PTP_FID_HI   0x010102
 
#define DNS_DELAY   3 /* Discovery delay after RSCN (in seconds)*/
 

Functions

void fc_get_host_port_state (struct Scsi_Host *shost)
 
 EXPORT_SYMBOL (fc_get_host_port_state)
 
void fc_get_host_speed (struct Scsi_Host *shost)
 
 EXPORT_SYMBOL (fc_get_host_speed)
 
struct fc_host_statisticsfc_get_host_stats (struct Scsi_Host *shost)
 
 EXPORT_SYMBOL (fc_get_host_stats)
 
int fc_fabric_login (struct fc_lport *lport)
 
 EXPORT_SYMBOL (fc_fabric_login)
 
void __fc_linkup (struct fc_lport *lport)
 
void fc_linkup (struct fc_lport *lport)
 
 EXPORT_SYMBOL (fc_linkup)
 
void __fc_linkdown (struct fc_lport *lport)
 
void fc_linkdown (struct fc_lport *lport)
 
 EXPORT_SYMBOL (fc_linkdown)
 
int fc_fabric_logoff (struct fc_lport *lport)
 
 EXPORT_SYMBOL (fc_fabric_logoff)
 
int fc_lport_destroy (struct fc_lport *lport)
 
 EXPORT_SYMBOL (fc_lport_destroy)
 
int fc_set_mfs (struct fc_lport *lport, u32 mfs)
 
 EXPORT_SYMBOL (fc_set_mfs)
 
void fc_lport_set_local_id (struct fc_lport *lport, u32 port_id)
 
 EXPORT_SYMBOL (fc_lport_set_local_id)
 
int fc_lport_reset (struct fc_lport *lport)
 
 EXPORT_SYMBOL (fc_lport_reset)
 
void fc_lport_logo_resp (struct fc_seq *sp, struct fc_frame *fp, void *lp_arg)
 
 EXPORT_SYMBOL (fc_lport_logo_resp)
 
void fc_lport_flogi_resp (struct fc_seq *sp, struct fc_frame *fp, void *lp_arg)
 
 EXPORT_SYMBOL (fc_lport_flogi_resp)
 
int fc_lport_config (struct fc_lport *lport)
 
 EXPORT_SYMBOL (fc_lport_config)
 
int fc_lport_init (struct fc_lport *lport)
 
 EXPORT_SYMBOL (fc_lport_init)
 
int fc_lport_bsg_request (struct fc_bsg_job *job)
 
 EXPORT_SYMBOL (fc_lport_bsg_request)
 

Variables

struct fc4_prov fc_lport_els_prov
 

Macro Definition Documentation

#define DNS_DELAY   3 /* Discovery delay after RSCN (in seconds)*/

Definition at line 108 of file fc_lport.c.

#define FC_LOCAL_PTP_FID_HI   0x010102

Definition at line 106 of file fc_lport.c.

#define FC_LOCAL_PTP_FID_LO   0x010101

Definition at line 105 of file fc_lport.c.

Function Documentation

void __fc_linkdown ( struct fc_lport lport)

__fc_linkdown() - Handler for transport linkdown events : The lport whose link is down

Locking: must be called with the lp_mutex held

Definition at line 590 of file fc_lport.c.

void __fc_linkup ( struct fc_lport lport)

__fc_linkup() - Handler for transport linkup events : The lport whose link is up

Locking: must be called with the lp_mutex held

Definition at line 559 of file fc_lport.c.

EXPORT_SYMBOL ( fc_get_host_port_state  )
EXPORT_SYMBOL ( fc_get_host_speed  )
EXPORT_SYMBOL ( fc_get_host_stats  )
EXPORT_SYMBOL ( fc_fabric_login  )
EXPORT_SYMBOL ( fc_linkup  )
EXPORT_SYMBOL ( fc_linkdown  )
EXPORT_SYMBOL ( fc_fabric_logoff  )
EXPORT_SYMBOL ( fc_lport_destroy  )
EXPORT_SYMBOL ( fc_set_mfs  )
EXPORT_SYMBOL ( fc_lport_set_local_id  )
EXPORT_SYMBOL ( fc_lport_reset  )
EXPORT_SYMBOL ( fc_lport_logo_resp  )
EXPORT_SYMBOL ( fc_lport_flogi_resp  )
EXPORT_SYMBOL ( fc_lport_config  )
EXPORT_SYMBOL ( fc_lport_init  )
EXPORT_SYMBOL ( fc_lport_bsg_request  )
int fc_fabric_login ( struct fc_lport lport)

fc_fabric_login() - Start the lport state machine : The local port that should log into the fabric

Locking Note: This function should not be called with the lport lock held.

Definition at line 536 of file fc_lport.c.

int fc_fabric_logoff ( struct fc_lport lport)

fc_fabric_logoff() - Logout of the fabric : The local port to logoff the fabric

Return value: 0 for success, -1 for failure

Definition at line 621 of file fc_lport.c.

void fc_get_host_port_state ( struct Scsi_Host shost)

fc_get_host_port_state() - Return the port state of the given Scsi_Host : The SCSI host whose port state is to be determined

Definition at line 265 of file fc_lport.c.

void fc_get_host_speed ( struct Scsi_Host shost)

fc_get_host_speed() - Return the speed of the given Scsi_Host : The SCSI host whose port speed is to be determined

Definition at line 288 of file fc_lport.c.

struct fc_host_statistics* fc_get_host_stats ( struct Scsi_Host shost)
read

fc_get_host_stats() - Return the Scsi_Host's statistics : The SCSI host whose statistics are to be returned

Definition at line 300 of file fc_lport.c.

void fc_linkdown ( struct fc_lport lport)

fc_linkdown() - Handler for transport linkdown events : The local port whose link is down

Definition at line 603 of file fc_lport.c.

void fc_linkup ( struct fc_lport lport)

fc_linkup() - Handler for transport linkup events : The local port whose link is up

Definition at line 573 of file fc_lport.c.

int fc_lport_bsg_request ( struct fc_bsg_job job)

fc_lport_bsg_request() - The common entry point for sending FC Passthrough requests : The BSG passthrough job

Definition at line 2085 of file fc_lport.c.

int fc_lport_config ( struct fc_lport lport)

fc_lport_config() - Configure a fc_lport : The local port to be configured

Definition at line 1843 of file fc_lport.c.

int fc_lport_destroy ( struct fc_lport lport)

fc_lport_destroy() - Unregister a fc_lport : The local port to unregister

Note: exit routine for fc_lport instance clean-up all the allocated memory and free up other system resources.

Definition at line 647 of file fc_lport.c.

void fc_lport_flogi_resp ( struct fc_seq sp,
struct fc_frame fp,
void lp_arg 
)

fc_lport_flogi_resp() - Handle response to FLOGI request : The sequence that the FLOGI was on : The FLOGI response frame : The lport port that received the FLOGI response

Locking Note: This function will be called without the lport lock held, but it will lock, call an enter* function or fc_lport_error() and then unlock the lport.

Definition at line 1704 of file fc_lport.c.

int fc_lport_init ( struct fc_lport lport)

fc_lport_init() - Initialize the lport layer for a local port : The local port to initialize the exchange layer for

Definition at line 1862 of file fc_lport.c.

void fc_lport_logo_resp ( struct fc_seq sp,
struct fc_frame fp,
void lp_arg 
)

fc_lport_logo_resp() - Handle response to LOGO request : The sequence that the LOGO was on : The LOGO frame : The lport port that received the LOGO request

Locking Note: This function will be called without the lport lock held, but it will lock, call an enter* function or fc_lport_error() and then unlock the lport.

Definition at line 1625 of file fc_lport.c.

int fc_lport_reset ( struct fc_lport lport)

fc_lport_reset() - Reset a local port : The local port which should be reset

Locking Note: This functions should not be called with the lport lock held.

Definition at line 994 of file fc_lport.c.

void fc_lport_set_local_id ( struct fc_lport lport,
u32  port_id 
)

fc_lport_set_port_id() - set the local port Port ID for point-to-multipoint : The local port which will have its Port ID set. : The new port ID.

Called by the lower-level driver when transport sets the local port_id. This is used in VN_port to VN_port mode for FCoE, and causes FLOGI and discovery to be skipped.

Definition at line 777 of file fc_lport.c.

int fc_set_mfs ( struct fc_lport lport,
u32  mfs 
)

fc_set_mfs() - Set the maximum frame size for a local port : The local port to set the MFS for : The new MFS

Definition at line 669 of file fc_lport.c.

Variable Documentation

struct fc4_prov fc_lport_els_prov
Initial value:
= {
.prli = fc_lport_els_prli,
.recv = fc_lport_recv_els_req,
}

Definition at line 941 of file fc_lport.c.