File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,19 @@ static inline void advance_sg_buffer(struct scsi_cmnd *cmd)
172
172
}
173
173
}
174
174
175
+ static inline void set_resid_from_SCp (struct scsi_cmnd * cmd )
176
+ {
177
+ int resid = cmd -> SCp .this_residual ;
178
+ struct scatterlist * s = cmd -> SCp .buffer ;
179
+
180
+ if (s )
181
+ while (!sg_is_last (s )) {
182
+ s = sg_next (s );
183
+ resid += s -> length ;
184
+ }
185
+ scsi_set_resid (cmd , resid );
186
+ }
187
+
175
188
/**
176
189
* NCR5380_poll_politely2 - wait for two chip register values
177
190
* @hostdata: host private data
@@ -1803,6 +1816,8 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
1803
1816
cmd -> result |= cmd -> SCp .Status ;
1804
1817
cmd -> result |= cmd -> SCp .Message << 8 ;
1805
1818
1819
+ set_resid_from_SCp (cmd );
1820
+
1806
1821
if (cmd -> cmnd [0 ] == REQUEST_SENSE )
1807
1822
complete_cmd (instance , cmd );
1808
1823
else {
You can’t perform that action at this time.
0 commit comments