Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
scsi_transport_fc.h File Reference
#include <linux/sched.h>
#include <scsi/scsi.h>
#include <scsi/scsi_netlink.h>

Go to the source code of this file.

Data Structures

struct  fc_vport_identifiers
 
struct  fc_vport
 
struct  fc_rport_identifiers
 
struct  fc_rport
 
struct  fc_starget_attrs
 
struct  fc_host_statistics
 
struct  fc_host_attrs
 
struct  fc_bsg_buffer
 
struct  fc_bsg_job
 
struct  fc_function_template
 

Macros

#define FC_COS_UNSPECIFIED   0
 
#define FC_COS_CLASS1   2
 
#define FC_COS_CLASS2   4
 
#define FC_COS_CLASS3   8
 
#define FC_COS_CLASS4   0x10
 
#define FC_COS_CLASS6   0x40
 
#define FC_PORTSPEED_UNKNOWN
 
#define FC_PORTSPEED_1GBIT   1
 
#define FC_PORTSPEED_2GBIT   2
 
#define FC_PORTSPEED_10GBIT   4
 
#define FC_PORTSPEED_4GBIT   8
 
#define FC_PORTSPEED_8GBIT   0x10
 
#define FC_PORTSPEED_16GBIT   0x20
 
#define FC_PORTSPEED_NOT_NEGOTIATED   (1 << 15) /* Speed not established */
 
#define FC_PORT_ROLE_UNKNOWN   0x00
 
#define FC_PORT_ROLE_FCP_TARGET   0x01
 
#define FC_PORT_ROLE_FCP_INITIATOR   0x02
 
#define FC_PORT_ROLE_IP_PORT   0x04
 
#define FC_RPORT_ROLE_UNKNOWN   FC_PORT_ROLE_UNKNOWN
 
#define FC_RPORT_ROLE_FCP_TARGET   FC_PORT_ROLE_FCP_TARGET
 
#define FC_RPORT_ROLE_FCP_INITIATOR   FC_PORT_ROLE_FCP_INITIATOR
 
#define FC_RPORT_ROLE_IP_PORT   FC_PORT_ROLE_IP_PORT
 
#define FC_VPORT_ATTR(_name, _mode, _show, _store)
 
#define FC_VPORT_SYMBOLIC_NAMELEN   64
 
#define FC_VPORT_CREATING   0x01
 
#define FC_VPORT_DELETING   0x02
 
#define FC_VPORT_DELETED   0x04
 
#define FC_VPORT_DEL   0x06 /* Any DELETE state */
 
#define dev_to_vport(d)   container_of(d, struct fc_vport, dev)
 
#define transport_class_to_vport(dev)   dev_to_vport(dev->parent)
 
#define vport_to_shost(v)   (v->shost)
 
#define vport_to_shost_channel(v)   (v->channel)
 
#define vport_to_parent(v)   (v->dev.parent)
 
#define VPCERR_UNSUPPORTED
 
#define VPCERR_BAD_WWN
 
#define VPCERR_NO_FABRIC_SUPP
 
#define FC_RPORT_ATTR(_name, _mode, _show, _store)
 
#define FC_RPORT_DEVLOSS_PENDING   0x01
 
#define FC_RPORT_SCAN_PENDING   0x02
 
#define FC_RPORT_FAST_FAIL_TIMEDOUT   0x04
 
#define FC_RPORT_DEVLOSS_CALLBK_DONE   0x08
 
#define dev_to_rport(d)   container_of(d, struct fc_rport, dev)
 
#define transport_class_to_rport(dev)   dev_to_rport(dev->parent)
 
#define rport_to_shost(r)   dev_to_shost(r->dev.parent)
 
#define fc_starget_node_name(x)   (((struct fc_starget_attrs *)&(x)->starget_data)->node_name)
 
#define fc_starget_port_name(x)   (((struct fc_starget_attrs *)&(x)->starget_data)->port_name)
 
#define fc_starget_port_id(x)   (((struct fc_starget_attrs *)&(x)->starget_data)->port_id)
 
#define starget_to_rport(s)   scsi_is_fc_rport(s->dev.parent) ? dev_to_rport(s->dev.parent) : NULL
 
#define FC_FC4_LIST_SIZE   32
 
#define FC_SYMBOLIC_NAME_SIZE   256
 
#define FC_VERSION_STRING_SIZE   64
 
#define FC_SERIAL_NUMBER_SIZE   80
 
#define shost_to_fc_host(x)   ((struct fc_host_attrs *)(x)->shost_data)
 
#define fc_host_node_name(x)   (((struct fc_host_attrs *)(x)->shost_data)->node_name)
 
#define fc_host_port_name(x)   (((struct fc_host_attrs *)(x)->shost_data)->port_name)
 
#define fc_host_permanent_port_name(x)   (((struct fc_host_attrs *)(x)->shost_data)->permanent_port_name)
 
#define fc_host_supported_classes(x)   (((struct fc_host_attrs *)(x)->shost_data)->supported_classes)
 
#define fc_host_supported_fc4s(x)   (((struct fc_host_attrs *)(x)->shost_data)->supported_fc4s)
 
#define fc_host_supported_speeds(x)   (((struct fc_host_attrs *)(x)->shost_data)->supported_speeds)
 
#define fc_host_maxframe_size(x)   (((struct fc_host_attrs *)(x)->shost_data)->maxframe_size)
 
#define fc_host_max_npiv_vports(x)   (((struct fc_host_attrs *)(x)->shost_data)->max_npiv_vports)
 
#define fc_host_serial_number(x)   (((struct fc_host_attrs *)(x)->shost_data)->serial_number)
 
#define fc_host_manufacturer(x)   (((struct fc_host_attrs *)(x)->shost_data)->manufacturer)
 
#define fc_host_model(x)   (((struct fc_host_attrs *)(x)->shost_data)->model)
 
#define fc_host_model_description(x)   (((struct fc_host_attrs *)(x)->shost_data)->model_description)
 
#define fc_host_hardware_version(x)   (((struct fc_host_attrs *)(x)->shost_data)->hardware_version)
 
#define fc_host_driver_version(x)   (((struct fc_host_attrs *)(x)->shost_data)->driver_version)
 
#define fc_host_firmware_version(x)   (((struct fc_host_attrs *)(x)->shost_data)->firmware_version)
 
#define fc_host_optionrom_version(x)   (((struct fc_host_attrs *)(x)->shost_data)->optionrom_version)
 
#define fc_host_port_id(x)   (((struct fc_host_attrs *)(x)->shost_data)->port_id)
 
#define fc_host_port_type(x)   (((struct fc_host_attrs *)(x)->shost_data)->port_type)
 
#define fc_host_port_state(x)   (((struct fc_host_attrs *)(x)->shost_data)->port_state)
 
#define fc_host_active_fc4s(x)   (((struct fc_host_attrs *)(x)->shost_data)->active_fc4s)
 
#define fc_host_speed(x)   (((struct fc_host_attrs *)(x)->shost_data)->speed)
 
#define fc_host_fabric_name(x)   (((struct fc_host_attrs *)(x)->shost_data)->fabric_name)
 
#define fc_host_symbolic_name(x)   (((struct fc_host_attrs *)(x)->shost_data)->symbolic_name)
 
#define fc_host_system_hostname(x)   (((struct fc_host_attrs *)(x)->shost_data)->system_hostname)
 
#define fc_host_tgtid_bind_type(x)   (((struct fc_host_attrs *)(x)->shost_data)->tgtid_bind_type)
 
#define fc_host_rports(x)   (((struct fc_host_attrs *)(x)->shost_data)->rports)
 
#define fc_host_rport_bindings(x)   (((struct fc_host_attrs *)(x)->shost_data)->rport_bindings)
 
#define fc_host_vports(x)   (((struct fc_host_attrs *)(x)->shost_data)->vports)
 
#define fc_host_next_rport_number(x)   (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number)
 
#define fc_host_next_target_id(x)   (((struct fc_host_attrs *)(x)->shost_data)->next_target_id)
 
#define fc_host_next_vport_number(x)   (((struct fc_host_attrs *)(x)->shost_data)->next_vport_number)
 
#define fc_host_npiv_vports_inuse(x)   (((struct fc_host_attrs *)(x)->shost_data)->npiv_vports_inuse)
 
#define fc_host_work_q_name(x)   (((struct fc_host_attrs *)(x)->shost_data)->work_q_name)
 
#define fc_host_work_q(x)   (((struct fc_host_attrs *)(x)->shost_data)->work_q)
 
#define fc_host_devloss_work_q_name(x)   (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name)
 
#define fc_host_devloss_work_q(x)   (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q)
 
#define fc_host_dev_loss_tmo(x)   (((struct fc_host_attrs *)(x)->shost_data)->dev_loss_tmo)
 
#define FC_RQST_STATE_INPROGRESS   0
 
#define FC_RQST_STATE_DONE   1
 

Enumerations

enum  fc_port_type {
  FC_PORTTYPE_UNKNOWN, FC_PORTTYPE_OTHER, FC_PORTTYPE_NOTPRESENT, FC_PORTTYPE_NPORT,
  FC_PORTTYPE_NLPORT, FC_PORTTYPE_LPORT, FC_PORTTYPE_PTP, FC_PORTTYPE_NPIV
}
 
enum  fc_port_state {
  FC_PORTSTATE_UNKNOWN, FC_PORTSTATE_NOTPRESENT, FC_PORTSTATE_ONLINE, FC_PORTSTATE_OFFLINE,
  FC_PORTSTATE_BLOCKED, FC_PORTSTATE_BYPASSED, FC_PORTSTATE_DIAGNOSTICS, FC_PORTSTATE_LINKDOWN,
  FC_PORTSTATE_ERROR, FC_PORTSTATE_LOOPBACK, FC_PORTSTATE_DELETED
}
 
enum  fc_vport_state {
  FC_VPORT_UNKNOWN, FC_VPORT_ACTIVE, FC_VPORT_DISABLED, FC_VPORT_LINKDOWN,
  FC_VPORT_INITIALIZING, FC_VPORT_NO_FABRIC_SUPP, FC_VPORT_NO_FABRIC_RSCS, FC_VPORT_FABRIC_LOGOUT,
  FC_VPORT_FABRIC_REJ_WWN, FC_VPORT_FAILED
}
 
enum  fc_tgtid_binding_type { FC_TGTID_BIND_NONE, FC_TGTID_BIND_BY_WWPN, FC_TGTID_BIND_BY_WWNN, FC_TGTID_BIND_BY_ID }
 
enum  fc_host_event_code {
  FCH_EVT_LIP = 0x1, FCH_EVT_LINKUP = 0x2, FCH_EVT_LINKDOWN = 0x3, FCH_EVT_LIPRESET = 0x4,
  FCH_EVT_RSCN = 0x5, FCH_EVT_ADAPTER_CHANGE = 0x103, FCH_EVT_PORT_UNKNOWN = 0x200, FCH_EVT_PORT_OFFLINE = 0x201,
  FCH_EVT_PORT_ONLINE = 0x202, FCH_EVT_PORT_FABRIC = 0x204, FCH_EVT_LINK_UNKNOWN = 0x500, FCH_EVT_VENDOR_UNIQUE = 0xffff
}
 

Functions

struct fc_vport __attribute__ ((aligned(sizeof(unsigned long))))
 
struct scsi_transport_templatefc_attach_transport (struct fc_function_template *)
 
void fc_release_transport (struct scsi_transport_template *)
 
void fc_remove_host (struct Scsi_Host *)
 
struct fc_rportfc_remote_port_add (struct Scsi_Host *shost, int channel, struct fc_rport_identifiers *ids)
 
void fc_remote_port_delete (struct fc_rport *rport)
 
void fc_remote_port_rolechg (struct fc_rport *rport, u32 roles)
 
int scsi_is_fc_rport (const struct device *)
 
u32 fc_get_event_number (void)
 
void fc_host_post_event (struct Scsi_Host *shost, u32 event_number, enum fc_host_event_code event_code, u32 event_data)
 
void fc_host_post_vendor_event (struct Scsi_Host *shost, u32 event_number, u32 data_len, char *data_buf, u64 vendor_id)
 
struct fc_vportfc_vport_create (struct Scsi_Host *shost, int channel, struct fc_vport_identifiers *)
 
int fc_vport_terminate (struct fc_vport *vport)
 
int fc_block_scsi_eh (struct scsi_cmnd *cmnd)
 

Variables

enum fc_vport_state vport_state
 
enum fc_vport_state vport_last_state
 
u64 node_name
 
u64 port_name
 
u32 roles
 
u32 vport_id
 
enum fc_port_type vport_type
 
char symbolic_name [FC_VPORT_SYMBOLIC_NAMELEN]
 
voiddd_data
 
struct Scsi_Hostshost
 
unsigned int channel
 
u32 number
 
u8 flags
 
struct list_head peers
 
struct device dev
 
struct work_struct vport_delete_work
 
struct fc_rport_identifiers __attribute__
 
u32 maxframe_size
 
u32 supported_classes
 
u32 dev_loss_tmo
 
u32 port_id
 
enum fc_port_state port_state
 
u32 scsi_target_id
 
u32 fast_io_fail_tmo
 
struct delayed_work dev_loss_work
 
struct work_struct scan_work
 
struct delayed_work fail_io_work
 
struct work_struct stgt_delete_work
 
struct work_struct rport_delete_work
 
struct request_queuerqst_q
 

Macro Definition Documentation

#define dev_to_rport (   d)    container_of(d, struct fc_rport, dev)

Definition at line 357 of file scsi_transport_fc.h.

#define dev_to_vport (   d)    container_of(d, struct fc_vport, dev)

Definition at line 252 of file scsi_transport_fc.h.

#define FC_COS_CLASS1   2

Definition at line 113 of file scsi_transport_fc.h.

#define FC_COS_CLASS2   4

Definition at line 114 of file scsi_transport_fc.h.

#define FC_COS_CLASS3   8

Definition at line 115 of file scsi_transport_fc.h.

#define FC_COS_CLASS4   0x10

Definition at line 116 of file scsi_transport_fc.h.

#define FC_COS_CLASS6   0x40

Definition at line 117 of file scsi_transport_fc.h.

#define FC_COS_UNSPECIFIED   0

Definition at line 112 of file scsi_transport_fc.h.

#define FC_FC4_LIST_SIZE   32

Definition at line 479 of file scsi_transport_fc.h.

#define fc_host_active_fc4s (   x)    (((struct fc_host_attrs *)(x)->shost_data)->active_fc4s)

Definition at line 577 of file scsi_transport_fc.h.

#define fc_host_dev_loss_tmo (   x)    (((struct fc_host_attrs *)(x)->shost_data)->dev_loss_tmo)

Definition at line 611 of file scsi_transport_fc.h.

#define fc_host_devloss_work_q (   x)    (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q)

Definition at line 609 of file scsi_transport_fc.h.

#define fc_host_devloss_work_q_name (   x)    (((struct fc_host_attrs *)(x)->shost_data)->devloss_work_q_name)

Definition at line 607 of file scsi_transport_fc.h.

#define fc_host_driver_version (   x)    (((struct fc_host_attrs *)(x)->shost_data)->driver_version)

Definition at line 565 of file scsi_transport_fc.h.

#define fc_host_fabric_name (   x)    (((struct fc_host_attrs *)(x)->shost_data)->fabric_name)

Definition at line 581 of file scsi_transport_fc.h.

#define fc_host_firmware_version (   x)    (((struct fc_host_attrs *)(x)->shost_data)->firmware_version)

Definition at line 567 of file scsi_transport_fc.h.

#define fc_host_hardware_version (   x)    (((struct fc_host_attrs *)(x)->shost_data)->hardware_version)

Definition at line 563 of file scsi_transport_fc.h.

#define fc_host_manufacturer (   x)    (((struct fc_host_attrs *)(x)->shost_data)->manufacturer)

Definition at line 557 of file scsi_transport_fc.h.

#define fc_host_max_npiv_vports (   x)    (((struct fc_host_attrs *)(x)->shost_data)->max_npiv_vports)

Definition at line 553 of file scsi_transport_fc.h.

#define fc_host_maxframe_size (   x)    (((struct fc_host_attrs *)(x)->shost_data)->maxframe_size)

Definition at line 551 of file scsi_transport_fc.h.

#define fc_host_model (   x)    (((struct fc_host_attrs *)(x)->shost_data)->model)

Definition at line 559 of file scsi_transport_fc.h.

#define fc_host_model_description (   x)    (((struct fc_host_attrs *)(x)->shost_data)->model_description)

Definition at line 561 of file scsi_transport_fc.h.

#define fc_host_next_rport_number (   x)    (((struct fc_host_attrs *)(x)->shost_data)->next_rport_number)

Definition at line 595 of file scsi_transport_fc.h.

#define fc_host_next_target_id (   x)    (((struct fc_host_attrs *)(x)->shost_data)->next_target_id)

Definition at line 597 of file scsi_transport_fc.h.

#define fc_host_next_vport_number (   x)    (((struct fc_host_attrs *)(x)->shost_data)->next_vport_number)

Definition at line 599 of file scsi_transport_fc.h.

#define fc_host_node_name (   x)    (((struct fc_host_attrs *)(x)->shost_data)->node_name)

Definition at line 539 of file scsi_transport_fc.h.

#define fc_host_npiv_vports_inuse (   x)    (((struct fc_host_attrs *)(x)->shost_data)->npiv_vports_inuse)

Definition at line 601 of file scsi_transport_fc.h.

#define fc_host_optionrom_version (   x)    (((struct fc_host_attrs *)(x)->shost_data)->optionrom_version)

Definition at line 569 of file scsi_transport_fc.h.

#define fc_host_permanent_port_name (   x)    (((struct fc_host_attrs *)(x)->shost_data)->permanent_port_name)

Definition at line 543 of file scsi_transport_fc.h.

#define fc_host_port_id (   x)    (((struct fc_host_attrs *)(x)->shost_data)->port_id)

Definition at line 571 of file scsi_transport_fc.h.

#define fc_host_port_name (   x)    (((struct fc_host_attrs *)(x)->shost_data)->port_name)

Definition at line 541 of file scsi_transport_fc.h.

#define fc_host_port_state (   x)    (((struct fc_host_attrs *)(x)->shost_data)->port_state)

Definition at line 575 of file scsi_transport_fc.h.

#define fc_host_port_type (   x)    (((struct fc_host_attrs *)(x)->shost_data)->port_type)

Definition at line 573 of file scsi_transport_fc.h.

#define fc_host_rport_bindings (   x)    (((struct fc_host_attrs *)(x)->shost_data)->rport_bindings)

Definition at line 591 of file scsi_transport_fc.h.

#define fc_host_rports (   x)    (((struct fc_host_attrs *)(x)->shost_data)->rports)

Definition at line 589 of file scsi_transport_fc.h.

#define fc_host_serial_number (   x)    (((struct fc_host_attrs *)(x)->shost_data)->serial_number)

Definition at line 555 of file scsi_transport_fc.h.

#define fc_host_speed (   x)    (((struct fc_host_attrs *)(x)->shost_data)->speed)

Definition at line 579 of file scsi_transport_fc.h.

#define fc_host_supported_classes (   x)    (((struct fc_host_attrs *)(x)->shost_data)->supported_classes)

Definition at line 545 of file scsi_transport_fc.h.

#define fc_host_supported_fc4s (   x)    (((struct fc_host_attrs *)(x)->shost_data)->supported_fc4s)

Definition at line 547 of file scsi_transport_fc.h.

#define fc_host_supported_speeds (   x)    (((struct fc_host_attrs *)(x)->shost_data)->supported_speeds)

Definition at line 549 of file scsi_transport_fc.h.

#define fc_host_symbolic_name (   x)    (((struct fc_host_attrs *)(x)->shost_data)->symbolic_name)

Definition at line 583 of file scsi_transport_fc.h.

#define fc_host_system_hostname (   x)    (((struct fc_host_attrs *)(x)->shost_data)->system_hostname)

Definition at line 585 of file scsi_transport_fc.h.

#define fc_host_tgtid_bind_type (   x)    (((struct fc_host_attrs *)(x)->shost_data)->tgtid_bind_type)

Definition at line 587 of file scsi_transport_fc.h.

#define fc_host_vports (   x)    (((struct fc_host_attrs *)(x)->shost_data)->vports)

Definition at line 593 of file scsi_transport_fc.h.

#define fc_host_work_q (   x)    (((struct fc_host_attrs *)(x)->shost_data)->work_q)

Definition at line 605 of file scsi_transport_fc.h.

#define fc_host_work_q_name (   x)    (((struct fc_host_attrs *)(x)->shost_data)->work_q_name)

Definition at line 603 of file scsi_transport_fc.h.

#define FC_PORT_ROLE_FCP_INITIATOR   0x02

Definition at line 153 of file scsi_transport_fc.h.

#define FC_PORT_ROLE_FCP_TARGET   0x01

Definition at line 152 of file scsi_transport_fc.h.

#define FC_PORT_ROLE_IP_PORT   0x04

Definition at line 154 of file scsi_transport_fc.h.

#define FC_PORT_ROLE_UNKNOWN   0x00

Definition at line 151 of file scsi_transport_fc.h.

#define FC_PORTSPEED_10GBIT   4

Definition at line 128 of file scsi_transport_fc.h.

#define FC_PORTSPEED_16GBIT   0x20

Definition at line 131 of file scsi_transport_fc.h.

#define FC_PORTSPEED_1GBIT   1

Definition at line 126 of file scsi_transport_fc.h.

#define FC_PORTSPEED_2GBIT   2

Definition at line 127 of file scsi_transport_fc.h.

#define FC_PORTSPEED_4GBIT   8

Definition at line 129 of file scsi_transport_fc.h.

#define FC_PORTSPEED_8GBIT   0x10

Definition at line 130 of file scsi_transport_fc.h.

#define FC_PORTSPEED_NOT_NEGOTIATED   (1 << 15) /* Speed not established */

Definition at line 132 of file scsi_transport_fc.h.

#define FC_PORTSPEED_UNKNOWN
Value:
0 /* Unknown - transceiver
incapable of reporting */

Definition at line 125 of file scsi_transport_fc.h.

#define FC_RPORT_ATTR (   _name,
  _mode,
  _show,
  _store 
)
Value:
struct device_attribute dev_attr_rport_##_name = \
__ATTR(_name,_mode,_show,_store)

Definition at line 285 of file scsi_transport_fc.h.

#define FC_RPORT_DEVLOSS_CALLBK_DONE   0x08

Definition at line 355 of file scsi_transport_fc.h.

#define FC_RPORT_DEVLOSS_PENDING   0x01

Definition at line 352 of file scsi_transport_fc.h.

#define FC_RPORT_FAST_FAIL_TIMEDOUT   0x04

Definition at line 354 of file scsi_transport_fc.h.

#define FC_RPORT_ROLE_FCP_INITIATOR   FC_PORT_ROLE_FCP_INITIATOR

Definition at line 159 of file scsi_transport_fc.h.

#define FC_RPORT_ROLE_FCP_TARGET   FC_PORT_ROLE_FCP_TARGET

Definition at line 158 of file scsi_transport_fc.h.

#define FC_RPORT_ROLE_IP_PORT   FC_PORT_ROLE_IP_PORT

Definition at line 160 of file scsi_transport_fc.h.

#define FC_RPORT_ROLE_UNKNOWN   FC_PORT_ROLE_UNKNOWN

Definition at line 157 of file scsi_transport_fc.h.

#define FC_RPORT_SCAN_PENDING   0x02

Definition at line 353 of file scsi_transport_fc.h.

#define FC_RQST_STATE_DONE   1

Definition at line 623 of file scsi_transport_fc.h.

#define FC_RQST_STATE_INPROGRESS   0

Definition at line 622 of file scsi_transport_fc.h.

#define FC_SERIAL_NUMBER_SIZE   80

Definition at line 482 of file scsi_transport_fc.h.

#define fc_starget_node_name (   x)    (((struct fc_starget_attrs *)&(x)->starget_data)->node_name)

Definition at line 383 of file scsi_transport_fc.h.

#define fc_starget_port_id (   x)    (((struct fc_starget_attrs *)&(x)->starget_data)->port_id)

Definition at line 387 of file scsi_transport_fc.h.

#define fc_starget_port_name (   x)    (((struct fc_starget_attrs *)&(x)->starget_data)->port_name)

Definition at line 385 of file scsi_transport_fc.h.

#define FC_SYMBOLIC_NAME_SIZE   256

Definition at line 480 of file scsi_transport_fc.h.

#define FC_VERSION_STRING_SIZE   64

Definition at line 481 of file scsi_transport_fc.h.

#define FC_VPORT_ATTR (   _name,
  _mode,
  _show,
  _store 
)
Value:
struct device_attribute dev_attr_vport_##_name = \
__ATTR(_name,_mode,_show,_store)

Definition at line 164 of file scsi_transport_fc.h.

#define FC_VPORT_CREATING   0x01

Definition at line 247 of file scsi_transport_fc.h.

#define FC_VPORT_DEL   0x06 /* Any DELETE state */

Definition at line 250 of file scsi_transport_fc.h.

#define FC_VPORT_DELETED   0x04

Definition at line 249 of file scsi_transport_fc.h.

#define FC_VPORT_DELETING   0x02

Definition at line 248 of file scsi_transport_fc.h.

#define FC_VPORT_SYMBOLIC_NAMELEN   64

Definition at line 179 of file scsi_transport_fc.h.

#define rport_to_shost (   r)    dev_to_shost(r->dev.parent)

Definition at line 361 of file scsi_transport_fc.h.

#define shost_to_fc_host (   x)    ((struct fc_host_attrs *)(x)->shost_data)

Definition at line 536 of file scsi_transport_fc.h.

#define starget_to_rport (   s)    scsi_is_fc_rport(s->dev.parent) ? dev_to_rport(s->dev.parent) : NULL

Definition at line 390 of file scsi_transport_fc.h.

#define transport_class_to_rport (   dev)    dev_to_rport(dev->parent)

Definition at line 359 of file scsi_transport_fc.h.

#define transport_class_to_vport (   dev)    dev_to_vport(dev->parent)

Definition at line 254 of file scsi_transport_fc.h.

#define VPCERR_BAD_WWN
Value:
-ENOTUNIQ /* driver validation
of WWNs failed */

Definition at line 266 of file scsi_transport_fc.h.

#define VPCERR_NO_FABRIC_SUPP
Value:
-EOPNOTSUPP /* Fabric connection
is loop or the
Fabric Port does
not support NPIV */

Definition at line 267 of file scsi_transport_fc.h.

#define VPCERR_UNSUPPORTED
Value:
-ENOSYS /* no driver/adapter
support */

Definition at line 265 of file scsi_transport_fc.h.

#define vport_to_parent (   v)    (v->dev.parent)

Definition at line 260 of file scsi_transport_fc.h.

#define vport_to_shost (   v)    (v->shost)

Definition at line 256 of file scsi_transport_fc.h.

#define vport_to_shost_channel (   v)    (v->channel)

Definition at line 258 of file scsi_transport_fc.h.

Enumeration Type Documentation

Enumerator:
FCH_EVT_LIP 
FCH_EVT_LINKUP 
FCH_EVT_LINKDOWN 
FCH_EVT_LIPRESET 
FCH_EVT_RSCN 
FCH_EVT_ADAPTER_CHANGE 
FCH_EVT_PORT_UNKNOWN 
FCH_EVT_PORT_OFFLINE 
FCH_EVT_PORT_ONLINE 
FCH_EVT_PORT_FABRIC 
FCH_EVT_LINK_UNKNOWN 
FCH_EVT_VENDOR_UNIQUE 

Definition at line 446 of file scsi_transport_fc.h.

Enumerator:
FC_PORTSTATE_UNKNOWN 
FC_PORTSTATE_NOTPRESENT 
FC_PORTSTATE_ONLINE 
FC_PORTSTATE_OFFLINE 
FC_PORTSTATE_BLOCKED 
FC_PORTSTATE_BYPASSED 
FC_PORTSTATE_DIAGNOSTICS 
FC_PORTSTATE_LINKDOWN 
FC_PORTSTATE_ERROR 
FC_PORTSTATE_LOOPBACK 
FC_PORTSTATE_DELETED 

Definition at line 72 of file scsi_transport_fc.h.

Enumerator:
FC_PORTTYPE_UNKNOWN 
FC_PORTTYPE_OTHER 
FC_PORTTYPE_NOTPRESENT 
FC_PORTTYPE_NPORT 
FC_PORTTYPE_NLPORT 
FC_PORTTYPE_LPORT 
FC_PORTTYPE_PTP 
FC_PORTTYPE_NPIV 

Definition at line 56 of file scsi_transport_fc.h.

Enumerator:
FC_TGTID_BIND_NONE 
FC_TGTID_BIND_BY_WWPN 
FC_TGTID_BIND_BY_WWNN 
FC_TGTID_BIND_BY_ID 

Definition at line 138 of file scsi_transport_fc.h.

Enumerator:
FC_VPORT_UNKNOWN 
FC_VPORT_ACTIVE 
FC_VPORT_DISABLED 
FC_VPORT_LINKDOWN 
FC_VPORT_INITIALIZING 
FC_VPORT_NO_FABRIC_SUPP 
FC_VPORT_NO_FABRIC_RSCS 
FC_VPORT_FABRIC_LOGOUT 
FC_VPORT_FABRIC_REJ_WWN 
FC_VPORT_FAILED 

Definition at line 91 of file scsi_transport_fc.h.

Function Documentation

struct scsi_transport_template* fc_attach_transport ( struct fc_function_template )
read

Definition at line 2175 of file scsi_transport_fc.c.

int fc_block_scsi_eh ( struct scsi_cmnd cmnd)

fc_block_scsi_eh - Block SCSI eh thread for blocked fc_rport : SCSI command that scsi_eh is trying to recover

This routine can be called from a FC LLD scsi_eh callback. It blocks the scsi_eh thread until the fc_rport leaves the FC_PORTSTATE_BLOCKED, or the fast_io_fail_tmo fires. This is necessary to avoid the scsi_eh failing recovery actions for blocked rports which would lead to offlined SCSI devices.

Returns: 0 if the fc_rport left the state FC_PORTSTATE_BLOCKED. FAST_IO_FAIL if the fast_io_fail_tmo fired, this should be passed back to scsi_eh.

Definition at line 3312 of file scsi_transport_fc.c.

u32 fc_get_event_number ( void  )

fc_get_event_number - Obtain the next sequential FC event number

Notes: We could have inlined this, but it would have required fc_event_seq to be exposed. For now, live with the subroutine call. Atomic used to avoid lock/unlock...

Definition at line 512 of file scsi_transport_fc.c.

void fc_host_post_event ( struct Scsi_Host shost,
u32  event_number,
enum fc_host_event_code  event_code,
u32  event_data 
)

fc_host_post_event - called to post an even on an fc_host. : host the event occurred on : fc event number obtained from get_fc_event_number() : fc_host event being posted : 32bits of data for the event being posted

Notes: This routine assumes no locks are held on entry.

Definition at line 530 of file scsi_transport_fc.c.

void fc_host_post_vendor_event ( struct Scsi_Host shost,
u32  event_number,
u32  data_len,
char data_buf,
u64  vendor_id 
)

fc_host_post_vendor_event - called to post a vendor unique event on an fc_host : host the event occurred on : fc event number obtained from get_fc_event_number() : amount, in bytes, of vendor unique data : pointer to vendor unique data : Vendor id

Notes: This routine assumes no locks are held on entry.

Definition at line 601 of file scsi_transport_fc.c.

void fc_release_transport ( struct scsi_transport_template )

Definition at line 2322 of file scsi_transport_fc.c.

struct fc_rport* fc_remote_port_add ( struct Scsi_Host shost,
int  channel,
struct fc_rport_identifiers ids 
)
read

fc_remote_port_add - notify fc transport of the existence of a remote FC port. : scsi host the remote port is connected to. : Channel on shost port connected to. : The world wide names, fc address, and FC4 port roles for the remote port.

The LLDD calls this routine to notify the transport of the existence of a remote port. The LLDD provides the unique identifiers (wwpn,wwn) of the port, it's FC address (port_id), and the FC4 roles that are active for the port.

For ports that are FCP targets (aka scsi targets), the FC transport maintains consistent target id bindings on behalf of the LLDD. A consistent target id binding is an assignment of a target id to a remote port identifier, which persists while the scsi host is attached. The remote port can disappear, then later reappear, and it's target id assignment remains the same. This allows for shifts in FC addressing (if binding by wwpn or wwnn) with no apparent changes to the scsi subsystem which is based on scsi host number and target id values. Bindings are only valid during the attachment of the scsi host. If the host detaches, then later re-attaches, target id bindings may change.

This routine is responsible for returning a remote port structure. The routine will search the list of remote ports it maintains internally on behalf of consistent target id mappings. If found, the remote port structure will be reused. Otherwise, a new remote port structure will be allocated.

Whenever a remote port is allocated, a new fc_remote_port class device is created.

Should not be called from interrupt context.

Notes: This routine assumes no locks are held on entry.

Definition at line 2733 of file scsi_transport_fc.c.

void fc_remote_port_delete ( struct fc_rport rport)

fc_remote_port_delete - notifies the fc transport that a remote port is no longer in existence. : The remote port that no longer exists

The LLDD calls this routine to notify the transport that a remote port is no longer part of the topology. Note: Although a port may no longer be part of the topology, it may persist in the remote ports displayed by the fc_host. We do this under 2 conditions: 1) If the port was a scsi target, we delay its deletion by "blocking" it. This allows the port to temporarily disappear, then reappear without disrupting the SCSI device tree attached to it. During the "blocked" period the port will still exist. 2) If the port was a scsi target and disappears for longer than we expect, we'll delete the port and the tear down the SCSI device tree attached to it. However, we want to semi-persist the target id assigned to that port if it eventually does exist. The port structure will remain (although with minimal information) so that the target id bindings remails.

If the remote port is not an FCP Target, it will be fully torn down and deallocated, including the fc_remote_port class device.

If the remote port is an FCP Target, the port will be placed in a temporary blocked state. From the LLDD's perspective, the rport no longer exists. From the SCSI midlayer's perspective, the SCSI target exists, but all sdevs on it are blocked from further I/O. The following is then expected.

If the remote port does not return (signaled by a LLDD call to fc_remote_port_add()) within the dev_loss_tmo timeout, then the scsi target is removed - killing all outstanding i/o and removing the scsi devices attached ot it. The port structure will be marked Not Present and be partially cleared, leaving only enough information to recognize the remote port relative to the scsi target id binding if it later appears. The port will remain as long as there is a valid binding (e.g. until the user changes the binding type or unloads the scsi host with the binding).

If the remote port returns within the dev_loss_tmo value (and matches according to the target id binding type), the port structure will be reused. If it is no longer a SCSI target, the target will be torn down. If it continues to be a SCSI target, then the target will be unblocked (allowing i/o to be resumed), and a scan will be activated to ensure that all luns are detected.

Called from normal process context only - cannot be called from interrupt.

Notes: This routine assumes no locks are held on entry.

Definition at line 2974 of file scsi_transport_fc.c.

void fc_remote_port_rolechg ( struct fc_rport rport,
u32  roles 
)

fc_remote_port_rolechg - notifies the fc transport that the roles on a remote may have changed. : The remote port that changed. : New roles for this port.

Description: The LLDD calls this routine to notify the transport that the roles on a remote port may have changed. The largest effect of this is if a port now becomes a FCP Target, it must be allocated a scsi target id. If the port is no longer a FCP target, any scsi target id value assigned to it will persist in case the role changes back to include FCP Target. No changes in the scsi midlayer will be invoked if the role changes (in the expectation that the role will be resumed. If it doesn't normal error processing will take place).

Should not be called from interrupt context.

Notes: This routine assumes no locks are held on entry.

Definition at line 3052 of file scsi_transport_fc.c.

void fc_remove_host ( struct Scsi_Host shost)

fc_remove_host - called to terminate any fc_transport-related elements for a scsi host. : Which &Scsi_Host

This routine is expected to be called immediately preceding the a driver's call to scsi_remove_host().

WARNING: A driver utilizing the fc_transport, which fails to call this routine prior to scsi_remove_host(), will leave dangling objects in /sys/class/fc_remote_ports. Access to any of these objects can result in a system crash !!!

Notes: This routine assumes no locks are held on entry.

Definition at line 2438 of file scsi_transport_fc.c.

struct fc_vport* fc_vport_create ( struct Scsi_Host shost,
int  channel,
struct fc_vport_identifiers ids 
)
read

fc_vport_create - Admin App or LLDD requests creation of a vport : scsi host the virtual port is connected to. : channel on shost port connected to. : The world wide names, FC4 port roles, etc for the virtual port.

Notes: This routine assumes no locks are held on entry.

Definition at line 3474 of file scsi_transport_fc.c.

int fc_vport_terminate ( struct fc_vport vport)

fc_vport_terminate - Admin App or LLDD requests termination of a vport : fc_vport to be terminated

Calls the LLDD vport_delete() function, then deallocates and removes the vport from the shost and object tree.

Notes: This routine assumes no locks are held on entry.

Definition at line 3497 of file scsi_transport_fc.c.

int scsi_is_fc_rport ( const struct device )

Definition at line 1997 of file scsi_transport_fc.c.

Variable Documentation

unsigned int channel

Definition at line 264 of file scsi_transport_fc.h.

void* dd_data

Definition at line 260 of file scsi_transport_fc.h.

Definition at line 268 of file scsi_transport_fc.h.

u32 dev_loss_tmo

Definition at line 355 of file scsi_transport_fc.h.

struct delayed_work dev_loss_work

Definition at line 375 of file scsi_transport_fc.h.

struct delayed_work fail_io_work

Definition at line 377 of file scsi_transport_fc.h.

u32 fast_io_fail_tmo

Definition at line 364 of file scsi_transport_fc.h.

u8 flags

Definition at line 266 of file scsi_transport_fc.h.

u32 maxframe_size

Definition at line 351 of file scsi_transport_fc.h.

u64 node_name

Definition at line 252 of file scsi_transport_fc.h.

u32 number

Definition at line 265 of file scsi_transport_fc.h.

Definition at line 267 of file scsi_transport_fc.h.

Definition at line 360 of file scsi_transport_fc.h.

u64 port_name

Definition at line 253 of file scsi_transport_fc.h.

enum fc_port_state port_state

Definition at line 362 of file scsi_transport_fc.h.

u32 roles

Definition at line 254 of file scsi_transport_fc.h.

struct work_struct rport_delete_work

Definition at line 379 of file scsi_transport_fc.h.

Definition at line 380 of file scsi_transport_fc.h.

struct work_struct scan_work

Definition at line 376 of file scsi_transport_fc.h.

u32 scsi_target_id

Definition at line 363 of file scsi_transport_fc.h.

struct Scsi_Host* shost

Definition at line 263 of file scsi_transport_fc.h.

struct work_struct stgt_delete_work

Definition at line 378 of file scsi_transport_fc.h.

u32 supported_classes

Definition at line 352 of file scsi_transport_fc.h.

Definition at line 257 of file scsi_transport_fc.h.

struct work_struct vport_delete_work

Definition at line 269 of file scsi_transport_fc.h.

u32 vport_id

Definition at line 255 of file scsi_transport_fc.h.

enum fc_vport_state vport_last_state

Definition at line 251 of file scsi_transport_fc.h.

enum fc_vport_state vport_state

Definition at line 250 of file scsi_transport_fc.h.

enum fc_port_type vport_type

Definition at line 256 of file scsi_transport_fc.h.