1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef ISCSI_SEQ_AND_PDU_LIST_H
3 #define ISCSI_SEQ_AND_PDU_LIST_H
5 #include <linux/types.h>
6 #include <linux/cache.h>
8 /* struct iscsi_pdu->status */
9 #define DATAOUT_PDU_SENT 1
11 /* struct iscsi_seq->type */
12 #define SEQTYPE_IMMEDIATE 1
13 #define SEQTYPE_UNSOLICITED 2
14 #define SEQTYPE_NORMAL 3
16 /* struct iscsi_seq->status */
17 #define DATAOUT_SEQUENCE_GOT_R2T 1
18 #define DATAOUT_SEQUENCE_WITHIN_COMMAND_RECOVERY 2
19 #define DATAOUT_SEQUENCE_COMPLETE 3
21 /* iscsi_determine_counts_for_list() type */
22 #define PDULIST_NORMAL 1
23 #define PDULIST_IMMEDIATE 2
24 #define PDULIST_UNSOLICITED 3
25 #define PDULIST_IMMEDIATE_AND_UNSOLICITED 4
27 /* struct iscsi_pdu->type */
28 #define PDUTYPE_IMMEDIATE 1
29 #define PDUTYPE_UNSOLICITED 2
30 #define PDUTYPE_NORMAL 3
32 /* struct iscsi_pdu->status */
33 #define ISCSI_PDU_NOT_RECEIVED 0
34 #define ISCSI_PDU_RECEIVED_OK 1
35 #define ISCSI_PDU_CRC_FAILED 2
36 #define ISCSI_PDU_TIMED_OUT 3
38 /* struct iscsi_build_list->randomize */
39 #define RANDOM_DATAIN_PDU_OFFSETS 0x01
40 #define RANDOM_DATAIN_SEQ_OFFSETS 0x02
41 #define RANDOM_DATAOUT_PDU_OFFSETS 0x04
42 #define RANDOM_R2T_OFFSETS 0x08
44 /* struct iscsi_build_list->data_direction */
45 #define ISCSI_PDU_READ 0x01
46 #define ISCSI_PDU_WRITE 0x02
48 struct iscsi_build_list
{
52 int immediate_data_length
;
64 } ____cacheline_aligned
;
83 } ____cacheline_aligned
;
87 extern int iscsit_build_pdu_and_seq_lists(struct iscsi_cmd
*, u32
);
88 extern struct iscsi_pdu
*iscsit_get_pdu_holder(struct iscsi_cmd
*, u32
, u32
);
89 extern struct iscsi_pdu
*iscsit_get_pdu_holder_for_seq(struct iscsi_cmd
*, struct iscsi_seq
*);
90 extern struct iscsi_seq
*iscsit_get_seq_holder(struct iscsi_cmd
*, u32
, u32
);
92 #endif /* ISCSI_SEQ_AND_PDU_LIST_H */