Lines Matching refs:ahw
92 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_vlan_tx_check() local
95 return ahw->capabilities & QLCNIC_FW_CAPABILITY_FVLANTX; in qlcnic_vlan_tx_check()
304 adapter->ahw->pci_func); in qlcnic_read_mac_addr()
417 if (netdev_uc_count(netdev) < adapter->ahw->max_uc_count) in qlcnic_fdb_add()
462 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_get_phys_port_id() local
467 ppid->id_len = sizeof(ahw->phys_port_id); in qlcnic_get_phys_port_id()
468 memcpy(ppid->id, ahw->phys_port_id, ppid->id_len); in qlcnic_get_phys_port_id()
477 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_add_vxlan_port() local
487 if (!ahw->vxlan_port_count) { in qlcnic_add_vxlan_port()
488 ahw->vxlan_port_count = 1; in qlcnic_add_vxlan_port()
489 ahw->vxlan_port = ntohs(ti->port); in qlcnic_add_vxlan_port()
493 if (ahw->vxlan_port == ntohs(ti->port)) in qlcnic_add_vxlan_port()
494 ahw->vxlan_port_count++; in qlcnic_add_vxlan_port()
502 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_del_vxlan_port() local
507 if (!qlcnic_encap_rx_offload(adapter) || !ahw->vxlan_port_count || in qlcnic_del_vxlan_port()
508 (ahw->vxlan_port != ntohs(ti->port))) in qlcnic_del_vxlan_port()
511 ahw->vxlan_port_count--; in qlcnic_del_vxlan_port()
512 if (!ahw->vxlan_port_count) in qlcnic_del_vxlan_port()
635 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_check_multi_tx_capability() local
638 (ahw->extra_capability[0] & QLCNIC_FW_CAPABILITY_2_MULTI_TX)) { in qlcnic_check_multi_tx_capability()
745 adapter->ahw->num_msix = num_msix; in qlcnic_setup_tss_rss_intr()
770 if (adapter->ahw->msix_supported) { in qlcnic_enable_msix()
780 adapter->ahw->num_msix = num_msix; in qlcnic_enable_msix()
847 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_enable_msi_legacy() local
852 offset = msi_tgt_status[adapter->ahw->pci_func]; in qlcnic_enable_msi_legacy()
853 adapter->tgt_status_reg = qlcnic_get_ioaddr(adapter->ahw, in qlcnic_enable_msi_legacy()
863 legacy_intrp = &legacy_intr[adapter->ahw->pci_func]; in qlcnic_enable_msi_legacy()
864 adapter->ahw->int_vec_bit = legacy_intrp->int_vec_bit; in qlcnic_enable_msi_legacy()
866 adapter->tgt_status_reg = qlcnic_get_ioaddr(ahw, offset); in qlcnic_enable_msi_legacy()
868 adapter->tgt_mask_reg = qlcnic_get_ioaddr(ahw, mask_reg); in qlcnic_enable_msi_legacy()
869 adapter->isr_int_vec = qlcnic_get_ioaddr(ahw, ISR_INT_VECTOR); in qlcnic_enable_msi_legacy()
870 adapter->crb_int_state_reg = qlcnic_get_ioaddr(ahw, ISR_INT_STATE_REG); in qlcnic_enable_msi_legacy()
884 num_msix = adapter->ahw->num_msix; in qlcnic_82xx_setup_intr()
907 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_82xx_mq_intrpt() local
911 !ahw->diag_test && in qlcnic_82xx_mq_intrpt()
913 ahw->intr_tbl = in qlcnic_82xx_mq_intrpt()
915 ahw->num_msix)); in qlcnic_82xx_mq_intrpt()
916 if (!ahw->intr_tbl) in qlcnic_82xx_mq_intrpt()
919 for (i = 0; i < ahw->num_msix; i++) { in qlcnic_82xx_mq_intrpt()
920 ahw->intr_tbl[i].type = QLCNIC_INTRPT_MSIX; in qlcnic_82xx_mq_intrpt()
921 ahw->intr_tbl[i].id = i; in qlcnic_82xx_mq_intrpt()
922 ahw->intr_tbl[i].src = 0; in qlcnic_82xx_mq_intrpt()
929 ahw->num_msix); in qlcnic_82xx_mq_intrpt()
946 if (adapter->ahw->intr_tbl) { in qlcnic_teardown_intr()
947 vfree(adapter->ahw->intr_tbl); in qlcnic_teardown_intr()
948 adapter->ahw->intr_tbl = NULL; in qlcnic_teardown_intr()
952 static void qlcnic_cleanup_pci_map(struct qlcnic_hardware_context *ahw) in qlcnic_cleanup_pci_map() argument
954 if (ahw->pci_base0 != NULL) in qlcnic_cleanup_pci_map()
955 iounmap(ahw->pci_base0); in qlcnic_cleanup_pci_map()
960 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_get_act_pci_func() local
965 switch (ahw->port_type) { in qlcnic_get_act_pci_func()
967 ahw->total_nic_func = QLCNIC_NIU_MAX_GBE_PORTS; in qlcnic_get_act_pci_func()
970 ahw->total_nic_func = QLCNIC_NIU_MAX_XG_PORTS; in qlcnic_get_act_pci_func()
976 if (ahw->op_mode == QLCNIC_MGMT_FUNC) in qlcnic_get_act_pci_func()
979 pci_info = kcalloc(ahw->max_vnic_func, sizeof(*pci_info), GFP_KERNEL); in qlcnic_get_act_pci_func()
995 if (adapter->ahw->extra_capability[0] & in qlcnic_port_eswitch_cfg_capability()
1007 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_init_pci_info() local
1013 pci_info = kcalloc(ahw->max_vnic_func, sizeof(*pci_info), GFP_KERNEL); in qlcnic_init_pci_info()
1021 act_pci_func = ahw->total_nic_func; in qlcnic_init_pci_info()
1039 for (i = 0; i < ahw->max_vnic_func; i++) { in qlcnic_init_pci_info()
1042 if (pfn >= ahw->max_vnic_func) { in qlcnic_init_pci_info()
1045 __func__, pfn, ahw->max_vnic_func); in qlcnic_init_pci_info()
1103 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_set_function_modes() local
1109 id = ahw->pci_func; in qlcnic_set_function_modes()
1125 adapter->ahw->fw_hal_version = QLC_SHARED_REG_RD32(adapter, in qlcnic_check_vf()
1136 priv_level = QLC_DEV_GET_DRV(op_mode, adapter->ahw->pci_func); in qlcnic_check_vf()
1139 adapter->ahw->op_mode = QLCNIC_NON_PRIV_FUNC; in qlcnic_check_vf()
1142 adapter->ahw->fw_hal_version); in qlcnic_check_vf()
1170 struct qlcnic_hardware_context *ahw) in qlcnic_setup_pci_map() argument
1194 ahw->pci_base0 = mem_ptr0; in qlcnic_setup_pci_map()
1195 ahw->pci_len0 = pci_len0; in qlcnic_setup_pci_map()
1196 offset = QLCNIC_PCIX_PS_REG(PCIX_OCM_WINDOW_REG(ahw->pci_func)); in qlcnic_setup_pci_map()
1197 qlcnic_get_ioaddr(ahw, offset); in qlcnic_setup_pci_map()
1250 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_check_options() local
1251 struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump; in qlcnic_check_options()
1266 if (ahw->op_mode != QLCNIC_NON_PRIV_FUNC) { in qlcnic_check_options()
1279 if (adapter->ahw->port_type == QLCNIC_XGBE) { in qlcnic_check_options()
1291 } else if (adapter->ahw->port_type == QLCNIC_GBE) { in qlcnic_check_options()
1298 adapter->ahw->msix_supported = !!qlcnic_use_msi_x; in qlcnic_check_options()
1312 err = qlcnic_get_nic_info(adapter, &nic_info, adapter->ahw->pci_func); in qlcnic_initialize_nic()
1316 adapter->ahw->physical_port = (u8)nic_info.phys_port; in qlcnic_initialize_nic()
1317 adapter->ahw->switch_mode = nic_info.switch_mode; in qlcnic_initialize_nic()
1318 adapter->ahw->max_tx_ques = nic_info.max_tx_ques; in qlcnic_initialize_nic()
1319 adapter->ahw->max_rx_ques = nic_info.max_rx_ques; in qlcnic_initialize_nic()
1320 adapter->ahw->capabilities = nic_info.capabilities; in qlcnic_initialize_nic()
1322 if (adapter->ahw->capabilities & QLCNIC_FW_CAPABILITY_MORE_CAPS) { in qlcnic_initialize_nic()
1327 adapter->ahw->extra_capability[0] = temp; in qlcnic_initialize_nic()
1329 adapter->ahw->extra_capability[0] = 0; in qlcnic_initialize_nic()
1332 adapter->ahw->max_mac_filters = nic_info.max_mac_filters; in qlcnic_initialize_nic()
1333 adapter->ahw->max_mtu = nic_info.max_mtu; in qlcnic_initialize_nic()
1335 if (adapter->ahw->capabilities & BIT_6) { in qlcnic_initialize_nic()
1337 adapter->ahw->nic_mode = QLCNIC_VNIC_MODE; in qlcnic_initialize_nic()
1343 adapter->ahw->nic_mode = QLCNIC_DEFAULT_MODE; in qlcnic_initialize_nic()
1433 esw_cfg.pci_func = adapter->ahw->pci_func; in qlcnic_set_eswitch_port_config()
1471 priv_level = QLC_DEV_GET_DRV(op_mode, adapter->ahw->pci_func); in qlcnic_check_eswitch_mode()
1476 priv_level = QLC_DEV_GET_DRV(op_mode, adapter->ahw->pci_func); in qlcnic_check_eswitch_mode()
1480 adapter->ahw->op_mode = QLCNIC_MGMT_FUNC; in qlcnic_check_eswitch_mode()
1488 adapter->ahw->fw_hal_version); in qlcnic_check_eswitch_mode()
1490 adapter->ahw->op_mode = QLCNIC_PRIV_FUNC; in qlcnic_check_eswitch_mode()
1493 adapter->ahw->fw_hal_version); in qlcnic_check_eswitch_mode()
1496 adapter->ahw->nic_mode = QLCNIC_DEFAULT_MODE; in qlcnic_check_eswitch_mode()
1513 for (i = 0; i < adapter->ahw->total_nic_func; i++) { in qlcnic_set_default_offload_settings()
1576 for (i = 0; i < adapter->ahw->total_nic_func; i++) { in qlcnic_reset_npar_config()
1611 if (adapter->ahw->op_mode == QLCNIC_MGMT_FUNC) in qlcnic_check_npar_opertional()
1635 adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) in qlcnic_set_mgmt_operations()
1668 adapter->ahw->fw_type = QLCNIC_FLASH_ROMIMAGE; in qlcnic_82xx_start_firmware()
1729 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_request_irq()
1752 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) { in qlcnic_request_irq()
1814 if (adapter->ahw->diag_test != QLCNIC_LOOPBACK_TEST) { in qlcnic_free_irq()
1842 if (adapter->ahw->extra_capability[0] & in qlcnic_get_lro_mss_capability()
1846 capab = adapter->ahw->capabilities; in qlcnic_get_lro_mss_capability()
1854 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_config_def_intr_coalesce() local
1858 ahw->coal.flag = QLCNIC_INTR_DEFAULT; in qlcnic_config_def_intr_coalesce()
1861 ahw->coal.type = QLCNIC_INTR_COAL_TYPE_RX_TX; in qlcnic_config_def_intr_coalesce()
1862 ahw->coal.tx_time_us = QLCNIC_DEF_INTR_COALESCE_TX_TIME_US; in qlcnic_config_def_intr_coalesce()
1863 ahw->coal.tx_packets = QLCNIC_DEF_INTR_COALESCE_TX_PACKETS; in qlcnic_config_def_intr_coalesce()
1864 ahw->coal.rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US; in qlcnic_config_def_intr_coalesce()
1865 ahw->coal.rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS; in qlcnic_config_def_intr_coalesce()
1869 ahw->coal.type = QLCNIC_INTR_COAL_TYPE_RX; in qlcnic_config_def_intr_coalesce()
1870 ahw->coal.rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US; in qlcnic_config_def_intr_coalesce()
1871 ahw->coal.rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS; in qlcnic_config_def_intr_coalesce()
1906 adapter->ahw->linkup = 0; in __qlcnic_up()
1921 adapter->ahw->reset_context = 0; in __qlcnic_up()
1950 adapter->ahw->linkup = 0; in __qlcnic_down()
1960 qlcnic_sriov_cleanup_async_list(&adapter->ahw->sriov->bc); in __qlcnic_down()
2057 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_diag_free_res()
2068 adapter->ahw->diag_test = 0; in qlcnic_diag_free_res()
2083 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_alloc_adapter_resources() local
2094 ahw->coal.type = QLCNIC_INTR_COAL_TYPE_RX_TX; in qlcnic_alloc_adapter_resources()
2095 ahw->coal.tx_time_us = QLCNIC_DEF_INTR_COALESCE_TX_TIME_US; in qlcnic_alloc_adapter_resources()
2096 ahw->coal.tx_packets = QLCNIC_DEF_INTR_COALESCE_TX_PACKETS; in qlcnic_alloc_adapter_resources()
2097 ahw->coal.rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US; in qlcnic_alloc_adapter_resources()
2098 ahw->coal.rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS; in qlcnic_alloc_adapter_resources()
2100 ahw->coal.type = QLCNIC_INTR_COAL_TYPE_RX; in qlcnic_alloc_adapter_resources()
2101 ahw->coal.rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US; in qlcnic_alloc_adapter_resources()
2102 ahw->coal.rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS; in qlcnic_alloc_adapter_resources()
2113 struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump; in qlcnic_free_adapter_resources()
2129 kfree(adapter->ahw->reset.buff); in qlcnic_free_adapter_resources()
2130 adapter->ahw->fw_dump.tmpl_hdr = NULL; in qlcnic_free_adapter_resources()
2149 adapter->ahw->diag_test = test; in qlcnic_diag_alloc_res()
2150 adapter->ahw->linkup = 0; in qlcnic_diag_alloc_res()
2170 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_diag_alloc_res()
2177 if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) { in qlcnic_diag_alloc_res()
2178 adapter->ahw->loopback_state = 0; in qlcnic_diag_alloc_res()
2244 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_82xx_set_mac_filter_count() local
2245 u16 act_pci_fn = ahw->total_nic_func; in qlcnic_82xx_set_mac_filter_count()
2248 ahw->max_mc_count = QLCNIC_MAX_MC_COUNT; in qlcnic_82xx_set_mac_filter_count()
2255 ahw->max_uc_count = count; in qlcnic_82xx_set_mac_filter_count()
2291 adapter->ahw->mc_enabled = 0; in qlcnic_setup_netdev()
2324 if (adapter->ahw->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO) in qlcnic_setup_netdev()
2440 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_set_drv_version() local
2448 if (ahw->extra_capability[0] & QLCNIC_FW_CAPABILITY_SET_DRV_VER) in qlcnic_set_drv_version()
2465 struct qlcnic_hardware_context *ahw; in qlcnic_probe() local
2489 ahw = kzalloc(sizeof(struct qlcnic_hardware_context), GFP_KERNEL); in qlcnic_probe()
2490 if (!ahw) { in qlcnic_probe()
2497 ahw->hw_ops = &qlcnic_hw_ops; in qlcnic_probe()
2498 ahw->reg_tbl = (u32 *) qlcnic_reg_tbl; in qlcnic_probe()
2503 qlcnic_83xx_register_map(ahw); in qlcnic_probe()
2508 qlcnic_sriov_vf_register_map(ahw); in qlcnic_probe()
2514 err = qlcnic_setup_pci_map(pdev, ahw); in qlcnic_probe()
2530 adapter->ahw = ahw; in qlcnic_probe()
2544 ahw->revision_id = pdev->revision; in qlcnic_probe()
2545 ahw->max_vnic_func = qlcnic_get_vnic_func_count(adapter); in qlcnic_probe()
2551 rwlock_init(&adapter->ahw->crb_lock); in qlcnic_probe()
2552 mutex_init(&adapter->ahw->mem_lock); in qlcnic_probe()
2560 adapter->portnum = adapter->ahw->pci_func; in qlcnic_probe()
2570 if (adapter->ahw->msix_supported) { in qlcnic_probe()
2592 adapter->portnum = adapter->ahw->pci_func; in qlcnic_probe()
2631 board_name, adapter->ahw->revision_id); in qlcnic_probe()
2667 switch (adapter->ahw->port_type) { in qlcnic_probe()
2704 qlcnic_cleanup_pci_map(ahw); in qlcnic_probe()
2707 kfree(ahw); in qlcnic_probe()
2720 ahw->port_type = QLCNIC_XGBE; in qlcnic_probe()
2725 ahw->board_type = QLCNIC_BRDTYPE_P3P_10G_SFP_PLUS; in qlcnic_probe()
2745 struct qlcnic_hardware_context *ahw; in qlcnic_remove() local
2755 ahw = adapter->ahw; in qlcnic_remove()
2765 qlcnic_83xx_free_mailbox(ahw->mailbox); in qlcnic_remove()
2766 kfree(ahw->fw_info); in qlcnic_remove()
2787 qlcnic_cleanup_pci_map(adapter->ahw); in qlcnic_remove()
2801 kfree(ahw); in qlcnic_remove()
2893 act_pci_func = adapter->ahw->total_nic_func; in qlcnic_alloc_lb_filters_mem()
2960 temp = QLCRDX(adapter->ahw, QLC_83XX_ASIC_TEMP); in qlcnic_check_temp()
2975 if (adapter->ahw->temp == QLCNIC_TEMP_NORMAL) { in qlcnic_check_temp()
2983 if (adapter->ahw->temp == QLCNIC_TEMP_WARN) { in qlcnic_check_temp()
2989 adapter->ahw->temp = temp_state; in qlcnic_check_temp()
3066 if (netif_msg_tx_err(adapter->ahw)) in qlcnic_dump_rings()
3082 netif_msg_tx_err(adapter->ahw)) { in qlcnic_tx_timeout()
3091 adapter->ahw->reset_context = 1; in qlcnic_tx_timeout()
3119 if (!(status & adapter->ahw->int_vec_bit)) in qlcnic_82xx_clear_legacy_intr()
3151 adapter->ahw->diag_cnt++; in qlcnic_tmp_intr()
3289 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_check_drv_state() local
3295 active_mask = (~(1 << (ahw->pci_func * 4))); in qlcnic_check_drv_state()
3427 if (adapter->ahw->op_mode == QLCNIC_NON_PRIV_FUNC) { in qlcnic_fwinit_work()
3545 if (adapter->ahw->temp == QLCNIC_TEMP_PANIC) { in qlcnic_detach_work()
3547 adapter->ahw->temp); in qlcnic_detach_work()
3665 if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) { in qlcnic_attach_work()
3704 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_check_health() local
3705 struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump; in qlcnic_check_health()
3730 if (ahw->reset_context && qlcnic_auto_fw_reset) in qlcnic_check_health()
3841 if (adapter->ahw->op_mode != QLCNIC_NON_PRIV_FUNC && first_func) { in qlcnic_attach_func()
3945 struct qlcnic_hardware_ops *hw_ops = adapter->ahw->hw_ops; in qlcnic_io_error_detected()
3958 struct qlcnic_hardware_ops *hw_ops = adapter->ahw->hw_ops; in qlcnic_io_slot_reset()
3971 struct qlcnic_hardware_ops *hw_ops = adapter->ahw->hw_ops; in qlcnic_io_resume()