iPXE
Data Structures | Macros | Functions
fcp.h File Reference

Fibre Channel Protocol. More...

#include <stdint.h>
#include <ipxe/fc.h>
#include <ipxe/fcels.h>
#include <ipxe/scsi.h>

Go to the source code of this file.

Data Structures

struct  fcp_cmnd
 An FCP command IU. More...
 
struct  fcp_xfer_rdy
 An FCP transfer ready IU. More...
 
struct  fcp_rsp
 An FCP response IU. More...
 
struct  fcp_prli_service_parameters
 An FCP PRLI service parameter page. More...
 
struct  fcp_description
 An FCP device description. More...
 

Macros

#define FCP_CMND_WRDATA   0x01
 Command includes data-out. More...
 
#define FCP_CMND_RDDATA   0x02
 Command includes data-in. More...
 
#define FCP_TAG_MAGIC   0x18ae0000
 FCP tag magic marker. More...
 
#define FCP_RSP_RESPONSE_LEN_VALID   0x01
 Response length field is valid. More...
 
#define FCP_RSP_SENSE_LEN_VALID   0x02
 Sense length field is valid. More...
 
#define FCP_RSP_RESIDUAL_OVERRUN   0x04
 Residual represents overrun. More...
 
#define FCP_RSP_RESIDUAL_UNDERRUN   0x08
 Residual represents underrun. More...
 
#define FCP_PRLI_NO_WRITE_RDY   0x0001
 Write FCP_XFER_RDY disabled. More...
 
#define FCP_PRLI_NO_READ_RDY   0x0002
 Read FCP_XFER_RDY disabled. More...
 
#define FCP_PRLI_TARGET   0x0010
 Has target functionality. More...
 
#define FCP_PRLI_INITIATOR   0x0020
 Has initiator functionality. More...
 
#define FCP_PRLI_OVERLAY   0x0040
 Data overlay allowed. More...
 
#define FCP_PRLI_CONF   0x0080
 Confirm completion allowed. More...
 
#define FCP_PRLI_RETRY   0x0100
 Retransmission supported. More...
 
#define FCP_PRLI_TASK_RETRY   0x0200
 Task retry identification. More...
 
#define FCP_PRLI_REC   0x0400
 REC ELS supported. More...
 
#define FCP_PRLI_ENH_DISC   0x0800
 Enhanced discovery supported. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static void * fcp_rsp_response_data (struct fcp_rsp *rsp)
 Get response data portion of FCP response. More...
 
static size_t fcp_rsp_response_data_len (struct fcp_rsp *rsp)
 Get length of response data portion of FCP response. More...
 
static void * fcp_rsp_sense_data (struct fcp_rsp *rsp)
 Get sense data portion of FCP response. More...
 
static size_t fcp_rsp_sense_data_len (struct fcp_rsp *rsp)
 Get length of sense data portion of FCP response. More...
 

Detailed Description

Fibre Channel Protocol.

Definition in file fcp.h.

Macro Definition Documentation

◆ FCP_CMND_WRDATA

#define FCP_CMND_WRDATA   0x01

Command includes data-out.

Definition at line 37 of file fcp.h.

◆ FCP_CMND_RDDATA

#define FCP_CMND_RDDATA   0x02

Command includes data-in.

Definition at line 40 of file fcp.h.

◆ FCP_TAG_MAGIC

#define FCP_TAG_MAGIC   0x18ae0000

FCP tag magic marker.

Definition at line 43 of file fcp.h.

◆ FCP_RSP_RESPONSE_LEN_VALID

#define FCP_RSP_RESPONSE_LEN_VALID   0x01

Response length field is valid.

Definition at line 74 of file fcp.h.

◆ FCP_RSP_SENSE_LEN_VALID

#define FCP_RSP_SENSE_LEN_VALID   0x02

Sense length field is valid.

Definition at line 77 of file fcp.h.

◆ FCP_RSP_RESIDUAL_OVERRUN

#define FCP_RSP_RESIDUAL_OVERRUN   0x04

Residual represents overrun.

Definition at line 80 of file fcp.h.

◆ FCP_RSP_RESIDUAL_UNDERRUN

#define FCP_RSP_RESIDUAL_UNDERRUN   0x08

Residual represents underrun.

Definition at line 83 of file fcp.h.

◆ FCP_PRLI_NO_WRITE_RDY

#define FCP_PRLI_NO_WRITE_RDY   0x0001

Write FCP_XFER_RDY disabled.

Definition at line 137 of file fcp.h.

◆ FCP_PRLI_NO_READ_RDY

#define FCP_PRLI_NO_READ_RDY   0x0002

Read FCP_XFER_RDY disabled.

Definition at line 140 of file fcp.h.

◆ FCP_PRLI_TARGET

#define FCP_PRLI_TARGET   0x0010

Has target functionality.

Definition at line 143 of file fcp.h.

◆ FCP_PRLI_INITIATOR

#define FCP_PRLI_INITIATOR   0x0020

Has initiator functionality.

Definition at line 146 of file fcp.h.

◆ FCP_PRLI_OVERLAY

#define FCP_PRLI_OVERLAY   0x0040

Data overlay allowed.

Definition at line 149 of file fcp.h.

◆ FCP_PRLI_CONF

#define FCP_PRLI_CONF   0x0080

Confirm completion allowed.

Definition at line 152 of file fcp.h.

◆ FCP_PRLI_RETRY

#define FCP_PRLI_RETRY   0x0100

Retransmission supported.

Definition at line 155 of file fcp.h.

◆ FCP_PRLI_TASK_RETRY

#define FCP_PRLI_TASK_RETRY   0x0200

Task retry identification.

Definition at line 158 of file fcp.h.

◆ FCP_PRLI_REC

#define FCP_PRLI_REC   0x0400

REC ELS supported.

Definition at line 161 of file fcp.h.

◆ FCP_PRLI_ENH_DISC

#define FCP_PRLI_ENH_DISC   0x0800

Enhanced discovery supported.

Definition at line 164 of file fcp.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ fcp_rsp_response_data()

static void* fcp_rsp_response_data ( struct fcp_rsp rsp)
inlinestatic

Get response data portion of FCP response.

Parameters
rspFCP response
Return values
response_dataResponse data, or NULL if not present

Definition at line 91 of file fcp.h.

91  {
92  return ( ( rsp->flags & FCP_RSP_RESPONSE_LEN_VALID ) ?
93  ( ( ( void * ) rsp ) + sizeof ( *rsp ) ) : NULL );
94 }
uint64_t rsp
Definition: librm.h:267
#define FCP_RSP_RESPONSE_LEN_VALID
Response length field is valid.
Definition: fcp.h:74
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References FCP_RSP_RESPONSE_LEN_VALID, NULL, and rsp.

Referenced by fcpcmd_recv_rsp().

◆ fcp_rsp_response_data_len()

static size_t fcp_rsp_response_data_len ( struct fcp_rsp rsp)
inlinestatic

Get length of response data portion of FCP response.

Parameters
rspFCP response
Return values
response_data_lenResponse data length

Definition at line 102 of file fcp.h.

102  {
103  return ( ( rsp->flags & FCP_RSP_RESPONSE_LEN_VALID ) ?
104  ntohl ( rsp->response_len ) : 0 );
105 }
#define ntohl(value)
Definition: byteswap.h:134
uint64_t rsp
Definition: librm.h:267
#define FCP_RSP_RESPONSE_LEN_VALID
Response length field is valid.
Definition: fcp.h:74

References FCP_RSP_RESPONSE_LEN_VALID, ntohl, and rsp.

Referenced by fcp_rsp_sense_data(), and fcpcmd_recv_rsp().

◆ fcp_rsp_sense_data()

static void* fcp_rsp_sense_data ( struct fcp_rsp rsp)
inlinestatic

Get sense data portion of FCP response.

Parameters
rspFCP response
Return values
sense_dataSense data, or NULL if not present

Definition at line 113 of file fcp.h.

113  {
114  return ( ( rsp->flags & FCP_RSP_SENSE_LEN_VALID ) ?
115  ( ( ( void * ) rsp ) + sizeof ( *rsp ) +
117 }
uint64_t rsp
Definition: librm.h:267
static size_t fcp_rsp_response_data_len(struct fcp_rsp *rsp)
Get length of response data portion of FCP response.
Definition: fcp.h:102
#define FCP_RSP_SENSE_LEN_VALID
Sense length field is valid.
Definition: fcp.h:77
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References fcp_rsp_response_data_len(), FCP_RSP_SENSE_LEN_VALID, NULL, and rsp.

Referenced by fcpcmd_recv_rsp().

◆ fcp_rsp_sense_data_len()

static size_t fcp_rsp_sense_data_len ( struct fcp_rsp rsp)
inlinestatic

Get length of sense data portion of FCP response.

Parameters
rspFCP response
Return values
sense_data_lenSense data length

Definition at line 125 of file fcp.h.

125  {
126  return ( ( rsp->flags & FCP_RSP_SENSE_LEN_VALID ) ?
127  ntohl ( rsp->sense_len ) : 0 );
128 }
#define ntohl(value)
Definition: byteswap.h:134
uint64_t rsp
Definition: librm.h:267
#define FCP_RSP_SENSE_LEN_VALID
Sense length field is valid.
Definition: fcp.h:77

References FCP_RSP_SENSE_LEN_VALID, ntohl, and rsp.

Referenced by fcpcmd_recv_rsp().