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