diff options
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r-- | drivers/message/fusion/mptsas.c | 72 |
1 files changed, 71 insertions, 1 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 9e5424e1871f..d50664640512 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 | ||
1124 | static int mptsas_get_linkerrors(struct sas_phy *phy) | 1125 | static 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 | ||
1412 | static int | 1418 | static int |
1419 | mptsas_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 | |||
1475 | static int | ||
1413 | mptsas_sas_phy_pg0(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, | 1476 | mptsas_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); |
@@ -3237,6 +3301,8 @@ static struct pci_driver mptsas_driver = { | |||
3237 | static int __init | 3301 | static int __init |
3238 | mptsas_init(void) | 3302 | mptsas_init(void) |
3239 | { | 3303 | { |
3304 | int error; | ||
3305 | |||
3240 | show_mptmod_ver(my_NAME, my_VERSION); | 3306 | show_mptmod_ver(my_NAME, my_VERSION); |
3241 | 3307 | ||
3242 | mptsas_transport_template = | 3308 | mptsas_transport_template = |
@@ -3260,7 +3326,11 @@ mptsas_init(void) | |||
3260 | ": Registered for IOC reset notifications\n")); | 3326 | ": Registered for IOC reset notifications\n")); |
3261 | } | 3327 | } |
3262 | 3328 | ||
3263 | return pci_register_driver(&mptsas_driver); | 3329 | error = pci_register_driver(&mptsas_driver); |
3330 | if (error) | ||
3331 | sas_release_transport(mptsas_transport_template); | ||
3332 | |||
3333 | return error; | ||
3264 | } | 3334 | } |
3265 | 3335 | ||
3266 | static void __exit | 3336 | static void __exit |