Lines Matching defs:sc

89 static void	mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq);
95 static void mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply);
426 * @sc: original scsi cmnd pointer
434 mptscsih_info_scsiio(MPT_ADAPTER *ioc, struct scsi_cmnd *sc, SCSIIOReply_t * pScsiReply)
536 scsi_print_command(sc);
538 ioc->name, pScsiReply->Bus, pScsiReply->TargetID, sc->device->lun);
540 "resid = %d\n", ioc->name, scsi_bufflen(sc), sc->underflow,
541 scsi_get_resid(sc));
543 "sc->result = %08X\n", ioc->name, le16_to_cpu(pScsiReply->TaskTag),
544 le32_to_cpu(pScsiReply->TransferCount), sc->result);
552 skey = sc->sense_buffer[2] & 0x0F;
553 asc = sc->sense_buffer[12];
554 ascq = sc->sense_buffer[13];
588 struct scsi_cmnd *sc;
609 sc = mptscsih_getclear_scsi_lookup(ioc, req_idx);
610 if (sc == NULL) {
615 * completion done. Cannot touch sc struct. Just free mem.
625 if ((unsigned char *)mf != sc->host_scribble) {
631 VirtDevice *vdevice = sc->device->hostdata;
635 sc->result = DID_NO_CONNECT << 16;
640 sc->host_scribble = NULL;
641 sc->result = DID_OK << 16; /* Set default reply as OK */
647 "ScsiDone (mf=%p,mr=%p,sc=%p,idx=%d,task-tag=%d)\n",
648 ioc->name, mf, mr, sc, req_idx, pScsiReply->TaskTag));
651 "ScsiDone (mf=%p,mr=%p,sc=%p,idx=%d)\n",
652 ioc->name, mf, mr, sc, req_idx));
669 scsi_set_resid(sc, scsi_bufflen(sc) - xfer_cnt);
686 mptscsih_copy_sense_data(sc, hd, mf, pScsiReply);
695 sc->device->host->host_no, sc->device->channel,
696 sc->device->id, sc->device->lun,
708 sc->result = SAM_STAT_BUSY;
713 sc->result = DID_BAD_TARGET << 16;
719 sc->result = DID_NO_CONNECT << 16;
722 sc->result = DID_REQUEUE << 16;
727 vdevice = sc->device->hostdata;
748 sc->device->hostdata;
766 sc->result =
780 sc->result = DID_ERROR << 16;
793 sc->result = DID_RESET << 16;
798 sc->result = DID_ERROR << 16;
800 sc->result = DID_RESET << 16;
804 scsi_set_resid(sc, scsi_bufflen(sc) - xfer_cnt);
805 if((xfer_cnt==0)||(sc->underflow > xfer_cnt))
806 sc->result=DID_SOFT_ERROR << 16;
808 sc->result = (DID_OK << 16) | scsi_status;
811 ioc->name, sc->result, sc->device->channel, sc->device->id));
819 sc->result = (DID_OK << 16) | scsi_status;
837 if (scsi_bufflen(sc) !=
839 sc->result =
843 "sc->req_bufflen=0x%02x,"
845 scsi_bufflen(sc),
851 if (xfer_cnt < sc->underflow) {
853 sc->result = SAM_STAT_BUSY;
855 sc->result = DID_SOFT_ERROR << 16;
860 sc->result = DID_SOFT_ERROR << 16;
864 sc->result = DID_RESET << 16;
870 " sc->underflow={report ERR if < %02xh bytes xfer'd}\n",
871 ioc->name, sc->underflow));
878 mptscsih_report_queue_full(sc, pScsiReply, pScsiReq);
883 scsi_set_resid(sc, 0);
887 sc->result = (DID_OK << 16) | scsi_status;
902 (sc->sense_buffer[2] & 0x20)) {
905 sc->sense_buffer[3] << 24 |
906 sc->sense_buffer[4] << 16 |
907 sc->sense_buffer[5] << 8 |
908 sc->sense_buffer[6];
909 if (((sc->sense_buffer[3] & 0x80) ==
910 0x80) && (scsi_bufflen(sc)
912 sc->sense_buffer[2] =
914 sc->sense_buffer[12] = 0xff;
915 sc->sense_buffer[13] = 0xff;
918 "sc->req_bufflen=0x%02x,"
920 scsi_bufflen(sc),
923 if (((sc->sense_buffer[3] & 0x80)
925 (scsi_bufflen(sc) !=
927 sc->sense_buffer[2] =
929 sc->sense_buffer[12] = 0xff;
930 sc->sense_buffer[13] = 0xff;
933 "sc->req_bufflen=0x%02x,"
936 scsi_bufflen(sc),
949 mptscsih_report_queue_full(sc, pScsiReply, pScsiReq);
958 sc->result = DID_SOFT_ERROR << 16;
962 sc->result = DID_RESET << 16;
972 if (sc->result == MPI_SCSI_STATUS_TASK_SET_FULL)
973 mptscsih_report_queue_full(sc, pScsiReply, pScsiReq);
982 sc->result = DID_SOFT_ERROR << 16;
997 sc->result = DID_SOFT_ERROR << 16;
1003 if (sc->result && (ioc->debug_level & MPT_DEBUG_REPLY))
1004 mptscsih_info_scsiio(ioc, sc, pScsiReply);
1010 scsi_dma_unmap(sc);
1012 scsi_done(sc); /* Issue the command callback */
1033 struct scsi_cmnd *sc;
1039 sc = mptscsih_getclear_scsi_lookup(ioc, ii);
1040 if (!sc)
1049 if ((unsigned char *)mf != sc->host_scribble)
1051 scsi_dma_unmap(sc);
1052 sc->result = DID_RESET << 16;
1053 sc->host_scribble = NULL;
1054 dtmprintk(ioc, sdev_printk(KERN_INFO, sc->device, MYIOC_s_FMT
1055 "completing cmds: fw_channel %d, fw_id %d, sc=%p, mf = %p, "
1056 "idx=%x\n", ioc->name, channel, id, sc, mf, ii));
1057 scsi_done(sc);
1081 struct scsi_cmnd *sc;
1088 if ((sc = ioc->ScsiLookup[ii]) != NULL) {
1107 if ((unsigned char *)mf != sc->host_scribble)
1113 scsi_dma_unmap(sc);
1114 sc->host_scribble = NULL;
1115 sc->result = DID_NO_CONNECT << 16;
1116 dtmprintk(ioc, sdev_printk(KERN_INFO, sc->device,
1118 "fw_id %d, sc=%p, mf = %p, idx=%x\n", ioc->name,
1120 sc, mf, ii));
1121 scsi_done(sc);
1135 * @sc: Pointer to scsi_cmnd structure
1144 mptscsih_report_queue_full(struct scsi_cmnd *sc, SCSIIOReply_t *pScsiReply, SCSIIORequest_t *pScsiReq)
1150 if (sc->device == NULL)
1152 if (sc->device->host == NULL)
1154 if ((hd = shost_priv(sc->device->host)) == NULL)
1159 ioc->name, 0, sc->device->id, sc->device->lun));
1697 "can't locate host! (sc=%p)\n", SCpnt);
1702 printk(MYIOC_s_INFO_FMT "attempting task abort! (sc=%p)\n",
1709 "task abort: device has been deleted (sc=%p)\n",
1721 "task abort: hidden raid component (sc=%p)\n",
1732 "task abort: raid volume (sc=%p)\n",
1747 "Command not in the active list! (sc=%p)\n", ioc->name,
1776 "task abort: command still in active list! (sc=%p)\n",
1781 "task abort: command cleared from active list! (sc=%p)\n",
1787 printk(MYIOC_s_INFO_FMT "task abort: %s (rv=%04x) (sc=%p)\n",
1815 "Can't locate host! (sc=%p)\n", SCpnt);
1820 printk(MYIOC_s_INFO_FMT "attempting lun reset! (sc=%p)\n",
1837 printk (MYIOC_s_INFO_FMT "lun reset: %s (sc=%p)\n",
1867 "Can't locate host! (sc=%p)\n", SCpnt);
1872 printk(MYIOC_s_INFO_FMT "attempting target reset! (sc=%p)\n",
1896 printk (MYIOC_s_INFO_FMT "target reset: %s (sc=%p)\n",
1927 "Can't locate host! (sc=%p)\n", SCpnt);
1932 printk(MYIOC_s_INFO_FMT "attempting bus reset! (sc=%p)\n",
1947 printk(MYIOC_s_INFO_FMT "bus reset: %s (sc=%p)\n",
1976 "Can't locate host! (sc=%p)\n", SCpnt);
1984 printk(MYIOC_s_INFO_FMT "attempting host reset! (sc=%p)\n",
1996 printk(MYIOC_s_INFO_FMT "host reset: %s (sc=%p)\n",
2455 mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply_t *pScsiReply)
2465 vdevice = sc->device->hostdata;
2474 memcpy(sc->sense_buffer, sense_data, MPT_SENSE_BUFFER_ALLOC);
2488 (sc->device->channel << 8) | sc->device->id;
2572 * @sc: scsi_cmnd pointer
2575 SCPNT_TO_LOOKUP_IDX(MPT_ADAPTER *ioc, struct scsi_cmnd *sc)
2582 if (ioc->ScsiLookup[i] == sc) {