TianoCore EDK2 master
Loading...
Searching...
No Matches
IScsiProto.c File Reference
#include "IScsiImpl.h"

Go to the source code of this file.

Functions

VOID IScsiAttatchConnection (IN OUT ISCSI_SESSION *Session, IN OUT ISCSI_CONNECTION *Conn)
 
VOID IScsiDetatchConnection (IN OUT ISCSI_CONNECTION *Conn)
 
EFI_STATUS IScsiCheckSN (IN OUT UINT32 *ExpSN, IN UINT32 NewSN)
 
VOID IScsiUpdateCmdSN (IN OUT ISCSI_SESSION *Session, IN UINT32 MaxCmdSN, IN UINT32 ExpCmdSN)
 
EFI_STATUS IScsiConnLogin (IN OUT ISCSI_CONNECTION *Conn, IN UINT16 Timeout)
 
VOID IScsiConnReset (IN OUT ISCSI_CONNECTION *Conn)
 
ISCSI_CONNECTIONIScsiCreateConnection (IN ISCSI_SESSION *Session)
 
VOID IScsiDestroyConnection (IN ISCSI_CONNECTION *Conn)
 
EFI_STATUS IScsiGetIp6NicInfo (IN ISCSI_CONNECTION *Conn)
 
STATIC VOID IScsiSessionResetAuthData (IN OUT ISCSI_SESSION *Session)
 
EFI_STATUS IScsiSessionLogin (IN ISCSI_SESSION *Session)
 
EFI_STATUS IScsiSessionReLogin (IN ISCSI_SESSION *Session)
 
EFI_STATUS IScsiSendLoginReq (IN ISCSI_CONNECTION *Conn)
 
EFI_STATUS IScsiReceiveLoginRsp (IN ISCSI_CONNECTION *Conn)
 
EFI_STATUS IScsiAddKeyValuePair (IN OUT NET_BUF *Pdu, IN CHAR8 *Key, IN CHAR8 *Value)
 
NET_BUFIScsiPrepareLoginReq (IN OUT ISCSI_CONNECTION *Conn)
 
EFI_STATUS IScsiProcessLoginRsp (IN OUT ISCSI_CONNECTION *Conn, IN OUT NET_BUF *Pdu)
 
EFI_STATUS IScsiUpdateTargetAddress (IN OUT ISCSI_SESSION *Session, IN CHAR8 *Data, IN UINT32 Len)
 
VOID EFIAPI IScsiFreeNbufList (VOID *Arg)
 
VOID EFIAPI IScsiNbufExtFree (VOID *Arg)
 
EFI_STATUS IScsiReceivePdu (IN ISCSI_CONNECTION *Conn, OUT NET_BUF **Pdu, IN ISCSI_IN_BUFFER_CONTEXT *Context OPTIONAL, IN BOOLEAN HeaderDigest, IN BOOLEAN DataDigest, IN EFI_EVENT TimeoutEvent OPTIONAL)
 
EFI_STATUS IScsiCheckOpParams (IN OUT ISCSI_CONNECTION *Conn)
 
VOID IScsiFillOpParams (IN ISCSI_CONNECTION *Conn, IN OUT NET_BUF *Pdu)
 
EFI_STATUS IScsiPadSegment (IN OUT NET_BUF *Pdu, IN UINT32 Len)
 
LIST_ENTRYIScsiBuildKeyValueList (IN CHAR8 *Data, IN UINT32 Len)
 
CHAR8 * IScsiGetValueByKeyFromList (IN OUT LIST_ENTRY *KeyValueList, IN CHAR8 *Key)
 
VOID IScsiFreeKeyValueList (IN LIST_ENTRY *KeyValueList)
 
EFI_STATUS IScsiNormalizeName (IN OUT CHAR8 *Name, IN UINTN Len)
 
EFI_STATUS IScsiNewTcb (IN ISCSI_CONNECTION *Conn, OUT ISCSI_TCB **Tcb)
 
VOID IScsiDelTcb (IN ISCSI_TCB *Tcb)
 
NET_BUFIScsiNewDataSegment (IN UINT8 *Data, IN UINT32 Len, IN BOOLEAN DataDigest)
 
NET_BUFIScsiNewScsiCmdPdu (IN EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet, IN UINT64 Lun, IN ISCSI_TCB *Tcb)
 
NET_BUFIScsiNewDataOutPdu (IN UINT8 *Data, IN UINT32 Len, IN UINT32 DataSN, IN ISCSI_TCB *Tcb, IN UINT64 Lun)
 
LIST_ENTRYIScsiGenerateDataOutPduSequence (IN UINT8 *Data, IN ISCSI_TCB *Tcb, IN UINT64 Lun)
 
EFI_STATUS IScsiSendDataOutPduSequence (IN UINT8 *Data, IN UINT64 Lun, IN ISCSI_TCB *Tcb)
 
EFI_STATUS IScsiOnDataInRcvd (IN NET_BUF *Pdu, IN ISCSI_TCB *Tcb, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
EFI_STATUS IScsiOnR2TRcvd (IN NET_BUF *Pdu, IN ISCSI_TCB *Tcb, IN UINT64 Lun, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
EFI_STATUS IScsiOnScsiRspRcvd (IN NET_BUF *Pdu, IN ISCSI_TCB *Tcb, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
EFI_STATUS IScsiOnNopInRcvd (IN NET_BUF *Pdu, IN ISCSI_TCB *Tcb)
 
EFI_STATUS IScsiExecuteScsiCommand (IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL *PassThru, IN UINT8 *Target, IN UINT64 Lun, IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet)
 
EFI_STATUS IScsiSessionReinstatement (IN ISCSI_SESSION *Session)
 
VOID IScsiSessionInit (IN OUT ISCSI_SESSION *Session, IN BOOLEAN Recovery)
 
VOID IScsiSessionAbort (IN OUT ISCSI_SESSION *Session)
 

Variables

UINT32 mDataSegPad = 0
 

Detailed Description

The implementation of iSCSI protocol based on RFC3720.

Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file IScsiProto.c.

Function Documentation

◆ IScsiAddKeyValuePair()

EFI_STATUS IScsiAddKeyValuePair ( IN OUT NET_BUF Pdu,
IN CHAR8 *  Key,
IN CHAR8 *  Value 
)

Add an iSCSI key-value pair as a string into the data segment of the Login Request PDU. The DataSegmentLength and the actual size of the net buffer containing this PDU will be updated.

Parameters
[in,out]PduThe iSCSI PDU whose data segment the key-value pair will be added to.
[in]KeyThe key name string.
[in]ValueThe value string.
Return values
EFI_SUCCESSThe key-value pair is added to the PDU's data segment and the correspondence length fields are updated.
EFI_OUT_OF_RESOURCESThere is not enough space in the PDU to add the key-value pair.
EFI_PROTOCOL_ERRORThere is no such data in the net buffer.

Definition at line 677 of file IScsiProto.c.

◆ IScsiAttatchConnection()

VOID IScsiAttatchConnection ( IN OUT ISCSI_SESSION Session,
IN OUT ISCSI_CONNECTION Conn 
)

Attach the iSCSI connection to the iSCSI session.

Parameters
[in,out]SessionThe iSCSI session.
[in,out]ConnThe iSCSI connection.

Definition at line 21 of file IScsiProto.c.

◆ IScsiBuildKeyValueList()

LIST_ENTRY * IScsiBuildKeyValueList ( IN CHAR8 *  Data,
IN UINT32  Len 
)

Build a key-value list from the data segment.

Parameters
[in]DataThe data segment containing the key-value pairs.
[in]LenLength of the data segment.
Returns
The key-value list.
Return values
NULLOther errors as indicated.

Definition at line 1876 of file IScsiProto.c.

◆ IScsiCheckOpParams()

EFI_STATUS IScsiCheckOpParams ( IN OUT ISCSI_CONNECTION Conn)

Check and get the result of the parameter negotiation.

Parameters
[in,out]ConnThe connection in iSCSI login.
Return values
EFI_SUCCESSThe parameter check is passed and negotiation is finished.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 1505 of file IScsiProto.c.

◆ IScsiCheckSN()

EFI_STATUS IScsiCheckSN ( IN OUT UINT32 *  ExpSN,
IN UINT32  NewSN 
)

Check the sequence number according to RFC3720.

Parameters
[in,out]ExpSNThe currently expected sequence number.
[in]NewSNThe sequence number to check.
Return values
EFI_SUCCESSThe check passed and the ExpSN is increased.
EFI_NOT_READYResponse was sent due to a retransmission request.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.

Definition at line 59 of file IScsiProto.c.

◆ IScsiConnLogin()

EFI_STATUS IScsiConnLogin ( IN OUT ISCSI_CONNECTION Conn,
IN UINT16  Timeout 
)

This function does the iSCSI connection login.

Parameters
[in,out]ConnThe iSCSI connection to login.
TimeoutThe timeout value in millisecond.
Return values
EFI_SUCCESSThe iSCSI connection is logged into the iSCSI target.
EFI_TIMEOUTTimeout occurred during the login procedure.
OthersOther errors as indicated.

Definition at line 122 of file IScsiProto.c.

◆ IScsiConnReset()

VOID IScsiConnReset ( IN OUT ISCSI_CONNECTION Conn)

Reset the iSCSI connection.

Parameters
[in,out]ConnThe iSCSI connection to reset.

Definition at line 178 of file IScsiProto.c.

◆ IScsiCreateConnection()

ISCSI_CONNECTION * IScsiCreateConnection ( IN ISCSI_SESSION Session)

Create a TCP connection for the iSCSI session.

Parameters
[in]SessionPoints to the iSCSI session.
Returns
The newly created iSCSI connection.

Definition at line 194 of file IScsiProto.c.

◆ IScsiDelTcb()

VOID IScsiDelTcb ( IN ISCSI_TCB Tcb)

Delete the tcb from the connection and destroy it.

Parameters
[in]TcbThe tcb to delete.

Definition at line 2106 of file IScsiProto.c.

◆ IScsiDestroyConnection()

VOID IScsiDestroyConnection ( IN ISCSI_CONNECTION Conn)

Destroy an iSCSI connection.

Parameters
[in]ConnThe connection to destroy.

Definition at line 310 of file IScsiProto.c.

◆ IScsiDetatchConnection()

VOID IScsiDetatchConnection ( IN OUT ISCSI_CONNECTION Conn)

Detach the iSCSI connection from the session it belongs to.

Parameters
[in,out]ConnThe iSCSI connection.

Definition at line 38 of file IScsiProto.c.

◆ IScsiExecuteScsiCommand()

EFI_STATUS IScsiExecuteScsiCommand ( IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL PassThru,
IN UINT8 *  Target,
IN UINT64  Lun,
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet 
)

Execute the SCSI command issued through the EXT SCSI PASS THRU protocol.

Parameters
[in]PassThruThe EXT SCSI PASS THRU protocol.
[in]TargetThe target ID.
[in]LunThe LUN.
[in,out]PacketThe request packet containing IO request, SCSI command buffer and buffers to read/write.
Return values
EFI_SUCCESSThe SCSI command is executed and the result is updated to the Packet.
EFI_DEVICE_ERRORSession state was not as required.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_PROTOCOL_ERRORThere is no such data in the net buffer.
EFI_NOT_READYThe target can not accept new commands.
OthersOther errors as indicated.

Definition at line 2904 of file IScsiProto.c.

◆ IScsiFillOpParams()

VOID IScsiFillOpParams ( IN ISCSI_CONNECTION Conn,
IN OUT NET_BUF Pdu 
)

Fill the operational parameters.

Parameters
[in]ConnThe connection in iSCSI login.
[in,out]PduThe iSCSI login request PDU to fill the parameters.

Definition at line 1779 of file IScsiProto.c.

◆ IScsiFreeKeyValueList()

VOID IScsiFreeKeyValueList ( IN LIST_ENTRY KeyValueList)

Free the key-value list.

Parameters
[in]KeyValueListThe key-value list.

Definition at line 1978 of file IScsiProto.c.

◆ IScsiFreeNbufList()

VOID EFIAPI IScsiFreeNbufList ( VOID *  Arg)

The callback function to free the net buffer list.

Parameters
[in]ArgThe opaque parameter.

Definition at line 1262 of file IScsiProto.c.

◆ IScsiGenerateDataOutPduSequence()

LIST_ENTRY * IScsiGenerateDataOutPduSequence ( IN UINT8 *  Data,
IN ISCSI_TCB Tcb,
IN UINT64  Lun 
)

Generate a consecutive sequence of iSCSI SCSI Data Out PDUs.

Parameters
[in]DataThe data which will be carried by the sequence of iSCSI SCSI Data Out PDUs.
[in]TcbThe task control block of the data to send out.
[in]LunThe LUN the data will be sent to.
Returns
A list of net buffers with each of them wrapping an iSCSI SCSI Data Out PDU.
Return values
NULLOther errors as indicated.

Definition at line 2445 of file IScsiProto.c.

◆ IScsiGetIp6NicInfo()

EFI_STATUS IScsiGetIp6NicInfo ( IN ISCSI_CONNECTION Conn)

Retrieve the IPv6 Address/Prefix/Gateway from the established TCP connection, these informations will be filled in the iSCSI Boot Firmware Table.

Parameters
[in]ConnThe connection used in the iSCSI login phase.
Return values
EFI_SUCCESSGet the NIC information successfully.
OthersOther errors as indicated.

Definition at line 332 of file IScsiProto.c.

◆ IScsiGetValueByKeyFromList()

CHAR8 * IScsiGetValueByKeyFromList ( IN OUT LIST_ENTRY KeyValueList,
IN CHAR8 *  Key 
)

Get the value string by the key name from the key-value list. If found, the key-value entry will be removed from the list.

Parameters
[in,out]KeyValueListThe key-value list.
[in]KeyThe key name to find.
Returns
The value string.
Return values
NULLThe key value pair cannot be found.

Definition at line 1945 of file IScsiProto.c.

◆ IScsiNbufExtFree()

VOID EFIAPI IScsiNbufExtFree ( VOID *  Arg)

The callback function called in NetBufFree; it does nothing.

Parameters
[in]ArgThe opaque parameter.

Definition at line 1280 of file IScsiProto.c.

◆ IScsiNewDataOutPdu()

NET_BUF * IScsiNewDataOutPdu ( IN UINT8 *  Data,
IN UINT32  Len,
IN UINT32  DataSN,
IN ISCSI_TCB Tcb,
IN UINT64  Lun 
)

Create a new iSCSI SCSI Data Out PDU.

Parameters
[in]DataThe data to put into the Data Out PDU.
[in]LenLength of the data.
[in]DataSNThe DataSN of the Data Out PDU.
[in]TcbThe task control block of this Data Out PDU.
[in]LunThe LUN.
Returns
The net buffer wrapping the Data Out PDU.
Return values
NULLOther errors as indicated.

Definition at line 2349 of file IScsiProto.c.

◆ IScsiNewDataSegment()

NET_BUF * IScsiNewDataSegment ( IN UINT8 *  Data,
IN UINT32  Len,
IN BOOLEAN  DataDigest 
)

Create a data segment, pad it, and calculate the CRC if needed.

Parameters
[in]DataThe data to fill into the data segment.
[in]LenLength of the data.
[in]DataDigestWhether to calculate CRC for this data segment.
Returns
The net buffer wrapping the data segment.

Definition at line 2126 of file IScsiProto.c.

◆ IScsiNewScsiCmdPdu()

NET_BUF * IScsiNewScsiCmdPdu ( IN EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet,
IN UINT64  Lun,
IN ISCSI_TCB Tcb 
)

Create a iSCSI SCSI command PDU to encapsulate the command issued by SCSI through the EXT SCSI PASS THRU Protocol.

Parameters
[in]PacketThe EXT SCSI PASS THRU request packet containing the SCSI command.
[in]LunThe LUN.
[in]TcbThe tcb associated with this SCSI command.
Returns
The created iSCSI SCSI command PDU.
Return values
NULLOther errors as indicated.

Definition at line 2168 of file IScsiProto.c.

◆ IScsiNewTcb()

EFI_STATUS IScsiNewTcb ( IN ISCSI_CONNECTION Conn,
OUT ISCSI_TCB **  Tcb 
)

Create an iSCSI task control block.

Parameters
[in]ConnThe connection on which the task control block will be created.
[out]TcbThe newly created task control block.
Return values
EFI_SUCCESSThe task control block is created.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_NOT_READYThe target cannot accept new commands.

Definition at line 2058 of file IScsiProto.c.

◆ IScsiNormalizeName()

EFI_STATUS IScsiNormalizeName ( IN OUT CHAR8 *  Name,
IN UINTN  Len 
)

Normalize the iSCSI name according to RFC.

Parameters
[in,out]NameThe iSCSI name.
[in]LenLength of the iSCSI name.
Return values
EFI_SUCCESSThe iSCSI name is valid and normalized.
EFI_PROTOCOL_ERRORThe iSCSI name is malformatted or not in the IQN format.

Definition at line 2006 of file IScsiProto.c.

◆ IScsiOnDataInRcvd()

EFI_STATUS IScsiOnDataInRcvd ( IN NET_BUF Pdu,
IN ISCSI_TCB Tcb,
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet 
)

Process the received iSCSI SCSI Data In PDU.

Parameters
[in]PduThe Data In PDU received.
[in]TcbThe task control block.
[in,out]PacketThe EXT SCSI PASS THRU request packet.
Return values
EFI_SUCCESSThe check on the Data IN PDU is passed and some update actions are taken.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.
EFI_BAD_BUFFER_SIZEEThe buffer was not the proper size for the request.
OthersOther errors as indicated.

Definition at line 2583 of file IScsiProto.c.

◆ IScsiOnNopInRcvd()

EFI_STATUS IScsiOnNopInRcvd ( IN NET_BUF Pdu,
IN ISCSI_TCB Tcb 
)

Process the received NOP In PDU.

Parameters
[in]PduThe NOP In PDU received.
[in]TcbThe task control block.
Return values
EFI_SUCCESSThe NOP In PDU is processed and the related sequence numbers are updated.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.

Definition at line 2852 of file IScsiProto.c.

◆ IScsiOnR2TRcvd()

EFI_STATUS IScsiOnR2TRcvd ( IN NET_BUF Pdu,
IN ISCSI_TCB Tcb,
IN UINT64  Lun,
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet 
)

Process the received iSCSI R2T PDU.

Parameters
[in]PduThe R2T PDU received.
[in]TcbThe task control block.
[in]LunThe Lun.
[in,out]PacketThe EXT SCSI PASS THRU request packet.
Return values
EFI_SUCCESSThe R2T PDU is valid and the solicited data is sent out.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.
OthersOther errors as indicated.

Definition at line 2674 of file IScsiProto.c.

◆ IScsiOnScsiRspRcvd()

EFI_STATUS IScsiOnScsiRspRcvd ( IN NET_BUF Pdu,
IN ISCSI_TCB Tcb,
IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET Packet 
)

Process the received iSCSI SCSI Response PDU.

Parameters
[in]PduThe Response PDU received.
[in]TcbThe task control block.
[in,out]PacketThe EXT SCSI PASS THRU request packet.
Return values
EFI_SUCCESSThe Response PDU is processed.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.
EFI_BAD_BUFFER_SIZEEThe buffer was not the proper size for the request.
OthersOther errors as indicated.

Definition at line 2745 of file IScsiProto.c.

◆ IScsiPadSegment()

EFI_STATUS IScsiPadSegment ( IN OUT NET_BUF Pdu,
IN UINT32  Len 
)

Pad the iSCSI AHS or data segment to an integer number of 4 byte words.

Parameters
[in,out]PduThe iSCSI pdu which contains segments to pad.
[in]LenThe length of the last segment in the PDU.
Return values
EFI_SUCCESSThe segment is padded or there is no need to pad it.
EFI_OUT_OF_RESOURCESThere is not enough remaining free space to add the padding bytes.

Definition at line 1843 of file IScsiProto.c.

◆ IScsiPrepareLoginReq()

NET_BUF * IScsiPrepareLoginReq ( IN OUT ISCSI_CONNECTION Conn)

Prepare the iSCSI login request to be sent according to the current login status.

Parameters
[in,out]ConnThe connection in the iSCSI login phase.
Returns
The pointer to the net buffer containing the iSCSI login request built.
Return values
NULLOther errors as indicated.

Definition at line 749 of file IScsiProto.c.

◆ IScsiProcessLoginRsp()

EFI_STATUS IScsiProcessLoginRsp ( IN OUT ISCSI_CONNECTION Conn,
IN OUT NET_BUF Pdu 
)

Process the iSCSI Login Response.

Parameters
[in,out]ConnThe connection on which the iSCSI login response is received.
[in,out]PduThe iSCSI login response PDU.
Return values
EFI_SUCCESSThe iSCSI login response PDU is processed, and all checks are passed.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.
EFI_MEDIA_CHANGEDTarget is redirected.
OthersOther errors as indicated.

Definition at line 865 of file IScsiProto.c.

◆ IScsiReceiveLoginRsp()

EFI_STATUS IScsiReceiveLoginRsp ( IN ISCSI_CONNECTION Conn)

Receive and process the iSCSI login response.

Parameters
[in]ConnThe connection in the iSCSI login phase.
Return values
EFI_SUCCESSThe iSCSI login response PDU is received and processed.
OthersOther errors as indicated.

Definition at line 631 of file IScsiProto.c.

◆ IScsiReceivePdu()

EFI_STATUS IScsiReceivePdu ( IN ISCSI_CONNECTION Conn,
OUT NET_BUF **  Pdu,
IN ISCSI_IN_BUFFER_CONTEXT *Context  OPTIONAL,
IN BOOLEAN  HeaderDigest,
IN BOOLEAN  DataDigest,
IN EFI_EVENT TimeoutEvent  OPTIONAL 
)

Receive an iSCSI response PDU. An iSCSI response PDU contains an iSCSI PDU header and an optional data segment. The two parts will be put into two blocks of buffers in the net buffer. The digest check will be conducted in this function if needed and the digests will be trimmed from the PDU buffer.

Parameters
[in]ConnThe iSCSI connection to receive data from.
[out]PduThe received iSCSI pdu.
[in]ContextThe context used to describe information on the caller provided buffer to receive data segment of the iSCSI pdu. It is optional.
[in]HeaderDigestWhether there will be header digest received.
[in]DataDigestWhether there will be data digest.
[in]TimeoutEventThe timeout event. It is optional.
Return values
EFI_SUCCESSAn iSCSI pdu is received.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.
OthersOther errors as indicated.

Definition at line 1307 of file IScsiProto.c.

◆ IScsiSendDataOutPduSequence()

EFI_STATUS IScsiSendDataOutPduSequence ( IN UINT8 *  Data,
IN UINT64  Lun,
IN ISCSI_TCB Tcb 
)

Send the Data in a sequence of Data Out PDUs one by one.

Parameters
[in]DataThe data to carry by Data Out PDUs.
[in]LunThe LUN the data will be sent to.
[in]TcbThe task control block.
Return values
EFI_SUCCESSThe data is sent out to the LUN.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
OthersOther errors as indicated.

Definition at line 2529 of file IScsiProto.c.

◆ IScsiSendLoginReq()

EFI_STATUS IScsiSendLoginReq ( IN ISCSI_CONNECTION Conn)

Build and send the iSCSI login request to the iSCSI target according to the current login stage.

Parameters
[in]ConnThe connection in the iSCSI login phase.
Return values
EFI_SUCCESSThe iSCSI login request PDU is built and sent on this connection.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_DEVICE_ERRORSome kind of device error occurred.

Definition at line 596 of file IScsiProto.c.

◆ IScsiSessionAbort()

VOID IScsiSessionAbort ( IN OUT ISCSI_SESSION Session)

Abort the iSCSI session. That is, reset all the connection(s), and free the resources.

Parameters
[in,out]SessionThe iSCSI session.

Definition at line 3166 of file IScsiProto.c.

◆ IScsiSessionInit()

VOID IScsiSessionInit ( IN OUT ISCSI_SESSION Session,
IN BOOLEAN  Recovery 
)

Initialize some session parameters before login.

Parameters
[in,out]SessionThe iSCSI session.
[in]RecoveryWhether the request is from a fresh new start or recovery.

Definition at line 3125 of file IScsiProto.c.

◆ IScsiSessionLogin()

EFI_STATUS IScsiSessionLogin ( IN ISCSI_SESSION Session)

Login the iSCSI session.

Parameters
[in]SessionThe iSCSI session.
Return values
EFI_SUCCESSThe iSCSI session login procedure finished.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_NO_MEDIAThere was a media error.
OthersOther errors as indicated.

Definition at line 452 of file IScsiProto.c.

◆ IScsiSessionReinstatement()

EFI_STATUS IScsiSessionReinstatement ( IN ISCSI_SESSION Session)

Reinstate the session on some error.

Parameters
[in]SessionThe iSCSI session
Return values
EFI_SUCCESSThe session is reinstated from some error.
OtherReinstatement failed.

Definition at line 3095 of file IScsiProto.c.

◆ IScsiSessionReLogin()

EFI_STATUS IScsiSessionReLogin ( IN ISCSI_SESSION Session)

Wait for IPsec negotiation, then try to login the iSCSI session again.

Parameters
[in]SessionThe iSCSI session.
Return values
EFI_SUCCESSThe iSCSI session login procedure finished.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_PROTOCOL_ERRORSome kind of iSCSI protocol error occurred.

Definition at line 547 of file IScsiProto.c.

◆ IScsiSessionResetAuthData()

STATIC VOID IScsiSessionResetAuthData ( IN OUT ISCSI_SESSION Session)

Re-set any stateful session-level authentication information that is used by the leading login / leading connection.

(Note that this driver only supports a single connection per session – see ISCSI_MAX_CONNS_PER_SESSION.)

Parameters
[in,out]SessionThe iSCSI session.

Definition at line 431 of file IScsiProto.c.

◆ IScsiUpdateCmdSN()

VOID IScsiUpdateCmdSN ( IN OUT ISCSI_SESSION Session,
IN UINT32  MaxCmdSN,
IN UINT32  ExpCmdSN 
)

Update the sequence numbers for the iSCSI command.

Parameters
[in,out]SessionThe iSCSI session.
[in]MaxCmdSNMaximum CmdSN from the target.
[in]ExpCmdSNNext expected CmdSN from the target.

Definition at line 91 of file IScsiProto.c.

◆ IScsiUpdateTargetAddress()

EFI_STATUS IScsiUpdateTargetAddress ( IN OUT ISCSI_SESSION Session,
IN CHAR8 *  Data,
IN UINT32  Len 
)

Updated the target information according the data received in the iSCSI login response with an target redirection status.

Parameters
[in,out]SessionThe iSCSI session.
[in]DataThe data segment that should contain the TargetAddress key-value list.
[in]LenLength of the data.
Return values
EFI_SUCCESSThe target address is updated.
EFI_OUT_OF_RESOURCESFailed to allocate memory.
EFI_NOT_FOUNDThe TargetAddress key is not found.
OthersOther errors as indicated.

Definition at line 1103 of file IScsiProto.c.

Variable Documentation

◆ mDataSegPad

UINT32 mDataSegPad = 0

Definition at line 11 of file IScsiProto.c.