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)
 
 FILE_SECBOOT (PERMITTED)
 
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 38 of file fcp.h.

◆ FCP_CMND_RDDATA

#define FCP_CMND_RDDATA   0x02

Command includes data-in.

Definition at line 41 of file fcp.h.

◆ FCP_TAG_MAGIC

#define FCP_TAG_MAGIC   0x18ae0000

FCP tag magic marker.

Definition at line 44 of file fcp.h.

◆ FCP_RSP_RESPONSE_LEN_VALID

#define FCP_RSP_RESPONSE_LEN_VALID   0x01

Response length field is valid.

Definition at line 75 of file fcp.h.

◆ FCP_RSP_SENSE_LEN_VALID

#define FCP_RSP_SENSE_LEN_VALID   0x02

Sense length field is valid.

Definition at line 78 of file fcp.h.

◆ FCP_RSP_RESIDUAL_OVERRUN

#define FCP_RSP_RESIDUAL_OVERRUN   0x04

Residual represents overrun.

Definition at line 81 of file fcp.h.

◆ FCP_RSP_RESIDUAL_UNDERRUN

#define FCP_RSP_RESIDUAL_UNDERRUN   0x08

Residual represents underrun.

Definition at line 84 of file fcp.h.

◆ FCP_PRLI_NO_WRITE_RDY

#define FCP_PRLI_NO_WRITE_RDY   0x0001

Write FCP_XFER_RDY disabled.

Definition at line 138 of file fcp.h.

◆ FCP_PRLI_NO_READ_RDY

#define FCP_PRLI_NO_READ_RDY   0x0002

Read FCP_XFER_RDY disabled.

Definition at line 141 of file fcp.h.

◆ FCP_PRLI_TARGET

#define FCP_PRLI_TARGET   0x0010

Has target functionality.

Definition at line 144 of file fcp.h.

◆ FCP_PRLI_INITIATOR

#define FCP_PRLI_INITIATOR   0x0020

Has initiator functionality.

Definition at line 147 of file fcp.h.

◆ FCP_PRLI_OVERLAY

#define FCP_PRLI_OVERLAY   0x0040

Data overlay allowed.

Definition at line 150 of file fcp.h.

◆ FCP_PRLI_CONF

#define FCP_PRLI_CONF   0x0080

Confirm completion allowed.

Definition at line 153 of file fcp.h.

◆ FCP_PRLI_RETRY

#define FCP_PRLI_RETRY   0x0100

Retransmission supported.

Definition at line 156 of file fcp.h.

◆ FCP_PRLI_TASK_RETRY

#define FCP_PRLI_TASK_RETRY   0x0200

Task retry identification.

Definition at line 159 of file fcp.h.

◆ FCP_PRLI_REC

#define FCP_PRLI_REC   0x0400

REC ELS supported.

Definition at line 162 of file fcp.h.

◆ FCP_PRLI_ENH_DISC

#define FCP_PRLI_ENH_DISC   0x0800

Enhanced discovery supported.

Definition at line 165 of file fcp.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED  )

◆ 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 92 of file fcp.h.

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

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 103 of file fcp.h.

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

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 114 of file fcp.h.

114  {
115  return ( ( rsp->flags & FCP_RSP_SENSE_LEN_VALID ) ?
116  ( ( ( void * ) rsp ) + sizeof ( *rsp ) +
118 }
uint64_t rsp
Definition: librm.h:153
static size_t fcp_rsp_response_data_len(struct fcp_rsp *rsp)
Get length of response data portion of FCP response.
Definition: fcp.h:103
#define FCP_RSP_SENSE_LEN_VALID
Sense length field is valid.
Definition: fcp.h:78
#define NULL
NULL pointer (VOID *)
Definition: Base.h:322

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 126 of file fcp.h.

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

References FCP_RSP_SENSE_LEN_VALID, ntohl, and rsp.

Referenced by fcpcmd_recv_rsp().