Lines Matching +full:0 +full:x58000000
83 module_param(mpt_msi_enable_spi, int, 0);
85 " Enable MSI Support for SPI controllers (default=0)");
88 module_param(mpt_msi_enable_fc, int, 0);
90 " Enable MSI Support for FC controllers (default=0)");
93 module_param(mpt_msi_enable_sas, int, 0);
95 " Enable MSI Support for SAS controllers (default=0)");
98 module_param(mpt_channel_mapping, int, 0);
99 MODULE_PARM_DESC(mpt_channel_mapping, " Mapping id's to channels (default=0)");
106 " debug level - refer to mptdebug.h - (default=0)");
112 "Enable detection of Firmware fault and halt Firmware on fault - (default=0)");
118 static int mfcounter = 0;
127 #define WHOINIT_UNKNOWN 0xAA
255 return 0; in mpt_set_debug_level()
272 return 0; in mpt_get_cb_idx()
288 int rc = 0; in mpt_is_discovery_complete()
290 memset(&hdr, 0, sizeof(ConfigExtendedPageHeader_t)); in mpt_is_discovery_complete()
291 memset(&cfg, 0, sizeof(CONFIGPARMS)); in mpt_is_discovery_complete()
314 if (!(buffer->PhyData[0].PortFlags & in mpt_is_discovery_complete()
330 * Return 0 if controller is removed from pci subsystem.
346 return 0; in mpt_remove_dead_ioc_func()
371 ioc_raw_state = mpt_GetIocState(ioc, 0); in mpt_fault_reset_work()
409 __func__, (rc == 0) ? "success" : "failed"); in mpt_fault_reset_work()
410 ioc_raw_state = mpt_GetIocState(ioc, 0); in mpt_fault_reset_work()
419 ioc->sas_discovery_quiesce_io = 0; in mpt_fault_reset_work()
447 u16 req_idx = 0; in mpt_turbo_reply()
455 req_idx = pa & 0x0000FFFF; in mpt_turbo_reply()
456 cb_idx = (pa & 0x00FF0000) >> 16; in mpt_turbo_reply()
470 if ((pa & 0x58000000) == 0x58000000) { in mpt_turbo_reply()
471 req_idx = pa & 0x0000FFFF; in mpt_turbo_reply()
484 cb_idx = 0; in mpt_turbo_reply()
557 freeme = 0; in mpt_reply()
595 if (pa == 0xFFFFFFFF) in mpt_interrupt()
607 } while (pa != 0xFFFFFFFF); in mpt_interrupt()
624 * should be freed, or 0 if it shouldn't.
637 evHandlers = 0; in mptbase_reply()
639 event = le32_to_cpu(pEventReply->Event) & 0xFF; in mptbase_reply()
641 freereq = 0; in mptbase_reply()
656 freereq = 0; in mptbase_reply()
707 * (slot/handle 0 is reserved!) in mpt_register()
753 * Returns 0 for success.
762 return 0; in mpt_event_register()
792 * Returns 0 for success.
801 return 0; in mpt_reset_register()
844 return 0; in mpt_device_driver_register()
910 mf->u.frame.linkage.arg1 = 0; in mpt_get_msg_frame()
916 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0; in mpt_get_msg_frame()
930 "Count 0x%x Max 0x%x\n", ioc->name, ioc->mfcnt, in mpt_get_msg_frame()
934 printk(MYIOC_s_INFO_FMT "MF Count 0x%x Max 0x%x \n", ioc->name, in mpt_get_msg_frame()
966 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0; in mpt_put_msg_frame()
1001 mf->u.frame.hwhdr.msgctxu.fld.rsvd = 0; in mpt_put_msg_frame_hi_pri()
1027 if (cpu_to_le32(mf->u.frame.linkage.arg1) == 0xdeadbeaf) in mpt_free_msg_frame()
1030 mf->u.frame.linkage.arg1 = cpu_to_le32(0xdeadbeaf); in mpt_free_msg_frame()
1106 "addr = 0x%llx len = %d\n", in mpt_add_sge_64bit_1078()
1149 u32 tmp = dma_addr & 0xFFFFFFFF; in mpt_add_chain_64bit()
1177 * Returns 0 for success, non-zero for failure.
1182 int r = 0; in mpt_send_handshake_request()
1197 if (reqBytes >= 12 && ii >= 0 && ii < ioc->req_depth) { in mpt_send_handshake_request()
1204 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in mpt_send_handshake_request()
1211 if ((ii = WaitForDoorbellInt(ioc, 5, sleepFlag)) < 0) { in mpt_send_handshake_request()
1222 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in mpt_send_handshake_request()
1224 if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) { in mpt_send_handshake_request()
1230 for (ii = 0; ii < reqBytes/4; ii++) { in mpt_send_handshake_request()
1233 word = ((req_as_bytes[(ii*4) + 0] << 0) | in mpt_send_handshake_request()
1238 if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) { in mpt_send_handshake_request()
1244 if (r >= 0 && WaitForDoorbellInt(ioc, 10, sleepFlag) >= 0) in mpt_send_handshake_request()
1245 r = 0; in mpt_send_handshake_request()
1250 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in mpt_send_handshake_request()
1266 * 0h Reserved
1271 * Returns 0 for success, non-zero for failure.
1282 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in mpt_host_page_access_control()
1290 if (WaitForDoorbellAck(ioc, 5, sleepFlag) < 0) in mpt_host_page_access_control()
1293 return 0; in mpt_host_page_access_control()
1303 * Returns 0 for success, non-zero for failure.
1310 u32 host_page_buffer_sz=0; in mpt_host_page_alloc()
1315 le32_to_cpu(ioc->facts.HostPageBufferSGE.FlagsLength) & 0xFFFFFF; in mpt_host_page_alloc()
1318 return 0; /* fw doesn't need any host buffers */ in mpt_host_page_alloc()
1321 while (host_page_buffer_sz > 0) { in mpt_host_page_alloc()
1359 return 0; in mpt_host_page_alloc()
1411 case 0x00: in mpt_get_product_name()
1414 case 0x01: in mpt_get_product_name()
1438 if (revision < 0x80) in mpt_get_product_name()
1444 if (revision < 0x80) in mpt_get_product_name()
1458 case 0x00: in mpt_get_product_name()
1461 case 0x01: in mpt_get_product_name()
1472 case 0x00: in mpt_get_product_name()
1475 case 0x01: in mpt_get_product_name()
1478 case 0x03: in mpt_get_product_name()
1481 case 0x07: in mpt_get_product_name()
1484 case 0x08: in mpt_get_product_name()
1487 case 0x80: in mpt_get_product_name()
1490 case 0x83: in mpt_get_product_name()
1493 case 0x87: in mpt_get_product_name()
1496 case 0xc1: in mpt_get_product_name()
1507 case 0x03: in mpt_get_product_name()
1510 case 0x04: in mpt_get_product_name()
1521 case 0x00: in mpt_get_product_name()
1524 case 0x01: in mpt_get_product_name()
1527 case 0x02: in mpt_get_product_name()
1530 case 0x03: in mpt_get_product_name()
1541 case 0x00: in mpt_get_product_name()
1544 case 0x01: in mpt_get_product_name()
1547 case 0x02: in mpt_get_product_name()
1550 case 0x04: in mpt_get_product_name()
1553 case 0x08: in mpt_get_product_name()
1564 case 0x00: in mpt_get_product_name()
1567 case 0x01: in mpt_get_product_name()
1570 case 0x02: in mpt_get_product_name()
1581 case 0x00: in mpt_get_product_name()
1584 case 0x01: in mpt_get_product_name()
1587 case 0x02: in mpt_get_product_name()
1590 case 0x04: in mpt_get_product_name()
1593 case 0x08: in mpt_get_product_name()
1604 case 0x00: in mpt_get_product_name()
1607 case 0x01: in mpt_get_product_name()
1610 case 0x02: in mpt_get_product_name()
1613 case 0x03: in mpt_get_product_name()
1616 case 0x04: in mpt_get_product_name()
1695 mem_phys = msize = 0; in mpt_mapresources()
1696 port = psize = 0; in mpt_mapresources()
1697 for (ii = 0; ii < DEVICE_COUNT_RESOURCE; ii++) { in mpt_mapresources()
1735 return 0; in mpt_mapresources()
1758 * Returns 0 for success, non-zero for failure.
1769 static int mpt_ids = 0; in mpt_attach()
1832 ioc->eventTypes = 0; /* None */ in mpt_attach()
1833 ioc->eventContext = 0; in mpt_attach()
1834 ioc->eventLogSize = 0; in mpt_attach()
1838 ioc->mfcnt = 0; in mpt_attach()
1846 memset(&ioc->spi_data, 0, sizeof(SpiCfgData)); in mpt_attach()
1860 alloc_workqueue("mpt_poll_%d", WQ_MEM_RECLAIM | WQ_PERCPU, 0, in mpt_attach()
1869 dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "facts @ %p, pfacts[0] @ %p\n", in mpt_attach()
1870 ioc->name, &ioc->facts, &ioc->pfacts[0])); in mpt_attach()
1893 pci_read_config_byte(pdev, 0x6a, &pcixcmd); in mpt_attach()
1894 pcixcmd &= 0x8F; in mpt_attach()
1895 pci_write_config_byte(pdev, 0x6a, pcixcmd); in mpt_attach()
1897 /* 929XL Chip Fix. Set MMRBC to 0x08. in mpt_attach()
1899 pci_read_config_byte(pdev, 0x6a, &pcixcmd); in mpt_attach()
1900 pcixcmd |= 0x08; in mpt_attach()
1901 pci_write_config_byte(pdev, 0x6a, pcixcmd); in mpt_attach()
1910 pci_read_config_byte(pdev, 0x6a, &pcixcmd); in mpt_attach()
1911 pcixcmd &= 0x8F; in mpt_attach()
1912 pci_write_config_byte(pdev, 0x6a, pcixcmd); in mpt_attach()
1921 pci_read_config_byte(pdev, 0x6a, &pcixcmd); in mpt_attach()
1922 pcixcmd &= 0x8F; in mpt_attach()
1923 pci_write_config_byte(pdev, 0x6a, pcixcmd); in mpt_attach()
1960 ioc->msi_enable = 0; in mpt_attach()
1972 CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); in mpt_attach()
1973 ioc->active = 0; in mpt_attach()
1974 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in mpt_attach()
1989 WQ_MEM_RECLAIM | WQ_PERCPU, 0, in mpt_attach()
1999 CAN_SLEEP)) != 0){ in mpt_attach()
2023 for(cb_idx = 0; cb_idx < MPT_MAX_PROTOCOL_DRIVERS; cb_idx++) { in mpt_attach()
2047 return 0; in mpt_attach()
2107 for(cb_idx = 0; cb_idx < MPT_MAX_PROTOCOL_DRIVERS; cb_idx++) { in mpt_detach()
2115 CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); in mpt_detach()
2117 ioc->active = 0; in mpt_detach()
2121 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in mpt_detach()
2146 printk(MYIOC_s_INFO_FMT "pci-suspend: pdev=0x%p, slot=%s, Entering " in mpt_suspend()
2157 CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); in mpt_suspend()
2158 ioc->active = 0; in mpt_suspend()
2161 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in mpt_suspend()
2171 return 0; in mpt_suspend()
2187 printk(MYIOC_s_INFO_FMT "pci-resume: pdev=0x%p, slot=%s, Previous " in mpt_resume()
2192 pci_enable_wake(pdev, PCI_D0, 0); in mpt_resume()
2214 printk(MYIOC_s_INFO_FMT "pci-resume: ioc-state=0x%x,doorbell=0x%x\n", in mpt_resume()
2228 if (KickStart(ioc, 1, CAN_SLEEP) < 0) { in mpt_resume()
2239 if (recovery_state != 0) in mpt_resume()
2246 return 0; in mpt_resume()
2262 return 0; in mpt_signal_reset()
2280 * 0 for success
2291 int hard_reset_done = 0; in mpt_do_ioc_recovery()
2292 int alt_ioc_ready = 0; in mpt_do_ioc_recovery()
2294 int rc=0; in mpt_do_ioc_recovery()
2296 int ret = 0; in mpt_do_ioc_recovery()
2297 int reset_alt_ioc_active = 0; in mpt_do_ioc_recovery()
2298 int irq_allocated = 0; in mpt_do_ioc_recovery()
2305 CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); in mpt_do_ioc_recovery()
2306 ioc->active = 0; in mpt_do_ioc_recovery()
2316 0xFFFFFFFF); in mpt_do_ioc_recovery()
2317 ioc->alt_ioc->active = 0; in mpt_do_ioc_recovery()
2323 hard = 0; in mpt_do_ioc_recovery()
2325 if ((hard_reset_done = MakeIocReady(ioc, hard, sleepFlag)) < 0) { in mpt_do_ioc_recovery()
2346 /* hard_reset_done = 0 if a soft reset was performed in mpt_do_ioc_recovery()
2350 if ((rc = MakeIocReady(ioc->alt_ioc, 0, sleepFlag)) == 0) in mpt_do_ioc_recovery()
2358 for (ii=0; ii<5; ii++) { in mpt_do_ioc_recovery()
2360 if ((rc = GetIocFacts(ioc, sleepFlag, reason)) == 0) in mpt_do_ioc_recovery()
2374 if ((rc = GetIocFacts(ioc->alt_ioc, sleepFlag, reason)) != 0) { in mpt_do_ioc_recovery()
2385 alt_ioc_ready = 0; in mpt_do_ioc_recovery()
2386 reset_alt_ioc_active = 0; in mpt_do_ioc_recovery()
2392 if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP) && in mpt_do_ioc_recovery()
2409 if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) { in mpt_do_ioc_recovery()
2416 ioc->msi_enable = 0; in mpt_do_ioc_recovery()
2419 if (rc < 0) { in mpt_do_ioc_recovery()
2445 if ((ret == 0) && ((rc = PrimeIocFifos(ioc)) != 0)) in mpt_do_ioc_recovery()
2453 if ((ret == 0) && ((rc = SendIocInit(ioc, sleepFlag)) != 0)) in mpt_do_ioc_recovery()
2456 if (alt_ioc_ready && ((rc = PrimeIocFifos(ioc->alt_ioc)) != 0)) { in mpt_do_ioc_recovery()
2460 alt_ioc_ready = 0; in mpt_do_ioc_recovery()
2461 reset_alt_ioc_active = 0; in mpt_do_ioc_recovery()
2465 if ((rc = SendIocInit(ioc->alt_ioc, sleepFlag)) != 0) { in mpt_do_ioc_recovery()
2466 alt_ioc_ready = 0; in mpt_do_ioc_recovery()
2467 reset_alt_ioc_active = 0; in mpt_do_ioc_recovery()
2481 if (ret == 0) { in mpt_do_ioc_recovery()
2483 if (rc == 0) { in mpt_do_ioc_recovery()
2509 if ((ret == 0) && (!ioc->facts.EventState)) { in mpt_do_ioc_recovery()
2519 if (ret == 0) { in mpt_do_ioc_recovery()
2524 if (rc == 0) { /* alt ioc */ in mpt_do_ioc_recovery()
2543 if ((ret == 0) && (reason == MPT_HOSTEVENT_IOC_BRINGUP)) { in mpt_do_ioc_recovery()
2559 if(ret != 0) in mpt_do_ioc_recovery()
2574 if ((ioc->pfacts[0].ProtocolFlags & in mpt_do_ioc_recovery()
2576 (ioc->lan_cnfg_page0.Header.PageLength == 0)) { in mpt_do_ioc_recovery()
2589 /* Get NVRAM and adapter maximums from SPP 0 and 2 in mpt_do_ioc_recovery()
2591 mpt_GetScsiPortSettings(ioc, 0); in mpt_do_ioc_recovery()
2595 mpt_readScsiDevicePageHeaders(ioc, 0); in mpt_do_ioc_recovery()
2616 if ((ret != 0) && irq_allocated) { in mpt_do_ioc_recovery()
2698 ioc->cached_fw, CAN_SLEEP)) < 0) { in mpt_adapter_disable()
2723 CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); in mpt_adapter_disable()
2724 ioc->active = 0; in mpt_adapter_disable()
2727 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in mpt_adapter_disable()
2786 MPI_DB_HPBAC_FREE_BUFFER, NO_SLEEP)) != 0) { in mpt_adapter_disable()
2798 ioc->HostPageBuffer_sz = 0; in mpt_adapter_disable()
2860 int i = 0; in MptDisplayIocCapabilities()
2867 if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_INITIATOR) { in MptDisplayIocCapabilities()
2872 if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_TARGET) { in MptDisplayIocCapabilities()
2877 if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) { in MptDisplayIocCapabilities()
2882 #if 0 in MptDisplayIocCapabilities()
2886 if (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_TARGET) { in MptDisplayIocCapabilities()
2904 * 0 - READY initially OR soft reset and READY
2914 int statefault = 0; in MakeIocReady()
2916 int hard_reset_done = 0; in MakeIocReady()
2922 ioc_state = mpt_GetIocState(ioc, 0); in MakeIocReady()
2940 return 0; in MakeIocReady()
2968 "whoinit 0x%x statefault %d force %d\n", in MakeIocReady()
2973 if ((statefault == 0 ) && (force == 0)) { in MakeIocReady()
2974 if ((r = SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag)) == 0) in MakeIocReady()
2975 return 0; in MakeIocReady()
2982 if (hard_reset_done < 0) in MakeIocReady()
2988 ii = 0; in MakeIocReady()
2997 if ((r = SendIocReset(ioc, MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET, sleepFlag)) != 0) { in MakeIocReady()
3006 if ((r = SendIocReset(ioc, MPI_FUNCTION_IO_UNIT_RESET, sleepFlag)) != 0) { in MakeIocReady()
3015 "Wait IOC_READY state (0x%x) timeout(%d)!\n", in MakeIocReady()
3042 * Returns all IOC Doorbell register bits if cooked==0, else just the
3067 * Returns 0 for success, non-zero for failure.
3093 memset(facts, 0, reply_sz); in GetIocFacts()
3097 memset(&get_facts, 0, req_sz); in GetIocFacts()
3111 if (r != 0) in GetIocFacts()
3152 ((oldv<<12) & 0xFF000000) | in GetIocFacts()
3153 ((oldv<<8) & 0x000FFF00); in GetIocFacts()
3175 * to 14 in MPI-1.01.0x. in GetIocFacts()
3186 printk(MYIOC_s_ERR_FMT "IOC reported invalid 0 request size!\n", in GetIocFacts()
3192 vv = ((63 / (sz * 4)) + 1) & 0x03; in GetIocFacts()
3220 if ( (r = GetPortFacts(ioc, 0, sleepFlag)) != 0 ) in GetIocFacts()
3231 return 0; in GetIocFacts()
3241 * Returns 0 for success, non-zero for failure.
3264 memset(pfacts, 0, reply_sz); in GetPortFacts()
3268 memset(&get_pfacts, 0, req_sz); in GetPortFacts()
3282 if (ii != 0) in GetPortFacts()
3313 return 0; in GetPortFacts()
3324 * Returns 0 for success, non-zero for failure.
3336 memset(&ioc_init, 0, sizeof(ioc_init)); in SendIocInit()
3337 memset(&init_reply, 0, sizeof(init_reply)); in SendIocInit()
3349 ioc->upload_fw = 0; in SendIocInit()
3378 ioc_init.HostMfaHighAddr = cpu_to_le32(0); in SendIocInit()
3379 ioc_init.SenseBufferHighAddr = cpu_to_le32(0); in SendIocInit()
3392 if (r != 0) { in SendIocInit()
3404 if ((r = SendPortEnable(ioc, 0, sleepFlag)) != 0) { in SendIocInit()
3413 count = 0; in SendIocInit()
3435 ioc->aen_event_read_flag=0; in SendIocInit()
3448 * Returns 0 for success, non-zero for failure.
3461 memset(&reply_buf, 0, reply_sz); in SendPortEnable()
3464 memset(&port_enable, 0, req_sz); in SendPortEnable()
3468 /* port_enable.ChainOffset = 0; */ in SendPortEnable()
3469 /* port_enable.MsgFlags = 0; */ in SendPortEnable()
3470 /* port_enable.MsgContext = 0; */ in SendPortEnable()
3497 * Return 0 if successful, or non-zero for failure
3505 rc = 0; /* use already allocated memory */ in mpt_alloc_fw_memory()
3511 rc = 0; in mpt_alloc_fw_memory()
3524 rc = 0; in mpt_alloc_fw_memory()
3560 * Returns 0 for success, >0 for handshake failure
3561 * <0 for fw upload failure.
3579 /* If the image size is 0, we are done. in mpt_do_upload()
3581 if ((sz = ioc->facts.FWImageSize) == 0) in mpt_do_upload()
3582 return 0; in mpt_do_upload()
3584 if (mpt_alloc_fw_memory(ioc, ioc->facts.FWImageSize) != 0) in mpt_do_upload()
3602 memset(preply, 0, reply_sz); in mpt_do_upload()
3629 if (ii == 0) { in mpt_do_upload()
3639 cmdStatus = 0; in mpt_do_upload()
3664 * Returns 0 for success
3665 * -1 FW Image size is 0
3667 * <0 for fw upload failure.
3680 u32 ioc_state=0; in mpt_downloadboot()
3682 ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "downloadboot: fw size 0x%x (%d), FW Ptr %p\n", in mpt_downloadboot()
3685 CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF); in mpt_downloadboot()
3704 for (count = 0; count < 30; count ++) { in mpt_downloadboot()
3726 CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF); in mpt_downloadboot()
3746 ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "LoadStart addr written 0x%x \n", in mpt_downloadboot()
3749 ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Write FW Image: 0x%x bytes @ %p\n", in mpt_downloadboot()
3764 ddlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Write Ext Image: 0x%x (%d) bytes @ %p load_addr=%x\n", in mpt_downloadboot()
3790 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, 0x3F000000); in mpt_downloadboot()
3792 diagRwData |= 0x40000000; in mpt_downloadboot()
3793 CHIPREG_PIO_WRITE32(&ioc->pio_chip->DiagRwAddress, 0x3F000000); in mpt_downloadboot()
3821 /* Write 0xFF to reset the sequencer */ in mpt_downloadboot()
3822 CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF); in mpt_downloadboot()
3825 ioc_state = mpt_GetIocState(ioc, 0); in mpt_downloadboot()
3827 MPT_HOSTEVENT_IOC_BRINGUP)) != 0 ) { in mpt_downloadboot()
3834 for (count=0; count<HZ*20; count++) { in mpt_downloadboot()
3835 if ((ioc_state = mpt_GetIocState(ioc, 0)) & MPI_IOC_STATE_READY) { in mpt_downloadboot()
3840 return 0; in mpt_downloadboot()
3842 if ((SendIocInit(ioc, sleepFlag)) != 0) { in mpt_downloadboot()
3851 return 0; in mpt_downloadboot()
3880 * 0 else
3884 * 0 - no reset due to History bit, READY
3893 int hard_reset_done = 0; in KickStart()
3894 u32 ioc_state=0; in KickStart()
3912 if (hard_reset_done < 0) in KickStart()
3919 for (cnt=0; cnt<cntdn; cnt++) { in KickStart()
3934 ioc->name, mpt_GetIocState(ioc, 0))); in KickStart()
3953 * 0 no reset performed because reset history bit set
3962 int hard_reset_done = 0; in mpt_diag_reset()
3963 int count = 0; in mpt_diag_reset()
3964 u32 diag1val = 0; in mpt_diag_reset()
3969 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in mpt_diag_reset()
3974 return 0; in mpt_diag_reset()
3979 CHIPREG_WRITE32(&ioc->chip->Reset_1078, 0x07); in mpt_diag_reset()
3997 for (count = 0; count < 60; count ++) { in mpt_diag_reset()
4030 * or if the reset history is 0 in mpt_diag_reset()
4033 while ((diag0val & MPI_DIAG_DRWE) == 0) { in mpt_diag_reset()
4037 CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF); in mpt_diag_reset()
4113 * case. _diag_reset will return < 0 in mpt_diag_reset()
4115 for (count = 0; count < 30; count ++) { in mpt_diag_reset()
4130 if ((count = mpt_downloadboot(ioc, cached_fw, sleepFlag)) < 0) { in mpt_diag_reset()
4142 for (count = 0; count < 60; count ++) { in mpt_diag_reset()
4181 count = 0; in mpt_diag_reset()
4182 while ((diag0val & MPI_DIAG_DRWE) == 0) { in mpt_diag_reset()
4186 CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFF); in mpt_diag_reset()
4218 CHIPREG_WRITE32(&ioc->chip->WriteSequence, 0xFFFFFFFF); in mpt_diag_reset()
4239 ioc->facts.EventState = 0; in mpt_diag_reset()
4242 ioc->alt_ioc->facts.EventState = 0; in mpt_diag_reset()
4257 * Returns 0 for success, non-zero for failure.
4266 drsprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Sending IOC reset(0x%02x)!\n", in SendIocReset()
4269 if ((r = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) in SendIocReset()
4274 count = 0; in SendIocReset()
4285 "Wait IOC_READY state (0x%x) timeout(%d)!\n", in SendIocReset()
4302 ioc->facts.EventState = 0; in SendIocReset()
4304 return 0; in SendIocReset()
4342 for (ii = 0; ii < ioc->req_depth; ii++) { in initChainBuffers()
4381 while (numSGE - num_sge > 0) { in initChainBuffers()
4411 memset(mem, 0xFF, sz); in initChainBuffers()
4424 * Returns 0 for success, non-zero for failure.
4436 dma_mask = 0; in PrimeIocFifos()
4441 if ( (num_chain = initChainBuffers(ioc)) < 0) in PrimeIocFifos()
4501 memset(mem, 0, total_size); in PrimeIocFifos()
4507 ioc->reply_frames_low_dma = (u32) (alloc_dma & 0xFFFFFFFF); in PrimeIocFifos()
4523 ioc->req_frames_low_dma = (u32) (alloc_dma & 0xFFFFFFFF); in PrimeIocFifos()
4525 for (i = 0; i < ioc->req_depth; i++) { in PrimeIocFifos()
4544 for (i=0; i < num_chain; i++) { in PrimeIocFifos()
4557 for (i = 0; i < ioc->req_depth; i++) { in PrimeIocFifos()
4576 ioc->sense_buf_low_dma = (u32) (ioc->sense_buf_pool_dma & 0xFFFFFFFF); in PrimeIocFifos()
4589 for (i = 0; i < ioc->reply_depth; i++) { in PrimeIocFifos()
4601 return 0; in PrimeIocFifos()
4646 * Returns 0 for success, non-zero for failure.
4653 int failcnt = 0; in mpt_handshake_req_reply_wait()
4659 ioc->hs_reply_idx = 0; in mpt_handshake_req_reply_wait()
4661 mptReply->MsgLength = 0; in mpt_handshake_req_reply_wait()
4664 * Make sure there are no doorbells (WRITE 0 to IntStatus reg), in mpt_handshake_req_reply_wait()
4668 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in mpt_handshake_req_reply_wait()
4676 if ((t = WaitForDoorbellInt(ioc, 5, sleepFlag)) < 0) in mpt_handshake_req_reply_wait()
4687 * Clear doorbell int (WRITE 0 to IntStatus reg), in mpt_handshake_req_reply_wait()
4691 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in mpt_handshake_req_reply_wait()
4692 if (!failcnt && (t = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) in mpt_handshake_req_reply_wait()
4703 for (ii = 0; !failcnt && ii < reqBytes/4; ii++) { in mpt_handshake_req_reply_wait()
4704 u32 word = ((req_as_bytes[(ii*4) + 0] << 0) | in mpt_handshake_req_reply_wait()
4710 if ((t = WaitForDoorbellAck(ioc, 5, sleepFlag)) < 0) in mpt_handshake_req_reply_wait()
4723 if (!failcnt && (t = WaitForDoorbellReply(ioc, maxwait, sleepFlag)) < 0) in mpt_handshake_req_reply_wait()
4732 for (ii=0; ii < min(replyBytes/2,mptReply->MsgLength*2); ii++) in mpt_handshake_req_reply_wait()
4758 int count = 0; in WaitForDoorbellAck()
4759 u32 intstat=0; in WaitForDoorbellAck()
4808 int count = 0; in WaitForDoorbellInt()
4809 u32 intstat=0; in WaitForDoorbellInt()
4857 int u16cnt = 0; in WaitForDoorbellReply()
4858 int failcnt = 0; in WaitForDoorbellReply()
4864 hs_reply[0] = hs_reply[1] = hs_reply[7] = 0; in WaitForDoorbellReply()
4869 u16cnt=0; in WaitForDoorbellReply()
4870 if ((t = WaitForDoorbellInt(ioc, howlong, sleepFlag)) < 0) { in WaitForDoorbellReply()
4873 hs_reply[u16cnt++] = le16_to_cpu(CHIPREG_READ32(&ioc->chip->Doorbell) & 0x0000FFFF); in WaitForDoorbellReply()
4874 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in WaitForDoorbellReply()
4875 if ((t = WaitForDoorbellInt(ioc, 5, sleepFlag)) < 0) in WaitForDoorbellReply()
4878 hs_reply[u16cnt++] = le16_to_cpu(CHIPREG_READ32(&ioc->chip->Doorbell) & 0x0000FFFF); in WaitForDoorbellReply()
4879 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in WaitForDoorbellReply()
4888 * If no error (and IOC said MsgLength is > 0), piece together in WaitForDoorbellReply()
4892 if ((t = WaitForDoorbellInt(ioc, 5, sleepFlag)) < 0) in WaitForDoorbellReply()
4894 hword = le16_to_cpu(CHIPREG_READ32(&ioc->chip->Doorbell) & 0x0000FFFF); in WaitForDoorbellReply()
4898 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in WaitForDoorbellReply()
4901 if (!failcnt && (t = WaitForDoorbellInt(ioc, 5, sleepFlag)) < 0) in WaitForDoorbellReply()
4903 CHIPREG_WRITE32(&ioc->chip->IntStatus, 0); in WaitForDoorbellReply()
4910 #if 0 in WaitForDoorbellReply()
4932 * Return: 0 for success
4947 int rc = 0; in GetLanConfigPages()
4951 /* Get LAN Page 0 header */ in GetLanConfigPages()
4952 hdr.PageVersion = 0; in GetLanConfigPages()
4953 hdr.PageLength = 0; in GetLanConfigPages()
4954 hdr.PageNumber = 0; in GetLanConfigPages()
4959 cfg.dir = 0; in GetLanConfigPages()
4960 cfg.pageAddr = 0; in GetLanConfigPages()
4961 cfg.timeout = 0; in GetLanConfigPages()
4963 if ((rc = mpt_config(ioc, &cfg)) != 0) in GetLanConfigPages()
4966 if (hdr.PageLength > 0) { in GetLanConfigPages()
4972 memset((u8 *)ppage0_alloc, 0, data_sz); in GetLanConfigPages()
4976 if ((rc = mpt_config(ioc, &cfg)) == 0) { in GetLanConfigPages()
4998 hdr.PageVersion = 0; in GetLanConfigPages()
4999 hdr.PageLength = 0; in GetLanConfigPages()
5005 cfg.dir = 0; in GetLanConfigPages()
5006 cfg.pageAddr = 0; in GetLanConfigPages()
5008 if ((rc = mpt_config(ioc, &cfg)) != 0) in GetLanConfigPages()
5011 if (hdr.PageLength == 0) in GetLanConfigPages()
5012 return 0; in GetLanConfigPages()
5019 memset((u8 *)ppage1_alloc, 0, data_sz); in GetLanConfigPages()
5023 if ((rc = mpt_config(ioc, &cfg)) == 0) { in GetLanConfigPages()
5056 * Returns 0 for success, non-zero error
5067 int ret = 0; in mptbase_sas_persist_operation()
5073 memset(ioc->mptbase_cmds.reply, 0 , MPT_DEFAULT_FRAME_SIZE); in mptbase_sas_persist_operation()
5101 memset(sasIoUnitCntrReq,0,sizeof(SasIoUnitControlRequest_t)); in mptbase_sas_persist_operation()
5115 "Issuing Reset from %s!!, doorbell=0x%08x\n", in mptbase_sas_persist_operation()
5116 ioc->name, __func__, mpt_GetIocState(ioc, 0)); in mptbase_sas_persist_operation()
5131 printk(KERN_DEBUG "%s: IOCStatus=0x%X IOCLogInfo=0x%X\n", in mptbase_sas_persist_operation()
5162 flags = (status >> 0) & 0xff; in mptbase_raid_process_event_data()
5163 state = (status >> 8) & 0xff; in mptbase_raid_process_event_data()
5282 * Returns: 0 for success
5299 hdr.PageVersion = 0; in GetIoUnitPage2()
5300 hdr.PageLength = 0; in GetIoUnitPage2()
5306 cfg.dir = 0; in GetIoUnitPage2()
5307 cfg.pageAddr = 0; in GetIoUnitPage2()
5308 cfg.timeout = 0; in GetIoUnitPage2()
5310 if ((rc = mpt_config(ioc, &cfg)) != 0) in GetIoUnitPage2()
5313 if (hdr.PageLength == 0) in GetIoUnitPage2()
5314 return 0; in GetIoUnitPage2()
5322 memset((u8 *)ppage_alloc, 0, data_sz); in GetIoUnitPage2()
5327 if ((rc = mpt_config(ioc, &cfg)) == 0) in GetIoUnitPage2()
5339 * mpt_GetScsiPortSettings - read SCSI Port Page 0 and 2
5345 * If read of SCSI Port Page 0 fails,
5346 * NVRAM = MPT_HOST_NVRAM_INVALID (0xFFFFFFFF)
5351 * NVRAM = MPT_HOST_NVRAM_INVALID (0xFFFFFFFF)
5355 * Return 0
5366 int data, rc = 0; in mpt_GetScsiPortSettings()
5386 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) { in mpt_GetScsiPortSettings()
5392 header.PageVersion = 0; in mpt_GetScsiPortSettings()
5393 header.PageLength = 0; in mpt_GetScsiPortSettings()
5394 header.PageNumber = 0; in mpt_GetScsiPortSettings()
5400 cfg.dir = 0; in mpt_GetScsiPortSettings()
5401 cfg.timeout = 0; /* use default */ in mpt_GetScsiPortSettings()
5402 if (mpt_config(ioc, &cfg) != 0) in mpt_GetScsiPortSettings()
5405 if (header.PageLength > 0) { in mpt_GetScsiPortSettings()
5412 if (mpt_config(ioc, &cfg) != 0) { in mpt_GetScsiPortSettings()
5414 ioc->spi_data.maxSyncOffset = 0; in mpt_GetScsiPortSettings()
5422 /* Save the Port Page 0 data in mpt_GetScsiPortSettings()
5428 if ( (pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_QAS) == 0 ) { in mpt_GetScsiPortSettings()
5434 ioc->spi_data.maxBusWidth = pPP0->Capabilities & MPI_SCSIPORTPAGE0_CAP_WIDE ? 1 : 0; in mpt_GetScsiPortSettings()
5444 ioc->spi_data.maxSyncOffset = 0; in mpt_GetScsiPortSettings()
5473 header.PageVersion = 0; in mpt_GetScsiPortSettings()
5474 header.PageLength = 0; in mpt_GetScsiPortSettings()
5481 cfg.dir = 0; in mpt_GetScsiPortSettings()
5482 if (mpt_config(ioc, &cfg) != 0) in mpt_GetScsiPortSettings()
5485 if (header.PageLength > 0) { in mpt_GetScsiPortSettings()
5494 if (mpt_config(ioc, &cfg) != 0) { in mpt_GetScsiPortSettings()
5509 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) { in mpt_GetScsiPortSettings()
5512 data = 0; in mpt_GetScsiPortSettings()
5540 0 : 1 ; in mpt_GetScsiPortSettings()
5547 for (ii=0; ii < MPT_MAX_SCSI_DEVICES; ii++) { in mpt_GetScsiPortSettings()
5576 * or 0 if success.
5586 header.PageVersion = 0; in mpt_readScsiDevicePageHeaders()
5587 header.PageLength = 0; in mpt_readScsiDevicePageHeaders()
5594 cfg.dir = 0; in mpt_readScsiDevicePageHeaders()
5595 cfg.timeout = 0; in mpt_readScsiDevicePageHeaders()
5596 if (mpt_config(ioc, &cfg) != 0) in mpt_readScsiDevicePageHeaders()
5602 header.PageVersion = 0; in mpt_readScsiDevicePageHeaders()
5603 header.PageLength = 0; in mpt_readScsiDevicePageHeaders()
5604 header.PageNumber = 0; in mpt_readScsiDevicePageHeaders()
5606 if (mpt_config(ioc, &cfg) != 0) in mpt_readScsiDevicePageHeaders()
5612 dcprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Headers: 0: version %d length %d\n", in mpt_readScsiDevicePageHeaders()
5617 return 0; in mpt_readScsiDevicePageHeaders()
5660 memset(&cfg, 0 , sizeof(CONFIGPARMS)); in mpt_inactive_raid_volumes()
5661 memset(&hdr, 0 , sizeof(ConfigPageHeader_t)); in mpt_inactive_raid_volumes()
5667 if (mpt_config(ioc, &cfg) != 0) in mpt_inactive_raid_volumes()
5682 if (mpt_config(ioc, &cfg) != 0) in mpt_inactive_raid_volumes()
5690 (buffer->VolumeStatus.Flags & MPI_RAIDVOL0_STATUS_FLAG_ENABLED) == 0 || in mpt_inactive_raid_volumes()
5692 buffer->VolumeStatus.State == MPI_RAIDVOL0_STATUS_STATE_MISSING) ? 1 : 0; in mpt_inactive_raid_volumes()
5698 for (i = 0; i < buffer->NumPhysDisks; i++) { in mpt_inactive_raid_volumes()
5700 buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0) in mpt_inactive_raid_volumes()
5731 * 0 on success
5745 memset(&cfg, 0 , sizeof(CONFIGPARMS)); in mpt_raid_phys_disk_pg0()
5746 memset(&hdr, 0 , sizeof(ConfigPageHeader_t)); in mpt_raid_phys_disk_pg0()
5747 memset(phys_disk, 0, sizeof(RaidPhysDiskPage0_t)); in mpt_raid_phys_disk_pg0()
5755 if (mpt_config(ioc, &cfg) != 0) { in mpt_raid_phys_disk_pg0()
5777 if (mpt_config(ioc, &cfg) != 0) { in mpt_raid_phys_disk_pg0()
5782 rc = 0; in mpt_raid_phys_disk_pg0()
5812 memset(&cfg, 0 , sizeof(CONFIGPARMS)); in mpt_raid_phys_disk_get_num_paths()
5813 memset(&hdr, 0 , sizeof(ConfigPageHeader_t)); in mpt_raid_phys_disk_get_num_paths()
5822 if (mpt_config(ioc, &cfg) != 0) { in mpt_raid_phys_disk_get_num_paths()
5823 rc = 0; in mpt_raid_phys_disk_get_num_paths()
5828 rc = 0; in mpt_raid_phys_disk_get_num_paths()
5836 rc = 0; in mpt_raid_phys_disk_get_num_paths()
5844 if (mpt_config(ioc, &cfg) != 0) { in mpt_raid_phys_disk_get_num_paths()
5845 rc = 0; in mpt_raid_phys_disk_get_num_paths()
5867 * 0 on success
5883 memset(&cfg, 0 , sizeof(CONFIGPARMS)); in mpt_raid_phys_disk_pg1()
5884 memset(&hdr, 0 , sizeof(ConfigPageHeader_t)); in mpt_raid_phys_disk_pg1()
5885 rc = 0; in mpt_raid_phys_disk_pg1()
5894 if (mpt_config(ioc, &cfg) != 0) { in mpt_raid_phys_disk_pg1()
5916 if (mpt_config(ioc, &cfg) != 0) { in mpt_raid_phys_disk_pg1()
5923 for (i = 0; i < phys_disk->NumPhysDiskPaths; i++) { in mpt_raid_phys_disk_pg1()
5955 * 0 on success
5967 int rc = 0; in mpt_findImVolumes()
5972 return 0; in mpt_findImVolumes()
5982 header.PageVersion = 0; in mpt_findImVolumes()
5983 header.PageLength = 0; in mpt_findImVolumes()
5988 cfg.pageAddr = 0; in mpt_findImVolumes()
5990 cfg.dir = 0; in mpt_findImVolumes()
5991 cfg.timeout = 0; in mpt_findImVolumes()
5992 if (mpt_config(ioc, &cfg) != 0) in mpt_findImVolumes()
5995 if (header.PageLength == 0) in mpt_findImVolumes()
6006 if (mpt_config(ioc, &cfg) != 0) in mpt_findImVolumes()
6019 for (i = 0; i < pIoc2->NumActiveVolumes ; i++) in mpt_findImVolumes()
6038 int iocpage3sz = 0; in mpt_read_ioc_pg_3()
6048 header.PageVersion = 0; in mpt_read_ioc_pg_3()
6049 header.PageLength = 0; in mpt_read_ioc_pg_3()
6054 cfg.pageAddr = 0; in mpt_read_ioc_pg_3()
6056 cfg.dir = 0; in mpt_read_ioc_pg_3()
6057 cfg.timeout = 0; in mpt_read_ioc_pg_3()
6058 if (mpt_config(ioc, &cfg) != 0) in mpt_read_ioc_pg_3()
6059 return 0; in mpt_read_ioc_pg_3()
6061 if (header.PageLength == 0) in mpt_read_ioc_pg_3()
6062 return 0; in mpt_read_ioc_pg_3()
6070 return 0; in mpt_read_ioc_pg_3()
6077 if (mpt_config(ioc, &cfg) == 0) { in mpt_read_ioc_pg_3()
6087 return 0; in mpt_read_ioc_pg_3()
6101 header.PageVersion = 0; in mpt_read_ioc_pg_4()
6102 header.PageLength = 0; in mpt_read_ioc_pg_4()
6107 cfg.pageAddr = 0; in mpt_read_ioc_pg_4()
6109 cfg.dir = 0; in mpt_read_ioc_pg_4()
6110 cfg.timeout = 0; in mpt_read_ioc_pg_4()
6111 if (mpt_config(ioc, &cfg) != 0) in mpt_read_ioc_pg_4()
6114 if (header.PageLength == 0) in mpt_read_ioc_pg_4()
6133 if (mpt_config(ioc, &cfg) == 0) { in mpt_read_ioc_pg_4()
6152 int iocpage1sz = 0; in mpt_read_ioc_pg_1()
6157 header.PageVersion = 0; in mpt_read_ioc_pg_1()
6158 header.PageLength = 0; in mpt_read_ioc_pg_1()
6163 cfg.pageAddr = 0; in mpt_read_ioc_pg_1()
6165 cfg.dir = 0; in mpt_read_ioc_pg_1()
6166 cfg.timeout = 0; in mpt_read_ioc_pg_1()
6167 if (mpt_config(ioc, &cfg) != 0) in mpt_read_ioc_pg_1()
6170 if (header.PageLength == 0) in mpt_read_ioc_pg_1()
6185 if (mpt_config(ioc, &cfg) == 0) { in mpt_read_ioc_pg_1()
6201 if (mpt_config(ioc, &cfg) == 0) { in mpt_read_ioc_pg_1()
6206 if (mpt_config(ioc, &cfg) == 0) { in mpt_read_ioc_pg_1()
6241 memset(&cfg, 0 , sizeof(CONFIGPARMS)); in mpt_get_manufacturing_pg_0()
6242 memset(&hdr, 0 , sizeof(ConfigPageHeader_t)); in mpt_get_manufacturing_pg_0()
6250 if (mpt_config(ioc, &cfg) != 0) in mpt_get_manufacturing_pg_0()
6264 if (mpt_config(ioc, &cfg) != 0) in mpt_get_manufacturing_pg_0()
6291 memset(&evn, 0, sizeof(EventNotification_t)); in SendEventNotification()
6292 memset(&reply_buf, 0, sizeof(MPIDefaultReply_t)); in SendEventNotification()
6327 pAck->ChainOffset = 0; in SendEventAck()
6328 pAck->Reserved[0] = pAck->Reserved[1] = 0; in SendEventAck()
6329 pAck->MsgFlags = 0; in SendEventAck()
6330 pAck->Reserved1[0] = pAck->Reserved1[1] = pAck->Reserved1[2] = 0; in SendEventAck()
6336 return 0; in SendEventAck()
6348 * Returns 0 for success
6363 u8 page_type = 0, extend_page; in mpt_config()
6366 u8 issue_hard_reset = 0; in mpt_config()
6367 u8 retry_count = 0; in mpt_config()
6387 mpt_GetIocState(ioc, 0))); in mpt_config()
6394 memset(ioc->mptbase_cmds.reply, 0 , MPT_DEFAULT_FRAME_SIZE); in mpt_config()
6408 pReq->Reserved = 0; in mpt_config()
6409 pReq->ChainOffset = 0; in mpt_config()
6413 pReq->ExtPageLength = 0; in mpt_config()
6414 pReq->ExtPageType = 0; in mpt_config()
6415 pReq->MsgFlags = 0; in mpt_config()
6417 for (ii=0; ii < 8; ii++) in mpt_config()
6418 pReq->Reserved2[ii] = 0; in mpt_config()
6434 pReq->Header.PageLength = 0; in mpt_config()
6454 extend_page = 0; in mpt_config()
6458 "Sending Config request type 0x%x, page 0x%x and action %d\n", in mpt_config()
6469 "Failed Sending Config request type 0x%x, page 0x%x," in mpt_config()
6514 "ret=0x%x timeleft=%ld\n", in mpt_config()
6525 issue_hard_reset = 0; in mpt_config()
6527 "Issuing Reset from %s!!, doorbell=0x%08x\n", in mpt_config()
6528 ioc->name, __func__, mpt_GetIocState(ioc, 0)); in mpt_config()
6529 if (retry_count == 0) { in mpt_config()
6530 if (mpt_Soft_Hard_ResetHandler(ioc, CAN_SLEEP) != 0) in mpt_config()
6540 " type 0x%x, page 0x%x," in mpt_config()
6605 * Returns 0 for success, non-zero for failure.
6618 return 0; in procmpt_create()
6625 * Returns 0 for success, non-zero for failure.
6653 return 0; in mpt_summary_proc_show()
6665 scsi = fc = sas = lan = ctl = targ = 0; in mpt_version_proc_show()
6695 return 0; in mpt_version_proc_show()
6713 seq_printf(m, "\n ProductID = 0x%04x (%s)\n", in mpt_iocinfo_proc_show()
6716 seq_printf(m, " FWVersion = 0x%08x%s", ioc->facts.FWVersion.Word, expVer); in mpt_iocinfo_proc_show()
6719 seq_printf(m, "\n MsgVersion = 0x%04x\n", ioc->facts.MsgVersion); in mpt_iocinfo_proc_show()
6720 seq_printf(m, " FirstWhoInit = 0x%02x\n", ioc->FirstWhoInit); in mpt_iocinfo_proc_show()
6721 seq_printf(m, " EventState = 0x%02x\n", ioc->facts.EventState); in mpt_iocinfo_proc_show()
6723 seq_printf(m, " CurrentHostMfaHighAddr = 0x%08x\n", in mpt_iocinfo_proc_show()
6725 seq_printf(m, " CurrentSenseBufferHighAddr = 0x%08x\n", in mpt_iocinfo_proc_show()
6728 seq_printf(m, " MaxChainDepth = 0x%02x frames\n", ioc->facts.MaxChainDepth); in mpt_iocinfo_proc_show()
6729 seq_printf(m, " MinBlockSize = 0x%02x bytes\n", 4*ioc->facts.BlockSize); in mpt_iocinfo_proc_show()
6731 seq_printf(m, " RequestFrames @ 0x%p (Dma @ 0x%p)\n", in mpt_iocinfo_proc_show()
6737 sz = ((sz + 0x1000UL - 1UL) / 0x1000) * 0x1000; in mpt_iocinfo_proc_show()
6738 seq_printf(m, " {CurReqSz=%d} x {CurReqDepth=%d} = %d bytes ^= 0x%x\n", in mpt_iocinfo_proc_show()
6744 seq_printf(m, " Frames @ 0x%p (Dma @ 0x%p)\n", in mpt_iocinfo_proc_show()
6747 seq_printf(m, " {CurRepSz=%d} x {CurRepDepth=%d} = %d bytes ^= 0x%x\n", in mpt_iocinfo_proc_show()
6754 (ioc->facts.MaxDevices==0) ? 255 : ioc->facts.MaxDevices); in mpt_iocinfo_proc_show()
6758 for (p=0; p < ioc->facts.NumberOfPorts; p++) { in mpt_iocinfo_proc_show()
6775 return 0; in mpt_iocinfo_proc_show()
6783 buf[0] ='\0'; in mpt_get_fw_exp_ver()
6784 if ((ioc->facts.FWVersion.Word >> 24) == 0x0E) { in mpt_get_fw_exp_ver()
6786 (ioc->facts.FWVersion.Word >> 16) & 0x00FF, /* Month */ in mpt_get_fw_exp_ver()
6787 (ioc->facts.FWVersion.Word >> 8) & 0x1F); /* Day */ in mpt_get_fw_exp_ver()
6790 if ((ioc->facts.FWVersion.Word >> 8) & 0x80) in mpt_get_fw_exp_ver()
6827 if (showlan && (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN)) { in mpt_print_ioc_summary()
6861 if (showlan && (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN)) { in seq_mpt_print_ioc_summary()
6879 * Returns 0 for SUCCESS or -1 if FAILED.
6895 retval = 0; in mpt_set_taskmgmt_in_progress_flag()
6919 ioc->taskmgmt_in_progress = 0; in mpt_clear_taskmgmt_in_progress_flag()
6920 ioc->taskmgmt_quiesce_io = 0; in mpt_clear_taskmgmt_in_progress_flag()
6922 ioc->alt_ioc->taskmgmt_in_progress = 0; in mpt_clear_taskmgmt_in_progress_flag()
6923 ioc->alt_ioc->taskmgmt_quiesce_io = 0; in mpt_clear_taskmgmt_in_progress_flag()
6941 ioc_raw_state = mpt_GetIocState(ioc, 0); in mpt_halt_firmware()
6949 CHIPREG_WRITE32(&ioc->chip->Doorbell, 0xC0FFEE00); in mpt_halt_firmware()
6961 * Returns 0 for SUCCESS or -1 if FAILED.
6982 ioc_state = mpt_GetIocState(ioc, 0) & MPI_IOC_STATE_MASK; in mpt_SoftResetHandler()
7015 ioc->ioc_reset_in_progress = 0; in mpt_SoftResetHandler()
7021 CHIPREG_WRITE32(&ioc->chip->IntMask, 0xFFFFFFFF); in mpt_SoftResetHandler()
7022 ioc->active = 0; in mpt_SoftResetHandler()
7035 ioc_state = mpt_GetIocState(ioc, 0) & MPI_IOC_STATE_MASK; in mpt_SoftResetHandler()
7039 for (ii = 0; ii < 5; ii++) { in mpt_SoftResetHandler()
7043 if (rc == 0) in mpt_SoftResetHandler()
7054 if (rc != 0) in mpt_SoftResetHandler()
7058 if (rc != 0) in mpt_SoftResetHandler()
7062 if (rc != 0) in mpt_SoftResetHandler()
7077 ioc->ioc_reset_in_progress = 0; in mpt_SoftResetHandler()
7078 ioc->taskmgmt_quiesce_io = 0; in mpt_SoftResetHandler()
7079 ioc->taskmgmt_in_progress = 0; in mpt_SoftResetHandler()
7093 ((rc == 0) ? "SUCCESS" : "FAILED"))); in mpt_SoftResetHandler()
7103 * Returns 0 for SUCCESS or -1 if FAILED.
7112 if (ret == 0) in mpt_Soft_Hard_ResetHandler()
7138 * Returns 0 for SUCCESS or -1 if FAILED.
7151 printk("MF count 0x%x !\n", ioc->mfcnt); in mpt_HardResetHandler()
7166 ioc->wait_on_reset_completion = 0; in mpt_HardResetHandler()
7171 rc = 0; in mpt_HardResetHandler()
7197 if (rc != 0) { in mpt_HardResetHandler()
7199 ": WARNING - (%d) Cannot recover %s, doorbell=0x%08x\n", in mpt_HardResetHandler()
7200 rc, ioc->name, mpt_GetIocState(ioc, 0)); in mpt_HardResetHandler()
7207 ioc->ioc_reset_in_progress = 0; in mpt_HardResetHandler()
7208 ioc->taskmgmt_quiesce_io = 0; in mpt_HardResetHandler()
7209 ioc->taskmgmt_in_progress = 0; in mpt_HardResetHandler()
7212 ioc->alt_ioc->ioc_reset_in_progress = 0; in mpt_HardResetHandler()
7213 ioc->alt_ioc->taskmgmt_quiesce_io = 0; in mpt_HardResetHandler()
7214 ioc->alt_ioc->taskmgmt_in_progress = 0; in mpt_HardResetHandler()
7230 jiffies_to_msecs(jiffies - time_count)/1000, ((rc == 0) ? in mpt_HardResetHandler()
7246 event = le32_to_cpu(pEventReply->Event) & 0xFF; in mpt_display_event_info()
7247 evData0 = le32_to_cpu(pEventReply->Data[0]); in mpt_display_event_info()
7574 "width=%d primitive=0x%02x", in mpt_display_event_info()
7616 "SAS SMP Error: port=%d result=0x%02x", in mpt_display_event_info()
7636 "SAS SMP Error: port=%d : status=0x%02x", in mpt_display_event_info()
7676 for (ii = 0; ii < le16_to_cpu(pEventReply->EventDataLength); ii++) in mpt_display_event_info()
7697 u32 evData0 = 0; in ProcessEventNotification()
7700 int r = 0; in ProcessEventNotification()
7701 int handlers = 0; in ProcessEventNotification()
7707 event = le32_to_cpu(pEventReply->Event) & 0xFF; in ProcessEventNotification()
7710 evData0 = le32_to_cpu(pEventReply->Data[0]); in ProcessEventNotification()
7722 case MPI_EVENT_EVENT_CHANGE: /* 0A */ in ProcessEventNotification()
7724 u8 evState = evData0 & 0xFF; in ProcessEventNotification()
7726 /* CHECKME! What if evState unexpectedly says OFF (0)? */ in ProcessEventNotification()
7754 for (ii = 0; ii < 2; ii++) { in ProcessEventNotification()
7758 ioc->events[idx].data[ii] = 0; in ProcessEventNotification()
7785 if ((ii = SendEventAck(ioc, pEventReply)) != 0) { in ProcessEventNotification()
7808 switch (log_info & 0xFF000000) { in mpt_fc_log_info()
7835 printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x): SubClass={%s}, Value=(0x%06x)\n", in mpt_fc_log_info()
7836 ioc->name, log_info, desc, (log_info & 0xFFFFFF)); in mpt_fc_log_info()
7850 u32 info = log_info & 0x00FF0000; in mpt_spi_log_info()
7854 case 0x00010000: in mpt_spi_log_info()
7858 case 0x00020000: in mpt_spi_log_info()
7862 case 0x00030000: in mpt_spi_log_info()
7866 case 0x00040000: in mpt_spi_log_info()
7870 case 0x00050000: in mpt_spi_log_info()
7874 case 0x00060000: in mpt_spi_log_info()
7878 case 0x00070000: in mpt_spi_log_info()
7882 case 0x00080000: in mpt_spi_log_info()
7886 case 0x00090000: in mpt_spi_log_info()
7890 case 0x000A0000: in mpt_spi_log_info()
7894 case 0x000B0000: in mpt_spi_log_info()
7898 case 0x000C0000: in mpt_spi_log_info()
7904 printk(MYIOC_s_INFO_FMT "LogInfo(0x%08x): F/W: %s\n", ioc->name, log_info, desc); in mpt_spi_log_info()
7934 "Receive Frame Invalid Message", /* 0Ah */
7935 "Receive Context Message Valid Error", /* 0Bh */
7936 "Receive Frame Current Frame Error", /* 0Ch */
7937 "SATA Link Down", /* 0Dh */
7938 "Discovery SATA Init W IOS", /* 0Eh */
7939 "Config Invalid Page", /* 0Fh */
7986 NULL, /* 0Ah */
7987 NULL, /* 0Bh */
7988 NULL, /* 0Ch */
7989 NULL, /* 0Dh */
7990 NULL, /* 0Eh */
7991 NULL, /* 0Fh */
8085 case 0: /* IOP */ in mpt_sas_log_info()
8103 if (sas_loginfo.dw.code == 0) in mpt_sas_log_info()
8113 "LogInfo(0x%08x): Originator={%s}, Code={%s}," in mpt_sas_log_info()
8119 "LogInfo(0x%08x): Originator={%s}, Code={%s}," in mpt_sas_log_info()
8120 " SubCode(0x%04x) cb_idx %s\n", in mpt_sas_log_info()
8125 "LogInfo(0x%08x): Originator={%s}, Code=(0x%02x)," in mpt_sas_log_info()
8126 " SubCode(0x%04x) cb_idx %s\n", in mpt_sas_log_info()
8179 case MPI_IOCSTATUS_CONFIG_INVALID_ACTION: /* 0x0020 */ in mpt_iocstatus_info_config()
8183 case MPI_IOCSTATUS_CONFIG_INVALID_TYPE: /* 0x0021 */ in mpt_iocstatus_info_config()
8187 case MPI_IOCSTATUS_CONFIG_INVALID_PAGE: /* 0x0022 */ in mpt_iocstatus_info_config()
8191 case MPI_IOCSTATUS_CONFIG_INVALID_DATA: /* 0x0023 */ in mpt_iocstatus_info_config()
8195 case MPI_IOCSTATUS_CONFIG_NO_DEFAULTS: /* 0x0024 */ in mpt_iocstatus_info_config()
8199 case MPI_IOCSTATUS_CONFIG_CANT_COMMIT: /* 0x0025 */ in mpt_iocstatus_info_config()
8207 dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT "IOCStatus(0x%04X): %s: %s\n", in mpt_iocstatus_info_config()
8231 case MPI_IOCSTATUS_INVALID_FUNCTION: /* 0x0001 */ in mpt_iocstatus_info()
8235 case MPI_IOCSTATUS_BUSY: /* 0x0002 */ in mpt_iocstatus_info()
8239 case MPI_IOCSTATUS_INVALID_SGL: /* 0x0003 */ in mpt_iocstatus_info()
8243 case MPI_IOCSTATUS_INTERNAL_ERROR: /* 0x0004 */ in mpt_iocstatus_info()
8247 case MPI_IOCSTATUS_RESERVED: /* 0x0005 */ in mpt_iocstatus_info()
8251 case MPI_IOCSTATUS_INSUFFICIENT_RESOURCES: /* 0x0006 */ in mpt_iocstatus_info()
8255 case MPI_IOCSTATUS_INVALID_FIELD: /* 0x0007 */ in mpt_iocstatus_info()
8259 case MPI_IOCSTATUS_INVALID_STATE: /* 0x0008 */ in mpt_iocstatus_info()
8267 case MPI_IOCSTATUS_CONFIG_INVALID_ACTION: /* 0x0020 */ in mpt_iocstatus_info()
8268 case MPI_IOCSTATUS_CONFIG_INVALID_TYPE: /* 0x0021 */ in mpt_iocstatus_info()
8269 case MPI_IOCSTATUS_CONFIG_INVALID_PAGE: /* 0x0022 */ in mpt_iocstatus_info()
8270 case MPI_IOCSTATUS_CONFIG_INVALID_DATA: /* 0x0023 */ in mpt_iocstatus_info()
8271 case MPI_IOCSTATUS_CONFIG_NO_DEFAULTS: /* 0x0024 */ in mpt_iocstatus_info()
8272 case MPI_IOCSTATUS_CONFIG_CANT_COMMIT: /* 0x0025 */ in mpt_iocstatus_info()
8283 case MPI_IOCSTATUS_SCSI_RECOVERED_ERROR: /* 0x0040 */ in mpt_iocstatus_info()
8284 case MPI_IOCSTATUS_SCSI_DATA_UNDERRUN: /* 0x0045 */ in mpt_iocstatus_info()
8285 case MPI_IOCSTATUS_SCSI_INVALID_BUS: /* 0x0041 */ in mpt_iocstatus_info()
8286 case MPI_IOCSTATUS_SCSI_INVALID_TARGETID: /* 0x0042 */ in mpt_iocstatus_info()
8287 case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */ in mpt_iocstatus_info()
8288 case MPI_IOCSTATUS_SCSI_DATA_OVERRUN: /* 0x0044 */ in mpt_iocstatus_info()
8289 case MPI_IOCSTATUS_SCSI_IO_DATA_ERROR: /* 0x0046 */ in mpt_iocstatus_info()
8290 case MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR: /* 0x0047 */ in mpt_iocstatus_info()
8291 case MPI_IOCSTATUS_SCSI_TASK_TERMINATED: /* 0x0048 */ in mpt_iocstatus_info()
8292 case MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: /* 0x0049 */ in mpt_iocstatus_info()
8293 case MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED: /* 0x004A */ in mpt_iocstatus_info()
8294 case MPI_IOCSTATUS_SCSI_IOC_TERMINATED: /* 0x004B */ in mpt_iocstatus_info()
8295 case MPI_IOCSTATUS_SCSI_EXT_TERMINATED: /* 0x004C */ in mpt_iocstatus_info()
8302 case MPI_IOCSTATUS_TARGET_PRIORITY_IO: /* 0x0060 */ in mpt_iocstatus_info()
8306 case MPI_IOCSTATUS_TARGET_INVALID_PORT: /* 0x0061 */ in mpt_iocstatus_info()
8310 case MPI_IOCSTATUS_TARGET_INVALID_IO_INDEX: /* 0x0062 */ in mpt_iocstatus_info()
8314 case MPI_IOCSTATUS_TARGET_ABORTED: /* 0x0063 */ in mpt_iocstatus_info()
8318 case MPI_IOCSTATUS_TARGET_NO_CONN_RETRYABLE: /* 0x0064 */ in mpt_iocstatus_info()
8322 case MPI_IOCSTATUS_TARGET_NO_CONNECTION: /* 0x0065 */ in mpt_iocstatus_info()
8326 case MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH: /* 0x006A */ in mpt_iocstatus_info()
8330 case MPI_IOCSTATUS_TARGET_STS_DATA_NOT_SENT: /* 0x006B */ in mpt_iocstatus_info()
8334 case MPI_IOCSTATUS_TARGET_DATA_OFFSET_ERROR: /* 0x006D */ in mpt_iocstatus_info()
8338 case MPI_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA: /* 0x006E */ in mpt_iocstatus_info()
8342 case MPI_IOCSTATUS_TARGET_IU_TOO_SHORT: /* 0x006F */ in mpt_iocstatus_info()
8346 case MPI_IOCSTATUS_TARGET_ACK_NAK_TIMEOUT: /* 0x0070 */ in mpt_iocstatus_info()
8350 case MPI_IOCSTATUS_TARGET_NAK_RECEIVED: /* 0x0071 */ in mpt_iocstatus_info()
8358 case MPI_IOCSTATUS_FC_ABORTED: /* 0x0066 */ in mpt_iocstatus_info()
8362 case MPI_IOCSTATUS_FC_RX_ID_INVALID: /* 0x0067 */ in mpt_iocstatus_info()
8366 case MPI_IOCSTATUS_FC_DID_INVALID: /* 0x0068 */ in mpt_iocstatus_info()
8370 case MPI_IOCSTATUS_FC_NODE_LOGGED_OUT: /* 0x0069 */ in mpt_iocstatus_info()
8374 case MPI_IOCSTATUS_FC_EXCHANGE_CANCELED: /* 0x006C */ in mpt_iocstatus_info()
8382 case MPI_IOCSTATUS_LAN_DEVICE_NOT_FOUND: /* 0x0080 */ in mpt_iocstatus_info()
8386 case MPI_IOCSTATUS_LAN_DEVICE_FAILURE: /* 0x0081 */ in mpt_iocstatus_info()
8390 case MPI_IOCSTATUS_LAN_TRANSMIT_ERROR: /* 0x0082 */ in mpt_iocstatus_info()
8394 case MPI_IOCSTATUS_LAN_TRANSMIT_ABORTED: /* 0x0083 */ in mpt_iocstatus_info()
8398 case MPI_IOCSTATUS_LAN_RECEIVE_ERROR: /* 0x0084 */ in mpt_iocstatus_info()
8402 case MPI_IOCSTATUS_LAN_RECEIVE_ABORTED: /* 0x0085 */ in mpt_iocstatus_info()
8406 case MPI_IOCSTATUS_LAN_PARTIAL_PACKET: /* 0x0086 */ in mpt_iocstatus_info()
8410 case MPI_IOCSTATUS_LAN_CANCELED: /* 0x0087 */ in mpt_iocstatus_info()
8418 case MPI_IOCSTATUS_SAS_SMP_REQUEST_FAILED: /* 0x0090 */ in mpt_iocstatus_info()
8422 case MPI_IOCSTATUS_SAS_SMP_DATA_OVERRUN: /* 0x0090 */ in mpt_iocstatus_info()
8434 dreplyprintk(ioc, printk(MYIOC_s_DEBUG_FMT "IOCStatus(0x%04X): %s\n", in mpt_iocstatus_info()
8474 * Returns 0 for success, non-zero for failure.
8484 for (cb_idx = 0; cb_idx < MPT_MAX_PROTOCOL_DRIVERS; cb_idx++) { in fusion_init()
8504 return 0; in fusion_init()