aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptsas.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r--drivers/message/fusion/mptsas.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 9e5424e1871f..030bb8389aee 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -1119,6 +1119,7 @@ static struct scsi_host_template mptsas_driver_template = {
1119 .max_sectors = 8192, 1119 .max_sectors = 8192,
1120 .cmd_per_lun = 7, 1120 .cmd_per_lun = 7,
1121 .use_clustering = ENABLE_CLUSTERING, 1121 .use_clustering = ENABLE_CLUSTERING,
1122 .shost_attrs = mptscsih_host_attrs,
1122}; 1123};
1123 1124
1124static int mptsas_get_linkerrors(struct sas_phy *phy) 1125static int mptsas_get_linkerrors(struct sas_phy *phy)
@@ -1390,6 +1391,11 @@ mptsas_sas_io_unit_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
1390 goto out_free_consistent; 1391 goto out_free_consistent;
1391 } 1392 }
1392 1393
1394 ioc->nvdata_version_persistent =
1395 le16_to_cpu(buffer->NvdataVersionPersistent);
1396 ioc->nvdata_version_default =
1397 le16_to_cpu(buffer->NvdataVersionDefault);
1398
1393 for (i = 0; i < port_info->num_phys; i++) { 1399 for (i = 0; i < port_info->num_phys; i++) {
1394 mptsas_print_phy_data(&buffer->PhyData[i]); 1400 mptsas_print_phy_data(&buffer->PhyData[i]);
1395 port_info->phy_info[i].phy_id = i; 1401 port_info->phy_info[i].phy_id = i;
@@ -1410,6 +1416,63 @@ mptsas_sas_io_unit_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info)
1410} 1416}
1411 1417
1412static int 1418static int
1419mptsas_sas_io_unit_pg1(MPT_ADAPTER *ioc)
1420{
1421 ConfigExtendedPageHeader_t hdr;
1422 CONFIGPARMS cfg;
1423 SasIOUnitPage1_t *buffer;
1424 dma_addr_t dma_handle;
1425 int error;
1426 u16 device_missing_delay;
1427
1428 memset(&hdr, 0, sizeof(ConfigExtendedPageHeader_t));
1429 memset(&cfg, 0, sizeof(CONFIGPARMS));
1430
1431 cfg.cfghdr.ehdr = &hdr;
1432 cfg.action = MPI_CONFIG_ACTION_PAGE_HEADER;
1433 cfg.timeout = 10;
1434 cfg.cfghdr.ehdr->PageType = MPI_CONFIG_PAGETYPE_EXTENDED;
1435 cfg.cfghdr.ehdr->ExtPageType = MPI_CONFIG_EXTPAGETYPE_SAS_IO_UNIT;
1436 cfg.cfghdr.ehdr->PageVersion = MPI_SASIOUNITPAGE1_PAGEVERSION;
1437 cfg.cfghdr.ehdr->PageNumber = 1;
1438
1439 error = mpt_config(ioc, &cfg);
1440 if (error)
1441 goto out;
1442 if (!hdr.ExtPageLength) {
1443 error = -ENXIO;
1444 goto out;
1445 }
1446
1447 buffer = pci_alloc_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
1448 &dma_handle);
1449 if (!buffer) {
1450 error = -ENOMEM;
1451 goto out;
1452 }
1453
1454 cfg.physAddr = dma_handle;
1455 cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
1456
1457 error = mpt_config(ioc, &cfg);
1458 if (error)
1459 goto out_free_consistent;
1460
1461 ioc->io_missing_delay =
1462 le16_to_cpu(buffer->IODeviceMissingDelay);
1463 device_missing_delay = le16_to_cpu(buffer->ReportDeviceMissingDelay);
1464 ioc->device_missing_delay = (device_missing_delay & MPI_SAS_IOUNIT1_REPORT_MISSING_UNIT_16) ?
1465 (device_missing_delay & MPI_SAS_IOUNIT1_REPORT_MISSING_TIMEOUT_MASK) * 16 :
1466 device_missing_delay & MPI_SAS_IOUNIT1_REPORT_MISSING_TIMEOUT_MASK;
1467
1468 out_free_consistent:
1469 pci_free_consistent(ioc->pcidev, hdr.ExtPageLength * 4,
1470 buffer, dma_handle);
1471 out:
1472 return error;
1473}
1474
1475static int
1413mptsas_sas_phy_pg0(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, 1476mptsas_sas_phy_pg0(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info,
1414 u32 form, u32 form_specific) 1477 u32 form, u32 form_specific)
1415{ 1478{
@@ -1990,6 +2053,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
1990 if (error) 2053 if (error)
1991 goto out_free_port_info; 2054 goto out_free_port_info;
1992 2055
2056 mptsas_sas_io_unit_pg1(ioc);
1993 mutex_lock(&ioc->sas_topology_mutex); 2057 mutex_lock(&ioc->sas_topology_mutex);
1994 ioc->handle = hba->phy_info[0].handle; 2058 ioc->handle = hba->phy_info[0].handle;
1995 port_info = mptsas_find_portinfo_by_handle(ioc, ioc->handle); 2059 port_info = mptsas_find_portinfo_by_handle(ioc, ioc->handle);