Commit 54c9f6fd authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Martin K. Petersen

scsi: aic7xxx: aic79xx: Remove driver-defined SAM status definitions

Replace the driver-defined SAM status definitions with the standard
mid-layer defined ones.

Link: https://lore.kernel.org/r/20210113090500.129644-9-hare@suse.deReviewed-by: default avatarBart van Assche <bvanassche@acm.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent c23435db
...@@ -8911,7 +8911,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) ...@@ -8911,7 +8911,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
break; break;
} }
} }
if (siu->status == SCSI_STATUS_OK) if (siu->status == SAM_STAT_GOOD)
ahd_set_transaction_status(scb, ahd_set_transaction_status(scb,
CAM_REQ_CMP_ERR); CAM_REQ_CMP_ERR);
} }
...@@ -8925,8 +8925,8 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) ...@@ -8925,8 +8925,8 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
ahd_done(ahd, scb); ahd_done(ahd, scb);
break; break;
} }
case SCSI_STATUS_CMD_TERMINATED: case SAM_STAT_COMMAND_TERMINATED:
case SCSI_STATUS_CHECK_COND: case SAM_STAT_CHECK_CONDITION:
{ {
struct ahd_devinfo devinfo; struct ahd_devinfo devinfo;
struct ahd_dma_seg *sg; struct ahd_dma_seg *sg;
...@@ -9016,7 +9016,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb) ...@@ -9016,7 +9016,7 @@ ahd_handle_scsi_status(struct ahd_softc *ahd, struct scb *scb)
ahd_queue_scb(ahd, scb); ahd_queue_scb(ahd, scb);
break; break;
} }
case SCSI_STATUS_OK: case SAM_STAT_GOOD:
printk("%s: Interrupted for status of 0???\n", printk("%s: Interrupted for status of 0???\n",
ahd_name(ahd)); ahd_name(ahd));
fallthrough; fallthrough;
......
...@@ -1834,7 +1834,7 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) ...@@ -1834,7 +1834,7 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb)
if (dev->openings == 1 if (dev->openings == 1
&& ahd_get_transaction_status(scb) == CAM_REQ_CMP && ahd_get_transaction_status(scb) == CAM_REQ_CMP
&& ahd_get_scsi_status(scb) != SCSI_STATUS_QUEUE_FULL) && ahd_get_scsi_status(scb) != SAM_STAT_TASK_SET_FULL)
dev->tag_success_count++; dev->tag_success_count++;
/* /*
* Some devices deal with temporary internal resource * Some devices deal with temporary internal resource
...@@ -1891,8 +1891,8 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, ...@@ -1891,8 +1891,8 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
switch (ahd_get_scsi_status(scb)) { switch (ahd_get_scsi_status(scb)) {
default: default:
break; break;
case SCSI_STATUS_CHECK_COND: case SAM_STAT_CHECK_CONDITION:
case SCSI_STATUS_CMD_TERMINATED: case SAM_STAT_COMMAND_TERMINATED:
{ {
struct scsi_cmnd *cmd; struct scsi_cmnd *cmd;
...@@ -1947,7 +1947,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, ...@@ -1947,7 +1947,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
} }
break; break;
} }
case SCSI_STATUS_QUEUE_FULL: case SAM_STAT_TASK_SET_FULL:
/* /*
* By the time the core driver has returned this * By the time the core driver has returned this
* command, all other commands that were queued * command, all other commands that were queued
...@@ -1993,7 +1993,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, ...@@ -1993,7 +1993,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
dev->last_queuefull_same_count = 0; dev->last_queuefull_same_count = 0;
} }
ahd_set_transaction_status(scb, CAM_REQUEUE_REQ); ahd_set_transaction_status(scb, CAM_REQUEUE_REQ);
ahd_set_scsi_status(scb, SCSI_STATUS_OK); ahd_set_scsi_status(scb, SAM_STAT_GOOD);
ahd_platform_set_tags(ahd, sdev, &devinfo, ahd_platform_set_tags(ahd, sdev, &devinfo,
(dev->flags & AHD_DEV_Q_BASIC) (dev->flags & AHD_DEV_Q_BASIC)
? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED); ? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED);
...@@ -2007,7 +2007,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd, ...@@ -2007,7 +2007,7 @@ ahd_linux_handle_scsi_status(struct ahd_softc *ahd,
ahd_platform_set_tags(ahd, sdev, &devinfo, ahd_platform_set_tags(ahd, sdev, &devinfo,
(dev->flags & AHD_DEV_Q_BASIC) (dev->flags & AHD_DEV_Q_BASIC)
? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED); ? AHD_QUEUE_BASIC : AHD_QUEUE_TAGGED);
ahd_set_scsi_status(scb, SCSI_STATUS_BUSY); ahd_set_scsi_status(scb, SAM_STAT_BUSY);
} }
} }
...@@ -2039,8 +2039,8 @@ ahd_linux_queue_cmd_complete(struct ahd_softc *ahd, struct scsi_cmnd *cmd) ...@@ -2039,8 +2039,8 @@ ahd_linux_queue_cmd_complete(struct ahd_softc *ahd, struct scsi_cmnd *cmd)
scsi_status = ahd_cmd_get_scsi_status(cmd); scsi_status = ahd_cmd_get_scsi_status(cmd);
switch(scsi_status) { switch(scsi_status) {
case SCSI_STATUS_CMD_TERMINATED: case SAM_STAT_COMMAND_TERMINATED:
case SCSI_STATUS_CHECK_COND: case SAM_STAT_CHECK_CONDITION:
if ((cmd->result >> 24) != DRIVER_SENSE) { if ((cmd->result >> 24) != DRIVER_SENSE) {
do_fallback = 1; do_fallback = 1;
} else { } else {
......
...@@ -1041,12 +1041,12 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) ...@@ -1041,12 +1041,12 @@ ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat)
ahc_freeze_scb(scb); ahc_freeze_scb(scb);
ahc_set_scsi_status(scb, hscb->shared_data.status.scsi_status); ahc_set_scsi_status(scb, hscb->shared_data.status.scsi_status);
switch (hscb->shared_data.status.scsi_status) { switch (hscb->shared_data.status.scsi_status) {
case SCSI_STATUS_OK: case SAM_STAT_GOOD:
printk("%s: Interrupted for status of 0???\n", printk("%s: Interrupted for status of 0???\n",
ahc_name(ahc)); ahc_name(ahc));
break; break;
case SCSI_STATUS_CMD_TERMINATED: case SAM_STAT_COMMAND_TERMINATED:
case SCSI_STATUS_CHECK_COND: case SAM_STAT_CHECK_CONDITION:
{ {
struct ahc_dma_seg *sg; struct ahc_dma_seg *sg;
struct scsi_sense *sc; struct scsi_sense *sc;
......
...@@ -1759,7 +1759,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) ...@@ -1759,7 +1759,7 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
if (dev->openings == 1 if (dev->openings == 1
&& ahc_get_transaction_status(scb) == CAM_REQ_CMP && ahc_get_transaction_status(scb) == CAM_REQ_CMP
&& ahc_get_scsi_status(scb) != SCSI_STATUS_QUEUE_FULL) && ahc_get_scsi_status(scb) != SAM_STAT_TASK_SET_FULL)
dev->tag_success_count++; dev->tag_success_count++;
/* /*
* Some devices deal with temporary internal resource * Some devices deal with temporary internal resource
...@@ -1816,8 +1816,8 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, ...@@ -1816,8 +1816,8 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
switch (ahc_get_scsi_status(scb)) { switch (ahc_get_scsi_status(scb)) {
default: default:
break; break;
case SCSI_STATUS_CHECK_COND: case SAM_STAT_CHECK_CONDITION:
case SCSI_STATUS_CMD_TERMINATED: case SAM_STAT_COMMAND_TERMINATED:
{ {
struct scsi_cmnd *cmd; struct scsi_cmnd *cmd;
...@@ -1855,7 +1855,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, ...@@ -1855,7 +1855,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
} }
break; break;
} }
case SCSI_STATUS_QUEUE_FULL: case SAM_STAT_TASK_SET_FULL:
{ {
/* /*
* By the time the core driver has returned this * By the time the core driver has returned this
...@@ -1899,7 +1899,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, ...@@ -1899,7 +1899,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
dev->last_queuefull_same_count = 0; dev->last_queuefull_same_count = 0;
} }
ahc_set_transaction_status(scb, CAM_REQUEUE_REQ); ahc_set_transaction_status(scb, CAM_REQUEUE_REQ);
ahc_set_scsi_status(scb, SCSI_STATUS_OK); ahc_set_scsi_status(scb, SAM_STAT_GOOD);
ahc_platform_set_tags(ahc, sdev, &devinfo, ahc_platform_set_tags(ahc, sdev, &devinfo,
(dev->flags & AHC_DEV_Q_BASIC) (dev->flags & AHC_DEV_Q_BASIC)
? AHC_QUEUE_BASIC : AHC_QUEUE_TAGGED); ? AHC_QUEUE_BASIC : AHC_QUEUE_TAGGED);
...@@ -1910,7 +1910,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc, ...@@ -1910,7 +1910,7 @@ ahc_linux_handle_scsi_status(struct ahc_softc *ahc,
* as if the target returned BUSY SCSI status. * as if the target returned BUSY SCSI status.
*/ */
dev->openings = 1; dev->openings = 1;
ahc_set_scsi_status(scb, SCSI_STATUS_BUSY); ahc_set_scsi_status(scb, SAM_STAT_BUSY);
ahc_platform_set_tags(ahc, sdev, &devinfo, ahc_platform_set_tags(ahc, sdev, &devinfo,
(dev->flags & AHC_DEV_Q_BASIC) (dev->flags & AHC_DEV_Q_BASIC)
? AHC_QUEUE_BASIC : AHC_QUEUE_TAGGED); ? AHC_QUEUE_BASIC : AHC_QUEUE_TAGGED);
......
...@@ -117,21 +117,6 @@ struct scsi_sense_data ...@@ -117,21 +117,6 @@ struct scsi_sense_data
#define SSD_FULL_SIZE sizeof(struct scsi_sense_data) #define SSD_FULL_SIZE sizeof(struct scsi_sense_data)
}; };
/*
* Status Byte
*/
#define SCSI_STATUS_OK 0x00
#define SCSI_STATUS_CHECK_COND 0x02
#define SCSI_STATUS_COND_MET 0x04
#define SCSI_STATUS_BUSY 0x08
#define SCSI_STATUS_INTERMED 0x10
#define SCSI_STATUS_INTERMED_COND_MET 0x14
#define SCSI_STATUS_RESERV_CONFLICT 0x18
#define SCSI_STATUS_CMD_TERMINATED 0x22 /* Obsolete in SAM-2 */
#define SCSI_STATUS_QUEUE_FULL 0x28
#define SCSI_STATUS_ACA_ACTIVE 0x30
#define SCSI_STATUS_TASK_ABORTED 0x40
/************************* Large Disk Handling ********************************/ /************************* Large Disk Handling ********************************/
static inline int static inline int
aic_sector_div(sector_t capacity, int heads, int sectors) aic_sector_div(sector_t capacity, int heads, int sectors)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment