Lines Matching refs:ahw

98 	struct qlcnic_hardware_context *ahw = adapter->ahw;  in qlcnic_vlan_tx_check()  local
101 return ahw->capabilities & QLCNIC_FW_CAPABILITY_FVLANTX; in qlcnic_vlan_tx_check()
309 adapter->ahw->pci_func); in qlcnic_read_mac_addr()
421 if (netdev_uc_count(netdev) < adapter->ahw->max_uc_count) in qlcnic_fdb_add()
465 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_get_phys_port_id() local
470 ppid->id_len = sizeof(ahw->phys_port_id); in qlcnic_get_phys_port_id()
471 memcpy(ppid->id, ahw->phys_port_id, ppid->id_len); in qlcnic_get_phys_port_id()
481 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_add_vxlan_port() local
486 if (!qlcnic_encap_rx_offload(adapter) || ahw->vxlan_port) in qlcnic_add_vxlan_port()
489 ahw->vxlan_port = ntohs(port); in qlcnic_add_vxlan_port()
497 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_del_vxlan_port() local
499 if (!qlcnic_encap_rx_offload(adapter) || !ahw->vxlan_port || in qlcnic_del_vxlan_port()
500 (ahw->vxlan_port != ntohs(port))) in qlcnic_del_vxlan_port()
629 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_check_multi_tx_capability() local
632 (ahw->extra_capability[0] & QLCNIC_FW_CAPABILITY_2_MULTI_TX)) { in qlcnic_check_multi_tx_capability()
739 adapter->ahw->num_msix = num_msix; in qlcnic_setup_tss_rss_intr()
764 if (adapter->ahw->msix_supported) { in qlcnic_enable_msix()
774 adapter->ahw->num_msix = num_msix; in qlcnic_enable_msix()
841 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_enable_msi_legacy() local
846 offset = msi_tgt_status[adapter->ahw->pci_func]; in qlcnic_enable_msi_legacy()
847 adapter->tgt_status_reg = qlcnic_get_ioaddr(adapter->ahw, in qlcnic_enable_msi_legacy()
857 legacy_intrp = &legacy_intr[adapter->ahw->pci_func]; in qlcnic_enable_msi_legacy()
858 adapter->ahw->int_vec_bit = legacy_intrp->int_vec_bit; in qlcnic_enable_msi_legacy()
860 adapter->tgt_status_reg = qlcnic_get_ioaddr(ahw, offset); in qlcnic_enable_msi_legacy()
862 adapter->tgt_mask_reg = qlcnic_get_ioaddr(ahw, mask_reg); in qlcnic_enable_msi_legacy()
863 adapter->isr_int_vec = qlcnic_get_ioaddr(ahw, ISR_INT_VECTOR); in qlcnic_enable_msi_legacy()
864 adapter->crb_int_state_reg = qlcnic_get_ioaddr(ahw, ISR_INT_STATE_REG); in qlcnic_enable_msi_legacy()
878 num_msix = adapter->ahw->num_msix; in qlcnic_82xx_setup_intr()
901 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_82xx_mq_intrpt() local
905 !ahw->diag_test && in qlcnic_82xx_mq_intrpt()
907 ahw->intr_tbl = vzalloc(ahw->num_msix * in qlcnic_82xx_mq_intrpt()
909 if (!ahw->intr_tbl) in qlcnic_82xx_mq_intrpt()
912 for (i = 0; i < ahw->num_msix; i++) { in qlcnic_82xx_mq_intrpt()
913 ahw->intr_tbl[i].type = QLCNIC_INTRPT_MSIX; in qlcnic_82xx_mq_intrpt()
914 ahw->intr_tbl[i].id = i; in qlcnic_82xx_mq_intrpt()
915 ahw->intr_tbl[i].src = 0; in qlcnic_82xx_mq_intrpt()
922 ahw->num_msix); in qlcnic_82xx_mq_intrpt()
939 if (adapter->ahw->intr_tbl) { in qlcnic_teardown_intr()
940 vfree(adapter->ahw->intr_tbl); in qlcnic_teardown_intr()
941 adapter->ahw->intr_tbl = NULL; in qlcnic_teardown_intr()
945 static void qlcnic_cleanup_pci_map(struct qlcnic_hardware_context *ahw) in qlcnic_cleanup_pci_map() argument
947 if (ahw->pci_base0 != NULL) in qlcnic_cleanup_pci_map()
948 iounmap(ahw->pci_base0); in qlcnic_cleanup_pci_map()
953 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_get_act_pci_func() local
958 switch (ahw->port_type) { in qlcnic_get_act_pci_func()
960 ahw->total_nic_func = QLCNIC_NIU_MAX_GBE_PORTS; in qlcnic_get_act_pci_func()
963 ahw->total_nic_func = QLCNIC_NIU_MAX_XG_PORTS; in qlcnic_get_act_pci_func()
969 if (ahw->op_mode == QLCNIC_MGMT_FUNC) in qlcnic_get_act_pci_func()
972 pci_info = kcalloc(ahw->max_vnic_func, sizeof(*pci_info), GFP_KERNEL); in qlcnic_get_act_pci_func()
988 if (adapter->ahw->extra_capability[0] & in qlcnic_port_eswitch_cfg_capability()
1000 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_init_pci_info() local
1006 pci_info = kcalloc(ahw->max_vnic_func, sizeof(*pci_info), GFP_KERNEL); in qlcnic_init_pci_info()
1014 act_pci_func = ahw->total_nic_func; in qlcnic_init_pci_info()
1030 for (i = 0; i < ahw->max_vnic_func; i++) { in qlcnic_init_pci_info()
1033 if (pfn >= ahw->max_vnic_func) { in qlcnic_init_pci_info()
1036 __func__, pfn, ahw->max_vnic_func); in qlcnic_init_pci_info()
1094 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_set_function_modes() local
1100 id = ahw->pci_func; in qlcnic_set_function_modes()
1116 adapter->ahw->fw_hal_version = QLC_SHARED_REG_RD32(adapter, in qlcnic_check_vf()
1127 priv_level = QLC_DEV_GET_DRV(op_mode, adapter->ahw->pci_func); in qlcnic_check_vf()
1130 adapter->ahw->op_mode = QLCNIC_NON_PRIV_FUNC; in qlcnic_check_vf()
1133 adapter->ahw->fw_hal_version); in qlcnic_check_vf()
1160 struct qlcnic_hardware_context *ahw) in qlcnic_setup_pci_map() argument
1184 ahw->pci_base0 = mem_ptr0; in qlcnic_setup_pci_map()
1185 ahw->pci_len0 = pci_len0; in qlcnic_setup_pci_map()
1186 offset = QLCNIC_PCIX_PS_REG(PCIX_OCM_WINDOW_REG(ahw->pci_func)); in qlcnic_setup_pci_map()
1187 qlcnic_get_ioaddr(ahw, offset); in qlcnic_setup_pci_map()
1240 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_check_options() local
1241 struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump; in qlcnic_check_options()
1256 if (ahw->op_mode != QLCNIC_NON_PRIV_FUNC) { in qlcnic_check_options()
1269 if (adapter->ahw->port_type == QLCNIC_XGBE) { in qlcnic_check_options()
1281 } else if (adapter->ahw->port_type == QLCNIC_GBE) { in qlcnic_check_options()
1288 adapter->ahw->msix_supported = !!qlcnic_use_msi_x; in qlcnic_check_options()
1302 err = qlcnic_get_nic_info(adapter, &nic_info, adapter->ahw->pci_func); in qlcnic_initialize_nic()
1306 adapter->ahw->physical_port = (u8)nic_info.phys_port; in qlcnic_initialize_nic()
1307 adapter->ahw->switch_mode = nic_info.switch_mode; in qlcnic_initialize_nic()
1308 adapter->ahw->max_tx_ques = nic_info.max_tx_ques; in qlcnic_initialize_nic()
1309 adapter->ahw->max_rx_ques = nic_info.max_rx_ques; in qlcnic_initialize_nic()
1310 adapter->ahw->capabilities = nic_info.capabilities; in qlcnic_initialize_nic()
1312 if (adapter->ahw->capabilities & QLCNIC_FW_CAPABILITY_MORE_CAPS) { in qlcnic_initialize_nic()
1317 adapter->ahw->extra_capability[0] = temp; in qlcnic_initialize_nic()
1319 adapter->ahw->extra_capability[0] = 0; in qlcnic_initialize_nic()
1322 adapter->ahw->max_mac_filters = nic_info.max_mac_filters; in qlcnic_initialize_nic()
1323 adapter->ahw->max_mtu = nic_info.max_mtu; in qlcnic_initialize_nic()
1325 if (adapter->ahw->capabilities & BIT_6) { in qlcnic_initialize_nic()
1327 adapter->ahw->nic_mode = QLCNIC_VNIC_MODE; in qlcnic_initialize_nic()
1333 adapter->ahw->nic_mode = QLCNIC_DEFAULT_MODE; in qlcnic_initialize_nic()
1423 esw_cfg.pci_func = adapter->ahw->pci_func; in qlcnic_set_eswitch_port_config()
1461 priv_level = QLC_DEV_GET_DRV(op_mode, adapter->ahw->pci_func); in qlcnic_check_eswitch_mode()
1466 priv_level = QLC_DEV_GET_DRV(op_mode, adapter->ahw->pci_func); in qlcnic_check_eswitch_mode()
1470 adapter->ahw->op_mode = QLCNIC_MGMT_FUNC; in qlcnic_check_eswitch_mode()
1478 adapter->ahw->fw_hal_version); in qlcnic_check_eswitch_mode()
1480 adapter->ahw->op_mode = QLCNIC_PRIV_FUNC; in qlcnic_check_eswitch_mode()
1483 adapter->ahw->fw_hal_version); in qlcnic_check_eswitch_mode()
1486 adapter->ahw->nic_mode = QLCNIC_DEFAULT_MODE; in qlcnic_check_eswitch_mode()
1503 for (i = 0; i < adapter->ahw->total_nic_func; i++) { in qlcnic_set_default_offload_settings()
1566 for (i = 0; i < adapter->ahw->total_nic_func; i++) { in qlcnic_reset_npar_config()
1601 if (adapter->ahw->op_mode == QLCNIC_MGMT_FUNC) in qlcnic_check_npar_opertional()
1625 adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) in qlcnic_set_mgmt_operations()
1658 adapter->ahw->fw_type = QLCNIC_FLASH_ROMIMAGE; in qlcnic_82xx_start_firmware()
1719 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_request_irq()
1742 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) { in qlcnic_request_irq()
1804 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) { in qlcnic_free_irq()
1832 if (adapter->ahw->extra_capability[0] & in qlcnic_get_lro_mss_capability()
1836 capab = adapter->ahw->capabilities; in qlcnic_get_lro_mss_capability()
1844 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_config_def_intr_coalesce() local
1848 ahw->coal.flag = QLCNIC_INTR_DEFAULT; in qlcnic_config_def_intr_coalesce()
1851 ahw->coal.type = QLCNIC_INTR_COAL_TYPE_RX_TX; in qlcnic_config_def_intr_coalesce()
1852 ahw->coal.tx_time_us = QLCNIC_DEF_INTR_COALESCE_TX_TIME_US; in qlcnic_config_def_intr_coalesce()
1853 ahw->coal.tx_packets = QLCNIC_DEF_INTR_COALESCE_TX_PACKETS; in qlcnic_config_def_intr_coalesce()
1854 ahw->coal.rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US; in qlcnic_config_def_intr_coalesce()
1855 ahw->coal.rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS; in qlcnic_config_def_intr_coalesce()
1859 ahw->coal.type = QLCNIC_INTR_COAL_TYPE_RX; in qlcnic_config_def_intr_coalesce()
1860 ahw->coal.rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US; in qlcnic_config_def_intr_coalesce()
1861 ahw->coal.rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS; in qlcnic_config_def_intr_coalesce()
1896 adapter->ahw->linkup = 0; in __qlcnic_up()
1911 adapter->ahw->reset_context = 0; in __qlcnic_up()
1940 adapter->ahw->linkup = 0; in __qlcnic_down()
1950 qlcnic_sriov_cleanup_async_list(&adapter->ahw->sriov->bc); in __qlcnic_down()
2049 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_diag_free_res()
2060 adapter->ahw->diag_test = 0; in qlcnic_diag_free_res()
2075 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_alloc_adapter_resources() local
2086 ahw->coal.type = QLCNIC_INTR_COAL_TYPE_RX_TX; in qlcnic_alloc_adapter_resources()
2087 ahw->coal.tx_time_us = QLCNIC_DEF_INTR_COALESCE_TX_TIME_US; in qlcnic_alloc_adapter_resources()
2088 ahw->coal.tx_packets = QLCNIC_DEF_INTR_COALESCE_TX_PACKETS; in qlcnic_alloc_adapter_resources()
2089 ahw->coal.rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US; in qlcnic_alloc_adapter_resources()
2090 ahw->coal.rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS; in qlcnic_alloc_adapter_resources()
2092 ahw->coal.type = QLCNIC_INTR_COAL_TYPE_RX; in qlcnic_alloc_adapter_resources()
2093 ahw->coal.rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US; in qlcnic_alloc_adapter_resources()
2094 ahw->coal.rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS; in qlcnic_alloc_adapter_resources()
2105 struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump; in qlcnic_free_adapter_resources()
2121 kfree(adapter->ahw->reset.buff); in qlcnic_free_adapter_resources()
2122 adapter->ahw->fw_dump.tmpl_hdr = NULL; in qlcnic_free_adapter_resources()
2141 adapter->ahw->diag_test = test; in qlcnic_diag_alloc_res()
2142 adapter->ahw->linkup = 0; in qlcnic_diag_alloc_res()
2162 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_diag_alloc_res()
2169 if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) { in qlcnic_diag_alloc_res()
2170 adapter->ahw->loopback_state = 0; in qlcnic_diag_alloc_res()
2236 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_82xx_set_mac_filter_count() local
2237 u16 act_pci_fn = ahw->total_nic_func; in qlcnic_82xx_set_mac_filter_count()
2240 ahw->max_mc_count = QLCNIC_MAX_MC_COUNT; in qlcnic_82xx_set_mac_filter_count()
2247 ahw->max_uc_count = count; in qlcnic_82xx_set_mac_filter_count()
2283 adapter->ahw->mc_enabled = 0; in qlcnic_setup_netdev()
2316 if (adapter->ahw->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO) in qlcnic_setup_netdev()
2429 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_set_drv_version() local
2437 if (ahw->extra_capability[0] & QLCNIC_FW_CAPABILITY_SET_DRV_VER) in qlcnic_set_drv_version()
2454 struct qlcnic_hardware_context *ahw; in qlcnic_probe() local
2478 ahw = kzalloc(sizeof(struct qlcnic_hardware_context), GFP_KERNEL); in qlcnic_probe()
2479 if (!ahw) { in qlcnic_probe()
2486 ahw->hw_ops = &qlcnic_hw_ops; in qlcnic_probe()
2487 ahw->reg_tbl = (u32 *) qlcnic_reg_tbl; in qlcnic_probe()
2492 qlcnic_83xx_register_map(ahw); in qlcnic_probe()
2496 qlcnic_sriov_vf_register_map(ahw); in qlcnic_probe()
2502 err = qlcnic_setup_pci_map(pdev, ahw); in qlcnic_probe()
2518 adapter->ahw = ahw; in qlcnic_probe()
2532 ahw->revision_id = pdev->revision; in qlcnic_probe()
2533 ahw->max_vnic_func = qlcnic_get_vnic_func_count(adapter); in qlcnic_probe()
2539 rwlock_init(&adapter->ahw->crb_lock); in qlcnic_probe()
2540 mutex_init(&adapter->ahw->mem_lock); in qlcnic_probe()
2548 adapter->portnum = adapter->ahw->pci_func; in qlcnic_probe()
2558 if (adapter->ahw->msix_supported) { in qlcnic_probe()
2580 adapter->portnum = adapter->ahw->pci_func; in qlcnic_probe()
2619 board_name, adapter->ahw->revision_id); in qlcnic_probe()
2655 switch (adapter->ahw->port_type) { in qlcnic_probe()
2692 qlcnic_cleanup_pci_map(ahw); in qlcnic_probe()
2695 kfree(ahw); in qlcnic_probe()
2708 ahw->port_type = QLCNIC_XGBE; in qlcnic_probe()
2713 ahw->board_type = QLCNIC_BRDTYPE_P3P_10G_SFP_PLUS; in qlcnic_probe()
2733 struct qlcnic_hardware_context *ahw; in qlcnic_remove() local
2743 ahw = adapter->ahw; in qlcnic_remove()
2753 qlcnic_83xx_free_mailbox(ahw->mailbox); in qlcnic_remove()
2754 kfree(ahw->fw_info); in qlcnic_remove()
2775 qlcnic_cleanup_pci_map(adapter->ahw); in qlcnic_remove()
2789 kfree(ahw); in qlcnic_remove()
2881 act_pci_func = adapter->ahw->total_nic_func; in qlcnic_alloc_lb_filters_mem()
2948 temp = QLCRDX(adapter->ahw, QLC_83XX_ASIC_TEMP); in qlcnic_check_temp()
2963 if (adapter->ahw->temp == QLCNIC_TEMP_NORMAL) { in qlcnic_check_temp()
2971 if (adapter->ahw->temp == QLCNIC_TEMP_WARN) { in qlcnic_check_temp()
2977 adapter->ahw->temp = temp_state; in qlcnic_check_temp()
3054 if (netif_msg_tx_err(adapter->ahw)) in qlcnic_dump_rings()
3070 netif_msg_tx_err(adapter->ahw)) { in qlcnic_tx_timeout()
3079 adapter->ahw->reset_context = 1; in qlcnic_tx_timeout()
3107 if (!(status & adapter->ahw->int_vec_bit)) in qlcnic_82xx_clear_legacy_intr()
3139 adapter->ahw->diag_cnt++; in qlcnic_tmp_intr()
3316 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_check_drv_state() local
3322 active_mask = (~(1 << (ahw->pci_func * 4))); in qlcnic_check_drv_state()
3454 if (adapter->ahw->op_mode == QLCNIC_NON_PRIV_FUNC) { in qlcnic_fwinit_work()
3572 if (adapter->ahw->temp == QLCNIC_TEMP_PANIC) { in qlcnic_detach_work()
3574 adapter->ahw->temp); in qlcnic_detach_work()
3692 if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) { in qlcnic_attach_work()
3731 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_check_health() local
3732 struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump; in qlcnic_check_health()
3757 if (ahw->reset_context && qlcnic_auto_fw_reset) in qlcnic_check_health()
3868 if (adapter->ahw->op_mode != QLCNIC_NON_PRIV_FUNC && first_func) { in qlcnic_attach_func()
3966 struct qlcnic_hardware_ops *hw_ops = adapter->ahw->hw_ops; in qlcnic_io_error_detected()
3979 struct qlcnic_hardware_ops *hw_ops = adapter->ahw->hw_ops; in qlcnic_io_slot_reset()
3992 struct qlcnic_hardware_ops *hw_ops = adapter->ahw->hw_ops; in qlcnic_io_resume()