Lines Matching +full:4 +full:mb

95  *	mb[MAX_MAILBOX_REGISTER_COUNT] = returned mailbox data.
161 mcp->mb[0] = MBS_LINK_DOWN_ERROR; in qla2x00_mailbox_command()
171 !is_rom_cmd(mcp->mb[0])) || ha->flags.eeh_busy) { in qla2x00_mailbox_command()
174 mcp->mb[0]); in qla2x00_mailbox_command()
188 mcp->mb[0]); in qla2x00_mailbox_command()
198 ha->flags.purge_mbox, ha->flags.eeh_busy, mcp->mb[0]); in qla2x00_mailbox_command()
208 "Prepare to issue mbox cmd=0x%x.\n", mcp->mb[0]); in qla2x00_mailbox_command()
228 iptr = mcp->mb; in qla2x00_mailbox_command()
229 command = mcp->mb[0]; in qla2x00_mailbox_command()
387 mcp->mb[0] = MBS_LINK_DOWN_ERROR; in qla2x00_mailbox_command()
403 iptr2 = mcp->mb; in qla2x00_mailbox_command()
422 uint16_t mb[8]; in qla2x00_mailbox_command() local
427 mb[0] = rd_reg_word(&reg->isp24.mailbox0); in qla2x00_mailbox_command()
428 mb[1] = rd_reg_word(&reg->isp24.mailbox1); in qla2x00_mailbox_command()
429 mb[2] = rd_reg_word(&reg->isp24.mailbox2); in qla2x00_mailbox_command()
430 mb[3] = rd_reg_word(&reg->isp24.mailbox3); in qla2x00_mailbox_command()
431 mb[7] = rd_reg_word(&reg->isp24.mailbox7); in qla2x00_mailbox_command()
438 "mb[0-3]=[0x%x 0x%x 0x%x 0x%x] mb7 0x%x host_status 0x%x hccr 0x%x\n", in qla2x00_mailbox_command()
439 command, ictrl, jiffies, mb[0], mb[1], mb[2], mb[3], in qla2x00_mailbox_command()
440 mb[7], host_status, hccr); in qla2x00_mailbox_command()
444 mb[0] = RD_MAILBOX_REG(ha, &reg->isp, 0); in qla2x00_mailbox_command()
448 "mb[0]=0x%x\n", command, ictrl, jiffies, mb[0]); in qla2x00_mailbox_command()
477 if (mcp->mb[0] != MBC_GEN_SYSTEM_ERROR) in qla2x00_mailbox_command()
498 mcp->mb[0] != MBC_GEN_SYSTEM_ERROR) { in qla2x00_mailbox_command()
519 "mb[0]=0x%x, eeh_busy=0x%x. Scheduling ISP " in qla2x00_mailbox_command()
520 "abort.\n", command, mcp->mb[0], in qla2x00_mailbox_command()
545 "mb[0]=0x%x. Scheduling ISP abort ", in qla2x00_mailbox_command()
546 command, mcp->mb[0]); in qla2x00_mailbox_command()
574 mcp->mb[0]); in qla2x00_mailbox_command()
581 cnt = 4; in qla2x00_mailbox_command()
584 printk(" mb[%u]=%x", i, mcp->mb[i]); in qla2x00_mailbox_command()
633 mcp->mb[0] = MBC_LOAD_RISC_RAM_EXTENDED; in qla2x00_load_ram()
634 mcp->mb[8] = MSW(risc_addr); in qla2x00_load_ram()
637 mcp->mb[0] = MBC_LOAD_RISC_RAM; in qla2x00_load_ram()
640 mcp->mb[1] = LSW(risc_addr); in qla2x00_load_ram()
641 mcp->mb[2] = MSW(req_dma); in qla2x00_load_ram()
642 mcp->mb[3] = LSW(req_dma); in qla2x00_load_ram()
643 mcp->mb[6] = MSW(MSD(req_dma)); in qla2x00_load_ram()
644 mcp->mb[7] = LSW(MSD(req_dma)); in qla2x00_load_ram()
647 mcp->mb[4] = MSW(risc_code_size); in qla2x00_load_ram()
648 mcp->mb[5] = LSW(risc_code_size); in qla2x00_load_ram()
651 mcp->mb[4] = LSW(risc_code_size); in qla2x00_load_ram()
662 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla2x00_load_ram()
663 rval, mcp->mb[0], mcp->mb[1]); in qla2x00_load_ram()
706 mcp->mb[0] = MBC_EXECUTE_FIRMWARE; in qla2x00_execute_fw()
710 mcp->mb[1] = MSW(risc_addr); in qla2x00_execute_fw()
711 mcp->mb[2] = LSW(risc_addr); in qla2x00_execute_fw()
712 mcp->mb[3] = 0; in qla2x00_execute_fw()
713 mcp->mb[4] = 0; in qla2x00_execute_fw()
714 mcp->mb[11] = 0; in qla2x00_execute_fw()
718 mcp->mb[4] = BIT_0; in qla2x00_execute_fw()
720 mcp->mb[4] |= in qla2x00_execute_fw()
725 mcp->mb[4] |= NVME_ENABLE_FLAG; in qla2x00_execute_fw()
732 mcp->mb[4] |= BIT_4; in qla2x00_execute_fw()
733 mcp->mb[11] |= nv->min_supported_speed & 0xF; in qla2x00_execute_fw()
741 mcp->mb[11] |= BIT_4; in qla2x00_execute_fw()
745 mcp->mb[4] |= ENABLE_EXTENDED_LOGIN; in qla2x00_execute_fw()
748 mcp->mb[4] |= ENABLE_EXCHANGE_OFFLD; in qla2x00_execute_fw()
751 mcp->mb[11] |= EXE_FW_FORCE_SEMAPHORE; in qla2x00_execute_fw()
756 mcp->mb[1] = LSW(risc_addr); in qla2x00_execute_fw()
759 mcp->mb[2] = 0; in qla2x00_execute_fw()
770 mcp->mb[1] == 0x27 && retry) { in qla2x00_execute_fw()
781 "Exe FW retry: mb[0]=%x retry[%d]\n", mcp->mb[0], retry); in qla2x00_execute_fw()
785 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_execute_fw()
793 ha->fw_ability_mask = mcp->mb[3] << 16 | mcp->mb[2]; in qla2x00_execute_fw()
796 ql_dbg(ql_dbg_mbx, vha, 0x1027, "exchanges=%x.\n", mcp->mb[1]); in qla2x00_execute_fw()
798 ha->max_supported_speed = mcp->mb[2] & (BIT_0|BIT_1); in qla2x00_execute_fw()
804 ha->min_supported_speed = mcp->mb[5] & in qla2x00_execute_fw()
810 ha->min_supported_speed == 4 ? "16Gps" : in qla2x00_execute_fw()
812 ha->min_supported_speed == 2 ? "4Gps" : "unknown"); in qla2x00_execute_fw()
816 if (IS_QLA28XX(ha) && (mcp->mb[5] & EDIF_HW_SUPPORT)) { in qla2x00_execute_fw()
856 memset(mcp->mb, 0 , sizeof(mcp->mb)); in qla_get_exlogin_status()
857 mcp->mb[0] = MBC_GET_MEM_OFFLOAD_CNTRL_STAT; in qla_get_exlogin_status()
858 mcp->mb[1] = FETCH_XLOGINS_STAT; in qla_get_exlogin_status()
868 *buf_sz = mcp->mb[4]; in qla_get_exlogin_status()
869 *ex_logins_cnt = mcp->mb[10]; in qla_get_exlogin_status()
873 mcp->mb[4], mcp->mb[10]); in qla_get_exlogin_status()
913 memset(mcp->mb, 0 , sizeof(mcp->mb)); in qla_set_exlogin_mem_cfg()
914 mcp->mb[0] = MBC_GET_MEM_OFFLOAD_CNTRL_STAT; in qla_set_exlogin_mem_cfg()
915 mcp->mb[1] = CONFIG_XLOGINS_MEM; in qla_set_exlogin_mem_cfg()
916 mcp->mb[2] = MSW(phys_addr); in qla_set_exlogin_mem_cfg()
917 mcp->mb[3] = LSW(phys_addr); in qla_set_exlogin_mem_cfg()
918 mcp->mb[6] = MSW(MSD(phys_addr)); in qla_set_exlogin_mem_cfg()
919 mcp->mb[7] = LSW(MSD(phys_addr)); in qla_set_exlogin_mem_cfg()
920 mcp->mb[8] = MSW(ha->exlogin_size); in qla_set_exlogin_mem_cfg()
921 mcp->mb[9] = LSW(ha->exlogin_size); in qla_set_exlogin_mem_cfg()
930 rval, mcp->mb[0], mcp->mb[11]); in qla_set_exlogin_mem_cfg()
966 memset(mcp->mb, 0 , sizeof(mcp->mb)); in qla_get_exchoffld_status()
967 mcp->mb[0] = MBC_GET_MEM_OFFLOAD_CNTRL_STAT; in qla_get_exchoffld_status()
968 mcp->mb[1] = FETCH_XCHOFFLD_STAT; in qla_get_exchoffld_status()
978 *buf_sz = mcp->mb[4]; in qla_get_exchoffld_status()
979 *ex_logins_cnt = mcp->mb[10]; in qla_get_exchoffld_status()
983 mcp->mb[4], mcp->mb[10]); in qla_get_exchoffld_status()
1023 memset(mcp->mb, 0 , sizeof(mcp->mb)); in qla_set_exchoffld_mem_cfg()
1024 mcp->mb[0] = MBC_GET_MEM_OFFLOAD_CNTRL_STAT; in qla_set_exchoffld_mem_cfg()
1025 mcp->mb[1] = CONFIG_XCHOFFLD_MEM; in qla_set_exchoffld_mem_cfg()
1026 mcp->mb[2] = MSW(ha->exchoffld_buf_dma); in qla_set_exchoffld_mem_cfg()
1027 mcp->mb[3] = LSW(ha->exchoffld_buf_dma); in qla_set_exchoffld_mem_cfg()
1028 mcp->mb[6] = MSW(MSD(ha->exchoffld_buf_dma)); in qla_set_exchoffld_mem_cfg()
1029 mcp->mb[7] = LSW(MSD(ha->exchoffld_buf_dma)); in qla_set_exchoffld_mem_cfg()
1030 mcp->mb[8] = MSW(ha->exchoffld_size); in qla_set_exchoffld_mem_cfg()
1031 mcp->mb[9] = LSW(ha->exchoffld_size); in qla_set_exchoffld_mem_cfg()
1075 mcp->mb[0] = MBC_GET_FIRMWARE_VERSION; in qla2x00_get_fw_version()
1094 ha->fw_major_version = mcp->mb[1]; in qla2x00_get_fw_version()
1095 ha->fw_minor_version = mcp->mb[2]; in qla2x00_get_fw_version()
1096 ha->fw_subminor_version = mcp->mb[3]; in qla2x00_get_fw_version()
1097 ha->fw_attributes = mcp->mb[6]; in qla2x00_get_fw_version()
1101 ha->fw_memory_size = (mcp->mb[5] << 16) | mcp->mb[4]; in qla2x00_get_fw_version()
1104 ha->mpi_version[0] = mcp->mb[10] & 0xff; in qla2x00_get_fw_version()
1105 ha->mpi_version[1] = mcp->mb[11] >> 8; in qla2x00_get_fw_version()
1106 ha->mpi_version[2] = mcp->mb[11] & 0xff; in qla2x00_get_fw_version()
1107 ha->mpi_capabilities = (mcp->mb[12] << 16) | mcp->mb[13]; in qla2x00_get_fw_version()
1108 ha->phy_version[0] = mcp->mb[8] & 0xff; in qla2x00_get_fw_version()
1109 ha->phy_version[1] = mcp->mb[9] >> 8; in qla2x00_get_fw_version()
1110 ha->phy_version[2] = mcp->mb[9] & 0xff; in qla2x00_get_fw_version()
1114 ha->fw_attributes_h = mcp->mb[15]; in qla2x00_get_fw_version()
1115 ha->fw_attributes_ext[0] = mcp->mb[16]; in qla2x00_get_fw_version()
1116 ha->fw_attributes_ext[1] = mcp->mb[17]; in qla2x00_get_fw_version()
1119 __func__, mcp->mb[15], mcp->mb[6]); in qla2x00_get_fw_version()
1122 __func__, mcp->mb[17], mcp->mb[16]); in qla2x00_get_fw_version()
1167 ha->serdes_version[0] = mcp->mb[7] & 0xff; in qla2x00_get_fw_version()
1168 ha->serdes_version[1] = mcp->mb[8] >> 8; in qla2x00_get_fw_version()
1169 ha->serdes_version[2] = mcp->mb[8] & 0xff; in qla2x00_get_fw_version()
1170 ha->mpi_version[0] = mcp->mb[10] & 0xff; in qla2x00_get_fw_version()
1171 ha->mpi_version[1] = mcp->mb[11] >> 8; in qla2x00_get_fw_version()
1172 ha->mpi_version[2] = mcp->mb[11] & 0xff; in qla2x00_get_fw_version()
1173 ha->pep_version[0] = mcp->mb[13] & 0xff; in qla2x00_get_fw_version()
1174 ha->pep_version[1] = mcp->mb[14] >> 8; in qla2x00_get_fw_version()
1175 ha->pep_version[2] = mcp->mb[14] & 0xff; in qla2x00_get_fw_version()
1176 ha->fw_shared_ram_start = (mcp->mb[19] << 16) | mcp->mb[18]; in qla2x00_get_fw_version()
1177 ha->fw_shared_ram_end = (mcp->mb[21] << 16) | mcp->mb[20]; in qla2x00_get_fw_version()
1178 ha->fw_ddr_ram_start = (mcp->mb[23] << 16) | mcp->mb[22]; in qla2x00_get_fw_version()
1179 ha->fw_ddr_ram_end = (mcp->mb[25] << 16) | mcp->mb[24]; in qla2x00_get_fw_version()
1181 if (mcp->mb[16] & BIT_10) in qla2x00_get_fw_version()
1243 mcp->mb[0] = MBC_GET_FIRMWARE_OPTION; in qla2x00_get_fw_options()
1254 fwopts[0] = mcp->mb[0]; in qla2x00_get_fw_options()
1255 fwopts[1] = mcp->mb[1]; in qla2x00_get_fw_options()
1256 fwopts[2] = mcp->mb[2]; in qla2x00_get_fw_options()
1257 fwopts[3] = mcp->mb[3]; in qla2x00_get_fw_options()
1291 mcp->mb[0] = MBC_SET_FIRMWARE_OPTION; in qla2x00_set_fw_options()
1292 mcp->mb[1] = fwopts[1]; in qla2x00_set_fw_options()
1293 mcp->mb[2] = fwopts[2]; in qla2x00_set_fw_options()
1294 mcp->mb[3] = fwopts[3]; in qla2x00_set_fw_options()
1299 mcp->mb[10] = fwopts[10]; in qla2x00_set_fw_options()
1302 mcp->mb[10] = fwopts[10]; in qla2x00_set_fw_options()
1303 mcp->mb[11] = fwopts[11]; in qla2x00_set_fw_options()
1304 mcp->mb[12] = 0; /* Undocumented, but used */ in qla2x00_set_fw_options()
1311 fwopts[0] = mcp->mb[0]; in qla2x00_set_fw_options()
1316 "Failed=%x (%x/%x).\n", rval, mcp->mb[0], mcp->mb[1]); in qla2x00_set_fw_options()
1351 mcp->mb[0] = MBC_MAILBOX_REGISTER_TEST; in qla2x00_mbx_reg_test()
1352 mcp->mb[1] = 0xAAAA; in qla2x00_mbx_reg_test()
1353 mcp->mb[2] = 0x5555; in qla2x00_mbx_reg_test()
1354 mcp->mb[3] = 0xAA55; in qla2x00_mbx_reg_test()
1355 mcp->mb[4] = 0x55AA; in qla2x00_mbx_reg_test()
1356 mcp->mb[5] = 0xA5A5; in qla2x00_mbx_reg_test()
1357 mcp->mb[6] = 0x5A5A; in qla2x00_mbx_reg_test()
1358 mcp->mb[7] = 0x2525; in qla2x00_mbx_reg_test()
1366 if (mcp->mb[1] != 0xAAAA || mcp->mb[2] != 0x5555 || in qla2x00_mbx_reg_test()
1367 mcp->mb[3] != 0xAA55 || mcp->mb[4] != 0x55AA) in qla2x00_mbx_reg_test()
1369 if (mcp->mb[5] != 0xA5A5 || mcp->mb[6] != 0x5A5A || in qla2x00_mbx_reg_test()
1370 mcp->mb[7] != 0x2525) in qla2x00_mbx_reg_test()
1412 mcp->mb[0] = MBC_VERIFY_CHECKSUM; in qla2x00_verify_checksum()
1416 mcp->mb[1] = MSW(risc_addr); in qla2x00_verify_checksum()
1417 mcp->mb[2] = LSW(risc_addr); in qla2x00_verify_checksum()
1421 mcp->mb[1] = LSW(risc_addr); in qla2x00_verify_checksum()
1433 (mcp->mb[2] << 16) | mcp->mb[1] : mcp->mb[1]); in qla2x00_verify_checksum()
1474 mcp->mb[0] = MBC_IOCB_COMMAND_A64; in qla2x00_issue_iocb_timeout()
1475 mcp->mb[1] = 0; in qla2x00_issue_iocb_timeout()
1476 mcp->mb[2] = MSW(LSD(phys_addr)); in qla2x00_issue_iocb_timeout()
1477 mcp->mb[3] = LSW(LSD(phys_addr)); in qla2x00_issue_iocb_timeout()
1478 mcp->mb[6] = MSW(MSD(phys_addr)); in qla2x00_issue_iocb_timeout()
1479 mcp->mb[7] = LSW(MSD(phys_addr)); in qla2x00_issue_iocb_timeout()
1559 mcp->mb[0] = MBC_ABORT_COMMAND; in qla2x00_abort_command()
1561 mcp->mb[1] = fcport->loop_id; in qla2x00_abort_command()
1563 mcp->mb[1] = fcport->loop_id << 8; in qla2x00_abort_command()
1564 mcp->mb[2] = (uint16_t)handle; in qla2x00_abort_command()
1565 mcp->mb[3] = (uint16_t)(handle >> 16); in qla2x00_abort_command()
1566 mcp->mb[6] = (uint16_t)cmd->device->lun; in qla2x00_abort_command()
1596 mcp->mb[0] = MBC_ABORT_TARGET; in qla2x00_abort_target()
1599 mcp->mb[1] = fcport->loop_id; in qla2x00_abort_target()
1600 mcp->mb[10] = 0; in qla2x00_abort_target()
1603 mcp->mb[1] = fcport->loop_id << 8; in qla2x00_abort_target()
1605 mcp->mb[2] = vha->hw->loop_reset_delay; in qla2x00_abort_target()
1606 mcp->mb[9] = vha->vp_idx; in qla2x00_abort_target()
1644 mcp->mb[0] = MBC_LUN_RESET; in qla2x00_lun_reset()
1647 mcp->mb[1] = fcport->loop_id; in qla2x00_lun_reset()
1649 mcp->mb[1] = fcport->loop_id << 8; in qla2x00_lun_reset()
1650 mcp->mb[2] = (u32)l; in qla2x00_lun_reset()
1651 mcp->mb[3] = 0; in qla2x00_lun_reset()
1652 mcp->mb[9] = vha->vp_idx; in qla2x00_lun_reset()
1707 mcp->mb[0] = MBC_GET_ADAPTER_LOOP_ID; in qla2x00_get_adapter_id()
1708 mcp->mb[9] = vha->vp_idx; in qla2x00_get_adapter_id()
1721 if (mcp->mb[0] == MBS_COMMAND_ERROR) in qla2x00_get_adapter_id()
1723 else if (mcp->mb[0] == MBS_INVALID_COMMAND) in qla2x00_get_adapter_id()
1727 *id = mcp->mb[1]; in qla2x00_get_adapter_id()
1728 *al_pa = LSB(mcp->mb[2]); in qla2x00_get_adapter_id()
1729 *area = MSB(mcp->mb[2]); in qla2x00_get_adapter_id()
1730 *domain = LSB(mcp->mb[3]); in qla2x00_get_adapter_id()
1731 *top = mcp->mb[6]; in qla2x00_get_adapter_id()
1732 *sw_cap = mcp->mb[7]; in qla2x00_get_adapter_id()
1742 vha->fcoe_vlan_id = mcp->mb[9] & 0xfff; in qla2x00_get_adapter_id()
1743 vha->fcoe_fcf_idx = mcp->mb[10]; in qla2x00_get_adapter_id()
1744 vha->fcoe_vn_port_mac[5] = mcp->mb[11] >> 8; in qla2x00_get_adapter_id()
1745 vha->fcoe_vn_port_mac[4] = mcp->mb[11] & 0xff; in qla2x00_get_adapter_id()
1746 vha->fcoe_vn_port_mac[3] = mcp->mb[12] >> 8; in qla2x00_get_adapter_id()
1747 vha->fcoe_vn_port_mac[2] = mcp->mb[12] & 0xff; in qla2x00_get_adapter_id()
1748 vha->fcoe_vn_port_mac[1] = mcp->mb[13] >> 8; in qla2x00_get_adapter_id()
1749 vha->fcoe_vn_port_mac[0] = mcp->mb[13] & 0xff; in qla2x00_get_adapter_id()
1753 if (mcp->mb[7] & BIT_14) { in qla2x00_get_adapter_id()
1754 vha->port_name[0] = MSB(mcp->mb[16]); in qla2x00_get_adapter_id()
1755 vha->port_name[1] = LSB(mcp->mb[16]); in qla2x00_get_adapter_id()
1756 vha->port_name[2] = MSB(mcp->mb[17]); in qla2x00_get_adapter_id()
1757 vha->port_name[3] = LSB(mcp->mb[17]); in qla2x00_get_adapter_id()
1758 vha->port_name[4] = MSB(mcp->mb[18]); in qla2x00_get_adapter_id()
1759 vha->port_name[5] = LSB(mcp->mb[18]); in qla2x00_get_adapter_id()
1760 vha->port_name[6] = MSB(mcp->mb[19]); in qla2x00_get_adapter_id()
1761 vha->port_name[7] = LSB(mcp->mb[19]); in qla2x00_get_adapter_id()
1771 vha->bbcr = mcp->mb[15]; in qla2x00_get_adapter_id()
1772 if (mcp->mb[7] & SCM_EDC_ACC_RECEIVED) { in qla2x00_get_adapter_id()
1775 mcp->mb[21]); in qla2x00_get_adapter_id()
1777 if (mcp->mb[7] & SCM_RDF_ACC_RECEIVED) { in qla2x00_get_adapter_id()
1783 mcp->mb[23]); in qla2x00_get_adapter_id()
1818 mcp->mb[0] = MBC_GET_RETRY_COUNT; in qla2x00_get_retry_cnt()
1828 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_get_retry_cnt()
1831 *r_a_tov = mcp->mb[3] / 2; in qla2x00_get_retry_cnt()
1832 ratov = (mcp->mb[3]/2) / 10; /* mb[3] value is in 100ms */ in qla2x00_get_retry_cnt()
1833 if (mcp->mb[1] * ratov > (*retry_cnt) * (*tov)) { in qla2x00_get_retry_cnt()
1835 *retry_cnt = (uint8_t)mcp->mb[1]; in qla2x00_get_retry_cnt()
1840 "Done %s mb3=%d ratov=%d.\n", __func__, mcp->mb[3], ratov); in qla2x00_get_retry_cnt()
1879 mcp->mb[0] = MBC_MID_INITIALIZE_FIRMWARE; in qla2x00_init_firmware()
1881 mcp->mb[0] = MBC_INITIALIZE_FIRMWARE; in qla2x00_init_firmware()
1883 mcp->mb[1] = 0; in qla2x00_init_firmware()
1884 mcp->mb[2] = MSW(ha->init_cb_dma); in qla2x00_init_firmware()
1885 mcp->mb[3] = LSW(ha->init_cb_dma); in qla2x00_init_firmware()
1886 mcp->mb[6] = MSW(MSD(ha->init_cb_dma)); in qla2x00_init_firmware()
1887 mcp->mb[7] = LSW(MSD(ha->init_cb_dma)); in qla2x00_init_firmware()
1890 mcp->mb[1] = BIT_0; in qla2x00_init_firmware()
1891 mcp->mb[10] = MSW(ha->ex_init_cb_dma); in qla2x00_init_firmware()
1892 mcp->mb[11] = LSW(ha->ex_init_cb_dma); in qla2x00_init_firmware()
1893 mcp->mb[12] = MSW(MSD(ha->ex_init_cb_dma)); in qla2x00_init_firmware()
1894 mcp->mb[13] = LSW(MSD(ha->ex_init_cb_dma)); in qla2x00_init_firmware()
1895 mcp->mb[14] = sizeof(*ha->ex_init_cb); in qla2x00_init_firmware()
1900 mcp->mb[1] |= BIT_1; in qla2x00_init_firmware()
1901 mcp->mb[16] = MSW(ha->sf_init_cb_dma); in qla2x00_init_firmware()
1902 mcp->mb[17] = LSW(ha->sf_init_cb_dma); in qla2x00_init_firmware()
1903 mcp->mb[18] = MSW(MSD(ha->sf_init_cb_dma)); in qla2x00_init_firmware()
1904 mcp->mb[19] = LSW(MSD(ha->sf_init_cb_dma)); in qla2x00_init_firmware()
1905 mcp->mb[15] = sizeof(*ha->sf_init_cb); in qla2x00_init_firmware()
1922 "Failed=%x mb[0]=%x, mb[1]=%x, mb[2]=%x, mb[3]=%x.\n", in qla2x00_init_firmware()
1923 rval, mcp->mb[0], mcp->mb[1], mcp->mb[2], mcp->mb[3]); in qla2x00_init_firmware()
1936 if (mcp->mb[2] == 6 || mcp->mb[3] == 2) in qla2x00_init_firmware()
1987 mcp->mb[0] = MBC_GET_PORT_DATABASE; in qla2x00_get_port_database()
1989 mcp->mb[0] = MBC_ENHANCED_GET_PORT_DATABASE; in qla2x00_get_port_database()
1990 mcp->mb[2] = MSW(pd_dma); in qla2x00_get_port_database()
1991 mcp->mb[3] = LSW(pd_dma); in qla2x00_get_port_database()
1992 mcp->mb[6] = MSW(MSD(pd_dma)); in qla2x00_get_port_database()
1993 mcp->mb[7] = LSW(MSD(pd_dma)); in qla2x00_get_port_database()
1994 mcp->mb[9] = vha->vp_idx; in qla2x00_get_port_database()
1998 mcp->mb[1] = fcport->loop_id; in qla2x00_get_port_database()
1999 mcp->mb[10] = opt; in qla2x00_get_port_database()
2003 mcp->mb[1] = fcport->loop_id; in qla2x00_get_port_database()
2004 mcp->mb[10] = opt; in qla2x00_get_port_database()
2007 mcp->mb[1] = fcport->loop_id << 8 | opt; in qla2x00_get_port_database()
2026 current_login_state = pd24->current_login_state >> 4; in qla2x00_get_port_database()
2027 last_login_state = pd24->last_login_state >> 4; in qla2x00_get_port_database()
2128 "Failed=%x mb[0]=%x mb[1]=%x.\n", rval, in qla2x00_get_port_database()
2129 mcp->mb[0], mcp->mb[1]); in qla2x00_get_port_database()
2159 mcp->mb[0] = MBC_GET_PORT_DATABASE; in qla24xx_get_port_database()
2160 mcp->mb[1] = nport_handle; in qla24xx_get_port_database()
2161 mcp->mb[2] = MSW(LSD(pdb_dma)); in qla24xx_get_port_database()
2162 mcp->mb[3] = LSW(LSD(pdb_dma)); in qla24xx_get_port_database()
2163 mcp->mb[6] = MSW(MSD(pdb_dma)); in qla24xx_get_port_database()
2164 mcp->mb[7] = LSW(MSD(pdb_dma)); in qla24xx_get_port_database()
2165 mcp->mb[9] = 0; in qla24xx_get_port_database()
2166 mcp->mb[10] = 0; in qla24xx_get_port_database()
2176 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla24xx_get_port_database()
2177 rval, mcp->mb[0], mcp->mb[1]); in qla24xx_get_port_database()
2216 mcp->mb[0] = MBC_GET_FIRMWARE_STATE; in qla2x00_get_firmware_state()
2227 states[0] = mcp->mb[1]; in qla2x00_get_firmware_state()
2229 states[1] = mcp->mb[2]; in qla2x00_get_firmware_state()
2230 states[2] = mcp->mb[3]; /* SFP info */ in qla2x00_get_firmware_state()
2231 states[3] = mcp->mb[4]; in qla2x00_get_firmware_state()
2232 states[4] = mcp->mb[5]; in qla2x00_get_firmware_state()
2233 states[5] = mcp->mb[6]; /* DPORT status */ in qla2x00_get_firmware_state()
2241 if (mcp->mb[2] == 6 || mcp->mb[3] == 2) in qla2x00_get_firmware_state()
2281 mcp->mb[0] = MBC_GET_PORT_NAME; in qla2x00_get_port_name()
2282 mcp->mb[9] = vha->vp_idx; in qla2x00_get_port_name()
2285 mcp->mb[1] = loop_id; in qla2x00_get_port_name()
2286 mcp->mb[10] = opt; in qla2x00_get_port_name()
2289 mcp->mb[1] = loop_id << 8 | opt; in qla2x00_get_port_name()
2303 name[0] = MSB(mcp->mb[2]); in qla2x00_get_port_name()
2304 name[1] = LSB(mcp->mb[2]); in qla2x00_get_port_name()
2305 name[2] = MSB(mcp->mb[3]); in qla2x00_get_port_name()
2306 name[3] = LSB(mcp->mb[3]); in qla2x00_get_port_name()
2307 name[4] = MSB(mcp->mb[6]); in qla2x00_get_port_name()
2308 name[5] = LSB(mcp->mb[6]); in qla2x00_get_port_name()
2309 name[6] = MSB(mcp->mb[7]); in qla2x00_get_port_name()
2310 name[7] = LSB(mcp->mb[7]); in qla2x00_get_port_name()
2348 mcp->mb[0] = MBC_LINK_INITIALIZATION; in qla24xx_link_initialize()
2349 mcp->mb[1] = BIT_4; in qla24xx_link_initialize()
2351 mcp->mb[1] |= BIT_6; in qla24xx_link_initialize()
2353 mcp->mb[1] |= BIT_5; in qla24xx_link_initialize()
2354 mcp->mb[2] = 0; in qla24xx_link_initialize()
2355 mcp->mb[3] = 0; in qla24xx_link_initialize()
2399 mcp->mb[0] = MBC_LIP_FULL_LOGIN; in qla2x00_lip_reset()
2400 mcp->mb[1] = BIT_1; in qla2x00_lip_reset()
2401 mcp->mb[2] = 0; in qla2x00_lip_reset()
2404 mcp->mb[0] = MBC_LIP_FULL_LOGIN; in qla2x00_lip_reset()
2405 mcp->mb[1] = BIT_4; in qla2x00_lip_reset()
2406 mcp->mb[2] = 0; in qla2x00_lip_reset()
2407 mcp->mb[3] = vha->hw->loop_reset_delay; in qla2x00_lip_reset()
2410 mcp->mb[0] = MBC_LIP_RESET; in qla2x00_lip_reset()
2413 mcp->mb[1] = 0x00ff; in qla2x00_lip_reset()
2414 mcp->mb[10] = 0; in qla2x00_lip_reset()
2417 mcp->mb[1] = 0xff00; in qla2x00_lip_reset()
2419 mcp->mb[2] = vha->hw->loop_reset_delay; in qla2x00_lip_reset()
2420 mcp->mb[3] = 0; in qla2x00_lip_reset()
2472 mcp->mb[0] = MBC_SEND_SNS_COMMAND; in qla2x00_send_sns()
2473 mcp->mb[1] = cmd_size; in qla2x00_send_sns()
2474 mcp->mb[2] = MSW(sns_phys_address); in qla2x00_send_sns()
2475 mcp->mb[3] = LSW(sns_phys_address); in qla2x00_send_sns()
2476 mcp->mb[6] = MSW(MSD(sns_phys_address)); in qla2x00_send_sns()
2477 mcp->mb[7] = LSW(MSD(sns_phys_address)); in qla2x00_send_sns()
2488 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla2x00_send_sns()
2489 rval, mcp->mb[0], mcp->mb[1]); in qla2x00_send_sns()
2501 uint8_t area, uint8_t al_pa, uint16_t *mb, uint8_t opt) in qla24xx_login_fabric() argument
2560 mb[0] = MBS_PORT_ID_USED; in qla24xx_login_fabric()
2561 mb[1] = LSW(iop[1]); in qla24xx_login_fabric()
2564 mb[0] = MBS_LOOP_ID_USED; in qla24xx_login_fabric()
2580 mb[0] = MBS_COMMAND_ERROR; in qla24xx_login_fabric()
2589 mb[0] = MBS_COMMAND_COMPLETE; in qla24xx_login_fabric()
2590 mb[1] = 0; in qla24xx_login_fabric()
2593 mb[1] |= BIT_1; in qla24xx_login_fabric()
2595 mb[1] = BIT_0; in qla24xx_login_fabric()
2598 mb[10] = 0; in qla24xx_login_fabric()
2600 mb[10] |= BIT_0; /* Class 2. */ in qla24xx_login_fabric()
2602 mb[10] |= BIT_1; /* Class 3. */ in qla24xx_login_fabric()
2604 mb[10] |= BIT_7; /* Confirmed Completion in qla24xx_login_fabric()
2637 uint8_t area, uint8_t al_pa, uint16_t *mb, uint8_t opt) in qla2x00_login_fabric() argument
2647 mcp->mb[0] = MBC_LOGIN_FABRIC_PORT; in qla2x00_login_fabric()
2650 mcp->mb[1] = loop_id; in qla2x00_login_fabric()
2651 mcp->mb[10] = opt; in qla2x00_login_fabric()
2654 mcp->mb[1] = (loop_id << 8) | opt; in qla2x00_login_fabric()
2656 mcp->mb[2] = domain; in qla2x00_login_fabric()
2657 mcp->mb[3] = area << 8 | al_pa; in qla2x00_login_fabric()
2665 if (mb != NULL) { in qla2x00_login_fabric()
2666 mb[0] = mcp->mb[0]; in qla2x00_login_fabric()
2667 mb[1] = mcp->mb[1]; in qla2x00_login_fabric()
2668 mb[2] = mcp->mb[2]; in qla2x00_login_fabric()
2669 mb[6] = mcp->mb[6]; in qla2x00_login_fabric()
2670 mb[7] = mcp->mb[7]; in qla2x00_login_fabric()
2672 mb[10] = 0; in qla2x00_login_fabric()
2682 if (mcp->mb[0] == 0x4001 || mcp->mb[0] == 0x4002 || in qla2x00_login_fabric()
2683 mcp->mb[0] == 0x4003 || mcp->mb[0] == 0x4005 || in qla2x00_login_fabric()
2684 mcp->mb[0] == 0x4006) in qla2x00_login_fabric()
2689 "Failed=%x mb[0]=%x mb[1]=%x mb[2]=%x.\n", in qla2x00_login_fabric()
2690 rval, mcp->mb[0], mcp->mb[1], mcp->mb[2]); in qla2x00_login_fabric()
2733 mcp->mb[0] = MBC_LOGIN_LOOP_PORT; in qla2x00_login_local_device()
2735 mcp->mb[1] = fcport->loop_id; in qla2x00_login_local_device()
2737 mcp->mb[1] = fcport->loop_id << 8; in qla2x00_login_local_device()
2738 mcp->mb[2] = opt; in qla2x00_login_local_device()
2747 mb_ret[0] = mcp->mb[0]; in qla2x00_login_local_device()
2748 mb_ret[1] = mcp->mb[1]; in qla2x00_login_local_device()
2749 mb_ret[6] = mcp->mb[6]; in qla2x00_login_local_device()
2750 mb_ret[7] = mcp->mb[7]; in qla2x00_login_local_device()
2760 if (mcp->mb[0] == 0x4005 || mcp->mb[0] == 0x4006) in qla2x00_login_local_device()
2764 "Failed=%x mb[0]=%x mb[1]=%x mb[6]=%x mb[7]=%x.\n", in qla2x00_login_local_device()
2765 rval, mcp->mb[0], mcp->mb[1], mcp->mb[6], mcp->mb[7]); in qla2x00_login_local_device()
2861 mcp->mb[0] = MBC_LOGOUT_FABRIC_PORT; in qla2x00_fabric_logout()
2864 mcp->mb[1] = loop_id; in qla2x00_fabric_logout()
2865 mcp->mb[10] = 0; in qla2x00_fabric_logout()
2868 mcp->mb[1] = loop_id << 8; in qla2x00_fabric_logout()
2879 "Failed=%x mb[1]=%x.\n", rval, mcp->mb[1]); in qla2x00_fabric_logout()
2914 mcp->mb[0] = MBC_LIP_FULL_LOGIN; in qla2x00_full_login_lip()
2915 mcp->mb[1] = IS_FWI2_CAPABLE(vha->hw) ? BIT_4 : 0; in qla2x00_full_login_lip()
2916 mcp->mb[2] = 0; in qla2x00_full_login_lip()
2917 mcp->mb[3] = 0; in qla2x00_full_login_lip()
2962 mcp->mb[0] = MBC_GET_ID_LIST; in qla2x00_get_id_list()
2965 mcp->mb[2] = MSW(id_list_dma); in qla2x00_get_id_list()
2966 mcp->mb[3] = LSW(id_list_dma); in qla2x00_get_id_list()
2967 mcp->mb[6] = MSW(MSD(id_list_dma)); in qla2x00_get_id_list()
2968 mcp->mb[7] = LSW(MSD(id_list_dma)); in qla2x00_get_id_list()
2969 mcp->mb[8] = 0; in qla2x00_get_id_list()
2970 mcp->mb[9] = vha->vp_idx; in qla2x00_get_id_list()
2973 mcp->mb[1] = MSW(id_list_dma); in qla2x00_get_id_list()
2974 mcp->mb[2] = LSW(id_list_dma); in qla2x00_get_id_list()
2975 mcp->mb[3] = MSW(MSD(id_list_dma)); in qla2x00_get_id_list()
2976 mcp->mb[6] = LSW(MSD(id_list_dma)); in qla2x00_get_id_list()
2988 *entries = mcp->mb[1]; in qla2x00_get_id_list()
3020 mcp->mb[0] = MBC_GET_RESOURCE_COUNTS; in qla2x00_get_resource_cnts()
3033 "Failed mb[0]=%x.\n", mcp->mb[0]); in qla2x00_get_resource_cnts()
3037 "mb11=%x mb12=%x.\n", __func__, mcp->mb[1], mcp->mb[2], in qla2x00_get_resource_cnts()
3038 mcp->mb[3], mcp->mb[6], mcp->mb[7], mcp->mb[10], in qla2x00_get_resource_cnts()
3039 mcp->mb[11], mcp->mb[12]); in qla2x00_get_resource_cnts()
3041 ha->orig_fw_tgt_xcb_count = mcp->mb[1]; in qla2x00_get_resource_cnts()
3042 ha->cur_fw_tgt_xcb_count = mcp->mb[2]; in qla2x00_get_resource_cnts()
3043 ha->cur_fw_xcb_count = mcp->mb[3]; in qla2x00_get_resource_cnts()
3044 ha->orig_fw_xcb_count = mcp->mb[6]; in qla2x00_get_resource_cnts()
3045 ha->cur_fw_iocb_count = mcp->mb[7]; in qla2x00_get_resource_cnts()
3046 ha->orig_fw_iocb_count = mcp->mb[10]; in qla2x00_get_resource_cnts()
3048 ha->max_npiv_vports = mcp->mb[11]; in qla2x00_get_resource_cnts()
3050 ha->fw_max_fcf_count = mcp->mb[12]; in qla2x00_get_resource_cnts()
3091 mcp->mb[0] = MBC_GET_FC_AL_POSITION_MAP; in qla2x00_get_fcal_position_map()
3092 mcp->mb[2] = MSW(pmap_dma); in qla2x00_get_fcal_position_map()
3093 mcp->mb[3] = LSW(pmap_dma); in qla2x00_get_fcal_position_map()
3094 mcp->mb[6] = MSW(MSD(pmap_dma)); in qla2x00_get_fcal_position_map()
3095 mcp->mb[7] = LSW(MSD(pmap_dma)); in qla2x00_get_fcal_position_map()
3106 mcp->mb[0], mcp->mb[1], (unsigned)pmap[0]); in qla2x00_get_fcal_position_map()
3154 mcp->mb[0] = MBC_GET_LINK_STATUS; in qla2x00_get_link_status()
3155 mcp->mb[2] = MSW(LSD(stats_dma)); in qla2x00_get_link_status()
3156 mcp->mb[3] = LSW(LSD(stats_dma)); in qla2x00_get_link_status()
3157 mcp->mb[6] = MSW(MSD(stats_dma)); in qla2x00_get_link_status()
3158 mcp->mb[7] = LSW(MSD(stats_dma)); in qla2x00_get_link_status()
3162 mcp->mb[1] = loop_id; in qla2x00_get_link_status()
3163 mcp->mb[4] = 0; in qla2x00_get_link_status()
3164 mcp->mb[10] = 0; in qla2x00_get_link_status()
3168 mcp->mb[1] = loop_id; in qla2x00_get_link_status()
3169 mcp->mb[10] = 0; in qla2x00_get_link_status()
3172 mcp->mb[1] = loop_id << 8; in qla2x00_get_link_status()
3180 if (mcp->mb[0] != MBS_COMMAND_COMPLETE) { in qla2x00_get_link_status()
3182 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_get_link_status()
3213 mc.mb[0] = MBC_GET_LINK_PRIV_STATS; in qla24xx_get_isp_stats()
3214 mc.mb[2] = MSW(LSD(stats_dma)); in qla24xx_get_isp_stats()
3215 mc.mb[3] = LSW(LSD(stats_dma)); in qla24xx_get_isp_stats()
3216 mc.mb[6] = MSW(MSD(stats_dma)); in qla24xx_get_isp_stats()
3217 mc.mb[7] = LSW(MSD(stats_dma)); in qla24xx_get_isp_stats()
3218 mc.mb[8] = dwords; in qla24xx_get_isp_stats()
3219 mc.mb[9] = vha->vp_idx; in qla24xx_get_isp_stats()
3220 mc.mb[10] = options; in qla24xx_get_isp_stats()
3225 if (mcp->mb[0] != MBS_COMMAND_COMPLETE) { in qla24xx_get_isp_stats()
3227 "Failed mb[0]=%x.\n", mcp->mb[0]); in qla24xx_get_isp_stats()
3406 if (le32_to_cpu(sts->rsp_data_len) < 4) { in __qla24xx_issue_tmf()
3471 mcp->mb[0] = MBC_GEN_SYSTEM_ERROR; in qla2x00_system_error()
3502 mcp->mb[0] = MBC_WRITE_SERDES; in qla2x00_write_serdes_word()
3503 mcp->mb[1] = addr; in qla2x00_write_serdes_word()
3505 mcp->mb[2] = data & 0xff; in qla2x00_write_serdes_word()
3507 mcp->mb[2] = data; in qla2x00_write_serdes_word()
3509 mcp->mb[3] = 0; in qla2x00_write_serdes_word()
3518 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_write_serdes_word()
3541 mcp->mb[0] = MBC_READ_SERDES; in qla2x00_read_serdes_word()
3542 mcp->mb[1] = addr; in qla2x00_read_serdes_word()
3543 mcp->mb[3] = 0; in qla2x00_read_serdes_word()
3551 *data = mcp->mb[1] & 0xff; in qla2x00_read_serdes_word()
3553 *data = mcp->mb[1]; in qla2x00_read_serdes_word()
3557 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_read_serdes_word()
3579 mcp->mb[0] = MBC_SET_GET_ETH_SERDES_REG; in qla8044_write_serdes_word()
3580 mcp->mb[1] = HCS_WRITE_SERDES; in qla8044_write_serdes_word()
3581 mcp->mb[3] = LSW(addr); in qla8044_write_serdes_word()
3582 mcp->mb[4] = MSW(addr); in qla8044_write_serdes_word()
3583 mcp->mb[5] = LSW(data); in qla8044_write_serdes_word()
3584 mcp->mb[6] = MSW(data); in qla8044_write_serdes_word()
3593 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla8044_write_serdes_word()
3615 mcp->mb[0] = MBC_SET_GET_ETH_SERDES_REG; in qla8044_read_serdes_word()
3616 mcp->mb[1] = HCS_READ_SERDES; in qla8044_read_serdes_word()
3617 mcp->mb[3] = LSW(addr); in qla8044_read_serdes_word()
3618 mcp->mb[4] = MSW(addr); in qla8044_read_serdes_word()
3625 *data = mcp->mb[2] << 16 | mcp->mb[1]; in qla8044_read_serdes_word()
3629 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla8044_read_serdes_word()
3658 mcp->mb[0] = MBC_SERDES_PARAMS; in qla2x00_set_serdes_params()
3659 mcp->mb[1] = BIT_0; in qla2x00_set_serdes_params()
3660 mcp->mb[2] = sw_em_1g | BIT_15; in qla2x00_set_serdes_params()
3661 mcp->mb[3] = sw_em_2g | BIT_15; in qla2x00_set_serdes_params()
3662 mcp->mb[4] = sw_em_4g | BIT_15; in qla2x00_set_serdes_params()
3672 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_set_serdes_params()
3695 mcp->mb[0] = MBC_STOP_FIRMWARE; in qla2x00_stop_firmware()
3696 mcp->mb[1] = 0; in qla2x00_stop_firmware()
3705 if (mcp->mb[0] == MBS_INVALID_COMMAND) in qla2x00_stop_firmware()
3732 mcp->mb[0] = MBC_TRACE_CONTROL; in qla2x00_enable_eft_trace()
3733 mcp->mb[1] = TC_EFT_ENABLE; in qla2x00_enable_eft_trace()
3734 mcp->mb[2] = LSW(eft_dma); in qla2x00_enable_eft_trace()
3735 mcp->mb[3] = MSW(eft_dma); in qla2x00_enable_eft_trace()
3736 mcp->mb[4] = LSW(MSD(eft_dma)); in qla2x00_enable_eft_trace()
3737 mcp->mb[5] = MSW(MSD(eft_dma)); in qla2x00_enable_eft_trace()
3738 mcp->mb[6] = buffers; in qla2x00_enable_eft_trace()
3739 mcp->mb[7] = TC_AEN_DISABLE; in qla2x00_enable_eft_trace()
3747 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla2x00_enable_eft_trace()
3748 rval, mcp->mb[0], mcp->mb[1]); in qla2x00_enable_eft_trace()
3773 mcp->mb[0] = MBC_TRACE_CONTROL; in qla2x00_disable_eft_trace()
3774 mcp->mb[1] = TC_EFT_DISABLE; in qla2x00_disable_eft_trace()
3782 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla2x00_disable_eft_trace()
3783 rval, mcp->mb[0], mcp->mb[1]); in qla2x00_disable_eft_trace()
3794 uint16_t buffers, uint16_t *mb, uint32_t *dwords) in qla2x00_enable_fce_trace() argument
3811 mcp->mb[0] = MBC_TRACE_CONTROL; in qla2x00_enable_fce_trace()
3812 mcp->mb[1] = TC_FCE_ENABLE; in qla2x00_enable_fce_trace()
3813 mcp->mb[2] = LSW(fce_dma); in qla2x00_enable_fce_trace()
3814 mcp->mb[3] = MSW(fce_dma); in qla2x00_enable_fce_trace()
3815 mcp->mb[4] = LSW(MSD(fce_dma)); in qla2x00_enable_fce_trace()
3816 mcp->mb[5] = MSW(MSD(fce_dma)); in qla2x00_enable_fce_trace()
3817 mcp->mb[6] = buffers; in qla2x00_enable_fce_trace()
3818 mcp->mb[7] = TC_AEN_DISABLE; in qla2x00_enable_fce_trace()
3819 mcp->mb[8] = 0; in qla2x00_enable_fce_trace()
3820 mcp->mb[9] = TC_FCE_DEFAULT_RX_SIZE; in qla2x00_enable_fce_trace()
3821 mcp->mb[10] = TC_FCE_DEFAULT_TX_SIZE; in qla2x00_enable_fce_trace()
3830 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla2x00_enable_fce_trace()
3831 rval, mcp->mb[0], mcp->mb[1]); in qla2x00_enable_fce_trace()
3836 if (mb) in qla2x00_enable_fce_trace()
3837 memcpy(mb, mcp->mb, 8 * sizeof(*mb)); in qla2x00_enable_fce_trace()
3861 mcp->mb[0] = MBC_TRACE_CONTROL; in qla2x00_disable_fce_trace()
3862 mcp->mb[1] = TC_FCE_DISABLE; in qla2x00_disable_fce_trace()
3863 mcp->mb[2] = TC_FCE_DISABLE_TRACE; in qla2x00_disable_fce_trace()
3872 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla2x00_disable_fce_trace()
3873 rval, mcp->mb[0], mcp->mb[1]); in qla2x00_disable_fce_trace()
3879 *wr = (uint64_t) mcp->mb[5] << 48 | in qla2x00_disable_fce_trace()
3880 (uint64_t) mcp->mb[4] << 32 | in qla2x00_disable_fce_trace()
3881 (uint64_t) mcp->mb[3] << 16 | in qla2x00_disable_fce_trace()
3882 (uint64_t) mcp->mb[2]; in qla2x00_disable_fce_trace()
3884 *rd = (uint64_t) mcp->mb[9] << 48 | in qla2x00_disable_fce_trace()
3885 (uint64_t) mcp->mb[8] << 32 | in qla2x00_disable_fce_trace()
3886 (uint64_t) mcp->mb[7] << 16 | in qla2x00_disable_fce_trace()
3887 (uint64_t) mcp->mb[6]; in qla2x00_disable_fce_trace()
3895 uint16_t *port_speed, uint16_t *mb) in qla2x00_get_idma_speed() argument
3907 mcp->mb[0] = MBC_PORT_PARAMS; in qla2x00_get_idma_speed()
3908 mcp->mb[1] = loop_id; in qla2x00_get_idma_speed()
3909 mcp->mb[2] = mcp->mb[3] = 0; in qla2x00_get_idma_speed()
3910 mcp->mb[9] = vha->vp_idx; in qla2x00_get_idma_speed()
3918 if (mb) { in qla2x00_get_idma_speed()
3919 mb[0] = mcp->mb[0]; in qla2x00_get_idma_speed()
3920 mb[1] = mcp->mb[1]; in qla2x00_get_idma_speed()
3921 mb[3] = mcp->mb[3]; in qla2x00_get_idma_speed()
3930 *port_speed = mcp->mb[3]; in qla2x00_get_idma_speed()
3938 uint16_t port_speed, uint16_t *mb) in qla2x00_set_idma_speed() argument
3950 mcp->mb[0] = MBC_PORT_PARAMS; in qla2x00_set_idma_speed()
3951 mcp->mb[1] = loop_id; in qla2x00_set_idma_speed()
3952 mcp->mb[2] = BIT_0; in qla2x00_set_idma_speed()
3953 mcp->mb[3] = port_speed & 0x3F; in qla2x00_set_idma_speed()
3954 mcp->mb[9] = vha->vp_idx; in qla2x00_set_idma_speed()
3962 if (mb) { in qla2x00_set_idma_speed()
3963 mb[0] = mcp->mb[0]; in qla2x00_set_idma_speed()
3964 mb[1] = mcp->mb[1]; in qla2x00_set_idma_speed()
3965 mb[3] = mcp->mb[3]; in qla2x00_set_idma_speed()
4328 mcp->mb[0] = MBC_SEND_CHANGE_REQUEST; in qla2x00_send_change_request()
4329 mcp->mb[1] = format; in qla2x00_send_change_request()
4330 mcp->mb[9] = vp_idx; in qla2x00_send_change_request()
4338 if (mcp->mb[0] != MBS_COMMAND_COMPLETE) { in qla2x00_send_change_request()
4359 mcp->mb[0] = MBC_DUMP_RISC_RAM_EXTENDED; in qla2x00_dump_ram()
4360 mcp->mb[8] = MSW(addr); in qla2x00_dump_ram()
4361 mcp->mb[10] = 0; in qla2x00_dump_ram()
4364 mcp->mb[0] = MBC_DUMP_RISC_RAM; in qla2x00_dump_ram()
4367 mcp->mb[1] = LSW(addr); in qla2x00_dump_ram()
4368 mcp->mb[2] = MSW(req_dma); in qla2x00_dump_ram()
4369 mcp->mb[3] = LSW(req_dma); in qla2x00_dump_ram()
4370 mcp->mb[6] = MSW(MSD(req_dma)); in qla2x00_dump_ram()
4371 mcp->mb[7] = LSW(MSD(req_dma)); in qla2x00_dump_ram()
4374 mcp->mb[4] = MSW(size); in qla2x00_dump_ram()
4375 mcp->mb[5] = LSW(size); in qla2x00_dump_ram()
4378 mcp->mb[4] = LSW(size); in qla2x00_dump_ram()
4389 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_dump_ram()
4517 mcp->mb[0] = MBC_INITIALIZE_MULTIQ; in qla25xx_init_req_que()
4518 mcp->mb[1] = req->options; in qla25xx_init_req_que()
4519 mcp->mb[2] = MSW(LSD(req->dma)); in qla25xx_init_req_que()
4520 mcp->mb[3] = LSW(LSD(req->dma)); in qla25xx_init_req_que()
4521 mcp->mb[6] = MSW(MSD(req->dma)); in qla25xx_init_req_que()
4522 mcp->mb[7] = LSW(MSD(req->dma)); in qla25xx_init_req_que()
4523 mcp->mb[5] = req->length; in qla25xx_init_req_que()
4525 mcp->mb[10] = req->rsp->id; in qla25xx_init_req_que()
4526 mcp->mb[12] = req->qos; in qla25xx_init_req_que()
4527 mcp->mb[11] = req->vp_idx; in qla25xx_init_req_que()
4528 mcp->mb[13] = req->rid; in qla25xx_init_req_que()
4530 mcp->mb[15] = 0; in qla25xx_init_req_que()
4532 mcp->mb[4] = req->id; in qla25xx_init_req_que()
4534 mcp->mb[8] = 0; in qla25xx_init_req_que()
4536 mcp->mb[9] = *req->out_ptr = 0; in qla25xx_init_req_que()
4563 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla25xx_init_req_que()
4590 mcp->mb[0] = MBC_INITIALIZE_MULTIQ; in qla25xx_init_rsp_que()
4591 mcp->mb[1] = rsp->options; in qla25xx_init_rsp_que()
4592 mcp->mb[2] = MSW(LSD(rsp->dma)); in qla25xx_init_rsp_que()
4593 mcp->mb[3] = LSW(LSD(rsp->dma)); in qla25xx_init_rsp_que()
4594 mcp->mb[6] = MSW(MSD(rsp->dma)); in qla25xx_init_rsp_que()
4595 mcp->mb[7] = LSW(MSD(rsp->dma)); in qla25xx_init_rsp_que()
4596 mcp->mb[5] = rsp->length; in qla25xx_init_rsp_que()
4597 mcp->mb[14] = rsp->msix->entry; in qla25xx_init_rsp_que()
4598 mcp->mb[13] = rsp->rid; in qla25xx_init_rsp_que()
4600 mcp->mb[15] = 0; in qla25xx_init_rsp_que()
4602 mcp->mb[4] = rsp->id; in qla25xx_init_rsp_que()
4604 mcp->mb[8] = *rsp->in_ptr = 0; in qla25xx_init_rsp_que()
4606 mcp->mb[9] = 0; in qla25xx_init_rsp_que()
4635 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla25xx_init_rsp_que()
4645 qla81xx_idc_ack(scsi_qla_host_t *vha, uint16_t *mb) in qla81xx_idc_ack() argument
4654 mcp->mb[0] = MBC_IDC_ACK; in qla81xx_idc_ack()
4655 memcpy(&mcp->mb[1], mb, QLA_IDC_ACK_REGS * sizeof(uint16_t)); in qla81xx_idc_ack()
4664 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla81xx_idc_ack()
4687 mcp->mb[0] = MBC_FLASH_ACCESS_CTRL; in qla81xx_fac_get_sector_size()
4688 mcp->mb[1] = FAC_OPT_CMD_GET_SECTOR_SIZE; in qla81xx_fac_get_sector_size()
4697 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla81xx_fac_get_sector_size()
4698 rval, mcp->mb[0], mcp->mb[1]); in qla81xx_fac_get_sector_size()
4702 *sector_size = mcp->mb[1]; in qla81xx_fac_get_sector_size()
4722 mcp->mb[0] = MBC_FLASH_ACCESS_CTRL; in qla81xx_fac_do_write_enable()
4723 mcp->mb[1] = enable ? FAC_OPT_CMD_WRITE_ENABLE : in qla81xx_fac_do_write_enable()
4733 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla81xx_fac_do_write_enable()
4734 rval, mcp->mb[0], mcp->mb[1]); in qla81xx_fac_do_write_enable()
4757 mcp->mb[0] = MBC_FLASH_ACCESS_CTRL; in qla81xx_fac_erase_sector()
4758 mcp->mb[1] = FAC_OPT_CMD_ERASE_SECTOR; in qla81xx_fac_erase_sector()
4759 mcp->mb[2] = LSW(start); in qla81xx_fac_erase_sector()
4760 mcp->mb[3] = MSW(start); in qla81xx_fac_erase_sector()
4761 mcp->mb[4] = LSW(finish); in qla81xx_fac_erase_sector()
4762 mcp->mb[5] = MSW(finish); in qla81xx_fac_erase_sector()
4771 "Failed=%x mb[0]=%x mb[1]=%x mb[2]=%x.\n", in qla81xx_fac_erase_sector()
4772 rval, mcp->mb[0], mcp->mb[1], mcp->mb[2]); in qla81xx_fac_erase_sector()
4796 mcp->mb[0] = MBC_FLASH_ACCESS_CTRL; in qla81xx_fac_semaphore_access()
4797 mcp->mb[1] = (lock ? FAC_OPT_CMD_LOCK_SEMAPHORE : in qla81xx_fac_semaphore_access()
4807 "Failed=%x mb[0]=%x mb[1]=%x mb[2]=%x.\n", in qla81xx_fac_semaphore_access()
4808 rval, mcp->mb[0], mcp->mb[1], mcp->mb[2]); in qla81xx_fac_semaphore_access()
4827 mcp->mb[0] = MBC_RESTART_MPI_FW; in qla81xx_restart_mpi_firmware()
4836 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla81xx_restart_mpi_firmware()
4837 rval, mcp->mb[0], mcp->mb[1]); in qla81xx_restart_mpi_firmware()
4866 mcp->mb[0] = MBC_SET_RNID_PARAMS; in qla82xx_set_driver_version()
4867 mcp->mb[1] = RNID_TYPE_SET_VERSION << 8; in qla82xx_set_driver_version()
4869 for (i = 4; i < 16 && len; i++, str++, len -= 2) { in qla82xx_set_driver_version()
4870 mcp->mb[i] = le16_to_cpup(str); in qla82xx_set_driver_version()
4874 mcp->mb[i] = 0; in qla82xx_set_driver_version()
4884 "Failed=%x mb[0]=%x,%x.\n", rval, mcp->mb[0], mcp->mb[1]); in qla82xx_set_driver_version()
4919 memcpy(str, "\x7\x3\x11\x0", 4); in qla25xx_set_driver_version()
4921 len = dwlen * 4 - 4; in qla25xx_set_driver_version()
4922 memset(str + 4, 0, len); in qla25xx_set_driver_version()
4925 memcpy(str + 4, version, len); in qla25xx_set_driver_version()
4927 mcp->mb[0] = MBC_SET_RNID_PARAMS; in qla25xx_set_driver_version()
4928 mcp->mb[1] = RNID_TYPE_SET_VERSION << 8 | dwlen; in qla25xx_set_driver_version()
4929 mcp->mb[2] = MSW(LSD(str_dma)); in qla25xx_set_driver_version()
4930 mcp->mb[3] = LSW(LSD(str_dma)); in qla25xx_set_driver_version()
4931 mcp->mb[6] = MSW(MSD(str_dma)); in qla25xx_set_driver_version()
4932 mcp->mb[7] = LSW(MSD(str_dma)); in qla25xx_set_driver_version()
4941 "Failed=%x mb[0]=%x,%x.\n", rval, mcp->mb[0], mcp->mb[1]); in qla25xx_set_driver_version()
4967 mcp->mb[0] = MBC_GET_RNID_PARAMS; in qla24xx_get_port_login_templ()
4968 mcp->mb[1] = RNID_TYPE_PORT_LOGIN << 8; in qla24xx_get_port_login_templ()
4969 mcp->mb[2] = MSW(buf_dma); in qla24xx_get_port_login_templ()
4970 mcp->mb[3] = LSW(buf_dma); in qla24xx_get_port_login_templ()
4971 mcp->mb[6] = MSW(MSD(buf_dma)); in qla24xx_get_port_login_templ()
4972 mcp->mb[7] = LSW(MSD(buf_dma)); in qla24xx_get_port_login_templ()
4973 mcp->mb[8] = bufsiz/4; in qla24xx_get_port_login_templ()
4982 "Failed=%x mb[0]=%x,%x.\n", rval, mcp->mb[0], mcp->mb[1]); in qla24xx_get_port_login_templ()
4987 for (i = 0; i < (bufsiz-4)/4; i++, bp++) in qla24xx_get_port_login_templ()
4994 #define PUREX_CMD_COUNT 4
5043 mcp->mb[0] = MBC_SET_RNID_PARAMS; in qla25xx_set_els_cmds_supported()
5044 mcp->mb[1] = RNID_TYPE_ELS_CMD << 8; in qla25xx_set_els_cmds_supported()
5045 mcp->mb[2] = MSW(LSD(els_cmd_map_dma)); in qla25xx_set_els_cmds_supported()
5046 mcp->mb[3] = LSW(LSD(els_cmd_map_dma)); in qla25xx_set_els_cmds_supported()
5047 mcp->mb[6] = MSW(MSD(els_cmd_map_dma)); in qla25xx_set_els_cmds_supported()
5048 mcp->mb[7] = LSW(MSD(els_cmd_map_dma)); in qla25xx_set_els_cmds_supported()
5058 "Failed=%x (%x,%x).\n", rval, mcp->mb[0], mcp->mb[1]); in qla25xx_set_els_cmds_supported()
5083 mcp->mb[0] = MBC_GET_RNID_PARAMS; in qla2x00_read_asic_temperature()
5084 mcp->mb[1] = RNID_TYPE_ASIC_TEMP << 8; in qla2x00_read_asic_temperature()
5090 *temp = mcp->mb[1]; in qla2x00_read_asic_temperature()
5094 "Failed=%x mb[0]=%x,%x.\n", rval, mcp->mb[0], mcp->mb[1]); in qla2x00_read_asic_temperature()
5121 mcp->mb[0] = MBC_READ_SFP; in qla2x00_read_sfp()
5122 mcp->mb[1] = dev; in qla2x00_read_sfp()
5123 mcp->mb[2] = MSW(LSD(sfp_dma)); in qla2x00_read_sfp()
5124 mcp->mb[3] = LSW(LSD(sfp_dma)); in qla2x00_read_sfp()
5125 mcp->mb[6] = MSW(MSD(sfp_dma)); in qla2x00_read_sfp()
5126 mcp->mb[7] = LSW(MSD(sfp_dma)); in qla2x00_read_sfp()
5127 mcp->mb[8] = len; in qla2x00_read_sfp()
5128 mcp->mb[9] = off; in qla2x00_read_sfp()
5129 mcp->mb[10] = opt; in qla2x00_read_sfp()
5137 *sfp = mcp->mb[1]; in qla2x00_read_sfp()
5141 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_read_sfp()
5142 if (mcp->mb[0] == MBS_COMMAND_ERROR && mcp->mb[1] == 0x22) { in qla2x00_read_sfp()
5175 mcp->mb[0] = MBC_WRITE_SFP; in qla2x00_write_sfp()
5176 mcp->mb[1] = dev; in qla2x00_write_sfp()
5177 mcp->mb[2] = MSW(LSD(sfp_dma)); in qla2x00_write_sfp()
5178 mcp->mb[3] = LSW(LSD(sfp_dma)); in qla2x00_write_sfp()
5179 mcp->mb[6] = MSW(MSD(sfp_dma)); in qla2x00_write_sfp()
5180 mcp->mb[7] = LSW(MSD(sfp_dma)); in qla2x00_write_sfp()
5181 mcp->mb[8] = len; in qla2x00_write_sfp()
5182 mcp->mb[9] = off; in qla2x00_write_sfp()
5183 mcp->mb[10] = opt; in qla2x00_write_sfp()
5192 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_write_sfp()
5215 mcp->mb[0] = MBC_GET_XGMAC_STATS; in qla2x00_get_xgmac_stats()
5216 mcp->mb[2] = MSW(stats_dma); in qla2x00_get_xgmac_stats()
5217 mcp->mb[3] = LSW(stats_dma); in qla2x00_get_xgmac_stats()
5218 mcp->mb[6] = MSW(MSD(stats_dma)); in qla2x00_get_xgmac_stats()
5219 mcp->mb[7] = LSW(MSD(stats_dma)); in qla2x00_get_xgmac_stats()
5220 mcp->mb[8] = size_in_bytes >> 2; in qla2x00_get_xgmac_stats()
5229 "Failed=%x mb[0]=%x mb[1]=%x mb[2]=%x.\n", in qla2x00_get_xgmac_stats()
5230 rval, mcp->mb[0], mcp->mb[1], mcp->mb[2]); in qla2x00_get_xgmac_stats()
5236 *actual_size = mcp->mb[2] << 2; in qla2x00_get_xgmac_stats()
5256 mcp->mb[0] = MBC_GET_DCBX_PARAMS; in qla2x00_get_dcbx_params()
5257 mcp->mb[1] = 0; in qla2x00_get_dcbx_params()
5258 mcp->mb[2] = MSW(tlv_dma); in qla2x00_get_dcbx_params()
5259 mcp->mb[3] = LSW(tlv_dma); in qla2x00_get_dcbx_params()
5260 mcp->mb[6] = MSW(MSD(tlv_dma)); in qla2x00_get_dcbx_params()
5261 mcp->mb[7] = LSW(MSD(tlv_dma)); in qla2x00_get_dcbx_params()
5262 mcp->mb[8] = size; in qla2x00_get_dcbx_params()
5271 "Failed=%x mb[0]=%x mb[1]=%x mb[2]=%x.\n", in qla2x00_get_dcbx_params()
5272 rval, mcp->mb[0], mcp->mb[1], mcp->mb[2]); in qla2x00_get_dcbx_params()
5294 mcp->mb[0] = MBC_READ_RAM_EXTENDED; in qla2x00_read_ram_word()
5295 mcp->mb[1] = LSW(risc_addr); in qla2x00_read_ram_word()
5296 mcp->mb[8] = MSW(risc_addr); in qla2x00_read_ram_word()
5304 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_read_ram_word()
5308 *data = mcp->mb[3] << 16 | mcp->mb[2]; in qla2x00_read_ram_word()
5325 memset(mcp->mb, 0 , sizeof(mcp->mb)); in qla2x00_loopback_test()
5326 mcp->mb[0] = MBC_DIAGNOSTIC_LOOP_BACK; in qla2x00_loopback_test()
5327 mcp->mb[1] = mreq->options | BIT_6; // BIT_6 specifies 64 bit addressing in qla2x00_loopback_test()
5330 mcp->mb[10] = LSW(mreq->transfer_size); in qla2x00_loopback_test()
5331 mcp->mb[11] = MSW(mreq->transfer_size); in qla2x00_loopback_test()
5334 mcp->mb[14] = LSW(mreq->send_dma); in qla2x00_loopback_test()
5335 mcp->mb[15] = MSW(mreq->send_dma); in qla2x00_loopback_test()
5336 mcp->mb[20] = LSW(MSD(mreq->send_dma)); in qla2x00_loopback_test()
5337 mcp->mb[21] = MSW(MSD(mreq->send_dma)); in qla2x00_loopback_test()
5340 mcp->mb[16] = LSW(mreq->rcv_dma); in qla2x00_loopback_test()
5341 mcp->mb[17] = MSW(mreq->rcv_dma); in qla2x00_loopback_test()
5342 mcp->mb[6] = LSW(MSD(mreq->rcv_dma)); in qla2x00_loopback_test()
5343 mcp->mb[7] = MSW(MSD(mreq->rcv_dma)); in qla2x00_loopback_test()
5346 mcp->mb[18] = LSW(mreq->iteration_count); in qla2x00_loopback_test()
5347 mcp->mb[19] = MSW(mreq->iteration_count); in qla2x00_loopback_test()
5363 "Failed=%x mb[0]=%x mb[1]=%x mb[2]=%x mb[3]=%x mb[18]=%x " in qla2x00_loopback_test()
5364 "mb[19]=%x.\n", rval, mcp->mb[0], mcp->mb[1], mcp->mb[2], in qla2x00_loopback_test()
5365 mcp->mb[3], mcp->mb[18], mcp->mb[19]); in qla2x00_loopback_test()
5372 memcpy( mresp, mcp->mb, 64); in qla2x00_loopback_test()
5388 memset(mcp->mb, 0 , sizeof(mcp->mb)); in qla2x00_echo_test()
5389 mcp->mb[0] = MBC_DIAGNOSTIC_ECHO; in qla2x00_echo_test()
5391 mcp->mb[1] = mreq->options | BIT_15 | BIT_6; in qla2x00_echo_test()
5393 mcp->mb[2] = vha->fcoe_fcf_idx; in qla2x00_echo_test()
5395 mcp->mb[16] = LSW(mreq->rcv_dma); in qla2x00_echo_test()
5396 mcp->mb[17] = MSW(mreq->rcv_dma); in qla2x00_echo_test()
5397 mcp->mb[6] = LSW(MSD(mreq->rcv_dma)); in qla2x00_echo_test()
5398 mcp->mb[7] = MSW(MSD(mreq->rcv_dma)); in qla2x00_echo_test()
5400 mcp->mb[10] = LSW(mreq->transfer_size); in qla2x00_echo_test()
5402 mcp->mb[14] = LSW(mreq->send_dma); in qla2x00_echo_test()
5403 mcp->mb[15] = MSW(mreq->send_dma); in qla2x00_echo_test()
5404 mcp->mb[20] = LSW(MSD(mreq->send_dma)); in qla2x00_echo_test()
5405 mcp->mb[21] = MSW(MSD(mreq->send_dma)); in qla2x00_echo_test()
5428 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla2x00_echo_test()
5429 rval, mcp->mb[0], mcp->mb[1]); in qla2x00_echo_test()
5436 memcpy(mresp, mcp->mb, 64); in qla2x00_echo_test()
5450 mcp->mb[0] = MBC_ISP84XX_RESET; in qla84xx_reset_chip()
5451 mcp->mb[1] = enable_diagnostic; in qla84xx_reset_chip()
5480 mcp->mb[0] = MBC_WRITE_RAM_WORD_EXTENDED; in qla2x00_write_ram_word()
5481 mcp->mb[1] = LSW(risc_addr); in qla2x00_write_ram_word()
5482 mcp->mb[2] = LSW(data); in qla2x00_write_ram_word()
5483 mcp->mb[3] = MSW(data); in qla2x00_write_ram_word()
5484 mcp->mb[8] = MSW(risc_addr); in qla2x00_write_ram_word()
5492 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla2x00_write_ram_word()
5493 rval, mcp->mb[0], mcp->mb[1]); in qla2x00_write_ram_word()
5503 qla81xx_write_mpi_register(scsi_qla_host_t *vha, uint16_t *mb) in qla81xx_write_mpi_register() argument
5520 wrt_reg_word(&reg->mailbox1, mb[0]); in qla81xx_write_mpi_register()
5521 wrt_reg_word(&reg->mailbox2, mb[1]); in qla81xx_write_mpi_register()
5522 wrt_reg_word(&reg->mailbox3, mb[2]); in qla81xx_write_mpi_register()
5523 wrt_reg_word(&reg->mailbox4, mb[3]); in qla81xx_write_mpi_register()
5555 "Failed=%x mb[0]=%x.\n", rval, mb[0]); in qla81xx_write_mpi_register()
5598 mcp->mb[0] = MBC_DATA_RATE; in qla2x00_set_data_rate()
5599 mcp->mb[1] = mode; in qla2x00_set_data_rate()
5600 mcp->mb[2] = val; in qla2x00_set_data_rate()
5611 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_set_data_rate()
5613 if (mcp->mb[1] != 0x7) in qla2x00_set_data_rate()
5615 "Speed set:0x%x\n", mcp->mb[1]); in qla2x00_set_data_rate()
5638 mcp->mb[0] = MBC_DATA_RATE; in qla2x00_get_data_rate()
5639 mcp->mb[1] = QLA_GET_DATA_RATE; in qla2x00_get_data_rate()
5649 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_get_data_rate()
5651 if (mcp->mb[1] != 0x7) in qla2x00_get_data_rate()
5652 ha->link_data_rate = mcp->mb[1]; in qla2x00_get_data_rate()
5655 if (mcp->mb[4] & BIT_0) in qla2x00_get_data_rate()
5662 if (mcp->mb[1] != 0x7) in qla2x00_get_data_rate()
5663 ha->link_data_rate = mcp->mb[1]; in qla2x00_get_data_rate()
5670 qla81xx_get_port_config(scsi_qla_host_t *vha, uint16_t *mb) in qla81xx_get_port_config() argument
5683 mcp->mb[0] = MBC_GET_PORT_CONFIG; in qla81xx_get_port_config()
5693 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla81xx_get_port_config()
5696 memcpy(mb, &mcp->mb[1], sizeof(uint16_t) * 4); in qla81xx_get_port_config()
5705 qla81xx_set_port_config(scsi_qla_host_t *vha, uint16_t *mb) in qla81xx_set_port_config() argument
5714 mcp->mb[0] = MBC_SET_PORT_CONFIG; in qla81xx_set_port_config()
5716 memcpy(&mcp->mb[1], mb, sizeof(uint16_t) * 4); in qla81xx_set_port_config()
5725 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla81xx_set_port_config()
5736 uint16_t *mb) in qla24xx_set_fcp_prio() argument
5749 mcp->mb[0] = MBC_PORT_PARAMS; in qla24xx_set_fcp_prio()
5750 mcp->mb[1] = loop_id; in qla24xx_set_fcp_prio()
5752 mcp->mb[2] = BIT_1; in qla24xx_set_fcp_prio()
5754 mcp->mb[2] = BIT_2; in qla24xx_set_fcp_prio()
5755 mcp->mb[4] = priority & 0xf; in qla24xx_set_fcp_prio()
5756 mcp->mb[9] = vha->vp_idx; in qla24xx_set_fcp_prio()
5762 if (mb != NULL) { in qla24xx_set_fcp_prio()
5763 mb[0] = mcp->mb[0]; in qla24xx_set_fcp_prio()
5764 mb[1] = mcp->mb[1]; in qla24xx_set_fcp_prio()
5765 mb[3] = mcp->mb[3]; in qla24xx_set_fcp_prio()
5766 mb[4] = mcp->mb[4]; in qla24xx_set_fcp_prio()
5841 mcp->mb[0] = MBC_TOGGLE_INTERRUPT; in qla82xx_mbx_intr_enable()
5842 mcp->mb[1] = 1; in qla82xx_mbx_intr_enable()
5852 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla82xx_mbx_intr_enable()
5876 mcp->mb[0] = MBC_TOGGLE_INTERRUPT; in qla82xx_mbx_intr_disable()
5877 mcp->mb[1] = 0; in qla82xx_mbx_intr_disable()
5887 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla82xx_mbx_intr_disable()
5907 memset(mcp->mb, 0 , sizeof(mcp->mb)); in qla82xx_md_get_template_size()
5908 mcp->mb[0] = LSW(MBC_DIAGNOSTIC_MINIDUMP_TEMPLATE); in qla82xx_md_get_template_size()
5909 mcp->mb[1] = MSW(MBC_DIAGNOSTIC_MINIDUMP_TEMPLATE); in qla82xx_md_get_template_size()
5910 mcp->mb[2] = LSW(RQST_TMPLT_SIZE); in qla82xx_md_get_template_size()
5911 mcp->mb[3] = MSW(RQST_TMPLT_SIZE); in qla82xx_md_get_template_size()
5925 (mcp->mb[1] << 16) | mcp->mb[0], in qla82xx_md_get_template_size()
5926 (mcp->mb[3] << 16) | mcp->mb[2]); in qla82xx_md_get_template_size()
5930 ha->md_template_size = ((mcp->mb[3] << 16) | mcp->mb[2]); in qla82xx_md_get_template_size()
5959 memset(mcp->mb, 0 , sizeof(mcp->mb)); in qla82xx_md_get_template()
5960 mcp->mb[0] = LSW(MBC_DIAGNOSTIC_MINIDUMP_TEMPLATE); in qla82xx_md_get_template()
5961 mcp->mb[1] = MSW(MBC_DIAGNOSTIC_MINIDUMP_TEMPLATE); in qla82xx_md_get_template()
5962 mcp->mb[2] = LSW(RQST_TMPLT); in qla82xx_md_get_template()
5963 mcp->mb[3] = MSW(RQST_TMPLT); in qla82xx_md_get_template()
5964 mcp->mb[4] = LSW(LSD(ha->md_tmplt_hdr_dma)); in qla82xx_md_get_template()
5965 mcp->mb[5] = MSW(LSD(ha->md_tmplt_hdr_dma)); in qla82xx_md_get_template()
5966 mcp->mb[6] = LSW(MSD(ha->md_tmplt_hdr_dma)); in qla82xx_md_get_template()
5967 mcp->mb[7] = MSW(MSD(ha->md_tmplt_hdr_dma)); in qla82xx_md_get_template()
5968 mcp->mb[8] = LSW(ha->md_template_size); in qla82xx_md_get_template()
5969 mcp->mb[9] = MSW(ha->md_template_size); in qla82xx_md_get_template()
5981 ((mcp->mb[1] << 16) | mcp->mb[0]), in qla82xx_md_get_template()
5982 ((mcp->mb[3] << 16) | mcp->mb[2])); in qla82xx_md_get_template()
6009 memset(mcp->mb, 0 , sizeof(mcp->mb)); in qla8044_md_get_template()
6011 mcp->mb[0] = LSW(MBC_DIAGNOSTIC_MINIDUMP_TEMPLATE); in qla8044_md_get_template()
6012 mcp->mb[1] = MSW(MBC_DIAGNOSTIC_MINIDUMP_TEMPLATE); in qla8044_md_get_template()
6013 mcp->mb[2] = LSW(RQST_TMPLT); in qla8044_md_get_template()
6014 mcp->mb[3] = MSW(RQST_TMPLT); in qla8044_md_get_template()
6015 mcp->mb[4] = LSW(LSD(ha->md_tmplt_hdr_dma + offset)); in qla8044_md_get_template()
6016 mcp->mb[5] = MSW(LSD(ha->md_tmplt_hdr_dma + offset)); in qla8044_md_get_template()
6017 mcp->mb[6] = LSW(MSD(ha->md_tmplt_hdr_dma + offset)); in qla8044_md_get_template()
6018 mcp->mb[7] = MSW(MSD(ha->md_tmplt_hdr_dma + offset)); in qla8044_md_get_template()
6019 mcp->mb[8] = LSW(size); in qla8044_md_get_template()
6020 mcp->mb[9] = MSW(size); in qla8044_md_get_template()
6021 mcp->mb[10] = offset & 0x0000FFFF; in qla8044_md_get_template()
6022 mcp->mb[11] = offset & 0xFFFF0000; in qla8044_md_get_template()
6033 ((mcp->mb[1] << 16) | mcp->mb[0]), in qla8044_md_get_template()
6034 ((mcp->mb[3] << 16) | mcp->mb[2])); in qla8044_md_get_template()
6059 mcp->mb[0] = MBC_SET_LED_CONFIG; in qla81xx_set_led_config()
6060 mcp->mb[1] = led_cfg[0]; in qla81xx_set_led_config()
6061 mcp->mb[2] = led_cfg[1]; in qla81xx_set_led_config()
6063 mcp->mb[3] = led_cfg[2]; in qla81xx_set_led_config()
6064 mcp->mb[4] = led_cfg[3]; in qla81xx_set_led_config()
6065 mcp->mb[5] = led_cfg[4]; in qla81xx_set_led_config()
6066 mcp->mb[6] = led_cfg[5]; in qla81xx_set_led_config()
6079 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla81xx_set_led_config()
6103 mcp->mb[0] = MBC_GET_LED_CONFIG; in qla81xx_get_led_config()
6115 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla81xx_get_led_config()
6117 led_cfg[0] = mcp->mb[1]; in qla81xx_get_led_config()
6118 led_cfg[1] = mcp->mb[2]; in qla81xx_get_led_config()
6120 led_cfg[2] = mcp->mb[3]; in qla81xx_get_led_config()
6121 led_cfg[3] = mcp->mb[4]; in qla81xx_get_led_config()
6122 led_cfg[4] = mcp->mb[5]; in qla81xx_get_led_config()
6123 led_cfg[5] = mcp->mb[6]; in qla81xx_get_led_config()
6147 mcp->mb[0] = MBC_SET_LED_CONFIG; in qla82xx_mbx_beacon_ctl()
6149 mcp->mb[7] = 0xE; in qla82xx_mbx_beacon_ctl()
6151 mcp->mb[7] = 0xD; in qla82xx_mbx_beacon_ctl()
6161 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla82xx_mbx_beacon_ctl()
6184 mcp->mb[0] = MBC_WRITE_REMOTE_REG; in qla83xx_wr_reg()
6185 mcp->mb[1] = LSW(reg); in qla83xx_wr_reg()
6186 mcp->mb[2] = MSW(reg); in qla83xx_wr_reg()
6187 mcp->mb[3] = LSW(data); in qla83xx_wr_reg()
6188 mcp->mb[4] = MSW(data); in qla83xx_wr_reg()
6198 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla83xx_wr_reg()
6226 mcp->mb[0] = MBC_PORT_LOGOUT; in qla2x00_port_logout()
6227 mcp->mb[1] = fcport->loop_id; in qla2x00_port_logout()
6228 mcp->mb[10] = BIT_15; in qla2x00_port_logout()
6236 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_port_logout()
6259 mcp->mb[0] = MBC_READ_REMOTE_REG; in qla83xx_rd_reg()
6260 mcp->mb[1] = LSW(reg); in qla83xx_rd_reg()
6261 mcp->mb[2] = MSW(reg); in qla83xx_rd_reg()
6270 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla83xx_rd_reg()
6271 rval, mcp->mb[0], mcp->mb[1]); in qla83xx_rd_reg()
6273 *data = (mcp->mb[3] | (mcp->mb[4] << 16)); in qla83xx_rd_reg()
6308 mcp->mb[0] = MBC_RESTART_NIC_FIRMWARE; in qla83xx_restart_nic_firmware()
6317 "Failed=%x mb[0]=%x mb[1]=%x.\n", in qla83xx_restart_nic_firmware()
6318 rval, mcp->mb[0], mcp->mb[1]); in qla83xx_restart_nic_firmware()
6342 mcp->mb[0] = MBC_SET_ACCESS_CONTROL; in qla83xx_access_control()
6343 mcp->mb[1] = options; in qla83xx_access_control()
6346 mcp->mb[2] = LSW(start_addr); in qla83xx_access_control()
6347 mcp->mb[3] = MSW(start_addr); in qla83xx_access_control()
6348 mcp->mb[4] = LSW(end_addr); in qla83xx_access_control()
6349 mcp->mb[5] = MSW(end_addr); in qla83xx_access_control()
6361 "Failed=%x mb[0]=%x mb[1]=%x mb[2]=%x mb[3]=%x mb[4]=%x.\n", in qla83xx_access_control()
6362 rval, mcp->mb[0], mcp->mb[1], mcp->mb[2], mcp->mb[3], in qla83xx_access_control()
6363 mcp->mb[4]); in qla83xx_access_control()
6367 *sector_size = mcp->mb[1]; in qla83xx_access_control()
6370 "Driver-lock id=%x%x", mcp->mb[4], mcp->mb[3]); in qla83xx_access_control()
6373 "Flash-lock id=%x%x", mcp->mb[4], mcp->mb[3]); in qla83xx_access_control()
6395 mcp->mb[0] = MBC_DUMP_RISC_RAM_EXTENDED; in qla2x00_dump_mctp_data()
6396 mcp->mb[1] = LSW(addr); in qla2x00_dump_mctp_data()
6397 mcp->mb[2] = MSW(req_dma); in qla2x00_dump_mctp_data()
6398 mcp->mb[3] = LSW(req_dma); in qla2x00_dump_mctp_data()
6399 mcp->mb[4] = MSW(size); in qla2x00_dump_mctp_data()
6400 mcp->mb[5] = LSW(size); in qla2x00_dump_mctp_data()
6401 mcp->mb[6] = MSW(MSD(req_dma)); in qla2x00_dump_mctp_data()
6402 mcp->mb[7] = LSW(MSD(req_dma)); in qla2x00_dump_mctp_data()
6403 mcp->mb[8] = MSW(addr); in qla2x00_dump_mctp_data()
6406 mcp->mb[10] = BIT_7 | 0x40; in qla2x00_dump_mctp_data()
6418 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2x00_dump_mctp_data()
6452 mcp->mb[0] = MBC_DPORT_DIAGNOSTICS; in qla26xx_dport_diagnostics()
6453 mcp->mb[1] = options; in qla26xx_dport_diagnostics()
6454 mcp->mb[2] = MSW(LSD(dd_dma)); in qla26xx_dport_diagnostics()
6455 mcp->mb[3] = LSW(LSD(dd_dma)); in qla26xx_dport_diagnostics()
6456 mcp->mb[6] = MSW(MSD(dd_dma)); in qla26xx_dport_diagnostics()
6457 mcp->mb[7] = LSW(MSD(dd_dma)); in qla26xx_dport_diagnostics()
6458 mcp->mb[8] = size; in qla26xx_dport_diagnostics()
6463 mcp->tov = MBX_TOV_SECONDS * 4; in qla26xx_dport_diagnostics()
6501 mcp->mb[0] = MBC_DPORT_DIAGNOSTICS; in qla26xx_dport_diagnostics_v2()
6502 mcp->mb[1] = options; in qla26xx_dport_diagnostics_v2()
6503 mcp->mb[2] = MSW(LSD(dd_dma)); in qla26xx_dport_diagnostics_v2()
6504 mcp->mb[3] = LSW(LSD(dd_dma)); in qla26xx_dport_diagnostics_v2()
6505 mcp->mb[6] = MSW(MSD(dd_dma)); in qla26xx_dport_diagnostics_v2()
6506 mcp->mb[7] = LSW(MSD(dd_dma)); in qla26xx_dport_diagnostics_v2()
6507 mcp->mb[8] = size; in qla26xx_dport_diagnostics_v2()
6512 mcp->tov = MBX_TOV_SECONDS * 4; in qla26xx_dport_diagnostics_v2()
6536 * This mailbox uses the iocb interface to send MB command.
6558 sp->name = mb_to_str(mcp->mb[0]); in qla24xx_send_mb_cmd()
6562 memcpy(sp->u.iocb_cmd.u.mbx.out_mb, mcp->mb, SIZEOF_IOCB_MB_REG); in qla24xx_send_mb_cmd()
6572 ql_dbg(ql_dbg_mbx, vha, 0x113f, "MB:%s hndl %x submitted\n", in qla24xx_send_mb_cmd()
6576 memcpy(mcp->mb, sp->u.iocb_cmd.u.mbx.in_mb, SIZEOF_IOCB_MB_REG); in qla24xx_send_mb_cmd()
6624 mc.mb[0] = MBC_GET_PORT_DATABASE; in qla24xx_gpdb_wait()
6625 mc.mb[1] = fcport->loop_id; in qla24xx_gpdb_wait()
6626 mc.mb[2] = MSW(pd_dma); in qla24xx_gpdb_wait()
6627 mc.mb[3] = LSW(pd_dma); in qla24xx_gpdb_wait()
6628 mc.mb[6] = MSW(MSD(pd_dma)); in qla24xx_gpdb_wait()
6629 mc.mb[7] = LSW(MSD(pd_dma)); in qla24xx_gpdb_wait()
6630 mc.mb[9] = vha->vp_idx; in qla24xx_gpdb_wait()
6631 mc.mb[10] = opt; in qla24xx_gpdb_wait()
6660 current_login_state = pd->current_login_state >> 4; in __qla24xx_parse_gpdb()
6661 last_login_state = pd->last_login_state >> 4; in __qla24xx_parse_gpdb()
6742 mc.mb[0] = MBC_GET_ID_LIST; in qla24xx_gidlist_wait()
6743 mc.mb[2] = MSW(id_list_dma); in qla24xx_gidlist_wait()
6744 mc.mb[3] = LSW(id_list_dma); in qla24xx_gidlist_wait()
6745 mc.mb[6] = MSW(MSD(id_list_dma)); in qla24xx_gidlist_wait()
6746 mc.mb[7] = LSW(MSD(id_list_dma)); in qla24xx_gidlist_wait()
6747 mc.mb[8] = 0; in qla24xx_gidlist_wait()
6748 mc.mb[9] = vha->vp_idx; in qla24xx_gidlist_wait()
6755 *entries = mc.mb[1]; in qla24xx_gidlist_wait()
6772 memset(mcp->mb, 0 , sizeof(mcp->mb)); in qla27xx_set_zio_threshold()
6773 mcp->mb[0] = MBC_GET_SET_ZIO_THRESHOLD; in qla27xx_set_zio_threshold()
6774 mcp->mb[1] = 1; in qla27xx_set_zio_threshold()
6775 mcp->mb[2] = value; in qla27xx_set_zio_threshold()
6798 memset(mcp->mb, 0, sizeof(mcp->mb)); in qla27xx_get_zio_threshold()
6799 mcp->mb[0] = MBC_GET_SET_ZIO_THRESHOLD; in qla27xx_get_zio_threshold()
6800 mcp->mb[1] = 0; in qla27xx_get_zio_threshold()
6808 *value = mc.mb[2]; in qla27xx_get_zio_threshold()
6832 if (iter == 4) { in qla2x00_read_sfp_dev()
6878 mc.mb[0] = MBC_GET_RESOURCE_COUNTS; in qla24xx_res_count_wait()
6886 memcpy(out_mb, mc.mb, out_mb_sz); in qla24xx_res_count_wait()
6888 memcpy(out_mb, mc.mb, SIZEOF_IOCB_MB_REG); in qla24xx_res_count_wait()
6905 mcp->mb[0] = MBC_SECURE_FLASH_UPDATE; in qla28xx_secure_flash_update()
6906 mcp->mb[1] = opts; in qla28xx_secure_flash_update()
6907 mcp->mb[2] = region; in qla28xx_secure_flash_update()
6908 mcp->mb[3] = MSW(len); in qla28xx_secure_flash_update()
6909 mcp->mb[4] = LSW(len); in qla28xx_secure_flash_update()
6910 mcp->mb[5] = MSW(sfub_dma_addr); in qla28xx_secure_flash_update()
6911 mcp->mb[6] = LSW(sfub_dma_addr); in qla28xx_secure_flash_update()
6912 mcp->mb[7] = MSW(MSD(sfub_dma_addr)); in qla28xx_secure_flash_update()
6913 mcp->mb[8] = LSW(MSD(sfub_dma_addr)); in qla28xx_secure_flash_update()
6914 mcp->mb[9] = sfub_len; in qla28xx_secure_flash_update()
6924 __func__, vha->host_no, rval, mcp->mb[0], mcp->mb[1], in qla28xx_secure_flash_update()
6925 mcp->mb[2]); in qla28xx_secure_flash_update()
6941 mcp->mb[0] = MBC_WRITE_REMOTE_REG; in qla2xxx_write_remote_register()
6942 mcp->mb[1] = LSW(addr); in qla2xxx_write_remote_register()
6943 mcp->mb[2] = MSW(addr); in qla2xxx_write_remote_register()
6944 mcp->mb[3] = LSW(data); in qla2xxx_write_remote_register()
6945 mcp->mb[4] = MSW(data); in qla2xxx_write_remote_register()
6954 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2xxx_write_remote_register()
6973 mcp->mb[0] = MBC_READ_REMOTE_REG; in qla2xxx_read_remote_register()
6974 mcp->mb[1] = LSW(addr); in qla2xxx_read_remote_register()
6975 mcp->mb[2] = MSW(addr); in qla2xxx_read_remote_register()
6982 *data = (uint32_t)((((uint32_t)mcp->mb[4]) << 16) | mcp->mb[3]); in qla2xxx_read_remote_register()
6986 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla2xxx_read_remote_register()
7009 mcp->mb[0] = MBC_SET_GET_FC_LED_CONFIG; in ql26xx_led_config()
7010 mcp->mb[1] = options; in ql26xx_led_config()
7015 mcp->mb[2] = led[2]; in ql26xx_led_config()
7019 mcp->mb[3] = led[0]; in ql26xx_led_config()
7023 mcp->mb[4] = led[1]; in ql26xx_led_config()
7033 ql_dbg(ql_dbg_mbx, vha, 0x7071, "Failed %s %x (mb=%x,%x)\n", in ql26xx_led_config()
7034 __func__, rval, mcp->mb[0], mcp->mb[1]); in ql26xx_led_config()
7042 led[2] = mcp->mb[2]; in ql26xx_led_config()
7043 led[0] = mcp->mb[3]; in ql26xx_led_config()
7044 led[1] = mcp->mb[4]; in ql26xx_led_config()
7053 * qla_no_op_mb(): This MB is used to check if FW is still alive and
7066 mcp->mb[0] = 0; // noop cmd= 0 in qla_no_op_mb()
7088 memcpy(&mcp->mb, (char *)mbx_in, (32 * sizeof(uint16_t))); in qla_mailbox_passthru()
7101 "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); in qla_mailbox_passthru()
7106 memcpy(mbx_out, &mcp->mb, 32 * sizeof(uint16_t)); in qla_mailbox_passthru()