Commit 3d45cefc authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen
Browse files

scsi: core: Drop obsolete Linux-specific SCSI status codes

Originally the SCSI subsystem has been using 'special' SCSI status codes,
which were the SAM-specified ones but shifted by 1.  As most drivers have
now been modified to use the SAM-specified ones, having two nearly
identical sets of definitions only causes confusion.

The Linux-specifed SCSI status codes have been marked obsolete for several
years so drop them and use the SAM-specified status codes throughout.

Link: https://lore.kernel.org/r/20210427083046.31620-41-hare@suse.de


Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 50207148
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -642,7 +642,7 @@ static struct ata_queued_cmd *ata_scsi_qc_new(struct ata_device *dev,
		if (cmd->request->rq_flags & RQF_QUIET)
			qc->flags |= ATA_QCFLAG_QUIET;
	} else {
		cmd->result = (DID_OK << 16) | (QUEUE_FULL << 1);
		cmd->result = (DID_OK << 16) | SAM_STAT_TASK_SET_FULL;
		cmd->scsi_done(cmd);
	}

+1 −1
Original line number Diff line number Diff line
@@ -2232,7 +2232,7 @@ static int srp_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scmnd)
		 * to reduce queue depth temporarily.
		 */
		scmnd->result = len == -ENOMEM ?
			DID_OK << 16 | QUEUE_FULL << 1 : DID_ERROR << 16;
			DID_OK << 16 | SAM_STAT_TASK_SET_FULL : DID_ERROR << 16;
		goto err_iu;
	}

+1 −1
Original line number Diff line number Diff line
@@ -1338,7 +1338,7 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
				/* If error, command failed */
				if (error == 1) {
					/* Ask for a host reset */
					cmd->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
					cmd->result = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
				}

				/* Report residual bytes for single sgl */
+2 −2
Original line number Diff line number Diff line
@@ -429,7 +429,7 @@ static int tw_decode_sense(TW_Device_Extension *tw_dev, int request_id, int fill
					/* Additional sense code qualifier */
					tw_dev->srb[request_id]->sense_buffer[13] = tw_sense_table[i][3];

					tw_dev->srb[request_id]->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
					tw_dev->srb[request_id]->result = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
					return TW_ISR_DONT_RESULT; /* Special case for isr to not over-write result */
				}
			}
@@ -2159,7 +2159,7 @@ static irqreturn_t tw_interrupt(int irq, void *dev_instance)
				/* If error, command failed */
				if (error == 1) {
					/* Ask for a host reset */
					tw_dev->srb[request_id]->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
					tw_dev->srb[request_id]->result = (DID_OK << 16) | SAM_STAT_CHECK_CONDITION;
				}

				/* Now complete the io */
+3 −3
Original line number Diff line number Diff line
@@ -980,8 +980,8 @@ process_script_interrupt(__u32 dsps, __u32 dsp, struct scsi_cmnd *SCp,
						  NCR_700_FINISHED_TAG_NEGOTIATION);

		/* check for contingent allegiance conditions */
		if (hostdata->status[0] >> 1 == CHECK_CONDITION ||
		    hostdata->status[0] >> 1 == COMMAND_TERMINATED) {
		if (hostdata->status[0] == SAM_STAT_CHECK_CONDITION ||
		    hostdata->status[0] == SAM_STAT_COMMAND_TERMINATED) {
			struct NCR_700_command_slot *slot =
				(struct NCR_700_command_slot *)SCp->host_scribble;
			if(slot->flags == NCR_700_FLAG_AUTOSENSE) {
Loading