Lines Matching refs:ahw
258 void qlcnic_83xx_register_map(struct qlcnic_hardware_context *ahw) in qlcnic_83xx_register_map() argument
260 ahw->hw_ops = &qlcnic_83xx_hw_ops; in qlcnic_83xx_register_map()
261 ahw->reg_tbl = (u32 *)qlcnic_83xx_reg_tbl; in qlcnic_83xx_register_map()
262 ahw->ext_reg_tbl = (u32 *)qlcnic_83xx_ext_reg_tbl; in qlcnic_83xx_register_map()
286 base = adapter->ahw->pci_base0 + in __qlcnic_set_win_base()
287 QLC_83XX_CRB_WIN_FUNC(adapter->ahw->pci_func); in __qlcnic_set_win_base()
299 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_rd_reg_indirect() local
303 return QLCRDX(ahw, QLCNIC_WILDCARD); in qlcnic_83xx_rd_reg_indirect()
315 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_wrt_reg_indirect() local
319 QLCWRX(ahw, QLCNIC_WILDCARD, data); in qlcnic_83xx_wrt_reg_indirect()
331 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_enable_legacy() local
334 adapter->tgt_status_reg = ahw->pci_base0 + QLC_83XX_INTX_PTR; in qlcnic_83xx_enable_legacy()
335 adapter->tgt_mask_reg = ahw->pci_base0 + QLC_83XX_INTX_MASK; in qlcnic_83xx_enable_legacy()
336 adapter->isr_int_vec = ahw->pci_base0 + QLC_83XX_INTX_TRGR; in qlcnic_83xx_enable_legacy()
358 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_setup_intr() local
365 num_msix = ahw->num_msix; in qlcnic_83xx_setup_intr()
374 num_msix = ahw->num_msix; in qlcnic_83xx_setup_intr()
385 ahw->intr_tbl = vzalloc(num_msix * in qlcnic_83xx_setup_intr()
387 if (!ahw->intr_tbl) in qlcnic_83xx_setup_intr()
391 if (adapter->ahw->pci_func >= QLC_MAX_LEGACY_FUNC_SUPP) { in qlcnic_83xx_setup_intr()
393 ahw->pci_func); in qlcnic_83xx_setup_intr()
402 ahw->intr_tbl[i].type = QLCNIC_INTRPT_MSIX; in qlcnic_83xx_setup_intr()
404 ahw->intr_tbl[i].type = QLCNIC_INTRPT_INTX; in qlcnic_83xx_setup_intr()
405 ahw->intr_tbl[i].id = i; in qlcnic_83xx_setup_intr()
406 ahw->intr_tbl[i].src = 0; in qlcnic_83xx_setup_intr()
433 mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_enable_legacy_msix_mbx_intr()
434 writel(0, adapter->ahw->pci_base0 + mask); in qlcnic_83xx_enable_legacy_msix_mbx_intr()
441 mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_disable_mbx_intr()
442 writel(1, adapter->ahw->pci_base0 + mask); in qlcnic_83xx_disable_mbx_intr()
443 QLCWRX(adapter->ahw, QLCNIC_MBX_INTR_ENBL, 0); in qlcnic_83xx_disable_mbx_intr()
455 cmd->rsp.arg[i] = readl(QLCNIC_MBX_FW(adapter->ahw, i)); in qlcnic_83xx_get_mbx_data()
461 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_clear_legacy_intr() local
469 if (QLC_83XX_INTX_FUNC(intr_val) != adapter->ahw->pci_func) { in qlcnic_83xx_clear_legacy_intr()
481 if (QLC_83XX_INTX_FUNC(intr_val) != ahw->pci_func) in qlcnic_83xx_clear_legacy_intr()
499 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_poll_process_aen()
503 resp = QLCRDX(adapter->ahw, QLCNIC_FW_MBX_CTRL); in qlcnic_83xx_poll_process_aen()
507 event = readl(QLCNIC_MBX_FW(adapter->ahw, 0)); in qlcnic_83xx_poll_process_aen()
523 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_intr() local
530 if (ahw->diag_test) { in qlcnic_83xx_intr()
531 if (ahw->diag_test == QLCNIC_INTERRUPT_TEST) in qlcnic_83xx_intr()
532 ahw->diag_cnt++; in qlcnic_83xx_intr()
559 adapter->ahw->diag_cnt++; in qlcnic_83xx_tmp_intr()
575 num_msix = adapter->ahw->num_msix - 1; in qlcnic_83xx_free_mbx_intr()
600 val = adapter->msix_entries[adapter->ahw->num_msix - 1].vector; in qlcnic_83xx_setup_mbx_intr()
627 u32 val = QLCRDX(adapter->ahw, QLCNIC_INFORMANT); in qlcnic_83xx_get_func_no()
628 adapter->ahw->pci_func = (val >> 24) & 0xff; in qlcnic_83xx_get_func_no()
636 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_cam_lock() local
638 addr = ahw->pci_base0 + QLC_83XX_SEM_LOCK_FUNC(ahw->pci_func); in qlcnic_83xx_cam_lock()
644 ahw->pci_func); in qlcnic_83xx_cam_lock()
657 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_cam_unlock() local
659 addr = ahw->pci_base0 + QLC_83XX_SEM_UNLOCK_FUNC(ahw->pci_func); in qlcnic_83xx_cam_unlock()
699 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_port_info() local
708 if (ahw->port_config & QLC_83XX_10G_CAPABLE) { in qlcnic_83xx_get_port_info()
709 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_get_port_info()
710 } else if (ahw->port_config & QLC_83XX_10_CAPABLE || in qlcnic_83xx_get_port_info()
711 ahw->port_config & QLC_83XX_100_CAPABLE || in qlcnic_83xx_get_port_info()
712 ahw->port_config & QLC_83XX_1G_CAPABLE) { in qlcnic_83xx_get_port_info()
713 ahw->port_type = QLCNIC_GBE; in qlcnic_83xx_get_port_info()
715 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_get_port_info()
718 if (QLC_83XX_AUTONEG(ahw->port_config)) in qlcnic_83xx_get_port_info()
719 ahw->link_autoneg = AUTONEG_ENABLE; in qlcnic_83xx_get_port_info()
727 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_mac_filter_count() local
728 u16 act_pci_fn = ahw->total_nic_func; in qlcnic_83xx_set_mac_filter_count()
731 ahw->max_mc_count = QLC_83XX_MAX_MC_COUNT; in qlcnic_83xx_set_mac_filter_count()
738 ahw->max_uc_count = count; in qlcnic_83xx_set_mac_filter_count()
746 val = BIT_2 | ((adapter->ahw->num_msix - 1) << 8); in qlcnic_83xx_enable_mbx_interrupt()
750 QLCWRX(adapter->ahw, QLCNIC_MBX_INTR_ENBL, val); in qlcnic_83xx_enable_mbx_interrupt()
758 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_check_vf() local
760 ahw->fw_hal_version = 2; in qlcnic_83xx_check_vf()
769 op_mode = QLCRDX(adapter->ahw, QLC_83XX_DRV_OP_MODE); in qlcnic_83xx_check_vf()
774 ahw->pci_func); in qlcnic_83xx_check_vf()
777 ahw->op_mode = QLCNIC_NON_PRIV_FUNC; in qlcnic_83xx_check_vf()
780 ahw->fw_hal_version); in qlcnic_83xx_check_vf()
824 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_poll_for_mbx_completion() local
840 __func__, opcode, cmd->type, ahw->pci_func, ahw->op_mode); in qlcnic_83xx_poll_for_mbx_completion()
841 flush_workqueue(ahw->mailbox->work_q); in qlcnic_83xx_poll_for_mbx_completion()
848 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_issue_cmd()
849 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_issue_cmd() local
862 __func__, opcode, cmd->type, ahw->pci_func, in qlcnic_83xx_issue_cmd()
863 ahw->op_mode); in qlcnic_83xx_issue_cmd()
872 __func__, opcode, cmd_type, ahw->pci_func, in qlcnic_83xx_issue_cmd()
873 ahw->op_mode); in qlcnic_83xx_issue_cmd()
885 __func__, opcode, cmd_type, ahw->pci_func, in qlcnic_83xx_issue_cmd()
886 ahw->op_mode); in qlcnic_83xx_issue_cmd()
921 temp = adapter->ahw->fw_hal_version << 29; in qlcnic_83xx_alloc_mbx_args()
945 cmd.req.arg[i] = adapter->ahw->mbox_aen[i]; in qlcnic_83xx_idc_aen_work()
959 clear_bit(QLC_83XX_IDC_COMP_AEN, &adapter->ahw->idc.status); in qlcnic_83xx_handle_idc_comp_aen()
965 struct qlcnic_hardware_context *ahw = adapter->ahw; in __qlcnic_83xx_process_aen() local
970 event[i] = readl(QLCNIC_MBX_FW(ahw, i)); in __qlcnic_83xx_process_aen()
982 adapter->ahw->mbox_aen[i] = QLCNIC_MBX_RSP(event[i]); in __qlcnic_83xx_process_aen()
987 ahw->extend_lb_time = event[1] >> 8 & 0xf; in __qlcnic_83xx_process_aen()
1009 QLCWRX(ahw, QLCNIC_FW_MBX_CTRL, QLCNIC_CLR_OWNER); in __qlcnic_83xx_process_aen()
1015 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_process_aen() local
1016 struct qlcnic_mailbox *mbx = ahw->mailbox; in qlcnic_83xx_process_aen()
1020 resp = QLCRDX(ahw, QLCNIC_FW_MBX_CTRL); in qlcnic_83xx_process_aen()
1022 event = readl(QLCNIC_MBX_FW(ahw, 0)); in qlcnic_83xx_process_aen()
1074 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_add_rings() local
1079 ahw->hw_ops->alloc_mbx_args(&cmd, adapter, in qlcnic_83xx_add_rings()
1095 intrpt_id = ahw->intr_tbl[i].id; in qlcnic_83xx_add_rings()
1097 intrpt_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_add_rings()
1099 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) in qlcnic_83xx_add_rings()
1110 err = ahw->hw_ops->mbx_cmd(adapter, &cmd); in qlcnic_83xx_add_rings()
1122 sds->crb_sts_consumer = ahw->pci_base0 + in qlcnic_83xx_add_rings()
1125 intr_mask = ahw->intr_tbl[i].src; in qlcnic_83xx_add_rings()
1127 intr_mask = QLCRDX(ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_add_rings()
1129 sds->crb_intr_mask = ahw->pci_base0 + intr_mask; in qlcnic_83xx_add_rings()
1175 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_create_rx_ctx() local
1217 intrpt_id = ahw->intr_tbl[i].id; in qlcnic_83xx_create_rx_ctx()
1219 intrpt_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_create_rx_ctx()
1220 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) in qlcnic_83xx_create_rx_ctx()
1249 err = ahw->hw_ops->mbx_cmd(adapter, &cmd); in qlcnic_83xx_create_rx_ctx()
1264 rds->crb_rcv_producer = ahw->pci_base0 + in qlcnic_83xx_create_rx_ctx()
1268 rds->crb_rcv_producer = ahw->pci_base0 + in qlcnic_83xx_create_rx_ctx()
1273 sds->crb_sts_consumer = ahw->pci_base0 + in qlcnic_83xx_create_rx_ctx()
1276 intr_mask = ahw->intr_tbl[i].src; in qlcnic_83xx_create_rx_ctx()
1278 intr_mask = QLCRDX(ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_create_rx_ctx()
1279 sds->crb_intr_mask = ahw->pci_base0 + intr_mask; in qlcnic_83xx_create_rx_ctx()
1320 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_create_tx_ctx() local
1341 msix_id = ahw->intr_tbl[msix_vector].id; in qlcnic_83xx_create_tx_ctx()
1343 msix_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_create_tx_ctx()
1346 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) in qlcnic_83xx_create_tx_ctx()
1375 tx->crb_cmd_producer = ahw->pci_base0 + mbx_out->host_prod; in qlcnic_83xx_create_tx_ctx()
1379 intr_mask = ahw->intr_tbl[adapter->drv_sds_rings + ring].src; in qlcnic_83xx_create_tx_ctx()
1380 tx->crb_intr_mask = ahw->pci_base0 + intr_mask; in qlcnic_83xx_create_tx_ctx()
1408 adapter->ahw->diag_test = test; in qlcnic_83xx_diag_alloc_res()
1409 adapter->ahw->linkup = 0; in qlcnic_83xx_diag_alloc_res()
1433 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_83xx_diag_alloc_res()
1440 if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) { in qlcnic_83xx_diag_alloc_res()
1441 adapter->ahw->loopback_state = 0; in qlcnic_83xx_diag_alloc_res()
1442 adapter->ahw->hw_ops->setup_link_event(adapter, 1); in qlcnic_83xx_diag_alloc_res()
1457 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_83xx_diag_free_res()
1468 adapter->ahw->diag_test = 0; in qlcnic_83xx_diag_free_res()
1483 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_beacon_state() local
1494 ahw->beacon_state = QLC_83XX_BEACON_OFF; in qlcnic_83xx_get_beacon_state()
1496 ahw->beacon_state = QLC_83XX_BEACON_ON; in qlcnic_83xx_get_beacon_state()
1529 adapter->ahw->mbox_reg[i] = cmd.rsp.arg[i+1]; in qlcnic_83xx_config_led()
1561 cmd.req.arg[1] = adapter->ahw->mbox_reg[0]; in qlcnic_83xx_config_led()
1562 cmd.req.arg[2] = adapter->ahw->mbox_reg[1]; in qlcnic_83xx_config_led()
1563 cmd.req.arg[3] = adapter->ahw->mbox_reg[2]; in qlcnic_83xx_config_led()
1565 cmd.req.arg[4] = adapter->ahw->mbox_reg[3]; in qlcnic_83xx_config_led()
1581 if (adapter->ahw->op_mode == QLCNIC_NON_PRIV_FUNC) { in qlcnic_83xx_set_led()
1661 cmd.req.arg[1] = adapter->ahw->port_config; in qlcnic_83xx_set_port_config()
1682 adapter->ahw->port_config = cmd.rsp.arg[1]; in qlcnic_83xx_get_port_config()
1759 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_loopback_test() local
1764 if (ahw->op_mode == QLCNIC_NON_PRIV_FUNC) { in qlcnic_83xx_loopback_test()
1809 } while ((adapter->ahw->linkup && ahw->has_link_events) != 1); in qlcnic_83xx_loopback_test()
1828 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_extend_lb_idc_cmpltn_wait() local
1832 ahw->extend_lb_time); in qlcnic_extend_lb_idc_cmpltn_wait()
1833 temp = ahw->extend_lb_time * 1000; in qlcnic_extend_lb_idc_cmpltn_wait()
1835 ahw->extend_lb_time = 0; in qlcnic_extend_lb_idc_cmpltn_wait()
1840 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_lb_mode() local
1845 ahw->extend_lb_time = 0; in qlcnic_83xx_set_lb_mode()
1851 config = ahw->port_config; in qlcnic_83xx_set_lb_mode()
1861 set_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1864 ahw->port_config |= QLC_83XX_CFG_LOOPBACK_HSS; in qlcnic_83xx_set_lb_mode()
1866 ahw->port_config |= QLC_83XX_CFG_LOOPBACK_EXT; in qlcnic_83xx_set_lb_mode()
1872 ahw->port_config); in qlcnic_83xx_set_lb_mode()
1873 ahw->port_config = config; in qlcnic_83xx_set_lb_mode()
1874 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1885 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1889 if (ahw->extend_lb_time) in qlcnic_83xx_set_lb_mode()
1896 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1900 } while (test_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status)); in qlcnic_83xx_set_lb_mode()
1909 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_clear_lb_mode() local
1910 u32 config = ahw->port_config, max_wait_count; in qlcnic_83xx_clear_lb_mode()
1914 ahw->extend_lb_time = 0; in qlcnic_83xx_clear_lb_mode()
1916 set_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1918 ahw->port_config &= ~QLC_83XX_CFG_LOOPBACK_HSS; in qlcnic_83xx_clear_lb_mode()
1920 ahw->port_config &= ~QLC_83XX_CFG_LOOPBACK_EXT; in qlcnic_83xx_clear_lb_mode()
1926 ahw->port_config); in qlcnic_83xx_clear_lb_mode()
1927 ahw->port_config = config; in qlcnic_83xx_clear_lb_mode()
1928 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1939 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1943 if (ahw->extend_lb_time) in qlcnic_83xx_clear_lb_mode()
1950 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1953 } while (test_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status)); in qlcnic_83xx_clear_lb_mode()
2189 struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal; in qlcnic_83xx_set_rx_intr_coal()
2216 struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal; in qlcnic_83xx_set_tx_intr_coal()
2261 struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal; in qlcnic_83xx_config_intr_coal()
2316 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_handle_link_aen() local
2321 ahw->link_speed = MSW(data[2]); in qlcnic_83xx_handle_link_aen()
2324 ahw->link_duplex = DUPLEX_FULL; in qlcnic_83xx_handle_link_aen()
2326 ahw->link_duplex = DUPLEX_HALF; in qlcnic_83xx_handle_link_aen()
2328 ahw->link_speed = SPEED_UNKNOWN; in qlcnic_83xx_handle_link_aen()
2329 ahw->link_duplex = DUPLEX_UNKNOWN; in qlcnic_83xx_handle_link_aen()
2332 ahw->link_autoneg = MSB(MSW(data[3])); in qlcnic_83xx_handle_link_aen()
2333 ahw->module_type = MSB(LSW(data[3])); in qlcnic_83xx_handle_link_aen()
2334 ahw->has_link_events = 1; in qlcnic_83xx_handle_link_aen()
2335 ahw->lb_mode = data[4] & QLCNIC_LB_MODE_MASK; in qlcnic_83xx_handle_link_aen()
2346 mbx = adapter->ahw->mailbox; in qlcnic_83xx_handle_aen()
2348 resp = QLCRDX(adapter->ahw, QLCNIC_FW_MBX_CTRL); in qlcnic_83xx_handle_aen()
2352 event = readl(QLCNIC_MBX_FW(adapter->ahw, 0)); in qlcnic_83xx_handle_aen()
2359 mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_handle_aen()
2360 writel(0, adapter->ahw->pci_base0 + mask); in qlcnic_83xx_handle_aen()
2371 if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) { in qlcnic_83xx_set_nic_info()
2412 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_nic_info() local
2418 if (func_id != ahw->pci_func) { in qlcnic_83xx_get_nic_info()
2422 cmd.req.arg[1] = ahw->pci_func << 16; in qlcnic_83xx_get_nic_info()
2450 memcpy(ahw->extra_capability, &cmd.rsp.arg[16], in qlcnic_83xx_get_nic_info()
2451 sizeof(ahw->extra_capability)); in qlcnic_83xx_get_nic_info()
2486 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_pci_info() local
2499 ahw->total_nic_func = 0; in qlcnic_83xx_get_pci_info()
2501 ahw->max_pci_func = cmd.rsp.arg[1] & 0xFF; in qlcnic_83xx_get_pci_info()
2502 for (i = 2, j = 0; j < ahw->max_vnic_func; j++, pci_info++) { in qlcnic_83xx_get_pci_info()
2530 ahw->total_nic_func = nic; in qlcnic_83xx_get_pci_info()
2531 ahw->total_pci_func = nic + fcoe + iscsi; in qlcnic_83xx_get_pci_info()
2532 if (ahw->total_nic_func == 0 || ahw->total_pci_func == 0) { in qlcnic_83xx_get_pci_info()
2534 __func__, ahw->total_nic_func, ahw->total_pci_func); in qlcnic_83xx_get_pci_info()
2549 max_ints = adapter->ahw->num_msix - 1; in qlcnic_83xx_config_intrpt()
2557 cmd.req.arg[1] |= (adapter->ahw->pci_func << 8) | BIT_16; in qlcnic_83xx_config_intrpt()
2561 val = type | (adapter->ahw->intr_tbl[i].type << 4); in qlcnic_83xx_config_intrpt()
2562 if (adapter->ahw->intr_tbl[i].type == QLCNIC_INTRPT_MSIX) in qlcnic_83xx_config_intrpt()
2563 val |= (adapter->ahw->intr_tbl[i].id << 16); in qlcnic_83xx_config_intrpt()
2579 adapter->ahw->intr_tbl[i].id); in qlcnic_83xx_config_intrpt()
2583 adapter->ahw->intr_tbl[i].id = MSW(val); in qlcnic_83xx_config_intrpt()
2584 adapter->ahw->intr_tbl[i].enabled = 1; in qlcnic_83xx_config_intrpt()
2586 adapter->ahw->intr_tbl[i].src = temp; in qlcnic_83xx_config_intrpt()
2588 adapter->ahw->intr_tbl[i].id = i; in qlcnic_83xx_config_intrpt()
2589 adapter->ahw->intr_tbl[i].enabled = 0; in qlcnic_83xx_config_intrpt()
2590 adapter->ahw->intr_tbl[i].src = 0; in qlcnic_83xx_config_intrpt()
2717 cmd = adapter->ahw->fdt.write_statusreg_cmd; in qlcnic_83xx_enable_flash_write()
2721 adapter->ahw->fdt.write_enable_bits); in qlcnic_83xx_enable_flash_write()
2737 adapter->ahw->fdt.write_statusreg_cmd)); in qlcnic_83xx_disable_flash_write()
2739 adapter->ahw->fdt.write_disable_bits); in qlcnic_83xx_disable_flash_write()
2789 memset(&adapter->ahw->fdt, 0, fdt_size); in qlcnic_83xx_read_flash_descriptor_table()
2791 (u8 *)&adapter->ahw->fdt, in qlcnic_83xx_read_flash_descriptor_table()
2793 qlcnic_swap32_buffer((u32 *)&adapter->ahw->fdt, count); in qlcnic_83xx_read_flash_descriptor_table()
2807 if (adapter->ahw->fdt.mfg_id == adapter->flash_mfg_id) { in qlcnic_83xx_erase_flash_sector()
2832 cmd = QLC_83XX_FLASH_FDT_ERASE_DEF_SIG | adapter->ahw->fdt.erase_cmd; in qlcnic_83xx_erase_flash_sector()
2833 if (adapter->ahw->fdt.mfg_id == adapter->flash_mfg_id) in qlcnic_83xx_erase_flash_sector()
2849 if (adapter->ahw->fdt.mfg_id == adapter->flash_mfg_id) { in qlcnic_83xx_erase_flash_sector()
2973 val = QLCRDX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK); in qlcnic_83xx_recover_driver_lock()
2980 QLCWRX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK, val); in qlcnic_83xx_recover_driver_lock()
2984 val = QLCRDX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK); in qlcnic_83xx_recover_driver_lock()
2989 QLCWRX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK, val); in qlcnic_83xx_recover_driver_lock()
2991 QLCRDX(adapter->ahw, QLC_83XX_DRV_UNLOCK); in qlcnic_83xx_recover_driver_lock()
2994 QLCWRX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK, val); in qlcnic_83xx_recover_driver_lock()
3015 status = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK); in qlcnic_83xx_lock_driver()
3023 temp = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_lock_driver()
3026 val = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_lock_driver()
3050 val = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_lock_driver()
3054 QLCWRX(adapter->ahw, QLC_83XX_DRV_LOCK_ID, val); in qlcnic_83xx_lock_driver()
3063 val = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_unlock_driver()
3073 QLCWRX(adapter->ahw, QLC_83XX_DRV_LOCK_ID, val); in qlcnic_83xx_unlock_driver()
3074 QLCRDX(adapter->ahw, QLC_83XX_DRV_UNLOCK); in qlcnic_83xx_unlock_driver()
3087 mutex_lock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3095 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3118 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3123 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3174 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_test_link() local
3179 pci_func = ahw->pci_func; in qlcnic_83xx_test_link()
3181 state = readl(ahw->pci_base0 + QLC_83XX_LINK_STATE(pci_func)); in qlcnic_83xx_test_link()
3200 ahw->link_speed = SPEED_10; in qlcnic_83xx_test_link()
3203 ahw->link_speed = SPEED_100; in qlcnic_83xx_test_link()
3206 ahw->link_speed = SPEED_1000; in qlcnic_83xx_test_link()
3209 ahw->link_speed = SPEED_10000; in qlcnic_83xx_test_link()
3212 ahw->link_speed = 0; in qlcnic_83xx_test_link()
3220 ahw->supported_type = PORT_FIBRE; in qlcnic_83xx_test_link()
3221 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_test_link()
3226 ahw->supported_type = PORT_FIBRE; in qlcnic_83xx_test_link()
3227 ahw->port_type = QLCNIC_GBE; in qlcnic_83xx_test_link()
3230 ahw->supported_type = PORT_TP; in qlcnic_83xx_test_link()
3231 ahw->port_type = QLCNIC_GBE; in qlcnic_83xx_test_link()
3237 ahw->supported_type = PORT_DA; in qlcnic_83xx_test_link()
3238 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_test_link()
3241 ahw->supported_type = PORT_OTHER; in qlcnic_83xx_test_link()
3242 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_test_link()
3255 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_settings() local
3264 ahw->module_type = QLC_83XX_SFP_MODULE_TYPE(config); in qlcnic_83xx_get_settings()
3268 ahw->board_type = QLCNIC_BRDTYPE_83XX_10G; in qlcnic_83xx_get_settings()
3270 if (netif_running(adapter->netdev) && ahw->has_link_events) { in qlcnic_83xx_get_settings()
3271 ethtool_cmd_speed_set(ecmd, ahw->link_speed); in qlcnic_83xx_get_settings()
3272 ecmd->duplex = ahw->link_duplex; in qlcnic_83xx_get_settings()
3273 ecmd->autoneg = ahw->link_autoneg; in qlcnic_83xx_get_settings()
3287 if (ahw->port_config & QLC_83XX_10_CAPABLE) in qlcnic_83xx_get_settings()
3289 if (ahw->port_config & QLC_83XX_100_CAPABLE) in qlcnic_83xx_get_settings()
3291 if (ahw->port_config & QLC_83XX_1G_CAPABLE) in qlcnic_83xx_get_settings()
3293 if (ahw->port_config & QLC_83XX_10G_CAPABLE) in qlcnic_83xx_get_settings()
3295 if (ahw->port_config & QLC_83XX_AUTONEG_ENABLE) in qlcnic_83xx_get_settings()
3298 switch (ahw->link_speed) { in qlcnic_83xx_get_settings()
3317 switch (ahw->supported_type) { in qlcnic_83xx_get_settings()
3343 ecmd->phy_address = ahw->physical_port; in qlcnic_83xx_get_settings()
3350 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_settings() local
3351 u32 config = adapter->ahw->port_config; in qlcnic_83xx_set_settings()
3362 ahw->port_config |= QLC_83XX_AUTONEG_ENABLE; in qlcnic_83xx_set_settings()
3363 ahw->port_config |= (QLC_83XX_100_CAPABLE | in qlcnic_83xx_set_settings()
3367 ahw->port_config &= ~QLC_83XX_AUTONEG_ENABLE; in qlcnic_83xx_set_settings()
3370 ahw->port_config &= ~(QLC_83XX_100_CAPABLE | in qlcnic_83xx_set_settings()
3373 ahw->port_config |= QLC_83XX_10_CAPABLE; in qlcnic_83xx_set_settings()
3376 ahw->port_config &= ~(QLC_83XX_10_CAPABLE | in qlcnic_83xx_set_settings()
3379 ahw->port_config |= QLC_83XX_100_CAPABLE; in qlcnic_83xx_set_settings()
3382 ahw->port_config &= ~(QLC_83XX_10_CAPABLE | in qlcnic_83xx_set_settings()
3385 ahw->port_config |= QLC_83XX_1G_CAPABLE; in qlcnic_83xx_set_settings()
3388 ahw->port_config &= ~(QLC_83XX_10_CAPABLE | in qlcnic_83xx_set_settings()
3391 ahw->port_config |= QLC_83XX_10G_CAPABLE; in qlcnic_83xx_set_settings()
3401 ahw->port_config = config; in qlcnic_83xx_set_settings()
3535 sizeof(*adapter->ahw->ext_reg_tbl)) + in qlcnic_83xx_get_regs_len()
3537 sizeof(*adapter->ahw->reg_tbl)); in qlcnic_83xx_get_regs_len()
3549 regs_buff[i++] = QLCRDX(adapter->ahw, j); in qlcnic_83xx_get_registers()
3556 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_interrupt_test() local
3579 ahw->diag_cnt = 0; in qlcnic_83xx_interrupt_test()
3585 intrpt_id = ahw->intr_tbl[0].id; in qlcnic_83xx_interrupt_test()
3587 intrpt_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_interrupt_test()
3608 ret = !ahw->diag_cnt; in qlcnic_83xx_interrupt_test()
3624 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_pauseparam() local
3634 config = ahw->port_config; in qlcnic_83xx_get_pauseparam()
3660 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_pauseparam() local
3670 config = ahw->port_config; in qlcnic_83xx_set_pauseparam()
3672 if (ahw->port_type == QLCNIC_GBE) { in qlcnic_83xx_set_pauseparam()
3674 ahw->port_config |= QLC_83XX_ENABLE_AUTONEG; in qlcnic_83xx_set_pauseparam()
3676 ahw->port_config &= ~QLC_83XX_ENABLE_AUTONEG; in qlcnic_83xx_set_pauseparam()
3677 } else if ((ahw->port_type == QLCNIC_XGBE) && (pause->autoneg)) { in qlcnic_83xx_set_pauseparam()
3682 ahw->port_config |= QLC_83XX_CFG_STD_PAUSE; in qlcnic_83xx_set_pauseparam()
3685 ahw->port_config |= QLC_83XX_CFG_STD_TX_RX_PAUSE; in qlcnic_83xx_set_pauseparam()
3687 ahw->port_config &= ~QLC_83XX_CFG_STD_TX_PAUSE; in qlcnic_83xx_set_pauseparam()
3688 ahw->port_config |= QLC_83XX_CFG_STD_RX_PAUSE; in qlcnic_83xx_set_pauseparam()
3690 ahw->port_config &= ~QLC_83XX_CFG_STD_RX_PAUSE; in qlcnic_83xx_set_pauseparam()
3691 ahw->port_config |= QLC_83XX_CFG_STD_TX_PAUSE; in qlcnic_83xx_set_pauseparam()
3693 ahw->port_config &= ~(QLC_83XX_CFG_STD_TX_RX_PAUSE | in qlcnic_83xx_set_pauseparam()
3700 ahw->port_config = config; in qlcnic_83xx_set_pauseparam()
3762 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_resume() local
3763 struct qlc_83xx_idc *idc = &ahw->idc; in qlcnic_83xx_resume()
3770 if (ahw->nic_mode == QLCNIC_VNIC_MODE) { in qlcnic_83xx_resume()
3771 if (ahw->op_mode == QLCNIC_MGMT_FUNC) { in qlcnic_83xx_resume()
3820 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_flush_mbx_queue()
3840 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_check_mbx_status() local
3841 struct qlcnic_mailbox *mbx = ahw->mailbox; in qlcnic_83xx_check_mbx_status()
3847 host_mbx_ctrl = QLCRDX(ahw, QLCNIC_HOST_MBX_CTRL); in qlcnic_83xx_check_mbx_status()
3850 ahw->idc.collect_dump = 1; in qlcnic_83xx_check_mbx_status()
3861 QLCWRX(adapter->ahw, QLCNIC_HOST_MBX_CTRL, QLCNIC_SET_OWNER); in qlcnic_83xx_signal_mbx_cmd()
3863 QLCWRX(adapter->ahw, QLCNIC_FW_MBX_CTRL, QLCNIC_CLR_OWNER); in qlcnic_83xx_signal_mbx_cmd()
3869 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_dequeue_mbx_cmd()
3885 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_encode_mbx_cmd() local
3890 writel(mbx_cmd, QLCNIC_MBX_HOST(ahw, 0)); in qlcnic_83xx_encode_mbx_cmd()
3892 writel(cmd->req.arg[i], QLCNIC_MBX_HOST(ahw, i)); in qlcnic_83xx_encode_mbx_cmd()
3894 fw_hal_version = ahw->fw_hal_version; in qlcnic_83xx_encode_mbx_cmd()
3899 writel(mbx_cmd, QLCNIC_MBX_HOST(ahw, 0)); in qlcnic_83xx_encode_mbx_cmd()
3907 writel(mbx_cmd, QLCNIC_MBX_HOST(ahw, 1)); in qlcnic_83xx_encode_mbx_cmd()
3910 writel(*(cmd->hdr++), QLCNIC_MBX_HOST(ahw, i)); in qlcnic_83xx_encode_mbx_cmd()
3912 writel(*(cmd->pay++), QLCNIC_MBX_HOST(ahw, i)); in qlcnic_83xx_encode_mbx_cmd()
3918 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_detach_mailbox_work()
3934 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_enqueue_mbx_cmd()
3964 fw_data = readl(QLCNIC_MBX_FW(adapter->ahw, 2)); in qlcnic_83xx_check_mac_rcode()
3980 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_decode_mbx_rsp() local
3985 fw_data = readl(QLCNIC_MBX_FW(ahw, 0)); in qlcnic_83xx_decode_mbx_rsp()
3999 __func__, cmd->cmd_op, cmd->type, ahw->pci_func, in qlcnic_83xx_decode_mbx_rsp()
4000 ahw->op_mode, mbx_err_code); in qlcnic_83xx_decode_mbx_rsp()
4010 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_dump_mailbox_registers() local
4013 offset = QLCRDX(ahw, QLCNIC_DEF_INT_MASK); in qlcnic_dump_mailbox_registers()
4015 readl(ahw->pci_base0 + offset), in qlcnic_dump_mailbox_registers()
4016 QLCRDX(ahw, QLCNIC_MBX_INTR_ENBL), in qlcnic_dump_mailbox_registers()
4017 QLCRDX(ahw, QLCNIC_HOST_MBX_CTRL), in qlcnic_dump_mailbox_registers()
4018 QLCRDX(ahw, QLCNIC_FW_MBX_CTRL)); in qlcnic_dump_mailbox_registers()
4030 struct qlcnic_hardware_context *ahw; in qlcnic_83xx_mailbox_worker() local
4033 ahw = adapter->ahw; in qlcnic_83xx_mailbox_worker()
4062 __func__, cmd->cmd_op, cmd->type, ahw->pci_func, in qlcnic_83xx_mailbox_worker()
4063 ahw->op_mode); in qlcnic_83xx_mailbox_worker()
4086 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_init_mailbox_work() local
4089 ahw->mailbox = kzalloc(sizeof(*mbx), GFP_KERNEL); in qlcnic_83xx_init_mailbox_work()
4090 if (!ahw->mailbox) in qlcnic_83xx_init_mailbox_work()
4093 mbx = ahw->mailbox; in qlcnic_83xx_init_mailbox_work()