TianoCore EDK2 master
Loading...
Searching...
No Matches
IScsiProto.h
Go to the documentation of this file.
1
9#ifndef _ISCSI_PROTO_H_
10#define _ISCSI_PROTO_H_
11
12//
13// RFC 1982 Serial Number Arithmetic, SERIAL_BITS = 32
14//
15#define ISCSI_SEQ_EQ(s1, s2) ((s1) == (s2))
16#define ISCSI_SEQ_LT(s1, s2) \
17 ( \
18 (((INT32) (s1) < (INT32) (s2)) && (s2 - s1) < ((UINT32) 1 << 31)) || \
19 (((INT32) (s1) > (INT32) (s2)) && (s1 - s2) > ((UINT32) 1 << 31)) \
20 )
21#define ISCSI_SEQ_GT(s1, s2) \
22 ( \
23 (((INT32) (s1) < (INT32) (s2)) && (s2 - s1) > ((UINT32) 1 << 31)) || \
24 (((INT32) (s1) > (INT32) (s2)) && (s1 - s2) < ((UINT32) 1 << 31)) \
25 )
26
27#define ISCSI_WELL_KNOWN_PORT 3260
28#define ISCSI_MAX_CONNS_PER_SESSION 1
29
30#define DEFAULT_MAX_RECV_DATA_SEG_LEN 8192
31#define MAX_RECV_DATA_SEG_LEN_IN_FFP 65536
32#define DEFAULT_MAX_OUTSTANDING_R2T 1
33
34#define ISCSI_VERSION_MAX 0x00
35#define ISCSI_VERSION_MIN 0x00
36
37#define ISCSI_CHECK_MEDIA_LOGIN_WAITING_TIME EFI_TIMER_PERIOD_SECONDS(20)
38#define ISCSI_CHECK_MEDIA_GET_DHCP_WAITING_TIME EFI_TIMER_PERIOD_SECONDS(20)
39
40#define ISCSI_REDIRECT_ADDR_START_DELIMITER '['
41#define ISCSI_REDIRECT_ADDR_END_DELIMITER ']'
42
43#define ISCSI_KEY_AUTH_METHOD "AuthMethod"
44#define ISCSI_KEY_HEADER_DIGEST "HeaderDigest"
45#define ISCSI_KEY_DATA_DIGEST "DataDigest"
46#define ISCSI_KEY_MAX_CONNECTIONS "MaxConnections"
47#define ISCSI_KEY_TARGET_NAME "TargetName"
48#define ISCSI_KEY_INITIATOR_NAME "InitiatorName"
49#define ISCSI_KEY_TARGET_ALIAS "TargetAlias"
50#define ISCSI_KEY_INITIATOR_ALIAS "InitiatorAlias"
51#define ISCSI_KEY_TARGET_ADDRESS "TargetAddress"
52#define ISCSI_KEY_INITIAL_R2T "InitialR2T"
53#define ISCSI_KEY_IMMEDIATE_DATA "ImmediateData"
54#define ISCSI_KEY_TARGET_PORTAL_GROUP_TAG "TargetPortalGroupTag"
55#define ISCSI_KEY_MAX_BURST_LENGTH "MaxBurstLength"
56#define ISCSI_KEY_FIRST_BURST_LENGTH "FirstBurstLength"
57#define ISCSI_KEY_DEFAULT_TIME2WAIT "DefaultTime2Wait"
58#define ISCSI_KEY_DEFAULT_TIME2RETAIN "DefaultTime2Retain"
59#define ISCSI_KEY_MAX_OUTSTANDING_R2T "MaxOutstandingR2T"
60#define ISCSI_KEY_DATA_PDU_IN_ORDER "DataPDUInOrder"
61#define ISCSI_KEY_DATA_SEQUENCE_IN_ORDER "DataSequenceInOrder"
62#define ISCSI_KEY_ERROR_RECOVERY_LEVEL "ErrorRecoveryLevel"
63#define ISCSI_KEY_SESSION_TYPE "SessionType"
64#define ISCSI_KEY_MAX_RECV_DATA_SEGMENT_LENGTH "MaxRecvDataSegmentLength"
65
66#define ISCSI_KEY_VALUE_NONE "None"
67
71
72#define CONN_STATE_FREE 0
73#define CONN_STATE_XPT_WAIT 1
74#define CONN_STATE_IN_LOGIN 2
75#define CONN_STATE_LOGGED_IN 3
76#define CONN_STATE_IN_LOGOUT 4
77#define CONN_STATE_LOGOUT_REQUESTED 5
78#define CONN_STATE_CLEANUP_WAIT 6
79#define CONN_STATE_IN_CLEANUP 7
80
84#define SESSION_STATE_FREE 0
85#define SESSION_STATE_LOGGED_IN 1
86#define SESSION_STATE_FAILED 2
87
88#define ISCSI_RESERVED_TAG 0xffffffff
89
90#define ISCSI_REQ_IMMEDIATE 0x40
91#define ISCSI_OPCODE_MASK 0x3F
92
93#define ISCSI_SET_OPCODE(PduHdr, Op, Flgs) ((((ISCSI_BASIC_HEADER *) (PduHdr))->OpCode) = ((Op) | (Flgs)))
94#define ISCSI_GET_OPCODE(PduHdr) ((((ISCSI_BASIC_HEADER *) (PduHdr))->OpCode) & ISCSI_OPCODE_MASK)
95#define ISCSI_CHECK_OPCODE(PduHdr, Op) ((((PduHdr)->OpCode) & ISCSI_OPCODE_MASK) == (Op))
96#define ISCSI_IMMEDIATE_ON(PduHdr) ((PduHdr)->OpCode & ISCSI_REQ_IMMEDIATE)
97#define ISCSI_SET_FLAG(PduHdr, Flag) (((ISCSI_BASIC_HEADER *) (PduHdr))->Flags |= (BOOLEAN)(Flag))
98#define ISCSI_CLEAR_FLAG(PduHdr, Flag) (((ISCSI_BASIC_HEADER *) (PduHdr))->Flags &= ~(Flag))
99#define ISCSI_FLAG_ON(PduHdr, Flag) ((BOOLEAN) ((((ISCSI_BASIC_HEADER *) (PduHdr))->Flags & (Flag)) == (Flag)))
100#define ISCSI_SET_STAGES(PduHdr, Cur, Nxt) ((PduHdr)->Flags = (UINT8) ((PduHdr)->Flags | ((Cur) << 2 | (Nxt))))
101#define ISCSI_GET_CURRENT_STAGE(PduHdr) ((UINT8) (((PduHdr)->Flags >> 2) & 0x3))
102#define ISCSI_GET_NEXT_STAGE(PduHdr) ((UINT8) (((PduHdr)->Flags) & 0x3))
103
104#define ISCSI_GET_PAD_LEN(DataLen) ((~(DataLen) + 1) & 0x3)
105#define ISCSI_ROUNDUP(DataLen) (((DataLen) + 3) &~(0x3))
106
107#define HTON24(Dst, Src) \
108 do { \
109 (Dst)[0] = (UINT8) ((UINT8) ((Src) >> 16) & 0xFF); \
110 (Dst)[1] = (UINT8) ((UINT8) ((Src) >> 8) & 0xFF); \
111 (Dst)[2] = (UINT8) ((UINT8) (Src) & 0xFF); \
112 } while (0);
113
114#define NTOH24(src) (((src)[0] << 16) | ((src)[1] << 8) | ((src)[2]))
115
116#define ISCSI_GET_DATASEG_LEN(PduHdr) NTOH24 (((ISCSI_BASIC_HEADER *) (PduHdr))->DataSegmentLength)
117#define ISCSI_SET_DATASEG_LEN(PduHdr, Len) HTON24 (((ISCSI_BASIC_HEADER *) (PduHdr))->DataSegmentLength, (Len))
118#define ISCSI_GET_BUFFER_OFFSET(PduHdr) NTOHL (((ISCSI_SCSI_DATA_IN *) (PduHdr))->BufferOffset)
119
120//
121// Initiator opcodes.
122//
123#define ISCSI_OPCODE_NOP_OUT 0x00
124#define ISCSI_OPCODE_SCSI_CMD 0x01
125#define ISCSI_OPCODE_SCSI_TMF_REQ 0x02
126#define ISCSI_OPCODE_LOGIN_REQ 0x03
127#define ISCSI_OPCODE_TEXT_REQ 0x04
128#define ISCSI_OPCODE_SCSI_DATA_OUT 0x05
129#define ISCSI_OPCODE_LOGOUT_REQ 0x06
130#define ISCSI_OPCODE_SNACK_REQ 0x10
131#define ISCSI_OPCODE_VENDOR_I0 0x1c
132#define ISCSI_OPCODE_VENDOR_I1 0x1d
133#define ISCSI_OPCODE_VENDOR_I2 0x1e
134
135//
136// Target opcodes.
137//
138#define ISCSI_OPCODE_NOP_IN 0x20
139#define ISCSI_OPCODE_SCSI_RSP 0x21
140#define ISCSI_OPCODE_SCSI_TMF_RSP 0x22
141#define ISCSI_OPCODE_LOGIN_RSP 0x23
142#define ISCSI_OPCODE_TEXT_RSP 0x24
143#define ISCSI_OPCODE_SCSI_DATA_IN 0x25
144#define ISCSI_OPCODE_LOGOUT_RSP 0x26
145#define ISCSI_OPCODE_R2T 0x31
146#define ISCSI_OPCODE_ASYNC_MSG 0x32
147#define ISCSI_OPCODE_VENDOR_T0 0x3c
148#define ISCSI_OPCODE_VENDOR_T1 0x3d
149#define ISCSI_OPCODE_VENDOR_T2 0x3e
150#define ISCSI_OPCODE_REJECT 0x3f
151
152#define ISCSI_BHS_FLAG_FINAL 0x80
153
154//
155// Defined AHS types, others are reserved.
156//
157#define ISCSI_AHS_TYPE_EXT_CDB 0x1
158#define ISCSI_AHS_TYPE_BI_EXP_READ_DATA_LEN 0x2
159
160#define SCSI_CMD_PDU_FLAG_READ 0x40
161#define SCSI_CMD_PDU_FLAG_WRITE 0x20
162
163#define ISCSI_CMD_PDU_TASK_ATTR_MASK 0x07
164
165//
166// task attributes
167//
168#define ISCSI_TASK_ATTR_UNTAGGED 0x00
169#define ISCSI_TASK_ATTR_SIMPLE 0x01
170#define ISCSI_TASK_ATTR_ORDERD 0x02
171#define ISCSI_TASK_ATTR_HOQ 0x03
172#define ISCSI_TASK_ATTR_ACA 0x04
173
174//
175// Flag bit definitions in SCSI response.
176//
177#define SCSI_RSP_PDU_FLAG_BI_READ_OVERFLOW 0x10
178#define SCSI_RSP_PDU_FLAG_BI_READ_UNDERFLOW 0x08
179#define SCSI_RSP_PDU_FLAG_OVERFLOW 0x04
180#define SCSI_RSP_PDU_FLAG_UNDERFLOW 0x02
181
182//
183// iSCSI service response codes.
184//
185#define ISCSI_SERVICE_RSP_COMMAND_COMPLETE_AT_TARGET 0x00
186#define ISCSI_SERVICE_RSP_TARGET_FAILURE 0x01
187
188#define ISCSI_TMF_RSP_PDU_RSP_FUNCTION_COMPLETE 0
189#define ISCSI_TMF_RSP_PDU_RSP_TASK_NOT_EXIST 1
190#define ISCSI_TMF_RSP_PDU_RSP_LUN_NOT_EXIST 2
191#define ISCSI_TMF_RSP_PDU_RSP_TASK_STILL_ALLEGIANT 3
192#define ISCSI_TMF_RSP_PDU_RSP_TASK_REASSGIN_NOT_SUPPORTED 4
193#define ISCSI_TMF_RSP_PDU_RSP_NOT_SUPPORTED 5
194#define ISCSI_TMF_RSP_PDU_RSP_FUNCTION_AHTH_FAILED 6
195#define ISCSI_TMF_RSP_PDU_RSP_FUNCTION_REJECTED 255
196
197#define SCSI_DATA_IN_PDU_FLAG_ACKKNOWLEDGE 0x40
198#define SCSI_DATA_IN_PDU_FLAG_OVERFLOW SCSI_RSP_PDU_FLAG_OVERFLOW
199#define SCSI_DATA_IN_PDU_FLAG_UNDERFLOW SCSI_RSP_PDU_FLAG_UNDERFLOW
200#define SCSI_DATA_IN_PDU_FLAG_STATUS_VALID 0x01
201
202#define ISCSI_LOGIN_REQ_PDU_FLAG_TRANSIT 0x80
203#define ISCSI_LOGIN_REQ_PDU_FLAG_CONTINUE 0x40
204
205#define ISCSI_LOGIN_RSP_PDU_FLAG_TRANSIT ISCSI_LOGIN_REQ_PDU_FLAG_TRANSIT
206#define ISCSI_LOGIN_RSP_PDU_FLAG_CONTINUE ISCSI_LOGIN_REQ_PDU_FLAG_CONTINUE
207
208#define ISCSI_LOGIN_STATUS_SUCCESS 0
209#define ISCSI_LOGIN_STATUS_REDIRECTION 1
210#define ISCSI_LOGIN_STATUS_INITIATOR_ERROR 2
211#define ISCSI_LOGIN_STATUS_TARGET_ERROR 3
212
213#define ISCSI_LOGOUT_REASON_CLOSE_SESSION 0
214#define ISCSI_LOGOUT_REASON_CLOSE_CONNECTION 1
215#define ISCSI_LOGOUT_REASON_REMOVE_CONNECTION_FOR_RECOVERY 2
216
217#define ISCSI_LOGOUT_RESPONSE_SESSION_CLOSED_SUCCESS 0
218#define ISCSI_LOGOUT_RESPONSE_CID_NOT_FOUND 1
219#define ISCSI_LOGOUT_RESPONSE_RECOVERY_NOT_SUPPORTED 2
220#define ISCSI_LOGOUT_RESPONSE_CLEANUP_FAILED 3
221
222#define ISCSI_SNACK_REQUEST_TYPE_DATA_OR_R2T 0
223#define ISCSI_SNACK_REQUEST_TYPE_STATUS 1
224#define ISCSI_SNACK_REQUEST_TYPE_DATA_ACK 2
225#define ISCSI_SNACK_REQUEST_TYPE_RDATA 3
226
227#define ISCSI_SECURITY_NEGOTIATION 0
228#define ISCSI_LOGIN_OPERATIONAL_NEGOTIATION 1
229#define ISCSI_FULL_FEATURE_PHASE 3
230
231typedef struct _ISCSI_SESSION ISCSI_SESSION;
233
234typedef enum {
235 DataIn = 0,
236 DataOut = 1,
237 DataBi = 2
238} DATA_DIRECTION;
239
243typedef struct _ISCSI_BASIC_HEADER {
244 UINT8 OpCode;
245 UINT8 Flags;
246 UINT16 OpCodeSpecific1;
247 UINT8 TotalAHSLength;
248 UINT8 DataSegmentLength[3];
249 UINT8 Lun[8];
250 UINT32 InitiatorTaskTag;
251 UINT32 OpCodeSpecific2[7];
253
255 UINT16 Length;
256 UINT8 Type;
257 UINT8 TypeSpecific[1];
259
261 UINT16 Length;
262 UINT8 Type;
263 UINT8 Reserved;
264 UINT32 ExpReadDataLength;
266
270typedef struct _SCSI_COMMAND {
271 UINT8 OpCode;
272 UINT8 Flags;
273 UINT16 Reserved;
274 UINT8 TotalAHSLength;
275 UINT8 DataSegmentLength[3];
276 UINT8 Lun[8];
277 UINT32 InitiatorTaskTag;
278 UINT32 ExpDataXferLength;
279 UINT32 CmdSN;
280 UINT32 ExpStatSN;
281 UINT8 Cdb[16];
283
287typedef struct _SCSI_RESPONSE {
288 UINT8 OpCode;
289 UINT8 Flags;
290 UINT8 Response;
291 UINT8 Status;
292 UINT8 TotalAHSLength;
293 UINT8 DataSegmentLength[3];
294 UINT8 Reserved[8];
295 UINT32 InitiatorTaskTag;
296 UINT32 SNACKTag;
297 UINT32 StatSN;
298 UINT32 ExpCmdSN;
299 UINT32 MaxCmdSN;
300 UINT32 ExpDataSN;
301 UINT32 BiReadResidualCount;
302 UINT32 ResidualCount;
304
305typedef struct _ISCSI_SENSE_DATA {
306 UINT16 Length;
307 UINT8 Data[2];
309
313typedef struct _ISCSI_TMF_REQUEST {
314 UINT8 OpCode;
315 UINT8 Fuction;
316 UINT16 Reserved1;
317 UINT8 TotalAHSLength;
318 UINT8 DataSegmentLength[3];
319 UINT8 Lun[8];
320 UINT32 InitiatorTaskTag;
321 UINT32 ReferencedTaskTag;
322 UINT32 CmdSN;
323 UINT32 ExpStatSN;
324 UINT32 RefCmdSN;
325 UINT32 ExpDataSN;
326 UINT32 Reserved2[2];
328
332typedef struct _ISCSI_TMF_RESPONSE {
333 UINT8 OpCode;
334 UINT8 Reserved1;
335 UINT8 Response;
336 UINT8 Reserved2;
337 UINT8 TotalAHSLength;
338 UINT8 DataSegmentLength[3];
339 UINT32 Reserver3[2];
340 UINT32 InitiatorTaskTag;
341 UINT32 Reserved4;
342 UINT32 StatSN;
343 UINT32 ExpCmdSN;
344 UINT32 MaxCmdSN;
345 UINT32 Reserved[3];
347
351typedef struct _ISCSI_SCSI_DATA_OUT {
352 UINT8 OpCode;
353 UINT8 Reserved1[3];
354 UINT8 TotalAHSLength;
355 UINT8 DataSegmentLength[3];
356 UINT8 Lun[8];
357 UINT32 InitiatorTaskTag;
358 UINT32 TargetTransferTag;
359 UINT32 Reserved2;
360 UINT32 ExpStatSN;
361 UINT32 Reserved3;
362 UINT32 DataSN;
363 UINT32 BufferOffset;
364 UINT32 Reserved4;
366
370typedef struct _ISCSI_SCSI_DATA_IN {
371 UINT8 OpCode;
372 UINT8 Flags;
373 UINT8 Reserved1;
374 UINT8 Status;
375 UINT8 TotalAHSLength;
376 UINT8 DataSegmentLength[3];
377 UINT8 Lun[8];
378 UINT32 InitiatorTaskTag;
379 UINT32 TargetTransferTag;
380 UINT32 StatSN;
381 UINT32 ExpCmdSN;
382 UINT32 MaxCmdSN;
383 UINT32 DataSN;
384 UINT32 BufferOffset;
385 UINT32 ResidualCount;
387
392 UINT8 OpCode;
393 UINT8 Reserved1[3];
394 UINT8 TotalAHSLength;
395 UINT8 DataSegmentLength[3];
396 UINT8 Lun[8];
397 UINT32 InitiatorTaskTag;
398 UINT32 TargetTransferTag;
399 UINT32 StatSN;
400 UINT32 ExpCmdSN;
401 UINT32 MaxCmdSN;
402 UINT32 R2TSeqNum;
403 UINT32 BufferOffset;
404 UINT32 DesiredDataTransferLength;
406
407typedef struct _ISCSI_ASYNC_MESSAGE {
408 UINT8 OpCode;
409 UINT8 Reserved1[8];
410 UINT8 TotalAHSLength;
411 UINT8 DataSegmentLength[3];
412 UINT8 Lun[8];
413 UINT32 InitiatorTaskTag;
414 UINT32 Reserved2;
415 UINT32 StatSN;
416 UINT32 ExpCmdSN;
417 UINT32 MaxCmdSN;
418 UINT8 AsyncEvent;
419 UINT8 AsyncVCode;
420 UINT16 Parameter1;
421 UINT16 Parameter2;
422 UINT16 Parameter3;
423 UINT32 Reserved3;
425
429typedef struct _ISCSI_LOGIN_REQUEST {
430 UINT8 OpCode;
431 UINT8 Flags;
432 UINT8 VersionMax;
433 UINT8 VersionMin;
434 UINT8 TotalAHSLength;
435 UINT8 DataSegmentLength[3];
436 UINT8 Isid[6];
437 UINT16 Tsih;
438 UINT32 InitiatorTaskTag;
439 UINT16 Cid;
440 UINT16 Reserved1;
441 UINT32 CmdSN;
442 UINT32 ExpStatSN;
443 UINT32 Reserved2[4];
445
449typedef struct _ISCSI_LOGIN_RESPONSE {
450 UINT8 OpCode;
451 UINT8 Flags;
452 UINT8 VersionMax;
453 UINT8 VersionActive;
454 UINT8 TotalAHSLength;
455 UINT8 DataSegmentLength[3];
456 UINT8 Isid[6];
457 UINT16 Tsih;
458 UINT32 InitiatorTaskTag;
459 UINT32 Reserved1;
460 UINT32 StatSN;
461 UINT32 ExpCmdSN;
462 UINT32 MaxCmdSN;
463 UINT8 StatusClass;
464 UINT8 StatusDetail;
465 UINT8 Reserved2[10];
467
471typedef struct _ISCSI_LOGOUT_REQUEST {
472 UINT8 OpCode;
473 UINT8 ReasonCode;
474 UINT16 Reserved1;
475 UINT8 TotalAHSLength;
476 UINT8 DataSegmentLength[3];
477 UINT32 Reserved2[2];
478 UINT32 InitiatorTaskTag;
479 UINT16 Cid;
480 UINT16 Reserved3;
481 UINT32 CmdSN;
482 UINT32 ExpStatSN;
483 UINT32 Reserved4[4];
485
490 UINT8 OpCode;
491 UINT8 Reserved1;
492 UINT8 Response;
493 UINT8 Reserved2;
494 UINT8 TotalAHSLength;
495 UINT8 DataSegmentLength[3];
496 UINT32 Reserved3[2];
497 UINT32 InitiatorTaskTag;
498 UINT32 Reserved4;
499 UINT32 StatSN;
500 UINT32 ExpCmdSN;
501 UINT32 MaxCmdSN;
502 UINT32 Reserved5;
503 UINT16 Time2Wait;
504 UINT16 Time2Retain;
505 UINT32 Reserved6;
507
511typedef struct _ISCSI_SNACK_REQUEST {
512 UINT8 OpCode;
513 UINT8 Type;
514 UINT16 Reserved1;
515 UINT8 TotalAHSLength;
516 UINT8 DataSegmentLength[3];
517 UINT8 Lun[8];
518 UINT32 InitiatorTaskTag;
519 UINT32 TargetTransferTag;
520 UINT32 Reserved2;
521 UINT32 ExpStatSN;
522 UINT32 Reserved[2];
523 UINT32 BegRun;
524 UINT32 RunLength;
526
530typedef struct _ISCSI_REJECT {
531 UINT8 OpCode;
532 UINT8 Reserved1;
533 UINT8 Reason;
534 UINT8 Reserved2;
535 UINT8 TotalAHSLength;
536 UINT8 DataSegmentLength[3];
537 UINT32 Reserved3[2];
538 UINT32 InitiatorTaskTag;
539 UINT32 Reserved4;
540 UINT32 StatSN;
541 UINT32 ExpCmdSN;
542 UINT32 MaxCmdSN;
543 UINT32 DataSN;
544 UINT32 Reserved5[2];
546
550typedef struct _ISCSI_NOP_OUT {
551 UINT8 OpCode;
552 UINT8 Reserved1[3];
553 UINT8 TotalAHSLength;
554 UINT8 DataSegmentLength[3];
555 UINT8 Lun[8];
556 UINT32 InitiatorTaskTag;
557 UINT32 TargetTransferTag;
558 UINT32 CmdSN;
559 UINT32 ExpStatSN;
560 UINT32 Reserved2[4];
562
566typedef struct _ISCSI_NOP_IN {
567 UINT8 OpCode;
568 UINT8 Reserved1[3];
569 UINT8 TotalAHSLength;
570 UINT8 DataSegmentLength[3];
571 UINT8 Lun[8];
572 UINT32 InitiatorTaskTag;
573 UINT32 TargetTransferTag;
574 UINT32 StatSN;
575 UINT32 ExpCmdSN;
576 UINT32 MaxCmdSN;
577 UINT32 Reserved2[3];
579
580typedef enum {
581 IScsiDigestNone,
582 IScsiDigestCRC32
583} ISCSI_DIGEST_TYPE;
584
585typedef struct _ISCSI_XFER_CONTEXT {
586 UINT32 TargetTransferTag;
587 UINT32 Offset;
588 UINT32 DesiredLength;
589 UINT32 ExpDataSN;
591
593 UINT8 *InData;
594 UINT32 InDataLen;
596
597typedef struct _ISCSI_TCB {
598 LIST_ENTRY Link;
599
600 BOOLEAN SoFarInOrder;
601 UINT32 ExpDataSN;
602 BOOLEAN FbitReceived;
603 BOOLEAN StatusXferd;
604 UINT32 ActiveR2Ts;
605 UINT32 Response;
606 CHAR8 *Reason;
607 UINT32 InitiatorTaskTag;
608 UINT32 CmdSN;
609 UINT32 SNACKTag;
610
611 ISCSI_XFER_CONTEXT XferContext;
612
613 ISCSI_CONNECTION *Conn;
614} ISCSI_TCB;
615
616typedef struct _ISCSI_KEY_VALUE_PAIR {
617 LIST_ENTRY List;
618
619 CHAR8 *Key;
620 CHAR8 *Value;
622
630VOID
632 IN OUT ISCSI_SESSION *Session,
634 );
635
642VOID
645 );
646
660 IN OUT ISCSI_CONNECTION *Conn,
661 IN UINT16 Timeout
662 );
663
674 IN ISCSI_SESSION *Session
675 );
676
683VOID
685 IN ISCSI_CONNECTION *Conn
686 );
687
701 IN ISCSI_SESSION *Session
702 );
703
716 IN ISCSI_SESSION *Session
717 );
718
733 IN ISCSI_CONNECTION *Conn
734 );
735
747 IN ISCSI_CONNECTION *Conn
748 );
749
767 IN OUT NET_BUF *Pdu,
768 IN CHAR8 *Key,
769 IN CHAR8 *Value
770 );
771
781NET_BUF *
784 );
785
800 IN OUT ISCSI_CONNECTION *Conn,
801 IN OUT NET_BUF *Pdu
802 );
803
821 IN OUT ISCSI_SESSION *Session,
822 IN CHAR8 *Data,
823 IN UINT32 Len
824 );
825
832VOID
833EFIAPI
835 VOID *Arg
836 );
837
860 IN ISCSI_CONNECTION *Conn,
861 OUT NET_BUF **Pdu,
862 IN ISCSI_IN_BUFFER_CONTEXT *Context OPTIONAL,
863 IN BOOLEAN HeaderDigest,
864 IN BOOLEAN DataDigest,
865 IN EFI_EVENT TimeoutEvent OPTIONAL
866 );
867
881 );
882
890VOID
892 IN ISCSI_CONNECTION *Conn,
893 IN OUT NET_BUF *Pdu
894 );
895
908 IN OUT NET_BUF *Pdu,
909 IN UINT32 Len
910 );
911
924 IN CHAR8 *Data,
925 IN UINT32 Len
926 );
927
939CHAR8 *
941 IN OUT LIST_ENTRY *KeyValueList,
942 IN CHAR8 *Key
943 );
944
951VOID
953 IN LIST_ENTRY *KeyValueList
954 );
955
968 IN OUT CHAR8 *Name,
969 IN UINTN Len
970 );
971
992 IN UINT8 *Target,
993 IN UINT64 Lun,
995 );
996
1008 IN ISCSI_SESSION *Session
1009 );
1010
1018VOID
1020 IN OUT ISCSI_SESSION *Session,
1021 IN BOOLEAN Recovery
1022 );
1023
1031VOID
1033 IN OUT ISCSI_SESSION *Session
1034 );
1035
1036#endif
UINT64 UINTN
EFI_STATUS IScsiSessionReinstatement(IN ISCSI_SESSION *Session)
Definition: IScsiProto.c:3095
EFI_STATUS IScsiSendLoginReq(IN ISCSI_CONNECTION *Conn)
Definition: IScsiProto.c:596
EFI_STATUS IScsiReceiveLoginRsp(IN ISCSI_CONNECTION *Conn)
Definition: IScsiProto.c:631
VOID EFIAPI IScsiFreeNbufList(VOID *Arg)
Definition: IScsiProto.c:1262
struct _ISCSI_SNACK_REQUEST ISCSI_SNACK_REQUEST
struct _ISCSI_LOGIN_RESPONSE ISCSI_LOGIN_RESPONSE
VOID IScsiAttatchConnection(IN OUT ISCSI_SESSION *Session, IN OUT ISCSI_CONNECTION *Conn)
Definition: IScsiProto.c:21
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)
Definition: IScsiProto.c:2904
VOID IScsiSessionAbort(IN OUT ISCSI_SESSION *Session)
Definition: IScsiProto.c:3166
NET_BUF * IScsiPrepareLoginReq(IN OUT ISCSI_CONNECTION *Conn)
Definition: IScsiProto.c:749
EFI_STATUS IScsiProcessLoginRsp(IN OUT ISCSI_CONNECTION *Conn, IN OUT NET_BUF *Pdu)
Definition: IScsiProto.c:865
VOID IScsiFillOpParams(IN ISCSI_CONNECTION *Conn, IN OUT NET_BUF *Pdu)
Definition: IScsiProto.c:1779
struct _ISCSI_REJECT ISCSI_REJECT
VOID IScsiDestroyConnection(IN ISCSI_CONNECTION *Conn)
Definition: IScsiProto.c:310
VOID IScsiFreeKeyValueList(IN LIST_ENTRY *KeyValueList)
Definition: IScsiProto.c:1978
CHAR8 * IScsiGetValueByKeyFromList(IN OUT LIST_ENTRY *KeyValueList, IN CHAR8 *Key)
Definition: IScsiProto.c:1945
EFI_STATUS IScsiUpdateTargetAddress(IN OUT ISCSI_SESSION *Session, IN CHAR8 *Data, IN UINT32 Len)
Definition: IScsiProto.c:1103
struct _ISCSI_LOGIN_REQUEST ISCSI_LOGIN_REQUEST
struct _SCSI_RESPONSE SCSI_RESPONSE
EFI_STATUS IScsiPadSegment(IN OUT NET_BUF *Pdu, IN UINT32 Len)
Definition: IScsiProto.c:1843
VOID IScsiDetatchConnection(IN OUT ISCSI_CONNECTION *Conn)
Definition: IScsiProto.c:38
EFI_STATUS IScsiCheckOpParams(IN OUT ISCSI_CONNECTION *Conn)
Definition: IScsiProto.c:1505
EFI_STATUS IScsiConnLogin(IN OUT ISCSI_CONNECTION *Conn, IN UINT16 Timeout)
Definition: IScsiProto.c:122
EFI_STATUS IScsiSessionLogin(IN ISCSI_SESSION *Session)
Definition: IScsiProto.c:452
EFI_STATUS IScsiNormalizeName(IN OUT CHAR8 *Name, IN UINTN Len)
Definition: IScsiProto.c:2006
LIST_ENTRY * IScsiBuildKeyValueList(IN CHAR8 *Data, IN UINT32 Len)
Definition: IScsiProto.c:1876
struct _ISCSI_TMF_RESPONSE ISCSI_TMF_RESPONSE
struct _ISCSI_NOP_IN ISCSI_NOP_IN
struct _ISCSI_BASIC_HEADER ISCSI_BASIC_HEADER
struct _ISCSI_NOP_OUT ISCSI_NOP_OUT
EFI_STATUS IScsiAddKeyValuePair(IN OUT NET_BUF *Pdu, IN CHAR8 *Key, IN CHAR8 *Value)
Definition: IScsiProto.c:677
EFI_STATUS IScsiSessionReLogin(IN ISCSI_SESSION *Session)
Definition: IScsiProto.c:547
struct _ISCSI_SCSI_DATA_IN ISCSI_SCSI_DATA_IN
ISCSI_CONNECTION * IScsiCreateConnection(IN ISCSI_SESSION *Session)
Definition: IScsiProto.c:194
struct _ISCSI_READY_TO_TRANSFER ISCSI_READY_TO_TRANSFER
VOID IScsiSessionInit(IN OUT ISCSI_SESSION *Session, IN BOOLEAN Recovery)
Definition: IScsiProto.c:3125
struct _ISCSI_LOGOUT_RESPONSE ISCSI_LOGOUT_RESPONSE
struct _ISCSI_TMF_REQUEST ISCSI_TMF_REQUEST
struct _SCSI_COMMAND SCSI_COMMAND
struct _ISCSI_LOGOUT_REQUEST ISCSI_LOGOUT_REQUEST
struct _ISCSI_SCSI_DATA_OUT ISCSI_SCSI_DATA_OUT
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)
Definition: IScsiProto.c:1307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37