diff options
author | James Bottomley <jejb@titanic> | 2005-04-18 14:45:00 -0400 |
---|---|---|
committer | James Bottomley <jejb@titanic> | 2005-04-18 14:45:00 -0400 |
commit | c46f2ffb9e7fce7208c2639790e1ade42e00b146 (patch) | |
tree | 284912295d46a861930d0619788a650f56c2a29b | |
parent | c2a9331c62216e222a08de8dd58559367fef0af6 (diff) | |
parent | f59114b7b5dc677bbd7cc7e26a5fcb3572a3445c (diff) |
merge by hand (scsi_device.h)
39 files changed, 203 insertions, 330 deletions
diff --git a/drivers/block/scsi_ioctl.c b/drivers/block/scsi_ioctl.c index 689527a89de..681871ca5d6 100644 --- a/drivers/block/scsi_ioctl.c +++ b/drivers/block/scsi_ioctl.c | |||
@@ -328,11 +328,6 @@ static int sg_io(struct file *file, request_queue_t *q, | |||
328 | return 0; | 328 | return 0; |
329 | } | 329 | } |
330 | 330 | ||
331 | #define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) | ||
332 | #define START_STOP_TIMEOUT (60 * HZ) | ||
333 | #define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) | ||
334 | #define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) | ||
335 | #define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) | ||
336 | #define OMAX_SB_LEN 16 /* For backward compatibility */ | 331 | #define OMAX_SB_LEN 16 /* For backward compatibility */ |
337 | 332 | ||
338 | static int sg_scsi_ioctl(struct file *file, request_queue_t *q, | 333 | static int sg_scsi_ioctl(struct file *file, request_queue_t *q, |
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 5fc5004ea07..1fb5cdf67f8 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c | |||
@@ -54,6 +54,9 @@ | |||
54 | 54 | ||
55 | extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int); | 55 | extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int); |
56 | 56 | ||
57 | static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, | ||
58 | unsigned long arg); | ||
59 | |||
57 | static spinlock_t i2o_config_lock; | 60 | static spinlock_t i2o_config_lock; |
58 | 61 | ||
59 | #define MODINC(x,y) ((x) = ((x) + 1) % (y)) | 62 | #define MODINC(x,y) ((x) = ((x) + 1) % (y)) |
@@ -538,8 +541,7 @@ static int i2o_cfg_evt_get(unsigned long arg, struct file *fp) | |||
538 | } | 541 | } |
539 | 542 | ||
540 | #ifdef CONFIG_COMPAT | 543 | #ifdef CONFIG_COMPAT |
541 | static int i2o_cfg_passthru32(unsigned fd, unsigned cmnd, unsigned long arg, | 544 | static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, unsigned long arg) |
542 | struct file *file) | ||
543 | { | 545 | { |
544 | struct i2o_cmd_passthru32 __user *cmd; | 546 | struct i2o_cmd_passthru32 __user *cmd; |
545 | struct i2o_controller *c; | 547 | struct i2o_controller *c; |
@@ -752,7 +754,26 @@ static int i2o_cfg_passthru32(unsigned fd, unsigned cmnd, unsigned long arg, | |||
752 | return rcode; | 754 | return rcode; |
753 | } | 755 | } |
754 | 756 | ||
755 | #else | 757 | static long i2o_cfg_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg) |
758 | { | ||
759 | int ret; | ||
760 | lock_kernel(); | ||
761 | switch (cmd) { | ||
762 | case I2OGETIOPS: | ||
763 | ret = i2o_cfg_ioctl(NULL, file, cmd, arg); | ||
764 | break; | ||
765 | case I2OPASSTHRU32: | ||
766 | ret = i2o_cfg_passthru32(file, cmd, arg); | ||
767 | break; | ||
768 | default: | ||
769 | ret = -ENOIOCTLCMD; | ||
770 | break; | ||
771 | } | ||
772 | unlock_kernel(); | ||
773 | return ret; | ||
774 | } | ||
775 | |||
776 | #endif | ||
756 | 777 | ||
757 | static int i2o_cfg_passthru(unsigned long arg) | 778 | static int i2o_cfg_passthru(unsigned long arg) |
758 | { | 779 | { |
@@ -958,7 +979,6 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
958 | kfree(reply); | 979 | kfree(reply); |
959 | return rcode; | 980 | return rcode; |
960 | } | 981 | } |
961 | #endif | ||
962 | 982 | ||
963 | /* | 983 | /* |
964 | * IOCTL Handler | 984 | * IOCTL Handler |
@@ -1013,11 +1033,9 @@ static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, | |||
1013 | ret = i2o_cfg_evt_get(arg, fp); | 1033 | ret = i2o_cfg_evt_get(arg, fp); |
1014 | break; | 1034 | break; |
1015 | 1035 | ||
1016 | #ifndef CONFIG_COMPAT | ||
1017 | case I2OPASSTHRU: | 1036 | case I2OPASSTHRU: |
1018 | ret = i2o_cfg_passthru(arg); | 1037 | ret = i2o_cfg_passthru(arg); |
1019 | break; | 1038 | break; |
1020 | #endif | ||
1021 | 1039 | ||
1022 | default: | 1040 | default: |
1023 | osm_debug("unknown ioctl called!\n"); | 1041 | osm_debug("unknown ioctl called!\n"); |
@@ -1105,6 +1123,9 @@ static struct file_operations config_fops = { | |||
1105 | .owner = THIS_MODULE, | 1123 | .owner = THIS_MODULE, |
1106 | .llseek = no_llseek, | 1124 | .llseek = no_llseek, |
1107 | .ioctl = i2o_cfg_ioctl, | 1125 | .ioctl = i2o_cfg_ioctl, |
1126 | #ifdef CONFIG_COMPAT | ||
1127 | .compat_ioctl = i2o_cfg_compat_ioctl, | ||
1128 | #endif | ||
1108 | .open = cfg_open, | 1129 | .open = cfg_open, |
1109 | .release = cfg_release, | 1130 | .release = cfg_release, |
1110 | .fasync = cfg_fasync, | 1131 | .fasync = cfg_fasync, |
@@ -1134,19 +1155,11 @@ static int __init i2o_config_init(void) | |||
1134 | misc_deregister(&i2o_miscdev); | 1155 | misc_deregister(&i2o_miscdev); |
1135 | return -EBUSY; | 1156 | return -EBUSY; |
1136 | } | 1157 | } |
1137 | #ifdef CONFIG_COMPAT | ||
1138 | register_ioctl32_conversion(I2OPASSTHRU32, i2o_cfg_passthru32); | ||
1139 | register_ioctl32_conversion(I2OGETIOPS, (void *)sys_ioctl); | ||
1140 | #endif | ||
1141 | return 0; | 1158 | return 0; |
1142 | } | 1159 | } |
1143 | 1160 | ||
1144 | static void i2o_config_exit(void) | 1161 | static void i2o_config_exit(void) |
1145 | { | 1162 | { |
1146 | #ifdef CONFIG_COMPAT | ||
1147 | unregister_ioctl32_conversion(I2OPASSTHRU32); | ||
1148 | unregister_ioctl32_conversion(I2OGETIOPS); | ||
1149 | #endif | ||
1150 | misc_deregister(&i2o_miscdev); | 1163 | misc_deregister(&i2o_miscdev); |
1151 | i2o_driver_unregister(&i2o_config_driver); | 1164 | i2o_driver_unregister(&i2o_config_driver); |
1152 | } | 1165 | } |
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index ce398aa9e01..1f9aeb4accc 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -88,10 +88,10 @@ MODULE_DESCRIPTION | |||
88 | ("FCP (SCSI over Fibre Channel) HBA driver for IBM eServer zSeries"); | 88 | ("FCP (SCSI over Fibre Channel) HBA driver for IBM eServer zSeries"); |
89 | MODULE_LICENSE("GPL"); | 89 | MODULE_LICENSE("GPL"); |
90 | 90 | ||
91 | module_param(device, charp, 0); | 91 | module_param(device, charp, 0400); |
92 | MODULE_PARM_DESC(device, "specify initial device"); | 92 | MODULE_PARM_DESC(device, "specify initial device"); |
93 | 93 | ||
94 | module_param(loglevel, uint, 0); | 94 | module_param(loglevel, uint, 0400); |
95 | MODULE_PARM_DESC(loglevel, | 95 | MODULE_PARM_DESC(loglevel, |
96 | "log levels, 8 nibbles: " | 96 | "log levels, 8 nibbles: " |
97 | "FC ERP QDIO CIO Config FSF SCSI Other, " | 97 | "FC ERP QDIO CIO Config FSF SCSI Other, " |
diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h index 53fcccbb424..0afa1c4696c 100644 --- a/drivers/s390/scsi/zfcp_def.h +++ b/drivers/s390/scsi/zfcp_def.h | |||
@@ -70,7 +70,7 @@ | |||
70 | /********************* GENERAL DEFINES *********************************/ | 70 | /********************* GENERAL DEFINES *********************************/ |
71 | 71 | ||
72 | /* zfcp version number, it consists of major, minor, and patch-level number */ | 72 | /* zfcp version number, it consists of major, minor, and patch-level number */ |
73 | #define ZFCP_VERSION "4.2.0" | 73 | #define ZFCP_VERSION "4.3.0" |
74 | 74 | ||
75 | /** | 75 | /** |
76 | * zfcp_sg_to_address - determine kernel address from struct scatterlist | 76 | * zfcp_sg_to_address - determine kernel address from struct scatterlist |
@@ -851,6 +851,9 @@ struct zfcp_adapter { | |||
851 | wwn_t wwnn; /* WWNN */ | 851 | wwn_t wwnn; /* WWNN */ |
852 | wwn_t wwpn; /* WWPN */ | 852 | wwn_t wwpn; /* WWPN */ |
853 | fc_id_t s_id; /* N_Port ID */ | 853 | fc_id_t s_id; /* N_Port ID */ |
854 | wwn_t peer_wwnn; /* P2P peer WWNN */ | ||
855 | wwn_t peer_wwpn; /* P2P peer WWPN */ | ||
856 | fc_id_t peer_d_id; /* P2P peer D_ID */ | ||
854 | struct ccw_device *ccw_device; /* S/390 ccw device */ | 857 | struct ccw_device *ccw_device; /* S/390 ccw device */ |
855 | u8 fc_service_class; | 858 | u8 fc_service_class; |
856 | u32 fc_topology; /* FC topology */ | 859 | u32 fc_topology; /* FC topology */ |
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index cfc0d8c588d..53ebc1cdfe2 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -2568,6 +2568,23 @@ zfcp_erp_port_strategy_open_common(struct zfcp_erp_action *erp_action) | |||
2568 | case ZFCP_ERP_STEP_UNINITIALIZED: | 2568 | case ZFCP_ERP_STEP_UNINITIALIZED: |
2569 | case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: | 2569 | case ZFCP_ERP_STEP_PHYS_PORT_CLOSING: |
2570 | case ZFCP_ERP_STEP_PORT_CLOSING: | 2570 | case ZFCP_ERP_STEP_PORT_CLOSING: |
2571 | if (adapter->fc_topology == FSF_TOPO_P2P) { | ||
2572 | if (port->wwpn != adapter->peer_wwpn) { | ||
2573 | ZFCP_LOG_NORMAL("Failed to open port 0x%016Lx " | ||
2574 | "on adapter %s.\nPeer WWPN " | ||
2575 | "0x%016Lx does not match\n", | ||
2576 | port->wwpn, | ||
2577 | zfcp_get_busid_by_adapter(adapter), | ||
2578 | adapter->peer_wwpn); | ||
2579 | zfcp_erp_port_failed(port); | ||
2580 | retval = ZFCP_ERP_FAILED; | ||
2581 | break; | ||
2582 | } | ||
2583 | port->d_id = adapter->peer_d_id; | ||
2584 | atomic_set_mask(ZFCP_STATUS_PORT_DID_DID, &port->status); | ||
2585 | retval = zfcp_erp_port_strategy_open_port(erp_action); | ||
2586 | break; | ||
2587 | } | ||
2571 | if (!(adapter->nameserver_port)) { | 2588 | if (!(adapter->nameserver_port)) { |
2572 | retval = zfcp_nameserver_enqueue(adapter); | 2589 | retval = zfcp_nameserver_enqueue(adapter); |
2573 | if (retval != 0) { | 2590 | if (retval != 0) { |
@@ -3516,8 +3533,9 @@ zfcp_erp_adapter_access_changed(struct zfcp_adapter *adapter) | |||
3516 | debug_text_event(adapter->erp_dbf, 3, "a_access_unblock"); | 3533 | debug_text_event(adapter->erp_dbf, 3, "a_access_unblock"); |
3517 | debug_event(adapter->erp_dbf, 3, &adapter->name, 8); | 3534 | debug_event(adapter->erp_dbf, 3, &adapter->name, 8); |
3518 | 3535 | ||
3519 | zfcp_erp_port_access_changed(adapter->nameserver_port); | ||
3520 | read_lock_irqsave(&zfcp_data.config_lock, flags); | 3536 | read_lock_irqsave(&zfcp_data.config_lock, flags); |
3537 | if (adapter->nameserver_port) | ||
3538 | zfcp_erp_port_access_changed(adapter->nameserver_port); | ||
3521 | list_for_each_entry(port, &adapter->port_list_head, list) | 3539 | list_for_each_entry(port, &adapter->port_list_head, list) |
3522 | if (port != adapter->nameserver_port) | 3540 | if (port != adapter->nameserver_port) |
3523 | zfcp_erp_port_access_changed(port); | 3541 | zfcp_erp_port_access_changed(port); |
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 578b9fbe520..148b11c822b 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -2107,6 +2107,9 @@ zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *fsf_req, int xchg_ok) | |||
2107 | bottom->low_qtcb_version, bottom->high_qtcb_version); | 2107 | bottom->low_qtcb_version, bottom->high_qtcb_version); |
2108 | adapter->fsf_lic_version = bottom->lic_version; | 2108 | adapter->fsf_lic_version = bottom->lic_version; |
2109 | adapter->supported_features = bottom->supported_features; | 2109 | adapter->supported_features = bottom->supported_features; |
2110 | adapter->peer_wwpn = 0; | ||
2111 | adapter->peer_wwnn = 0; | ||
2112 | adapter->peer_d_id = 0; | ||
2110 | 2113 | ||
2111 | if (xchg_ok) { | 2114 | if (xchg_ok) { |
2112 | adapter->wwnn = bottom->nport_serv_param.wwnn; | 2115 | 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) | |||
2124 | adapter->hydra_version = 0; | 2127 | adapter->hydra_version = 0; |
2125 | } | 2128 | } |
2126 | 2129 | ||
2130 | if (adapter->fc_topology == FSF_TOPO_P2P) { | ||
2131 | adapter->peer_d_id = bottom->peer_d_id & ZFCP_DID_MASK; | ||
2132 | adapter->peer_wwpn = bottom->plogi_payload.wwpn; | ||
2133 | adapter->peer_wwnn = bottom->plogi_payload.wwnn; | ||
2134 | } | ||
2135 | |||
2127 | if(adapter->supported_features & FSF_FEATURE_HBAAPI_MANAGEMENT){ | 2136 | if(adapter->supported_features & FSF_FEATURE_HBAAPI_MANAGEMENT){ |
2128 | adapter->hardware_version = bottom->hardware_version; | 2137 | adapter->hardware_version = bottom->hardware_version; |
2129 | memcpy(adapter->serial_number, bottom->serial_number, 17); | 2138 | memcpy(adapter->serial_number, bottom->serial_number, 17); |
2130 | EBCASC(adapter->serial_number, sizeof(adapter->serial_number)); | 2139 | EBCASC(adapter->serial_number, sizeof(adapter->serial_number)); |
2131 | } | 2140 | } |
2132 | 2141 | ||
2133 | ZFCP_LOG_INFO("The adapter %s reported the following characteristics:\n" | 2142 | ZFCP_LOG_NORMAL("The adapter %s reported the following characteristics:\n" |
2134 | "WWNN 0x%016Lx, " | 2143 | "WWNN 0x%016Lx, " |
2135 | "WWPN 0x%016Lx, " | 2144 | "WWPN 0x%016Lx, " |
2136 | "S_ID 0x%08x,\n" | 2145 | "S_ID 0x%08x,\n" |
@@ -2194,14 +2203,18 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) | |||
2194 | switch (adapter->fc_topology) { | 2203 | switch (adapter->fc_topology) { |
2195 | case FSF_TOPO_P2P: | 2204 | case FSF_TOPO_P2P: |
2196 | ZFCP_LOG_FLAGS(1, "FSF_TOPO_P2P\n"); | 2205 | ZFCP_LOG_FLAGS(1, "FSF_TOPO_P2P\n"); |
2197 | ZFCP_LOG_NORMAL("error: Point-to-point fibrechannel " | 2206 | ZFCP_LOG_NORMAL("Point-to-Point fibrechannel " |
2198 | "configuration detected at adapter %s " | 2207 | "configuration detected at adapter %s\n" |
2199 | "unsupported, shutting down adapter\n", | 2208 | "Peer WWNN 0x%016llx, " |
2200 | zfcp_get_busid_by_adapter(adapter)); | 2209 | "peer WWPN 0x%016llx, " |
2210 | "peer d_id 0x%06x\n", | ||
2211 | zfcp_get_busid_by_adapter(adapter), | ||
2212 | adapter->peer_wwnn, | ||
2213 | adapter->peer_wwpn, | ||
2214 | adapter->peer_d_id); | ||
2201 | debug_text_event(fsf_req->adapter->erp_dbf, 0, | 2215 | debug_text_event(fsf_req->adapter->erp_dbf, 0, |
2202 | "top-p-to-p"); | 2216 | "top-p-to-p"); |
2203 | zfcp_erp_adapter_shutdown(adapter, 0); | 2217 | break; |
2204 | return -EIO; | ||
2205 | case FSF_TOPO_AL: | 2218 | case FSF_TOPO_AL: |
2206 | ZFCP_LOG_FLAGS(1, "FSF_TOPO_AL\n"); | 2219 | ZFCP_LOG_FLAGS(1, "FSF_TOPO_AL\n"); |
2207 | ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " | 2220 | ZFCP_LOG_NORMAL("error: Arbitrated loop fibrechannel " |
@@ -2226,6 +2239,7 @@ zfcp_fsf_exchange_config_data_handler(struct zfcp_fsf_req *fsf_req) | |||
2226 | "of a type known to the zfcp " | 2239 | "of a type known to the zfcp " |
2227 | "driver, shutting down adapter\n", | 2240 | "driver, shutting down adapter\n", |
2228 | zfcp_get_busid_by_adapter(adapter)); | 2241 | zfcp_get_busid_by_adapter(adapter)); |
2242 | adapter->fc_topology = FSF_TOPO_ERROR; | ||
2229 | debug_text_exception(fsf_req->adapter->erp_dbf, 0, | 2243 | debug_text_exception(fsf_req->adapter->erp_dbf, 0, |
2230 | "unknown-topo"); | 2244 | "unknown-topo"); |
2231 | zfcp_erp_adapter_shutdown(adapter, 0); | 2245 | zfcp_erp_adapter_shutdown(adapter, 0); |
@@ -4281,6 +4295,7 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) | |||
4281 | bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE); | 4295 | bottom.io.fcp_cmnd, FSF_FCP_CMND_SIZE); |
4282 | zfcp_cmd_dbf_event_fsf("undeffcp", fsf_req, NULL, 0); | 4296 | zfcp_cmd_dbf_event_fsf("undeffcp", fsf_req, NULL, 0); |
4283 | set_host_byte(&scpnt->result, DID_ERROR); | 4297 | set_host_byte(&scpnt->result, DID_ERROR); |
4298 | goto skip_fsfstatus; | ||
4284 | } | 4299 | } |
4285 | } | 4300 | } |
4286 | 4301 | ||
@@ -4334,7 +4349,7 @@ zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *fsf_req) | |||
4334 | 4349 | ||
4335 | scpnt->resid = fcp_rsp_iu->fcp_resid; | 4350 | scpnt->resid = fcp_rsp_iu->fcp_resid; |
4336 | if (scpnt->request_bufflen - scpnt->resid < scpnt->underflow) | 4351 | if (scpnt->request_bufflen - scpnt->resid < scpnt->underflow) |
4337 | scpnt->result |= DID_ERROR << 16; | 4352 | set_host_byte(&scpnt->result, DID_ERROR); |
4338 | } | 4353 | } |
4339 | 4354 | ||
4340 | skip_fsfstatus: | 4355 | skip_fsfstatus: |
@@ -4607,6 +4622,13 @@ zfcp_fsf_control_file_handler(struct zfcp_fsf_req *fsf_req) | |||
4607 | if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) { | 4622 | if (bottom->operation_subtype == FSF_CFDC_OPERATION_SUBTYPE) { |
4608 | switch (header->fsf_status_qual.word[0]) { | 4623 | switch (header->fsf_status_qual.word[0]) { |
4609 | 4624 | ||
4625 | case FSF_SQ_CFDC_HARDENED_ON_SE: | ||
4626 | ZFCP_LOG_NORMAL( | ||
4627 | "CFDC on the adapter %s has being " | ||
4628 | "hardened on primary and secondary SE\n", | ||
4629 | zfcp_get_busid_by_adapter(adapter)); | ||
4630 | break; | ||
4631 | |||
4610 | case FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE: | 4632 | case FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE: |
4611 | ZFCP_LOG_NORMAL( | 4633 | ZFCP_LOG_NORMAL( |
4612 | "CFDC of the adapter %s could not " | 4634 | "CFDC of the adapter %s could not " |
diff --git a/drivers/s390/scsi/zfcp_fsf.h b/drivers/s390/scsi/zfcp_fsf.h index 5889956bbf0..07140dfda2a 100644 --- a/drivers/s390/scsi/zfcp_fsf.h +++ b/drivers/s390/scsi/zfcp_fsf.h | |||
@@ -129,6 +129,7 @@ | |||
129 | #define FSF_SQ_NO_RETRY_POSSIBLE 0x07 | 129 | #define FSF_SQ_NO_RETRY_POSSIBLE 0x07 |
130 | 130 | ||
131 | /* FSF status qualifier for CFDC commands */ | 131 | /* FSF status qualifier for CFDC commands */ |
132 | #define FSF_SQ_CFDC_HARDENED_ON_SE 0x00000000 | ||
132 | #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE 0x00000001 | 133 | #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE 0x00000001 |
133 | #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE2 0x00000002 | 134 | #define FSF_SQ_CFDC_COULD_NOT_HARDEN_ON_SE2 0x00000002 |
134 | /* CFDC subtable codes */ | 135 | /* CFDC subtable codes */ |
@@ -357,7 +358,6 @@ struct fsf_nport_serv_param { | |||
357 | u8 class3_serv_param[16]; | 358 | u8 class3_serv_param[16]; |
358 | u8 class4_serv_param[16]; | 359 | u8 class4_serv_param[16]; |
359 | u8 vendor_version_level[16]; | 360 | u8 vendor_version_level[16]; |
360 | u8 res1[16]; | ||
361 | } __attribute__ ((packed)); | 361 | } __attribute__ ((packed)); |
362 | 362 | ||
363 | struct fsf_plogi { | 363 | struct fsf_plogi { |
@@ -415,11 +415,13 @@ struct fsf_qtcb_bottom_config { | |||
415 | u8 res2[12]; | 415 | u8 res2[12]; |
416 | u32 s_id; | 416 | u32 s_id; |
417 | struct fsf_nport_serv_param nport_serv_param; | 417 | struct fsf_nport_serv_param nport_serv_param; |
418 | u8 reserved_nport_serv_param[16]; | ||
418 | u8 res3[8]; | 419 | u8 res3[8]; |
419 | u32 adapter_ports; | 420 | u32 adapter_ports; |
420 | u32 hardware_version; | 421 | u32 hardware_version; |
421 | u8 serial_number[32]; | 422 | u8 serial_number[32]; |
422 | u8 res4[272]; | 423 | struct fsf_nport_serv_param plogi_payload; |
424 | u8 res4[160]; | ||
423 | } __attribute__ ((packed)); | 425 | } __attribute__ ((packed)); |
424 | 426 | ||
425 | struct fsf_qtcb_bottom_port { | 427 | struct fsf_qtcb_bottom_port { |
diff --git a/drivers/s390/scsi/zfcp_sysfs_adapter.c b/drivers/s390/scsi/zfcp_sysfs_adapter.c index ff28ade1dfc..23e2dca55bb 100644 --- a/drivers/s390/scsi/zfcp_sysfs_adapter.c +++ b/drivers/s390/scsi/zfcp_sysfs_adapter.c | |||
@@ -65,6 +65,9 @@ ZFCP_DEFINE_ADAPTER_ATTR(status, "0x%08x\n", atomic_read(&adapter->status)); | |||
65 | ZFCP_DEFINE_ADAPTER_ATTR(wwnn, "0x%016llx\n", adapter->wwnn); | 65 | ZFCP_DEFINE_ADAPTER_ATTR(wwnn, "0x%016llx\n", adapter->wwnn); |
66 | ZFCP_DEFINE_ADAPTER_ATTR(wwpn, "0x%016llx\n", adapter->wwpn); | 66 | ZFCP_DEFINE_ADAPTER_ATTR(wwpn, "0x%016llx\n", adapter->wwpn); |
67 | ZFCP_DEFINE_ADAPTER_ATTR(s_id, "0x%06x\n", adapter->s_id); | 67 | ZFCP_DEFINE_ADAPTER_ATTR(s_id, "0x%06x\n", adapter->s_id); |
68 | ZFCP_DEFINE_ADAPTER_ATTR(peer_wwnn, "0x%016llx\n", adapter->peer_wwnn); | ||
69 | ZFCP_DEFINE_ADAPTER_ATTR(peer_wwpn, "0x%016llx\n", adapter->peer_wwpn); | ||
70 | ZFCP_DEFINE_ADAPTER_ATTR(peer_d_id, "0x%06x\n", adapter->peer_d_id); | ||
68 | ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); | 71 | ZFCP_DEFINE_ADAPTER_ATTR(card_version, "0x%04x\n", adapter->hydra_version); |
69 | ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); | 72 | ZFCP_DEFINE_ADAPTER_ATTR(lic_version, "0x%08x\n", adapter->fsf_lic_version); |
70 | ZFCP_DEFINE_ADAPTER_ATTR(fc_link_speed, "%d Gb/s\n", adapter->fc_link_speed); | 73 | 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[] = { | |||
255 | &dev_attr_wwnn.attr, | 258 | &dev_attr_wwnn.attr, |
256 | &dev_attr_wwpn.attr, | 259 | &dev_attr_wwpn.attr, |
257 | &dev_attr_s_id.attr, | 260 | &dev_attr_s_id.attr, |
261 | &dev_attr_peer_wwnn.attr, | ||
262 | &dev_attr_peer_wwpn.attr, | ||
263 | &dev_attr_peer_d_id.attr, | ||
258 | &dev_attr_card_version.attr, | 264 | &dev_attr_card_version.attr, |
259 | &dev_attr_lic_version.attr, | 265 | &dev_attr_lic_version.attr, |
260 | &dev_attr_fc_link_speed.attr, | 266 | &dev_attr_fc_link_speed.attr, |
diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c index 8ead55f75d0..2341d27ceed 100644 --- a/drivers/scsi/53c7xx.c +++ b/drivers/scsi/53c7xx.c | |||
@@ -280,6 +280,7 @@ | |||
280 | #endif | 280 | #endif |
281 | 281 | ||
282 | #include "scsi.h" | 282 | #include "scsi.h" |
283 | #include <scsi/scsi_dbg.h> | ||
283 | #include <scsi/scsi_host.h> | 284 | #include <scsi/scsi_host.h> |
284 | #include "53c7xx.h" | 285 | #include "53c7xx.h" |
285 | #include <linux/stat.h> | 286 | #include <linux/stat.h> |
@@ -1721,9 +1722,9 @@ NCR53c7xx_run_tests (struct Scsi_Host *host) { | |||
1721 | printk ("scsi%d : test 2 INQUIRY to target %d, lun 0 : %s\n", | 1722 | printk ("scsi%d : test 2 INQUIRY to target %d, lun 0 : %s\n", |
1722 | host->host_no, i, data + 8); | 1723 | host->host_no, i, data + 8); |
1723 | printk ("scsi%d : status ", host->host_no); | 1724 | printk ("scsi%d : status ", host->host_no); |
1724 | print_status (status); | 1725 | scsi_print_status (status); |
1725 | printk ("\nscsi%d : message ", host->host_no); | 1726 | printk ("\nscsi%d : message ", host->host_no); |
1726 | print_msg (&msg); | 1727 | scsi_print_msg (&msg); |
1727 | printk ("\n"); | 1728 | printk ("\n"); |
1728 | } else if (hostdata->test_completed == 3) { | 1729 | } else if (hostdata->test_completed == 3) { |
1729 | printk("scsi%d : test 2 no connection with target %d\n", | 1730 | printk("scsi%d : test 2 no connection with target %d\n", |
@@ -2312,7 +2313,7 @@ NCR53c7x0_dstat_sir_intr (struct Scsi_Host *host, struct | |||
2312 | printk ("scsi%d : received message", host->host_no); | 2313 | printk ("scsi%d : received message", host->host_no); |
2313 | if (c) | 2314 | if (c) |
2314 | printk (" from target %d lun %d ", c->device->id, c->device->lun); | 2315 | printk (" from target %d lun %d ", c->device->id, c->device->lun); |
2315 | print_msg ((unsigned char *) hostdata->msg_buf); | 2316 | scsi_print_msg ((unsigned char *) hostdata->msg_buf); |
2316 | printk("\n"); | 2317 | printk("\n"); |
2317 | } | 2318 | } |
2318 | 2319 | ||
@@ -3204,7 +3205,7 @@ create_cmd (Scsi_Cmnd *cmd) { | |||
3204 | case WRITE_10: | 3205 | case WRITE_10: |
3205 | #if 0 | 3206 | #if 0 |
3206 | printk("scsi%d : command is ", host->host_no); | 3207 | printk("scsi%d : command is ", host->host_no); |
3207 | print_command(cmd->cmnd); | 3208 | __scsi_print_command(cmd->cmnd); |
3208 | #endif | 3209 | #endif |
3209 | #if 0 | 3210 | #if 0 |
3210 | printk ("scsi%d : %d scatter/gather segments\n", host->host_no, | 3211 | printk ("scsi%d : %d scatter/gather segments\n", host->host_no, |
@@ -3232,7 +3233,7 @@ create_cmd (Scsi_Cmnd *cmd) { | |||
3232 | */ | 3233 | */ |
3233 | default: | 3234 | default: |
3234 | printk("scsi%d : datain+dataout for command ", host->host_no); | 3235 | printk("scsi%d : datain+dataout for command ", host->host_no); |
3235 | print_command(cmd->cmnd); | 3236 | __scsi_print_command(cmd->cmnd); |
3236 | datain = dataout = 2 * (cmd->use_sg ? cmd->use_sg : 1) + 3; | 3237 | datain = dataout = 2 * (cmd->use_sg ? cmd->use_sg : 1) + 3; |
3237 | } | 3238 | } |
3238 | 3239 | ||
@@ -3938,7 +3939,7 @@ intr_scsi (struct Scsi_Host *host, struct NCR53c7x0_cmd *cmd) { | |||
3938 | if (cmd) { | 3939 | if (cmd) { |
3939 | printk("scsi%d : target %d, lun %d, command ", | 3940 | printk("scsi%d : target %d, lun %d, command ", |
3940 | host->host_no, cmd->cmd->device->id, cmd->cmd->device->lun); | 3941 | host->host_no, cmd->cmd->device->id, cmd->cmd->device->lun); |
3941 | print_command (cmd->cmd->cmnd); | 3942 | __scsi_print_command (cmd->cmd->cmnd); |
3942 | printk("scsi%d : dsp = 0x%x (virt 0x%p)\n", host->host_no, | 3943 | printk("scsi%d : dsp = 0x%x (virt 0x%p)\n", host->host_no, |
3943 | NCR53c7x0_read32(DSP_REG), | 3944 | NCR53c7x0_read32(DSP_REG), |
3944 | bus_to_virt(NCR53c7x0_read32(DSP_REG))); | 3945 | bus_to_virt(NCR53c7x0_read32(DSP_REG))); |
@@ -4208,7 +4209,7 @@ restart: | |||
4208 | if (hostdata->options & OPTION_DEBUG_INTR) { | 4209 | if (hostdata->options & OPTION_DEBUG_INTR) { |
4209 | printk ("scsi%d : command complete : pid %lu, id %d,lun %d result 0x%x ", | 4210 | printk ("scsi%d : command complete : pid %lu, id %d,lun %d result 0x%x ", |
4210 | host->host_no, tmp->pid, tmp->device->id, tmp->device->lun, tmp->result); | 4211 | host->host_no, tmp->pid, tmp->device->id, tmp->device->lun, tmp->result); |
4211 | print_command (tmp->cmnd); | 4212 | __scsi_print_command (tmp->cmnd); |
4212 | } | 4213 | } |
4213 | 4214 | ||
4214 | tmp->scsi_done(tmp); | 4215 | tmp->scsi_done(tmp); |
@@ -4297,7 +4298,7 @@ NCR53c7x0_intr (int irq, void *dev_id, struct pt_regs * regs) | |||
4297 | printk("scsi%d : interrupt for pid %lu, id %d, lun %d ", | 4298 | printk("scsi%d : interrupt for pid %lu, id %d, lun %d ", |
4298 | host->host_no, cmd->cmd->pid, (int) cmd->cmd->device->id, | 4299 | host->host_no, cmd->cmd->pid, (int) cmd->cmd->device->id, |
4299 | (int) cmd->cmd->device->lun); | 4300 | (int) cmd->cmd->device->lun); |
4300 | print_command (cmd->cmd->cmnd); | 4301 | __scsi_print_command (cmd->cmd->cmnd); |
4301 | } else { | 4302 | } else { |
4302 | printk("scsi%d : no active command\n", host->host_no); | 4303 | printk("scsi%d : no active command\n", host->host_no); |
4303 | } | 4304 | } |
@@ -5539,7 +5540,7 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) { | |||
5539 | i > 0 && !check_address ((unsigned long) ptr, 1); | 5540 | i > 0 && !check_address ((unsigned long) ptr, 1); |
5540 | ptr += len, i -= len) { | 5541 | ptr += len, i -= len) { |
5541 | printk(" "); | 5542 | printk(" "); |
5542 | len = print_msg (ptr); | 5543 | len = scsi_print_msg (ptr); |
5543 | printk("\n"); | 5544 | printk("\n"); |
5544 | if (!len) | 5545 | if (!len) |
5545 | break; | 5546 | break; |
@@ -5554,7 +5555,7 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) { | |||
5554 | if (cmd) { | 5555 | if (cmd) { |
5555 | printk(" result = 0x%x, target = %d, lun = %d, cmd = ", | 5556 | printk(" result = 0x%x, target = %d, lun = %d, cmd = ", |
5556 | cmd->result, cmd->device->id, cmd->device->lun); | 5557 | cmd->result, cmd->device->id, cmd->device->lun); |
5557 | print_command(cmd->cmnd); | 5558 | __scsi_print_command(cmd->cmnd); |
5558 | } else | 5559 | } else |
5559 | printk("\n"); | 5560 | printk("\n"); |
5560 | printk(" + %d : dsa_next = 0x%x\n", hostdata->dsa_next, | 5561 | printk(" + %d : dsa_next = 0x%x\n", hostdata->dsa_next, |
@@ -6028,7 +6029,7 @@ dump_events (struct Scsi_Host *host, int count) { | |||
6028 | virt_to_bus(event.dsa), event.dsa); | 6029 | virt_to_bus(event.dsa), event.dsa); |
6029 | if (event.pid != -1) { | 6030 | if (event.pid != -1) { |
6030 | printk (" event for pid %ld ", event.pid); | 6031 | printk (" event for pid %ld ", event.pid); |
6031 | print_command (event.cmnd); | 6032 | __scsi_print_command (event.cmnd); |
6032 | } | 6033 | } |
6033 | } | 6034 | } |
6034 | } | 6035 | } |
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index 41b5197ce4e..15e4b122d56 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c | |||
@@ -2958,13 +2958,6 @@ static int BusLogic_AbortCommand(struct scsi_cmnd *Command) | |||
2958 | struct BusLogic_CCB *CCB; | 2958 | struct BusLogic_CCB *CCB; |
2959 | BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[TargetID].CommandAbortsRequested); | 2959 | BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[TargetID].CommandAbortsRequested); |
2960 | /* | 2960 | /* |
2961 | If this Command has already completed, then no Abort is necessary. | ||
2962 | */ | ||
2963 | if (Command->serial_number != Command->serial_number_at_timeout) { | ||
2964 | BusLogic_Warning("Unable to Abort Command to Target %d - " "Already Completed\n", HostAdapter, TargetID); | ||
2965 | return SUCCESS; | ||
2966 | } | ||
2967 | /* | ||
2968 | Attempt to find an Active CCB for this Command. If no Active CCB for this | 2961 | Attempt to find an Active CCB for this Command. If no Active CCB for this |
2969 | Command is found, then no Abort is necessary. | 2962 | Command is found, then no Abort is necessary. |
2970 | */ | 2963 | */ |
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 5e71a0beafc..770fa841e38 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c | |||
@@ -86,6 +86,7 @@ | |||
86 | * 5. Test linked command handling code after Eric is ready with | 86 | * 5. Test linked command handling code after Eric is ready with |
87 | * the high level code. | 87 | * the high level code. |
88 | */ | 88 | */ |
89 | #include <scsi/scsi_dbg.h> | ||
89 | 90 | ||
90 | #if (NDEBUG & NDEBUG_LISTS) | 91 | #if (NDEBUG & NDEBUG_LISTS) |
91 | #define LIST(x,y) {printk("LINE:%d Adding %p to %p\n", __LINE__, (void*)(x), (void*)(y)); if ((x)==(y)) udelay(5); } | 92 | #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) { | |||
2371 | * 3..length+1 arguments | 2372 | * 3..length+1 arguments |
2372 | * | 2373 | * |
2373 | * Start the extended message buffer with the EXTENDED_MESSAGE | 2374 | * Start the extended message buffer with the EXTENDED_MESSAGE |
2374 | * byte, since print_msg() wants the whole thing. | 2375 | * byte, since scsi_print_msg() wants the whole thing. |
2375 | */ | 2376 | */ |
2376 | extended_msg[0] = EXTENDED_MESSAGE; | 2377 | extended_msg[0] = EXTENDED_MESSAGE; |
2377 | /* Accept first byte by clearing ACK */ | 2378 | /* Accept first byte by clearing ACK */ |
@@ -2418,7 +2419,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2418 | default: | 2419 | default: |
2419 | if (!tmp) { | 2420 | if (!tmp) { |
2420 | printk("scsi%d: rejecting message ", instance->host_no); | 2421 | printk("scsi%d: rejecting message ", instance->host_no); |
2421 | print_msg(extended_msg); | 2422 | scsi_print_msg(extended_msg); |
2422 | printk("\n"); | 2423 | printk("\n"); |
2423 | } else if (tmp != EXTENDED_MESSAGE) | 2424 | } else if (tmp != EXTENDED_MESSAGE) |
2424 | printk("scsi%d: rejecting unknown message %02x from target %d, lun %d\n", instance->host_no, tmp, cmd->device->id, cmd->device->lun); | 2425 | 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) { | |||
2552 | 2553 | ||
2553 | if (!(msg[0] & 0x80)) { | 2554 | if (!(msg[0] & 0x80)) { |
2554 | printk(KERN_ERR "scsi%d : expecting IDENTIFY message, got ", instance->host_no); | 2555 | printk(KERN_ERR "scsi%d : expecting IDENTIFY message, got ", instance->host_no); |
2555 | print_msg(msg); | 2556 | scsi_print_msg(msg); |
2556 | abort = 1; | 2557 | abort = 1; |
2557 | } else { | 2558 | } else { |
2558 | /* Accept message by clearing ACK */ | 2559 | /* Accept message by clearing ACK */ |
@@ -2677,7 +2678,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) { | |||
2677 | Scsi_Cmnd *tmp, **prev; | 2678 | Scsi_Cmnd *tmp, **prev; |
2678 | 2679 | ||
2679 | printk(KERN_WARNING "scsi%d : aborting command\n", instance->host_no); | 2680 | printk(KERN_WARNING "scsi%d : aborting command\n", instance->host_no); |
2680 | print_Scsi_Cmnd(cmd); | 2681 | scsi_print_command(cmd); |
2681 | 2682 | ||
2682 | NCR5380_print_status(instance); | 2683 | NCR5380_print_status(instance); |
2683 | 2684 | ||
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 9962c51dc2a..04cb5c405a2 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c | |||
@@ -9198,16 +9198,13 @@ asc_prt_scsi_cmnd(struct scsi_cmnd *s) | |||
9198 | s->use_sg, s->sglist_len, s->abort_reason); | 9198 | s->use_sg, s->sglist_len, s->abort_reason); |
9199 | 9199 | ||
9200 | printk( | 9200 | printk( |
9201 | " serial_number 0x%x, serial_number_at_timeout 0x%x, retries %d, allowed %d\n", | 9201 | " serial_number 0x%x, retries %d, allowed %d\n", |
9202 | (unsigned) s->serial_number, (unsigned) s->serial_number_at_timeout, | 9202 | (unsigned) s->serial_number, s->retries, s->allowed); |
9203 | s->retries, s->allowed); | ||
9204 | 9203 | ||
9205 | printk( | 9204 | printk( |
9206 | " timeout_per_command %d, timeout_total %d, timeout %d\n", | 9205 | " timeout_per_command %d, timeout_total %d, timeout %d\n", |
9207 | s->timeout_per_command, s->timeout_total, s->timeout); | 9206 | s->timeout_per_command, s->timeout_total, s->timeout); |
9208 | 9207 | ||
9209 | printk(" internal_timeout %u\n", s->internal_timeout); | ||
9210 | |||
9211 | printk( | 9208 | printk( |
9212 | " scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n", | 9209 | " scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n", |
9213 | (ulong) s->scsi_done, (ulong) s->done, | 9210 | (ulong) s->scsi_done, (ulong) s->done, |
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index d7b8efe8640..88d119f4b97 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c | |||
@@ -257,6 +257,7 @@ | |||
257 | #include <scsi/scsicam.h> | 257 | #include <scsi/scsicam.h> |
258 | 258 | ||
259 | #include "scsi.h" | 259 | #include "scsi.h" |
260 | #include <scsi/scsi_dbg.h> | ||
260 | #include <scsi/scsi_host.h> | 261 | #include <scsi/scsi_host.h> |
261 | #include "aha152x.h" | 262 | #include "aha152x.h" |
262 | 263 | ||
@@ -986,7 +987,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct semaphore *sem, int p | |||
986 | if (HOSTDATA(shpnt)->debug & debug_queue) { | 987 | if (HOSTDATA(shpnt)->debug & debug_queue) { |
987 | printk(INFO_LEAD "queue: %p; cmd_len=%d pieces=%d size=%u cmnd=", | 988 | printk(INFO_LEAD "queue: %p; cmd_len=%d pieces=%d size=%u cmnd=", |
988 | CMDINFO(SCpnt), SCpnt, SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen); | 989 | CMDINFO(SCpnt), SCpnt, SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen); |
989 | print_command(SCpnt->cmnd); | 990 | __scsi_print_command(SCpnt->cmnd); |
990 | } | 991 | } |
991 | #endif | 992 | #endif |
992 | 993 | ||
@@ -1560,7 +1561,7 @@ static void busfree_run(struct Scsi_Host *shpnt) | |||
1560 | #if 0 | 1561 | #if 0 |
1561 | if(HOSTDATA(shpnt)->debug & debug_eh) { | 1562 | if(HOSTDATA(shpnt)->debug & debug_eh) { |
1562 | printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC)); | 1563 | printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC)); |
1563 | print_sense("bh", DONE_SC); | 1564 | scsi_print_sense("bh", DONE_SC); |
1564 | } | 1565 | } |
1565 | #endif | 1566 | #endif |
1566 | 1567 | ||
@@ -1846,7 +1847,7 @@ static void msgi_run(struct Scsi_Host *shpnt) | |||
1846 | #if defined(AHA152X_DEBUG) | 1847 | #if defined(AHA152X_DEBUG) |
1847 | if (HOSTDATA(shpnt)->debug & debug_msgi) { | 1848 | if (HOSTDATA(shpnt)->debug & debug_msgi) { |
1848 | printk(INFO_LEAD "inbound message %02x ", CMDINFO(CURRENT_SC), MSGI(0)); | 1849 | printk(INFO_LEAD "inbound message %02x ", CMDINFO(CURRENT_SC), MSGI(0)); |
1849 | print_msg(&MSGI(0)); | 1850 | scsi_print_msg(&MSGI(0)); |
1850 | printk("\n"); | 1851 | printk("\n"); |
1851 | } | 1852 | } |
1852 | #endif | 1853 | #endif |
@@ -1934,7 +1935,7 @@ static void msgi_run(struct Scsi_Host *shpnt) | |||
1934 | break; | 1935 | break; |
1935 | 1936 | ||
1936 | printk(INFO_LEAD, CMDINFO(CURRENT_SC)); | 1937 | printk(INFO_LEAD, CMDINFO(CURRENT_SC)); |
1937 | print_msg(&MSGI(0)); | 1938 | scsi_print_msg(&MSGI(0)); |
1938 | printk("\n"); | 1939 | printk("\n"); |
1939 | 1940 | ||
1940 | ticks = (MSGI(3) * 4 + 49) / 50; | 1941 | ticks = (MSGI(3) * 4 + 49) / 50; |
@@ -2032,7 +2033,7 @@ static void msgo_init(struct Scsi_Host *shpnt) | |||
2032 | int i; | 2033 | int i; |
2033 | 2034 | ||
2034 | printk(DEBUG_LEAD "messages( ", CMDINFO(CURRENT_SC)); | 2035 | printk(DEBUG_LEAD "messages( ", CMDINFO(CURRENT_SC)); |
2035 | for (i=0; i<MSGOLEN; i+=print_msg(&MSGO(i)), printk(" ")) | 2036 | for (i=0; i<MSGOLEN; i+=scsi_print_msg(&MSGO(i)), printk(" ")) |
2036 | ; | 2037 | ; |
2037 | printk(")\n"); | 2038 | printk(")\n"); |
2038 | } | 2039 | } |
@@ -2104,7 +2105,7 @@ static void cmd_init(struct Scsi_Host *shpnt) | |||
2104 | #if defined(AHA152X_DEBUG) | 2105 | #if defined(AHA152X_DEBUG) |
2105 | if (HOSTDATA(shpnt)->debug & debug_cmd) { | 2106 | if (HOSTDATA(shpnt)->debug & debug_cmd) { |
2106 | printk(DEBUG_LEAD "cmd_init: ", CMDINFO(CURRENT_SC)); | 2107 | printk(DEBUG_LEAD "cmd_init: ", CMDINFO(CURRENT_SC)); |
2107 | print_command(CURRENT_SC->cmnd); | 2108 | __scsi_print_command(CURRENT_SC->cmnd); |
2108 | } | 2109 | } |
2109 | #endif | 2110 | #endif |
2110 | 2111 | ||
@@ -2158,7 +2159,7 @@ static void status_run(struct Scsi_Host *shpnt) | |||
2158 | #if defined(AHA152X_DEBUG) | 2159 | #if defined(AHA152X_DEBUG) |
2159 | if (HOSTDATA(shpnt)->debug & debug_status) { | 2160 | if (HOSTDATA(shpnt)->debug & debug_status) { |
2160 | printk(DEBUG_LEAD "inbound status %02x ", CMDINFO(CURRENT_SC), CURRENT_SC->SCp.Status); | 2161 | printk(DEBUG_LEAD "inbound status %02x ", CMDINFO(CURRENT_SC), CURRENT_SC->SCp.Status); |
2161 | print_status(CURRENT_SC->SCp.Status); | 2162 | scsi_print_status(CURRENT_SC->SCp.Status); |
2162 | printk("\n"); | 2163 | printk("\n"); |
2163 | } | 2164 | } |
2164 | #endif | 2165 | #endif |
@@ -2925,7 +2926,7 @@ static void show_command(Scsi_Cmnd *ptr) | |||
2925 | printk(KERN_DEBUG "0x%08x: target=%d; lun=%d; cmnd=(", | 2926 | printk(KERN_DEBUG "0x%08x: target=%d; lun=%d; cmnd=(", |
2926 | (unsigned int) ptr, ptr->device->id, ptr->device->lun); | 2927 | (unsigned int) ptr, ptr->device->id, ptr->device->lun); |
2927 | 2928 | ||
2928 | print_command(ptr->cmnd); | 2929 | __scsi_print_command(ptr->cmnd); |
2929 | 2930 | ||
2930 | printk(KERN_DEBUG "); request_bufflen=%d; resid=%d; phase |", | 2931 | printk(KERN_DEBUG "); request_bufflen=%d; resid=%d; phase |", |
2931 | ptr->request_bufflen, ptr->resid); | 2932 | ptr->request_bufflen, ptr->resid); |
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c index 24dd0b890dd..be2caecbbdd 100644 --- a/drivers/scsi/arm/acornscsi.c +++ b/drivers/scsi/arm/acornscsi.c | |||
@@ -150,6 +150,7 @@ | |||
150 | #include <asm/ecard.h> | 150 | #include <asm/ecard.h> |
151 | 151 | ||
152 | #include "../scsi.h" | 152 | #include "../scsi.h" |
153 | #include <scsi/scsi_dbg.h> | ||
153 | #include <scsi/scsi_host.h> | 154 | #include <scsi/scsi_host.h> |
154 | #include "acornscsi.h" | 155 | #include "acornscsi.h" |
155 | #include "msgqueue.h" | 156 | #include "msgqueue.h" |
@@ -866,7 +867,7 @@ void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result) | |||
866 | default: | 867 | default: |
867 | printk(KERN_ERR "scsi%d.H: incomplete data transfer detected: result=%08X command=", | 868 | printk(KERN_ERR "scsi%d.H: incomplete data transfer detected: result=%08X command=", |
868 | host->host->host_no, SCpnt->result); | 869 | host->host->host_no, SCpnt->result); |
869 | print_command(SCpnt->cmnd); | 870 | __scsi_print_command(SCpnt->cmnd); |
870 | acornscsi_dumpdma(host, "done"); | 871 | acornscsi_dumpdma(host, "done"); |
871 | acornscsi_dumplog(host, SCpnt->device->id); | 872 | acornscsi_dumplog(host, SCpnt->device->id); |
872 | SCpnt->result &= 0xffff; | 873 | SCpnt->result &= 0xffff; |
@@ -1369,7 +1370,7 @@ void acornscsi_sendmessage(AS_Host *host) | |||
1369 | 1370 | ||
1370 | host->scsi.last_message = msg->msg[0]; | 1371 | host->scsi.last_message = msg->msg[0]; |
1371 | #if (DEBUG & DEBUG_MESSAGES) | 1372 | #if (DEBUG & DEBUG_MESSAGES) |
1372 | print_msg(msg->msg); | 1373 | scsi_print_msg(msg->msg); |
1373 | #endif | 1374 | #endif |
1374 | break; | 1375 | break; |
1375 | 1376 | ||
@@ -1391,7 +1392,7 @@ void acornscsi_sendmessage(AS_Host *host) | |||
1391 | while ((msg = msgqueue_getmsg(&host->scsi.msgs, msgnr++)) != NULL) { | 1392 | while ((msg = msgqueue_getmsg(&host->scsi.msgs, msgnr++)) != NULL) { |
1392 | unsigned int i; | 1393 | unsigned int i; |
1393 | #if (DEBUG & DEBUG_MESSAGES) | 1394 | #if (DEBUG & DEBUG_MESSAGES) |
1394 | print_msg(msg); | 1395 | scsi_print_msg(msg); |
1395 | #endif | 1396 | #endif |
1396 | i = 0; | 1397 | i = 0; |
1397 | if (acornscsi_write_pio(host, msg->msg, &i, msg->length, 1000000)) | 1398 | if (acornscsi_write_pio(host, msg->msg, &i, msg->length, 1000000)) |
@@ -1487,7 +1488,7 @@ void acornscsi_message(AS_Host *host) | |||
1487 | #if (DEBUG & DEBUG_MESSAGES) | 1488 | #if (DEBUG & DEBUG_MESSAGES) |
1488 | printk("scsi%d.%c: message in: ", | 1489 | printk("scsi%d.%c: message in: ", |
1489 | host->host->host_no, acornscsi_target(host)); | 1490 | host->host->host_no, acornscsi_target(host)); |
1490 | print_msg(message); | 1491 | scsi_print_msg(message); |
1491 | printk("\n"); | 1492 | printk("\n"); |
1492 | #endif | 1493 | #endif |
1493 | 1494 | ||
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c index 5411e850c83..0a172c1e9f7 100644 --- a/drivers/scsi/arm/fas216.c +++ b/drivers/scsi/arm/fas216.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <asm/ecard.h> | 52 | #include <asm/ecard.h> |
53 | 53 | ||
54 | #include "../scsi.h" | 54 | #include "../scsi.h" |
55 | #include <scsi/scsi_dbg.h> | ||
55 | #include <scsi/scsi_host.h> | 56 | #include <scsi/scsi_host.h> |
56 | #include "fas216.h" | 57 | #include "fas216.h" |
57 | #include "scsi.h" | 58 | #include "scsi.h" |
@@ -309,7 +310,7 @@ fas216_log_command(FAS216_Info *info, int level, Scsi_Cmnd *SCpnt, char *fmt, .. | |||
309 | va_end(args); | 310 | va_end(args); |
310 | 311 | ||
311 | printk(" CDB: "); | 312 | printk(" CDB: "); |
312 | print_command(SCpnt->cmnd); | 313 | __scsi_print_command(SCpnt->cmnd); |
313 | } | 314 | } |
314 | 315 | ||
315 | static void | 316 | static void |
@@ -2081,7 +2082,7 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result) | |||
2081 | info->host->host_no, '0' + SCpnt->device->id, | 2082 | info->host->host_no, '0' + SCpnt->device->id, |
2082 | SCpnt->result, info->scsi.SCp.ptr, | 2083 | SCpnt->result, info->scsi.SCp.ptr, |
2083 | info->scsi.SCp.this_residual); | 2084 | info->scsi.SCp.this_residual); |
2084 | print_command(SCpnt->cmnd); | 2085 | __scsi_print_command(SCpnt->cmnd); |
2085 | SCpnt->result &= ~(255 << 16); | 2086 | SCpnt->result &= ~(255 << 16); |
2086 | SCpnt->result |= DID_BAD_TARGET << 16; | 2087 | SCpnt->result |= DID_BAD_TARGET << 16; |
2087 | goto request_sense; | 2088 | goto request_sense; |
@@ -2170,7 +2171,7 @@ static void fas216_done(FAS216_Info *info, unsigned int result) | |||
2170 | info->host->host_no, '0' + SCpnt->device->id, | 2171 | info->host->host_no, '0' + SCpnt->device->id, |
2171 | info->scsi.SCp.ptr, info->scsi.SCp.this_residual); | 2172 | info->scsi.SCp.ptr, info->scsi.SCp.this_residual); |
2172 | info->scsi.SCp.ptr = NULL; | 2173 | info->scsi.SCp.ptr = NULL; |
2173 | print_command(SCpnt->cmnd); | 2174 | __scsi_print_command(SCpnt->cmnd); |
2174 | } | 2175 | } |
2175 | 2176 | ||
2176 | /* | 2177 | /* |
@@ -2426,7 +2427,7 @@ int fas216_eh_abort(Scsi_Cmnd *SCpnt) | |||
2426 | info->stats.aborts += 1; | 2427 | info->stats.aborts += 1; |
2427 | 2428 | ||
2428 | printk(KERN_WARNING "scsi%d: abort command ", info->host->host_no); | 2429 | printk(KERN_WARNING "scsi%d: abort command ", info->host->host_no); |
2429 | print_command(SCpnt->data_cmnd); | 2430 | __scsi_print_command(SCpnt->data_cmnd); |
2430 | 2431 | ||
2431 | print_debug_list(); | 2432 | print_debug_list(); |
2432 | fas216_dumpstate(info); | 2433 | fas216_dumpstate(info); |
diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h index 2f1b3f4bf95..48e1c4d9738 100644 --- a/drivers/scsi/arm/scsi.h +++ b/drivers/scsi/arm/scsi.h | |||
@@ -108,7 +108,7 @@ static inline void init_SCp(Scsi_Cmnd *SCpnt) | |||
108 | #if 0 //def BELT_AND_BRACES | 108 | #if 0 //def BELT_AND_BRACES |
109 | printk(KERN_WARNING "scsi%d.%c: zero length buffer passed for " | 109 | printk(KERN_WARNING "scsi%d.%c: zero length buffer passed for " |
110 | "command ", SCpnt->host->host_no, '0' + SCpnt->target); | 110 | "command ", SCpnt->host->host_no, '0' + SCpnt->target); |
111 | print_command(SCpnt->cmnd); | 111 | __scsi_print_command(SCpnt->cmnd); |
112 | #endif | 112 | #endif |
113 | SCpnt->SCp.ptr = NULL; | 113 | SCpnt->SCp.ptr = NULL; |
114 | } | 114 | } |
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index 5d1e78ebed8..2c12be72c4c 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c | |||
@@ -73,6 +73,7 @@ | |||
73 | * 1. Test linked command handling code after Eric is ready with | 73 | * 1. Test linked command handling code after Eric is ready with |
74 | * the high level code. | 74 | * the high level code. |
75 | */ | 75 | */ |
76 | #include <scsi/scsi_dbg.h> | ||
76 | 77 | ||
77 | #if (NDEBUG & NDEBUG_LISTS) | 78 | #if (NDEBUG & NDEBUG_LISTS) |
78 | #define LIST(x,y) \ | 79 | #define LIST(x,y) \ |
@@ -2354,7 +2355,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) | |||
2354 | * 3..length+1 arguments | 2355 | * 3..length+1 arguments |
2355 | * | 2356 | * |
2356 | * Start the extended message buffer with the EXTENDED_MESSAGE | 2357 | * Start the extended message buffer with the EXTENDED_MESSAGE |
2357 | * byte, since print_msg() wants the whole thing. | 2358 | * byte, since scsi_print_msg() wants the whole thing. |
2358 | */ | 2359 | */ |
2359 | extended_msg[0] = EXTENDED_MESSAGE; | 2360 | extended_msg[0] = EXTENDED_MESSAGE; |
2360 | /* Accept first byte by clearing ACK */ | 2361 | /* Accept first byte by clearing ACK */ |
@@ -2407,7 +2408,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) | |||
2407 | default: | 2408 | default: |
2408 | if (!tmp) { | 2409 | if (!tmp) { |
2409 | printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); | 2410 | printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); |
2410 | print_msg (extended_msg); | 2411 | scsi_print_msg (extended_msg); |
2411 | printk("\n"); | 2412 | printk("\n"); |
2412 | } else if (tmp != EXTENDED_MESSAGE) | 2413 | } else if (tmp != EXTENDED_MESSAGE) |
2413 | printk(KERN_DEBUG "scsi%d: rejecting unknown " | 2414 | printk(KERN_DEBUG "scsi%d: rejecting unknown " |
@@ -2540,7 +2541,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance) | |||
2540 | 2541 | ||
2541 | if (!(msg[0] & 0x80)) { | 2542 | if (!(msg[0] & 0x80)) { |
2542 | printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); | 2543 | printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); |
2543 | print_msg(msg); | 2544 | scsi_print_msg(msg); |
2544 | do_abort(instance); | 2545 | do_abort(instance); |
2545 | return; | 2546 | return; |
2546 | } | 2547 | } |
@@ -2646,7 +2647,7 @@ int NCR5380_abort (Scsi_Cmnd *cmd) | |||
2646 | unsigned long flags; | 2647 | unsigned long flags; |
2647 | 2648 | ||
2648 | printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO); | 2649 | printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO); |
2649 | print_Scsi_Cmnd (cmd); | 2650 | scsi_print_command(cmd); |
2650 | 2651 | ||
2651 | NCR5380_print_status (instance); | 2652 | NCR5380_print_status (instance); |
2652 | 2653 | ||
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c index d625fdebe05..ec161733a82 100644 --- a/drivers/scsi/constants.c +++ b/drivers/scsi/constants.c | |||
@@ -372,7 +372,7 @@ static void scsi_print_cdb(unsigned char *cdb, int cdb_len, int start_of_line) | |||
372 | 372 | ||
373 | /** | 373 | /** |
374 | * | 374 | * |
375 | * print_status - print scsi status description | 375 | * scsi_print_status - print scsi status description |
376 | * @scsi_status: scsi status value | 376 | * @scsi_status: scsi status value |
377 | * | 377 | * |
378 | * If the status is recognized, the description is printed. | 378 | * If the status is recognized, the description is printed. |
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index e46096da8db..47c263e5cd3 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c | |||
@@ -833,13 +833,6 @@ ips_eh_abort(Scsi_Cmnd * SC) | |||
833 | if (!ha->active) | 833 | if (!ha->active) |
834 | return (FAILED); | 834 | return (FAILED); |
835 | 835 | ||
836 | if (SC->serial_number != SC->serial_number_at_timeout) { | ||
837 | /* HMM, looks like a bogus command */ | ||
838 | DEBUG(1, "Abort called with bogus scsi command"); | ||
839 | |||
840 | return (FAILED); | ||
841 | } | ||
842 | |||
843 | /* See if the command is on the copp queue */ | 836 | /* See if the command is on the copp queue */ |
844 | item = ha->copp_waitlist.head; | 837 | item = ha->copp_waitlist.head; |
845 | while ((item) && (item->scsi_cmd != SC)) | 838 | while ((item) && (item->scsi_cmd != SC)) |
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 7ae13236788..2a0e42ec27d 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c | |||
@@ -7486,24 +7486,14 @@ static int ncr53c8xx_abort(struct scsi_cmnd *cmd) | |||
7486 | struct scsi_cmnd *done_list; | 7486 | struct scsi_cmnd *done_list; |
7487 | 7487 | ||
7488 | #if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS | 7488 | #if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS |
7489 | printk("ncr53c8xx_abort: pid=%lu serial_number=%ld serial_number_at_timeout=%ld\n", | 7489 | printk("ncr53c8xx_abort: pid=%lu serial_number=%ld\n", |
7490 | cmd->pid, cmd->serial_number, cmd->serial_number_at_timeout); | 7490 | cmd->pid, cmd->serial_number); |
7491 | #else | 7491 | #else |
7492 | printk("ncr53c8xx_abort: command pid %lu\n", cmd->pid); | 7492 | printk("ncr53c8xx_abort: command pid %lu\n", cmd->pid); |
7493 | #endif | 7493 | #endif |
7494 | 7494 | ||
7495 | NCR_LOCK_NCB(np, flags); | 7495 | NCR_LOCK_NCB(np, flags); |
7496 | 7496 | ||
7497 | #if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS | ||
7498 | /* | ||
7499 | * We have to just ignore abort requests in some situations. | ||
7500 | */ | ||
7501 | if (cmd->serial_number != cmd->serial_number_at_timeout) { | ||
7502 | sts = SCSI_ABORT_NOT_RUNNING; | ||
7503 | goto out; | ||
7504 | } | ||
7505 | #endif | ||
7506 | |||
7507 | sts = ncr_abort_command(np, cmd); | 7497 | sts = ncr_abort_command(np, cmd); |
7508 | out: | 7498 | out: |
7509 | done_list = np->done_list; | 7499 | done_list = np->done_list; |
diff --git a/drivers/scsi/pci2000.c b/drivers/scsi/pci2000.c index 60ce1cce949..d58f303127f 100644 --- a/drivers/scsi/pci2000.c +++ b/drivers/scsi/pci2000.c | |||
@@ -438,8 +438,8 @@ int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) | |||
438 | if ( bus ) | 438 | if ( bus ) |
439 | { | 439 | { |
440 | 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])); | 440 | 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])); |
441 | DEB (if(*cdb) printk ("\ntimeout_per_command: %d, timeout_total: %d, timeout: %d, internal_timout: %d", SCpnt->timeout_per_command, | 441 | DEB (if(*cdb) printk ("\ntimeout_per_command: %d, timeout_total: %d, timeout: %d", SCpnt->timeout_per_command, |
442 | SCpnt->timeout_total, SCpnt->timeout, SCpnt->internal_timeout)); | 442 | SCpnt->timeout_total, SCpnt->timeout)); |
443 | outl (SCpnt->timeout_per_command, padapter->mb1); | 443 | outl (SCpnt->timeout_per_command, padapter->mb1); |
444 | outb_p (CMD_SCSI_TIMEOUT, padapter->cmd); | 444 | outb_p (CMD_SCSI_TIMEOUT, padapter->cmd); |
445 | if ( WaitReady (padapter) ) | 445 | if ( WaitReady (padapter) ) |
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index dcc33daa591..0e8ebbc56e8 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -1050,10 +1050,8 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd) | |||
1050 | for (i = 0; i < cmd->cmd_len; i++) { | 1050 | for (i = 0; i < cmd->cmd_len; i++) { |
1051 | printk("0x%02x ", cmd->cmnd[i]); | 1051 | printk("0x%02x ", cmd->cmnd[i]); |
1052 | } | 1052 | } |
1053 | printk("\n seg_cnt=%d, allowed=%d, retries=%d, " | 1053 | printk("\n seg_cnt=%d, allowed=%d, retries=%d\n", |
1054 | "serial_number_at_timeout=0x%lx\n", | 1054 | cmd->use_sg, cmd->allowed, cmd->retries); |
1055 | cmd->use_sg, cmd->allowed, cmd->retries, | ||
1056 | cmd->serial_number_at_timeout); | ||
1057 | printk(" request buffer=0x%p, request buffer len=0x%x\n", | 1055 | printk(" request buffer=0x%p, request buffer len=0x%x\n", |
1058 | cmd->request_buffer, cmd->request_bufflen); | 1056 | cmd->request_buffer, cmd->request_bufflen); |
1059 | printk(" tag=%d, transfersize=0x%x\n", | 1057 | printk(" tag=%d, transfersize=0x%x\n", |
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 2e7ab3ab099..05d2bd075fd 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c | |||
@@ -489,7 +489,7 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition) | |||
489 | scsi_print_command(cmd); | 489 | scsi_print_command(cmd); |
490 | if (status_byte(cmd->result) & CHECK_CONDITION) { | 490 | if (status_byte(cmd->result) & CHECK_CONDITION) { |
491 | /* | 491 | /* |
492 | * XXX The print_sense formatting/prefix | 492 | * XXX The scsi_print_sense formatting/prefix |
493 | * doesn't match this function. | 493 | * doesn't match this function. |
494 | */ | 494 | */ |
495 | scsi_print_sense("", cmd); | 495 | scsi_print_sense("", cmd); |
@@ -686,7 +686,6 @@ void scsi_init_cmd_from_req(struct scsi_cmnd *cmd, struct scsi_request *sreq) | |||
686 | cmd->request = sreq->sr_request; | 686 | cmd->request = sreq->sr_request; |
687 | memcpy(cmd->data_cmnd, sreq->sr_cmnd, sizeof(cmd->data_cmnd)); | 687 | memcpy(cmd->data_cmnd, sreq->sr_cmnd, sizeof(cmd->data_cmnd)); |
688 | cmd->serial_number = 0; | 688 | cmd->serial_number = 0; |
689 | cmd->serial_number_at_timeout = 0; | ||
690 | cmd->bufflen = sreq->sr_bufflen; | 689 | cmd->bufflen = sreq->sr_bufflen; |
691 | cmd->buffer = sreq->sr_buffer; | 690 | cmd->buffer = sreq->sr_buffer; |
692 | cmd->retries = 0; | 691 | cmd->retries = 0; |
@@ -716,7 +715,6 @@ void scsi_init_cmd_from_req(struct scsi_cmnd *cmd, struct scsi_request *sreq) | |||
716 | /* | 715 | /* |
717 | * Start the timer ticking. | 716 | * Start the timer ticking. |
718 | */ | 717 | */ |
719 | cmd->internal_timeout = NORMAL_TIMEOUT; | ||
720 | cmd->abort_reason = 0; | 718 | cmd->abort_reason = 0; |
721 | cmd->result = 0; | 719 | cmd->result = 0; |
722 | 720 | ||
@@ -766,7 +764,6 @@ void __scsi_done(struct scsi_cmnd *cmd) | |||
766 | * Set the serial numbers back to zero | 764 | * Set the serial numbers back to zero |
767 | */ | 765 | */ |
768 | cmd->serial_number = 0; | 766 | cmd->serial_number = 0; |
769 | cmd->serial_number_at_timeout = 0; | ||
770 | cmd->state = SCSI_STATE_BHQUEUE; | 767 | cmd->state = SCSI_STATE_BHQUEUE; |
771 | cmd->owner = SCSI_OWNER_BH_HANDLER; | 768 | cmd->owner = SCSI_OWNER_BH_HANDLER; |
772 | 769 | ||
diff --git a/drivers/scsi/scsi.h b/drivers/scsi/scsi.h index cb6b5fbb7e1..e2360c26ef0 100644 --- a/drivers/scsi/scsi.h +++ b/drivers/scsi/scsi.h | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/config.h> /* for CONFIG_SCSI_LOGGING */ | 23 | #include <linux/config.h> /* for CONFIG_SCSI_LOGGING */ |
24 | 24 | ||
25 | #include <scsi/scsi_cmnd.h> | 25 | #include <scsi/scsi_cmnd.h> |
26 | #include <scsi/scsi_dbg.h> | ||
27 | #include <scsi/scsi_device.h> | 26 | #include <scsi/scsi_device.h> |
28 | #include <scsi/scsi_eh.h> | 27 | #include <scsi/scsi_eh.h> |
29 | #include <scsi/scsi_request.h> | 28 | #include <scsi/scsi_request.h> |
@@ -61,48 +60,6 @@ struct scatterlist; | |||
61 | #define scsi_to_pci_dma_dir(scsi_dir) ((int)(scsi_dir)) | 60 | #define scsi_to_pci_dma_dir(scsi_dir) ((int)(scsi_dir)) |
62 | #define scsi_to_sbus_dma_dir(scsi_dir) ((int)(scsi_dir)) | 61 | #define scsi_to_sbus_dma_dir(scsi_dir) ((int)(scsi_dir)) |
63 | 62 | ||
64 | /* | ||
65 | * Old names for debug prettyprinting functions. | ||
66 | */ | ||
67 | static inline void print_Scsi_Cmnd(struct scsi_cmnd *cmd) | ||
68 | { | ||
69 | return scsi_print_command(cmd); | ||
70 | } | ||
71 | static inline void print_command(unsigned char *cdb) | ||
72 | { | ||
73 | return __scsi_print_command(cdb); | ||
74 | } | ||
75 | static inline void print_sense(const char *devclass, struct scsi_cmnd *cmd) | ||
76 | { | ||
77 | return scsi_print_sense(devclass, cmd); | ||
78 | } | ||
79 | static inline void print_req_sense(const char *devclass, struct scsi_request *req) | ||
80 | { | ||
81 | return scsi_print_req_sense(devclass, req); | ||
82 | } | ||
83 | static inline void print_driverbyte(int scsiresult) | ||
84 | { | ||
85 | return scsi_print_driverbyte(scsiresult); | ||
86 | } | ||
87 | static inline void print_hostbyte(int scsiresult) | ||
88 | { | ||
89 | return scsi_print_hostbyte(scsiresult); | ||
90 | } | ||
91 | static inline void print_status(unsigned char status) | ||
92 | { | ||
93 | return scsi_print_status(status); | ||
94 | } | ||
95 | static inline int print_msg(const unsigned char *msg) | ||
96 | { | ||
97 | return scsi_print_msg(msg); | ||
98 | } | ||
99 | |||
100 | /* | ||
101 | * This is the crap from the old error handling code. We have it in a special | ||
102 | * place so that we can more easily delete it later on. | ||
103 | */ | ||
104 | #include "scsi_obsolete.h" | ||
105 | |||
106 | /* obsolete typedef junk. */ | 63 | /* obsolete typedef junk. */ |
107 | #include "scsi_typedefs.h" | 64 | #include "scsi_typedefs.h" |
108 | 65 | ||
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 9bc597bd13b..1a135f38e78 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -79,11 +79,6 @@ int scsi_eh_scmd_add(struct scsi_cmnd *scmd, int eh_flag) | |||
79 | */ | 79 | */ |
80 | scmd->owner = SCSI_OWNER_ERROR_HANDLER; | 80 | scmd->owner = SCSI_OWNER_ERROR_HANDLER; |
81 | scmd->state = SCSI_STATE_FAILED; | 81 | scmd->state = SCSI_STATE_FAILED; |
82 | /* | ||
83 | * Set the serial_number_at_timeout to the current | ||
84 | * serial_number | ||
85 | */ | ||
86 | scmd->serial_number_at_timeout = scmd->serial_number; | ||
87 | list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q); | 82 | list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q); |
88 | set_bit(SHOST_RECOVERY, &shost->shost_state); | 83 | set_bit(SHOST_RECOVERY, &shost->shost_state); |
89 | shost->host_failed++; | 84 | shost->host_failed++; |
@@ -481,7 +476,8 @@ static void scsi_eh_done(struct scsi_cmnd *scmd) | |||
481 | **/ | 476 | **/ |
482 | static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) | 477 | static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) |
483 | { | 478 | { |
484 | struct Scsi_Host *host = scmd->device->host; | 479 | struct scsi_device *sdev = scmd->device; |
480 | struct Scsi_Host *shost = sdev->host; | ||
485 | DECLARE_MUTEX_LOCKED(sem); | 481 | DECLARE_MUTEX_LOCKED(sem); |
486 | unsigned long flags; | 482 | unsigned long flags; |
487 | int rtn = SUCCESS; | 483 | int rtn = SUCCESS; |
@@ -492,27 +488,27 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) | |||
492 | */ | 488 | */ |
493 | scmd->owner = SCSI_OWNER_LOWLEVEL; | 489 | scmd->owner = SCSI_OWNER_LOWLEVEL; |
494 | 490 | ||
495 | if (scmd->device->scsi_level <= SCSI_2) | 491 | if (sdev->scsi_level <= SCSI_2) |
496 | scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) | | 492 | scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) | |
497 | (scmd->device->lun << 5 & 0xe0); | 493 | (sdev->lun << 5 & 0xe0); |
498 | 494 | ||
499 | scsi_add_timer(scmd, timeout, scsi_eh_times_out); | 495 | scsi_add_timer(scmd, timeout, scsi_eh_times_out); |
500 | 496 | ||
501 | /* | 497 | /* |
502 | * set up the semaphore so we wait for the command to complete. | 498 | * set up the semaphore so we wait for the command to complete. |
503 | */ | 499 | */ |
504 | scmd->device->host->eh_action = &sem; | 500 | shost->eh_action = &sem; |
505 | scmd->request->rq_status = RQ_SCSI_BUSY; | 501 | scmd->request->rq_status = RQ_SCSI_BUSY; |
506 | 502 | ||
507 | spin_lock_irqsave(scmd->device->host->host_lock, flags); | 503 | spin_lock_irqsave(shost->host_lock, flags); |
508 | scsi_log_send(scmd); | 504 | scsi_log_send(scmd); |
509 | host->hostt->queuecommand(scmd, scsi_eh_done); | 505 | shost->hostt->queuecommand(scmd, scsi_eh_done); |
510 | spin_unlock_irqrestore(scmd->device->host->host_lock, flags); | 506 | spin_unlock_irqrestore(shost->host_lock, flags); |
511 | 507 | ||
512 | down(&sem); | 508 | down(&sem); |
513 | scsi_log_completion(scmd, SUCCESS); | 509 | scsi_log_completion(scmd, SUCCESS); |
514 | 510 | ||
515 | scmd->device->host->eh_action = NULL; | 511 | shost->eh_action = NULL; |
516 | 512 | ||
517 | /* | 513 | /* |
518 | * see if timeout. if so, tell the host to forget about it. | 514 | * see if timeout. if so, tell the host to forget about it. |
@@ -532,10 +528,10 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) | |||
532 | * abort a timed out command or not. not sure how | 528 | * abort a timed out command or not. not sure how |
533 | * we should treat them differently anyways. | 529 | * we should treat them differently anyways. |
534 | */ | 530 | */ |
535 | spin_lock_irqsave(scmd->device->host->host_lock, flags); | 531 | spin_lock_irqsave(shost->host_lock, flags); |
536 | if (scmd->device->host->hostt->eh_abort_handler) | 532 | if (shost->hostt->eh_abort_handler) |
537 | scmd->device->host->hostt->eh_abort_handler(scmd); | 533 | shost->hostt->eh_abort_handler(scmd); |
538 | spin_unlock_irqrestore(scmd->device->host->host_lock, flags); | 534 | spin_unlock_irqrestore(shost->host_lock, flags); |
539 | 535 | ||
540 | scmd->request->rq_status = RQ_SCSI_DONE; | 536 | scmd->request->rq_status = RQ_SCSI_DONE; |
541 | scmd->owner = SCSI_OWNER_ERROR_HANDLER; | 537 | scmd->owner = SCSI_OWNER_ERROR_HANDLER; |
@@ -1061,7 +1057,6 @@ static int scsi_try_bus_reset(struct scsi_cmnd *scmd) | |||
1061 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n", | 1057 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n", |
1062 | __FUNCTION__)); | 1058 | __FUNCTION__)); |
1063 | scmd->owner = SCSI_OWNER_LOWLEVEL; | 1059 | scmd->owner = SCSI_OWNER_LOWLEVEL; |
1064 | scmd->serial_number_at_timeout = scmd->serial_number; | ||
1065 | 1060 | ||
1066 | if (!scmd->device->host->hostt->eh_bus_reset_handler) | 1061 | if (!scmd->device->host->hostt->eh_bus_reset_handler) |
1067 | return FAILED; | 1062 | return FAILED; |
@@ -1093,7 +1088,6 @@ static int scsi_try_host_reset(struct scsi_cmnd *scmd) | |||
1093 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n", | 1088 | SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n", |
1094 | __FUNCTION__)); | 1089 | __FUNCTION__)); |
1095 | scmd->owner = SCSI_OWNER_LOWLEVEL; | 1090 | scmd->owner = SCSI_OWNER_LOWLEVEL; |
1096 | scmd->serial_number_at_timeout = scmd->serial_number; | ||
1097 | 1091 | ||
1098 | if (!scmd->device->host->hostt->eh_host_reset_handler) | 1092 | if (!scmd->device->host->hostt->eh_host_reset_handler) |
1099 | return FAILED; | 1093 | return FAILED; |
@@ -1313,6 +1307,9 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) | |||
1313 | case DID_IMM_RETRY: | 1307 | case DID_IMM_RETRY: |
1314 | return NEEDS_RETRY; | 1308 | return NEEDS_RETRY; |
1315 | 1309 | ||
1310 | case DID_REQUEUE: | ||
1311 | return ADD_TO_MLQUEUE; | ||
1312 | |||
1316 | case DID_ERROR: | 1313 | case DID_ERROR: |
1317 | if (msg_byte(scmd->result) == COMMAND_COMPLETE && | 1314 | if (msg_byte(scmd->result) == COMMAND_COMPLETE && |
1318 | status_byte(scmd->result) == RESERVATION_CONFLICT) | 1315 | status_byte(scmd->result) == RESERVATION_CONFLICT) |
@@ -1839,7 +1836,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag) | |||
1839 | scmd->bufflen = 0; | 1836 | scmd->bufflen = 0; |
1840 | scmd->request_buffer = NULL; | 1837 | scmd->request_buffer = NULL; |
1841 | scmd->request_bufflen = 0; | 1838 | scmd->request_bufflen = 0; |
1842 | scmd->internal_timeout = NORMAL_TIMEOUT; | ||
1843 | scmd->abort_reason = DID_ABORT; | 1839 | scmd->abort_reason = DID_ABORT; |
1844 | 1840 | ||
1845 | scmd->cmd_len = 0; | 1841 | scmd->cmd_len = 0; |
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c index 68c9728dfbb..7a6b530115a 100644 --- a/drivers/scsi/scsi_ioctl.c +++ b/drivers/scsi/scsi_ioctl.c | |||
@@ -27,11 +27,6 @@ | |||
27 | 27 | ||
28 | #define NORMAL_RETRIES 5 | 28 | #define NORMAL_RETRIES 5 |
29 | #define IOCTL_NORMAL_TIMEOUT (10 * HZ) | 29 | #define IOCTL_NORMAL_TIMEOUT (10 * HZ) |
30 | #define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) | ||
31 | #define START_STOP_TIMEOUT (60 * HZ) | ||
32 | #define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) | ||
33 | #define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) | ||
34 | #define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) /* ZIP-250 on parallel port takes as long! */ | ||
35 | 30 | ||
36 | #define MAX_BUF PAGE_SIZE | 31 | #define MAX_BUF PAGE_SIZE |
37 | 32 | ||
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index d230c699c72..d18da21c9c5 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -298,7 +298,6 @@ static int scsi_init_cmd_errh(struct scsi_cmnd *cmd) | |||
298 | { | 298 | { |
299 | cmd->owner = SCSI_OWNER_MIDLEVEL; | 299 | cmd->owner = SCSI_OWNER_MIDLEVEL; |
300 | cmd->serial_number = 0; | 300 | cmd->serial_number = 0; |
301 | cmd->serial_number_at_timeout = 0; | ||
302 | cmd->abort_reason = 0; | 301 | cmd->abort_reason = 0; |
303 | 302 | ||
304 | memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer); | 303 | memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer); |
@@ -320,7 +319,6 @@ static int scsi_init_cmd_errh(struct scsi_cmnd *cmd) | |||
320 | memcpy(cmd->data_cmnd, cmd->cmnd, sizeof(cmd->cmnd)); | 319 | memcpy(cmd->data_cmnd, cmd->cmnd, sizeof(cmd->cmnd)); |
321 | cmd->buffer = cmd->request_buffer; | 320 | cmd->buffer = cmd->request_buffer; |
322 | cmd->bufflen = cmd->request_bufflen; | 321 | cmd->bufflen = cmd->request_bufflen; |
323 | cmd->internal_timeout = NORMAL_TIMEOUT; | ||
324 | cmd->abort_reason = 0; | 322 | cmd->abort_reason = 0; |
325 | 323 | ||
326 | return 1; | 324 | return 1; |
diff --git a/drivers/scsi/scsi_obsolete.h b/drivers/scsi/scsi_obsolete.h deleted file mode 100644 index abeacb996ea..00000000000 --- a/drivers/scsi/scsi_obsolete.h +++ /dev/null | |||
@@ -1,106 +0,0 @@ | |||
1 | /* | ||
2 | * scsi_obsolete.h Copyright (C) 1997 Eric Youngdale | ||
3 | * | ||
4 | */ | ||
5 | |||
6 | #ifndef _SCSI_OBSOLETE_H | ||
7 | #define _SCSI_OBSOLETE_H | ||
8 | |||
9 | /* | ||
10 | * These are the return codes for the abort and reset functions. The mid-level | ||
11 | * code uses these to decide what to do next. Each of the low level abort | ||
12 | * and reset functions must correctly indicate what it has done. | ||
13 | * The descriptions are written from the point of view of the mid-level code, | ||
14 | * so that the return code is telling the mid-level drivers exactly what | ||
15 | * the low level driver has already done, and what remains to be done. | ||
16 | */ | ||
17 | |||
18 | /* We did not do anything. | ||
19 | * Wait some more for this command to complete, and if this does not work, | ||
20 | * try something more serious. */ | ||
21 | #define SCSI_ABORT_SNOOZE 0 | ||
22 | |||
23 | /* This means that we were able to abort the command. We have already | ||
24 | * called the mid-level done function, and do not expect an interrupt that | ||
25 | * will lead to another call to the mid-level done function for this command */ | ||
26 | #define SCSI_ABORT_SUCCESS 1 | ||
27 | |||
28 | /* We called for an abort of this command, and we should get an interrupt | ||
29 | * when this succeeds. Thus we should not restore the timer for this | ||
30 | * command in the mid-level abort function. */ | ||
31 | #define SCSI_ABORT_PENDING 2 | ||
32 | |||
33 | /* Unable to abort - command is currently on the bus. Grin and bear it. */ | ||
34 | #define SCSI_ABORT_BUSY 3 | ||
35 | |||
36 | /* The command is not active in the low level code. Command probably | ||
37 | * finished. */ | ||
38 | #define SCSI_ABORT_NOT_RUNNING 4 | ||
39 | |||
40 | /* Something went wrong. The low level driver will indicate the correct | ||
41 | * error condition when it calls scsi_done, so the mid-level abort function | ||
42 | * can simply wait until this comes through */ | ||
43 | #define SCSI_ABORT_ERROR 5 | ||
44 | |||
45 | /* We do not know how to reset the bus, or we do not want to. Bummer. | ||
46 | * Anyway, just wait a little more for the command in question, and hope that | ||
47 | * it eventually finishes. If it never finishes, the SCSI device could | ||
48 | * hang, so use this with caution. */ | ||
49 | #define SCSI_RESET_SNOOZE 0 | ||
50 | |||
51 | /* We do not know how to reset the bus, or we do not want to. Bummer. | ||
52 | * We have given up on this ever completing. The mid-level code will | ||
53 | * request sense information to decide how to proceed from here. */ | ||
54 | #define SCSI_RESET_PUNT 1 | ||
55 | |||
56 | /* This means that we were able to reset the bus. We have restarted all of | ||
57 | * the commands that should be restarted, and we should be able to continue | ||
58 | * on normally from here. We do not expect any interrupts that will return | ||
59 | * DID_RESET to any of the other commands in the host_queue, and the mid-level | ||
60 | * code does not need to do anything special to keep the commands alive. | ||
61 | * If a hard reset was performed then all outstanding commands on the | ||
62 | * bus have been restarted. */ | ||
63 | #define SCSI_RESET_SUCCESS 2 | ||
64 | |||
65 | /* We called for a reset of this bus, and we should get an interrupt | ||
66 | * when this succeeds. Each command should get its own status | ||
67 | * passed up to scsi_done, but this has not happened yet. | ||
68 | * If a hard reset was performed, then we expect an interrupt | ||
69 | * for *each* of the outstanding commands that will have the | ||
70 | * effect of restarting the commands. | ||
71 | */ | ||
72 | #define SCSI_RESET_PENDING 3 | ||
73 | |||
74 | /* We did a reset, but do not expect an interrupt to signal DID_RESET. | ||
75 | * This tells the upper level code to request the sense info, and this | ||
76 | * should keep the command alive. */ | ||
77 | #define SCSI_RESET_WAKEUP 4 | ||
78 | |||
79 | /* The command is not active in the low level code. Command probably | ||
80 | finished. */ | ||
81 | #define SCSI_RESET_NOT_RUNNING 5 | ||
82 | |||
83 | /* Something went wrong, and we do not know how to fix it. */ | ||
84 | #define SCSI_RESET_ERROR 6 | ||
85 | |||
86 | #define SCSI_RESET_SYNCHRONOUS 0x01 | ||
87 | #define SCSI_RESET_ASYNCHRONOUS 0x02 | ||
88 | #define SCSI_RESET_SUGGEST_BUS_RESET 0x04 | ||
89 | #define SCSI_RESET_SUGGEST_HOST_RESET 0x08 | ||
90 | /* | ||
91 | * This is a bitmask that is ored with one of the above codes. | ||
92 | * It tells the mid-level code that we did a hard reset. | ||
93 | */ | ||
94 | #define SCSI_RESET_BUS_RESET 0x100 | ||
95 | /* | ||
96 | * This is a bitmask that is ored with one of the above codes. | ||
97 | * It tells the mid-level code that we did a host adapter reset. | ||
98 | */ | ||
99 | #define SCSI_RESET_HOST_RESET 0x200 | ||
100 | /* | ||
101 | * Used to mask off bits and to obtain the basic action that was | ||
102 | * performed. | ||
103 | */ | ||
104 | #define SCSI_RESET_ACTION 0xff | ||
105 | |||
106 | #endif /* SCSI_OBSOLETE_H */ | ||
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h index aca3b39fe71..c01580df447 100644 --- a/drivers/scsi/scsi_priv.h +++ b/drivers/scsi/scsi_priv.h | |||
@@ -30,11 +30,6 @@ struct Scsi_Host; | |||
30 | #define SCSI_REQ_MAGIC 0x75F6D354 | 30 | #define SCSI_REQ_MAGIC 0x75F6D354 |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * Flag bit for the internal_timeout array | ||
34 | */ | ||
35 | #define NORMAL_TIMEOUT 0 | ||
36 | |||
37 | /* | ||
38 | * Scsi Error Handler Flags | 33 | * Scsi Error Handler Flags |
39 | */ | 34 | */ |
40 | #define scsi_eh_eflags_chk(scp, flags) \ | 35 | #define scsi_eh_eflags_chk(scp, flags) \ |
diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c index b362ff2811d..4c95abb5405 100644 --- a/drivers/scsi/seagate.c +++ b/drivers/scsi/seagate.c | |||
@@ -103,6 +103,7 @@ | |||
103 | #include <asm/uaccess.h> | 103 | #include <asm/uaccess.h> |
104 | 104 | ||
105 | #include "scsi.h" | 105 | #include "scsi.h" |
106 | #include <scsi/scsi_dbg.h> | ||
106 | #include <scsi/scsi_host.h> | 107 | #include <scsi/scsi_host.h> |
107 | #include "seagate.h" | 108 | #include "seagate.h" |
108 | 109 | ||
@@ -746,7 +747,7 @@ static int internal_command (unsigned char target, unsigned char lun, | |||
746 | 747 | ||
747 | #if (DEBUG & PRINT_COMMAND) | 748 | #if (DEBUG & PRINT_COMMAND) |
748 | printk("scsi%d : target = %d, command = ", hostno, target); | 749 | printk("scsi%d : target = %d, command = ", hostno, target); |
749 | print_command((unsigned char *) cmnd); | 750 | __scsi_print_command((unsigned char *) cmnd); |
750 | #endif | 751 | #endif |
751 | 752 | ||
752 | #if (DEBUG & PHASE_RESELECT) | 753 | #if (DEBUG & PHASE_RESELECT) |
@@ -1553,7 +1554,7 @@ connect_loop: | |||
1553 | printk("\n"); | 1554 | printk("\n"); |
1554 | #endif | 1555 | #endif |
1555 | printk("scsi%d : status = ", hostno); | 1556 | printk("scsi%d : status = ", hostno); |
1556 | print_status(status); | 1557 | scsi_print_status(status); |
1557 | printk(" message = %02x\n", message); | 1558 | printk(" message = %02x\n", message); |
1558 | #endif | 1559 | #endif |
1559 | 1560 | ||
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 32de9aabcb9..ce8332297df 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -51,6 +51,7 @@ static int sg_version_num = 30533; /* 2 digits for each component */ | |||
51 | #include <linux/delay.h> | 51 | #include <linux/delay.h> |
52 | 52 | ||
53 | #include "scsi.h" | 53 | #include "scsi.h" |
54 | #include <scsi/scsi_dbg.h> | ||
54 | #include <scsi/scsi_host.h> | 55 | #include <scsi/scsi_host.h> |
55 | #include <scsi/scsi_driver.h> | 56 | #include <scsi/scsi_driver.h> |
56 | #include <scsi/scsi_ioctl.h> | 57 | #include <scsi/scsi_ioctl.h> |
@@ -1368,7 +1369,7 @@ sg_cmd_done(Scsi_Cmnd * SCpnt) | |||
1368 | if ((sdp->sgdebug > 0) && | 1369 | if ((sdp->sgdebug > 0) && |
1369 | ((CHECK_CONDITION == srp->header.masked_status) || | 1370 | ((CHECK_CONDITION == srp->header.masked_status) || |
1370 | (COMMAND_TERMINATED == srp->header.masked_status))) | 1371 | (COMMAND_TERMINATED == srp->header.masked_status))) |
1371 | print_req_sense("sg_cmd_done", SRpnt); | 1372 | scsi_print_req_sense("sg_cmd_done", SRpnt); |
1372 | 1373 | ||
1373 | /* Following if statement is a patch supplied by Eric Youngdale */ | 1374 | /* Following if statement is a patch supplied by Eric Youngdale */ |
1374 | if (driver_byte(SRpnt->sr_result) != 0 | 1375 | if (driver_byte(SRpnt->sr_result) != 0 |
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c index 90811390a37..7e19589e71a 100644 --- a/drivers/scsi/sun3_NCR5380.c +++ b/drivers/scsi/sun3_NCR5380.c | |||
@@ -69,6 +69,7 @@ | |||
69 | * finally replaced that by the *_PRINTK() macros. | 69 | * finally replaced that by the *_PRINTK() macros. |
70 | * | 70 | * |
71 | */ | 71 | */ |
72 | #include <scsi/scsi_dbg.h> | ||
72 | 73 | ||
73 | /* | 74 | /* |
74 | * Further development / testing that should be done : | 75 | * Further development / testing that should be done : |
@@ -2377,7 +2378,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) | |||
2377 | * 3..length+1 arguments | 2378 | * 3..length+1 arguments |
2378 | * | 2379 | * |
2379 | * Start the extended message buffer with the EXTENDED_MESSAGE | 2380 | * Start the extended message buffer with the EXTENDED_MESSAGE |
2380 | * byte, since print_msg() wants the whole thing. | 2381 | * byte, since scsi_print_msg() wants the whole thing. |
2381 | */ | 2382 | */ |
2382 | extended_msg[0] = EXTENDED_MESSAGE; | 2383 | extended_msg[0] = EXTENDED_MESSAGE; |
2383 | /* Accept first byte by clearing ACK */ | 2384 | /* Accept first byte by clearing ACK */ |
@@ -2430,7 +2431,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) | |||
2430 | default: | 2431 | default: |
2431 | if (!tmp) { | 2432 | if (!tmp) { |
2432 | printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); | 2433 | printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); |
2433 | print_msg (extended_msg); | 2434 | scsi_print_msg (extended_msg); |
2434 | printk("\n"); | 2435 | printk("\n"); |
2435 | } else if (tmp != EXTENDED_MESSAGE) | 2436 | } else if (tmp != EXTENDED_MESSAGE) |
2436 | printk(KERN_DEBUG "scsi%d: rejecting unknown " | 2437 | printk(KERN_DEBUG "scsi%d: rejecting unknown " |
@@ -2565,7 +2566,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance) | |||
2565 | 2566 | ||
2566 | if (!(msg[0] & 0x80)) { | 2567 | if (!(msg[0] & 0x80)) { |
2567 | printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); | 2568 | printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); |
2568 | print_msg(msg); | 2569 | scsi_print_msg(msg); |
2569 | do_abort(instance); | 2570 | do_abort(instance); |
2570 | return; | 2571 | return; |
2571 | } | 2572 | } |
@@ -2691,7 +2692,7 @@ static int NCR5380_abort (Scsi_Cmnd *cmd) | |||
2691 | unsigned long flags; | 2692 | unsigned long flags; |
2692 | 2693 | ||
2693 | printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO); | 2694 | printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO); |
2694 | print_Scsi_Cmnd (cmd); | 2695 | scsi_print_command(cmd); |
2695 | 2696 | ||
2696 | NCR5380_print_status (instance); | 2697 | NCR5380_print_status (instance); |
2697 | 2698 | ||
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c index a1dff6d437b..5ff83d214f1 100644 --- a/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c | |||
@@ -799,12 +799,6 @@ static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd) | |||
799 | 799 | ||
800 | dev_warn(&cmd->device->sdev_gendev, "%s operation started.\n", opname); | 800 | dev_warn(&cmd->device->sdev_gendev, "%s operation started.\n", opname); |
801 | 801 | ||
802 | #if 0 | ||
803 | /* This one should be the result of some race, thus to ignore */ | ||
804 | if (cmd->serial_number != cmd->serial_number_at_timeout) | ||
805 | goto prepare; | ||
806 | #endif | ||
807 | |||
808 | /* This one is queued in some place -> to wait for completion */ | 802 | /* This one is queued in some place -> to wait for completion */ |
809 | FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) { | 803 | FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) { |
810 | struct sym_ccb *cp = sym_que_entry(qp, struct sym_ccb, link_ccbq); | 804 | struct sym_ccb *cp = sym_que_entry(qp, struct sym_ccb, link_ccbq); |
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c index 7484916fe2a..a00095cc74c 100644 --- a/drivers/scsi/ultrastor.c +++ b/drivers/scsi/ultrastor.c | |||
@@ -945,7 +945,7 @@ static int ultrastor_abort(Scsi_Cmnd *SCpnt) | |||
945 | config.mscp[mscp_index].SCint, SCpnt); | 945 | config.mscp[mscp_index].SCint, SCpnt); |
946 | #endif | 946 | #endif |
947 | if (config.mscp[mscp_index].SCint == 0) | 947 | if (config.mscp[mscp_index].SCint == 0) |
948 | return SCSI_ABORT_NOT_RUNNING; | 948 | return FAILURE; |
949 | 949 | ||
950 | if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort"); | 950 | if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort"); |
951 | config.mscp[mscp_index].SCint = NULL; | 951 | config.mscp[mscp_index].SCint = NULL; |
@@ -1020,7 +1020,7 @@ static int ultrastor_host_reset(Scsi_Cmnd * SCpnt) | |||
1020 | #endif | 1020 | #endif |
1021 | 1021 | ||
1022 | spin_unlock_irqrestore(host->host_lock, flags); | 1022 | spin_unlock_irqrestore(host->host_lock, flags); |
1023 | return SCSI_RESET_SUCCESS; | 1023 | return SUCCESS; |
1024 | 1024 | ||
1025 | } | 1025 | } |
1026 | 1026 | ||
diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c index de0d32f6618..cab89a970c7 100644 --- a/drivers/usb/image/microtek.c +++ b/drivers/usb/image/microtek.c | |||
@@ -335,7 +335,7 @@ static int mts_scsi_abort (Scsi_Cmnd *srb) | |||
335 | 335 | ||
336 | mts_urb_abort(desc); | 336 | mts_urb_abort(desc); |
337 | 337 | ||
338 | return SCSI_ABORT_PENDING; | 338 | return FAILURE; |
339 | } | 339 | } |
340 | 340 | ||
341 | static int mts_scsi_host_reset (Scsi_Cmnd *srb) | 341 | static int mts_scsi_host_reset (Scsi_Cmnd *srb) |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 1d54c063ae5..659ecf48fb4 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -295,6 +295,8 @@ struct scsi_lun { | |||
295 | #define DID_PASSTHROUGH 0x0a /* Force command past mid-layer */ | 295 | #define DID_PASSTHROUGH 0x0a /* Force command past mid-layer */ |
296 | #define DID_SOFT_ERROR 0x0b /* The low level driver just wish a retry */ | 296 | #define DID_SOFT_ERROR 0x0b /* The low level driver just wish a retry */ |
297 | #define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */ | 297 | #define DID_IMM_RETRY 0x0c /* Retry without decrementing retry count */ |
298 | #define DID_REQUEUE 0x0d /* Requeue command (no immediate retry) also | ||
299 | * without decrementing the retry count */ | ||
298 | #define DRIVER_OK 0x00 /* Driver status */ | 300 | #define DRIVER_OK 0x00 /* Driver status */ |
299 | 301 | ||
300 | /* | 302 | /* |
@@ -360,6 +362,15 @@ struct scsi_lun { | |||
360 | #define sense_error(sense) ((sense) & 0xf) | 362 | #define sense_error(sense) ((sense) & 0xf) |
361 | #define sense_valid(sense) ((sense) & 0x80); | 363 | #define sense_valid(sense) ((sense) & 0x80); |
362 | 364 | ||
365 | /* | ||
366 | * default timeouts | ||
367 | */ | ||
368 | #define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ) | ||
369 | #define START_STOP_TIMEOUT (60 * HZ) | ||
370 | #define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ) | ||
371 | #define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ) | ||
372 | #define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) | ||
373 | |||
363 | 374 | ||
364 | #define IDENTIFY_BASE 0x80 | 375 | #define IDENTIFY_BASE 0x80 |
365 | #define IDENTIFY(can_disconnect, lun) (IDENTIFY_BASE |\ | 376 | #define IDENTIFY(can_disconnect, lun) (IDENTIFY_BASE |\ |
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index 9d9871c28ab..07f5c699eaa 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -43,21 +43,17 @@ struct scsi_cmnd { | |||
43 | void (*done) (struct scsi_cmnd *); /* Mid-level done function */ | 43 | void (*done) (struct scsi_cmnd *); /* Mid-level done function */ |
44 | 44 | ||
45 | /* | 45 | /* |
46 | * A SCSI Command is assigned a nonzero serial_number when internal_cmnd | 46 | * A SCSI Command is assigned a nonzero serial_number before passed |
47 | * passes it to the driver's queue command function. The serial_number | 47 | * to the driver's queue command function. The serial_number is |
48 | * is cleared when scsi_done is entered indicating that the command has | 48 | * cleared when scsi_done is entered indicating that the command |
49 | * been completed. If a timeout occurs, the serial number at the moment | 49 | * has been completed. It currently doesn't have much use other |
50 | * of timeout is copied into serial_number_at_timeout. By subsequently | 50 | * than printk's. Some lldd's use this number for other purposes. |
51 | * comparing the serial_number and serial_number_at_timeout fields | 51 | * It's almost certain that such usages are either incorrect or |
52 | * during abort or reset processing, we can detect whether the command | 52 | * meaningless. Please kill all usages other than printk's. Also, |
53 | * has already completed. This also detects cases where the command has | 53 | * as this number is always identical to ->pid, please convert |
54 | * completed and the SCSI Command structure has already being reused | 54 | * printk's to use ->pid, so that we can kill this field. |
55 | * for another command, so that we can avoid incorrectly aborting or | ||
56 | * resetting the new command. | ||
57 | * The serial number is only unique per host. | ||
58 | */ | 55 | */ |
59 | unsigned long serial_number; | 56 | unsigned long serial_number; |
60 | unsigned long serial_number_at_timeout; | ||
61 | 57 | ||
62 | int retries; | 58 | int retries; |
63 | int allowed; | 59 | int allowed; |
@@ -65,12 +61,6 @@ struct scsi_cmnd { | |||
65 | int timeout_total; | 61 | int timeout_total; |
66 | int timeout; | 62 | int timeout; |
67 | 63 | ||
68 | /* | ||
69 | * We handle the timeout differently if it happens when a reset, | ||
70 | * abort, etc are in process. | ||
71 | */ | ||
72 | unsigned volatile char internal_timeout; | ||
73 | |||
74 | unsigned char cmd_len; | 64 | unsigned char cmd_len; |
75 | unsigned char old_cmd_len; | 65 | unsigned char old_cmd_len; |
76 | enum dma_data_direction sc_data_direction; | 66 | enum dma_data_direction sc_data_direction; |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index fe9571d2e30..c018020d916 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -44,7 +44,8 @@ struct scsi_device { | |||
44 | struct list_head same_target_siblings; /* just the devices sharing same target id */ | 44 | struct list_head same_target_siblings; /* just the devices sharing same target id */ |
45 | 45 | ||
46 | /* this is now protected by the request_queue->queue_lock */ | 46 | /* this is now protected by the request_queue->queue_lock */ |
47 | volatile unsigned short device_busy; /* commands actually active on low-level */ | 47 | unsigned int device_busy; /* commands actually active on |
48 | * low-level. protected by queue_lock. */ | ||
48 | spinlock_t list_lock; | 49 | spinlock_t list_lock; |
49 | struct list_head cmd_list; /* queue of in use SCSI Command structures */ | 50 | struct list_head cmd_list; /* queue of in use SCSI Command structures */ |
50 | struct list_head starved_entry; | 51 | struct list_head starved_entry; |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 27f2c4e8943..1cee1e10094 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -448,8 +448,14 @@ struct Scsi_Host { | |||
448 | wait_queue_head_t host_wait; | 448 | wait_queue_head_t host_wait; |
449 | struct scsi_host_template *hostt; | 449 | struct scsi_host_template *hostt; |
450 | struct scsi_transport_template *transportt; | 450 | struct scsi_transport_template *transportt; |
451 | volatile unsigned short host_busy; /* commands actually active on low-level */ | 451 | |
452 | volatile unsigned short host_failed; /* commands that failed. */ | 452 | /* |
453 | * The following two fields are protected with host_lock; | ||
454 | * however, eh routines can safely access during eh processing | ||
455 | * without acquiring the lock. | ||
456 | */ | ||
457 | unsigned int host_busy; /* commands actually active on low-level */ | ||
458 | unsigned int host_failed; /* commands that failed. */ | ||
453 | 459 | ||
454 | unsigned short host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */ | 460 | unsigned short host_no; /* Used for IOCTL_GET_IDLUN, /proc/scsi et al. */ |
455 | int resetting; /* if set, it means that last_reset is a valid value */ | 461 | int resetting; /* if set, it means that last_reset is a valid value */ |