]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge branch 'master'
authorJeff Garzik <jgarzik@pobox.com>
Tue, 3 Jan 2006 15:58:53 +0000 (10:58 -0500)
committerJeff Garzik <jgarzik@pobox.com>
Tue, 3 Jan 2006 15:58:53 +0000 (10:58 -0500)
1  2 
drivers/scsi/libata-scsi.c

index f286a6f1c0db80fd7fce069fc669c868258d318f,2282c04fee4635097c0f3566f4251e6bd7cc5238..e0439be4b5731fd2b8390c479f0c756043030af7
@@@ -418,7 -418,7 +418,7 @@@ void ata_to_sense_error(unsigned id, u
        int i;
  
        /* Based on the 3ware driver translation table */
 -      static unsigned char sense_table[][4] = {
 +      static const unsigned char sense_table[][4] = {
                /* BBD|ECC|ID|MAR */
                {0xd1,          ABORTED_COMMAND, 0x00, 0x00},   // Device busy                  Aborted command
                /* BBD|ECC|ID */
                {0x80,          MEDIUM_ERROR, 0x11, 0x04},      // Block marked bad               Medium error, unrecovered read error
                {0xFF, 0xFF, 0xFF, 0xFF}, // END mark
        };
 -      static unsigned char stat_table[][4] = {
 +      static const unsigned char stat_table[][4] = {
                /* Must be first because BUSY means no other bits valid */
                {0x80,          ABORTED_COMMAND, 0x47, 0x00},   // Busy, fake parity for now
                {0x20,          HARDWARE_ERROR,  0x00, 0x00},   // Device fault
@@@ -1203,11 -1203,12 +1203,11 @@@ nothing_to_do
        return 1;
  }
  
 -static int ata_scsi_qc_complete(struct ata_queued_cmd *qc,
 -                              unsigned int err_mask)
 +static int ata_scsi_qc_complete(struct ata_queued_cmd *qc)
  {
        struct scsi_cmnd *cmd = qc->scsicmd;
        u8 *cdb = cmd->cmnd;
 -      int need_sense = (err_mask != 0);
 +      int need_sense = (qc->err_mask != 0);
  
        /* For ATA pass thru (SAT) commands, generate a sense block if
         * user mandated it or if there's an error.  Note that if we
@@@ -1531,7 -1532,7 +1531,7 @@@ unsigned int ata_scsiop_inq_80(struct a
        return 0;
  }
  
 -static const char *inq_83_str = "Linux ATA-SCSI simulator";
 +static const char * const inq_83_str = "Linux ATA-SCSI simulator";
  
  /**
   *    ata_scsiop_inq_83 - Simulate INQUIRY EVPD page 83, device identity
@@@ -1954,9 -1955,9 +1954,9 @@@ void ata_scsi_badcmd(struct scsi_cmnd *
        done(cmd);
  }
  
 -static int atapi_sense_complete(struct ata_queued_cmd *qc,unsigned int err_mask)
 +static int atapi_sense_complete(struct ata_queued_cmd *qc)
  {
 -      if (err_mask && ((err_mask & AC_ERR_DEV) == 0))
 +      if (qc->err_mask && ((qc->err_mask & AC_ERR_DEV) == 0))
                /* FIXME: not quite right; we don't want the
                 * translation of taskfile registers into
                 * a sense descriptors, since that's only
@@@ -2014,18 -2015,15 +2014,18 @@@ static void atapi_request_sense(struct 
  
        qc->complete_fn = atapi_sense_complete;
  
 -      if (ata_qc_issue(qc))
 -              ata_qc_complete(qc, AC_ERR_OTHER);
 +      if (ata_qc_issue(qc)) {
 +              qc->err_mask |= AC_ERR_OTHER;
 +              ata_qc_complete(qc);
 +      }
  
        DPRINTK("EXIT\n");
  }
  
 -static int atapi_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask)
 +static int atapi_qc_complete(struct ata_queued_cmd *qc)
  {
        struct scsi_cmnd *cmd = qc->scsicmd;
 +      unsigned int err_mask = qc->err_mask;
  
        VPRINTK("ENTER, err_mask 0x%X\n", err_mask);
  
        else {
                u8 *scsicmd = cmd->cmnd;
  
-               if (scsicmd[0] == INQUIRY) {
+               if ((scsicmd[0] == INQUIRY) && ((scsicmd[1] & 0x03) == 0)) {
                        u8 *buf = NULL;
                        unsigned int buflen;
  
         * to indicate to the Linux scsi midlayer this is a modern
         * device.  2) Ensure response data format / ATAPI information
         * are always correct.
-        */
-       /* FIXME: do we ever override EVPD pages and the like, with
-        * this code?
         */
                        if (buf[2] == 0) {
                                buf[2] = 0x5;