diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2008-12-02 01:32:05 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-12-29 12:24:20 -0500 |
commit | 577577da6d197ea3dcf3ee19c4f902fbd3a9390a (patch) | |
tree | 624b991f45dc12da557469daed0deea2bffb47ac /include/scsi/libiscsi.h | |
parent | 63c62f1cb980241513c82cacd5b9f878527c6647 (diff) |
[SCSI] libiscsi: prepare libiscsi for new offload engines by modifying unsol data code
cxgb3i offloads data transfers. It does not offload the entire scsi/iscsi
procssing like qla4xxx and it does not offload the iscsi sequence
processing like how bnx2i does. cxgb3i relies on iscsi_tcp for the
seqeunce handling so this changes how we transfer unsolicitied data by
adding a common r2t struct and helpers.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi/libiscsi.h')
-rw-r--r-- | include/scsi/libiscsi.h | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 61e53f14f7e1..51500573c0b8 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -93,24 +93,38 @@ enum { | |||
93 | ISCSI_TASK_RUNNING, | 93 | ISCSI_TASK_RUNNING, |
94 | }; | 94 | }; |
95 | 95 | ||
96 | struct iscsi_r2t_info { | ||
97 | __be32 ttt; /* copied from R2T */ | ||
98 | __be32 exp_statsn; /* copied from R2T */ | ||
99 | uint32_t data_length; /* copied from R2T */ | ||
100 | uint32_t data_offset; /* copied from R2T */ | ||
101 | int data_count; /* DATA-Out payload progress */ | ||
102 | int datasn; | ||
103 | /* LLDs should set/update these values */ | ||
104 | int sent; /* R2T sequence progress */ | ||
105 | }; | ||
106 | |||
96 | struct iscsi_task { | 107 | struct iscsi_task { |
97 | /* | 108 | /* |
98 | * Because LLDs allocate their hdr differently, this is a pointer | 109 | * Because LLDs allocate their hdr differently, this is a pointer |
99 | * and length to that storage. It must be setup at session | 110 | * and length to that storage. It must be setup at session |
100 | * creation time. | 111 | * creation time. |
101 | */ | 112 | */ |
102 | struct iscsi_cmd *hdr; | 113 | struct iscsi_hdr *hdr; |
103 | unsigned short hdr_max; | 114 | unsigned short hdr_max; |
104 | unsigned short hdr_len; /* accumulated size of hdr used */ | 115 | unsigned short hdr_len; /* accumulated size of hdr used */ |
116 | /* copied values in case we need to send tmfs */ | ||
117 | itt_t hdr_itt; | ||
118 | __be32 cmdsn; | ||
119 | uint8_t lun[8]; | ||
120 | |||
105 | int itt; /* this ITT */ | 121 | int itt; /* this ITT */ |
106 | 122 | ||
107 | uint32_t unsol_datasn; | ||
108 | unsigned imm_count; /* imm-data (bytes) */ | 123 | unsigned imm_count; /* imm-data (bytes) */ |
109 | unsigned unsol_count; /* unsolicited (bytes)*/ | ||
110 | /* offset in unsolicited stream (bytes); */ | 124 | /* offset in unsolicited stream (bytes); */ |
111 | unsigned unsol_offset; | 125 | struct iscsi_r2t_info unsol_r2t; |
112 | unsigned data_count; /* remaining Data-Out */ | ||
113 | char *data; /* mgmt payload */ | 126 | char *data; /* mgmt payload */ |
127 | unsigned data_count; | ||
114 | struct scsi_cmnd *sc; /* associated SCSI cmd*/ | 128 | struct scsi_cmnd *sc; /* associated SCSI cmd*/ |
115 | struct iscsi_conn *conn; /* used connection */ | 129 | struct iscsi_conn *conn; /* used connection */ |
116 | 130 | ||
@@ -121,6 +135,11 @@ struct iscsi_task { | |||
121 | void *dd_data; /* driver/transport data */ | 135 | void *dd_data; /* driver/transport data */ |
122 | }; | 136 | }; |
123 | 137 | ||
138 | static inline int iscsi_task_has_unsol_data(struct iscsi_task *task) | ||
139 | { | ||
140 | return task->unsol_r2t.data_length > task->unsol_r2t.sent; | ||
141 | } | ||
142 | |||
124 | static inline void* iscsi_next_hdr(struct iscsi_task *task) | 143 | static inline void* iscsi_next_hdr(struct iscsi_task *task) |
125 | { | 144 | { |
126 | return (void*)task->hdr + task->hdr_len; | 145 | return (void*)task->hdr + task->hdr_len; |
@@ -376,8 +395,9 @@ extern void iscsi_suspend_tx(struct iscsi_conn *conn); | |||
376 | * pdu and task processing | 395 | * pdu and task processing |
377 | */ | 396 | */ |
378 | extern void iscsi_update_cmdsn(struct iscsi_session *, struct iscsi_nopin *); | 397 | extern void iscsi_update_cmdsn(struct iscsi_session *, struct iscsi_nopin *); |
379 | extern void iscsi_prep_unsolicit_data_pdu(struct iscsi_task *, | 398 | extern void iscsi_prep_data_out_pdu(struct iscsi_task *task, |
380 | struct iscsi_data *hdr); | 399 | struct iscsi_r2t_info *r2t, |
400 | struct iscsi_data *hdr); | ||
381 | extern int iscsi_conn_send_pdu(struct iscsi_cls_conn *, struct iscsi_hdr *, | 401 | extern int iscsi_conn_send_pdu(struct iscsi_cls_conn *, struct iscsi_hdr *, |
382 | char *, uint32_t); | 402 | char *, uint32_t); |
383 | extern int iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *, | 403 | extern int iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *, |