Merge SCSI tree from James Bottomley.
authorLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 18 Apr 2005 21:25:40 +0000 (14:25 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 18 Apr 2005 21:25:40 +0000 (14:25 -0700)
Done with "git-pull-script rsync://www.parisc-linux.org/~jejb/scsi-rc-fixes-2.6.git"
together with an automated content merge.

37 files changed:
drivers/block/scsi_ioctl.c
drivers/message/i2o/i2o_config.c
drivers/s390/scsi/zfcp_aux.c
drivers/s390/scsi/zfcp_def.h
drivers/s390/scsi/zfcp_erp.c
drivers/s390/scsi/zfcp_fsf.c
drivers/s390/scsi/zfcp_fsf.h
drivers/s390/scsi/zfcp_sysfs_adapter.c
drivers/scsi/53c7xx.c
drivers/scsi/BusLogic.c
drivers/scsi/NCR5380.c
drivers/scsi/advansys.c
drivers/scsi/aha152x.c
drivers/scsi/arm/acornscsi.c
drivers/scsi/arm/fas216.c
drivers/scsi/arm/scsi.h
drivers/scsi/atari_NCR5380.c
drivers/scsi/constants.c
drivers/scsi/ips.c
drivers/scsi/ncr53c8xx.c
drivers/scsi/pci2000.c
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/scsi.c
drivers/scsi/scsi.h
drivers/scsi/scsi_error.c
drivers/scsi/scsi_ioctl.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_obsolete.h [deleted file]
drivers/scsi/scsi_priv.h
drivers/scsi/seagate.c
drivers/scsi/sg.c
drivers/scsi/sun3_NCR5380.c
drivers/scsi/sym53c8xx_2/sym_glue.c
drivers/scsi/ultrastor.c
drivers/usb/image/microtek.c
include/scsi/scsi.h
include/scsi/scsi_cmnd.h

index 689527a89de7b3f88da38a1f39d855131b7c41fe..681871ca5d60a89af6978c4727daac1853314d5c 100644 (file)
@@ -328,11 +328,6 @@ static int sg_io(struct file *file, request_queue_t *q,
        return 0;
 }
 
-#define FORMAT_UNIT_TIMEOUT            (2 * 60 * 60 * HZ)
-#define START_STOP_TIMEOUT             (60 * HZ)
-#define MOVE_MEDIUM_TIMEOUT            (5 * 60 * HZ)
-#define READ_ELEMENT_STATUS_TIMEOUT    (5 * 60 * HZ)
-#define READ_DEFECT_DATA_TIMEOUT       (60 * HZ )
 #define OMAX_SB_LEN 16          /* For backward compatibility */
 
 static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
index 5fc5004ea07a316a2cc4f5f3a6eab7823490b987..1fb5cdf67f8fa82e6245586bdf151da6a26d60a7 100644 (file)
@@ -54,6 +54,9 @@
 
 extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int);
 
+static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd,
+                        unsigned long arg);
+
 static spinlock_t i2o_config_lock;
 
 #define MODINC(x,y) ((x) = ((x) + 1) % (y))
@@ -538,8 +541,7 @@ static int i2o_cfg_evt_get(unsigned long arg, struct file *fp)
 }
 
 #ifdef CONFIG_COMPAT
-static int i2o_cfg_passthru32(unsigned fd, unsigned cmnd, unsigned long arg,
-                             struct file *file)
+static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long arg)
 {
        struct i2o_cmd_passthru32 __user *cmd;
        struct i2o_controller *c;
@@ -752,7 +754,26 @@ static int i2o_cfg_passthru32(unsigned fd, unsigned cmnd, unsigned long arg,
        return rcode;
 }
 
-#else
+static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
+{
+       int ret;
+       lock_kernel();          
+       switch (cmd) { 
+       case I2OGETIOPS:
+               ret = i2o_cfg_ioctl(NULL, file, cmd, arg);
+               break;
+       case I2OPASSTHRU32:
+               ret = i2o_cfg_passthru32(file, cmd, arg);
+               break;
+       default:
+               ret = -ENOIOCTLCMD;
+               break;
+       }
+       unlock_kernel();
+       return ret;
+}
+
+#endif
 
 static int i2o_cfg_passthru(unsigned long arg)
 {
@@ -958,7 +979,6 @@ static int i2o_cfg_passthru(unsigned long arg)
        kfree(reply);
        return rcode;
 }
-#endif
 
 /*
  * IOCTL Handler
@@ -1013,11 +1033,9 @@ static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd,
                ret = i2o_cfg_evt_get(arg, fp);
                break;
 
-#ifndef CONFIG_COMPAT
        case I2OPASSTHRU:
                ret = i2o_cfg_passthru(arg);
                break;
-#endif
 
        default:
                osm_debug("unknown ioctl called!\n");
@@ -1105,6 +1123,9 @@ static struct file_operations config_fops = {
        .owner = THIS_MODULE,
        .llseek = no_llseek,
        .ioctl = i2o_cfg_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl = i2o_cfg_compat_ioctl,
+#endif
        .open = cfg_open,
        .release = cfg_release,
        .fasync = cfg_fasync,
@@ -1134,19 +1155,11 @@ static int __init i2o_config_init(void)
                misc_deregister(&i2o_miscdev);
                return -EBUSY;
        }
-#ifdef CONFIG_COMPAT
-       register_ioctl32_conversion(I2OPASSTHRU32, i2o_cfg_passthru32);
-       register_ioctl32_conversion(I2OGETIOPS, (void *)sys_ioctl);
-#endif
        return 0;
 }
 
 static void i2o_config_exit(void)
 {
-#ifdef CONFIG_COMPAT
-       unregister_ioctl32_conversion(I2OPASSTHRU32);
-       unregister_ioctl32_conversion(I2OGETIOPS);
-#endif
        misc_deregister(&i2o_miscdev);
        i2o_driver_unregister(&i2o_config_driver);
 }
index 6a43322ccb0a570a99e9ebe1dfabec475728ca47..a393cf4d0313cb22c7c8449168749b3b88a7744d 100644 (file)
@@ -89,10 +89,10 @@ MODULE_DESCRIPTION
     ("FCP (SCSI over Fibre Channel) HBA driver for IBM eServer zSeries");
 MODULE_LICENSE("GPL");
 
-module_param(device, charp, 0);
+module_param(device, charp, 0400);
 MODULE_PARM_DESC(device, "specify initial device");
 
-module_param(loglevel, uint, 0);
+module_param(loglevel, uint, 0400);
 MODULE_PARM_DESC(loglevel,
                 "log levels, 8 nibbles: "
                 "FC ERP QDIO CIO Config FSF SCSI Other, "
index 53fcccbb424c8c324170d8d5ec9cd90be0f8eb03..0afa1c4696ca6b5f7ae4c1356ad7b640f8c8b8cc 100644 (file)
@@ -70,7 +70,7 @@
 /********************* GENERAL DEFINES *********************************/
 
 /* zfcp version number, it consists of major, minor, and patch-level number */
-#define ZFCP_VERSION           "4.2.0"
+#define ZFCP_VERSION           "4.3.0"
 
 /**
  * zfcp_sg_to_address - determine kernel address from struct scatterlist
@@ -851,6 +851,9 @@ struct zfcp_adapter {
        wwn_t                   wwnn;              /* WWNN */
        wwn_t                   wwpn;              /* WWPN */
        fc_id_t                 s_id;              /* N_Port ID */
+       wwn_t                   peer_wwnn;         /* P2P peer WWNN */
+       wwn_t                   peer_wwpn;         /* P2P peer WWPN */
+       fc_id_t                 peer_d_id;         /* P2P peer D_ID */
        struct ccw_device       *ccw_device;       /* S/390 ccw device */
        u8                      fc_service_class;
        u32                     fc_topology;       /* FC topology */
index cfc0d8c588dfb8a653cfdd517de4e453867bc046..53ebc1cdfe2de995e4ea39bc75076549cab847e8 100644 (file)
@@ -2568,6 +2568,23 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action)
        case ZFCP_ERP_STEP_UNINITIALIZED:
        case ZFCP_ERP_STEP_PHYS_PORT_CLOSING:
        case ZFCP_ERP_STEP_PORT_CLOSING:
+               if (adapter->fc_topology == FSF_TOPO_P2P) {
+                       if (port->wwpn != adapter->peer_wwpn) {
+                               ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx "
+                                               "on adapter %s.\nPeer WWPN "
+                                               "0x%016Lx does not match\n",
+                                               port->wwpn,
+                                               zfcp_get_busid_by_adapter(adapter),
+                                               adapter->peer_wwpn);
+                               zfcp_erp_port_failed(port);
+                               retval = ZFCP_ERP_FAILED;
+                               break;
+                       }
+                       port->d_id = adapter->peer_d_id;
+                       atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status);
+                       retval = zfcp_erp_port_strategy_open_port(erp_action);
+                       break;
+               }
                if (!(adapter->nameserver_port)) {
                        retval = zfcp_nameserver_enqueue(adapter);
                        if (retval != 0) {
@@ -3516,8 +3533,9 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter)
        debug_text_event(adapter->erp_dbf, 3, "a_access_unblock");
        debug_event(adapter->erp_dbf, 3, &adapter->name, 8);
 
-       zfcp_erp_port_access_changed(adapter->nameserver_port);
        read_lock_irqsave(&zfcp_data.config_lock, flags);
+       if (adapter->nameserver_port)
+               zfcp_erp_port_access_changed(adapter->nameserver_port);
        list_for_each_entry(port, &adapter->port_list_head, list)
                if (port != adapter->nameserver_port)
                        zfcp_erp_port_access_changed(port);
index 578b9fbe5206510c2ed5c5ed3cdda3adeedf3a69..148b11c822bf818c9299744a907a0bdfe39d674e 100644 (file)
@@ -2107,6 +2107,9 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
                       bottom->low_qtcb_version, bottom->high_qtcb_version);
        adapter->fsf_lic_version = bottom->lic_version;
        adapter->supported_features = bottom->supported_features;
+       adapter->peer_wwpn = 0;
+       adapter->peer_wwnn = 0;
+       adapter->peer_d_id = 0;
 
        if (xchg_ok) {
                adapter->wwnn = bottom->nport_serv_param.wwnn;
@@ -2124,13 +2127,19 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok)
                adapter->hydra_version = 0;
        }
 
+       if (adapter->fc_topology == FSF_TOPO_P2P) {
+               adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK;
+               adapter->peer_wwpn = bottom->plogi_payload.wwpn;
+               adapter->peer_wwnn = bottom->plogi_payload.wwnn;
+       }
+
        if(adapter->supported_features & FSF_FEATURE_HBAAPI_MANAGEMENT){
                adapter->hardware_version = bottom->hardware_version;
                memcpy(adapter->serial_number, bottom->serial_number, 17);
                EBCASC(adapter->serial_number, sizeof(adapter->serial_number));
        }
 
-       ZFCP_LOG_INFO("The adapter %s reported the following characteristics:\n"
+       ZFCP_LOG_NORMAL("The adapter %s reported the following characteristics:\n"
                      "WWNN 0x%016Lx, "
                      "WWPN 0x%016Lx, "
                      "S_ID 0x%08x,\n"
@@ -2194,14 +2203,18 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
                switch (adapter->fc_topology) {
                case FSF_TOPO_P2P:
                        ZFCP_LOG_FLAGS(1, "FSF_TOPO_P2P\n");
-                       ZFCP_LOG_NORMAL("error: Point-to-point fibrechannel "
-                                       "configuration detected at adapter %s "
-                                       "unsupported, shutting down adapter\n",
-                                       zfcp_get_busid_by_adapter(adapter));
+                       ZFCP_LOG_NORMAL("Point-to-Point fibrechannel "
+                                       "configuration detected at adapter %s\n"
+                                       "Peer WWNN 0x%016llx, "
+                                       "peer WWPN 0x%016llx, "
+                                       "peer d_id 0x%06x\n",
+                                       zfcp_get_busid_by_adapter(adapter),
+                                       adapter->peer_wwnn,
+                                       adapter->peer_wwpn,
+                                       adapter->peer_d_id);
                        debug_text_event(fsf_req->adapter->erp_dbf, 0,
                                         "top-p-to-p");
-                       zfcp_erp_adapter_shutdown(adapter, 0);
-                       return -EIO;
+                       break;
                case FSF_TOPO_AL:
                        ZFCP_LOG_FLAGS(1, "FSF_TOPO_AL\n");
                        ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel "
@@ -2226,6 +2239,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req)
                                        "of a type known to the zfcp "
                                        "driver, shutting down adapter\n",
                                        zfcp_get_busid_by_adapter(adapter));
+                       adapter->fc_topology = FSF_TOPO_ERROR;
                        debug_text_exception(fsf_req->adapter->erp_dbf, 0,
                                             "unknown-topo");
                        zfcp_erp_adapter_shutdown(adapter, 0);
@@ -4281,6 +4295,7 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
                                      bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE);
                        zfcp_cmd_dbf_event_fsf("undeffcp", fsf_req, NULL, 0);
                        set_host_byte(&scpnt->result, DID_ERROR);
+                       goto skip_fsfstatus;
                }
        }
 
@@ -4334,7 +4349,7 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req)
 
                scpnt->resid = fcp_rsp_iu->fcp_resid;
                if (scpnt->request_bufflen - scpnt->resid < scpnt->underflow)
-                       scpnt->result |= DID_ERROR << 16;
+                       set_host_byte(&scpnt->result, DID_ERROR);
        }
 
  skip_fsfstatus:
@@ -4607,6 +4622,13 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req)
                if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) {
                        switch (header->fsf_status_qual.word[0]) {
 
+                       case FSF_SQ_CFDC_HARDENED_ON_SE:
+                               ZFCP_LOG_NORMAL(
+                                       "CFDC on the adapter %s has being "
+                                       "hardened on primary and secondary SE\n",
+                                       zfcp_get_busid_by_adapter(adapter));
+                               break;
+
                        case FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE:
                                ZFCP_LOG_NORMAL(
                                        "CFDC of the adapter %s could not "
index 5889956bbf08699b749ba2e0fa68b1eff7a5b499..07140dfda2a7c3c5f6d112327f57ee423553a8bb 100644 (file)
 #define FSF_SQ_NO_RETRY_POSSIBLE               0x07
 
 /* FSF status qualifier for CFDC commands */
+#define FSF_SQ_CFDC_HARDENED_ON_SE             0x00000000
 #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE     0x00000001
 #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE2    0x00000002
 /* CFDC subtable codes */
@@ -357,7 +358,6 @@ struct fsf_nport_serv_param {
        u8  class3_serv_param[16];
        u8  class4_serv_param[16];
        u8  vendor_version_level[16];
-       u8  res1[16];
 } __attribute__ ((packed));
 
 struct fsf_plogi {
@@ -415,11 +415,13 @@ struct fsf_qtcb_bottom_config {
        u8 res2[12];
        u32 s_id;
        struct fsf_nport_serv_param nport_serv_param;
+       u8 reserved_nport_serv_param[16];
        u8 res3[8];
        u32 adapter_ports;
        u32 hardware_version;
        u8 serial_number[32];
-       u8 res4[272];
+       struct fsf_nport_serv_param plogi_payload;
+       u8 res4[160];
 } __attribute__ ((packed));
 
 struct fsf_qtcb_bottom_port {
index ff28ade1dfc7ad1825b10a2225438bc77314ff73..23e2dca55bb81f5156f38cab9079da360aa30302 100644 (file)
@@ -65,6 +65,9 @@ ZFCP_DEFINE_ADAPTER_ATTR(status, "0x%08x\n", atomic_read(&adapter->status));
 ZFCP_DEFINE_ADAPTER_ATTR(wwnn, "0x%016llx\n", adapter->wwnn);
 ZFCP_DEFINE_ADAPTER_ATTR(wwpn, "0x%016llx\n", adapter->wwpn);
 ZFCP_DEFINE_ADAPTER_ATTR(s_id, "0x%06x\n", adapter->s_id);
+ZFCP_DEFINE_ADAPTER_ATTR(peer_wwnn, "0x%016llx\n", adapter->peer_wwnn);
+ZFCP_DEFINE_ADAPTER_ATTR(peer_wwpn, "0x%016llx\n", adapter->peer_wwpn);
+ZFCP_DEFINE_ADAPTER_ATTR(peer_d_id, "0x%06x\n", adapter->peer_d_id);
 ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version);
 ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version);
 ZFCP_DEFINE_ADAPTER_ATTR(fc_link_speed, "%d Gb/s\n", adapter->fc_link_speed);
@@ -255,6 +258,9 @@ static struct attribute *zfcp_adapter_attrs[] = {
        &dev_attr_wwnn.attr,
        &dev_attr_wwpn.attr,
        &dev_attr_s_id.attr,
+       &dev_attr_peer_wwnn.attr,
+       &dev_attr_peer_wwpn.attr,
+       &dev_attr_peer_d_id.attr,
        &dev_attr_card_version.attr,
        &dev_attr_lic_version.attr,
        &dev_attr_fc_link_speed.attr,
index 8ead55f75d02e92af906b3891128b64cc7094b39..2341d27ceed7359991733e564eebba5c6a039f08 100644 (file)
 #endif
 
 #include "scsi.h"
+#include <scsi/scsi_dbg.h>
 #include <scsi/scsi_host.h>
 #include "53c7xx.h"
 #include <linux/stat.h>
@@ -1721,9 +1722,9 @@ NCR53c7xx_run_tests (struct Scsi_Host *host) {
                printk ("scsi%d : test 2 INQUIRY to target %d, lun 0 : %s\n",
                    host->host_no, i, data + 8);
                printk ("scsi%d : status ", host->host_no);
-               print_status (status);
+               scsi_print_status (status);
                printk ("\nscsi%d : message ", host->host_no);
-               print_msg (&msg);
+               scsi_print_msg (&msg);
                printk ("\n");
            } else if (hostdata->test_completed == 3) {
                printk("scsi%d : test 2 no connection with target %d\n",
@@ -2312,7 +2313,7 @@ NCR53c7x0_dstat_sir_intr (struct Scsi_Host *host, struct
            printk ("scsi%d : received message", host->host_no);
            if (c) 
                printk (" from target %d lun %d ", c->device->id, c->device->lun);
-           print_msg ((unsigned char *) hostdata->msg_buf);
+           scsi_print_msg ((unsigned char *) hostdata->msg_buf);
            printk("\n");
        }
        
@@ -3204,7 +3205,7 @@ create_cmd (Scsi_Cmnd *cmd) {
     case WRITE_10:
 #if 0
        printk("scsi%d : command is ", host->host_no);
-       print_command(cmd->cmnd);
+       __scsi_print_command(cmd->cmnd);
 #endif
 #if 0
        printk ("scsi%d : %d scatter/gather segments\n", host->host_no,
@@ -3232,7 +3233,7 @@ create_cmd (Scsi_Cmnd *cmd) {
      */
     default:
        printk("scsi%d : datain+dataout for command ", host->host_no);
-       print_command(cmd->cmnd);
+       __scsi_print_command(cmd->cmnd);
        datain = dataout = 2 * (cmd->use_sg ? cmd->use_sg : 1) + 3;
     }
 
@@ -3938,7 +3939,7 @@ intr_scsi (struct Scsi_Host *host, struct NCR53c7x0_cmd *cmd) {
            if (cmd) {
                printk("scsi%d : target %d, lun %d, command ",
                    host->host_no, cmd->cmd->device->id, cmd->cmd->device->lun);
-               print_command (cmd->cmd->cmnd);
+               __scsi_print_command (cmd->cmd->cmnd);
                printk("scsi%d : dsp = 0x%x (virt 0x%p)\n", host->host_no,
                    NCR53c7x0_read32(DSP_REG),
                    bus_to_virt(NCR53c7x0_read32(DSP_REG)));
@@ -4208,7 +4209,7 @@ restart:
        if (hostdata->options & OPTION_DEBUG_INTR) {
            printk ("scsi%d : command complete : pid %lu, id %d,lun %d result 0x%x ", 
                  host->host_no, tmp->pid, tmp->device->id, tmp->device->lun, tmp->result);
-           print_command (tmp->cmnd);
+           __scsi_print_command (tmp->cmnd);
        }
 
        tmp->scsi_done(tmp);
@@ -4297,7 +4298,7 @@ NCR53c7x0_intr (int irq, void *dev_id, struct pt_regs * regs)
                printk("scsi%d : interrupt for pid %lu, id %d, lun %d ", 
                    host->host_no, cmd->cmd->pid, (int) cmd->cmd->device->id,
                    (int) cmd->cmd->device->lun);
-               print_command (cmd->cmd->cmnd);
+               __scsi_print_command (cmd->cmd->cmnd);
            } else {
                printk("scsi%d : no active command\n", host->host_no);
            }
@@ -5539,7 +5540,7 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) {
            i > 0 && !check_address ((unsigned long) ptr, 1);
            ptr += len, i -= len) {
            printk("               ");
-           len = print_msg (ptr);
+           len = scsi_print_msg (ptr);
            printk("\n");
            if (!len)
                break;
@@ -5554,7 +5555,7 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) {
     if (cmd) {
        printk("               result = 0x%x, target = %d, lun = %d, cmd = ",
            cmd->result, cmd->device->id, cmd->device->lun);
-       print_command(cmd->cmnd);
+       __scsi_print_command(cmd->cmnd);
     } else
        printk("\n");
     printk("        + %d : dsa_next = 0x%x\n", hostdata->dsa_next,
@@ -6028,7 +6029,7 @@ dump_events (struct Scsi_Host *host, int count) {
                    virt_to_bus(event.dsa), event.dsa);
            if (event.pid != -1) {
                printk ("         event for pid %ld ", event.pid);
-               print_command (event.cmnd);
+               __scsi_print_command (event.cmnd);
            }
        }
     }
index 41b5197ce4e6c01cb5de40f8482fb47f43aaa376..15e4b122d56e93c4330fbbfd1871e6d2c164b7a0 100644 (file)
@@ -2957,13 +2957,6 @@ static int BusLogic_AbortCommand(struct scsi_cmnd *Command)
        int TargetID = Command->device->id;
        struct BusLogic_CCB *CCB;
        BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[TargetID].CommandAbortsRequested);
-       /*
-          If this Command has already completed, then no Abort is necessary.
-        */
-       if (Command->serial_number != Command->serial_number_at_timeout) {
-               BusLogic_Warning("Unable to Abort Command to Target %d - " "Already Completed\n", HostAdapter, TargetID);
-               return SUCCESS;
-       }
        /*
           Attempt to find an Active CCB for this Command.  If no Active CCB for this
           Command is found, then no Abort is necessary.
index 5e71a0beafca9cb1e8857f53af68773510e771d1..770fa841e389e9e60981a918957a160d84f4a1b1 100644 (file)
@@ -86,6 +86,7 @@
  * 5.  Test linked command handling code after Eric is ready with 
  *      the high level code.
  */
+#include <scsi/scsi_dbg.h>
 
 #if (NDEBUG & NDEBUG_LISTS)
 #define LIST(x,y) {printk("LINE:%d   Adding %p to %p\n", __LINE__, (void*)(x), (void*)(y)); if ((x)==(y)) udelay(5); }
@@ -2371,7 +2372,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
  * 3..length+1  arguments
  *
  * Start the extended message buffer with the EXTENDED_MESSAGE
- * byte, since print_msg() wants the whole thing.  
+ * byte, since scsi_print_msg() wants the whole thing.  
  */
                                        extended_msg[0] = EXTENDED_MESSAGE;
                                        /* Accept first byte by clearing ACK */
@@ -2418,7 +2419,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
                                default:
                                        if (!tmp) {
                                                printk("scsi%d: rejecting message ", instance->host_no);
-                                               print_msg(extended_msg);
+                                               scsi_print_msg(extended_msg);
                                                printk("\n");
                                        } else if (tmp != EXTENDED_MESSAGE)
                                                printk("scsi%d: rejecting unknown message %02x from target %d, lun %d\n", instance->host_no, tmp, cmd->device->id, cmd->device->lun);
@@ -2552,7 +2553,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
 
        if (!(msg[0] & 0x80)) {
                printk(KERN_ERR "scsi%d : expecting IDENTIFY message, got ", instance->host_no);
-               print_msg(msg);
+               scsi_print_msg(msg);
                abort = 1;
        } else {
                /* Accept message by clearing ACK */
@@ -2677,7 +2678,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) {
        Scsi_Cmnd *tmp, **prev;
        
        printk(KERN_WARNING "scsi%d : aborting command\n", instance->host_no);
-       print_Scsi_Cmnd(cmd);
+       scsi_print_command(cmd);
 
        NCR5380_print_status(instance);
 
index 9962c51dc2a7d2803cf11a1ee12016625160f8ca..04cb5c405a2db94a232f7621c2e09f1f5599cd14 100644 (file)
@@ -9198,16 +9198,13 @@ asc_prt_scsi_cmnd(struct scsi_cmnd *s)
         s->use_sg, s->sglist_len, s->abort_reason);
 
     printk(
-" serial_number 0x%x, serial_number_at_timeout 0x%x, retries %d, allowed %d\n",
-        (unsigned) s->serial_number, (unsigned) s->serial_number_at_timeout,
-         s->retries, s->allowed);
+" serial_number 0x%x, retries %d, allowed %d\n",
+        (unsigned) s->serial_number, s->retries, s->allowed);
 
     printk(
 " timeout_per_command %d, timeout_total %d, timeout %d\n",
         s->timeout_per_command, s->timeout_total, s->timeout);
 
-    printk(" internal_timeout %u\n", s->internal_timeout);
-
     printk(
 " scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n",
         (ulong) s->scsi_done, (ulong) s->done,
index d7b8efe864010f57de718bae1e086fac756999d2..88d119f4b97070d221a9f496625f676401d70401 100644 (file)
 #include <scsi/scsicam.h>
 
 #include "scsi.h"
+#include <scsi/scsi_dbg.h>
 #include <scsi/scsi_host.h>
 #include "aha152x.h"
 
@@ -986,7 +987,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct semaphore *sem, int p
        if (HOSTDATA(shpnt)->debug & debug_queue) {
                printk(INFO_LEAD "queue: %p; cmd_len=%d pieces=%d size=%u cmnd=",
                       CMDINFO(SCpnt), SCpnt, SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen);
-               print_command(SCpnt->cmnd);
+               __scsi_print_command(SCpnt->cmnd);
        }
 #endif
 
@@ -1560,7 +1561,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
 #if 0
                        if(HOSTDATA(shpnt)->debug & debug_eh) {
                                printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC));
-                               print_sense("bh", DONE_SC);
+                               scsi_print_sense("bh", DONE_SC);
                        }
 #endif
 
@@ -1846,7 +1847,7 @@ static void msgi_run(struct Scsi_Host *shpnt)
 #if defined(AHA152X_DEBUG)
                if (HOSTDATA(shpnt)->debug & debug_msgi) {
                        printk(INFO_LEAD "inbound message %02x ", CMDINFO(CURRENT_SC), MSGI(0));
-                       print_msg(&MSGI(0));
+                       scsi_print_msg(&MSGI(0));
                        printk("\n");
                }
 #endif
@@ -1934,7 +1935,7 @@ static void msgi_run(struct Scsi_Host *shpnt)
                                                break;
 
                                        printk(INFO_LEAD, CMDINFO(CURRENT_SC));
-                                       print_msg(&MSGI(0));
+                                       scsi_print_msg(&MSGI(0));
                                        printk("\n");
 
                                        ticks = (MSGI(3) * 4 + 49) / 50;
@@ -2032,7 +2033,7 @@ static void msgo_init(struct Scsi_Host *shpnt)
                int i;
 
                printk(DEBUG_LEAD "messages( ", CMDINFO(CURRENT_SC));
-               for (i=0; i<MSGOLEN; i+=print_msg(&MSGO(i)), printk(" "))
+               for (i=0; i<MSGOLEN; i+=scsi_print_msg(&MSGO(i)), printk(" "))
                        ;
                printk(")\n");
        }
@@ -2104,7 +2105,7 @@ static void cmd_init(struct Scsi_Host *shpnt)
 #if defined(AHA152X_DEBUG)
        if (HOSTDATA(shpnt)->debug & debug_cmd) {
                printk(DEBUG_LEAD "cmd_init: ", CMDINFO(CURRENT_SC));
-               print_command(CURRENT_SC->cmnd);
+               __scsi_print_command(CURRENT_SC->cmnd);
        }
 #endif
 
@@ -2158,7 +2159,7 @@ static void status_run(struct Scsi_Host *shpnt)
 #if defined(AHA152X_DEBUG)
        if (HOSTDATA(shpnt)->debug & debug_status) {
                printk(DEBUG_LEAD "inbound status %02x ", CMDINFO(CURRENT_SC), CURRENT_SC->SCp.Status);
-               print_status(CURRENT_SC->SCp.Status);
+               scsi_print_status(CURRENT_SC->SCp.Status);
                printk("\n");
        }
 #endif
@@ -2925,7 +2926,7 @@ static void show_command(Scsi_Cmnd *ptr)
        printk(KERN_DEBUG "0x%08x: target=%d; lun=%d; cmnd=(",
               (unsigned int) ptr, ptr->device->id, ptr->device->lun);
 
-       print_command(ptr->cmnd);
+       __scsi_print_command(ptr->cmnd);
 
        printk(KERN_DEBUG "); request_bufflen=%d; resid=%d; phase |",
               ptr->request_bufflen, ptr->resid);
index 24dd0b890dd2069d38db05ff778b6e9990836de9..be2caecbbdd9f99a2ddbf7020f7bf76dbff988ff 100644 (file)
 #include <asm/ecard.h>
 
 #include "../scsi.h"
+#include <scsi/scsi_dbg.h>
 #include <scsi/scsi_host.h>
 #include "acornscsi.h"
 #include "msgqueue.h"
@@ -866,7 +867,7 @@ void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result)
                    default:
                        printk(KERN_ERR "scsi%d.H: incomplete data transfer detected: result=%08X command=",
                                host->host->host_no, SCpnt->result);
-                       print_command(SCpnt->cmnd);
+                       __scsi_print_command(SCpnt->cmnd);
                        acornscsi_dumpdma(host, "done");
                        acornscsi_dumplog(host, SCpnt->device->id);
                        SCpnt->result &= 0xffff;
@@ -1369,7 +1370,7 @@ void acornscsi_sendmessage(AS_Host *host)
 
        host->scsi.last_message = msg->msg[0];
 #if (DEBUG & DEBUG_MESSAGES)
-       print_msg(msg->msg);
+       scsi_print_msg(msg->msg);
 #endif
        break;
 
@@ -1391,7 +1392,7 @@ void acornscsi_sendmessage(AS_Host *host)
        while ((msg = msgqueue_getmsg(&host->scsi.msgs, msgnr++)) != NULL) {
            unsigned int i;
 #if (DEBUG & DEBUG_MESSAGES)
-           print_msg(msg);
+           scsi_print_msg(msg);
 #endif
            i = 0;
            if (acornscsi_write_pio(host, msg->msg, &i, msg->length, 1000000))
@@ -1487,7 +1488,7 @@ void acornscsi_message(AS_Host *host)
 #if (DEBUG & DEBUG_MESSAGES)
     printk("scsi%d.%c: message in: ",
            host->host->host_no, acornscsi_target(host));
-    print_msg(message);
+    scsi_print_msg(message);
     printk("\n");
 #endif
 
index 5411e850c83366c8bfb6778ef3cad3d6b9559579..0a172c1e9f7e6934beb7ddeb316d60919c4dcc5e 100644 (file)
@@ -52,6 +52,7 @@
 #include <asm/ecard.h>
 
 #include "../scsi.h"
+#include <scsi/scsi_dbg.h>
 #include <scsi/scsi_host.h>
 #include "fas216.h"
 #include "scsi.h"
@@ -309,7 +310,7 @@ fas216_log_command(FAS216_Info *info, int level, Scsi_Cmnd *SCpnt, char *fmt, ..
        va_end(args);
 
        printk(" CDB: ");
-       print_command(SCpnt->cmnd);
+       __scsi_print_command(SCpnt->cmnd);
 }
 
 static void
@@ -2081,7 +2082,7 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
                                info->host->host_no, '0' + SCpnt->device->id,
                                SCpnt->result, info->scsi.SCp.ptr,
                                info->scsi.SCp.this_residual);
-                       print_command(SCpnt->cmnd);
+                       __scsi_print_command(SCpnt->cmnd);
                        SCpnt->result &= ~(255 << 16);
                        SCpnt->result |= DID_BAD_TARGET << 16;
                        goto request_sense;
@@ -2170,7 +2171,7 @@ static void fas216_done(FAS216_Info *info, unsigned int result)
                       info->host->host_no, '0' + SCpnt->device->id,
                       info->scsi.SCp.ptr, info->scsi.SCp.this_residual);
                info->scsi.SCp.ptr = NULL;
-               print_command(SCpnt->cmnd);
+               __scsi_print_command(SCpnt->cmnd);
        }
 
        /*
@@ -2426,7 +2427,7 @@ int fas216_eh_abort(Scsi_Cmnd *SCpnt)
        info->stats.aborts += 1;
 
        printk(KERN_WARNING "scsi%d: abort command ", info->host->host_no);
-       print_command(SCpnt->data_cmnd);
+       __scsi_print_command(SCpnt->data_cmnd);
 
        print_debug_list();
        fas216_dumpstate(info);
index 2f1b3f4bf954de455ff7bb23c6d93790d0a8f7d5..48e1c4d9738bfddc9a3fa0a51fec2c34de456b35 100644 (file)
@@ -108,7 +108,7 @@ static inline void init_SCp(Scsi_Cmnd *SCpnt)
 #if 0 //def BELT_AND_BRACES
                printk(KERN_WARNING "scsi%d.%c: zero length buffer passed for "
                       "command ", SCpnt->host->host_no, '0' + SCpnt->target);
-               print_command(SCpnt->cmnd);
+               __scsi_print_command(SCpnt->cmnd);
 #endif
                SCpnt->SCp.ptr = NULL;
        }
index 5d1e78ebed834064afb8dba16aa69e77a131cd11..2c12be72c4c6abe0e72048e0b092bd2c6379b9cb 100644 (file)
@@ -73,6 +73,7 @@
  * 1.  Test linked command handling code after Eric is ready with 
  *     the high level code.
  */
+#include <scsi/scsi_dbg.h>
 
 #if (NDEBUG & NDEBUG_LISTS)
 #define LIST(x,y) \
@@ -2354,7 +2355,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
  * 3..length+1 arguments
  *
  * Start the extended message buffer with the EXTENDED_MESSAGE
- * byte, since print_msg() wants the whole thing.  
+ * byte, since scsi_print_msg() wants the whole thing.  
  */
                    extended_msg[0] = EXTENDED_MESSAGE;
                    /* Accept first byte by clearing ACK */
@@ -2407,7 +2408,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
                default:
                    if (!tmp) {
                        printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO);
-                       print_msg (extended_msg);
+                       scsi_print_msg (extended_msg);
                        printk("\n");
                    } else if (tmp != EXTENDED_MESSAGE)
                        printk(KERN_DEBUG "scsi%d: rejecting unknown "
@@ -2540,7 +2541,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance)
 
     if (!(msg[0] & 0x80)) {
        printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO);
-       print_msg(msg);
+       scsi_print_msg(msg);
        do_abort(instance);
        return;
     }
@@ -2646,7 +2647,7 @@ int NCR5380_abort (Scsi_Cmnd *cmd)
     unsigned long flags;
 
     printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO);
-    print_Scsi_Cmnd (cmd);
+    scsi_print_command(cmd);
 
     NCR5380_print_status (instance);
 
index d625fdebe052bd5416c43f4ddbe5079ea4ed2f86..ec161733a82bc7a8bfa677ef0c23d5eae77255d5 100644 (file)
@@ -372,7 +372,7 @@ static void scsi_print_cdb(unsigned char *cdb, int cdb_len, int start_of_line)
 
 /**
  *
- *     print_status - print scsi status description
+ *     scsi_print_status - print scsi status description
  *     @scsi_status: scsi status value
  *
  *     If the status is recognized, the description is printed.
index e46096da8db2d96b8dffff85f174964416d6d0a5..47c263e5cd39d355e15b061d6564cd131b47c249 100644 (file)
@@ -833,13 +833,6 @@ ips_eh_abort(Scsi_Cmnd * SC)
        if (!ha->active)
                return (FAILED);
 
-       if (SC->serial_number != SC->serial_number_at_timeout) {
-               /* HMM, looks like a bogus command */
-               DEBUG(1, "Abort called with bogus scsi command");
-
-               return (FAILED);
-       }
-
        /* See if the command is on the copp queue */
        item = ha->copp_waitlist.head;
        while ((item) && (item->scsi_cmd != SC))
index 7ae13236788ec961c80720654ed9b9d6e0f2b236..2a0e42ec27d3e8bc5a66baf424f990516632a0e4 100644 (file)
@@ -7486,24 +7486,14 @@ static int ncr53c8xx_abort(struct scsi_cmnd *cmd)
        struct scsi_cmnd *done_list;
 
 #if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS
-       printk("ncr53c8xx_abort: pid=%lu serial_number=%ld serial_number_at_timeout=%ld\n",
-               cmd->pid, cmd->serial_number, cmd->serial_number_at_timeout);
+       printk("ncr53c8xx_abort: pid=%lu serial_number=%ld\n",
+               cmd->pid, cmd->serial_number);
 #else
        printk("ncr53c8xx_abort: command pid %lu\n", cmd->pid);
 #endif
 
        NCR_LOCK_NCB(np, flags);
 
-#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS
-       /*
-        * We have to just ignore abort requests in some situations.
-        */
-       if (cmd->serial_number != cmd->serial_number_at_timeout) {
-               sts = SCSI_ABORT_NOT_RUNNING;
-               goto out;
-       }
-#endif
-
        sts = ncr_abort_command(np, cmd);
 out:
        done_list     = np->done_list;
index 60ce1cce9497c22f81b7c5c00984a8963ce98e80..d58f303127f506ea2ea21f6c4f9c8e532e8eae48 100644 (file)
@@ -438,8 +438,8 @@ int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
        if ( bus )
                {
                DEB (if(*cdb) printk ("\nCDB: %X-  %X %X %X %X %X %X %X %X %X %X ", SCpnt->cmd_len, cdb[0], cdb[1], cdb[2], cdb[3], cdb[4], cdb[5], cdb[6], cdb[7], cdb[8], cdb[9]));
-               DEB (if(*cdb) printk ("\ntimeout_per_command: %d, timeout_total: %d, timeout: %d, internal_timout: %d", SCpnt->timeout_per_command,
-                                                         SCpnt->timeout_total, SCpnt->timeout, SCpnt->internal_timeout));
+               DEB (if(*cdb) printk ("\ntimeout_per_command: %d, timeout_total: %d, timeout: %d", SCpnt->timeout_per_command,
+                                                         SCpnt->timeout_total, SCpnt->timeout));
                outl (SCpnt->timeout_per_command, padapter->mb1);
                outb_p (CMD_SCSI_TIMEOUT, padapter->cmd);
                if ( WaitReady (padapter) )
index dcc33daa5913dbd558d3f3178ae9868698561337..0e8ebbc56e81c67affd7a6f996490db57cf33cd0 100644 (file)
@@ -1050,10 +1050,8 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd)
        for (i = 0; i < cmd->cmd_len; i++) {
                printk("0x%02x ", cmd->cmnd[i]);
        }
-       printk("\n  seg_cnt=%d, allowed=%d, retries=%d, "
-           "serial_number_at_timeout=0x%lx\n",
-           cmd->use_sg, cmd->allowed, cmd->retries,
-           cmd->serial_number_at_timeout);
+       printk("\n  seg_cnt=%d, allowed=%d, retries=%d\n",
+           cmd->use_sg, cmd->allowed, cmd->retries);
        printk("  request buffer=0x%p, request buffer len=0x%x\n",
            cmd->request_buffer, cmd->request_bufflen);
        printk("  tag=%d, transfersize=0x%x\n",
index 2e7ab3ab09932c9a2d74b0f28938c65ef0df5580..05d2bd075fd4e27a6f954e2b0662c400733790f9 100644 (file)
@@ -489,7 +489,7 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
                        scsi_print_command(cmd);
                        if (status_byte(cmd->result) & CHECK_CONDITION) {
                                /*
-                                * XXX The print_sense formatting/prefix
+                                * XXX The scsi_print_sense formatting/prefix
                                 * doesn't match this function.
                                 */
                                scsi_print_sense("", cmd);
@@ -686,7 +686,6 @@ void scsi_init_cmd_from_req(struct scsi_cmnd *cmd, struct scsi_request *sreq)
        cmd->request = sreq->sr_request;
        memcpy(cmd->data_cmnd, sreq->sr_cmnd, sizeof(cmd->data_cmnd));
        cmd->serial_number = 0;
-       cmd->serial_number_at_timeout = 0;
        cmd->bufflen = sreq->sr_bufflen;
        cmd->buffer = sreq->sr_buffer;
        cmd->retries = 0;
@@ -716,7 +715,6 @@ void scsi_init_cmd_from_req(struct scsi_cmnd *cmd, struct scsi_request *sreq)
        /*
         * Start the timer ticking.
         */
-       cmd->internal_timeout = NORMAL_TIMEOUT;
        cmd->abort_reason = 0;
        cmd->result = 0;
 
@@ -766,7 +764,6 @@ void __scsi_done(struct scsi_cmnd *cmd)
         * Set the serial numbers back to zero
         */
        cmd->serial_number = 0;
-       cmd->serial_number_at_timeout = 0;
        cmd->state = SCSI_STATE_BHQUEUE;
        cmd->owner = SCSI_OWNER_BH_HANDLER;
 
index cb6b5fbb7e14f3a8bb328d7b25a2b6ef0e728d23..e2360c26ef01f3eed5027bf730b1376442f96473 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/config.h>          /* for CONFIG_SCSI_LOGGING */
 
 #include <scsi/scsi_cmnd.h>
-#include <scsi/scsi_dbg.h>
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_eh.h>
 #include <scsi/scsi_request.h>
@@ -61,48 +60,6 @@ struct scatterlist;
 #define scsi_to_pci_dma_dir(scsi_dir)  ((int)(scsi_dir))
 #define scsi_to_sbus_dma_dir(scsi_dir) ((int)(scsi_dir))
 
-/*
- * Old names for debug prettyprinting functions.
- */
-static inline void print_Scsi_Cmnd(struct scsi_cmnd *cmd)
-{
-       return scsi_print_command(cmd);
-}
-static inline void print_command(unsigned char *cdb)
-{
-       return __scsi_print_command(cdb);
-}
-static inline void print_sense(const char *devclass, struct scsi_cmnd *cmd)
-{
-       return scsi_print_sense(devclass, cmd);
-}
-static inline void print_req_sense(const char *devclass, struct scsi_request *req)
-{
-       return scsi_print_req_sense(devclass, req);
-}
-static inline void print_driverbyte(int scsiresult)
-{
-       return scsi_print_driverbyte(scsiresult);
-}
-static inline void print_hostbyte(int scsiresult)
-{
-       return scsi_print_hostbyte(scsiresult);
-}
-static inline void print_status(unsigned char status)
-{
-       return scsi_print_status(status);
-}
-static inline int print_msg(const unsigned char *msg)
-{
-       return scsi_print_msg(msg);
-}
-
-/*
- * This is the crap from the old error handling code.  We have it in a special
- * place so that we can more easily delete it later on.
- */
-#include "scsi_obsolete.h"
-
 /* obsolete typedef junk. */
 #include "scsi_typedefs.h"
 
index 9bc597bd13bad212303ed6a6ffd60bf83156757c..203a0812508a1962c2c9d58020d3a6a9bc61aaf5 100644 (file)
@@ -79,11 +79,6 @@ int scsi_eh_scmd_add(struct scsi_cmnd *scmd, int eh_flag)
         */
        scmd->owner = SCSI_OWNER_ERROR_HANDLER;
        scmd->state = SCSI_STATE_FAILED;
-       /*
-        * Set the serial_number_at_timeout to the current
-        * serial_number
-        */
-       scmd->serial_number_at_timeout = scmd->serial_number;
        list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q);
        set_bit(SHOST_RECOVERY, &shost->shost_state);
        shost->host_failed++;
@@ -1061,7 +1056,6 @@ static int scsi_try_bus_reset(struct scsi_cmnd *scmd)
        SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n",
                                          __FUNCTION__));
        scmd->owner = SCSI_OWNER_LOWLEVEL;
-       scmd->serial_number_at_timeout = scmd->serial_number;
 
        if (!scmd->device->host->hostt->eh_bus_reset_handler)
                return FAILED;
@@ -1093,7 +1087,6 @@ static int scsi_try_host_reset(struct scsi_cmnd *scmd)
        SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n",
                                          __FUNCTION__));
        scmd->owner = SCSI_OWNER_LOWLEVEL;
-       scmd->serial_number_at_timeout = scmd->serial_number;
 
        if (!scmd->device->host->hostt->eh_host_reset_handler)
                return FAILED;
@@ -1313,6 +1306,9 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
        case DID_IMM_RETRY:
                return NEEDS_RETRY;
 
+       case DID_REQUEUE:
+               return ADD_TO_MLQUEUE;
+
        case DID_ERROR:
                if (msg_byte(scmd->result) == COMMAND_COMPLETE &&
                    status_byte(scmd->result) == RESERVATION_CONFLICT)
@@ -1839,7 +1835,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
        scmd->bufflen                   = 0;
        scmd->request_buffer            = NULL;
        scmd->request_bufflen           = 0;
-       scmd->internal_timeout          = NORMAL_TIMEOUT;
        scmd->abort_reason              = DID_ABORT;
 
        scmd->cmd_len                   = 0;
index 68c9728dfbbb3f9cd66919abde4d0893971a360a..7a6b530115ac9dbe78e136dc7e7ba5568e015cf0 100644 (file)
 
 #define NORMAL_RETRIES                 5
 #define IOCTL_NORMAL_TIMEOUT                   (10 * HZ)
-#define FORMAT_UNIT_TIMEOUT            (2 * 60 * 60 * HZ)
-#define START_STOP_TIMEOUT             (60 * HZ)
-#define MOVE_MEDIUM_TIMEOUT            (5 * 60 * HZ)
-#define READ_ELEMENT_STATUS_TIMEOUT    (5 * 60 * HZ)
-#define READ_DEFECT_DATA_TIMEOUT       (60 * HZ )  /* ZIP-250 on parallel port takes as long! */
 
 #define MAX_BUF PAGE_SIZE
 
index 7cbc4127fb5a6375e870920dd3f7b19199d59a90..619d3fb7a2f056bdfdde5f103d618a2b566fb949 100644 (file)
@@ -298,7 +298,6 @@ static int scsi_init_cmd_errh(struct scsi_cmnd *cmd)
 {
        cmd->owner = SCSI_OWNER_MIDLEVEL;
        cmd->serial_number = 0;
-       cmd->serial_number_at_timeout = 0;
        cmd->abort_reason = 0;
 
        memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer);
@@ -320,7 +319,6 @@ static int scsi_init_cmd_errh(struct scsi_cmnd *cmd)
        memcpy(cmd->data_cmnd, cmd->cmnd, sizeof(cmd->cmnd));
        cmd->buffer = cmd->request_buffer;
        cmd->bufflen = cmd->request_bufflen;
-       cmd->internal_timeout = NORMAL_TIMEOUT;
        cmd->abort_reason = 0;
 
        return 1;
diff --git a/drivers/scsi/scsi_obsolete.h b/drivers/scsi/scsi_obsolete.h
deleted file mode 100644 (file)
index abeacb9..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *  scsi_obsolete.h Copyright (C) 1997 Eric Youngdale
- *
- */
-
-#ifndef _SCSI_OBSOLETE_H
-#define _SCSI_OBSOLETE_H
-
-/*
- * These are the return codes for the abort and reset functions.  The mid-level
- * code uses these to decide what to do next.  Each of the low level abort
- * and reset functions must correctly indicate what it has done.
- * The descriptions are written from the point of view of the mid-level code,
- * so that the return code is telling the mid-level drivers exactly what
- * the low level driver has already done, and what remains to be done.
- */
-
-/* We did not do anything.  
- * Wait some more for this command to complete, and if this does not work, 
- * try something more serious. */
-#define SCSI_ABORT_SNOOZE 0
-
-/* This means that we were able to abort the command.  We have already
- * called the mid-level done function, and do not expect an interrupt that 
- * will lead to another call to the mid-level done function for this command */
-#define SCSI_ABORT_SUCCESS 1
-
-/* We called for an abort of this command, and we should get an interrupt 
- * when this succeeds.  Thus we should not restore the timer for this
- * command in the mid-level abort function. */
-#define SCSI_ABORT_PENDING 2
-
-/* Unable to abort - command is currently on the bus.  Grin and bear it. */
-#define SCSI_ABORT_BUSY 3
-
-/* The command is not active in the low level code. Command probably
- * finished. */
-#define SCSI_ABORT_NOT_RUNNING 4
-
-/* Something went wrong.  The low level driver will indicate the correct
- * error condition when it calls scsi_done, so the mid-level abort function
- * can simply wait until this comes through */
-#define SCSI_ABORT_ERROR 5
-
-/* We do not know how to reset the bus, or we do not want to.  Bummer.
- * Anyway, just wait a little more for the command in question, and hope that
- * it eventually finishes.  If it never finishes, the SCSI device could
- * hang, so use this with caution. */
-#define SCSI_RESET_SNOOZE 0
-
-/* We do not know how to reset the bus, or we do not want to.  Bummer.
- * We have given up on this ever completing.  The mid-level code will
- * request sense information to decide how to proceed from here. */
-#define SCSI_RESET_PUNT 1
-
-/* This means that we were able to reset the bus.  We have restarted all of
- * the commands that should be restarted, and we should be able to continue
- * on normally from here.  We do not expect any interrupts that will return
- * DID_RESET to any of the other commands in the host_queue, and the mid-level
- * code does not need to do anything special to keep the commands alive. 
- * If a hard reset was performed then all outstanding commands on the
- * bus have been restarted. */
-#define SCSI_RESET_SUCCESS 2
-
-/* We called for a reset of this bus, and we should get an interrupt 
- * when this succeeds.  Each command should get its own status
- * passed up to scsi_done, but this has not happened yet. 
- * If a hard reset was performed, then we expect an interrupt
- * for *each* of the outstanding commands that will have the
- * effect of restarting the commands.
- */
-#define SCSI_RESET_PENDING 3
-
-/* We did a reset, but do not expect an interrupt to signal DID_RESET.
- * This tells the upper level code to request the sense info, and this
- * should keep the command alive. */
-#define SCSI_RESET_WAKEUP 4
-
-/* The command is not active in the low level code. Command probably
-   finished. */
-#define SCSI_RESET_NOT_RUNNING 5
-
-/* Something went wrong, and we do not know how to fix it. */
-#define SCSI_RESET_ERROR 6
-
-#define SCSI_RESET_SYNCHRONOUS         0x01
-#define SCSI_RESET_ASYNCHRONOUS                0x02
-#define SCSI_RESET_SUGGEST_BUS_RESET   0x04
-#define SCSI_RESET_SUGGEST_HOST_RESET  0x08
-/*
- * This is a bitmask that is ored with one of the above codes.
- * It tells the mid-level code that we did a hard reset.
- */
-#define SCSI_RESET_BUS_RESET 0x100
-/*
- * This is a bitmask that is ored with one of the above codes.
- * It tells the mid-level code that we did a host adapter reset.
- */
-#define SCSI_RESET_HOST_RESET 0x200
-/*
- * Used to mask off bits and to obtain the basic action that was
- * performed.  
- */
-#define SCSI_RESET_ACTION   0xff
-
-#endif                         /* SCSI_OBSOLETE_H */
index aca3b39fe71049088e474c9fc3db3881ce15ea09..c01580df4476bc1acc70a41bd23434cc067fdf67 100644 (file)
@@ -29,11 +29,6 @@ struct Scsi_Host;
 #define SCSI_CMND_MAGIC                0xE25C23A5
 #define SCSI_REQ_MAGIC         0x75F6D354
 
-/*
- *  Flag bit for the internal_timeout array
- */
-#define NORMAL_TIMEOUT         0
-
 /*
  * Scsi Error Handler Flags
  */
index b362ff2811da3753deb03e66859b1253e1d08cfb..4c95abb540571dc301ee3c1385f90c0f15b417ee 100644 (file)
 #include <asm/uaccess.h>
 
 #include "scsi.h"
+#include <scsi/scsi_dbg.h>
 #include <scsi/scsi_host.h>
 #include "seagate.h"
 
@@ -746,7 +747,7 @@ static int internal_command (unsigned char target, unsigned char lun,
 
 #if (DEBUG & PRINT_COMMAND)
        printk("scsi%d : target = %d, command = ", hostno, target);
-       print_command((unsigned char *) cmnd);
+       __scsi_print_command((unsigned char *) cmnd);
 #endif
 
 #if (DEBUG & PHASE_RESELECT)
@@ -1553,7 +1554,7 @@ connect_loop:
        printk("\n");
 #endif
        printk("scsi%d : status = ", hostno);
-       print_status(status);
+       scsi_print_status(status);
        printk(" message = %02x\n", message);
 #endif
 
index fd72d73bb24407d53082d147591e1281f6a045d3..cf6b1f0fb124d1af9b80f2815f93d2c34c5dab6a 100644 (file)
@@ -51,6 +51,7 @@ static int sg_version_num = 30532;    /* 2 digits for each component */
 #include <linux/delay.h>
 
 #include "scsi.h"
+#include <scsi/scsi_dbg.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_driver.h>
 #include <scsi/scsi_ioctl.h>
@@ -1311,7 +1312,7 @@ sg_cmd_done(Scsi_Cmnd * SCpnt)
                if ((sdp->sgdebug > 0) &&
                    ((CHECK_CONDITION == srp->header.masked_status) ||
                     (COMMAND_TERMINATED == srp->header.masked_status)))
-                       print_req_sense("sg_cmd_done", SRpnt);
+                       scsi_print_req_sense("sg_cmd_done", SRpnt);
 
                /* Following if statement is a patch supplied by Eric Youngdale */
                if (driver_byte(SRpnt->sr_result) != 0
index 90811390a37da0fcf5ebe00827f1b36860a66c4a..7e19589e71a06c33d6cf94558c390b0b88f14457 100644 (file)
@@ -69,6 +69,7 @@
  *   finally replaced that by the *_PRINTK() macros.
  *
  */
+#include <scsi/scsi_dbg.h>
 
 /*
  * Further development / testing that should be done : 
@@ -2377,7 +2378,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
  * 3..length+1 arguments
  *
  * Start the extended message buffer with the EXTENDED_MESSAGE
- * byte, since print_msg() wants the whole thing.  
+ * byte, since scsi_print_msg() wants the whole thing.  
  */
                    extended_msg[0] = EXTENDED_MESSAGE;
                    /* Accept first byte by clearing ACK */
@@ -2430,7 +2431,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
                default:
                    if (!tmp) {
                        printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO);
-                       print_msg (extended_msg);
+                       scsi_print_msg (extended_msg);
                        printk("\n");
                    } else if (tmp != EXTENDED_MESSAGE)
                        printk(KERN_DEBUG "scsi%d: rejecting unknown "
@@ -2565,7 +2566,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance)
 
     if (!(msg[0] & 0x80)) {
        printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO);
-       print_msg(msg);
+       scsi_print_msg(msg);
        do_abort(instance);
        return;
     }
@@ -2691,7 +2692,7 @@ static int NCR5380_abort (Scsi_Cmnd *cmd)
     unsigned long flags;
 
     printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO);
-    print_Scsi_Cmnd (cmd);
+    scsi_print_command(cmd);
 
     NCR5380_print_status (instance);
 
index a1dff6d437bc22b066a123e2332526fdb7cc4d13..5ff83d214f128eed2ca780cf50fbc8f12a6fa07e 100644 (file)
@@ -799,12 +799,6 @@ static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd)
 
        dev_warn(&cmd->device->sdev_gendev, "%s operation started.\n", opname);
 
-#if 0
-       /* This one should be the result of some race, thus to ignore */
-       if (cmd->serial_number != cmd->serial_number_at_timeout)
-               goto prepare;
-#endif
-
        /* This one is queued in some place -> to wait for completion */
        FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) {
                struct sym_ccb *cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);
index 7484916fe2aac2f42e4ff03e01283a4263829629..a00095cc74c65a23b9eaa7ef060a2c5d43c4e28a 100644 (file)
@@ -945,7 +945,7 @@ static int ultrastor_abort(Scsi_Cmnd *SCpnt)
               config.mscp[mscp_index].SCint, SCpnt);
 #endif
     if (config.mscp[mscp_index].SCint == 0)
-       return SCSI_ABORT_NOT_RUNNING;
+       return FAILURE;
 
     if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort");
     config.mscp[mscp_index].SCint = NULL;
@@ -1020,7 +1020,7 @@ static int ultrastor_host_reset(Scsi_Cmnd * SCpnt)
 #endif
 
     spin_unlock_irqrestore(host->host_lock, flags);
-    return SCSI_RESET_SUCCESS;
+    return SUCCESS;
 
 }
 
index de0d32f6618de2bf0d78b36a13be128e52761d2d..cab89a970c7ff76b5d608bab1ad1d92cc94799be 100644 (file)
@@ -335,7 +335,7 @@ static int mts_scsi_abort (Scsi_Cmnd *srb)
 
        mts_urb_abort(desc);
 
-       return SCSI_ABORT_PENDING;
+       return FAILURE;
 }
 
 static int mts_scsi_host_reset (Scsi_Cmnd *srb)
index 1d54c063ae52fa958c5cb3ad1cf5198e1de2ae52..659ecf48fb4ac3777001cd71f887a5fbe569a6ec 100644 (file)
@@ -295,6 +295,8 @@ struct scsi_lun {
 #define DID_PASSTHROUGH 0x0a   /* Force command past mid-layer            */
 #define DID_SOFT_ERROR  0x0b   /* The low level driver just wish a retry  */
 #define DID_IMM_RETRY   0x0c   /* Retry without decrementing retry count  */
+#define DID_REQUEUE    0x0d    /* Requeue command (no immediate retry) also
+                                * without decrementing the retry count    */
 #define DRIVER_OK       0x00   /* Driver status                           */
 
 /*
@@ -360,6 +362,15 @@ struct scsi_lun {
 #define sense_error(sense)  ((sense) & 0xf)
 #define sense_valid(sense)  ((sense) & 0x80);
 
+/*
+ * default timeouts
+*/
+#define FORMAT_UNIT_TIMEOUT            (2 * 60 * 60 * HZ)
+#define START_STOP_TIMEOUT             (60 * HZ)
+#define MOVE_MEDIUM_TIMEOUT            (5 * 60 * HZ)
+#define READ_ELEMENT_STATUS_TIMEOUT    (5 * 60 * HZ)
+#define READ_DEFECT_DATA_TIMEOUT       (60 * HZ )
+
 
 #define IDENTIFY_BASE       0x80
 #define IDENTIFY(can_disconnect, lun)   (IDENTIFY_BASE |\
index 9d9871c28abdc2a3e8932a9819001aadf41cb0cd..07f5c699eaa7b365468150dc81bb0ce7bf05b46f 100644 (file)
@@ -43,21 +43,17 @@ struct scsi_cmnd {
        void (*done) (struct scsi_cmnd *);      /* Mid-level done function */
 
        /*
-        * A SCSI Command is assigned a nonzero serial_number when internal_cmnd
-        * passes it to the driver's queue command function.  The serial_number
-        * is cleared when scsi_done is entered indicating that the command has
-        * been completed.  If a timeout occurs, the serial number at the moment
-        * of timeout is copied into serial_number_at_timeout.  By subsequently
-        * comparing the serial_number and serial_number_at_timeout fields
-        * during abort or reset processing, we can detect whether the command
-        * has already completed.  This also detects cases where the command has
-        * completed and the SCSI Command structure has already being reused
-        * for another command, so that we can avoid incorrectly aborting or
-        * resetting the new command.
-        * The serial number is only unique per host.
+        * A SCSI Command is assigned a nonzero serial_number before passed
+        * to the driver's queue command function.  The serial_number is
+        * cleared when scsi_done is entered indicating that the command
+        * has been completed.  It currently doesn't have much use other
+        * than printk's.  Some lldd's use this number for other purposes.
+        * It's almost certain that such usages are either incorrect or
+        * meaningless.  Please kill all usages other than printk's.  Also,
+        * as this number is always identical to ->pid, please convert
+        * printk's to use ->pid, so that we can kill this field.
         */
        unsigned long serial_number;
-       unsigned long serial_number_at_timeout;
 
        int retries;
        int allowed;
@@ -65,12 +61,6 @@ struct scsi_cmnd {
        int timeout_total;
        int timeout;
 
-       /*
-        * We handle the timeout differently if it happens when a reset, 
-        * abort, etc are in process. 
-        */
-       unsigned volatile char internal_timeout;
-
        unsigned char cmd_len;
        unsigned char old_cmd_len;
        enum dma_data_direction sc_data_direction;