36 pr_err(
"Unable to allocate memory for"
37 " struct iscsi_datain_req\n");
76 pr_err(
"cmd->datain_list is empty for ITT:"
114 if (!read_data_left) {
115 pr_err(
"ITT: 0x%08x read_data_left is zero!\n",
120 if ((read_data_left <= conn->conn_ops->MaxRecvDataSegmentLength) &&
121 (read_data_left <= (conn->
sess->sess_ops->MaxBurstLength -
123 datain->
length = read_data_left;
126 if (conn->
sess->sess_ops->ErrorRecoveryLevel > 0)
129 if ((next_burst_len +
130 conn->
conn_ops->MaxRecvDataSegmentLength) <
131 conn->
sess->sess_ops->MaxBurstLength) {
133 conn->
conn_ops->MaxRecvDataSegmentLength;
134 next_burst_len += datain->
length;
136 datain->
length = (conn->
sess->sess_ops->MaxBurstLength -
141 if (conn->
sess->sess_ops->ErrorRecoveryLevel > 0)
147 datain->
offset = read_data_done;
212 read_data_left = (cmd->
se_cmd.data_length - read_data_done);
213 if (!read_data_left) {
214 pr_err(
"ITT: 0x%08x read_data_left is zero!\n",
230 if ((offset + conn->
conn_ops->MaxRecvDataSegmentLength) >=
231 cmd->
se_cmd.data_length) {
236 if (conn->
sess->sess_ops->ErrorRecoveryLevel > 0)
243 conn->
conn_ops->MaxRecvDataSegmentLength) <
244 conn->
sess->sess_ops->MaxBurstLength) {
246 conn->
conn_ops->MaxRecvDataSegmentLength;
251 datain->
length = (conn->
sess->sess_ops->MaxBurstLength -
256 if (conn->
sess->sess_ops->ErrorRecoveryLevel > 0)
264 if ((read_data_done + datain->
length) == cmd->
se_cmd.data_length)
333 read_data_left = (cmd->
se_cmd.data_length - read_data_done);
334 if (!read_data_left) {
335 pr_err(
"ITT: 0x%08x read_data_left is zero!\n",
344 if ((read_data_done + pdu->
length) == cmd->
se_cmd.data_length) {
346 if (conn->
sess->sess_ops->ErrorRecoveryLevel > 0)
351 if ((next_burst_len + conn->
conn_ops->MaxRecvDataSegmentLength) <
352 conn->
sess->sess_ops->MaxBurstLength)
353 next_burst_len += pdu->
length;
356 if (conn->
sess->sess_ops->ErrorRecoveryLevel > 0)
433 read_data_left = (cmd->
se_cmd.data_length - read_data_done);
434 if (!read_data_left) {
435 pr_err(
"ITT: 0x%08x read_data_left is zero!\n",
455 if (conn->
sess->sess_ops->ErrorRecoveryLevel > 0)
463 if ((read_data_done + pdu->
length) == cmd->
se_cmd.data_length)
514 if (conn->
sess->sess_ops->DataSequenceInOrder &&
515 conn->
sess->sess_ops->DataPDUInOrder)
516 return iscsit_set_datain_values_yes_and_yes(cmd, datain);
517 else if (!conn->
sess->sess_ops->DataSequenceInOrder &&
518 conn->
sess->sess_ops->DataPDUInOrder)
519 return iscsit_set_datain_values_no_and_yes(cmd, datain);
520 else if (conn->
sess->sess_ops->DataSequenceInOrder &&
521 !conn->
sess->sess_ops->DataPDUInOrder)
522 return iscsit_set_datain_values_yes_and_no(cmd, datain);
523 else if (!conn->
sess->sess_ops->DataSequenceInOrder &&
524 !conn->
sess->sess_ops->DataPDUInOrder)
525 return iscsit_set_datain_values_no_and_no(cmd, datain);