iPXE
Data Structures | Defines | 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...

Defines

#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)
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.


Define Documentation

#define FCP_CMND_WRDATA   0x01

Command includes data-out.

Definition at line 37 of file fcp.h.

Referenced by fcpcmd_send_cmnd().

#define FCP_CMND_RDDATA   0x02

Command includes data-in.

Definition at line 40 of file fcp.h.

Referenced by fcpcmd_send_cmnd().

#define FCP_TAG_MAGIC   0x18ae0000

FCP tag magic marker.

Definition at line 43 of file fcp.h.

Referenced by fcpdev_scsi_command().

#define FCP_RSP_RESPONSE_LEN_VALID   0x01

Response length field is valid.

Definition at line 74 of file fcp.h.

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

#define FCP_RSP_SENSE_LEN_VALID   0x02

Sense length field is valid.

Definition at line 77 of file fcp.h.

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

#define FCP_RSP_RESIDUAL_OVERRUN   0x04

Residual represents overrun.

Definition at line 80 of file fcp.h.

Referenced by fcpcmd_recv_rsp().

#define FCP_RSP_RESIDUAL_UNDERRUN   0x08

Residual represents underrun.

Definition at line 83 of file fcp.h.

Referenced by fcpcmd_recv_rsp().

#define FCP_PRLI_NO_WRITE_RDY   0x0001

Write FCP_XFER_RDY disabled.

Definition at line 137 of file fcp.h.

#define FCP_PRLI_NO_READ_RDY   0x0002

Read FCP_XFER_RDY disabled.

Definition at line 140 of file fcp.h.

Referenced by fcp_prli_tx().

#define FCP_PRLI_TARGET   0x0010

Has target functionality.

Definition at line 143 of file fcp.h.

Referenced by fcpdev_scsi_command().

#define FCP_PRLI_INITIATOR   0x0020

Has initiator functionality.

Definition at line 146 of file fcp.h.

Referenced by fcp_prli_tx().

#define FCP_PRLI_OVERLAY   0x0040

Data overlay allowed.

Definition at line 149 of file fcp.h.

#define FCP_PRLI_CONF   0x0080

Confirm completion allowed.

Definition at line 152 of file fcp.h.

#define FCP_PRLI_RETRY   0x0100

Retransmission supported.

Definition at line 155 of file fcp.h.

#define FCP_PRLI_TASK_RETRY   0x0200

Task retry identification.

Definition at line 158 of file fcp.h.

#define FCP_PRLI_REC   0x0400

REC ELS supported.

Definition at line 161 of file fcp.h.

#define FCP_PRLI_ENH_DISC   0x0800

Enhanced discovery supported.

Definition at line 164 of file fcp.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static void* fcp_rsp_response_data ( struct fcp_rsp rsp) [inline, static]

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.

References FCP_RSP_RESPONSE_LEN_VALID, fcp_rsp::flags, and NULL.

Referenced by fcpcmd_recv_rsp().

                                                                   {
        return ( ( rsp->flags & FCP_RSP_RESPONSE_LEN_VALID ) ?
                 ( ( ( void * ) rsp ) + sizeof ( *rsp ) ) : NULL );
}
static size_t fcp_rsp_response_data_len ( struct fcp_rsp rsp) [inline, static]

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.

References FCP_RSP_RESPONSE_LEN_VALID, fcp_rsp::flags, ntohl, and fcp_rsp::response_len.

Referenced by fcp_rsp_sense_data(), and fcpcmd_recv_rsp().

                                                                       {
        return ( ( rsp->flags & FCP_RSP_RESPONSE_LEN_VALID ) ?
                 ntohl ( rsp->response_len ) : 0 );
}
static void* fcp_rsp_sense_data ( struct fcp_rsp rsp) [inline, static]

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.

References fcp_rsp_response_data_len(), FCP_RSP_SENSE_LEN_VALID, fcp_rsp::flags, and NULL.

Referenced by fcpcmd_recv_rsp().

                                                                {
        return ( ( rsp->flags & FCP_RSP_SENSE_LEN_VALID ) ?
                 ( ( ( void * ) rsp ) + sizeof ( *rsp ) +
                   fcp_rsp_response_data_len ( rsp ) ) : NULL );
}
static size_t fcp_rsp_sense_data_len ( struct fcp_rsp rsp) [inline, static]

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.

References FCP_RSP_SENSE_LEN_VALID, fcp_rsp::flags, ntohl, and fcp_rsp::sense_len.

Referenced by fcpcmd_recv_rsp().

                                                                    {
        return ( ( rsp->flags & FCP_RSP_SENSE_LEN_VALID ) ?
                 ntohl ( rsp->sense_len ) : 0 );
}