Lines Matching refs:ahw

261 void qlcnic_83xx_register_map(struct qlcnic_hardware_context *ahw)  in qlcnic_83xx_register_map()  argument
263 ahw->hw_ops = &qlcnic_83xx_hw_ops; in qlcnic_83xx_register_map()
264 ahw->reg_tbl = (u32 *)qlcnic_83xx_reg_tbl; in qlcnic_83xx_register_map()
265 ahw->ext_reg_tbl = (u32 *)qlcnic_83xx_ext_reg_tbl; in qlcnic_83xx_register_map()
289 base = adapter->ahw->pci_base0 + in __qlcnic_set_win_base()
290 QLC_83XX_CRB_WIN_FUNC(adapter->ahw->pci_func); in __qlcnic_set_win_base()
302 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_rd_reg_indirect() local
306 return QLCRDX(ahw, QLCNIC_WILDCARD); in qlcnic_83xx_rd_reg_indirect()
318 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_wrt_reg_indirect() local
322 QLCWRX(ahw, QLCNIC_WILDCARD, data); in qlcnic_83xx_wrt_reg_indirect()
334 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_enable_legacy() local
337 adapter->tgt_status_reg = ahw->pci_base0 + QLC_83XX_INTX_PTR; in qlcnic_83xx_enable_legacy()
338 adapter->tgt_mask_reg = ahw->pci_base0 + QLC_83XX_INTX_MASK; in qlcnic_83xx_enable_legacy()
339 adapter->isr_int_vec = ahw->pci_base0 + QLC_83XX_INTX_TRGR; in qlcnic_83xx_enable_legacy()
361 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_setup_intr() local
368 num_msix = ahw->num_msix; in qlcnic_83xx_setup_intr()
377 num_msix = ahw->num_msix; in qlcnic_83xx_setup_intr()
388 ahw->intr_tbl = in qlcnic_83xx_setup_intr()
391 if (!ahw->intr_tbl) in qlcnic_83xx_setup_intr()
395 if (adapter->ahw->pci_func >= QLC_MAX_LEGACY_FUNC_SUPP) { in qlcnic_83xx_setup_intr()
397 ahw->pci_func); in qlcnic_83xx_setup_intr()
406 ahw->intr_tbl[i].type = QLCNIC_INTRPT_MSIX; in qlcnic_83xx_setup_intr()
408 ahw->intr_tbl[i].type = QLCNIC_INTRPT_INTX; in qlcnic_83xx_setup_intr()
409 ahw->intr_tbl[i].id = i; in qlcnic_83xx_setup_intr()
410 ahw->intr_tbl[i].src = 0; in qlcnic_83xx_setup_intr()
437 mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_enable_legacy_msix_mbx_intr()
438 writel(0, adapter->ahw->pci_base0 + mask); in qlcnic_83xx_enable_legacy_msix_mbx_intr()
445 mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_disable_mbx_intr()
446 writel(1, adapter->ahw->pci_base0 + mask); in qlcnic_83xx_disable_mbx_intr()
447 QLCWRX(adapter->ahw, QLCNIC_MBX_INTR_ENBL, 0); in qlcnic_83xx_disable_mbx_intr()
459 cmd->rsp.arg[i] = readl(QLCNIC_MBX_FW(adapter->ahw, i)); in qlcnic_83xx_get_mbx_data()
465 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_clear_legacy_intr() local
473 if (QLC_83XX_INTX_FUNC(intr_val) != adapter->ahw->pci_func) { in qlcnic_83xx_clear_legacy_intr()
485 if (QLC_83XX_INTX_FUNC(intr_val) != ahw->pci_func) in qlcnic_83xx_clear_legacy_intr()
503 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_poll_process_aen()
507 resp = QLCRDX(adapter->ahw, QLCNIC_FW_MBX_CTRL); in qlcnic_83xx_poll_process_aen()
511 event = readl(QLCNIC_MBX_FW(adapter->ahw, 0)); in qlcnic_83xx_poll_process_aen()
527 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_intr() local
534 if (ahw->diag_test) { in qlcnic_83xx_intr()
535 if (ahw->diag_test == QLCNIC_INTERRUPT_TEST) in qlcnic_83xx_intr()
536 ahw->diag_cnt++; in qlcnic_83xx_intr()
563 adapter->ahw->diag_cnt++; in qlcnic_83xx_tmp_intr()
579 num_msix = adapter->ahw->num_msix - 1; in qlcnic_83xx_free_mbx_intr()
604 val = adapter->msix_entries[adapter->ahw->num_msix - 1].vector; in qlcnic_83xx_setup_mbx_intr()
631 u32 val = QLCRDX(adapter->ahw, QLCNIC_INFORMANT); in qlcnic_83xx_get_func_no()
632 adapter->ahw->pci_func = (val >> 24) & 0xff; in qlcnic_83xx_get_func_no()
640 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_cam_lock() local
642 addr = ahw->pci_base0 + QLC_83XX_SEM_LOCK_FUNC(ahw->pci_func); in qlcnic_83xx_cam_lock()
648 ahw->pci_func); in qlcnic_83xx_cam_lock()
660 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_cam_unlock() local
662 addr = ahw->pci_base0 + QLC_83XX_SEM_UNLOCK_FUNC(ahw->pci_func); in qlcnic_83xx_cam_unlock()
702 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_port_info() local
711 if (ahw->port_config & QLC_83XX_10G_CAPABLE) { in qlcnic_83xx_get_port_info()
712 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_get_port_info()
713 } else if (ahw->port_config & QLC_83XX_10_CAPABLE || in qlcnic_83xx_get_port_info()
714 ahw->port_config & QLC_83XX_100_CAPABLE || in qlcnic_83xx_get_port_info()
715 ahw->port_config & QLC_83XX_1G_CAPABLE) { in qlcnic_83xx_get_port_info()
716 ahw->port_type = QLCNIC_GBE; in qlcnic_83xx_get_port_info()
718 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_get_port_info()
721 if (QLC_83XX_AUTONEG(ahw->port_config)) in qlcnic_83xx_get_port_info()
722 ahw->link_autoneg = AUTONEG_ENABLE; in qlcnic_83xx_get_port_info()
730 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_mac_filter_count() local
731 u16 act_pci_fn = ahw->total_nic_func; in qlcnic_83xx_set_mac_filter_count()
734 ahw->max_mc_count = QLC_83XX_MAX_MC_COUNT; in qlcnic_83xx_set_mac_filter_count()
741 ahw->max_uc_count = count; in qlcnic_83xx_set_mac_filter_count()
749 val = BIT_2 | ((adapter->ahw->num_msix - 1) << 8); in qlcnic_83xx_enable_mbx_interrupt()
753 QLCWRX(adapter->ahw, QLCNIC_MBX_INTR_ENBL, val); in qlcnic_83xx_enable_mbx_interrupt()
761 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_check_vf() local
763 ahw->fw_hal_version = 2; in qlcnic_83xx_check_vf()
772 op_mode = QLCRDX(adapter->ahw, QLC_83XX_DRV_OP_MODE); in qlcnic_83xx_check_vf()
777 ahw->pci_func); in qlcnic_83xx_check_vf()
780 ahw->op_mode = QLCNIC_NON_PRIV_FUNC; in qlcnic_83xx_check_vf()
783 ahw->fw_hal_version); in qlcnic_83xx_check_vf()
827 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_poll_for_mbx_completion() local
843 __func__, opcode, cmd->type, ahw->pci_func, ahw->op_mode); in qlcnic_83xx_poll_for_mbx_completion()
844 flush_workqueue(ahw->mailbox->work_q); in qlcnic_83xx_poll_for_mbx_completion()
851 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_issue_cmd()
852 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_issue_cmd() local
865 __func__, opcode, cmd->type, ahw->pci_func, in qlcnic_83xx_issue_cmd()
866 ahw->op_mode); in qlcnic_83xx_issue_cmd()
875 __func__, opcode, cmd_type, ahw->pci_func, in qlcnic_83xx_issue_cmd()
876 ahw->op_mode); in qlcnic_83xx_issue_cmd()
888 __func__, opcode, cmd_type, ahw->pci_func, in qlcnic_83xx_issue_cmd()
889 ahw->op_mode); in qlcnic_83xx_issue_cmd()
922 temp = adapter->ahw->fw_hal_version << 29; in qlcnic_83xx_alloc_mbx_args()
946 cmd.req.arg[i] = adapter->ahw->mbox_aen[i]; in qlcnic_83xx_idc_aen_work()
960 clear_bit(QLC_83XX_IDC_COMP_AEN, &adapter->ahw->idc.status); in qlcnic_83xx_handle_idc_comp_aen()
966 struct qlcnic_hardware_context *ahw = adapter->ahw; in __qlcnic_83xx_process_aen() local
971 event[i] = readl(QLCNIC_MBX_FW(ahw, i)); in __qlcnic_83xx_process_aen()
983 adapter->ahw->mbox_aen[i] = QLCNIC_MBX_RSP(event[i]); in __qlcnic_83xx_process_aen()
988 ahw->extend_lb_time = event[1] >> 8 & 0xf; in __qlcnic_83xx_process_aen()
1010 QLCWRX(ahw, QLCNIC_FW_MBX_CTRL, QLCNIC_CLR_OWNER); in __qlcnic_83xx_process_aen()
1016 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_process_aen() local
1017 struct qlcnic_mailbox *mbx = ahw->mailbox; in qlcnic_83xx_process_aen()
1021 resp = QLCRDX(ahw, QLCNIC_FW_MBX_CTRL); in qlcnic_83xx_process_aen()
1023 event = readl(QLCNIC_MBX_FW(ahw, 0)); in qlcnic_83xx_process_aen()
1075 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_add_rings() local
1080 err = ahw->hw_ops->alloc_mbx_args(&cmd, adapter, in qlcnic_83xx_add_rings()
1102 intrpt_id = ahw->intr_tbl[i].id; in qlcnic_83xx_add_rings()
1104 intrpt_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_add_rings()
1106 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) in qlcnic_83xx_add_rings()
1117 err = ahw->hw_ops->mbx_cmd(adapter, &cmd); in qlcnic_83xx_add_rings()
1129 sds->crb_sts_consumer = ahw->pci_base0 + in qlcnic_83xx_add_rings()
1132 intr_mask = ahw->intr_tbl[i].src; in qlcnic_83xx_add_rings()
1134 intr_mask = QLCRDX(ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_add_rings()
1136 sds->crb_intr_mask = ahw->pci_base0 + intr_mask; in qlcnic_83xx_add_rings()
1182 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_create_rx_ctx() local
1224 intrpt_id = ahw->intr_tbl[i].id; in qlcnic_83xx_create_rx_ctx()
1226 intrpt_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_create_rx_ctx()
1227 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) in qlcnic_83xx_create_rx_ctx()
1256 err = ahw->hw_ops->mbx_cmd(adapter, &cmd); in qlcnic_83xx_create_rx_ctx()
1271 rds->crb_rcv_producer = ahw->pci_base0 + in qlcnic_83xx_create_rx_ctx()
1275 rds->crb_rcv_producer = ahw->pci_base0 + in qlcnic_83xx_create_rx_ctx()
1280 sds->crb_sts_consumer = ahw->pci_base0 + in qlcnic_83xx_create_rx_ctx()
1283 intr_mask = ahw->intr_tbl[i].src; in qlcnic_83xx_create_rx_ctx()
1285 intr_mask = QLCRDX(ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_create_rx_ctx()
1286 sds->crb_intr_mask = ahw->pci_base0 + intr_mask; in qlcnic_83xx_create_rx_ctx()
1327 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_create_tx_ctx() local
1348 msix_id = ahw->intr_tbl[msix_vector].id; in qlcnic_83xx_create_tx_ctx()
1350 msix_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_create_tx_ctx()
1353 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) in qlcnic_83xx_create_tx_ctx()
1382 tx->crb_cmd_producer = ahw->pci_base0 + mbx_out->host_prod; in qlcnic_83xx_create_tx_ctx()
1386 intr_mask = ahw->intr_tbl[adapter->drv_sds_rings + ring].src; in qlcnic_83xx_create_tx_ctx()
1387 tx->crb_intr_mask = ahw->pci_base0 + intr_mask; in qlcnic_83xx_create_tx_ctx()
1415 adapter->ahw->diag_test = test; in qlcnic_83xx_diag_alloc_res()
1416 adapter->ahw->linkup = 0; in qlcnic_83xx_diag_alloc_res()
1440 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_83xx_diag_alloc_res()
1447 if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) { in qlcnic_83xx_diag_alloc_res()
1448 adapter->ahw->loopback_state = 0; in qlcnic_83xx_diag_alloc_res()
1449 adapter->ahw->hw_ops->setup_link_event(adapter, 1); in qlcnic_83xx_diag_alloc_res()
1464 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_83xx_diag_free_res()
1475 adapter->ahw->diag_test = 0; in qlcnic_83xx_diag_free_res()
1490 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_beacon_state() local
1501 ahw->beacon_state = QLC_83XX_BEACON_OFF; in qlcnic_83xx_get_beacon_state()
1503 ahw->beacon_state = QLC_83XX_BEACON_ON; in qlcnic_83xx_get_beacon_state()
1536 adapter->ahw->mbox_reg[i] = cmd.rsp.arg[i+1]; in qlcnic_83xx_config_led()
1568 cmd.req.arg[1] = adapter->ahw->mbox_reg[0]; in qlcnic_83xx_config_led()
1569 cmd.req.arg[2] = adapter->ahw->mbox_reg[1]; in qlcnic_83xx_config_led()
1570 cmd.req.arg[3] = adapter->ahw->mbox_reg[2]; in qlcnic_83xx_config_led()
1572 cmd.req.arg[4] = adapter->ahw->mbox_reg[3]; in qlcnic_83xx_config_led()
1588 if (adapter->ahw->op_mode == QLCNIC_NON_PRIV_FUNC) { in qlcnic_83xx_set_led()
1668 cmd.req.arg[1] = adapter->ahw->port_config; in qlcnic_83xx_set_port_config()
1689 adapter->ahw->port_config = cmd.rsp.arg[1]; in qlcnic_83xx_get_port_config()
1766 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_loopback_test() local
1771 if (ahw->op_mode == QLCNIC_NON_PRIV_FUNC) { in qlcnic_83xx_loopback_test()
1816 } while ((adapter->ahw->linkup && ahw->has_link_events) != 1); in qlcnic_83xx_loopback_test()
1835 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_extend_lb_idc_cmpltn_wait() local
1839 ahw->extend_lb_time); in qlcnic_extend_lb_idc_cmpltn_wait()
1840 temp = ahw->extend_lb_time * 1000; in qlcnic_extend_lb_idc_cmpltn_wait()
1842 ahw->extend_lb_time = 0; in qlcnic_extend_lb_idc_cmpltn_wait()
1847 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_lb_mode() local
1852 ahw->extend_lb_time = 0; in qlcnic_83xx_set_lb_mode()
1858 config = ahw->port_config; in qlcnic_83xx_set_lb_mode()
1868 set_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1871 ahw->port_config |= QLC_83XX_CFG_LOOPBACK_HSS; in qlcnic_83xx_set_lb_mode()
1873 ahw->port_config |= QLC_83XX_CFG_LOOPBACK_EXT; in qlcnic_83xx_set_lb_mode()
1879 ahw->port_config); in qlcnic_83xx_set_lb_mode()
1880 ahw->port_config = config; in qlcnic_83xx_set_lb_mode()
1881 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1892 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1896 if (ahw->extend_lb_time) in qlcnic_83xx_set_lb_mode()
1903 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1907 } while (test_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status)); in qlcnic_83xx_set_lb_mode()
1916 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_clear_lb_mode() local
1917 u32 config = ahw->port_config, max_wait_count; in qlcnic_83xx_clear_lb_mode()
1921 ahw->extend_lb_time = 0; in qlcnic_83xx_clear_lb_mode()
1923 set_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1925 ahw->port_config &= ~QLC_83XX_CFG_LOOPBACK_HSS; in qlcnic_83xx_clear_lb_mode()
1927 ahw->port_config &= ~QLC_83XX_CFG_LOOPBACK_EXT; in qlcnic_83xx_clear_lb_mode()
1933 ahw->port_config); in qlcnic_83xx_clear_lb_mode()
1934 ahw->port_config = config; in qlcnic_83xx_clear_lb_mode()
1935 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1946 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1950 if (ahw->extend_lb_time) in qlcnic_83xx_clear_lb_mode()
1957 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1960 } while (test_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status)); in qlcnic_83xx_clear_lb_mode()
2196 struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal; in qlcnic_83xx_set_rx_intr_coal()
2223 struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal; in qlcnic_83xx_set_tx_intr_coal()
2268 struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal; in qlcnic_83xx_config_intr_coal()
2323 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_handle_link_aen() local
2328 ahw->link_speed = MSW(data[2]); in qlcnic_83xx_handle_link_aen()
2331 ahw->link_duplex = DUPLEX_FULL; in qlcnic_83xx_handle_link_aen()
2333 ahw->link_duplex = DUPLEX_HALF; in qlcnic_83xx_handle_link_aen()
2335 ahw->link_speed = SPEED_UNKNOWN; in qlcnic_83xx_handle_link_aen()
2336 ahw->link_duplex = DUPLEX_UNKNOWN; in qlcnic_83xx_handle_link_aen()
2339 ahw->link_autoneg = MSB(MSW(data[3])); in qlcnic_83xx_handle_link_aen()
2340 ahw->module_type = MSB(LSW(data[3])); in qlcnic_83xx_handle_link_aen()
2341 ahw->has_link_events = 1; in qlcnic_83xx_handle_link_aen()
2342 ahw->lb_mode = data[4] & QLCNIC_LB_MODE_MASK; in qlcnic_83xx_handle_link_aen()
2353 mbx = adapter->ahw->mailbox; in qlcnic_83xx_handle_aen()
2355 resp = QLCRDX(adapter->ahw, QLCNIC_FW_MBX_CTRL); in qlcnic_83xx_handle_aen()
2359 event = readl(QLCNIC_MBX_FW(adapter->ahw, 0)); in qlcnic_83xx_handle_aen()
2370 mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_handle_aen()
2371 writel(0, adapter->ahw->pci_base0 + mask); in qlcnic_83xx_handle_aen()
2382 if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) { in qlcnic_83xx_set_nic_info()
2423 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_nic_info() local
2429 if (func_id != ahw->pci_func) { in qlcnic_83xx_get_nic_info()
2433 cmd.req.arg[1] = ahw->pci_func << 16; in qlcnic_83xx_get_nic_info()
2461 memcpy(ahw->extra_capability, &cmd.rsp.arg[16], in qlcnic_83xx_get_nic_info()
2462 sizeof(ahw->extra_capability)); in qlcnic_83xx_get_nic_info()
2497 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_pci_info() local
2510 ahw->total_nic_func = 0; in qlcnic_83xx_get_pci_info()
2512 ahw->max_pci_func = cmd.rsp.arg[1] & 0xFF; in qlcnic_83xx_get_pci_info()
2513 for (i = 2, j = 0; j < ahw->max_vnic_func; j++, pci_info++) { in qlcnic_83xx_get_pci_info()
2541 ahw->total_nic_func = nic; in qlcnic_83xx_get_pci_info()
2542 ahw->total_pci_func = nic + fcoe + iscsi; in qlcnic_83xx_get_pci_info()
2543 if (ahw->total_nic_func == 0 || ahw->total_pci_func == 0) { in qlcnic_83xx_get_pci_info()
2545 __func__, ahw->total_nic_func, ahw->total_pci_func); in qlcnic_83xx_get_pci_info()
2560 max_ints = adapter->ahw->num_msix - 1; in qlcnic_83xx_config_intrpt()
2568 cmd.req.arg[1] |= (adapter->ahw->pci_func << 8) | BIT_16; in qlcnic_83xx_config_intrpt()
2572 val = type | (adapter->ahw->intr_tbl[i].type << 4); in qlcnic_83xx_config_intrpt()
2573 if (adapter->ahw->intr_tbl[i].type == QLCNIC_INTRPT_MSIX) in qlcnic_83xx_config_intrpt()
2574 val |= (adapter->ahw->intr_tbl[i].id << 16); in qlcnic_83xx_config_intrpt()
2590 adapter->ahw->intr_tbl[i].id); in qlcnic_83xx_config_intrpt()
2594 adapter->ahw->intr_tbl[i].id = MSW(val); in qlcnic_83xx_config_intrpt()
2595 adapter->ahw->intr_tbl[i].enabled = 1; in qlcnic_83xx_config_intrpt()
2597 adapter->ahw->intr_tbl[i].src = temp; in qlcnic_83xx_config_intrpt()
2599 adapter->ahw->intr_tbl[i].id = i; in qlcnic_83xx_config_intrpt()
2600 adapter->ahw->intr_tbl[i].enabled = 0; in qlcnic_83xx_config_intrpt()
2601 adapter->ahw->intr_tbl[i].src = 0; in qlcnic_83xx_config_intrpt()
2728 cmd = adapter->ahw->fdt.write_statusreg_cmd; in qlcnic_83xx_enable_flash_write()
2732 adapter->ahw->fdt.write_enable_bits); in qlcnic_83xx_enable_flash_write()
2748 adapter->ahw->fdt.write_statusreg_cmd)); in qlcnic_83xx_disable_flash_write()
2750 adapter->ahw->fdt.write_disable_bits); in qlcnic_83xx_disable_flash_write()
2800 memset(&adapter->ahw->fdt, 0, fdt_size); in qlcnic_83xx_read_flash_descriptor_table()
2802 (u8 *)&adapter->ahw->fdt, in qlcnic_83xx_read_flash_descriptor_table()
2804 qlcnic_swap32_buffer((u32 *)&adapter->ahw->fdt, count); in qlcnic_83xx_read_flash_descriptor_table()
2818 if (adapter->ahw->fdt.mfg_id == adapter->flash_mfg_id) { in qlcnic_83xx_erase_flash_sector()
2843 cmd = QLC_83XX_FLASH_FDT_ERASE_DEF_SIG | adapter->ahw->fdt.erase_cmd; in qlcnic_83xx_erase_flash_sector()
2844 if (adapter->ahw->fdt.mfg_id == adapter->flash_mfg_id) in qlcnic_83xx_erase_flash_sector()
2860 if (adapter->ahw->fdt.mfg_id == adapter->flash_mfg_id) { in qlcnic_83xx_erase_flash_sector()
2984 val = QLCRDX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK); in qlcnic_83xx_recover_driver_lock()
2991 QLCWRX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK, val); in qlcnic_83xx_recover_driver_lock()
2995 val = QLCRDX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK); in qlcnic_83xx_recover_driver_lock()
3000 QLCWRX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK, val); in qlcnic_83xx_recover_driver_lock()
3002 QLCRDX(adapter->ahw, QLC_83XX_DRV_UNLOCK); in qlcnic_83xx_recover_driver_lock()
3005 QLCWRX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK, val); in qlcnic_83xx_recover_driver_lock()
3026 status = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK); in qlcnic_83xx_lock_driver()
3034 temp = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_lock_driver()
3037 val = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_lock_driver()
3061 val = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_lock_driver()
3065 QLCWRX(adapter->ahw, QLC_83XX_DRV_LOCK_ID, val); in qlcnic_83xx_lock_driver()
3074 val = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_unlock_driver()
3084 QLCWRX(adapter->ahw, QLC_83XX_DRV_LOCK_ID, val); in qlcnic_83xx_unlock_driver()
3085 QLCRDX(adapter->ahw, QLC_83XX_DRV_UNLOCK); in qlcnic_83xx_unlock_driver()
3098 mutex_lock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3106 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3129 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3134 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3183 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_port_type() local
3205 ahw->port_type = QLCNIC_GBE; in qlcnic_83xx_get_port_type()
3208 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_get_port_type()
3221 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_test_link() local
3226 pci_func = ahw->pci_func; in qlcnic_83xx_test_link()
3228 state = readl(ahw->pci_base0 + QLC_83XX_LINK_STATE(pci_func)); in qlcnic_83xx_test_link()
3247 ahw->link_speed = SPEED_10; in qlcnic_83xx_test_link()
3250 ahw->link_speed = SPEED_100; in qlcnic_83xx_test_link()
3253 ahw->link_speed = SPEED_1000; in qlcnic_83xx_test_link()
3256 ahw->link_speed = SPEED_10000; in qlcnic_83xx_test_link()
3259 ahw->link_speed = 0; in qlcnic_83xx_test_link()
3267 ahw->supported_type = PORT_FIBRE; in qlcnic_83xx_test_link()
3268 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_test_link()
3273 ahw->supported_type = PORT_FIBRE; in qlcnic_83xx_test_link()
3274 ahw->port_type = QLCNIC_GBE; in qlcnic_83xx_test_link()
3277 ahw->supported_type = PORT_TP; in qlcnic_83xx_test_link()
3278 ahw->port_type = QLCNIC_GBE; in qlcnic_83xx_test_link()
3284 ahw->supported_type = PORT_DA; in qlcnic_83xx_test_link()
3285 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_test_link()
3288 ahw->supported_type = PORT_OTHER; in qlcnic_83xx_test_link()
3289 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_test_link()
3302 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_link_ksettings() local
3312 ahw->module_type = QLC_83XX_SFP_MODULE_TYPE(config); in qlcnic_83xx_get_link_ksettings()
3316 ahw->board_type = QLCNIC_BRDTYPE_83XX_10G; in qlcnic_83xx_get_link_ksettings()
3318 if (netif_running(adapter->netdev) && ahw->has_link_events) { in qlcnic_83xx_get_link_ksettings()
3319 ecmd->base.speed = ahw->link_speed; in qlcnic_83xx_get_link_ksettings()
3320 ecmd->base.duplex = ahw->link_duplex; in qlcnic_83xx_get_link_ksettings()
3321 ecmd->base.autoneg = ahw->link_autoneg; in qlcnic_83xx_get_link_ksettings()
3338 if (ahw->port_config & QLC_83XX_10_CAPABLE) in qlcnic_83xx_get_link_ksettings()
3340 if (ahw->port_config & QLC_83XX_100_CAPABLE) in qlcnic_83xx_get_link_ksettings()
3342 if (ahw->port_config & QLC_83XX_1G_CAPABLE) in qlcnic_83xx_get_link_ksettings()
3344 if (ahw->port_config & QLC_83XX_10G_CAPABLE) in qlcnic_83xx_get_link_ksettings()
3346 if (ahw->port_config & QLC_83XX_AUTONEG_ENABLE) in qlcnic_83xx_get_link_ksettings()
3349 switch (ahw->link_speed) { in qlcnic_83xx_get_link_ksettings()
3368 switch (ahw->supported_type) { in qlcnic_83xx_get_link_ksettings()
3390 ecmd->base.phy_address = ahw->physical_port; in qlcnic_83xx_get_link_ksettings()
3403 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_link_ksettings() local
3404 u32 config = adapter->ahw->port_config; in qlcnic_83xx_set_link_ksettings()
3415 ahw->port_config |= QLC_83XX_AUTONEG_ENABLE; in qlcnic_83xx_set_link_ksettings()
3416 ahw->port_config |= (QLC_83XX_100_CAPABLE | in qlcnic_83xx_set_link_ksettings()
3420 ahw->port_config &= ~QLC_83XX_AUTONEG_ENABLE; in qlcnic_83xx_set_link_ksettings()
3423 ahw->port_config &= ~(QLC_83XX_100_CAPABLE | in qlcnic_83xx_set_link_ksettings()
3426 ahw->port_config |= QLC_83XX_10_CAPABLE; in qlcnic_83xx_set_link_ksettings()
3429 ahw->port_config &= ~(QLC_83XX_10_CAPABLE | in qlcnic_83xx_set_link_ksettings()
3432 ahw->port_config |= QLC_83XX_100_CAPABLE; in qlcnic_83xx_set_link_ksettings()
3435 ahw->port_config &= ~(QLC_83XX_10_CAPABLE | in qlcnic_83xx_set_link_ksettings()
3438 ahw->port_config |= QLC_83XX_1G_CAPABLE; in qlcnic_83xx_set_link_ksettings()
3441 ahw->port_config &= ~(QLC_83XX_10_CAPABLE | in qlcnic_83xx_set_link_ksettings()
3444 ahw->port_config |= QLC_83XX_10G_CAPABLE; in qlcnic_83xx_set_link_ksettings()
3454 ahw->port_config = config; in qlcnic_83xx_set_link_ksettings()
3613 sizeof(*adapter->ahw->ext_reg_tbl)) + in qlcnic_83xx_get_regs_len()
3615 sizeof(*adapter->ahw->reg_tbl)); in qlcnic_83xx_get_regs_len()
3627 regs_buff[i++] = QLCRDX(adapter->ahw, j); in qlcnic_83xx_get_registers()
3634 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_interrupt_test() local
3657 ahw->diag_cnt = 0; in qlcnic_83xx_interrupt_test()
3663 intrpt_id = ahw->intr_tbl[0].id; in qlcnic_83xx_interrupt_test()
3665 intrpt_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_interrupt_test()
3686 ret = !ahw->diag_cnt; in qlcnic_83xx_interrupt_test()
3704 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_pauseparam() local
3714 config = ahw->port_config; in qlcnic_83xx_get_pauseparam()
3740 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_pauseparam() local
3750 config = ahw->port_config; in qlcnic_83xx_set_pauseparam()
3752 if (ahw->port_type == QLCNIC_GBE) { in qlcnic_83xx_set_pauseparam()
3754 ahw->port_config |= QLC_83XX_ENABLE_AUTONEG; in qlcnic_83xx_set_pauseparam()
3756 ahw->port_config &= ~QLC_83XX_ENABLE_AUTONEG; in qlcnic_83xx_set_pauseparam()
3757 } else if ((ahw->port_type == QLCNIC_XGBE) && (pause->autoneg)) { in qlcnic_83xx_set_pauseparam()
3762 ahw->port_config |= QLC_83XX_CFG_STD_PAUSE; in qlcnic_83xx_set_pauseparam()
3765 ahw->port_config |= QLC_83XX_CFG_STD_TX_RX_PAUSE; in qlcnic_83xx_set_pauseparam()
3767 ahw->port_config &= ~QLC_83XX_CFG_STD_TX_PAUSE; in qlcnic_83xx_set_pauseparam()
3768 ahw->port_config |= QLC_83XX_CFG_STD_RX_PAUSE; in qlcnic_83xx_set_pauseparam()
3770 ahw->port_config &= ~QLC_83XX_CFG_STD_RX_PAUSE; in qlcnic_83xx_set_pauseparam()
3771 ahw->port_config |= QLC_83XX_CFG_STD_TX_PAUSE; in qlcnic_83xx_set_pauseparam()
3773 ahw->port_config &= ~(QLC_83XX_CFG_STD_TX_RX_PAUSE | in qlcnic_83xx_set_pauseparam()
3780 ahw->port_config = config; in qlcnic_83xx_set_pauseparam()
3837 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_resume() local
3838 struct qlc_83xx_idc *idc = &ahw->idc; in qlcnic_83xx_resume()
3845 if (ahw->nic_mode == QLCNIC_VNIC_MODE) { in qlcnic_83xx_resume()
3846 if (ahw->op_mode == QLCNIC_MGMT_FUNC) { in qlcnic_83xx_resume()
3895 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_flush_mbx_queue()
3915 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_check_mbx_status() local
3916 struct qlcnic_mailbox *mbx = ahw->mailbox; in qlcnic_83xx_check_mbx_status()
3922 host_mbx_ctrl = QLCRDX(ahw, QLCNIC_HOST_MBX_CTRL); in qlcnic_83xx_check_mbx_status()
3925 ahw->idc.collect_dump = 1; in qlcnic_83xx_check_mbx_status()
3936 QLCWRX(adapter->ahw, QLCNIC_HOST_MBX_CTRL, QLCNIC_SET_OWNER); in qlcnic_83xx_signal_mbx_cmd()
3938 QLCWRX(adapter->ahw, QLCNIC_FW_MBX_CTRL, QLCNIC_CLR_OWNER); in qlcnic_83xx_signal_mbx_cmd()
3944 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_dequeue_mbx_cmd()
3960 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_encode_mbx_cmd() local
3965 writel(mbx_cmd, QLCNIC_MBX_HOST(ahw, 0)); in qlcnic_83xx_encode_mbx_cmd()
3967 writel(cmd->req.arg[i], QLCNIC_MBX_HOST(ahw, i)); in qlcnic_83xx_encode_mbx_cmd()
3969 fw_hal_version = ahw->fw_hal_version; in qlcnic_83xx_encode_mbx_cmd()
3974 writel(mbx_cmd, QLCNIC_MBX_HOST(ahw, 0)); in qlcnic_83xx_encode_mbx_cmd()
3982 writel(mbx_cmd, QLCNIC_MBX_HOST(ahw, 1)); in qlcnic_83xx_encode_mbx_cmd()
3985 writel(*(cmd->hdr++), QLCNIC_MBX_HOST(ahw, i)); in qlcnic_83xx_encode_mbx_cmd()
3987 writel(*(cmd->pay++), QLCNIC_MBX_HOST(ahw, i)); in qlcnic_83xx_encode_mbx_cmd()
3993 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_detach_mailbox_work()
4009 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_enqueue_mbx_cmd()
4039 fw_data = readl(QLCNIC_MBX_FW(adapter->ahw, 2)); in qlcnic_83xx_check_mac_rcode()
4055 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_decode_mbx_rsp() local
4060 fw_data = readl(QLCNIC_MBX_FW(ahw, 0)); in qlcnic_83xx_decode_mbx_rsp()
4074 __func__, cmd->cmd_op, cmd->type, ahw->pci_func, in qlcnic_83xx_decode_mbx_rsp()
4075 ahw->op_mode, mbx_err_code); in qlcnic_83xx_decode_mbx_rsp()
4085 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_dump_mailbox_registers() local
4088 offset = QLCRDX(ahw, QLCNIC_DEF_INT_MASK); in qlcnic_dump_mailbox_registers()
4090 readl(ahw->pci_base0 + offset), in qlcnic_dump_mailbox_registers()
4091 QLCRDX(ahw, QLCNIC_MBX_INTR_ENBL), in qlcnic_dump_mailbox_registers()
4092 QLCRDX(ahw, QLCNIC_HOST_MBX_CTRL), in qlcnic_dump_mailbox_registers()
4093 QLCRDX(ahw, QLCNIC_FW_MBX_CTRL)); in qlcnic_dump_mailbox_registers()
4104 struct qlcnic_hardware_context *ahw; in qlcnic_83xx_mailbox_worker() local
4108 ahw = adapter->ahw; in qlcnic_83xx_mailbox_worker()
4139 __func__, cmd->cmd_op, cmd->type, ahw->pci_func, in qlcnic_83xx_mailbox_worker()
4140 ahw->op_mode); in qlcnic_83xx_mailbox_worker()
4163 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_init_mailbox_work() local
4166 ahw->mailbox = kzalloc(sizeof(*mbx), GFP_KERNEL); in qlcnic_83xx_init_mailbox_work()
4167 if (!ahw->mailbox) in qlcnic_83xx_init_mailbox_work()
4170 mbx = ahw->mailbox; in qlcnic_83xx_init_mailbox_work()