Lines Matching refs:SCpnt

136 static inline void nsp_inc_resid(struct scsi_cmnd *SCpnt, int residInc)  in nsp_inc_resid()  argument
138 scsi_set_resid(SCpnt, scsi_get_resid(SCpnt) + residInc); in nsp_inc_resid()
180 static void nsp_scsi_done(struct scsi_cmnd *SCpnt) in nsp_scsi_done() argument
182 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsp_scsi_done()
186 scsi_done(SCpnt); in nsp_scsi_done()
189 static int nsp_queuecommand_lck(struct scsi_cmnd *const SCpnt) in nsp_queuecommand_lck() argument
191 struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); in nsp_queuecommand_lck()
195 unsigned char target = scmd_id(SCpnt); in nsp_queuecommand_lck()
197 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsp_queuecommand_lck()
201 SCpnt, target, SCpnt->device->lun, scsi_sglist(SCpnt), in nsp_queuecommand_lck()
202 scsi_bufflen(SCpnt), scsi_sg_count(SCpnt)); in nsp_queuecommand_lck()
207 SCpnt->result = DID_BAD_TARGET << 16; in nsp_queuecommand_lck()
208 nsp_scsi_done(SCpnt); in nsp_queuecommand_lck()
217 SCpnt->result = DID_BAD_TARGET << 16; in nsp_queuecommand_lck()
218 nsp_scsi_done(SCpnt); in nsp_queuecommand_lck()
223 show_command(SCpnt); in nsp_queuecommand_lck()
225 data->CurrentSC = SCpnt; in nsp_queuecommand_lck()
232 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt)); in nsp_queuecommand_lck()
240 if (scsi_bufflen(SCpnt)) { in nsp_queuecommand_lck()
241 scsi_pointer->buffer = scsi_sglist(SCpnt); in nsp_queuecommand_lck()
242 scsi_pointer->ptr = BUFFER_ADDR(SCpnt); in nsp_queuecommand_lck()
244 scsi_pointer->buffers_residual = scsi_sg_count(SCpnt) - 1; in nsp_queuecommand_lck()
252 if (!nsphw_start_selection(SCpnt)) { in nsp_queuecommand_lck()
254 SCpnt->result = DID_BUS_BUSY << 16; in nsp_queuecommand_lck()
255 nsp_scsi_done(SCpnt); in nsp_queuecommand_lck()
363 static bool nsphw_start_selection(struct scsi_cmnd *const SCpnt) in nsphw_start_selection() argument
365 struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); in nsphw_start_selection()
366 unsigned int host_id = SCpnt->device->host->this_id; in nsphw_start_selection()
367 unsigned int base = SCpnt->device->host->io_port; in nsphw_start_selection()
368 unsigned char target = scmd_id(SCpnt); in nsphw_start_selection()
369 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsphw_start_selection()
414 nsp_start_timer(SCpnt, 1000/51); in nsphw_start_selection()
445 static int nsp_analyze_sdtr(struct scsi_cmnd *SCpnt) in nsp_analyze_sdtr() argument
447 unsigned char target = scmd_id(SCpnt); in nsp_analyze_sdtr()
449 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsp_analyze_sdtr()
501 static void nsp_start_timer(struct scsi_cmnd *SCpnt, int time) in nsp_start_timer() argument
503 unsigned int base = SCpnt->device->host->io_port; in nsp_start_timer()
504 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsp_start_timer()
514 static int nsp_negate_signal(struct scsi_cmnd *SCpnt, unsigned char mask, in nsp_negate_signal() argument
517 unsigned int base = SCpnt->device->host->io_port; in nsp_negate_signal()
542 static int nsp_expect_signal(struct scsi_cmnd *SCpnt, in nsp_expect_signal() argument
546 unsigned int base = SCpnt->device->host->io_port; in nsp_expect_signal()
577 static int nsp_xfer(struct scsi_cmnd *const SCpnt, int phase) in nsp_xfer() argument
579 struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); in nsp_xfer()
580 unsigned int base = SCpnt->device->host->io_port; in nsp_xfer()
581 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsp_xfer()
590 ret = nsp_expect_signal(SCpnt, phase, BUSMON_REQ); in nsp_xfer()
609 nsp_negate_signal(SCpnt, BUSMON_ACK, "xfer<ack>"); in nsp_xfer()
618 static int nsp_dataphase_bypass(struct scsi_cmnd *const SCpnt) in nsp_dataphase_bypass() argument
620 struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); in nsp_dataphase_bypass()
621 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsp_dataphase_bypass()
630 count = nsp_fifo_count(SCpnt); in nsp_dataphase_bypass()
642 nsp_pio_read(SCpnt); in nsp_dataphase_bypass()
651 static void nsp_reselected(struct scsi_cmnd *SCpnt) in nsp_reselected() argument
653 unsigned int base = SCpnt->device->host->io_port; in nsp_reselected()
654 unsigned int host_id = SCpnt->device->host->this_id; in nsp_reselected()
673 if (scmd_id(SCpnt) != target) { in nsp_reselected()
677 nsp_negate_signal(SCpnt, BUSMON_SEL, "reselect<SEL>"); in nsp_reselected()
679 nsp_nexus(SCpnt); in nsp_reselected()
688 static int nsp_fifo_count(struct scsi_cmnd *SCpnt) in nsp_fifo_count() argument
690 unsigned int base = SCpnt->device->host->io_port; in nsp_fifo_count()
715 static void nsp_pio_read(struct scsi_cmnd *const SCpnt) in nsp_pio_read() argument
717 struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); in nsp_pio_read()
718 unsigned int base = SCpnt->device->host->io_port; in nsp_pio_read()
719 unsigned long mmio_base = SCpnt->device->host->base; in nsp_pio_read()
720 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsp_pio_read()
728 SCpnt, scsi_get_resid(SCpnt), ocount, scsi_pointer->ptr, in nsp_pio_read()
742 res = nsp_fifo_count(SCpnt) - ocount; in nsp_pio_read()
782 nsp_inc_resid(SCpnt, -res); in nsp_pio_read()
794 scsi_pointer->ptr = BUFFER_ADDR(SCpnt); in nsp_pio_read()
807 scsi_get_resid(SCpnt), scsi_pointer->this_residual, in nsp_pio_read()
812 scsi_get_resid(SCpnt)); in nsp_pio_read()
818 static void nsp_pio_write(struct scsi_cmnd *SCpnt) in nsp_pio_write() argument
820 struct scsi_pointer *scsi_pointer = nsp_priv(SCpnt); in nsp_pio_write()
821 unsigned int base = SCpnt->device->host->io_port; in nsp_pio_write()
822 unsigned long mmio_base = SCpnt->device->host->base; in nsp_pio_write()
823 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsp_pio_write()
833 scsi_get_resid(SCpnt)); in nsp_pio_write()
844 res = ocount - nsp_fifo_count(SCpnt); in nsp_pio_write()
848 nsp_inc_resid(SCpnt, res); in nsp_pio_write()
856 res = ocount - nsp_fifo_count(SCpnt); in nsp_pio_write()
885 nsp_inc_resid(SCpnt, -res); in nsp_pio_write()
896 scsi_pointer->ptr = BUFFER_ADDR(SCpnt); in nsp_pio_write()
907 scsi_get_resid(SCpnt)); in nsp_pio_write()
911 scsi_get_resid(SCpnt)); in nsp_pio_write()
919 static int nsp_nexus(struct scsi_cmnd *SCpnt) in nsp_nexus() argument
921 unsigned int base = SCpnt->device->host->io_port; in nsp_nexus()
922 unsigned char target = scmd_id(SCpnt); in nsp_nexus()
924 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsp_nexus()
933 if (scsi_get_resid(SCpnt) % 4 != 0 || in nsp_nexus()
934 scsi_get_resid(SCpnt) <= PAGE_SIZE ) { in nsp_nexus()
1489 static int nsp_eh_bus_reset(struct scsi_cmnd *SCpnt) in nsp_eh_bus_reset() argument
1491 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsp_eh_bus_reset()
1493 nsp_dbg(NSP_DEBUG_BUSRESET, "SCpnt=0x%p", SCpnt); in nsp_eh_bus_reset()
1498 static int nsp_eh_host_reset(struct scsi_cmnd *SCpnt) in nsp_eh_host_reset() argument
1500 nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata; in nsp_eh_host_reset()