Lines Matching refs:ahw

262 void qlcnic_83xx_register_map(struct qlcnic_hardware_context *ahw)  in qlcnic_83xx_register_map()  argument
264 ahw->hw_ops = &qlcnic_83xx_hw_ops; in qlcnic_83xx_register_map()
265 ahw->reg_tbl = (u32 *)qlcnic_83xx_reg_tbl; in qlcnic_83xx_register_map()
266 ahw->ext_reg_tbl = (u32 *)qlcnic_83xx_ext_reg_tbl; in qlcnic_83xx_register_map()
290 base = adapter->ahw->pci_base0 + in __qlcnic_set_win_base()
291 QLC_83XX_CRB_WIN_FUNC(adapter->ahw->pci_func); in __qlcnic_set_win_base()
303 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_rd_reg_indirect() local
307 return QLCRDX(ahw, QLCNIC_WILDCARD); in qlcnic_83xx_rd_reg_indirect()
319 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_wrt_reg_indirect() local
323 QLCWRX(ahw, QLCNIC_WILDCARD, data); in qlcnic_83xx_wrt_reg_indirect()
335 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_enable_legacy() local
338 adapter->tgt_status_reg = ahw->pci_base0 + QLC_83XX_INTX_PTR; in qlcnic_83xx_enable_legacy()
339 adapter->tgt_mask_reg = ahw->pci_base0 + QLC_83XX_INTX_MASK; in qlcnic_83xx_enable_legacy()
340 adapter->isr_int_vec = ahw->pci_base0 + QLC_83XX_INTX_TRGR; in qlcnic_83xx_enable_legacy()
362 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_setup_intr() local
369 num_msix = ahw->num_msix; in qlcnic_83xx_setup_intr()
378 num_msix = ahw->num_msix; in qlcnic_83xx_setup_intr()
389 ahw->intr_tbl = in qlcnic_83xx_setup_intr()
392 if (!ahw->intr_tbl) in qlcnic_83xx_setup_intr()
396 if (adapter->ahw->pci_func >= QLC_MAX_LEGACY_FUNC_SUPP) { in qlcnic_83xx_setup_intr()
398 ahw->pci_func); in qlcnic_83xx_setup_intr()
407 ahw->intr_tbl[i].type = QLCNIC_INTRPT_MSIX; in qlcnic_83xx_setup_intr()
409 ahw->intr_tbl[i].type = QLCNIC_INTRPT_INTX; in qlcnic_83xx_setup_intr()
410 ahw->intr_tbl[i].id = i; in qlcnic_83xx_setup_intr()
411 ahw->intr_tbl[i].src = 0; in qlcnic_83xx_setup_intr()
438 mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_enable_legacy_msix_mbx_intr()
439 writel(0, adapter->ahw->pci_base0 + mask); in qlcnic_83xx_enable_legacy_msix_mbx_intr()
446 mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_disable_mbx_intr()
447 writel(1, adapter->ahw->pci_base0 + mask); in qlcnic_83xx_disable_mbx_intr()
448 QLCWRX(adapter->ahw, QLCNIC_MBX_INTR_ENBL, 0); in qlcnic_83xx_disable_mbx_intr()
460 cmd->rsp.arg[i] = readl(QLCNIC_MBX_FW(adapter->ahw, i)); in qlcnic_83xx_get_mbx_data()
466 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_clear_legacy_intr() local
474 if (QLC_83XX_INTX_FUNC(intr_val) != adapter->ahw->pci_func) { in qlcnic_83xx_clear_legacy_intr()
486 if (QLC_83XX_INTX_FUNC(intr_val) != ahw->pci_func) in qlcnic_83xx_clear_legacy_intr()
504 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_poll_process_aen()
508 resp = QLCRDX(adapter->ahw, QLCNIC_FW_MBX_CTRL); in qlcnic_83xx_poll_process_aen()
512 event = readl(QLCNIC_MBX_FW(adapter->ahw, 0)); in qlcnic_83xx_poll_process_aen()
528 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_intr() local
535 if (ahw->diag_test) { in qlcnic_83xx_intr()
536 if (ahw->diag_test == QLCNIC_INTERRUPT_TEST) in qlcnic_83xx_intr()
537 ahw->diag_cnt++; in qlcnic_83xx_intr()
564 adapter->ahw->diag_cnt++; in qlcnic_83xx_tmp_intr()
580 num_msix = adapter->ahw->num_msix - 1; in qlcnic_83xx_free_mbx_intr()
605 val = adapter->msix_entries[adapter->ahw->num_msix - 1].vector; in qlcnic_83xx_setup_mbx_intr()
632 u32 val = QLCRDX(adapter->ahw, QLCNIC_INFORMANT); in qlcnic_83xx_get_func_no()
633 adapter->ahw->pci_func = (val >> 24) & 0xff; in qlcnic_83xx_get_func_no()
641 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_cam_lock() local
643 addr = ahw->pci_base0 + QLC_83XX_SEM_LOCK_FUNC(ahw->pci_func); in qlcnic_83xx_cam_lock()
649 ahw->pci_func); in qlcnic_83xx_cam_lock()
662 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_cam_unlock() local
664 addr = ahw->pci_base0 + QLC_83XX_SEM_UNLOCK_FUNC(ahw->pci_func); in qlcnic_83xx_cam_unlock()
704 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_port_info() local
713 if (ahw->port_config & QLC_83XX_10G_CAPABLE) { in qlcnic_83xx_get_port_info()
714 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_get_port_info()
715 } else if (ahw->port_config & QLC_83XX_10_CAPABLE || in qlcnic_83xx_get_port_info()
716 ahw->port_config & QLC_83XX_100_CAPABLE || in qlcnic_83xx_get_port_info()
717 ahw->port_config & QLC_83XX_1G_CAPABLE) { in qlcnic_83xx_get_port_info()
718 ahw->port_type = QLCNIC_GBE; in qlcnic_83xx_get_port_info()
720 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_get_port_info()
723 if (QLC_83XX_AUTONEG(ahw->port_config)) in qlcnic_83xx_get_port_info()
724 ahw->link_autoneg = AUTONEG_ENABLE; in qlcnic_83xx_get_port_info()
732 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_mac_filter_count() local
733 u16 act_pci_fn = ahw->total_nic_func; in qlcnic_83xx_set_mac_filter_count()
736 ahw->max_mc_count = QLC_83XX_MAX_MC_COUNT; in qlcnic_83xx_set_mac_filter_count()
743 ahw->max_uc_count = count; in qlcnic_83xx_set_mac_filter_count()
751 val = BIT_2 | ((adapter->ahw->num_msix - 1) << 8); in qlcnic_83xx_enable_mbx_interrupt()
755 QLCWRX(adapter->ahw, QLCNIC_MBX_INTR_ENBL, val); in qlcnic_83xx_enable_mbx_interrupt()
763 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_check_vf() local
765 ahw->fw_hal_version = 2; in qlcnic_83xx_check_vf()
774 op_mode = QLCRDX(adapter->ahw, QLC_83XX_DRV_OP_MODE); in qlcnic_83xx_check_vf()
779 ahw->pci_func); in qlcnic_83xx_check_vf()
782 ahw->op_mode = QLCNIC_NON_PRIV_FUNC; in qlcnic_83xx_check_vf()
785 ahw->fw_hal_version); in qlcnic_83xx_check_vf()
829 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_poll_for_mbx_completion() local
845 __func__, opcode, cmd->type, ahw->pci_func, ahw->op_mode); in qlcnic_83xx_poll_for_mbx_completion()
846 flush_workqueue(ahw->mailbox->work_q); in qlcnic_83xx_poll_for_mbx_completion()
853 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_issue_cmd()
854 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_issue_cmd() local
867 __func__, opcode, cmd->type, ahw->pci_func, in qlcnic_83xx_issue_cmd()
868 ahw->op_mode); in qlcnic_83xx_issue_cmd()
877 __func__, opcode, cmd_type, ahw->pci_func, in qlcnic_83xx_issue_cmd()
878 ahw->op_mode); in qlcnic_83xx_issue_cmd()
890 __func__, opcode, cmd_type, ahw->pci_func, in qlcnic_83xx_issue_cmd()
891 ahw->op_mode); in qlcnic_83xx_issue_cmd()
924 temp = adapter->ahw->fw_hal_version << 29; in qlcnic_83xx_alloc_mbx_args()
948 cmd.req.arg[i] = adapter->ahw->mbox_aen[i]; in qlcnic_83xx_idc_aen_work()
962 clear_bit(QLC_83XX_IDC_COMP_AEN, &adapter->ahw->idc.status); in qlcnic_83xx_handle_idc_comp_aen()
968 struct qlcnic_hardware_context *ahw = adapter->ahw; in __qlcnic_83xx_process_aen() local
973 event[i] = readl(QLCNIC_MBX_FW(ahw, i)); in __qlcnic_83xx_process_aen()
985 adapter->ahw->mbox_aen[i] = QLCNIC_MBX_RSP(event[i]); in __qlcnic_83xx_process_aen()
990 ahw->extend_lb_time = event[1] >> 8 & 0xf; in __qlcnic_83xx_process_aen()
1012 QLCWRX(ahw, QLCNIC_FW_MBX_CTRL, QLCNIC_CLR_OWNER); in __qlcnic_83xx_process_aen()
1018 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_process_aen() local
1019 struct qlcnic_mailbox *mbx = ahw->mailbox; in qlcnic_83xx_process_aen()
1023 resp = QLCRDX(ahw, QLCNIC_FW_MBX_CTRL); in qlcnic_83xx_process_aen()
1025 event = readl(QLCNIC_MBX_FW(ahw, 0)); in qlcnic_83xx_process_aen()
1077 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_add_rings() local
1082 ahw->hw_ops->alloc_mbx_args(&cmd, adapter, in qlcnic_83xx_add_rings()
1098 intrpt_id = ahw->intr_tbl[i].id; in qlcnic_83xx_add_rings()
1100 intrpt_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_add_rings()
1102 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) in qlcnic_83xx_add_rings()
1113 err = ahw->hw_ops->mbx_cmd(adapter, &cmd); in qlcnic_83xx_add_rings()
1125 sds->crb_sts_consumer = ahw->pci_base0 + in qlcnic_83xx_add_rings()
1128 intr_mask = ahw->intr_tbl[i].src; in qlcnic_83xx_add_rings()
1130 intr_mask = QLCRDX(ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_add_rings()
1132 sds->crb_intr_mask = ahw->pci_base0 + intr_mask; in qlcnic_83xx_add_rings()
1178 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_create_rx_ctx() local
1220 intrpt_id = ahw->intr_tbl[i].id; in qlcnic_83xx_create_rx_ctx()
1222 intrpt_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_create_rx_ctx()
1223 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) in qlcnic_83xx_create_rx_ctx()
1252 err = ahw->hw_ops->mbx_cmd(adapter, &cmd); in qlcnic_83xx_create_rx_ctx()
1267 rds->crb_rcv_producer = ahw->pci_base0 + in qlcnic_83xx_create_rx_ctx()
1271 rds->crb_rcv_producer = ahw->pci_base0 + in qlcnic_83xx_create_rx_ctx()
1276 sds->crb_sts_consumer = ahw->pci_base0 + in qlcnic_83xx_create_rx_ctx()
1279 intr_mask = ahw->intr_tbl[i].src; in qlcnic_83xx_create_rx_ctx()
1281 intr_mask = QLCRDX(ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_create_rx_ctx()
1282 sds->crb_intr_mask = ahw->pci_base0 + intr_mask; in qlcnic_83xx_create_rx_ctx()
1323 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_create_tx_ctx() local
1344 msix_id = ahw->intr_tbl[msix_vector].id; in qlcnic_83xx_create_tx_ctx()
1346 msix_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_create_tx_ctx()
1349 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) in qlcnic_83xx_create_tx_ctx()
1378 tx->crb_cmd_producer = ahw->pci_base0 + mbx_out->host_prod; in qlcnic_83xx_create_tx_ctx()
1382 intr_mask = ahw->intr_tbl[adapter->drv_sds_rings + ring].src; in qlcnic_83xx_create_tx_ctx()
1383 tx->crb_intr_mask = ahw->pci_base0 + intr_mask; in qlcnic_83xx_create_tx_ctx()
1411 adapter->ahw->diag_test = test; in qlcnic_83xx_diag_alloc_res()
1412 adapter->ahw->linkup = 0; in qlcnic_83xx_diag_alloc_res()
1436 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_83xx_diag_alloc_res()
1443 if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) { in qlcnic_83xx_diag_alloc_res()
1444 adapter->ahw->loopback_state = 0; in qlcnic_83xx_diag_alloc_res()
1445 adapter->ahw->hw_ops->setup_link_event(adapter, 1); in qlcnic_83xx_diag_alloc_res()
1460 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_83xx_diag_free_res()
1471 adapter->ahw->diag_test = 0; in qlcnic_83xx_diag_free_res()
1486 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_beacon_state() local
1497 ahw->beacon_state = QLC_83XX_BEACON_OFF; in qlcnic_83xx_get_beacon_state()
1499 ahw->beacon_state = QLC_83XX_BEACON_ON; in qlcnic_83xx_get_beacon_state()
1532 adapter->ahw->mbox_reg[i] = cmd.rsp.arg[i+1]; in qlcnic_83xx_config_led()
1564 cmd.req.arg[1] = adapter->ahw->mbox_reg[0]; in qlcnic_83xx_config_led()
1565 cmd.req.arg[2] = adapter->ahw->mbox_reg[1]; in qlcnic_83xx_config_led()
1566 cmd.req.arg[3] = adapter->ahw->mbox_reg[2]; in qlcnic_83xx_config_led()
1568 cmd.req.arg[4] = adapter->ahw->mbox_reg[3]; in qlcnic_83xx_config_led()
1584 if (adapter->ahw->op_mode == QLCNIC_NON_PRIV_FUNC) { in qlcnic_83xx_set_led()
1664 cmd.req.arg[1] = adapter->ahw->port_config; in qlcnic_83xx_set_port_config()
1685 adapter->ahw->port_config = cmd.rsp.arg[1]; in qlcnic_83xx_get_port_config()
1762 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_loopback_test() local
1767 if (ahw->op_mode == QLCNIC_NON_PRIV_FUNC) { in qlcnic_83xx_loopback_test()
1812 } while ((adapter->ahw->linkup && ahw->has_link_events) != 1); in qlcnic_83xx_loopback_test()
1831 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_extend_lb_idc_cmpltn_wait() local
1835 ahw->extend_lb_time); in qlcnic_extend_lb_idc_cmpltn_wait()
1836 temp = ahw->extend_lb_time * 1000; in qlcnic_extend_lb_idc_cmpltn_wait()
1838 ahw->extend_lb_time = 0; in qlcnic_extend_lb_idc_cmpltn_wait()
1843 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_lb_mode() local
1848 ahw->extend_lb_time = 0; in qlcnic_83xx_set_lb_mode()
1854 config = ahw->port_config; in qlcnic_83xx_set_lb_mode()
1864 set_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1867 ahw->port_config |= QLC_83XX_CFG_LOOPBACK_HSS; in qlcnic_83xx_set_lb_mode()
1869 ahw->port_config |= QLC_83XX_CFG_LOOPBACK_EXT; in qlcnic_83xx_set_lb_mode()
1875 ahw->port_config); in qlcnic_83xx_set_lb_mode()
1876 ahw->port_config = config; in qlcnic_83xx_set_lb_mode()
1877 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1888 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1892 if (ahw->extend_lb_time) in qlcnic_83xx_set_lb_mode()
1899 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_set_lb_mode()
1903 } while (test_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status)); in qlcnic_83xx_set_lb_mode()
1912 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_clear_lb_mode() local
1913 u32 config = ahw->port_config, max_wait_count; in qlcnic_83xx_clear_lb_mode()
1917 ahw->extend_lb_time = 0; in qlcnic_83xx_clear_lb_mode()
1919 set_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1921 ahw->port_config &= ~QLC_83XX_CFG_LOOPBACK_HSS; in qlcnic_83xx_clear_lb_mode()
1923 ahw->port_config &= ~QLC_83XX_CFG_LOOPBACK_EXT; in qlcnic_83xx_clear_lb_mode()
1929 ahw->port_config); in qlcnic_83xx_clear_lb_mode()
1930 ahw->port_config = config; in qlcnic_83xx_clear_lb_mode()
1931 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1942 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1946 if (ahw->extend_lb_time) in qlcnic_83xx_clear_lb_mode()
1953 clear_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status); in qlcnic_83xx_clear_lb_mode()
1956 } while (test_bit(QLC_83XX_IDC_COMP_AEN, &ahw->idc.status)); in qlcnic_83xx_clear_lb_mode()
2192 struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal; in qlcnic_83xx_set_rx_intr_coal()
2219 struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal; in qlcnic_83xx_set_tx_intr_coal()
2264 struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal; in qlcnic_83xx_config_intr_coal()
2319 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_handle_link_aen() local
2324 ahw->link_speed = MSW(data[2]); in qlcnic_83xx_handle_link_aen()
2327 ahw->link_duplex = DUPLEX_FULL; in qlcnic_83xx_handle_link_aen()
2329 ahw->link_duplex = DUPLEX_HALF; in qlcnic_83xx_handle_link_aen()
2331 ahw->link_speed = SPEED_UNKNOWN; in qlcnic_83xx_handle_link_aen()
2332 ahw->link_duplex = DUPLEX_UNKNOWN; in qlcnic_83xx_handle_link_aen()
2335 ahw->link_autoneg = MSB(MSW(data[3])); in qlcnic_83xx_handle_link_aen()
2336 ahw->module_type = MSB(LSW(data[3])); in qlcnic_83xx_handle_link_aen()
2337 ahw->has_link_events = 1; in qlcnic_83xx_handle_link_aen()
2338 ahw->lb_mode = data[4] & QLCNIC_LB_MODE_MASK; in qlcnic_83xx_handle_link_aen()
2349 mbx = adapter->ahw->mailbox; in qlcnic_83xx_handle_aen()
2351 resp = QLCRDX(adapter->ahw, QLCNIC_FW_MBX_CTRL); in qlcnic_83xx_handle_aen()
2355 event = readl(QLCNIC_MBX_FW(adapter->ahw, 0)); in qlcnic_83xx_handle_aen()
2366 mask = QLCRDX(adapter->ahw, QLCNIC_DEF_INT_MASK); in qlcnic_83xx_handle_aen()
2367 writel(0, adapter->ahw->pci_base0 + mask); in qlcnic_83xx_handle_aen()
2378 if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) { in qlcnic_83xx_set_nic_info()
2419 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_nic_info() local
2425 if (func_id != ahw->pci_func) { in qlcnic_83xx_get_nic_info()
2429 cmd.req.arg[1] = ahw->pci_func << 16; in qlcnic_83xx_get_nic_info()
2457 memcpy(ahw->extra_capability, &cmd.rsp.arg[16], in qlcnic_83xx_get_nic_info()
2458 sizeof(ahw->extra_capability)); in qlcnic_83xx_get_nic_info()
2493 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_pci_info() local
2506 ahw->total_nic_func = 0; in qlcnic_83xx_get_pci_info()
2508 ahw->max_pci_func = cmd.rsp.arg[1] & 0xFF; in qlcnic_83xx_get_pci_info()
2509 for (i = 2, j = 0; j < ahw->max_vnic_func; j++, pci_info++) { in qlcnic_83xx_get_pci_info()
2537 ahw->total_nic_func = nic; in qlcnic_83xx_get_pci_info()
2538 ahw->total_pci_func = nic + fcoe + iscsi; in qlcnic_83xx_get_pci_info()
2539 if (ahw->total_nic_func == 0 || ahw->total_pci_func == 0) { in qlcnic_83xx_get_pci_info()
2541 __func__, ahw->total_nic_func, ahw->total_pci_func); in qlcnic_83xx_get_pci_info()
2556 max_ints = adapter->ahw->num_msix - 1; in qlcnic_83xx_config_intrpt()
2564 cmd.req.arg[1] |= (adapter->ahw->pci_func << 8) | BIT_16; in qlcnic_83xx_config_intrpt()
2568 val = type | (adapter->ahw->intr_tbl[i].type << 4); in qlcnic_83xx_config_intrpt()
2569 if (adapter->ahw->intr_tbl[i].type == QLCNIC_INTRPT_MSIX) in qlcnic_83xx_config_intrpt()
2570 val |= (adapter->ahw->intr_tbl[i].id << 16); in qlcnic_83xx_config_intrpt()
2586 adapter->ahw->intr_tbl[i].id); in qlcnic_83xx_config_intrpt()
2590 adapter->ahw->intr_tbl[i].id = MSW(val); in qlcnic_83xx_config_intrpt()
2591 adapter->ahw->intr_tbl[i].enabled = 1; in qlcnic_83xx_config_intrpt()
2593 adapter->ahw->intr_tbl[i].src = temp; in qlcnic_83xx_config_intrpt()
2595 adapter->ahw->intr_tbl[i].id = i; in qlcnic_83xx_config_intrpt()
2596 adapter->ahw->intr_tbl[i].enabled = 0; in qlcnic_83xx_config_intrpt()
2597 adapter->ahw->intr_tbl[i].src = 0; in qlcnic_83xx_config_intrpt()
2724 cmd = adapter->ahw->fdt.write_statusreg_cmd; in qlcnic_83xx_enable_flash_write()
2728 adapter->ahw->fdt.write_enable_bits); in qlcnic_83xx_enable_flash_write()
2744 adapter->ahw->fdt.write_statusreg_cmd)); in qlcnic_83xx_disable_flash_write()
2746 adapter->ahw->fdt.write_disable_bits); in qlcnic_83xx_disable_flash_write()
2796 memset(&adapter->ahw->fdt, 0, fdt_size); in qlcnic_83xx_read_flash_descriptor_table()
2798 (u8 *)&adapter->ahw->fdt, in qlcnic_83xx_read_flash_descriptor_table()
2800 qlcnic_swap32_buffer((u32 *)&adapter->ahw->fdt, count); in qlcnic_83xx_read_flash_descriptor_table()
2814 if (adapter->ahw->fdt.mfg_id == adapter->flash_mfg_id) { in qlcnic_83xx_erase_flash_sector()
2839 cmd = QLC_83XX_FLASH_FDT_ERASE_DEF_SIG | adapter->ahw->fdt.erase_cmd; in qlcnic_83xx_erase_flash_sector()
2840 if (adapter->ahw->fdt.mfg_id == adapter->flash_mfg_id) in qlcnic_83xx_erase_flash_sector()
2856 if (adapter->ahw->fdt.mfg_id == adapter->flash_mfg_id) { in qlcnic_83xx_erase_flash_sector()
2980 val = QLCRDX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK); in qlcnic_83xx_recover_driver_lock()
2987 QLCWRX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK, val); in qlcnic_83xx_recover_driver_lock()
2991 val = QLCRDX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK); in qlcnic_83xx_recover_driver_lock()
2996 QLCWRX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK, val); in qlcnic_83xx_recover_driver_lock()
2998 QLCRDX(adapter->ahw, QLC_83XX_DRV_UNLOCK); in qlcnic_83xx_recover_driver_lock()
3001 QLCWRX(adapter->ahw, QLC_83XX_RECOVER_DRV_LOCK, val); in qlcnic_83xx_recover_driver_lock()
3022 status = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK); in qlcnic_83xx_lock_driver()
3030 temp = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_lock_driver()
3033 val = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_lock_driver()
3057 val = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_lock_driver()
3061 QLCWRX(adapter->ahw, QLC_83XX_DRV_LOCK_ID, val); in qlcnic_83xx_lock_driver()
3070 val = QLCRDX(adapter->ahw, QLC_83XX_DRV_LOCK_ID); in qlcnic_83xx_unlock_driver()
3080 QLCWRX(adapter->ahw, QLC_83XX_DRV_LOCK_ID, val); in qlcnic_83xx_unlock_driver()
3081 QLCRDX(adapter->ahw, QLC_83XX_DRV_UNLOCK); in qlcnic_83xx_unlock_driver()
3094 mutex_lock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3102 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3125 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3130 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_ms_mem_write128()
3177 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_port_type() local
3199 ahw->port_type = QLCNIC_GBE; in qlcnic_83xx_get_port_type()
3202 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_get_port_type()
3215 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_test_link() local
3220 pci_func = ahw->pci_func; in qlcnic_83xx_test_link()
3222 state = readl(ahw->pci_base0 + QLC_83XX_LINK_STATE(pci_func)); in qlcnic_83xx_test_link()
3241 ahw->link_speed = SPEED_10; in qlcnic_83xx_test_link()
3244 ahw->link_speed = SPEED_100; in qlcnic_83xx_test_link()
3247 ahw->link_speed = SPEED_1000; in qlcnic_83xx_test_link()
3250 ahw->link_speed = SPEED_10000; in qlcnic_83xx_test_link()
3253 ahw->link_speed = 0; in qlcnic_83xx_test_link()
3261 ahw->supported_type = PORT_FIBRE; in qlcnic_83xx_test_link()
3262 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_test_link()
3267 ahw->supported_type = PORT_FIBRE; in qlcnic_83xx_test_link()
3268 ahw->port_type = QLCNIC_GBE; in qlcnic_83xx_test_link()
3271 ahw->supported_type = PORT_TP; in qlcnic_83xx_test_link()
3272 ahw->port_type = QLCNIC_GBE; in qlcnic_83xx_test_link()
3278 ahw->supported_type = PORT_DA; in qlcnic_83xx_test_link()
3279 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_test_link()
3282 ahw->supported_type = PORT_OTHER; in qlcnic_83xx_test_link()
3283 ahw->port_type = QLCNIC_XGBE; in qlcnic_83xx_test_link()
3296 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_link_ksettings() local
3306 ahw->module_type = QLC_83XX_SFP_MODULE_TYPE(config); in qlcnic_83xx_get_link_ksettings()
3310 ahw->board_type = QLCNIC_BRDTYPE_83XX_10G; in qlcnic_83xx_get_link_ksettings()
3312 if (netif_running(adapter->netdev) && ahw->has_link_events) { in qlcnic_83xx_get_link_ksettings()
3313 ecmd->base.speed = ahw->link_speed; in qlcnic_83xx_get_link_ksettings()
3314 ecmd->base.duplex = ahw->link_duplex; in qlcnic_83xx_get_link_ksettings()
3315 ecmd->base.autoneg = ahw->link_autoneg; in qlcnic_83xx_get_link_ksettings()
3332 if (ahw->port_config & QLC_83XX_10_CAPABLE) in qlcnic_83xx_get_link_ksettings()
3334 if (ahw->port_config & QLC_83XX_100_CAPABLE) in qlcnic_83xx_get_link_ksettings()
3336 if (ahw->port_config & QLC_83XX_1G_CAPABLE) in qlcnic_83xx_get_link_ksettings()
3338 if (ahw->port_config & QLC_83XX_10G_CAPABLE) in qlcnic_83xx_get_link_ksettings()
3340 if (ahw->port_config & QLC_83XX_AUTONEG_ENABLE) in qlcnic_83xx_get_link_ksettings()
3343 switch (ahw->link_speed) { in qlcnic_83xx_get_link_ksettings()
3362 switch (ahw->supported_type) { in qlcnic_83xx_get_link_ksettings()
3384 ecmd->base.phy_address = ahw->physical_port; in qlcnic_83xx_get_link_ksettings()
3397 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_link_ksettings() local
3398 u32 config = adapter->ahw->port_config; in qlcnic_83xx_set_link_ksettings()
3409 ahw->port_config |= QLC_83XX_AUTONEG_ENABLE; in qlcnic_83xx_set_link_ksettings()
3410 ahw->port_config |= (QLC_83XX_100_CAPABLE | in qlcnic_83xx_set_link_ksettings()
3414 ahw->port_config &= ~QLC_83XX_AUTONEG_ENABLE; in qlcnic_83xx_set_link_ksettings()
3417 ahw->port_config &= ~(QLC_83XX_100_CAPABLE | in qlcnic_83xx_set_link_ksettings()
3420 ahw->port_config |= QLC_83XX_10_CAPABLE; in qlcnic_83xx_set_link_ksettings()
3423 ahw->port_config &= ~(QLC_83XX_10_CAPABLE | in qlcnic_83xx_set_link_ksettings()
3426 ahw->port_config |= QLC_83XX_100_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_1G_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_10G_CAPABLE; in qlcnic_83xx_set_link_ksettings()
3448 ahw->port_config = config; in qlcnic_83xx_set_link_ksettings()
3607 sizeof(*adapter->ahw->ext_reg_tbl)) + in qlcnic_83xx_get_regs_len()
3609 sizeof(*adapter->ahw->reg_tbl)); in qlcnic_83xx_get_regs_len()
3621 regs_buff[i++] = QLCRDX(adapter->ahw, j); in qlcnic_83xx_get_registers()
3628 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_interrupt_test() local
3651 ahw->diag_cnt = 0; in qlcnic_83xx_interrupt_test()
3657 intrpt_id = ahw->intr_tbl[0].id; in qlcnic_83xx_interrupt_test()
3659 intrpt_id = QLCRDX(ahw, QLCNIC_DEF_INT_ID); in qlcnic_83xx_interrupt_test()
3680 ret = !ahw->diag_cnt; in qlcnic_83xx_interrupt_test()
3696 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_get_pauseparam() local
3706 config = ahw->port_config; in qlcnic_83xx_get_pauseparam()
3732 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_set_pauseparam() local
3742 config = ahw->port_config; in qlcnic_83xx_set_pauseparam()
3744 if (ahw->port_type == QLCNIC_GBE) { in qlcnic_83xx_set_pauseparam()
3746 ahw->port_config |= QLC_83XX_ENABLE_AUTONEG; in qlcnic_83xx_set_pauseparam()
3748 ahw->port_config &= ~QLC_83XX_ENABLE_AUTONEG; in qlcnic_83xx_set_pauseparam()
3749 } else if ((ahw->port_type == QLCNIC_XGBE) && (pause->autoneg)) { in qlcnic_83xx_set_pauseparam()
3754 ahw->port_config |= QLC_83XX_CFG_STD_PAUSE; in qlcnic_83xx_set_pauseparam()
3757 ahw->port_config |= QLC_83XX_CFG_STD_TX_RX_PAUSE; in qlcnic_83xx_set_pauseparam()
3759 ahw->port_config &= ~QLC_83XX_CFG_STD_TX_PAUSE; in qlcnic_83xx_set_pauseparam()
3760 ahw->port_config |= QLC_83XX_CFG_STD_RX_PAUSE; in qlcnic_83xx_set_pauseparam()
3762 ahw->port_config &= ~QLC_83XX_CFG_STD_RX_PAUSE; in qlcnic_83xx_set_pauseparam()
3763 ahw->port_config |= QLC_83XX_CFG_STD_TX_PAUSE; in qlcnic_83xx_set_pauseparam()
3765 ahw->port_config &= ~(QLC_83XX_CFG_STD_TX_RX_PAUSE | in qlcnic_83xx_set_pauseparam()
3772 ahw->port_config = config; in qlcnic_83xx_set_pauseparam()
3834 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_resume() local
3835 struct qlc_83xx_idc *idc = &ahw->idc; in qlcnic_83xx_resume()
3842 if (ahw->nic_mode == QLCNIC_VNIC_MODE) { in qlcnic_83xx_resume()
3843 if (ahw->op_mode == QLCNIC_MGMT_FUNC) { in qlcnic_83xx_resume()
3892 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_flush_mbx_queue()
3912 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_check_mbx_status() local
3913 struct qlcnic_mailbox *mbx = ahw->mailbox; in qlcnic_83xx_check_mbx_status()
3919 host_mbx_ctrl = QLCRDX(ahw, QLCNIC_HOST_MBX_CTRL); in qlcnic_83xx_check_mbx_status()
3922 ahw->idc.collect_dump = 1; in qlcnic_83xx_check_mbx_status()
3933 QLCWRX(adapter->ahw, QLCNIC_HOST_MBX_CTRL, QLCNIC_SET_OWNER); in qlcnic_83xx_signal_mbx_cmd()
3935 QLCWRX(adapter->ahw, QLCNIC_FW_MBX_CTRL, QLCNIC_CLR_OWNER); in qlcnic_83xx_signal_mbx_cmd()
3941 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_dequeue_mbx_cmd()
3957 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_encode_mbx_cmd() local
3962 writel(mbx_cmd, QLCNIC_MBX_HOST(ahw, 0)); in qlcnic_83xx_encode_mbx_cmd()
3964 writel(cmd->req.arg[i], QLCNIC_MBX_HOST(ahw, i)); in qlcnic_83xx_encode_mbx_cmd()
3966 fw_hal_version = ahw->fw_hal_version; in qlcnic_83xx_encode_mbx_cmd()
3971 writel(mbx_cmd, QLCNIC_MBX_HOST(ahw, 0)); in qlcnic_83xx_encode_mbx_cmd()
3979 writel(mbx_cmd, QLCNIC_MBX_HOST(ahw, 1)); in qlcnic_83xx_encode_mbx_cmd()
3982 writel(*(cmd->hdr++), QLCNIC_MBX_HOST(ahw, i)); in qlcnic_83xx_encode_mbx_cmd()
3984 writel(*(cmd->pay++), QLCNIC_MBX_HOST(ahw, i)); in qlcnic_83xx_encode_mbx_cmd()
3990 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_detach_mailbox_work()
4006 struct qlcnic_mailbox *mbx = adapter->ahw->mailbox; in qlcnic_83xx_enqueue_mbx_cmd()
4036 fw_data = readl(QLCNIC_MBX_FW(adapter->ahw, 2)); in qlcnic_83xx_check_mac_rcode()
4052 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_decode_mbx_rsp() local
4057 fw_data = readl(QLCNIC_MBX_FW(ahw, 0)); in qlcnic_83xx_decode_mbx_rsp()
4071 __func__, cmd->cmd_op, cmd->type, ahw->pci_func, in qlcnic_83xx_decode_mbx_rsp()
4072 ahw->op_mode, mbx_err_code); in qlcnic_83xx_decode_mbx_rsp()
4082 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_dump_mailbox_registers() local
4085 offset = QLCRDX(ahw, QLCNIC_DEF_INT_MASK); in qlcnic_dump_mailbox_registers()
4087 readl(ahw->pci_base0 + offset), in qlcnic_dump_mailbox_registers()
4088 QLCRDX(ahw, QLCNIC_MBX_INTR_ENBL), in qlcnic_dump_mailbox_registers()
4089 QLCRDX(ahw, QLCNIC_HOST_MBX_CTRL), in qlcnic_dump_mailbox_registers()
4090 QLCRDX(ahw, QLCNIC_FW_MBX_CTRL)); in qlcnic_dump_mailbox_registers()
4101 struct qlcnic_hardware_context *ahw; in qlcnic_83xx_mailbox_worker() local
4105 ahw = adapter->ahw; in qlcnic_83xx_mailbox_worker()
4136 __func__, cmd->cmd_op, cmd->type, ahw->pci_func, in qlcnic_83xx_mailbox_worker()
4137 ahw->op_mode); in qlcnic_83xx_mailbox_worker()
4160 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_83xx_init_mailbox_work() local
4163 ahw->mailbox = kzalloc(sizeof(*mbx), GFP_KERNEL); in qlcnic_83xx_init_mailbox_work()
4164 if (!ahw->mailbox) in qlcnic_83xx_init_mailbox_work()
4167 mbx = ahw->mailbox; in qlcnic_83xx_init_mailbox_work()