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