aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2005-04-23 02:47:27 -0400
committerJames Bottomley <jejb@mulgrave.(none)>2005-05-20 13:53:25 -0400
commit354d6b2196c8e53e55e8f169804256ab9c72731d (patch)
tree2bdbd7618c154ab2614e6d1573cd0c348072d370 /drivers/scsi/qla2xxx/qla_os.c
parentb86fff7368b139171edab66972ea1309092f519e (diff)
[SCSI] remove some dead code in qla2xxx
Original from: Christoph Hellwig <hch@lst.de> Modified and Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c79
1 files changed, 8 insertions, 71 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 579448222d69..7f8d747bd5e5 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -36,27 +36,12 @@ char qla2x00_version_str[40];
36/* 36/*
37 * SRB allocation cache 37 * SRB allocation cache
38 */ 38 */
39char srb_cachep_name[16]; 39static kmem_cache_t *srb_cachep;
40kmem_cache_t *srb_cachep;
41
42/*
43 * Stats for all adpaters.
44 */
45struct _qla2x00stats qla2x00_stats;
46 40
47/* 41/*
48 * Ioctl related information. 42 * Ioctl related information.
49 */ 43 */
50int num_hosts; 44static int num_hosts;
51int apiHBAInstance;
52
53/*
54 * Module parameter information and variables
55 */
56int ql2xmaxqdepth;
57module_param(ql2xmaxqdepth, int, S_IRUGO|S_IWUSR);
58MODULE_PARM_DESC(ql2xmaxqdepth,
59 "Maximum queue depth to report for target devices.");
60 45
61int ql2xlogintimeout = 20; 46int ql2xlogintimeout = 20;
62module_param(ql2xlogintimeout, int, S_IRUGO|S_IRUSR); 47module_param(ql2xlogintimeout, int, S_IRUGO|S_IRUSR);
@@ -69,12 +54,6 @@ MODULE_PARM_DESC(qlport_down_retry,
69 "Maximum number of command retries to a port that returns" 54 "Maximum number of command retries to a port that returns"
70 "a PORT-DOWN status."); 55 "a PORT-DOWN status.");
71 56
72int ql2xretrycount = 20;
73module_param(ql2xretrycount, int, S_IRUGO|S_IWUSR);
74MODULE_PARM_DESC(ql2xretrycount,
75 "Maximum number of mid-layer retries allowed for a command. "
76 "Default value is 20, ");
77
78int ql2xplogiabsentdevice; 57int ql2xplogiabsentdevice;
79module_param(ql2xplogiabsentdevice, int, S_IRUGO|S_IWUSR); 58module_param(ql2xplogiabsentdevice, int, S_IRUGO|S_IWUSR);
80MODULE_PARM_DESC(ql2xplogiabsentdevice, 59MODULE_PARM_DESC(ql2xplogiabsentdevice,
@@ -95,25 +74,6 @@ MODULE_PARM_DESC(ql2xintrdelaytimer,
95 "ZIO: Waiting time for Firmware before it generates an " 74 "ZIO: Waiting time for Firmware before it generates an "
96 "interrupt to the host to notify completion of request."); 75 "interrupt to the host to notify completion of request.");
97 76
98int ConfigRequired;
99module_param(ConfigRequired, int, S_IRUGO|S_IRUSR);
100MODULE_PARM_DESC(ConfigRequired,
101 "If 1, then only configured devices passed in through the"
102 "ql2xopts parameter will be presented to the OS");
103
104int Bind = BIND_BY_PORT_NAME;
105module_param(Bind, int, S_IRUGO|S_IRUSR);
106MODULE_PARM_DESC(Bind,
107 "Target persistent binding method: "
108 "0 by Portname (default); 1 by PortID; 2 by Nodename. ");
109
110int ql2xsuspendcount = SUSPEND_COUNT;
111module_param(ql2xsuspendcount, int, S_IRUGO|S_IWUSR);
112MODULE_PARM_DESC(ql2xsuspendcount,
113 "Number of 6-second suspend iterations to perform while a "
114 "target returns a <NOT READY> status. Default is 10 "
115 "iterations.");
116
117int ql2xloginretrycount = 0; 77int ql2xloginretrycount = 0;
118module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR); 78module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR);
119MODULE_PARM_DESC(ql2xloginretrycount, 79MODULE_PARM_DESC(ql2xloginretrycount,
@@ -330,7 +290,6 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
330 sp->fcport = fcport; 290 sp->fcport = fcport;
331 sp->cmd = cmd; 291 sp->cmd = cmd;
332 sp->flags = 0; 292 sp->flags = 0;
333 sp->err_id = 0;
334 293
335 CMD_SP(cmd) = (void *)sp; 294 CMD_SP(cmd) = (void *)sp;
336 cmd->scsi_done = done; 295 cmd->scsi_done = done;
@@ -474,7 +433,6 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
474 433
475 while ((!atomic_read(&ha->loop_down_timer) && 434 while ((!atomic_read(&ha->loop_down_timer) &&
476 atomic_read(&ha->loop_state) == LOOP_DOWN) || 435 atomic_read(&ha->loop_state) == LOOP_DOWN) ||
477 test_bit(CFG_ACTIVE, &ha->cfg_flags) ||
478 atomic_read(&ha->loop_state) != LOOP_READY) { 436 atomic_read(&ha->loop_state) != LOOP_READY) {
479 msleep(1000); 437 msleep(1000);
480 if (time_after_eq(jiffies, loop_timeout)) { 438 if (time_after_eq(jiffies, loop_timeout)) {
@@ -1194,34 +1152,24 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1194 1152
1195 spin_lock_init(&ha->hardware_lock); 1153 spin_lock_init(&ha->hardware_lock);
1196 1154
1197 /* 4.23 Initialize /proc/scsi/qla2x00 counters */
1198 ha->actthreads = 0;
1199 ha->qthreads = 0;
1200 ha->total_isr_cnt = 0;
1201 ha->total_isp_aborts = 0;
1202 ha->total_lip_cnt = 0;
1203 ha->total_dev_errs = 0;
1204 ha->total_ios = 0;
1205 ha->total_bytes = 0;
1206
1207 ha->prev_topology = 0; 1155 ha->prev_topology = 0;
1208 ha->ports = MAX_BUSES; 1156 ha->ports = MAX_BUSES;
1209 1157
1210 if (IS_QLA2100(ha)) { 1158 if (IS_QLA2100(ha)) {
1211 ha->max_targets = MAX_TARGETS_2100; 1159 host->max_id = MAX_TARGETS_2100;
1212 ha->mbx_count = MAILBOX_REGISTER_COUNT_2100; 1160 ha->mbx_count = MAILBOX_REGISTER_COUNT_2100;
1213 ha->request_q_length = REQUEST_ENTRY_CNT_2100; 1161 ha->request_q_length = REQUEST_ENTRY_CNT_2100;
1214 ha->response_q_length = RESPONSE_ENTRY_CNT_2100; 1162 ha->response_q_length = RESPONSE_ENTRY_CNT_2100;
1215 ha->last_loop_id = SNS_LAST_LOOP_ID_2100; 1163 ha->last_loop_id = SNS_LAST_LOOP_ID_2100;
1216 host->sg_tablesize = 32; 1164 host->sg_tablesize = 32;
1217 } else if (IS_QLA2200(ha)) { 1165 } else if (IS_QLA2200(ha)) {
1218 ha->max_targets = MAX_TARGETS_2200; 1166 host->max_id = MAX_TARGETS_2200;
1219 ha->mbx_count = MAILBOX_REGISTER_COUNT; 1167 ha->mbx_count = MAILBOX_REGISTER_COUNT;
1220 ha->request_q_length = REQUEST_ENTRY_CNT_2200; 1168 ha->request_q_length = REQUEST_ENTRY_CNT_2200;
1221 ha->response_q_length = RESPONSE_ENTRY_CNT_2100; 1169 ha->response_q_length = RESPONSE_ENTRY_CNT_2100;
1222 ha->last_loop_id = SNS_LAST_LOOP_ID_2100; 1170 ha->last_loop_id = SNS_LAST_LOOP_ID_2100;
1223 } else /*if (IS_QLA2300(ha))*/ { 1171 } else /*if (IS_QLA2300(ha))*/ {
1224 ha->max_targets = MAX_TARGETS_2200; 1172 host->max_id = MAX_TARGETS_2200;
1225 ha->mbx_count = MAILBOX_REGISTER_COUNT; 1173 ha->mbx_count = MAILBOX_REGISTER_COUNT;
1226 ha->request_q_length = REQUEST_ENTRY_CNT_2200; 1174 ha->request_q_length = REQUEST_ENTRY_CNT_2200;
1227 ha->response_q_length = RESPONSE_ENTRY_CNT_2300; 1175 ha->response_q_length = RESPONSE_ENTRY_CNT_2300;
@@ -1265,8 +1213,7 @@ int qla2x00_probe_one(struct pci_dev *pdev, struct qla_board_info *brd_info)
1265 host->unique_id = ha->instance; 1213 host->unique_id = ha->instance;
1266 host->max_cmd_len = MAX_CMDSZ; 1214 host->max_cmd_len = MAX_CMDSZ;
1267 host->max_channel = ha->ports - 1; 1215 host->max_channel = ha->ports - 1;
1268 host->max_id = ha->max_targets; 1216 host->max_lun = MAX_LUNS;
1269 host->max_lun = ha->max_luns;
1270 host->transportt = qla2xxx_transport_template; 1217 host->transportt = qla2xxx_transport_template;
1271 if (scsi_add_host(host, &pdev->dev)) 1218 if (scsi_add_host(host, &pdev->dev))
1272 goto probe_alloc_failed; 1219 goto probe_alloc_failed;
@@ -2336,8 +2283,7 @@ static int __init
2336qla2x00_module_init(void) 2283qla2x00_module_init(void)
2337{ 2284{
2338 /* Allocate cache for SRBs. */ 2285 /* Allocate cache for SRBs. */
2339 sprintf(srb_cachep_name, "qla2xxx_srbs"); 2286 srb_cachep = kmem_cache_create("qla2xxx_srbs", sizeof(srb_t), 0,
2340 srb_cachep = kmem_cache_create(srb_cachep_name, sizeof(srb_t), 0,
2341 SLAB_HWCACHE_ALIGN, NULL, NULL); 2287 SLAB_HWCACHE_ALIGN, NULL, NULL);
2342 if (srb_cachep == NULL) { 2288 if (srb_cachep == NULL) {
2343 printk(KERN_ERR 2289 printk(KERN_ERR
@@ -2365,16 +2311,7 @@ qla2x00_module_init(void)
2365static void __exit 2311static void __exit
2366qla2x00_module_exit(void) 2312qla2x00_module_exit(void)
2367{ 2313{
2368 /* Free SRBs cache. */ 2314 kmem_cache_destroy(srb_cachep);
2369 if (srb_cachep != NULL) {
2370 if (kmem_cache_destroy(srb_cachep) != 0) {
2371 printk(KERN_ERR
2372 "qla2xxx: Unable to free SRB cache...Memory pools "
2373 "still active?\n");
2374 }
2375 srb_cachep = NULL;
2376 }
2377
2378 fc_release_transport(qla2xxx_transport_template); 2315 fc_release_transport(qla2xxx_transport_template);
2379} 2316}
2380 2317