iPXE
|
Fibre Channel Extended Link Services. More...
#include <stdint.h>
#include <ipxe/fc.h>
#include <ipxe/tables.h>
#include <ipxe/refcnt.h>
#include <ipxe/list.h>
#include <ipxe/process.h>
#include <ipxe/interface.h>
Go to the source code of this file.
Data Structures | |
struct | fc_els_frame_common |
Fibre Channel ELS frame common parameters. More... | |
struct | fc_ls_rjt_frame |
A Fibre Channel LS_RJT frame. More... | |
struct | fc_login_common |
Fibre Channel "common" service parameters. More... | |
struct | fc_login_class |
Fibre Channel class-specific login parameters. More... | |
struct | fc_login_frame |
A Fibre Channel FLOGI/PLOGI frame. More... | |
struct | fc_logout_request_frame |
A Fibre Channel LOGO request frame. More... | |
struct | fc_logout_response_frame |
A Fibre Channel LOGO response frame. More... | |
struct | fc_prli_page |
A Fibre Channel PRLI service parameter page. More... | |
struct | fc_prli_frame |
A Fibre Channel PRLI frame. More... | |
struct | fc_rtv_request_frame |
A Fibre Channel RTV request frame. More... | |
struct | fc_rtv_response_frame |
A Fibre Channel RTV response frame. More... | |
struct | fc_echo_frame_header |
A Fibre Channel ECHO frame. More... | |
struct | fc_els |
A Fibre Channel extended link services transaction. More... | |
struct | fc_els_handler |
A Fibre Channel extended link services handler. More... | |
struct | fc_els_prli_descriptor |
A Fibre Channel ELS PRLI descriptor. More... | |
Macros | |
#define | FC_LOGIN_VERSION 0x2020 |
Fibre Channel default login version. More... | |
#define | FC_LOGIN_DEFAULT_B2B 10 |
Fibre Channel default buffer-to-buffer credit. More... | |
#define | FC_LOGIN_CONTINUOUS_OFFSET 0x8000 |
Continuously increasing relative offset. More... | |
#define | FC_LOGIN_CLEAN 0x8000 |
Clean address. More... | |
#define | FC_LOGIN_MULTI_N 0x8000 |
Multiple N_Port_ID support. More... | |
#define | FC_LOGIN_RANDOM_OFFSET 0x4000 |
Random relative offset. More... | |
#define | FC_LOGIN_VIRTUAL 0x4000 |
Virtual fabrics. More... | |
#define | FC_LOGIN_VENDOR 0x2000 |
Vendor version level. More... | |
#define | FC_LOGIN_MULTI_F 0x2000 |
Multiple N_Port_ID support. More... | |
#define | FC_LOGIN_F_PORT 0x1000 |
Forwarder port. More... | |
#define | FC_LOGIN_ALT_CREDIT 0x0800 |
Alternative credit management. More... | |
#define | FC_LOGIN_NSS_STARTED 0x0800 |
Name server session started. More... | |
#define | FC_LOGIN_NSS_BEGIN 0x0400 |
Begin name server session. More... | |
#define | FC_LOGIN_HIRES_E_D_TOV 0x0400 |
1ns error detection timer resolution More... | |
#define | FC_LOGIN_BROADCAST 0x0100 |
Broadcast supported. More... | |
#define | FC_LOGIN_QUERY_BUF 0x0040 |
Query buffer conditions. More... | |
#define | FC_LOGIN_SECURITY 0x0020 |
Security. More... | |
#define | FC_LOGIN_CLOCK_SYNC 0x0010 |
Clock sync primitive capable. More... | |
#define | FC_LOGIN_SHORT_R_T_TOV 0x0008 |
Short R_T timeout. More... | |
#define | FC_LOGIN_DHD 0x0004 |
Dynamic half duplex. More... | |
#define | FC_LOGIN_CONTINUOUS_SEQ 0x0002 |
Continuously increasing sequence count. More... | |
#define | FC_LOGIN_PAYLOAD 0x0001 |
Payload. More... | |
#define | FC_LOGIN_DEFAULT_MTU 1452 |
Fibre Channel default MTU. More... | |
#define | FC_LOGIN_DEFAULT_MAX_SEQ 255 |
Default maximum number of concurrent sequences. More... | |
#define | FC_LOGIN_DEFAULT_REL_OFFS 0x1f |
Default relative offset by info category. More... | |
#define | FC_LOGIN_DEFAULT_E_D_TOV 2000 |
Default E_D timeout value. More... | |
#define | FC_LOGIN_CLASS_VALID 0x8000 |
Class valid. More... | |
#define | FC_LOGIN_CLASS_SEQUENTIAL 0x0800 |
Sequential delivery requested. More... | |
#define | FC_PRLI_ESTABLISH 0x2000 |
Establish image pair. More... | |
#define | FC_PRLI_RESPONSE_MASK 0x0f00 |
Response code mask. More... | |
#define | FC_PRLI_RESPONSE_SUCCESS 0x0100 |
Request was executed successfully. More... | |
#define | FC_RTV_HIRES_E_D_TOV 0x0400 |
1ns error detection timer resolution More... | |
#define | FC_RTV_SHORT_R_T_TOV 0x0008 |
Short R_T timeout. More... | |
#define | FC_ELS_HANDLERS __table ( struct fc_els_handler, "fc_els_handlers" ) |
Fibre Channel ELS handler table. More... | |
#define | __fc_els_handler __table_entry ( FC_ELS_HANDLERS, 01 ) |
Declare a Fibre Channel ELS handler. More... | |
#define | FC_ELS_PRLI_DESCRIPTORS __table ( struct fc_els_prli_descriptor, "fc_els_prli_descriptors" ) |
Fibre Channel ELS PRLI descriptor table. More... | |
#define | __fc_els_prli_descriptor __table_entry ( FC_ELS_PRLI_DESCRIPTORS, 01 ) |
Declare a Fibre Channel ELS PRLI descriptor. More... | |
Enumerations | |
enum | fc_els_command_code { FC_ELS_LS_RJT = 0x01, FC_ELS_LS_ACC = 0x02, FC_ELS_PLOGI = 0x03, FC_ELS_FLOGI = 0x04, FC_ELS_LOGO = 0x05, FC_ELS_RTV = 0x0e, FC_ELS_ECHO = 0x10, FC_ELS_PRLI = 0x20, FC_ELS_PRLO = 0x21 } |
Fibre Channel ELS command codes. More... | |
enum | fc_els_reject_reason { FC_ELS_RJT_INVALID_COMMAND = 0x01, FC_ELS_RJT_ILLOGICAL = 0x03, FC_ELS_RJT_BUSY = 0x05, FC_ELS_RJT_PROTOCOL = 0x07, FC_ELS_RJT_UNABLE = 0x09, FC_ELS_RJT_UNSUPPORTED = 0x0b, FC_ELS_RJT_IN_PROGRESS = 0x0e } |
Fibre Channel ELS rejection reason codes. More... | |
enum | fc_els_flags { FC_ELS_REQUEST = 0x0001 } |
Fibre Channel extended link services transaction flags. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static int | fc_els_is_request (struct fc_els *els) |
Check if Fibre Channel ELS transaction is a request. More... | |
static unsigned int | fc_els_tx_command (struct fc_els *els, unsigned int request_command) |
Calculate ELS command to transmit. More... | |
int | fc_els_tx (struct fc_els *els, const void *data, size_t len) |
Transmit Fibre Channel ELS frame. More... | |
int | fc_els_request (struct interface *job, struct fc_port *port, struct fc_port_id *peer_port_id, struct fc_els_handler *handler) |
Create ELS request. More... | |
int | fc_els_flogi (struct interface *parent, struct fc_port *port) |
Create FLOGI request. More... | |
int | fc_els_plogi (struct interface *parent, struct fc_port *port, struct fc_port_id *peer_port_id) |
Create PLOGI request. More... | |
int | fc_els_logo (struct interface *parent, struct fc_port *port, struct fc_port_id *peer_port_id) |
Create LOGO request. More... | |
int | fc_els_prli (struct interface *parent, struct fc_port *port, struct fc_port_id *peer_port_id, unsigned int type) |
Create PRLI request. More... | |
int | fc_els_prli_tx (struct fc_els *els, struct fc_els_prli_descriptor *descriptor, void *param) |
Transmit PRLI. More... | |
int | fc_els_prli_rx (struct fc_els *els, struct fc_els_prli_descriptor *descriptor, void *data, size_t len) |
Receive PRLI. More... | |
int | fc_els_prli_detect (struct fc_els *els __unused, struct fc_els_prli_descriptor *descriptor, const void *data, size_t len) |
Detect PRLI. More... | |
Fibre Channel Extended Link Services.
Definition in file fcels.h.
#define FC_LOGIN_VERSION 0x2020 |
#define FC_LOGIN_DEFAULT_B2B 10 |
#define FC_LOGIN_CONTINUOUS_OFFSET 0x8000 |
#define FC_LOGIN_RANDOM_OFFSET 0x4000 |
#define FC_LOGIN_ALT_CREDIT 0x0800 |
#define FC_LOGIN_NSS_STARTED 0x0800 |
#define FC_LOGIN_NSS_BEGIN 0x0400 |
#define FC_LOGIN_HIRES_E_D_TOV 0x0400 |
#define FC_LOGIN_CLOCK_SYNC 0x0010 |
#define FC_LOGIN_CONTINUOUS_SEQ 0x0002 |
#define FC_LOGIN_DEFAULT_MTU 1452 |
#define FC_LOGIN_DEFAULT_MAX_SEQ 255 |
#define FC_LOGIN_DEFAULT_REL_OFFS 0x1f |
#define FC_LOGIN_DEFAULT_E_D_TOV 2000 |
#define FC_LOGIN_CLASS_SEQUENTIAL 0x0800 |
#define FC_PRLI_RESPONSE_SUCCESS 0x0100 |
#define FC_RTV_HIRES_E_D_TOV 0x0400 |
#define FC_ELS_HANDLERS __table ( struct fc_els_handler, "fc_els_handlers" ) |
struct fc_els_handler fc_els_echo_handler __fc_els_handler __table_entry ( FC_ELS_HANDLERS, 01 ) |
#define FC_ELS_PRLI_DESCRIPTORS __table ( struct fc_els_prli_descriptor, "fc_els_prli_descriptors" ) |
struct fc_els_prli_descriptor fcp_prli_descriptor __fc_els_prli_descriptor __table_entry ( FC_ELS_PRLI_DESCRIPTORS, 01 ) |
enum fc_els_command_code |
Fibre Channel ELS command codes.
Definition at line 30 of file fcels.h.
enum fc_els_reject_reason |
Fibre Channel ELS rejection reason codes.
Definition at line 57 of file fcels.h.
enum fc_els_flags |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Check if Fibre Channel ELS transaction is a request.
els | Fibre Channel ELS transaction |
is_request | ELS transaction is a request |
Definition at line 408 of file fcels.h.
References FC_ELS_REQUEST, and fc_els::flags.
Referenced by fc_els_echo_rx(), fc_els_flogi_rx(), fc_els_logo_rx(), fc_els_plogi_rx(), fc_els_prli_rx(), fc_els_prli_tx(), fc_els_rtv_rx(), fc_els_rx(), fc_els_step(), fc_els_tx(), fc_els_tx_command(), and fc_els_unknown_rx().
|
inlinestatic |
Calculate ELS command to transmit.
els | Fibre Channel ELS transaction |
request_command | Command for requests |
command | Command to transmit |
Definition at line 419 of file fcels.h.
References fc_els_is_request(), and FC_ELS_LS_ACC.
Referenced by fc_els_flogi_tx(), fc_els_plogi_tx(), and fc_els_prli_tx().
Transmit Fibre Channel ELS frame.
els | Fibre Channel ELS transaction |
data | Data to transmit |
len | Length of data |
rc | Return status code |
Definition at line 126 of file fcels.c.
References data, DBGC, DBGC2, DBGC2_HDA, dest, fc_els_is_request(), fc_fill_sockaddr(), FCELS_ARGS, FCELS_FMT, len, memset(), meta(), fc_els::peer_port_id, rc, strerror(), fc_els::xchg, xfer_deliver_raw_meta(), XFER_FL_OUT, XFER_FL_OVER, and XFER_FL_RESPONSE.
Referenced by fc_els_echo_rx_request(), fc_els_echo_tx(), fc_els_flogi_tx(), fc_els_logo_tx(), fc_els_logo_tx_response(), fc_els_plogi_tx(), fc_els_prli_tx(), fc_els_rtv_tx_response(), and fc_els_unknown_tx_response().
int fc_els_request | ( | struct interface * | job, |
struct fc_port * | port, | ||
struct fc_port_id * | peer_port_id, | ||
struct fc_els_handler * | handler | ||
) |
Create ELS request.
job | Parent job-control interface |
port | Fibre Channel port |
peer_port_id | Peer port ID |
handler | ELS handler |
rc | Return status code |
Definition at line 323 of file fcels.c.
References ENOMEM, fc_els_create(), FC_ELS_REQUEST, fc_els::flags, fc_els::handler, intf_plug_plug(), fc_els::job, fc_els::peer_port_id, port, fc_els::process, process_add(), ref_put, and fc_els::refcnt.
Referenced by fc_els_flogi(), fc_els_logo(), fc_els_plogi(), fc_els_prli(), and fcels().
Create FLOGI request.
parent | Parent interface |
port | Fibre Channel port |
rc | Return status code |
Definition at line 581 of file fcels.c.
References fc_els_request(), fc_f_port_id, and port.
Referenced by fc_port_examine().
int fc_els_plogi | ( | struct interface * | parent, |
struct fc_port * | port, | ||
struct fc_port_id * | peer_port_id | ||
) |
Create PLOGI request.
parent | Parent interface |
port | Fibre Channel port |
peer_port_id | Peer port ID |
rc | Return status code |
Definition at line 733 of file fcels.c.
References fc_els_request(), and port.
Referenced by fc_peer_plogi(), and fc_port_login().
int fc_els_logo | ( | struct interface * | parent, |
struct fc_port * | port, | ||
struct fc_port_id * | peer_port_id | ||
) |
Create LOGO request.
parent | Parent interface |
port | Fibre Channel port |
peer_port_id | Peer port ID |
rc | Return status code |
Definition at line 911 of file fcels.c.
References fc_els_request(), and port.
int fc_els_prli | ( | struct interface * | parent, |
struct fc_port * | port, | ||
struct fc_port_id * | peer_port_id, | ||
unsigned int | type | ||
) |
Create PRLI request.
parent | Parent interface |
port | Fibre Channel port |
peer_port_id | Peer port ID |
type | Upper-layer protocol type |
rc | Return status code |
Definition at line 1124 of file fcels.c.
References ENOTSUP, fc_els_prli_descriptor(), fc_els_request(), fc_els_prli_descriptor::handler, port, and type.
Referenced by fc_ulp_examine().
int fc_els_prli_tx | ( | struct fc_els * | els, |
struct fc_els_prli_descriptor * | descriptor, | ||
void * | param | ||
) |
Transmit PRLI.
els | Fibre Channel ELS transaction |
descriptor | ELS PRLI descriptor |
param | Service parameters |
rc | Return status code |
Definition at line 950 of file fcels.c.
References __attribute__, ENOMEM, fc_els_is_request(), FC_ELS_PRLI, fc_els_tx(), fc_els_tx_command(), fc_link_ok(), FC_PRLI_ESTABLISH, FC_PRLI_RESPONSE_SUCCESS, fc_ulp_get_port_id_type(), fc_ulp_put(), frame, htons, fc_ulp::link, memcpy(), memset(), param, fc_els_prli_descriptor::param_len, fc_els::peer_port_id, fc_els::port, fc_ulp::prli, rc, and fc_els_prli_descriptor::type.
Referenced by fcp_prli_tx().
int fc_els_prli_rx | ( | struct fc_els * | els, |
struct fc_els_prli_descriptor * | descriptor, | ||
void * | data, | ||
size_t | len | ||
) |
Receive PRLI.
els | Fibre Channel ELS transaction |
descriptor | ELS PRLI descriptor |
frame | ELS frame |
len | Length of ELS frame |
rc | Return status code |
Definition at line 1006 of file fcels.c.
References __attribute__, data, DBGC, DBGC_HDA, EACCES, EINVAL, ENOMEM, fc_els_is_request(), fc_link_ok(), FC_PRLI_ESTABLISH, fc_ulp_get_port_id_type(), fc_ulp_login(), fc_ulp_logout(), fc_ulp_put(), FCELS_ARGS, FCELS_FMT, frame, fc_els::handler, htons, len, fc_peer::link, fc_ulp::param, fc_els_prli_descriptor::param_len, fc_ulp::peer, fc_els::peer_port_id, fc_els::port, fc_ulp::prli, rc, strerror(), fc_els_handler::tx, and fc_els_prli_descriptor::type.
Referenced by fcp_prli_rx().
int fc_els_prli_detect | ( | struct fc_els *els | __unused, |
struct fc_els_prli_descriptor * | descriptor, | ||
const void * | data, | ||
size_t | len | ||
) |
Detect PRLI.
els | Fibre Channel ELS transaction |
descriptor | ELS PRLI descriptor |
data | ELS frame |
len | Length of ELS frame |
rc | Return status code |
Definition at line 1092 of file fcels.c.
References __attribute__, data, EINVAL, FC_ELS_PRLI, frame, len, fc_ulp::param, fc_els_prli_descriptor::param_len, and fc_els_prli_descriptor::type.
Referenced by fcp_prli_detect().