Lines Matching refs:ncmd
147 struct NCR5380_cmd *ncmd = NCR5380_to_ncmd(cmd);
150 ncmd->buffer = scsi_sglist(cmd);
151 ncmd->ptr = sg_virt(ncmd->buffer);
152 ncmd->this_residual = ncmd->buffer->length;
154 ncmd->buffer = NULL;
155 ncmd->ptr = NULL;
156 ncmd->this_residual = 0;
159 ncmd->status = 0;
160 ncmd->message = 0;
163 static inline void advance_sg_buffer(struct NCR5380_cmd *ncmd)
165 struct scatterlist *s = ncmd->buffer;
167 if (!ncmd->this_residual && s && !sg_is_last(s)) {
168 ncmd->buffer = sg_next(s);
169 ncmd->ptr = sg_virt(ncmd->buffer);
170 ncmd->this_residual = ncmd->buffer->length;
176 struct NCR5380_cmd *ncmd = NCR5380_to_ncmd(cmd);
177 int resid = ncmd->this_residual;
178 struct scatterlist *s = ncmd->buffer;
564 struct NCR5380_cmd *ncmd = NCR5380_to_ncmd(cmd);
596 list_add(&ncmd->list, &hostdata->unissued);
598 list_add_tail(&ncmd->list, &hostdata->unissued);
638 struct NCR5380_cmd *ncmd;
642 list_for_each_entry(ncmd, &hostdata->unissued, list) {
643 cmd = NCR5380_to_scmd(ncmd);
648 list_del(&ncmd->list);
656 ncmd = list_first_entry(&hostdata->autosense,
658 list_del(&ncmd->list);
659 cmd = NCR5380_to_scmd(ncmd);
672 struct NCR5380_cmd *ncmd = NCR5380_to_ncmd(cmd);
676 list_add(&ncmd->list, &hostdata->autosense);
679 list_add(&ncmd->list, &hostdata->unissued);
757 struct NCR5380_cmd *ncmd = NCR5380_to_ncmd(hostdata->connected);
765 p = ncmd->phase;
802 data = (unsigned char **)&ncmd->ptr;
803 count = &ncmd->this_residual;
1691 struct NCR5380_cmd *ncmd = NCR5380_to_ncmd(cmd);
1706 advance_sg_buffer(ncmd);
1713 ncmd->ptr, count);
1716 ncmd->ptr, count);
1756 advance_sg_buffer(ncmd);
1759 ncmd->this_residual,
1760 sg_nents(ncmd->buffer));
1779 &len, (unsigned char **)&ncmd->ptr)) {
1795 transfersize = min(ncmd->this_residual,
1799 (unsigned char **)&ncmd->ptr,
1801 ncmd->this_residual -= transfersize - len;
1812 ncmd->message = tmp;
1829 set_status_byte(cmd, ncmd->status);
1836 if (ncmd->status == SAM_STAT_CHECK_CONDITION ||
1837 ncmd->status == SAM_STAT_COMMAND_TERMINATED) {
1840 list_add_tail(&ncmd->list,
1871 list_add(&ncmd->list, &hostdata->disconnected);
2001 ncmd->status = tmp;
2031 struct NCR5380_cmd *ncmd;
2122 list_for_each_entry(ncmd, &hostdata->disconnected, list) {
2123 struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd);
2127 list_del(&ncmd->list);
2154 advance_sg_buffer(ncmd);
2161 ncmd->ptr, count);
2164 ncmd->ptr, count);
2189 struct NCR5380_cmd *ncmd;
2191 list_for_each_entry(ncmd, haystack, list)
2192 if (NCR5380_to_scmd(ncmd) == needle)
2207 struct NCR5380_cmd *ncmd = NCR5380_to_ncmd(needle);
2209 list_del(&ncmd->list);
2328 struct NCR5380_cmd *ncmd;
2347 list_for_each_entry(ncmd, &hostdata->disconnected, list) {
2348 struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd);
2355 list_for_each_entry(ncmd, &hostdata->autosense, list) {
2356 struct scsi_cmnd *cmd = NCR5380_to_scmd(ncmd);
2387 struct NCR5380_cmd *ncmd;
2397 list_for_each_entry(ncmd, &hostdata->unissued, list) {
2398 struct scsi_cmnd *scmd = NCR5380_to_scmd(ncmd);