diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 1cc8febcbadb..cbe0cad83b68 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -95,6 +95,8 @@ MODULE_PARM_DESC(ql2xqfullrampup, | |||
95 | */ | 95 | */ |
96 | static int qla2xxx_slave_configure(struct scsi_device * device); | 96 | static int qla2xxx_slave_configure(struct scsi_device * device); |
97 | static int qla2xxx_slave_alloc(struct scsi_device *); | 97 | static int qla2xxx_slave_alloc(struct scsi_device *); |
98 | static int qla2xxx_scan_finished(struct Scsi_Host *, unsigned long time); | ||
99 | static void qla2xxx_scan_start(struct Scsi_Host *); | ||
98 | static void qla2xxx_slave_destroy(struct scsi_device *); | 100 | static void qla2xxx_slave_destroy(struct scsi_device *); |
99 | static int qla2x00_queuecommand(struct scsi_cmnd *cmd, | 101 | static int qla2x00_queuecommand(struct scsi_cmnd *cmd, |
100 | void (*fn)(struct scsi_cmnd *)); | 102 | void (*fn)(struct scsi_cmnd *)); |
@@ -124,6 +126,8 @@ static struct scsi_host_template qla2x00_driver_template = { | |||
124 | 126 | ||
125 | .slave_alloc = qla2xxx_slave_alloc, | 127 | .slave_alloc = qla2xxx_slave_alloc, |
126 | .slave_destroy = qla2xxx_slave_destroy, | 128 | .slave_destroy = qla2xxx_slave_destroy, |
129 | .scan_finished = qla2xxx_scan_finished, | ||
130 | .scan_start = qla2xxx_scan_start, | ||
127 | .change_queue_depth = qla2x00_change_queue_depth, | 131 | .change_queue_depth = qla2x00_change_queue_depth, |
128 | .change_queue_type = qla2x00_change_queue_type, | 132 | .change_queue_type = qla2x00_change_queue_type, |
129 | .this_id = -1, | 133 | .this_id = -1, |
@@ -1366,6 +1370,29 @@ qla24xx_disable_intrs(scsi_qla_host_t *ha) | |||
1366 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 1370 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
1367 | } | 1371 | } |
1368 | 1372 | ||
1373 | static void | ||
1374 | qla2xxx_scan_start(struct Scsi_Host *shost) | ||
1375 | { | ||
1376 | scsi_qla_host_t *ha = (scsi_qla_host_t *)shost->hostdata; | ||
1377 | |||
1378 | set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); | ||
1379 | set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags); | ||
1380 | set_bit(RSCN_UPDATE, &ha->dpc_flags); | ||
1381 | } | ||
1382 | |||
1383 | static int | ||
1384 | qla2xxx_scan_finished(struct Scsi_Host *shost, unsigned long time) | ||
1385 | { | ||
1386 | scsi_qla_host_t *ha = (scsi_qla_host_t *)shost->hostdata; | ||
1387 | |||
1388 | if (!ha->host) | ||
1389 | return 1; | ||
1390 | if (time > ha->loop_reset_delay * HZ) | ||
1391 | return 1; | ||
1392 | |||
1393 | return atomic_read(&ha->loop_state) == LOOP_READY; | ||
1394 | } | ||
1395 | |||
1369 | /* | 1396 | /* |
1370 | * PCI driver interface | 1397 | * PCI driver interface |
1371 | */ | 1398 | */ |
@@ -1631,10 +1658,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1631 | 1658 | ||
1632 | pci_set_drvdata(pdev, ha); | 1659 | pci_set_drvdata(pdev, ha); |
1633 | 1660 | ||
1634 | /* Start link scan. */ | ||
1635 | set_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags); | ||
1636 | set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags); | ||
1637 | set_bit(RSCN_UPDATE, &ha->dpc_flags); | ||
1638 | ha->flags.init_done = 1; | 1661 | ha->flags.init_done = 1; |
1639 | ha->flags.online = 1; | 1662 | ha->flags.online = 1; |
1640 | 1663 | ||
@@ -1644,6 +1667,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1644 | if (ret) | 1667 | if (ret) |
1645 | goto probe_failed; | 1668 | goto probe_failed; |
1646 | 1669 | ||
1670 | scsi_scan_host(host); | ||
1671 | |||
1647 | qla2x00_alloc_sysfs_attr(ha); | 1672 | qla2x00_alloc_sysfs_attr(ha); |
1648 | 1673 | ||
1649 | qla2x00_init_host_attr(ha); | 1674 | qla2x00_init_host_attr(ha); |