Lines Matching refs:ahw

97 	struct qlcnic_hardware_context *ahw = adapter->ahw;  in qlcnic_vlan_tx_check()  local
100 return ahw->capabilities & QLCNIC_FW_CAPABILITY_FVLANTX; in qlcnic_vlan_tx_check()
309 adapter->ahw->pci_func); in qlcnic_read_mac_addr()
422 if (netdev_uc_count(netdev) < adapter->ahw->max_uc_count) in qlcnic_fdb_add()
466 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_get_phys_port_id() local
471 ppid->id_len = sizeof(ahw->phys_port_id); in qlcnic_get_phys_port_id()
472 memcpy(ppid->id, ahw->phys_port_id, ppid->id_len); in qlcnic_get_phys_port_id()
482 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_add_vxlan_port() local
489 if (!ahw->vxlan_port_count) { in qlcnic_add_vxlan_port()
490 ahw->vxlan_port_count = 1; in qlcnic_add_vxlan_port()
491 ahw->vxlan_port = ntohs(port); in qlcnic_add_vxlan_port()
495 if (ahw->vxlan_port == ntohs(port)) in qlcnic_add_vxlan_port()
496 ahw->vxlan_port_count++; in qlcnic_add_vxlan_port()
504 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_del_vxlan_port() local
506 if (!qlcnic_encap_rx_offload(adapter) || !ahw->vxlan_port_count || in qlcnic_del_vxlan_port()
507 (ahw->vxlan_port != ntohs(port))) in qlcnic_del_vxlan_port()
510 ahw->vxlan_port_count--; in qlcnic_del_vxlan_port()
511 if (!ahw->vxlan_port_count) in qlcnic_del_vxlan_port()
638 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_check_multi_tx_capability() local
641 (ahw->extra_capability[0] & QLCNIC_FW_CAPABILITY_2_MULTI_TX)) { in qlcnic_check_multi_tx_capability()
748 adapter->ahw->num_msix = num_msix; in qlcnic_setup_tss_rss_intr()
773 if (adapter->ahw->msix_supported) { in qlcnic_enable_msix()
783 adapter->ahw->num_msix = num_msix; in qlcnic_enable_msix()
850 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_enable_msi_legacy() local
855 offset = msi_tgt_status[adapter->ahw->pci_func]; in qlcnic_enable_msi_legacy()
856 adapter->tgt_status_reg = qlcnic_get_ioaddr(adapter->ahw, in qlcnic_enable_msi_legacy()
866 legacy_intrp = &legacy_intr[adapter->ahw->pci_func]; in qlcnic_enable_msi_legacy()
867 adapter->ahw->int_vec_bit = legacy_intrp->int_vec_bit; in qlcnic_enable_msi_legacy()
869 adapter->tgt_status_reg = qlcnic_get_ioaddr(ahw, offset); in qlcnic_enable_msi_legacy()
871 adapter->tgt_mask_reg = qlcnic_get_ioaddr(ahw, mask_reg); in qlcnic_enable_msi_legacy()
872 adapter->isr_int_vec = qlcnic_get_ioaddr(ahw, ISR_INT_VECTOR); in qlcnic_enable_msi_legacy()
873 adapter->crb_int_state_reg = qlcnic_get_ioaddr(ahw, ISR_INT_STATE_REG); in qlcnic_enable_msi_legacy()
887 num_msix = adapter->ahw->num_msix; in qlcnic_82xx_setup_intr()
910 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_82xx_mq_intrpt() local
914 !ahw->diag_test && in qlcnic_82xx_mq_intrpt()
916 ahw->intr_tbl = vzalloc(ahw->num_msix * in qlcnic_82xx_mq_intrpt()
918 if (!ahw->intr_tbl) in qlcnic_82xx_mq_intrpt()
921 for (i = 0; i < ahw->num_msix; i++) { in qlcnic_82xx_mq_intrpt()
922 ahw->intr_tbl[i].type = QLCNIC_INTRPT_MSIX; in qlcnic_82xx_mq_intrpt()
923 ahw->intr_tbl[i].id = i; in qlcnic_82xx_mq_intrpt()
924 ahw->intr_tbl[i].src = 0; in qlcnic_82xx_mq_intrpt()
931 ahw->num_msix); in qlcnic_82xx_mq_intrpt()
948 if (adapter->ahw->intr_tbl) { in qlcnic_teardown_intr()
949 vfree(adapter->ahw->intr_tbl); in qlcnic_teardown_intr()
950 adapter->ahw->intr_tbl = NULL; in qlcnic_teardown_intr()
954 static void qlcnic_cleanup_pci_map(struct qlcnic_hardware_context *ahw) in qlcnic_cleanup_pci_map() argument
956 if (ahw->pci_base0 != NULL) in qlcnic_cleanup_pci_map()
957 iounmap(ahw->pci_base0); in qlcnic_cleanup_pci_map()
962 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_get_act_pci_func() local
967 switch (ahw->port_type) { in qlcnic_get_act_pci_func()
969 ahw->total_nic_func = QLCNIC_NIU_MAX_GBE_PORTS; in qlcnic_get_act_pci_func()
972 ahw->total_nic_func = QLCNIC_NIU_MAX_XG_PORTS; in qlcnic_get_act_pci_func()
978 if (ahw->op_mode == QLCNIC_MGMT_FUNC) in qlcnic_get_act_pci_func()
981 pci_info = kcalloc(ahw->max_vnic_func, sizeof(*pci_info), GFP_KERNEL); in qlcnic_get_act_pci_func()
997 if (adapter->ahw->extra_capability[0] & in qlcnic_port_eswitch_cfg_capability()
1009 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_init_pci_info() local
1015 pci_info = kcalloc(ahw->max_vnic_func, sizeof(*pci_info), GFP_KERNEL); in qlcnic_init_pci_info()
1023 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()
2059 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_diag_free_res()
2070 adapter->ahw->diag_test = 0; in qlcnic_diag_free_res()
2085 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_alloc_adapter_resources() local
2096 ahw->coal.type = QLCNIC_INTR_COAL_TYPE_RX_TX; in qlcnic_alloc_adapter_resources()
2097 ahw->coal.tx_time_us = QLCNIC_DEF_INTR_COALESCE_TX_TIME_US; in qlcnic_alloc_adapter_resources()
2098 ahw->coal.tx_packets = QLCNIC_DEF_INTR_COALESCE_TX_PACKETS; in qlcnic_alloc_adapter_resources()
2099 ahw->coal.rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US; in qlcnic_alloc_adapter_resources()
2100 ahw->coal.rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS; in qlcnic_alloc_adapter_resources()
2102 ahw->coal.type = QLCNIC_INTR_COAL_TYPE_RX; in qlcnic_alloc_adapter_resources()
2103 ahw->coal.rx_time_us = QLCNIC_DEF_INTR_COALESCE_RX_TIME_US; in qlcnic_alloc_adapter_resources()
2104 ahw->coal.rx_packets = QLCNIC_DEF_INTR_COALESCE_RX_PACKETS; in qlcnic_alloc_adapter_resources()
2115 struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump; in qlcnic_free_adapter_resources()
2131 kfree(adapter->ahw->reset.buff); in qlcnic_free_adapter_resources()
2132 adapter->ahw->fw_dump.tmpl_hdr = NULL; in qlcnic_free_adapter_resources()
2151 adapter->ahw->diag_test = test; in qlcnic_diag_alloc_res()
2152 adapter->ahw->linkup = 0; in qlcnic_diag_alloc_res()
2172 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { in qlcnic_diag_alloc_res()
2179 if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) { in qlcnic_diag_alloc_res()
2180 adapter->ahw->loopback_state = 0; in qlcnic_diag_alloc_res()
2246 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_82xx_set_mac_filter_count() local
2247 u16 act_pci_fn = ahw->total_nic_func; in qlcnic_82xx_set_mac_filter_count()
2250 ahw->max_mc_count = QLCNIC_MAX_MC_COUNT; in qlcnic_82xx_set_mac_filter_count()
2257 ahw->max_uc_count = count; in qlcnic_82xx_set_mac_filter_count()
2293 adapter->ahw->mc_enabled = 0; in qlcnic_setup_netdev()
2326 if (adapter->ahw->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO) in qlcnic_setup_netdev()
2438 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_set_drv_version() local
2446 if (ahw->extra_capability[0] & QLCNIC_FW_CAPABILITY_SET_DRV_VER) in qlcnic_set_drv_version()
2463 struct qlcnic_hardware_context *ahw; in qlcnic_probe() local
2487 ahw = kzalloc(sizeof(struct qlcnic_hardware_context), GFP_KERNEL); in qlcnic_probe()
2488 if (!ahw) { in qlcnic_probe()
2495 ahw->hw_ops = &qlcnic_hw_ops; in qlcnic_probe()
2496 ahw->reg_tbl = (u32 *) qlcnic_reg_tbl; in qlcnic_probe()
2501 qlcnic_83xx_register_map(ahw); in qlcnic_probe()
2506 qlcnic_sriov_vf_register_map(ahw); in qlcnic_probe()
2512 err = qlcnic_setup_pci_map(pdev, ahw); in qlcnic_probe()
2528 adapter->ahw = ahw; in qlcnic_probe()
2542 ahw->revision_id = pdev->revision; in qlcnic_probe()
2543 ahw->max_vnic_func = qlcnic_get_vnic_func_count(adapter); in qlcnic_probe()
2549 rwlock_init(&adapter->ahw->crb_lock); in qlcnic_probe()
2550 mutex_init(&adapter->ahw->mem_lock); in qlcnic_probe()
2558 adapter->portnum = adapter->ahw->pci_func; in qlcnic_probe()
2568 if (adapter->ahw->msix_supported) { in qlcnic_probe()
2590 adapter->portnum = adapter->ahw->pci_func; in qlcnic_probe()
2629 board_name, adapter->ahw->revision_id); in qlcnic_probe()
2665 switch (adapter->ahw->port_type) { in qlcnic_probe()
2702 qlcnic_cleanup_pci_map(ahw); in qlcnic_probe()
2705 kfree(ahw); in qlcnic_probe()
2718 ahw->port_type = QLCNIC_XGBE; in qlcnic_probe()
2723 ahw->board_type = QLCNIC_BRDTYPE_P3P_10G_SFP_PLUS; in qlcnic_probe()
2743 struct qlcnic_hardware_context *ahw; in qlcnic_remove() local
2753 ahw = adapter->ahw; in qlcnic_remove()
2763 qlcnic_83xx_free_mailbox(ahw->mailbox); in qlcnic_remove()
2764 kfree(ahw->fw_info); in qlcnic_remove()
2785 qlcnic_cleanup_pci_map(adapter->ahw); in qlcnic_remove()
2799 kfree(ahw); in qlcnic_remove()
2891 act_pci_func = adapter->ahw->total_nic_func; in qlcnic_alloc_lb_filters_mem()
2958 temp = QLCRDX(adapter->ahw, QLC_83XX_ASIC_TEMP); in qlcnic_check_temp()
2973 if (adapter->ahw->temp == QLCNIC_TEMP_NORMAL) { in qlcnic_check_temp()
2981 if (adapter->ahw->temp == QLCNIC_TEMP_WARN) { in qlcnic_check_temp()
2987 adapter->ahw->temp = temp_state; in qlcnic_check_temp()
3064 if (netif_msg_tx_err(adapter->ahw)) in qlcnic_dump_rings()
3080 netif_msg_tx_err(adapter->ahw)) { in qlcnic_tx_timeout()
3089 adapter->ahw->reset_context = 1; in qlcnic_tx_timeout()
3117 if (!(status & adapter->ahw->int_vec_bit)) in qlcnic_82xx_clear_legacy_intr()
3149 adapter->ahw->diag_cnt++; in qlcnic_tmp_intr()
3326 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_check_drv_state() local
3332 active_mask = (~(1 << (ahw->pci_func * 4))); in qlcnic_check_drv_state()
3464 if (adapter->ahw->op_mode == QLCNIC_NON_PRIV_FUNC) { in qlcnic_fwinit_work()
3582 if (adapter->ahw->temp == QLCNIC_TEMP_PANIC) { in qlcnic_detach_work()
3584 adapter->ahw->temp); in qlcnic_detach_work()
3702 if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) { in qlcnic_attach_work()
3741 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_check_health() local
3742 struct qlcnic_fw_dump *fw_dump = &ahw->fw_dump; in qlcnic_check_health()
3767 if (ahw->reset_context && qlcnic_auto_fw_reset) in qlcnic_check_health()
3878 if (adapter->ahw->op_mode != QLCNIC_NON_PRIV_FUNC && first_func) { in qlcnic_attach_func()
3976 struct qlcnic_hardware_ops *hw_ops = adapter->ahw->hw_ops; in qlcnic_io_error_detected()
3989 struct qlcnic_hardware_ops *hw_ops = adapter->ahw->hw_ops; in qlcnic_io_slot_reset()
4002 struct qlcnic_hardware_ops *hw_ops = adapter->ahw->hw_ops; in qlcnic_io_resume()