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

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.
static size_t fcp_rsp_response_data_len (struct fcp_rsp *rsp)
 Get length of response data portion of FCP response.
static void * fcp_rsp_sense_data (struct fcp_rsp *rsp)
 Get sense data portion of FCP response.
static size_t fcp_rsp_sense_data_len (struct fcp_rsp *rsp)
 Get length of sense data portion of FCP response.

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.

Referenced by fcpcmd_send_cmnd().

◆ FCP_CMND_RDDATA

#define FCP_CMND_RDDATA   0x02

Command includes data-in.

Definition at line 41 of file fcp.h.

Referenced by fcpcmd_send_cmnd().

◆ FCP_TAG_MAGIC

#define FCP_TAG_MAGIC   0x18ae0000

FCP tag magic marker.

Definition at line 44 of file fcp.h.

Referenced by fcpdev_scsi_command().

◆ 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.

Referenced by fcp_rsp_response_data(), fcp_rsp_response_data_len(), and fcpcmd_recv_rsp().

◆ 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.

Referenced by fcp_rsp_sense_data(), fcp_rsp_sense_data_len(), and fcpcmd_recv_rsp().

◆ FCP_RSP_RESIDUAL_OVERRUN

#define FCP_RSP_RESIDUAL_OVERRUN   0x04

Residual represents overrun.

Definition at line 81 of file fcp.h.

Referenced by fcpcmd_recv_rsp().

◆ FCP_RSP_RESIDUAL_UNDERRUN

#define FCP_RSP_RESIDUAL_UNDERRUN   0x08

Residual represents underrun.

Definition at line 84 of file fcp.h.

Referenced by fcpcmd_recv_rsp().

◆ 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.

Referenced by fcp_prli_tx().

◆ FCP_PRLI_TARGET

#define FCP_PRLI_TARGET   0x0010

Has target functionality.

Definition at line 144 of file fcp.h.

Referenced by fcpdev_scsi_command().

◆ FCP_PRLI_INITIATOR

#define FCP_PRLI_INITIATOR   0x0020

Has initiator functionality.

Definition at line 147 of file fcp.h.

Referenced by fcp_prli_tx().

◆ 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()

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}
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
#define FCP_RSP_RESPONSE_LEN_VALID
Response length field is valid.
Definition fcp.h:75
uint64_t rsp
Definition librm.h:18

References FCP_RSP_RESPONSE_LEN_VALID, NULL, and rsp.

Referenced by fcpcmd_recv_rsp().

◆ fcp_rsp_response_data_len()

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

References FCP_RSP_RESPONSE_LEN_VALID, ntohl, and rsp.

Referenced by fcp_rsp_sense_data(), and fcpcmd_recv_rsp().

◆ fcp_rsp_sense_data()

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}
#define FCP_RSP_SENSE_LEN_VALID
Sense length field is valid.
Definition fcp.h:78
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

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

Referenced by fcpcmd_recv_rsp().

◆ fcp_rsp_sense_data_len()

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}

References FCP_RSP_SENSE_LEN_VALID, ntohl, and rsp.

Referenced by fcpcmd_recv_rsp().