efx 122 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_rx_free_indir_table(struct efx_nic *efx); efx 123 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_table_remove(struct efx_nic *efx); efx 124 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_filter_add_vlan(struct efx_nic *efx, u16 vid); efx 125 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_del_vlan_internal(struct efx_nic *efx, efx 127 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_del_vlan(struct efx_nic *efx, u16 vid); efx 128 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_set_udp_tnl_ports(struct efx_nic *efx, bool unloading); efx 146 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_get_warm_boot_count(struct efx_nic *efx) efx 150 drivers/net/ethernet/sfc/ef10.c efx_readd(efx, ®, ER_DZ_BIU_MC_SFT_STATUS); efx 159 drivers/net/ethernet/sfc/ef10.c static unsigned int efx_ef10_pf_mem_bar(struct efx_nic *efx) efx 161 drivers/net/ethernet/sfc/ef10.c switch (efx->pci_dev->device) { efx 170 drivers/net/ethernet/sfc/ef10.c static unsigned int efx_ef10_vf_mem_bar(struct efx_nic *efx) efx 175 drivers/net/ethernet/sfc/ef10.c static unsigned int efx_ef10_mem_map_size(struct efx_nic *efx) efx 179 drivers/net/ethernet/sfc/ef10.c bar = efx->type->mem_bar(efx); efx 180 drivers/net/ethernet/sfc/ef10.c return resource_size(&efx->pci_dev->resource[bar]); efx 183 drivers/net/ethernet/sfc/ef10.c static bool efx_ef10_is_vf(struct efx_nic *efx) efx 185 drivers/net/ethernet/sfc/ef10.c return efx->type->is_vf; efx 188 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_get_pf_index(struct efx_nic *efx) efx 191 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 195 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_FUNCTION_INFO, NULL, 0, outbuf, efx 207 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_get_vf_index(struct efx_nic *efx) efx 210 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 214 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_FUNCTION_INFO, NULL, 0, outbuf, efx 226 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_init_datapath_caps(struct efx_nic *efx) efx 229 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 235 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_CAPABILITIES, NULL, 0, efx 240 drivers/net/ethernet/sfc/ef10.c netif_err(efx, drv, efx->net_dev, efx 267 drivers/net/ethernet/sfc/ef10.c netif_err(efx, probe, efx->net_dev, efx 278 drivers/net/ethernet/sfc/ef10.c efx->vi_stride = 8192; efx 281 drivers/net/ethernet/sfc/ef10.c efx->vi_stride = 16384; efx 284 drivers/net/ethernet/sfc/ef10.c efx->vi_stride = 65536; efx 287 drivers/net/ethernet/sfc/ef10.c netif_err(efx, probe, efx->net_dev, efx 292 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, "vi_stride = %u\n", efx 293 drivers/net/ethernet/sfc/ef10.c efx->vi_stride); efx 296 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 298 drivers/net/ethernet/sfc/ef10.c efx->vi_stride); efx 302 drivers/net/ethernet/sfc/ef10.c efx->num_mac_stats = MCDI_WORD(outbuf, efx 304 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 306 drivers/net/ethernet/sfc/ef10.c efx->num_mac_stats); efx 309 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 311 drivers/net/ethernet/sfc/ef10.c efx->num_mac_stats); efx 317 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_read_licensed_features(struct efx_nic *efx) efx 321 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 327 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_LICENSING_V3, inbuf, sizeof(inbuf), efx 336 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_get_sysclk_freq(struct efx_nic *efx) efx 341 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_CLOCK, NULL, 0, efx 349 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_get_timer_workarounds(struct efx_nic *efx) efx 351 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 359 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_get_workarounds(efx, &implemented, &enabled); efx 375 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_set_workaround(efx, efx 385 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 388 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 395 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_process_timer_config(struct efx_nic *efx, efx 400 drivers/net/ethernet/sfc/ef10.c if (EFX_EF10_WORKAROUND_61265(efx)) { efx 401 drivers/net/ethernet/sfc/ef10.c efx->timer_quantum_ns = MCDI_DWORD(data, efx 403 drivers/net/ethernet/sfc/ef10.c efx->timer_max_ns = MCDI_DWORD(data, efx 405 drivers/net/ethernet/sfc/ef10.c } else if (EFX_EF10_WORKAROUND_35388(efx)) { efx 406 drivers/net/ethernet/sfc/ef10.c efx->timer_quantum_ns = MCDI_DWORD(data, efx 410 drivers/net/ethernet/sfc/ef10.c efx->timer_max_ns = max_count * efx->timer_quantum_ns; efx 412 drivers/net/ethernet/sfc/ef10.c efx->timer_quantum_ns = MCDI_DWORD(data, efx 416 drivers/net/ethernet/sfc/ef10.c efx->timer_max_ns = max_count * efx->timer_quantum_ns; efx 419 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 421 drivers/net/ethernet/sfc/ef10.c efx->timer_quantum_ns, efx->timer_max_ns); efx 424 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_get_timer_config(struct efx_nic *efx) efx 429 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_get_timer_workarounds(efx); efx 433 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_GET_EVQ_TMR_PROPERTIES, NULL, 0, efx 437 drivers/net/ethernet/sfc/ef10.c efx_ef10_process_timer_config(efx, outbuf); efx 442 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_get_sysclk_freq(efx); efx 447 drivers/net/ethernet/sfc/ef10.c efx->timer_quantum_ns = quantum; efx 448 drivers/net/ethernet/sfc/ef10.c efx->timer_max_ns = efx->type->timer_period_max * quantum; efx 451 drivers/net/ethernet/sfc/ef10.c efx_mcdi_display_error(efx, MC_CMD_GET_EVQ_TMR_PROPERTIES, efx 459 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_get_mac_address_pf(struct efx_nic *efx, u8 *mac_address) efx 467 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_MAC_ADDRESSES, NULL, 0, efx 479 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_get_mac_address_vf(struct efx_nic *efx, u8 *mac_address) efx 488 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_VPORT_GET_MAC_ADDRESSES, inbuf, efx 511 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = dev_get_drvdata(dev); efx 514 drivers/net/ethernet/sfc/ef10.c ((efx->mcdi->fn_flags) & efx 523 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = dev_get_drvdata(dev); efx 526 drivers/net/ethernet/sfc/ef10.c ((efx->mcdi->fn_flags) & efx 531 drivers/net/ethernet/sfc/ef10.c static struct efx_ef10_vlan *efx_ef10_find_vlan(struct efx_nic *efx, u16 vid) efx 533 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 546 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_add_vlan(struct efx_nic *efx, u16 vid) efx 548 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 554 drivers/net/ethernet/sfc/ef10.c vlan = efx_ef10_find_vlan(efx, vid); efx 561 drivers/net/ethernet/sfc/ef10.c netif_warn(efx, drv, efx->net_dev, efx 576 drivers/net/ethernet/sfc/ef10.c if (efx->filter_state) { efx 577 drivers/net/ethernet/sfc/ef10.c mutex_lock(&efx->mac_lock); efx 578 drivers/net/ethernet/sfc/ef10.c down_write(&efx->filter_sem); efx 579 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_add_vlan(efx, vlan->vid); efx 580 drivers/net/ethernet/sfc/ef10.c up_write(&efx->filter_sem); efx 581 drivers/net/ethernet/sfc/ef10.c mutex_unlock(&efx->mac_lock); efx 599 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_del_vlan_internal(struct efx_nic *efx, efx 602 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 606 drivers/net/ethernet/sfc/ef10.c if (efx->filter_state) { efx 607 drivers/net/ethernet/sfc/ef10.c down_write(&efx->filter_sem); efx 608 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_del_vlan(efx, vlan->vid); efx 609 drivers/net/ethernet/sfc/ef10.c up_write(&efx->filter_sem); efx 616 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_del_vlan(struct efx_nic *efx, u16 vid) efx 618 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 631 drivers/net/ethernet/sfc/ef10.c vlan = efx_ef10_find_vlan(efx, vid); efx 633 drivers/net/ethernet/sfc/ef10.c netif_err(efx, drv, efx->net_dev, efx 637 drivers/net/ethernet/sfc/ef10.c efx_ef10_del_vlan_internal(efx, vlan); efx 645 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_cleanup_vlans(struct efx_nic *efx) efx 647 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 652 drivers/net/ethernet/sfc/ef10.c efx_ef10_del_vlan_internal(efx, vlan); efx 660 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_probe(struct efx_nic *efx) efx 668 drivers/net/ethernet/sfc/ef10.c efx->nic_data = nic_data; efx 673 drivers/net/ethernet/sfc/ef10.c rc = efx_nic_alloc_buffer(efx, &nic_data->mcdi_buf, efx 683 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_get_warm_boot_count(efx); efx 692 drivers/net/ethernet/sfc/ef10.c efx->rss_context.context_id = EFX_EF10_RSS_CONTEXT_INVALID; efx 701 drivers/net/ethernet/sfc/ef10.c _efx_writed(efx, cpu_to_le32(1), ER_DZ_MC_DB_HWRD); efx 703 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_init(efx); efx 710 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_reset(efx, RESET_TYPE_ALL); efx 715 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_log_ctrl(efx, true, false, 0); efx 719 drivers/net/ethernet/sfc/ef10.c rc = device_create_file(&efx->pci_dev->dev, efx 724 drivers/net/ethernet/sfc/ef10.c rc = device_create_file(&efx->pci_dev->dev, &dev_attr_primary_flag); efx 728 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_get_pf_index(efx); efx 732 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_init_datapath_caps(efx); efx 736 drivers/net/ethernet/sfc/ef10.c efx_ef10_read_licensed_features(efx); efx 742 drivers/net/ethernet/sfc/ef10.c efx->max_channels = min_t(unsigned int, efx 744 drivers/net/ethernet/sfc/ef10.c efx_ef10_mem_map_size(efx) / efx 745 drivers/net/ethernet/sfc/ef10.c (efx->vi_stride * EFX_TXQ_TYPES)); efx 746 drivers/net/ethernet/sfc/ef10.c efx->max_tx_channels = efx->max_channels; efx 747 drivers/net/ethernet/sfc/ef10.c if (WARN_ON(efx->max_channels == 0)) { efx 752 drivers/net/ethernet/sfc/ef10.c efx->rx_packet_len_offset = efx 757 drivers/net/ethernet/sfc/ef10.c efx->net_dev->hw_features |= NETIF_F_RXFCS; efx 759 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_port_get_number(efx); efx 762 drivers/net/ethernet/sfc/ef10.c efx->port_num = rc; efx 764 drivers/net/ethernet/sfc/ef10.c rc = efx->type->get_mac_address(efx, efx->net_dev->perm_addr); efx 768 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_get_timer_config(efx); efx 772 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_mon_probe(efx); efx 776 drivers/net/ethernet/sfc/ef10.c efx_ptp_defer_probe_with_channel(efx); efx 779 drivers/net/ethernet/sfc/ef10.c if ((efx->pci_dev->physfn) && (!efx->pci_dev->is_physfn)) { efx 780 drivers/net/ethernet/sfc/ef10.c struct pci_dev *pci_dev_pf = efx->pci_dev->physfn; efx 786 drivers/net/ethernet/sfc/ef10.c ether_addr_copy(nic_data->port_id, efx->net_dev->perm_addr); efx 792 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_add_vlan(efx, EFX_FILTER_VID_UNSPEC); efx 800 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_add_vlan(efx, 0); efx 807 drivers/net/ethernet/sfc/ef10.c efx_ef10_cleanup_vlans(efx); efx 810 drivers/net/ethernet/sfc/ef10.c efx_ptp_remove(efx); efx 811 drivers/net/ethernet/sfc/ef10.c efx_mcdi_mon_remove(efx); efx 813 drivers/net/ethernet/sfc/ef10.c device_remove_file(&efx->pci_dev->dev, &dev_attr_primary_flag); efx 815 drivers/net/ethernet/sfc/ef10.c device_remove_file(&efx->pci_dev->dev, &dev_attr_link_control_flag); efx 817 drivers/net/ethernet/sfc/ef10.c efx_mcdi_detach(efx); efx 821 drivers/net/ethernet/sfc/ef10.c (void)efx_ef10_set_udp_tnl_ports(efx, true); efx 825 drivers/net/ethernet/sfc/ef10.c efx_mcdi_fini(efx); efx 827 drivers/net/ethernet/sfc/ef10.c efx_nic_free_buffer(efx, &nic_data->mcdi_buf); efx 830 drivers/net/ethernet/sfc/ef10.c efx->nic_data = NULL; efx 834 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_free_vis(struct efx_nic *efx) efx 838 drivers/net/ethernet/sfc/ef10.c int rc = efx_mcdi_rpc_quiet(efx, MC_CMD_FREE_VIS, NULL, 0, efx 845 drivers/net/ethernet/sfc/ef10.c efx_mcdi_display_error(efx, MC_CMD_FREE_VIS, 0, outbuf, outlen, efx 852 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_free_piobufs(struct efx_nic *efx) efx 854 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 864 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_FREE_PIOBUF, inbuf, sizeof(inbuf), efx 872 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_alloc_piobufs(struct efx_nic *efx, unsigned int n) efx 874 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 883 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_ALLOC_PIOBUF, NULL, 0, efx 889 drivers/net/ethernet/sfc/ef10.c if (!(efx_ef10_is_vf(efx) && rc == -ENOSPC)) efx 890 drivers/net/ethernet/sfc/ef10.c efx_mcdi_display_error(efx, MC_CMD_ALLOC_PIOBUF, efx 900 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 907 drivers/net/ethernet/sfc/ef10.c efx_ef10_free_piobufs(efx); efx 911 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_link_piobufs(struct efx_nic *efx) efx 913 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 929 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_LINK_PIOBUF, efx 933 drivers/net/ethernet/sfc/ef10.c netif_err(efx, drv, efx->net_dev, efx 939 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 945 drivers/net/ethernet/sfc/ef10.c efx_for_each_channel(channel, efx) { efx 956 drivers/net/ethernet/sfc/ef10.c offset = ((efx->tx_channel_offset + efx->n_tx_channels - efx 977 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_LINK_PIOBUF, efx 986 drivers/net/ethernet/sfc/ef10.c netif_err(efx, drv, efx->net_dev, efx 993 drivers/net/ethernet/sfc/ef10.c index * efx->vi_stride + offset; efx 995 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 1014 drivers/net/ethernet/sfc/ef10.c efx_mcdi_rpc(efx, MC_CMD_UNLINK_PIOBUF, efx 1021 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_forget_old_piobufs(struct efx_nic *efx) efx 1027 drivers/net/ethernet/sfc/ef10.c efx_for_each_channel(channel, efx) efx 1034 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_alloc_piobufs(struct efx_nic *efx, unsigned int n) efx 1039 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_link_piobufs(struct efx_nic *efx) efx 1044 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_free_piobufs(struct efx_nic *efx) efx 1048 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_forget_old_piobufs(struct efx_nic *efx) efx 1054 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_remove(struct efx_nic *efx) efx 1056 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1065 drivers/net/ethernet/sfc/ef10.c if (efx->pci_dev->is_virtfn) { efx 1066 drivers/net/ethernet/sfc/ef10.c pci_dev_pf = efx->pci_dev->physfn; efx 1071 drivers/net/ethernet/sfc/ef10.c vf->efx = NULL; efx 1073 drivers/net/ethernet/sfc/ef10.c netif_info(efx, drv, efx->net_dev, efx 1078 drivers/net/ethernet/sfc/ef10.c efx_ef10_cleanup_vlans(efx); efx 1081 drivers/net/ethernet/sfc/ef10.c efx_ptp_remove(efx); efx 1083 drivers/net/ethernet/sfc/ef10.c efx_mcdi_mon_remove(efx); efx 1085 drivers/net/ethernet/sfc/ef10.c efx_ef10_rx_free_indir_table(efx); efx 1090 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_free_vis(efx); efx 1094 drivers/net/ethernet/sfc/ef10.c efx_ef10_free_piobufs(efx); efx 1096 drivers/net/ethernet/sfc/ef10.c device_remove_file(&efx->pci_dev->dev, &dev_attr_primary_flag); efx 1097 drivers/net/ethernet/sfc/ef10.c device_remove_file(&efx->pci_dev->dev, &dev_attr_link_control_flag); efx 1099 drivers/net/ethernet/sfc/ef10.c efx_mcdi_detach(efx); efx 1103 drivers/net/ethernet/sfc/ef10.c (void)efx_ef10_set_udp_tnl_ports(efx, true); efx 1108 drivers/net/ethernet/sfc/ef10.c efx_mcdi_fini(efx); efx 1109 drivers/net/ethernet/sfc/ef10.c efx_nic_free_buffer(efx, &nic_data->mcdi_buf); efx 1113 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_probe_pf(struct efx_nic *efx) efx 1115 drivers/net/ethernet/sfc/ef10.c return efx_ef10_probe(efx); efx 1118 drivers/net/ethernet/sfc/ef10.c int efx_ef10_vadaptor_query(struct efx_nic *efx, unsigned int port_id, efx 1122 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1133 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_VADAPTOR_QUERY, inbuf, sizeof(inbuf), efx 1157 drivers/net/ethernet/sfc/ef10.c int efx_ef10_vadaptor_alloc(struct efx_nic *efx, unsigned int port_id) efx 1162 drivers/net/ethernet/sfc/ef10.c return efx_mcdi_rpc(efx, MC_CMD_VADAPTOR_ALLOC, inbuf, sizeof(inbuf), efx 1166 drivers/net/ethernet/sfc/ef10.c int efx_ef10_vadaptor_free(struct efx_nic *efx, unsigned int port_id) efx 1171 drivers/net/ethernet/sfc/ef10.c return efx_mcdi_rpc(efx, MC_CMD_VADAPTOR_FREE, inbuf, sizeof(inbuf), efx 1175 drivers/net/ethernet/sfc/ef10.c int efx_ef10_vport_add_mac(struct efx_nic *efx, efx 1183 drivers/net/ethernet/sfc/ef10.c return efx_mcdi_rpc(efx, MC_CMD_VPORT_ADD_MAC_ADDRESS, inbuf, efx 1187 drivers/net/ethernet/sfc/ef10.c int efx_ef10_vport_del_mac(struct efx_nic *efx, efx 1195 drivers/net/ethernet/sfc/ef10.c return efx_mcdi_rpc(efx, MC_CMD_VPORT_DEL_MAC_ADDRESS, inbuf, efx 1200 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_probe_vf(struct efx_nic *efx) efx 1209 drivers/net/ethernet/sfc/ef10.c pci_dev_pf = efx->pci_dev->physfn; efx 1215 drivers/net/ethernet/sfc/ef10.c netif_info(efx, drv, efx->net_dev, efx 1222 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_probe(efx); efx 1226 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_get_vf_index(efx); efx 1230 drivers/net/ethernet/sfc/ef10.c if (efx->pci_dev->is_virtfn) { efx 1231 drivers/net/ethernet/sfc/ef10.c if (efx->pci_dev->physfn) { efx 1233 drivers/net/ethernet/sfc/ef10.c pci_get_drvdata(efx->pci_dev->physfn); efx 1235 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1237 drivers/net/ethernet/sfc/ef10.c nic_data_p->vf[nic_data->vf_index].efx = efx; efx 1239 drivers/net/ethernet/sfc/ef10.c efx->pci_dev; efx 1241 drivers/net/ethernet/sfc/ef10.c netif_info(efx, drv, efx->net_dev, efx 1248 drivers/net/ethernet/sfc/ef10.c efx_ef10_remove(efx); efx 1252 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_probe_vf(struct efx_nic *efx __attribute__ ((unused))) efx 1258 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_alloc_vis(struct efx_nic *efx, efx 1263 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1269 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_ALLOC_VIS, inbuf, sizeof(inbuf), efx 1277 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, "base VI is A0x%03x\n", efx 1288 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_dimension_resources(struct efx_nic *efx) efx 1290 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1298 drivers/net/ethernet/sfc/ef10.c channel_vis = max(efx->n_channels, efx 1299 drivers/net/ethernet/sfc/ef10.c (efx->n_tx_channels + efx->n_extra_tx_channels) * efx 1311 drivers/net/ethernet/sfc/ef10.c efx->n_tx_channels) { efx 1313 drivers/net/ethernet/sfc/ef10.c DIV_ROUND_UP(efx->n_tx_channels, efx 1316 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_alloc_piobufs(efx, n_piobufs); efx 1318 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 1321 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 1324 drivers/net/ethernet/sfc/ef10.c netif_err(efx, probe, efx->net_dev, efx 1327 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 1344 drivers/net/ethernet/sfc/ef10.c uc_mem_map_size = PAGE_ALIGN((channel_vis - 1) * efx->vi_stride + efx 1350 drivers/net/ethernet/sfc/ef10.c pio_write_vi_base = uc_mem_map_size / efx->vi_stride; efx 1353 drivers/net/ethernet/sfc/ef10.c efx->vi_stride) - efx 1363 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_free_vis(efx); efx 1367 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_alloc_vis(efx, min_vis, max_vis); efx 1372 drivers/net/ethernet/sfc/ef10.c netif_info(efx, drv, efx->net_dev, efx 1380 drivers/net/ethernet/sfc/ef10.c efx->max_channels = nic_data->n_allocated_vis; efx 1381 drivers/net/ethernet/sfc/ef10.c efx->max_tx_channels = efx 1384 drivers/net/ethernet/sfc/ef10.c efx_ef10_free_vis(efx); efx 1394 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 1397 drivers/net/ethernet/sfc/ef10.c efx_ef10_free_piobufs(efx); efx 1401 drivers/net/ethernet/sfc/ef10.c membase = ioremap_nocache(efx->membase_phys, uc_mem_map_size); efx 1403 drivers/net/ethernet/sfc/ef10.c netif_err(efx, probe, efx->net_dev, efx 1408 drivers/net/ethernet/sfc/ef10.c iounmap(efx->membase); efx 1409 drivers/net/ethernet/sfc/ef10.c efx->membase = membase; efx 1413 drivers/net/ethernet/sfc/ef10.c nic_data->wc_membase = ioremap_wc(efx->membase_phys + efx 1417 drivers/net/ethernet/sfc/ef10.c netif_err(efx, probe, efx->net_dev, efx 1425 drivers/net/ethernet/sfc/ef10.c (pio_write_vi_base * efx->vi_stride + ER_DZ_TX_PIOBUF - efx 1428 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_link_piobufs(efx); efx 1430 drivers/net/ethernet/sfc/ef10.c efx_ef10_free_piobufs(efx); efx 1433 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 1435 drivers/net/ethernet/sfc/ef10.c &efx->membase_phys, efx->membase, uc_mem_map_size, efx 1441 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_init_nic(struct efx_nic *efx) efx 1443 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1447 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_init_datapath_caps(efx); efx 1455 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_alloc_vis(efx, nic_data->n_allocated_vis, efx 1463 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_alloc_piobufs(efx, nic_data->n_piobufs); efx 1465 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_link_piobufs(efx); efx 1467 drivers/net/ethernet/sfc/ef10.c efx_ef10_free_piobufs(efx); efx 1475 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, efx 1478 drivers/net/ethernet/sfc/ef10.c netif_err(efx, drv, efx->net_dev, efx 1484 drivers/net/ethernet/sfc/ef10.c rc = efx->type->rx_push_rss_config(efx, false, efx 1485 drivers/net/ethernet/sfc/ef10.c efx->rss_context.rx_indir_table, NULL); efx 1490 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_reset_mc_allocations(struct efx_nic *efx) efx 1492 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1502 drivers/net/ethernet/sfc/ef10.c efx_ef10_forget_old_piobufs(efx); efx 1503 drivers/net/ethernet/sfc/ef10.c efx->rss_context.context_id = EFX_EF10_RSS_CONTEXT_INVALID; efx 1510 drivers/net/ethernet/sfc/ef10.c for (i = 0; i < efx->vf_count; i++) efx 1553 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_reset(struct efx_nic *efx, enum reset_type reset_type) efx 1555 drivers/net/ethernet/sfc/ef10.c int rc = efx_mcdi_reset(efx, reset_type); efx 1571 drivers/net/ethernet/sfc/ef10.c efx_ef10_reset_mc_allocations(efx); efx 1793 drivers/net/ethernet/sfc/ef10.c static u64 efx_ef10_raw_stat_mask(struct efx_nic *efx) efx 1796 drivers/net/ethernet/sfc/ef10.c u32 port_caps = efx_mcdi_phy_get_caps(efx); efx 1797 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1799 drivers/net/ethernet/sfc/ef10.c if (!(efx->mcdi->fn_flags & efx 1820 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_get_stat_mask(struct efx_nic *efx, unsigned long *mask) efx 1822 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1825 drivers/net/ethernet/sfc/ef10.c raw_mask[0] = efx_ef10_raw_stat_mask(efx); efx 1836 drivers/net/ethernet/sfc/ef10.c if (efx->num_mac_stats >= MC_CMD_MAC_NSTATS_V2) efx 1843 drivers/net/ethernet/sfc/ef10.c if (efx->num_mac_stats >= MC_CMD_MAC_NSTATS_V3 && efx 1860 drivers/net/ethernet/sfc/ef10.c static size_t efx_ef10_describe_stats(struct efx_nic *efx, u8 *names) efx 1864 drivers/net/ethernet/sfc/ef10.c efx_ef10_get_stat_mask(efx, mask); efx 1869 drivers/net/ethernet/sfc/ef10.c static size_t efx_ef10_update_stats_common(struct efx_nic *efx, u64 *full_stats, efx 1873 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1877 drivers/net/ethernet/sfc/ef10.c efx_ef10_get_stat_mask(efx, mask); efx 1938 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_try_update_nic_stats_pf(struct efx_nic *efx) efx 1940 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1946 drivers/net/ethernet/sfc/ef10.c efx_ef10_get_stat_mask(efx, mask); efx 1948 drivers/net/ethernet/sfc/ef10.c dma_stats = efx->stats_buffer.addr; efx 1950 drivers/net/ethernet/sfc/ef10.c generation_end = dma_stats[efx->num_mac_stats - 1]; efx 1955 drivers/net/ethernet/sfc/ef10.c stats, efx->stats_buffer.addr, false); efx 1962 drivers/net/ethernet/sfc/ef10.c efx_nic_fix_nodesc_drop_stat(efx, efx 1969 drivers/net/ethernet/sfc/ef10.c efx_update_sw_stats(efx, stats); efx 1974 drivers/net/ethernet/sfc/ef10.c static size_t efx_ef10_update_stats_pf(struct efx_nic *efx, u64 *full_stats, efx 1983 drivers/net/ethernet/sfc/ef10.c if (efx_ef10_try_update_nic_stats_pf(efx) == 0) efx 1988 drivers/net/ethernet/sfc/ef10.c return efx_ef10_update_stats_common(efx, full_stats, core_stats); efx 1991 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_try_update_nic_stats_vf(struct efx_nic *efx) efx 1994 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1998 drivers/net/ethernet/sfc/ef10.c u32 dma_len = efx->num_mac_stats * sizeof(u64); efx 2003 drivers/net/ethernet/sfc/ef10.c spin_unlock_bh(&efx->stats_lock); efx 2009 drivers/net/ethernet/sfc/ef10.c spin_lock_bh(&efx->stats_lock); efx 2010 drivers/net/ethernet/sfc/ef10.c efx_update_sw_stats(efx, stats); efx 2014 drivers/net/ethernet/sfc/ef10.c efx_ef10_get_stat_mask(efx, mask); efx 2016 drivers/net/ethernet/sfc/ef10.c rc = efx_nic_alloc_buffer(efx, &stats_buf, dma_len, GFP_ATOMIC); efx 2018 drivers/net/ethernet/sfc/ef10.c spin_lock_bh(&efx->stats_lock); efx 2023 drivers/net/ethernet/sfc/ef10.c dma_stats[efx->num_mac_stats - 1] = EFX_MC_STATS_GENERATION_INVALID; efx 2031 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_MAC_STATS, inbuf, sizeof(inbuf), efx 2033 drivers/net/ethernet/sfc/ef10.c spin_lock_bh(&efx->stats_lock); efx 2036 drivers/net/ethernet/sfc/ef10.c if (rc != -ENOENT || atomic_read(&efx->active_queues)) efx 2037 drivers/net/ethernet/sfc/ef10.c efx_mcdi_display_error(efx, MC_CMD_MAC_STATS, efx 2042 drivers/net/ethernet/sfc/ef10.c generation_end = dma_stats[efx->num_mac_stats - 1]; efx 2057 drivers/net/ethernet/sfc/ef10.c efx_update_sw_stats(efx, stats); efx 2059 drivers/net/ethernet/sfc/ef10.c efx_nic_free_buffer(efx, &stats_buf); efx 2063 drivers/net/ethernet/sfc/ef10.c static size_t efx_ef10_update_stats_vf(struct efx_nic *efx, u64 *full_stats, efx 2066 drivers/net/ethernet/sfc/ef10.c if (efx_ef10_try_update_nic_stats_vf(efx)) efx 2069 drivers/net/ethernet/sfc/ef10.c return efx_ef10_update_stats_common(efx, full_stats, core_stats); efx 2074 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = channel->efx; efx 2086 drivers/net/ethernet/sfc/ef10.c if (EFX_EF10_WORKAROUND_61265(efx)) { efx 2096 drivers/net/ethernet/sfc/ef10.c efx_mcdi_rpc_async(efx, MC_CMD_SET_EVQ_TMR, efx 2098 drivers/net/ethernet/sfc/ef10.c } else if (EFX_EF10_WORKAROUND_35388(efx)) { efx 2099 drivers/net/ethernet/sfc/ef10.c unsigned int ticks = efx_usecs_to_ticks(efx, usecs); efx 2105 drivers/net/ethernet/sfc/ef10.c efx_writed_page(efx, &timer_cmd, ER_DD_EVQ_INDIRECT, efx 2108 drivers/net/ethernet/sfc/ef10.c unsigned int ticks = efx_usecs_to_ticks(efx, usecs); efx 2113 drivers/net/ethernet/sfc/ef10.c efx_writed_page(efx, &timer_cmd, ER_DZ_EVQ_TMR, efx 2118 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_get_wol_vf(struct efx_nic *efx, efx 2121 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_set_wol_vf(struct efx_nic *efx, u32 type) efx 2126 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_get_wol(struct efx_nic *efx, struct ethtool_wolinfo *wol) efx 2133 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_set_wol(struct efx_nic *efx, u32 type) efx 2140 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_mcdi_request(struct efx_nic *efx, efx 2144 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 2157 drivers/net/ethernet/sfc/ef10.c _efx_writed(efx, cpu_to_le32((u64)nic_data->mcdi_buf.dma_addr >> 32), efx 2159 drivers/net/ethernet/sfc/ef10.c _efx_writed(efx, cpu_to_le32((u32)nic_data->mcdi_buf.dma_addr), efx 2163 drivers/net/ethernet/sfc/ef10.c static bool efx_ef10_mcdi_poll_response(struct efx_nic *efx) efx 2165 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 2173 drivers/net/ethernet/sfc/ef10.c efx_ef10_mcdi_read_response(struct efx_nic *efx, efx_dword_t *outbuf, efx 2176 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 2182 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_mcdi_reboot_detected(struct efx_nic *efx) efx 2184 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 2187 drivers/net/ethernet/sfc/ef10.c efx_ef10_reset_mc_allocations(efx); efx 2198 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_mcdi_poll_reboot(struct efx_nic *efx) efx 2200 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 2203 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_get_warm_boot_count(efx); efx 2217 drivers/net/ethernet/sfc/ef10.c efx_ef10_mcdi_reboot_detected(efx); efx 2232 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = context->efx; efx 2234 drivers/net/ethernet/sfc/ef10.c netif_vdbg(efx, intr, efx->net_dev, efx 2237 drivers/net/ethernet/sfc/ef10.c if (likely(READ_ONCE(efx->irq_soft_enabled))) { efx 2239 drivers/net/ethernet/sfc/ef10.c if (context->index == efx->irq_level) efx 2240 drivers/net/ethernet/sfc/ef10.c efx->last_irq_cpu = raw_smp_processor_id(); efx 2243 drivers/net/ethernet/sfc/ef10.c efx_schedule_channel_irq(efx->channel[context->index]); efx 2251 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = dev_id; efx 2252 drivers/net/ethernet/sfc/ef10.c bool soft_enabled = READ_ONCE(efx->irq_soft_enabled); efx 2258 drivers/net/ethernet/sfc/ef10.c efx_readd(efx, ®, ER_DZ_BIU_INT_ISR); efx 2266 drivers/net/ethernet/sfc/ef10.c if (queues & (1U << efx->irq_level)) efx 2267 drivers/net/ethernet/sfc/ef10.c efx->last_irq_cpu = raw_smp_processor_id(); efx 2269 drivers/net/ethernet/sfc/ef10.c efx_for_each_channel(channel, efx) { efx 2276 drivers/net/ethernet/sfc/ef10.c netif_vdbg(efx, intr, efx->net_dev, efx 2283 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_irq_test_generate(struct efx_nic *efx) efx 2287 drivers/net/ethernet/sfc/ef10.c if (efx_mcdi_set_workaround(efx, MC_CMD_WORKAROUND_BUG41750, true, efx 2293 drivers/net/ethernet/sfc/ef10.c MCDI_SET_DWORD(inbuf, TRIGGER_INTERRUPT_IN_INTR_LEVEL, efx->irq_level); efx 2294 drivers/net/ethernet/sfc/ef10.c return efx_mcdi_rpc(efx, MC_CMD_TRIGGER_INTERRUPT, efx 2300 drivers/net/ethernet/sfc/ef10.c return efx_nic_alloc_buffer(tx_queue->efx, &tx_queue->txd.buf, efx 2316 drivers/net/ethernet/sfc/ef10.c efx_writeo_page(tx_queue->efx, ®, efx 2392 drivers/net/ethernet/sfc/ef10.c static u32 efx_ef10_tso_versions(struct efx_nic *efx) efx 2394 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 2413 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = tx_queue->efx; efx 2414 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 2430 drivers/net/ethernet/sfc/ef10.c if (efx->type->ptp_set_ts_sync_events) efx 2431 drivers/net/ethernet/sfc/ef10.c efx->type->ptp_set_ts_sync_events(efx, false, false); efx 2443 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, hw, efx->net_dev, "Using TSOv2 for channel %u\n", efx 2456 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, hw, efx->net_dev, "pushing TXQ %d. %zu entries (%llx)\n", efx 2478 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_INIT_TXQ, inbuf, inlen, efx 2483 drivers/net/ethernet/sfc/ef10.c netif_warn(efx, probe, efx->net_dev, efx 2486 drivers/net/ethernet/sfc/ef10.c efx_mcdi_display_error(efx, MC_CMD_INIT_TXQ, efx 2525 drivers/net/ethernet/sfc/ef10.c netdev_WARN(efx->net_dev, "failed to initialise TXQ %d\n", efx 2533 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = tx_queue->efx; efx 2540 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_FINI_TXQ, inbuf, sizeof(inbuf), efx 2549 drivers/net/ethernet/sfc/ef10.c efx_mcdi_display_error(efx, MC_CMD_FINI_TXQ, MC_CMD_FINI_TXQ_IN_LEN, efx 2555 drivers/net/ethernet/sfc/ef10.c efx_nic_free_buffer(tx_queue->efx, &tx_queue->txd.buf); efx 2566 drivers/net/ethernet/sfc/ef10.c efx_writed_page(tx_queue->efx, ®, efx 2651 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_get_rss_flags(struct efx_nic *efx, u32 context, u32 *flags) efx 2680 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_GET_FLAGS, inbuf, efx 2697 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_set_rss_flags(struct efx_nic *efx, efx 2705 drivers/net/ethernet/sfc/ef10.c if (efx_ef10_get_rss_flags(efx, ctx->context_id, &flags) != 0) efx 2712 drivers/net/ethernet/sfc/ef10.c if (!efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_SET_FLAGS, inbuf, sizeof(inbuf), efx 2718 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_alloc_rss_context(struct efx_nic *efx, bool exclusive, efx 2724 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 2731 drivers/net/ethernet/sfc/ef10.c efx->rss_spread : efx 2732 drivers/net/ethernet/sfc/ef10.c min(rounddown_pow_of_two(efx->rss_spread), efx 2751 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_ALLOC, inbuf, sizeof(inbuf), efx 2766 drivers/net/ethernet/sfc/ef10.c efx_ef10_set_rss_flags(efx, ctx); efx 2771 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_free_rss_context(struct efx_nic *efx, u32 context) efx 2777 drivers/net/ethernet/sfc/ef10.c return efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_FREE, inbuf, sizeof(inbuf), efx 2781 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_populate_rss_table(struct efx_nic *efx, u32 context, efx 2790 drivers/net/ethernet/sfc/ef10.c BUILD_BUG_ON(ARRAY_SIZE(efx->rss_context.rx_indir_table) != efx 2798 drivers/net/ethernet/sfc/ef10.c for (i = 0; i < ARRAY_SIZE(efx->rss_context.rx_indir_table); ++i) efx 2803 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_SET_TABLE, tablebuf, efx 2810 drivers/net/ethernet/sfc/ef10.c BUILD_BUG_ON(ARRAY_SIZE(efx->rss_context.rx_hash_key) != efx 2812 drivers/net/ethernet/sfc/ef10.c for (i = 0; i < ARRAY_SIZE(efx->rss_context.rx_hash_key); ++i) efx 2815 drivers/net/ethernet/sfc/ef10.c return efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_SET_KEY, keybuf, efx 2819 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_rx_free_indir_table(struct efx_nic *efx) efx 2823 drivers/net/ethernet/sfc/ef10.c if (efx->rss_context.context_id != EFX_EF10_RSS_CONTEXT_INVALID) { efx 2824 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_free_rss_context(efx, efx->rss_context.context_id); efx 2827 drivers/net/ethernet/sfc/ef10.c efx->rss_context.context_id = EFX_EF10_RSS_CONTEXT_INVALID; efx 2830 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_rx_push_shared_rss_config(struct efx_nic *efx, efx 2833 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 2834 drivers/net/ethernet/sfc/ef10.c int rc = efx_ef10_alloc_rss_context(efx, false, &efx->rss_context, efx 2841 drivers/net/ethernet/sfc/ef10.c efx_set_default_rx_indir_table(efx, &efx->rss_context); efx 2845 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_rx_push_exclusive_rss_config(struct efx_nic *efx, efx 2849 drivers/net/ethernet/sfc/ef10.c u32 old_rx_rss_context = efx->rss_context.context_id; efx 2850 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 2853 drivers/net/ethernet/sfc/ef10.c if (efx->rss_context.context_id == EFX_EF10_RSS_CONTEXT_INVALID || efx 2855 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_alloc_rss_context(efx, true, &efx->rss_context, efx 2863 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_populate_rss_table(efx, efx->rss_context.context_id, efx 2868 drivers/net/ethernet/sfc/ef10.c if (efx->rss_context.context_id != old_rx_rss_context && efx 2870 drivers/net/ethernet/sfc/ef10.c WARN_ON(efx_ef10_free_rss_context(efx, old_rx_rss_context) != 0); efx 2872 drivers/net/ethernet/sfc/ef10.c if (rx_indir_table != efx->rss_context.rx_indir_table) efx 2873 drivers/net/ethernet/sfc/ef10.c memcpy(efx->rss_context.rx_indir_table, rx_indir_table, efx 2874 drivers/net/ethernet/sfc/ef10.c sizeof(efx->rss_context.rx_indir_table)); efx 2875 drivers/net/ethernet/sfc/ef10.c if (key != efx->rss_context.rx_hash_key) efx 2876 drivers/net/ethernet/sfc/ef10.c memcpy(efx->rss_context.rx_hash_key, key, efx 2877 drivers/net/ethernet/sfc/ef10.c efx->type->rx_hash_key_size); efx 2882 drivers/net/ethernet/sfc/ef10.c if (old_rx_rss_context != efx->rss_context.context_id) { efx 2883 drivers/net/ethernet/sfc/ef10.c WARN_ON(efx_ef10_free_rss_context(efx, efx->rss_context.context_id) != 0); efx 2884 drivers/net/ethernet/sfc/ef10.c efx->rss_context.context_id = old_rx_rss_context; efx 2887 drivers/net/ethernet/sfc/ef10.c netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); efx 2891 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_rx_push_rss_context_config(struct efx_nic *efx, efx 2898 drivers/net/ethernet/sfc/ef10.c WARN_ON(!mutex_is_locked(&efx->rss_lock)); efx 2901 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_alloc_rss_context(efx, true, ctx, NULL); efx 2907 drivers/net/ethernet/sfc/ef10.c return efx_ef10_free_rss_context(efx, ctx->context_id); efx 2909 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_populate_rss_table(efx, ctx->context_id, efx 2915 drivers/net/ethernet/sfc/ef10.c sizeof(efx->rss_context.rx_indir_table)); efx 2916 drivers/net/ethernet/sfc/ef10.c memcpy(ctx->rx_hash_key, key, efx->type->rx_hash_key_size); efx 2921 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_rx_pull_rss_context_config(struct efx_nic *efx, efx 2930 drivers/net/ethernet/sfc/ef10.c WARN_ON(!mutex_is_locked(&efx->rss_lock)); efx 2942 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_GET_TABLE, inbuf, sizeof(inbuf), efx 2958 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_GET_KEY, inbuf, sizeof(inbuf), efx 2973 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_rx_pull_rss_config(struct efx_nic *efx) efx 2977 drivers/net/ethernet/sfc/ef10.c mutex_lock(&efx->rss_lock); efx 2978 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_rx_pull_rss_context_config(efx, &efx->rss_context); efx 2979 drivers/net/ethernet/sfc/ef10.c mutex_unlock(&efx->rss_lock); efx 2983 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_rx_restore_rss_contexts(struct efx_nic *efx) efx 2985 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 2989 drivers/net/ethernet/sfc/ef10.c WARN_ON(!mutex_is_locked(&efx->rss_lock)); efx 2994 drivers/net/ethernet/sfc/ef10.c list_for_each_entry(ctx, &efx->rss_context.list, list) { efx 2998 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_rx_push_rss_context_config(efx, ctx, efx 3002 drivers/net/ethernet/sfc/ef10.c netif_warn(efx, probe, efx->net_dev, efx 3010 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_pf_rx_push_rss_config(struct efx_nic *efx, bool user, efx 3016 drivers/net/ethernet/sfc/ef10.c if (efx->rss_spread == 1) efx 3020 drivers/net/ethernet/sfc/ef10.c key = efx->rss_context.rx_hash_key; efx 3022 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_rx_push_exclusive_rss_config(efx, rx_indir_table, key); efx 3030 drivers/net/ethernet/sfc/ef10.c i < ARRAY_SIZE(efx->rss_context.rx_indir_table) && !mismatch; efx 3033 drivers/net/ethernet/sfc/ef10.c ethtool_rxfh_indir_default(i, efx->rss_spread); efx 3035 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_rx_push_shared_rss_config(efx, &context_size); efx 3037 drivers/net/ethernet/sfc/ef10.c if (context_size != efx->rss_spread) efx 3038 drivers/net/ethernet/sfc/ef10.c netif_warn(efx, probe, efx->net_dev, efx 3043 drivers/net/ethernet/sfc/ef10.c efx->rss_spread, context_size); efx 3045 drivers/net/ethernet/sfc/ef10.c netif_warn(efx, probe, efx->net_dev, efx 3051 drivers/net/ethernet/sfc/ef10.c netif_info(efx, probe, efx->net_dev, efx 3059 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_vf_rx_push_rss_config(struct efx_nic *efx, bool user, efx 3067 drivers/net/ethernet/sfc/ef10.c if (efx->rss_context.context_id != EFX_EF10_RSS_CONTEXT_INVALID) efx 3069 drivers/net/ethernet/sfc/ef10.c return efx_ef10_rx_push_shared_rss_config(efx, NULL); efx 3074 drivers/net/ethernet/sfc/ef10.c return efx_nic_alloc_buffer(rx_queue->efx, &rx_queue->rxd.buf, efx 3087 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = rx_queue->efx; efx 3088 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 3111 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, hw, efx->net_dev, "pushing RXQ %d. %zu entries (%llx)\n", efx 3121 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_INIT_RXQ, inbuf, inlen, efx 3124 drivers/net/ethernet/sfc/ef10.c netdev_WARN(efx->net_dev, "failed to initialise RXQ %d\n", efx 3132 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = rx_queue->efx; efx 3139 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_FINI_RXQ, inbuf, sizeof(inbuf), efx 3148 drivers/net/ethernet/sfc/ef10.c efx_mcdi_display_error(efx, MC_CMD_FINI_RXQ, MC_CMD_FINI_RXQ_IN_LEN, efx 3154 drivers/net/ethernet/sfc/ef10.c efx_nic_free_buffer(rx_queue->efx, &rx_queue->rxd.buf); efx 3173 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = rx_queue->efx; efx 3191 drivers/net/ethernet/sfc/ef10.c efx_writed_page(efx, ®, ER_DZ_RX_DESC_UPD, efx 3215 drivers/net/ethernet/sfc/ef10.c efx_mcdi_rpc_async(channel->efx, MC_CMD_DRIVER_EVENT, efx 3221 drivers/net/ethernet/sfc/ef10.c efx_ef10_rx_defer_refill_complete(struct efx_nic *efx, unsigned long cookie, efx 3230 drivers/net/ethernet/sfc/ef10.c return efx_nic_alloc_buffer(channel->efx, &channel->eventq.buf, efx 3240 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = channel->efx; efx 3246 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_FINI_EVQ, inbuf, sizeof(inbuf), efx 3255 drivers/net/ethernet/sfc/ef10.c efx_mcdi_display_error(efx, MC_CMD_FINI_EVQ, MC_CMD_FINI_EVQ_IN_LEN, efx 3266 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = channel->efx; efx 3274 drivers/net/ethernet/sfc/ef10.c nic_data = efx->nic_data; efx 3320 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_INIT_EVQ, inbuf, inlen, efx 3324 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, efx 3334 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_get_workarounds(efx, &implemented, &enabled); efx 3351 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_set_workaround(efx, efx 3358 drivers/net/ethernet/sfc/ef10.c netif_info(efx, drv, efx->net_dev, efx 3368 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_get_warm_boot_count(efx); efx 3391 drivers/net/ethernet/sfc/ef10.c efx_nic_free_buffer(channel->efx, &channel->eventq.buf); efx 3397 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = rx_queue->efx; efx 3399 drivers/net/ethernet/sfc/ef10.c netif_info(efx, hw, efx->net_dev, efx 3403 drivers/net/ethernet/sfc/ef10.c efx_schedule_reset(efx, RESET_TYPE_DISABLE); efx 3411 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = rx_queue->efx; efx 3413 drivers/net/ethernet/sfc/ef10.c netif_info(efx, hw, efx->net_dev, efx 3417 drivers/net/ethernet/sfc/ef10.c efx_schedule_reset(efx, RESET_TYPE_DISABLE); efx 3425 drivers/net/ethernet/sfc/ef10.c netif_dbg(rx_queue->efx, hw, rx_queue->efx->net_dev, efx 3447 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = channel->efx; efx 3451 drivers/net/ethernet/sfc/ef10.c if (!(efx->net_dev->features & NETIF_F_RXALL)) { efx 3452 drivers/net/ethernet/sfc/ef10.c if (!efx->loopback_selftest) efx 3464 drivers/net/ethernet/sfc/ef10.c netdev_WARN(efx->net_dev, efx 3468 drivers/net/ethernet/sfc/ef10.c if (!efx->loopback_selftest) efx 3480 drivers/net/ethernet/sfc/ef10.c netdev_WARN(efx->net_dev, efx 3484 drivers/net/ethernet/sfc/ef10.c if (!efx->loopback_selftest) efx 3492 drivers/net/ethernet/sfc/ef10.c netdev_WARN(efx->net_dev, efx 3500 drivers/net/ethernet/sfc/ef10.c netdev_WARN(efx->net_dev, efx 3504 drivers/net/ethernet/sfc/ef10.c if (!efx->loopback_selftest) efx 3510 drivers/net/ethernet/sfc/ef10.c netdev_WARN(efx->net_dev, efx 3518 drivers/net/ethernet/sfc/ef10.c netdev_WARN(efx->net_dev, efx 3522 drivers/net/ethernet/sfc/ef10.c if (!efx->loopback_selftest) efx 3537 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = channel->efx; efx 3538 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 3544 drivers/net/ethernet/sfc/ef10.c if (unlikely(READ_ONCE(efx->reset_pending))) efx 3561 drivers/net/ethernet/sfc/ef10.c netdev_WARN(efx->net_dev, "saw RX_DROP_EVENT: event=" efx 3574 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 3579 drivers/net/ethernet/sfc/ef10.c netdev_WARN(efx->net_dev, efx 3645 drivers/net/ethernet/sfc/ef10.c netdev_WARN(efx->net_dev, efx 3686 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = channel->efx; efx 3693 drivers/net/ethernet/sfc/ef10.c if (unlikely(READ_ONCE(efx->reset_pending))) efx 3751 drivers/net/ethernet/sfc/ef10.c netif_err(efx, hw, efx->net_dev, efx 3763 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = channel->efx; efx 3776 drivers/net/ethernet/sfc/ef10.c netif_err(efx, hw, efx->net_dev, efx 3788 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = channel->efx; efx 3805 drivers/net/ethernet/sfc/ef10.c netif_err(efx, hw, efx->net_dev, efx 3815 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = channel->efx; efx 3839 drivers/net/ethernet/sfc/ef10.c netif_vdbg(efx, drv, efx->net_dev, efx 3869 drivers/net/ethernet/sfc/ef10.c netif_err(efx, hw, efx->net_dev, efx 3884 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = channel->efx; efx 3887 drivers/net/ethernet/sfc/ef10.c if (EFX_EF10_WORKAROUND_35388(efx)) { efx 3899 drivers/net/ethernet/sfc/ef10.c efx_writed_page(efx, &rptr, ER_DD_EVQ_INDIRECT, efx 3906 drivers/net/ethernet/sfc/ef10.c efx_writed_page(efx, &rptr, ER_DD_EVQ_INDIRECT, efx 3912 drivers/net/ethernet/sfc/ef10.c efx_writed_page(efx, &rptr, ER_DZ_EVQ_RPTR, channel->channel); efx 3919 drivers/net/ethernet/sfc/ef10.c struct efx_nic *efx = channel->efx; efx 3935 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_DRIVER_EVENT, inbuf, sizeof(inbuf), efx 3944 drivers/net/ethernet/sfc/ef10.c netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); efx 3947 drivers/net/ethernet/sfc/ef10.c void efx_ef10_handle_drain_event(struct efx_nic *efx) efx 3949 drivers/net/ethernet/sfc/ef10.c if (atomic_dec_and_test(&efx->active_queues)) efx 3950 drivers/net/ethernet/sfc/ef10.c wake_up(&efx->flush_wq); efx 3952 drivers/net/ethernet/sfc/ef10.c WARN_ON(atomic_read(&efx->active_queues) < 0); efx 3955 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_fini_dmaq(struct efx_nic *efx) efx 3957 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 3967 drivers/net/ethernet/sfc/ef10.c atomic_set(&efx->active_queues, 0); efx 3972 drivers/net/ethernet/sfc/ef10.c if (efx->state != STATE_RECOVERY) { efx 3973 drivers/net/ethernet/sfc/ef10.c efx_for_each_channel(channel, efx) { efx 3980 drivers/net/ethernet/sfc/ef10.c wait_event_timeout(efx->flush_wq, efx 3981 drivers/net/ethernet/sfc/ef10.c atomic_read(&efx->active_queues) == 0, efx 3983 drivers/net/ethernet/sfc/ef10.c pending = atomic_read(&efx->active_queues); efx 3985 drivers/net/ethernet/sfc/ef10.c netif_err(efx, hw, efx->net_dev, "failed to flush %d queues\n", efx 3994 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_prepare_flr(struct efx_nic *efx) efx 3996 drivers/net/ethernet/sfc/ef10.c atomic_set(&efx->active_queues, 0); efx 4049 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_push_prep_set_match_fields(struct efx_nic *efx, efx 4146 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_push_prep(struct efx_nic *efx, efx 4152 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 4173 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_push_prep_set_match_fields(efx, spec, inbuf); efx 4195 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_filter_push(struct efx_nic *efx, efx 4203 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_push_prep(efx, spec, inbuf, *handle, ctx, replacing); efx 4204 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_FILTER_OP, inbuf, sizeof(inbuf), efx 4288 drivers/net/ethernet/sfc/ef10.c static s32 efx_ef10_filter_insert_locked(struct efx_nic *efx, efx 4293 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 4307 drivers/net/ethernet/sfc/ef10.c WARN_ON(!rwsem_is_locked(&efx->filter_sem)); efx 4308 drivers/net/ethernet/sfc/ef10.c table = efx->filter_state; efx 4329 drivers/net/ethernet/sfc/ef10.c mutex_lock(&efx->rss_lock); efx 4332 drivers/net/ethernet/sfc/ef10.c ctx = efx_find_rss_context_entry(efx, spec->rss_context); efx 4334 drivers/net/ethernet/sfc/ef10.c ctx = &efx->rss_context; efx 4419 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_push(efx, spec, &table->entry[ins_index].handle, efx 4475 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_FILTER_OP, efx 4496 drivers/net/ethernet/sfc/ef10.c mutex_unlock(&efx->rss_lock); efx 4501 drivers/net/ethernet/sfc/ef10.c static s32 efx_ef10_filter_insert(struct efx_nic *efx, efx 4507 drivers/net/ethernet/sfc/ef10.c down_read(&efx->filter_sem); efx 4508 drivers/net/ethernet/sfc/ef10.c ret = efx_ef10_filter_insert_locked(efx, spec, replace_equal); efx 4509 drivers/net/ethernet/sfc/ef10.c up_read(&efx->filter_sem); efx 4514 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_update_rx_scatter(struct efx_nic *efx) efx 4526 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_filter_remove_internal(struct efx_nic *efx, efx 4531 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 4564 drivers/net/ethernet/sfc/ef10.c (efx_rss_active(&efx->rss_context) ? efx 4568 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_push(efx, &new_spec, efx 4570 drivers/net/ethernet/sfc/ef10.c &efx->rss_context, efx 4584 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_FILTER_OP, efx 4592 drivers/net/ethernet/sfc/ef10.c efx_mcdi_display_error(efx, MC_CMD_FILTER_OP, efx 4601 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_filter_remove_safe(struct efx_nic *efx, efx 4608 drivers/net/ethernet/sfc/ef10.c down_read(&efx->filter_sem); efx 4609 drivers/net/ethernet/sfc/ef10.c table = efx->filter_state; efx 4611 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_remove_internal(efx, 1U << priority, filter_id, efx 4614 drivers/net/ethernet/sfc/ef10.c up_read(&efx->filter_sem); efx 4619 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_remove_unsafe(struct efx_nic *efx, efx 4623 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 4629 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_remove_internal(efx, 1U << priority, filter_id, efx 4634 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_filter_get_safe(struct efx_nic *efx, efx 4643 drivers/net/ethernet/sfc/ef10.c down_read(&efx->filter_sem); efx 4644 drivers/net/ethernet/sfc/ef10.c table = efx->filter_state; efx 4656 drivers/net/ethernet/sfc/ef10.c up_read(&efx->filter_sem); efx 4660 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_filter_clear_rx(struct efx_nic *efx, efx 4671 drivers/net/ethernet/sfc/ef10.c down_read(&efx->filter_sem); efx 4672 drivers/net/ethernet/sfc/ef10.c table = efx->filter_state; efx 4675 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_remove_internal(efx, priority_mask, efx 4683 drivers/net/ethernet/sfc/ef10.c up_read(&efx->filter_sem); efx 4687 drivers/net/ethernet/sfc/ef10.c static u32 efx_ef10_filter_count_rx_used(struct efx_nic *efx, efx 4694 drivers/net/ethernet/sfc/ef10.c down_read(&efx->filter_sem); efx 4695 drivers/net/ethernet/sfc/ef10.c table = efx->filter_state; efx 4704 drivers/net/ethernet/sfc/ef10.c up_read(&efx->filter_sem); efx 4708 drivers/net/ethernet/sfc/ef10.c static u32 efx_ef10_filter_get_rx_id_limit(struct efx_nic *efx) efx 4710 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 4715 drivers/net/ethernet/sfc/ef10.c static s32 efx_ef10_filter_get_rx_ids(struct efx_nic *efx, efx 4724 drivers/net/ethernet/sfc/ef10.c down_read(&efx->filter_sem); efx 4725 drivers/net/ethernet/sfc/ef10.c table = efx->filter_state; efx 4742 drivers/net/ethernet/sfc/ef10.c up_read(&efx->filter_sem); efx 4748 drivers/net/ethernet/sfc/ef10.c static bool efx_ef10_filter_rfs_expire_one(struct efx_nic *efx, u32 flow_id, efx 4757 drivers/net/ethernet/sfc/ef10.c down_read(&efx->filter_sem); efx 4758 drivers/net/ethernet/sfc/ef10.c table = efx->filter_state; efx 4765 drivers/net/ethernet/sfc/ef10.c spin_lock_bh(&efx->rps_hash_lock); efx 4766 drivers/net/ethernet/sfc/ef10.c if (!efx->rps_hash_table) { efx 4770 drivers/net/ethernet/sfc/ef10.c rule = efx_rps_hash_find(efx, spec); efx 4779 drivers/net/ethernet/sfc/ef10.c spin_unlock_bh(&efx->rps_hash_lock); efx 4783 drivers/net/ethernet/sfc/ef10.c if (!rps_may_expire_flow(efx->net_dev, spec->dmaq_id, flow_id, arfs_id)) efx 4789 drivers/net/ethernet/sfc/ef10.c spin_unlock_bh(&efx->rps_hash_lock); efx 4797 drivers/net/ethernet/sfc/ef10.c ret = efx_ef10_filter_remove_internal(efx, 1U << spec->priority, efx 4804 drivers/net/ethernet/sfc/ef10.c spin_lock_bh(&efx->rps_hash_lock); efx 4805 drivers/net/ethernet/sfc/ef10.c efx_rps_hash_del(efx, &saved_spec); efx 4806 drivers/net/ethernet/sfc/ef10.c spin_unlock_bh(&efx->rps_hash_lock); efx 4810 drivers/net/ethernet/sfc/ef10.c up_read(&efx->filter_sem); efx 4873 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_cleanup_vlans(struct efx_nic *efx) efx 4875 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 4879 drivers/net/ethernet/sfc/ef10.c if (!efx_rwsem_assert_write_locked(&efx->filter_sem)) efx 4886 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_del_vlan_internal(efx, vlan); efx 4909 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_table_probe_matches(struct efx_nic *efx, efx 4924 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_PARSER_DISP_INFO, efx 4941 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 4945 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, probe, efx->net_dev, efx 4957 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_filter_table_probe(struct efx_nic *efx) efx 4959 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 4960 drivers/net/ethernet/sfc/ef10.c struct net_device *net_dev = efx->net_dev; efx 4965 drivers/net/ethernet/sfc/ef10.c if (!efx_rwsem_assert_write_locked(&efx->filter_sem)) efx 4968 drivers/net/ethernet/sfc/ef10.c if (efx->filter_state) /* already probed */ efx 4976 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_table_probe_matches(efx, table, false); efx 4981 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_table_probe_matches(efx, table, true); efx 4984 drivers/net/ethernet/sfc/ef10.c if ((efx_supported_features(efx) & NETIF_F_HW_VLAN_CTAG_FILTER) && efx 4989 drivers/net/ethernet/sfc/ef10.c netif_info(efx, probe, net_dev, efx 4992 drivers/net/ethernet/sfc/ef10.c efx->fixed_features &= ~NETIF_F_HW_VLAN_CTAG_FILTER; efx 5005 drivers/net/ethernet/sfc/ef10.c !!(efx->net_dev->features & NETIF_F_HW_VLAN_CTAG_FILTER); efx 5009 drivers/net/ethernet/sfc/ef10.c efx->filter_state = table; efx 5012 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_add_vlan(efx, vlan->vid); efx 5020 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_cleanup_vlans(efx); efx 5021 drivers/net/ethernet/sfc/ef10.c efx->filter_state = NULL; efx 5030 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_table_restore(struct efx_nic *efx) efx 5032 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5033 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 5043 drivers/net/ethernet/sfc/ef10.c WARN_ON(!rwsem_is_locked(&efx->filter_sem)); efx 5052 drivers/net/ethernet/sfc/ef10.c mutex_lock(&efx->rss_lock); efx 5069 drivers/net/ethernet/sfc/ef10.c ctx = efx_find_rss_context_entry(efx, spec->rss_context); efx 5071 drivers/net/ethernet/sfc/ef10.c ctx = &efx->rss_context; efx 5074 drivers/net/ethernet/sfc/ef10.c netif_warn(efx, drv, efx->net_dev, efx 5081 drivers/net/ethernet/sfc/ef10.c netif_warn(efx, drv, efx->net_dev, efx 5089 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_push(efx, spec, efx 5108 drivers/net/ethernet/sfc/ef10.c mutex_unlock(&efx->rss_lock); efx 5115 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, efx 5120 drivers/net/ethernet/sfc/ef10.c netif_err(efx, hw, efx->net_dev, efx 5126 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_table_remove(struct efx_nic *efx) efx 5128 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5134 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_cleanup_vlans(efx); efx 5135 drivers/net/ethernet/sfc/ef10.c efx->filter_state = NULL; efx 5142 drivers/net/ethernet/sfc/ef10.c if (!efx_rwsem_assert_write_locked(&efx->filter_sem)) efx 5159 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_FILTER_OP, inbuf, efx 5162 drivers/net/ethernet/sfc/ef10.c netif_info(efx, drv, efx->net_dev, efx 5172 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_mark_one_old(struct efx_nic *efx, uint16_t *id) efx 5174 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5182 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, efx 5191 drivers/net/ethernet/sfc/ef10.c static void _efx_ef10_filter_vlan_mark_old(struct efx_nic *efx, efx 5194 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5198 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_mark_one_old(efx, &vlan->uc[i]); efx 5200 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_mark_one_old(efx, &vlan->mc[i]); efx 5202 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_mark_one_old(efx, &vlan->default_filters[i]); efx 5209 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_mark_old(struct efx_nic *efx) efx 5211 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5216 drivers/net/ethernet/sfc/ef10.c _efx_ef10_filter_vlan_mark_old(efx, vlan); efx 5220 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_uc_addr_list(struct efx_nic *efx) efx 5222 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5223 drivers/net/ethernet/sfc/ef10.c struct net_device *net_dev = efx->net_dev; efx 5242 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_mc_addr_list(struct efx_nic *efx) efx 5244 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5245 drivers/net/ethernet/sfc/ef10.c struct net_device *net_dev = efx->net_dev; efx 5266 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_filter_insert_addr_list(struct efx_nic *efx, efx 5270 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5290 drivers/net/ethernet/sfc/ef10.c filter_flags = efx_rss_active(&efx->rss_context) ? EFX_FILTER_FLAG_RX_RSS : 0; efx 5297 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_insert_locked(efx, &spec, true); efx 5300 drivers/net/ethernet/sfc/ef10.c netif_info(efx, drv, efx->net_dev, efx 5306 drivers/net/ethernet/sfc/ef10.c efx, EFX_FILTER_PRI_AUTO, efx 5326 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_insert_locked(efx, &spec, true); efx 5328 drivers/net/ethernet/sfc/ef10.c netif_warn(efx, drv, efx->net_dev, efx 5333 drivers/net/ethernet/sfc/ef10.c efx, EFX_FILTER_PRI_AUTO, efx 5347 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_filter_insert_def(struct efx_nic *efx, efx 5352 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 5359 drivers/net/ethernet/sfc/ef10.c filter_flags = efx_rss_active(&efx->rss_context) ? EFX_FILTER_FLAG_RX_RSS : 0; efx 5382 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_insert_locked(efx, &spec, true); efx 5406 drivers/net/ethernet/sfc/ef10.c netif_cond_dbg(efx, drv, efx->net_dev, efx 5442 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_insert_locked(efx, &spec, true); efx 5444 drivers/net/ethernet/sfc/ef10.c netif_warn(efx, drv, efx->net_dev, efx 5450 drivers/net/ethernet/sfc/ef10.c efx, EFX_FILTER_PRI_AUTO, efx 5495 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_remove_old(struct efx_nic *efx) efx 5497 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5507 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_filter_remove_internal(efx, efx 5518 drivers/net/ethernet/sfc/ef10.c netif_info(efx, drv, efx->net_dev, efx 5522 drivers/net/ethernet/sfc/ef10.c netif_info(efx, drv, efx->net_dev, efx 5527 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_vport_set_mac_address(struct efx_nic *efx) efx 5529 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 5537 drivers/net/ethernet/sfc/ef10.c efx_device_detach_sync(efx); efx 5538 drivers/net/ethernet/sfc/ef10.c efx_net_stop(efx->net_dev); efx 5539 drivers/net/ethernet/sfc/ef10.c down_write(&efx->filter_sem); efx 5540 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_table_remove(efx); efx 5541 drivers/net/ethernet/sfc/ef10.c up_write(&efx->filter_sem); efx 5543 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_vadaptor_free(efx, nic_data->vport_id); efx 5548 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_vport_del_mac(efx, nic_data->vport_id, efx 5553 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_vport_add_mac(efx, nic_data->vport_id, efx 5554 drivers/net/ethernet/sfc/ef10.c efx->net_dev->dev_addr); efx 5556 drivers/net/ethernet/sfc/ef10.c ether_addr_copy(nic_data->vport_mac, efx->net_dev->dev_addr); efx 5558 drivers/net/ethernet/sfc/ef10.c rc2 = efx_ef10_vport_add_mac(efx, nic_data->vport_id, mac_old); efx 5567 drivers/net/ethernet/sfc/ef10.c rc2 = efx_ef10_vadaptor_alloc(efx, nic_data->vport_id); efx 5571 drivers/net/ethernet/sfc/ef10.c down_write(&efx->filter_sem); efx 5572 drivers/net/ethernet/sfc/ef10.c rc2 = efx_ef10_filter_table_probe(efx); efx 5573 drivers/net/ethernet/sfc/ef10.c up_write(&efx->filter_sem); efx 5577 drivers/net/ethernet/sfc/ef10.c rc2 = efx_net_open(efx->net_dev); efx 5581 drivers/net/ethernet/sfc/ef10.c efx_device_attach_if_not_resetting(efx); efx 5586 drivers/net/ethernet/sfc/ef10.c netif_err(efx, drv, efx->net_dev, efx 5588 drivers/net/ethernet/sfc/ef10.c efx_schedule_reset(efx, RESET_TYPE_DATAPATH); efx 5596 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_vlan_sync_rx_mode(struct efx_nic *efx, efx 5599 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5600 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 5610 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_NONE, efx 5612 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_addr_list(efx, vlan, false, false); efx 5618 drivers/net/ethernet/sfc/ef10.c if (efx_ef10_filter_insert_addr_list(efx, vlan, false, false)) efx 5619 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, efx 5623 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_VXLAN, efx 5625 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_VXLAN | efx 5628 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_NVGRE, efx 5630 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_NVGRE | efx 5633 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_GENEVE, efx 5635 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_GENEVE | efx 5645 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_remove_old(efx); efx 5651 drivers/net/ethernet/sfc/ef10.c if (efx_ef10_filter_insert_def(efx, vlan, efx 5655 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_remove_old(efx); efx 5656 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_addr_list(efx, vlan, efx 5664 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, efx 5668 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_addr_list(efx, vlan, efx 5677 drivers/net/ethernet/sfc/ef10.c if (efx_ef10_filter_insert_addr_list(efx, vlan, true, true)) { efx 5680 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_remove_old(efx); efx 5681 drivers/net/ethernet/sfc/ef10.c if (efx_ef10_filter_insert_def(efx, vlan, efx 5684 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_addr_list(efx, vlan, efx 5688 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_VXLAN, efx 5690 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_VXLAN | efx 5693 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_NVGRE, efx 5695 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_NVGRE | efx 5698 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_GENEVE, efx 5700 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_insert_def(efx, vlan, EFX_ENCAP_TYPE_GENEVE | efx 5708 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_sync_rx_mode(struct efx_nic *efx) efx 5710 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5711 drivers/net/ethernet/sfc/ef10.c struct net_device *net_dev = efx->net_dev; efx 5715 drivers/net/ethernet/sfc/ef10.c if (!efx_dev_registered(efx)) efx 5721 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_mark_old(efx); efx 5727 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_uc_addr_list(efx); efx 5728 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_mc_addr_list(efx); efx 5738 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_remove_old(efx); efx 5742 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_vlan_sync_rx_mode(efx, vlan); efx 5744 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_remove_old(efx); efx 5748 drivers/net/ethernet/sfc/ef10.c static struct efx_ef10_filter_vlan *efx_ef10_filter_find_vlan(struct efx_nic *efx, u16 vid) efx 5750 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5753 drivers/net/ethernet/sfc/ef10.c WARN_ON(!rwsem_is_locked(&efx->filter_sem)); efx 5763 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_filter_add_vlan(struct efx_nic *efx, u16 vid) efx 5765 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_filter_table *table = efx->filter_state; efx 5769 drivers/net/ethernet/sfc/ef10.c if (!efx_rwsem_assert_write_locked(&efx->filter_sem)) efx 5772 drivers/net/ethernet/sfc/ef10.c vlan = efx_ef10_filter_find_vlan(efx, vid); efx 5774 drivers/net/ethernet/sfc/ef10.c netif_err(efx, drv, efx->net_dev, efx 5794 drivers/net/ethernet/sfc/ef10.c if (efx_dev_registered(efx)) efx 5795 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_vlan_sync_rx_mode(efx, vlan); efx 5800 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_del_vlan_internal(struct efx_nic *efx, efx 5806 drivers/net/ethernet/sfc/ef10.c if (!efx_rwsem_assert_write_locked(&efx->filter_sem)) efx 5812 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_remove_unsafe(efx, EFX_FILTER_PRI_AUTO, efx 5815 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_remove_unsafe(efx, EFX_FILTER_PRI_AUTO, efx 5819 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_remove_unsafe(efx, EFX_FILTER_PRI_AUTO, efx 5825 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_filter_del_vlan(struct efx_nic *efx, u16 vid) efx 5830 drivers/net/ethernet/sfc/ef10.c if (!efx_rwsem_assert_write_locked(&efx->filter_sem)) efx 5833 drivers/net/ethernet/sfc/ef10.c vlan = efx_ef10_filter_find_vlan(efx, vid); efx 5835 drivers/net/ethernet/sfc/ef10.c netif_err(efx, drv, efx->net_dev, efx 5840 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_del_vlan_internal(efx, vlan); efx 5843 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_set_mac_address(struct efx_nic *efx) efx 5846 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 5847 drivers/net/ethernet/sfc/ef10.c bool was_enabled = efx->port_enabled; efx 5850 drivers/net/ethernet/sfc/ef10.c efx_device_detach_sync(efx); efx 5851 drivers/net/ethernet/sfc/ef10.c efx_net_stop(efx->net_dev); efx 5853 drivers/net/ethernet/sfc/ef10.c mutex_lock(&efx->mac_lock); efx 5854 drivers/net/ethernet/sfc/ef10.c down_write(&efx->filter_sem); efx 5855 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_table_remove(efx); efx 5858 drivers/net/ethernet/sfc/ef10.c efx->net_dev->dev_addr); efx 5861 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_VADAPTOR_SET_MAC, inbuf, efx 5864 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_table_probe(efx); efx 5865 drivers/net/ethernet/sfc/ef10.c up_write(&efx->filter_sem); efx 5866 drivers/net/ethernet/sfc/ef10.c mutex_unlock(&efx->mac_lock); efx 5869 drivers/net/ethernet/sfc/ef10.c efx_net_open(efx->net_dev); efx 5870 drivers/net/ethernet/sfc/ef10.c efx_device_attach_if_not_resetting(efx); efx 5873 drivers/net/ethernet/sfc/ef10.c if (efx->pci_dev->is_virtfn && efx->pci_dev->physfn) { efx 5874 drivers/net/ethernet/sfc/ef10.c struct pci_dev *pci_dev_pf = efx->pci_dev->physfn; efx 5884 drivers/net/ethernet/sfc/ef10.c efx->net_dev->dev_addr); efx 5896 drivers/net/ethernet/sfc/ef10.c if (vf->efx == efx) { efx 5898 drivers/net/ethernet/sfc/ef10.c efx->net_dev->dev_addr); efx 5906 drivers/net/ethernet/sfc/ef10.c netif_err(efx, drv, efx->net_dev, efx 5909 drivers/net/ethernet/sfc/ef10.c } else if (rc == -ENOSYS && !efx_ef10_is_vf(efx)) { efx 5915 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_vport_set_mac_address(efx); efx 5917 drivers/net/ethernet/sfc/ef10.c efx_mcdi_display_error(efx, MC_CMD_VADAPTOR_SET_MAC, efx 5924 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_mac_reconfigure(struct efx_nic *efx) efx 5926 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_sync_rx_mode(efx); efx 5928 drivers/net/ethernet/sfc/ef10.c return efx_mcdi_set_mac(efx); efx 5931 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_mac_reconfigure_vf(struct efx_nic *efx) efx 5933 drivers/net/ethernet/sfc/ef10.c efx_ef10_filter_sync_rx_mode(efx); efx 5938 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_start_bist(struct efx_nic *efx, u32 bist_type) efx 5943 drivers/net/ethernet/sfc/ef10.c return efx_mcdi_rpc(efx, MC_CMD_START_BIST, inbuf, sizeof(inbuf), efx 5951 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_poll_bist(struct efx_nic *efx) efx 5958 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_POLL_BIST, NULL, 0, efx 5969 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, hw, efx->net_dev, "BIST passed.\n"); efx 5972 drivers/net/ethernet/sfc/ef10.c netif_err(efx, hw, efx->net_dev, "BIST timed out\n"); efx 5975 drivers/net/ethernet/sfc/ef10.c netif_err(efx, hw, efx->net_dev, "BIST failed.\n"); efx 5978 drivers/net/ethernet/sfc/ef10.c netif_err(efx, hw, efx->net_dev, efx 5984 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_run_bist(struct efx_nic *efx, u32 bist_type) efx 5988 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, "starting BIST type %u\n", bist_type); efx 5990 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_start_bist(efx, bist_type); efx 5994 drivers/net/ethernet/sfc/ef10.c return efx_ef10_poll_bist(efx); efx 5998 drivers/net/ethernet/sfc/ef10.c efx_ef10_test_chip(struct efx_nic *efx, struct efx_self_tests *tests) efx 6002 drivers/net/ethernet/sfc/ef10.c efx_reset_down(efx, RESET_TYPE_WORLD); efx 6004 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_ENABLE_OFFLINE_BIST, efx 6009 drivers/net/ethernet/sfc/ef10.c tests->memory = efx_ef10_run_bist(efx, MC_CMD_MC_MEM_BIST) ? -1 : 1; efx 6010 drivers/net/ethernet/sfc/ef10.c tests->registers = efx_ef10_run_bist(efx, MC_CMD_REG_BIST) ? -1 : 1; efx 6012 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_reset(efx, RESET_TYPE_WORLD); efx 6017 drivers/net/ethernet/sfc/ef10.c rc2 = efx_reset_up(efx, RESET_TYPE_WORLD, rc == 0); efx 6051 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_mtd_probe_partition(struct efx_nic *efx, efx 6071 drivers/net/ethernet/sfc/ef10.c if (info->port != efx_port_num(efx)) efx 6074 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_nvram_info(efx, type, &size, &erase_size, &protected); efx 6097 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_METADATA, inbuf, sizeof(inbuf), efx 6122 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_mtd_probe(struct efx_nic *efx) efx 6134 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_PARTITIONS, NULL, 0, efx 6154 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_mtd_probe_partition(efx, &parts[n_parts], type, efx 6163 drivers/net/ethernet/sfc/ef10.c rc = efx_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts)); efx 6172 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_ptp_write_host_time(struct efx_nic *efx, u32 host_time) efx 6174 drivers/net/ethernet/sfc/ef10.c _efx_writed(efx, cpu_to_le32(host_time), ER_DZ_MC_DB_LWRD); efx 6177 drivers/net/ethernet/sfc/ef10.c static void efx_ef10_ptp_write_host_time_vf(struct efx_nic *efx, efx 6197 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(channel->efx, MC_CMD_PTP, efx 6230 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc(channel->efx, MC_CMD_PTP, efx 6236 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_ptp_set_ts_sync_events(struct efx_nic *efx, bool en, efx 6246 drivers/net/ethernet/sfc/ef10.c channel = efx_ptp_channel(efx); efx 6250 drivers/net/ethernet/sfc/ef10.c efx_ef10_ptp_set_ts_sync_events(efx, false, temp); efx 6258 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_ptp_set_ts_config_vf(struct efx_nic *efx, efx 6264 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_ptp_set_ts_config(struct efx_nic *efx, efx 6271 drivers/net/ethernet/sfc/ef10.c efx_ef10_ptp_set_ts_sync_events(efx, false, false); efx 6273 drivers/net/ethernet/sfc/ef10.c return efx_ptp_change_mode(efx, efx 6290 drivers/net/ethernet/sfc/ef10.c rc = efx_ptp_change_mode(efx, true, 0); efx 6292 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_ptp_set_ts_sync_events(efx, true, false); efx 6294 drivers/net/ethernet/sfc/ef10.c efx_ptp_change_mode(efx, false, 0); efx 6301 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_get_phys_port_id(struct efx_nic *efx, efx 6304 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 6315 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_vlan_rx_add_vid(struct efx_nic *efx, __be16 proto, u16 vid) efx 6320 drivers/net/ethernet/sfc/ef10.c return efx_ef10_add_vlan(efx, vid); efx 6323 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_vlan_rx_kill_vid(struct efx_nic *efx, __be16 proto, u16 vid) efx 6328 drivers/net/ethernet/sfc/ef10.c return efx_ef10_del_vlan(efx, vid); efx 6336 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_set_udp_tnl_ports(struct efx_nic *efx, bool unloading) efx 6338 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 6354 drivers/net/ethernet/sfc/ef10.c efx_device_attach_if_not_resetting(efx); efx 6391 drivers/net/ethernet/sfc/ef10.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_SET_TUNNEL_ENCAP_UDP_PORTS, efx 6405 drivers/net/ethernet/sfc/ef10.c netif_warn(efx, drv, efx->net_dev, efx 6409 drivers/net/ethernet/sfc/ef10.c netif_info(efx, drv, efx->net_dev, efx 6426 drivers/net/ethernet/sfc/ef10.c efx_device_attach_if_not_resetting(efx); efx 6432 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_udp_tnl_push_ports(struct efx_nic *efx) efx 6434 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 6442 drivers/net/ethernet/sfc/ef10.c efx_device_detach_sync(efx); efx 6443 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_set_udp_tnl_ports(efx, false); efx 6449 drivers/net/ethernet/sfc/ef10.c static struct efx_udp_tunnel *__efx_ef10_udp_tnl_lookup_port(struct efx_nic *efx, efx 6452 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 6464 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_udp_tnl_add_port(struct efx_nic *efx, efx 6467 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 6478 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, "Adding UDP tunnel (%s) port %d\n", efx 6485 drivers/net/ethernet/sfc/ef10.c efx_device_detach_sync(efx); efx 6487 drivers/net/ethernet/sfc/ef10.c match = __efx_ef10_udp_tnl_lookup_port(efx, tnl.port); efx 6490 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, efx 6499 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, efx 6510 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_set_udp_tnl_ports(efx, false); efx 6514 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, efx 6530 drivers/net/ethernet/sfc/ef10.c static bool efx_ef10_udp_tnl_has_port(struct efx_nic *efx, __be16 port) efx 6532 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 6544 drivers/net/ethernet/sfc/ef10.c return __efx_ef10_udp_tnl_lookup_port(efx, port) != NULL; efx 6547 drivers/net/ethernet/sfc/ef10.c static int efx_ef10_udp_tnl_del_port(struct efx_nic *efx, efx 6550 drivers/net/ethernet/sfc/ef10.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 6560 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, "Removing UDP tunnel (%s) port %d\n", efx 6567 drivers/net/ethernet/sfc/ef10.c efx_device_detach_sync(efx); efx 6569 drivers/net/ethernet/sfc/ef10.c match = __efx_ef10_udp_tnl_lookup_port(efx, tnl.port); efx 6574 drivers/net/ethernet/sfc/ef10.c netif_dbg(efx, drv, efx->net_dev, efx 6580 drivers/net/ethernet/sfc/ef10.c rc = efx_ef10_set_udp_tnl_ports(efx, false); efx 6585 drivers/net/ethernet/sfc/ef10.c netif_warn(efx, drv, efx->net_dev, efx 15 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_evb_port_assign(struct efx_nic *efx, unsigned int port_id, efx 19 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 26 drivers/net/ethernet/sfc/ef10_sriov.c return efx_mcdi_rpc(efx, MC_CMD_EVB_PORT_ASSIGN, inbuf, sizeof(inbuf), efx 30 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_vswitch_alloc(struct efx_nic *efx, unsigned int port_id, efx 43 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_VSWITCH_ALLOC, inbuf, sizeof(inbuf), efx 49 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_mcdi_rpc(efx, MC_CMD_VSWITCH_ALLOC, inbuf, efx 52 drivers/net/ethernet/sfc/ef10_sriov.c efx_mcdi_display_error(efx, MC_CMD_VSWITCH_ALLOC, efx 59 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_vswitch_free(struct efx_nic *efx, unsigned int port_id) efx 65 drivers/net/ethernet/sfc/ef10_sriov.c return efx_mcdi_rpc(efx, MC_CMD_VSWITCH_FREE, inbuf, sizeof(inbuf), efx 69 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_vport_alloc(struct efx_nic *efx, efx 92 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_mcdi_rpc(efx, MC_CMD_VPORT_ALLOC, inbuf, sizeof(inbuf), efx 103 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_vport_free(struct efx_nic *efx, unsigned int port_id) efx 109 drivers/net/ethernet/sfc/ef10_sriov.c return efx_mcdi_rpc(efx, MC_CMD_VPORT_FREE, inbuf, sizeof(inbuf), efx 113 drivers/net/ethernet/sfc/ef10_sriov.c static void efx_ef10_sriov_free_vf_vports(struct efx_nic *efx) efx 115 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 121 drivers/net/ethernet/sfc/ef10_sriov.c for (i = 0; i < efx->vf_count; i++) { efx 130 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_evb_port_assign(efx, EVB_PORT_ID_NULL, i); efx 135 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vport_del_mac(efx, vf->vport_id, vf->mac); efx 140 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vport_free(efx, vf->vport_id); efx 144 drivers/net/ethernet/sfc/ef10_sriov.c vf->efx = NULL; efx 148 drivers/net/ethernet/sfc/ef10_sriov.c static void efx_ef10_sriov_free_vf_vswitching(struct efx_nic *efx) efx 150 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 152 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_sriov_free_vf_vports(efx); efx 157 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_sriov_assign_vf_vport(struct efx_nic *efx, efx 160 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 167 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vport_alloc(efx, EVB_PORT_ID_ASSIGNED, efx 173 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vport_add_mac(efx, vf->vport_id, vf->mac); efx 179 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i); efx 187 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_sriov_alloc_vf_vswitching(struct efx_nic *efx) efx 189 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 193 drivers/net/ethernet/sfc/ef10_sriov.c nic_data->vf = kcalloc(efx->vf_count, sizeof(struct ef10_vf), efx 198 drivers/net/ethernet/sfc/ef10_sriov.c for (i = 0; i < efx->vf_count; i++) { efx 200 drivers/net/ethernet/sfc/ef10_sriov.c nic_data->vf[i].efx = NULL; efx 203 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_sriov_assign_vf_vport(efx, i); efx 210 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_sriov_free_vf_vports(efx); efx 216 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_sriov_restore_vf_vswitching(struct efx_nic *efx) efx 221 drivers/net/ethernet/sfc/ef10_sriov.c for (i = 0; i < efx->vf_count; i++) { efx 222 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_sriov_assign_vf_vport(efx, i); efx 229 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_sriov_free_vf_vswitching(efx); efx 233 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_vadaptor_alloc_set_features(struct efx_nic *efx) efx 235 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 239 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vadaptor_alloc(efx, nic_data->vport_id); efx 243 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vadaptor_query(efx, nic_data->vport_id, efx 250 drivers/net/ethernet/sfc/ef10_sriov.c efx->fixed_features |= NETIF_F_HW_VLAN_CTAG_FILTER; efx 252 drivers/net/ethernet/sfc/ef10_sriov.c efx->fixed_features &= ~NETIF_F_HW_VLAN_CTAG_FILTER; efx 257 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vadaptor_free(efx, EVB_PORT_ID_ASSIGNED); efx 265 drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_vswitching_probe_pf(struct efx_nic *efx) efx 267 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 268 drivers/net/ethernet/sfc/ef10_sriov.c struct net_device *net_dev = efx->net_dev; efx 271 drivers/net/ethernet/sfc/ef10_sriov.c if (pci_sriov_get_totalvfs(efx->pci_dev) <= 0) { efx 273 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vadaptor_alloc_set_features(efx); efx 277 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vswitch_alloc(efx, EVB_PORT_ID_ASSIGNED, efx 282 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vport_alloc(efx, EVB_PORT_ID_ASSIGNED, efx 288 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vport_add_mac(efx, nic_data->vport_id, net_dev->dev_addr); efx 293 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vadaptor_alloc_set_features(efx); efx 299 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vport_del_mac(efx, nic_data->vport_id, nic_data->vport_mac); efx 302 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vport_free(efx, nic_data->vport_id); efx 305 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vswitch_free(efx, EVB_PORT_ID_ASSIGNED); efx 310 drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_vswitching_probe_vf(struct efx_nic *efx) efx 312 drivers/net/ethernet/sfc/ef10_sriov.c return efx_ef10_vadaptor_alloc_set_features(efx); efx 315 drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_vswitching_restore_pf(struct efx_nic *efx) efx 317 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 323 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vswitching_probe_pf(efx); efx 327 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_sriov_restore_vf_vswitching(efx); efx 336 drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_vswitching_restore_vf(struct efx_nic *efx) efx 338 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 344 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vadaptor_free(efx, EVB_PORT_ID_ASSIGNED); efx 352 drivers/net/ethernet/sfc/ef10_sriov.c void efx_ef10_vswitching_remove_pf(struct efx_nic *efx) efx 354 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 356 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_sriov_free_vf_vswitching(efx); efx 358 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vadaptor_free(efx, nic_data->vport_id); efx 364 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vport_del_mac(efx, nic_data->vport_id, efx 365 drivers/net/ethernet/sfc/ef10_sriov.c efx->net_dev->dev_addr); efx 368 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vport_free(efx, nic_data->vport_id); efx 372 drivers/net/ethernet/sfc/ef10_sriov.c if (!pci_vfs_assigned(efx->pci_dev)) efx 373 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vswitch_free(efx, nic_data->vport_id); efx 376 drivers/net/ethernet/sfc/ef10_sriov.c void efx_ef10_vswitching_remove_vf(struct efx_nic *efx) efx 378 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_vadaptor_free(efx, EVB_PORT_ID_ASSIGNED); efx 381 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_pci_sriov_enable(struct efx_nic *efx, int num_vfs) efx 384 drivers/net/ethernet/sfc/ef10_sriov.c struct pci_dev *dev = efx->pci_dev; efx 386 drivers/net/ethernet/sfc/ef10_sriov.c efx->vf_count = num_vfs; efx 388 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_sriov_alloc_vf_vswitching(efx); efx 398 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_sriov_free_vf_vswitching(efx); efx 400 drivers/net/ethernet/sfc/ef10_sriov.c efx->vf_count = 0; efx 401 drivers/net/ethernet/sfc/ef10_sriov.c netif_err(efx, probe, efx->net_dev, efx 406 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_pci_sriov_disable(struct efx_nic *efx, bool force) efx 408 drivers/net/ethernet/sfc/ef10_sriov.c struct pci_dev *dev = efx->pci_dev; efx 414 drivers/net/ethernet/sfc/ef10_sriov.c netif_info(efx, drv, efx->net_dev, "VFs are assigned to guests; " efx 422 drivers/net/ethernet/sfc/ef10_sriov.c efx_ef10_sriov_free_vf_vswitching(efx); efx 423 drivers/net/ethernet/sfc/ef10_sriov.c efx->vf_count = 0; efx 427 drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_sriov_configure(struct efx_nic *efx, int num_vfs) efx 430 drivers/net/ethernet/sfc/ef10_sriov.c return efx_ef10_pci_sriov_disable(efx, false); efx 432 drivers/net/ethernet/sfc/ef10_sriov.c return efx_ef10_pci_sriov_enable(efx, num_vfs); efx 435 drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_sriov_init(struct efx_nic *efx) efx 440 drivers/net/ethernet/sfc/ef10_sriov.c void efx_ef10_sriov_fini(struct efx_nic *efx) efx 442 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 448 drivers/net/ethernet/sfc/ef10_sriov.c if (pci_num_vf(efx->pci_dev) && !pci_vfs_assigned(efx->pci_dev)) efx 449 drivers/net/ethernet/sfc/ef10_sriov.c pci_disable_sriov(efx->pci_dev); efx 454 drivers/net/ethernet/sfc/ef10_sriov.c for (i = 0; i < efx->vf_count; ++i) { efx 455 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_nic *vf_efx = nic_data->vf[i].efx; efx 461 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_pci_sriov_disable(efx, true); efx 463 drivers/net/ethernet/sfc/ef10_sriov.c netif_dbg(efx, drv, efx->net_dev, efx 466 drivers/net/ethernet/sfc/ef10_sriov.c netif_dbg(efx, drv, efx->net_dev, "SRIOV disabled\n"); efx 469 drivers/net/ethernet/sfc/ef10_sriov.c static int efx_ef10_vport_del_vf_mac(struct efx_nic *efx, unsigned int port_id, efx 480 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_mcdi_rpc(efx, MC_CMD_VPORT_DEL_MAC_ADDRESS, inbuf, efx 486 drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf_i, u8 *mac) efx 488 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 495 drivers/net/ethernet/sfc/ef10_sriov.c if (vf_i >= efx->vf_count) efx 499 drivers/net/ethernet/sfc/ef10_sriov.c if (vf->efx) { efx 500 drivers/net/ethernet/sfc/ef10_sriov.c efx_device_detach_sync(vf->efx); efx 501 drivers/net/ethernet/sfc/ef10_sriov.c efx_net_stop(vf->efx->net_dev); efx 503 drivers/net/ethernet/sfc/ef10_sriov.c down_write(&vf->efx->filter_sem); efx 504 drivers/net/ethernet/sfc/ef10_sriov.c vf->efx->type->filter_table_remove(vf->efx); efx 506 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vadaptor_free(vf->efx, EVB_PORT_ID_ASSIGNED); efx 508 drivers/net/ethernet/sfc/ef10_sriov.c up_write(&vf->efx->filter_sem); efx 513 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_evb_port_assign(efx, EVB_PORT_ID_NULL, vf_i); efx 518 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vport_del_vf_mac(efx, vf->vport_id, vf->mac); efx 524 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vport_add_mac(efx, vf->vport_id, mac); efx 529 drivers/net/ethernet/sfc/ef10_sriov.c if (vf->efx) efx 530 drivers/net/ethernet/sfc/ef10_sriov.c ether_addr_copy(vf->efx->net_dev->dev_addr, mac); efx 535 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i); efx 539 drivers/net/ethernet/sfc/ef10_sriov.c if (vf->efx) { efx 541 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vadaptor_alloc(vf->efx, EVB_PORT_ID_ASSIGNED); efx 543 drivers/net/ethernet/sfc/ef10_sriov.c up_write(&vf->efx->filter_sem); efx 546 drivers/net/ethernet/sfc/ef10_sriov.c vf->efx->type->filter_table_probe(vf->efx); efx 547 drivers/net/ethernet/sfc/ef10_sriov.c up_write(&vf->efx->filter_sem); efx 548 drivers/net/ethernet/sfc/ef10_sriov.c efx_net_open(vf->efx->net_dev); efx 549 drivers/net/ethernet/sfc/ef10_sriov.c efx_device_attach_if_not_resetting(vf->efx); efx 559 drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_sriov_set_vf_vlan(struct efx_nic *efx, int vf_i, u16 vlan, efx 562 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 567 drivers/net/ethernet/sfc/ef10_sriov.c if (vf_i >= efx->vf_count) efx 578 drivers/net/ethernet/sfc/ef10_sriov.c if (vf->efx) { efx 579 drivers/net/ethernet/sfc/ef10_sriov.c efx_device_detach_sync(vf->efx); efx 580 drivers/net/ethernet/sfc/ef10_sriov.c efx_net_stop(vf->efx->net_dev); efx 582 drivers/net/ethernet/sfc/ef10_sriov.c mutex_lock(&vf->efx->mac_lock); efx 583 drivers/net/ethernet/sfc/ef10_sriov.c down_write(&vf->efx->filter_sem); efx 584 drivers/net/ethernet/sfc/ef10_sriov.c vf->efx->type->filter_table_remove(vf->efx); efx 586 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vadaptor_free(vf->efx, EVB_PORT_ID_ASSIGNED); efx 592 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_evb_port_assign(efx, EVB_PORT_ID_NULL, vf_i); efx 594 drivers/net/ethernet/sfc/ef10_sriov.c netif_warn(efx, drv, efx->net_dev, efx 596 drivers/net/ethernet/sfc/ef10_sriov.c netif_warn(efx, drv, efx->net_dev, efx 598 drivers/net/ethernet/sfc/ef10_sriov.c netif_warn(efx, drv, efx->net_dev, efx 606 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vport_del_mac(efx, vf->vport_id, vf->mac); efx 612 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vport_free(efx, vf->vport_id); efx 622 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_ef10_vport_alloc(efx, EVB_PORT_ID_ASSIGNED, efx 630 drivers/net/ethernet/sfc/ef10_sriov.c rc2 = efx_ef10_vport_add_mac(efx, vf->vport_id, vf->mac); efx 638 drivers/net/ethernet/sfc/ef10_sriov.c rc2 = efx_ef10_evb_port_assign(efx, vf->vport_id, vf_i); efx 645 drivers/net/ethernet/sfc/ef10_sriov.c if (vf->efx) { efx 646 drivers/net/ethernet/sfc/ef10_sriov.c rc2 = efx_ef10_vadaptor_alloc(vf->efx, EVB_PORT_ID_ASSIGNED); efx 652 drivers/net/ethernet/sfc/ef10_sriov.c if (vf->efx) { efx 653 drivers/net/ethernet/sfc/ef10_sriov.c rc2 = vf->efx->type->filter_table_probe(vf->efx); efx 657 drivers/net/ethernet/sfc/ef10_sriov.c up_write(&vf->efx->filter_sem); efx 658 drivers/net/ethernet/sfc/ef10_sriov.c mutex_unlock(&vf->efx->mac_lock); efx 660 drivers/net/ethernet/sfc/ef10_sriov.c rc2 = efx_net_open(vf->efx->net_dev); efx 664 drivers/net/ethernet/sfc/ef10_sriov.c efx_device_attach_if_not_resetting(vf->efx); efx 669 drivers/net/ethernet/sfc/ef10_sriov.c if (vf->efx) { efx 670 drivers/net/ethernet/sfc/ef10_sriov.c up_write(&vf->efx->filter_sem); efx 671 drivers/net/ethernet/sfc/ef10_sriov.c mutex_unlock(&vf->efx->mac_lock); efx 674 drivers/net/ethernet/sfc/ef10_sriov.c if (vf->efx) { efx 675 drivers/net/ethernet/sfc/ef10_sriov.c netif_err(efx, drv, efx->net_dev, efx 677 drivers/net/ethernet/sfc/ef10_sriov.c efx_schedule_reset(vf->efx, RESET_TYPE_DATAPATH); efx 679 drivers/net/ethernet/sfc/ef10_sriov.c netif_err(efx, drv, efx->net_dev, efx 682 drivers/net/ethernet/sfc/ef10_sriov.c netif_err(efx, drv, efx->net_dev, efx 689 drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf_i, efx 695 drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_sriov_set_vf_link_state(struct efx_nic *efx, int vf_i, efx 699 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 712 drivers/net/ethernet/sfc/ef10_sriov.c return efx_mcdi_rpc(efx, MC_CMD_LINK_STATE_MODE, inbuf, sizeof(inbuf), efx 716 drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i, efx 722 drivers/net/ethernet/sfc/ef10_sriov.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 727 drivers/net/ethernet/sfc/ef10_sriov.c if (vf_i >= efx->vf_count) efx 748 drivers/net/ethernet/sfc/ef10_sriov.c rc = efx_mcdi_rpc(efx, MC_CMD_LINK_STATE_MODE, inbuf, sizeof(inbuf), efx 22 drivers/net/ethernet/sfc/ef10_sriov.h struct efx_nic *efx; efx 31 drivers/net/ethernet/sfc/ef10_sriov.h static inline bool efx_ef10_sriov_wanted(struct efx_nic *efx) efx 36 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_sriov_configure(struct efx_nic *efx, int num_vfs); efx 37 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_sriov_init(struct efx_nic *efx); efx 38 drivers/net/ethernet/sfc/ef10_sriov.h static inline void efx_ef10_sriov_reset(struct efx_nic *efx) {} efx 39 drivers/net/ethernet/sfc/ef10_sriov.h void efx_ef10_sriov_fini(struct efx_nic *efx); efx 40 drivers/net/ethernet/sfc/ef10_sriov.h static inline void efx_ef10_sriov_flr(struct efx_nic *efx, unsigned vf_i) {} efx 42 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf, u8 *mac); efx 44 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_sriov_set_vf_vlan(struct efx_nic *efx, int vf_i, efx 47 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf, efx 50 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_sriov_get_vf_config(struct efx_nic *efx, int vf_i, efx 53 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_sriov_set_vf_link_state(struct efx_nic *efx, int vf_i, efx 56 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_vswitching_probe_pf(struct efx_nic *efx); efx 57 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_vswitching_probe_vf(struct efx_nic *efx); efx 58 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_vswitching_restore_pf(struct efx_nic *efx); efx 59 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_vswitching_restore_vf(struct efx_nic *efx); efx 60 drivers/net/ethernet/sfc/ef10_sriov.h void efx_ef10_vswitching_remove_pf(struct efx_nic *efx); efx 61 drivers/net/ethernet/sfc/ef10_sriov.h void efx_ef10_vswitching_remove_vf(struct efx_nic *efx); efx 62 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_vport_add_mac(struct efx_nic *efx, efx 64 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_vport_del_mac(struct efx_nic *efx, efx 66 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_vadaptor_alloc(struct efx_nic *efx, unsigned int port_id); efx 67 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_vadaptor_query(struct efx_nic *efx, unsigned int port_id, efx 70 drivers/net/ethernet/sfc/ef10_sriov.h int efx_ef10_vadaptor_free(struct efx_nic *efx, unsigned int port_id); efx 217 drivers/net/ethernet/sfc/efx.c static int efx_soft_enable_interrupts(struct efx_nic *efx); efx 218 drivers/net/ethernet/sfc/efx.c static void efx_soft_disable_interrupts(struct efx_nic *efx); efx 220 drivers/net/ethernet/sfc/efx.c static void efx_remove_channels(struct efx_nic *efx); efx 222 drivers/net/ethernet/sfc/efx.c static void efx_remove_port(struct efx_nic *efx); efx 224 drivers/net/ethernet/sfc/efx.c static void efx_fini_napi(struct efx_nic *efx); efx 226 drivers/net/ethernet/sfc/efx.c static void efx_fini_struct(struct efx_nic *efx); efx 227 drivers/net/ethernet/sfc/efx.c static void efx_start_all(struct efx_nic *efx); efx 228 drivers/net/ethernet/sfc/efx.c static void efx_stop_all(struct efx_nic *efx); efx 230 drivers/net/ethernet/sfc/efx.c #define EFX_ASSERT_RESET_SERIALISED(efx) \ efx 232 drivers/net/ethernet/sfc/efx.c if ((efx->state == STATE_READY) || \ efx 233 drivers/net/ethernet/sfc/efx.c (efx->state == STATE_RECOVERY) || \ efx 234 drivers/net/ethernet/sfc/efx.c (efx->state == STATE_DISABLED)) \ efx 238 drivers/net/ethernet/sfc/efx.c static int efx_check_disabled(struct efx_nic *efx) efx 240 drivers/net/ethernet/sfc/efx.c if (efx->state == STATE_DISABLED || efx->state == STATE_RECOVERY) { efx 241 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, efx 309 drivers/net/ethernet/sfc/efx.c static void efx_update_irq_mod(struct efx_nic *efx, struct efx_channel *channel) efx 311 drivers/net/ethernet/sfc/efx.c int step = efx->irq_mod_step_us; efx 316 drivers/net/ethernet/sfc/efx.c efx->type->push_irq_moderation(channel); efx 320 drivers/net/ethernet/sfc/efx.c efx->irq_rx_moderation_us) { efx 322 drivers/net/ethernet/sfc/efx.c efx->type->push_irq_moderation(channel); efx 334 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = channel->efx; efx 337 drivers/net/ethernet/sfc/efx.c netif_vdbg(efx, intr, efx->net_dev, efx 345 drivers/net/ethernet/sfc/efx.c efx->irq_rx_adaptive && efx 347 drivers/net/ethernet/sfc/efx.c efx_update_irq_mod(efx, channel); efx 374 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = channel->efx; efx 377 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, probe, efx->net_dev, efx 382 drivers/net/ethernet/sfc/efx.c entries = roundup_pow_of_two(efx->rxq_entries + efx->txq_entries + 128); efx 392 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = channel->efx; efx 397 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, efx 402 drivers/net/ethernet/sfc/efx.c efx->type->push_irq_moderation(channel); efx 412 drivers/net/ethernet/sfc/efx.c netif_dbg(channel->efx, ifup, channel->efx->net_dev, efx 438 drivers/net/ethernet/sfc/efx.c netif_dbg(channel->efx, drv, channel->efx->net_dev, efx 447 drivers/net/ethernet/sfc/efx.c netif_dbg(channel->efx, drv, channel->efx->net_dev, efx 461 drivers/net/ethernet/sfc/efx.c efx_alloc_channel(struct efx_nic *efx, int i, struct efx_channel *old_channel) efx 472 drivers/net/ethernet/sfc/efx.c channel->efx = efx; efx 478 drivers/net/ethernet/sfc/efx.c tx_queue->efx = efx; efx 488 drivers/net/ethernet/sfc/efx.c rx_queue->efx = efx; efx 543 drivers/net/ethernet/sfc/efx.c netif_dbg(channel->efx, probe, channel->efx->net_dev, efx 578 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = channel->efx; efx 583 drivers/net/ethernet/sfc/efx.c if (efx->tx_channel_offset == 0) { efx 585 drivers/net/ethernet/sfc/efx.c } else if (channel->channel < efx->tx_channel_offset) { efx 589 drivers/net/ethernet/sfc/efx.c number -= efx->tx_channel_offset; efx 591 drivers/net/ethernet/sfc/efx.c snprintf(buf, len, "%s%s-%d", efx->name, type, number); efx 594 drivers/net/ethernet/sfc/efx.c static void efx_set_channel_names(struct efx_nic *efx) efx 598 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) efx 600 drivers/net/ethernet/sfc/efx.c efx->msi_context[channel->channel].name, efx 601 drivers/net/ethernet/sfc/efx.c sizeof(efx->msi_context[0].name)); efx 604 drivers/net/ethernet/sfc/efx.c static int efx_probe_channels(struct efx_nic *efx) efx 610 drivers/net/ethernet/sfc/efx.c efx->next_buffer_table = 0; efx 617 drivers/net/ethernet/sfc/efx.c efx_for_each_channel_rev(channel, efx) { efx 620 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, efx 626 drivers/net/ethernet/sfc/efx.c efx_set_channel_names(efx); efx 631 drivers/net/ethernet/sfc/efx.c efx_remove_channels(efx); efx 639 drivers/net/ethernet/sfc/efx.c static void efx_start_datapath(struct efx_nic *efx) efx 641 drivers/net/ethernet/sfc/efx.c netdev_features_t old_features = efx->net_dev->features; efx 642 drivers/net/ethernet/sfc/efx.c bool old_rx_scatter = efx->rx_scatter; efx 652 drivers/net/ethernet/sfc/efx.c efx->rx_dma_len = (efx->rx_prefix_size + efx 653 drivers/net/ethernet/sfc/efx.c EFX_MAX_FRAME_LEN(efx->net_dev->mtu) + efx 654 drivers/net/ethernet/sfc/efx.c efx->type->rx_buffer_padding); efx 656 drivers/net/ethernet/sfc/efx.c efx->rx_ip_align + efx->rx_dma_len); efx 658 drivers/net/ethernet/sfc/efx.c efx->rx_scatter = efx->type->always_rx_scatter; efx 659 drivers/net/ethernet/sfc/efx.c efx->rx_buffer_order = 0; efx 660 drivers/net/ethernet/sfc/efx.c } else if (efx->type->can_rx_scatter) { efx 666 drivers/net/ethernet/sfc/efx.c efx->rx_scatter = true; efx 667 drivers/net/ethernet/sfc/efx.c efx->rx_dma_len = EFX_RX_USR_BUF_SIZE; efx 668 drivers/net/ethernet/sfc/efx.c efx->rx_buffer_order = 0; efx 670 drivers/net/ethernet/sfc/efx.c efx->rx_scatter = false; efx 671 drivers/net/ethernet/sfc/efx.c efx->rx_buffer_order = get_order(rx_buf_len); efx 674 drivers/net/ethernet/sfc/efx.c efx_rx_config_page_split(efx); efx 675 drivers/net/ethernet/sfc/efx.c if (efx->rx_buffer_order) efx 676 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, efx 678 drivers/net/ethernet/sfc/efx.c efx->rx_dma_len, efx->rx_buffer_order, efx 679 drivers/net/ethernet/sfc/efx.c efx->rx_pages_per_batch); efx 681 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, efx 683 drivers/net/ethernet/sfc/efx.c efx->rx_dma_len, efx->rx_page_buf_step, efx 684 drivers/net/ethernet/sfc/efx.c efx->rx_bufs_per_page, efx->rx_pages_per_batch); efx 689 drivers/net/ethernet/sfc/efx.c efx->net_dev->hw_features |= efx->net_dev->features; efx 690 drivers/net/ethernet/sfc/efx.c efx->net_dev->hw_features &= ~efx->fixed_features; efx 691 drivers/net/ethernet/sfc/efx.c efx->net_dev->features |= efx->fixed_features; efx 692 drivers/net/ethernet/sfc/efx.c if (efx->net_dev->features != old_features) efx 693 drivers/net/ethernet/sfc/efx.c netdev_features_change(efx->net_dev); efx 696 drivers/net/ethernet/sfc/efx.c if (efx->rx_scatter != old_rx_scatter) efx 697 drivers/net/ethernet/sfc/efx.c efx->type->filter_update_rx_scatter(efx); efx 706 drivers/net/ethernet/sfc/efx.c efx->txq_stop_thresh = efx->txq_entries - efx_tx_max_skb_descs(efx); efx 707 drivers/net/ethernet/sfc/efx.c efx->txq_wake_thresh = efx->txq_stop_thresh / 2; efx 710 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 713 drivers/net/ethernet/sfc/efx.c atomic_inc(&efx->active_queues); efx 718 drivers/net/ethernet/sfc/efx.c atomic_inc(&efx->active_queues); efx 727 drivers/net/ethernet/sfc/efx.c efx_ptp_start_datapath(efx); efx 729 drivers/net/ethernet/sfc/efx.c if (netif_device_present(efx->net_dev)) efx 730 drivers/net/ethernet/sfc/efx.c netif_tx_wake_all_queues(efx->net_dev); efx 733 drivers/net/ethernet/sfc/efx.c static void efx_stop_datapath(struct efx_nic *efx) efx 740 drivers/net/ethernet/sfc/efx.c EFX_ASSERT_RESET_SERIALISED(efx); efx 741 drivers/net/ethernet/sfc/efx.c BUG_ON(efx->port_enabled); efx 743 drivers/net/ethernet/sfc/efx.c efx_ptp_stop_datapath(efx); efx 746 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 751 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 764 drivers/net/ethernet/sfc/efx.c rc = efx->type->fini_dmaq(efx); efx 766 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "failed to flush queues\n"); efx 768 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, efx 772 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 785 drivers/net/ethernet/sfc/efx.c netif_dbg(channel->efx, drv, channel->efx->net_dev, efx 796 drivers/net/ethernet/sfc/efx.c static void efx_remove_channels(struct efx_nic *efx) efx 800 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) efx 805 drivers/net/ethernet/sfc/efx.c efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries) efx 812 drivers/net/ethernet/sfc/efx.c rc = efx_check_disabled(efx); efx 819 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 838 drivers/net/ethernet/sfc/efx.c efx_device_detach_sync(efx); efx 839 drivers/net/ethernet/sfc/efx.c efx_stop_all(efx); efx 840 drivers/net/ethernet/sfc/efx.c efx_soft_disable_interrupts(efx); efx 844 drivers/net/ethernet/sfc/efx.c for (i = 0; i < efx->n_channels; i++) { efx 845 drivers/net/ethernet/sfc/efx.c channel = efx->channel[i]; efx 856 drivers/net/ethernet/sfc/efx.c old_rxq_entries = efx->rxq_entries; efx 857 drivers/net/ethernet/sfc/efx.c old_txq_entries = efx->txq_entries; efx 858 drivers/net/ethernet/sfc/efx.c efx->rxq_entries = rxq_entries; efx 859 drivers/net/ethernet/sfc/efx.c efx->txq_entries = txq_entries; efx 860 drivers/net/ethernet/sfc/efx.c for (i = 0; i < efx->n_channels; i++) { efx 861 drivers/net/ethernet/sfc/efx.c channel = efx->channel[i]; efx 862 drivers/net/ethernet/sfc/efx.c efx->channel[i] = other_channel[i]; efx 867 drivers/net/ethernet/sfc/efx.c efx->next_buffer_table = next_buffer_table; efx 869 drivers/net/ethernet/sfc/efx.c for (i = 0; i < efx->n_channels; i++) { efx 870 drivers/net/ethernet/sfc/efx.c channel = efx->channel[i]; efx 876 drivers/net/ethernet/sfc/efx.c efx_init_napi_channel(efx->channel[i]); efx 881 drivers/net/ethernet/sfc/efx.c for (i = 0; i < efx->n_channels; i++) { efx 890 drivers/net/ethernet/sfc/efx.c rc2 = efx_soft_enable_interrupts(efx); efx 893 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, efx 895 drivers/net/ethernet/sfc/efx.c efx_schedule_reset(efx, RESET_TYPE_DISABLE); efx 897 drivers/net/ethernet/sfc/efx.c efx_start_all(efx); efx 898 drivers/net/ethernet/sfc/efx.c efx_device_attach_if_not_resetting(efx); efx 904 drivers/net/ethernet/sfc/efx.c efx->rxq_entries = old_rxq_entries; efx 905 drivers/net/ethernet/sfc/efx.c efx->txq_entries = old_txq_entries; efx 906 drivers/net/ethernet/sfc/efx.c for (i = 0; i < efx->n_channels; i++) { efx 907 drivers/net/ethernet/sfc/efx.c channel = efx->channel[i]; efx 908 drivers/net/ethernet/sfc/efx.c efx->channel[i] = other_channel[i]; efx 921 drivers/net/ethernet/sfc/efx.c return channel->channel - channel->efx->tx_channel_offset < efx 922 drivers/net/ethernet/sfc/efx.c channel->efx->n_tx_channels; efx 954 drivers/net/ethernet/sfc/efx.c void efx_link_status_changed(struct efx_nic *efx) efx 956 drivers/net/ethernet/sfc/efx.c struct efx_link_state *link_state = &efx->link_state; efx 962 drivers/net/ethernet/sfc/efx.c if (!netif_running(efx->net_dev)) efx 965 drivers/net/ethernet/sfc/efx.c if (link_state->up != netif_carrier_ok(efx->net_dev)) { efx 966 drivers/net/ethernet/sfc/efx.c efx->n_link_state_changes++; efx 969 drivers/net/ethernet/sfc/efx.c netif_carrier_on(efx->net_dev); efx 971 drivers/net/ethernet/sfc/efx.c netif_carrier_off(efx->net_dev); efx 976 drivers/net/ethernet/sfc/efx.c netif_info(efx, link, efx->net_dev, efx 979 drivers/net/ethernet/sfc/efx.c efx->net_dev->mtu); efx 981 drivers/net/ethernet/sfc/efx.c netif_info(efx, link, efx->net_dev, "link down\n"); efx 984 drivers/net/ethernet/sfc/efx.c void efx_link_set_advertising(struct efx_nic *efx, efx 987 drivers/net/ethernet/sfc/efx.c memcpy(efx->link_advertising, advertising, efx 990 drivers/net/ethernet/sfc/efx.c efx->link_advertising[0] |= ADVERTISED_Autoneg; efx 992 drivers/net/ethernet/sfc/efx.c efx->wanted_fc |= (EFX_FC_TX | EFX_FC_RX); efx 994 drivers/net/ethernet/sfc/efx.c efx->wanted_fc &= ~(EFX_FC_TX | EFX_FC_RX); efx 996 drivers/net/ethernet/sfc/efx.c efx->wanted_fc ^= EFX_FC_TX; efx 1002 drivers/net/ethernet/sfc/efx.c void efx_link_clear_advertising(struct efx_nic *efx) efx 1004 drivers/net/ethernet/sfc/efx.c bitmap_zero(efx->link_advertising, __ETHTOOL_LINK_MODE_MASK_NBITS); efx 1005 drivers/net/ethernet/sfc/efx.c efx->wanted_fc &= ~(EFX_FC_TX | EFX_FC_RX); efx 1008 drivers/net/ethernet/sfc/efx.c void efx_link_set_wanted_fc(struct efx_nic *efx, u8 wanted_fc) efx 1010 drivers/net/ethernet/sfc/efx.c efx->wanted_fc = wanted_fc; efx 1011 drivers/net/ethernet/sfc/efx.c if (efx->link_advertising[0]) { efx 1013 drivers/net/ethernet/sfc/efx.c efx->link_advertising[0] |= (ADVERTISED_Pause | efx 1016 drivers/net/ethernet/sfc/efx.c efx->link_advertising[0] &= ~(ADVERTISED_Pause | efx 1019 drivers/net/ethernet/sfc/efx.c efx->link_advertising[0] ^= ADVERTISED_Asym_Pause; efx 1023 drivers/net/ethernet/sfc/efx.c static void efx_fini_port(struct efx_nic *efx); efx 1028 drivers/net/ethernet/sfc/efx.c void efx_mac_reconfigure(struct efx_nic *efx) efx 1030 drivers/net/ethernet/sfc/efx.c down_read(&efx->filter_sem); efx 1031 drivers/net/ethernet/sfc/efx.c efx->type->reconfigure_mac(efx); efx 1032 drivers/net/ethernet/sfc/efx.c up_read(&efx->filter_sem); efx 1042 drivers/net/ethernet/sfc/efx.c int __efx_reconfigure_port(struct efx_nic *efx) efx 1047 drivers/net/ethernet/sfc/efx.c WARN_ON(!mutex_is_locked(&efx->mac_lock)); efx 1050 drivers/net/ethernet/sfc/efx.c phy_mode = efx->phy_mode; efx 1051 drivers/net/ethernet/sfc/efx.c if (LOOPBACK_INTERNAL(efx)) efx 1052 drivers/net/ethernet/sfc/efx.c efx->phy_mode |= PHY_MODE_TX_DISABLED; efx 1054 drivers/net/ethernet/sfc/efx.c efx->phy_mode &= ~PHY_MODE_TX_DISABLED; efx 1056 drivers/net/ethernet/sfc/efx.c rc = efx->type->reconfigure_port(efx); efx 1059 drivers/net/ethernet/sfc/efx.c efx->phy_mode = phy_mode; efx 1066 drivers/net/ethernet/sfc/efx.c int efx_reconfigure_port(struct efx_nic *efx) efx 1070 drivers/net/ethernet/sfc/efx.c EFX_ASSERT_RESET_SERIALISED(efx); efx 1072 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->mac_lock); efx 1073 drivers/net/ethernet/sfc/efx.c rc = __efx_reconfigure_port(efx); efx 1074 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 1084 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = container_of(data, struct efx_nic, mac_work); efx 1086 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->mac_lock); efx 1087 drivers/net/ethernet/sfc/efx.c if (efx->port_enabled) efx 1088 drivers/net/ethernet/sfc/efx.c efx_mac_reconfigure(efx); efx 1089 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 1092 drivers/net/ethernet/sfc/efx.c static int efx_probe_port(struct efx_nic *efx) efx 1096 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, probe, efx->net_dev, "create port\n"); efx 1099 drivers/net/ethernet/sfc/efx.c efx->phy_mode = PHY_MODE_SPECIAL; efx 1102 drivers/net/ethernet/sfc/efx.c rc = efx->type->probe_port(efx); efx 1107 drivers/net/ethernet/sfc/efx.c ether_addr_copy(efx->net_dev->dev_addr, efx->net_dev->perm_addr); efx 1112 drivers/net/ethernet/sfc/efx.c static int efx_init_port(struct efx_nic *efx) efx 1116 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, "init port\n"); efx 1118 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->mac_lock); efx 1120 drivers/net/ethernet/sfc/efx.c rc = efx->phy_op->init(efx); efx 1124 drivers/net/ethernet/sfc/efx.c efx->port_initialized = true; efx 1128 drivers/net/ethernet/sfc/efx.c efx_mac_reconfigure(efx); efx 1131 drivers/net/ethernet/sfc/efx.c rc = efx->phy_op->reconfigure(efx); efx 1135 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 1139 drivers/net/ethernet/sfc/efx.c efx->phy_op->fini(efx); efx 1141 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 1145 drivers/net/ethernet/sfc/efx.c static void efx_start_port(struct efx_nic *efx) efx 1147 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, ifup, efx->net_dev, "start port\n"); efx 1148 drivers/net/ethernet/sfc/efx.c BUG_ON(efx->port_enabled); efx 1150 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->mac_lock); efx 1151 drivers/net/ethernet/sfc/efx.c efx->port_enabled = true; efx 1154 drivers/net/ethernet/sfc/efx.c efx_mac_reconfigure(efx); efx 1156 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 1164 drivers/net/ethernet/sfc/efx.c static void efx_stop_port(struct efx_nic *efx) efx 1166 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, ifdown, efx->net_dev, "stop port\n"); efx 1168 drivers/net/ethernet/sfc/efx.c EFX_ASSERT_RESET_SERIALISED(efx); efx 1170 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->mac_lock); efx 1171 drivers/net/ethernet/sfc/efx.c efx->port_enabled = false; efx 1172 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 1175 drivers/net/ethernet/sfc/efx.c netif_addr_lock_bh(efx->net_dev); efx 1176 drivers/net/ethernet/sfc/efx.c netif_addr_unlock_bh(efx->net_dev); efx 1178 drivers/net/ethernet/sfc/efx.c cancel_delayed_work_sync(&efx->monitor_work); efx 1179 drivers/net/ethernet/sfc/efx.c efx_selftest_async_cancel(efx); efx 1180 drivers/net/ethernet/sfc/efx.c cancel_work_sync(&efx->mac_work); efx 1183 drivers/net/ethernet/sfc/efx.c static void efx_fini_port(struct efx_nic *efx) efx 1185 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, "shut down port\n"); efx 1187 drivers/net/ethernet/sfc/efx.c if (!efx->port_initialized) efx 1190 drivers/net/ethernet/sfc/efx.c efx->phy_op->fini(efx); efx 1191 drivers/net/ethernet/sfc/efx.c efx->port_initialized = false; efx 1193 drivers/net/ethernet/sfc/efx.c efx->link_state.up = false; efx 1194 drivers/net/ethernet/sfc/efx.c efx_link_status_changed(efx); efx 1197 drivers/net/ethernet/sfc/efx.c static void efx_remove_port(struct efx_nic *efx) efx 1199 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, "destroying port\n"); efx 1201 drivers/net/ethernet/sfc/efx.c efx->type->remove_port(efx); efx 1220 drivers/net/ethernet/sfc/efx.c static void efx_associate(struct efx_nic *efx) efx 1224 drivers/net/ethernet/sfc/efx.c if (efx->primary == efx) { efx 1227 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, probe, efx->net_dev, "adding to primary list\n"); efx 1228 drivers/net/ethernet/sfc/efx.c list_add_tail(&efx->node, &efx_primary_list); efx 1232 drivers/net/ethernet/sfc/efx.c if (efx_same_controller(efx, other)) { efx 1236 drivers/net/ethernet/sfc/efx.c pci_name(efx->pci_dev), efx 1237 drivers/net/ethernet/sfc/efx.c efx->net_dev->name); efx 1239 drivers/net/ethernet/sfc/efx.c &efx->secondary_list); efx 1240 drivers/net/ethernet/sfc/efx.c other->primary = efx; efx 1247 drivers/net/ethernet/sfc/efx.c if (efx_same_controller(efx, other)) { efx 1248 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, probe, efx->net_dev, efx 1252 drivers/net/ethernet/sfc/efx.c list_add_tail(&efx->node, efx 1254 drivers/net/ethernet/sfc/efx.c efx->primary = other; efx 1259 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, probe, efx->net_dev, efx 1261 drivers/net/ethernet/sfc/efx.c list_add_tail(&efx->node, &efx_unassociated_list); efx 1265 drivers/net/ethernet/sfc/efx.c static void efx_dissociate(struct efx_nic *efx) efx 1269 drivers/net/ethernet/sfc/efx.c list_del(&efx->node); efx 1270 drivers/net/ethernet/sfc/efx.c efx->primary = NULL; efx 1272 drivers/net/ethernet/sfc/efx.c list_for_each_entry_safe(other, next, &efx->secondary_list, node) { efx 1282 drivers/net/ethernet/sfc/efx.c static int efx_init_io(struct efx_nic *efx) efx 1284 drivers/net/ethernet/sfc/efx.c struct pci_dev *pci_dev = efx->pci_dev; efx 1285 drivers/net/ethernet/sfc/efx.c dma_addr_t dma_mask = efx->type->max_dma_mask; efx 1286 drivers/net/ethernet/sfc/efx.c unsigned int mem_map_size = efx->type->mem_map_size(efx); efx 1289 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, probe, efx->net_dev, "initialising I/O\n"); efx 1291 drivers/net/ethernet/sfc/efx.c bar = efx->type->mem_bar(efx); efx 1295 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, efx 1313 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, efx 1317 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, probe, efx->net_dev, efx 1320 drivers/net/ethernet/sfc/efx.c efx->membase_phys = pci_resource_start(efx->pci_dev, bar); efx 1323 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, efx 1328 drivers/net/ethernet/sfc/efx.c efx->membase = ioremap_nocache(efx->membase_phys, mem_map_size); efx 1329 drivers/net/ethernet/sfc/efx.c if (!efx->membase) { efx 1330 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, efx 1332 drivers/net/ethernet/sfc/efx.c (unsigned long long)efx->membase_phys, mem_map_size); efx 1336 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, probe, efx->net_dev, efx 1338 drivers/net/ethernet/sfc/efx.c (unsigned long long)efx->membase_phys, mem_map_size, efx 1339 drivers/net/ethernet/sfc/efx.c efx->membase); efx 1344 drivers/net/ethernet/sfc/efx.c pci_release_region(efx->pci_dev, bar); efx 1346 drivers/net/ethernet/sfc/efx.c efx->membase_phys = 0; efx 1348 drivers/net/ethernet/sfc/efx.c pci_disable_device(efx->pci_dev); efx 1353 drivers/net/ethernet/sfc/efx.c static void efx_fini_io(struct efx_nic *efx) efx 1357 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, "shutting down I/O\n"); efx 1359 drivers/net/ethernet/sfc/efx.c if (efx->membase) { efx 1360 drivers/net/ethernet/sfc/efx.c iounmap(efx->membase); efx 1361 drivers/net/ethernet/sfc/efx.c efx->membase = NULL; efx 1364 drivers/net/ethernet/sfc/efx.c if (efx->membase_phys) { efx 1365 drivers/net/ethernet/sfc/efx.c bar = efx->type->mem_bar(efx); efx 1366 drivers/net/ethernet/sfc/efx.c pci_release_region(efx->pci_dev, bar); efx 1367 drivers/net/ethernet/sfc/efx.c efx->membase_phys = 0; efx 1371 drivers/net/ethernet/sfc/efx.c if (!pci_vfs_assigned(efx->pci_dev)) efx 1372 drivers/net/ethernet/sfc/efx.c pci_disable_device(efx->pci_dev); efx 1375 drivers/net/ethernet/sfc/efx.c void efx_set_default_rx_indir_table(struct efx_nic *efx, efx 1382 drivers/net/ethernet/sfc/efx.c ethtool_rxfh_indir_default(i, efx->rss_spread); efx 1385 drivers/net/ethernet/sfc/efx.c static unsigned int efx_wanted_parallelism(struct efx_nic *efx) efx 1395 drivers/net/ethernet/sfc/efx.c netif_warn(efx, probe, efx->net_dev, efx 1413 drivers/net/ethernet/sfc/efx.c netif_cond_dbg(efx, probe, efx->net_dev, !rss_cpus, warn, efx 1423 drivers/net/ethernet/sfc/efx.c if (efx->type->sriov_wanted) { efx 1424 drivers/net/ethernet/sfc/efx.c if (efx->type->sriov_wanted(efx) && efx_vf_size(efx) > 1 && efx 1425 drivers/net/ethernet/sfc/efx.c count > efx_vf_size(efx)) { efx 1426 drivers/net/ethernet/sfc/efx.c netif_warn(efx, probe, efx->net_dev, efx 1430 drivers/net/ethernet/sfc/efx.c count, efx_vf_size(efx)); efx 1431 drivers/net/ethernet/sfc/efx.c count = efx_vf_size(efx); efx 1442 drivers/net/ethernet/sfc/efx.c static int efx_probe_interrupts(struct efx_nic *efx) efx 1449 drivers/net/ethernet/sfc/efx.c if (efx->extra_channel_type[i]) efx 1452 drivers/net/ethernet/sfc/efx.c if (efx->interrupt_mode == EFX_INT_MODE_MSIX) { efx 1456 drivers/net/ethernet/sfc/efx.c n_channels = efx_wanted_parallelism(efx); efx 1460 drivers/net/ethernet/sfc/efx.c n_channels = min(n_channels, efx->max_channels); efx 1464 drivers/net/ethernet/sfc/efx.c rc = pci_enable_msix_range(efx->pci_dev, efx 1468 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, efx 1470 drivers/net/ethernet/sfc/efx.c if (efx->type->min_interrupt_mode >= EFX_INT_MODE_MSI) efx 1471 drivers/net/ethernet/sfc/efx.c efx->interrupt_mode = EFX_INT_MODE_MSI; efx 1475 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, efx 1478 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, efx 1484 drivers/net/ethernet/sfc/efx.c efx->n_channels = n_channels; efx 1488 drivers/net/ethernet/sfc/efx.c efx->n_tx_channels = min(max(n_channels / 2, efx 1490 drivers/net/ethernet/sfc/efx.c efx->max_tx_channels); efx 1491 drivers/net/ethernet/sfc/efx.c efx->n_rx_channels = max(n_channels - efx 1492 drivers/net/ethernet/sfc/efx.c efx->n_tx_channels, efx 1495 drivers/net/ethernet/sfc/efx.c efx->n_tx_channels = min(n_channels, efx 1496 drivers/net/ethernet/sfc/efx.c efx->max_tx_channels); efx 1497 drivers/net/ethernet/sfc/efx.c efx->n_rx_channels = n_channels; efx 1499 drivers/net/ethernet/sfc/efx.c for (i = 0; i < efx->n_channels; i++) efx 1500 drivers/net/ethernet/sfc/efx.c efx_get_channel(efx, i)->irq = efx 1506 drivers/net/ethernet/sfc/efx.c if (efx->interrupt_mode == EFX_INT_MODE_MSI) { efx 1507 drivers/net/ethernet/sfc/efx.c efx->n_channels = 1; efx 1508 drivers/net/ethernet/sfc/efx.c efx->n_rx_channels = 1; efx 1509 drivers/net/ethernet/sfc/efx.c efx->n_tx_channels = 1; efx 1510 drivers/net/ethernet/sfc/efx.c rc = pci_enable_msi(efx->pci_dev); efx 1512 drivers/net/ethernet/sfc/efx.c efx_get_channel(efx, 0)->irq = efx->pci_dev->irq; efx 1514 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, efx 1516 drivers/net/ethernet/sfc/efx.c if (efx->type->min_interrupt_mode >= EFX_INT_MODE_LEGACY) efx 1517 drivers/net/ethernet/sfc/efx.c efx->interrupt_mode = EFX_INT_MODE_LEGACY; efx 1524 drivers/net/ethernet/sfc/efx.c if (efx->interrupt_mode == EFX_INT_MODE_LEGACY) { efx 1525 drivers/net/ethernet/sfc/efx.c efx->n_channels = 1 + (efx_separate_tx_channels ? 1 : 0); efx 1526 drivers/net/ethernet/sfc/efx.c efx->n_rx_channels = 1; efx 1527 drivers/net/ethernet/sfc/efx.c efx->n_tx_channels = 1; efx 1528 drivers/net/ethernet/sfc/efx.c efx->legacy_irq = efx->pci_dev->irq; efx 1532 drivers/net/ethernet/sfc/efx.c efx->n_extra_tx_channels = 0; efx 1533 drivers/net/ethernet/sfc/efx.c j = efx->n_channels; efx 1535 drivers/net/ethernet/sfc/efx.c if (!efx->extra_channel_type[i]) efx 1537 drivers/net/ethernet/sfc/efx.c if (efx->interrupt_mode != EFX_INT_MODE_MSIX || efx 1538 drivers/net/ethernet/sfc/efx.c efx->n_channels <= extra_channels) { efx 1539 drivers/net/ethernet/sfc/efx.c efx->extra_channel_type[i]->handle_no_channel(efx); efx 1542 drivers/net/ethernet/sfc/efx.c efx_get_channel(efx, j)->type = efx 1543 drivers/net/ethernet/sfc/efx.c efx->extra_channel_type[i]; efx 1544 drivers/net/ethernet/sfc/efx.c if (efx_channel_has_tx_queues(efx_get_channel(efx, j))) efx 1545 drivers/net/ethernet/sfc/efx.c efx->n_extra_tx_channels++; efx 1551 drivers/net/ethernet/sfc/efx.c if (efx->type->sriov_wanted) { efx 1552 drivers/net/ethernet/sfc/efx.c efx->rss_spread = ((efx->n_rx_channels > 1 || efx 1553 drivers/net/ethernet/sfc/efx.c !efx->type->sriov_wanted(efx)) ? efx 1554 drivers/net/ethernet/sfc/efx.c efx->n_rx_channels : efx_vf_size(efx)); efx 1558 drivers/net/ethernet/sfc/efx.c efx->rss_spread = efx->n_rx_channels; efx 1564 drivers/net/ethernet/sfc/efx.c static void efx_set_interrupt_affinity(struct efx_nic *efx) efx 1569 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 1571 drivers/net/ethernet/sfc/efx.c pcibus_to_node(efx->pci_dev->bus)); efx 1576 drivers/net/ethernet/sfc/efx.c static void efx_clear_interrupt_affinity(struct efx_nic *efx) efx 1580 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) efx 1585 drivers/net/ethernet/sfc/efx.c efx_set_interrupt_affinity(struct efx_nic *efx __attribute__ ((unused))) efx 1590 drivers/net/ethernet/sfc/efx.c efx_clear_interrupt_affinity(struct efx_nic *efx __attribute__ ((unused))) efx 1595 drivers/net/ethernet/sfc/efx.c static int efx_soft_enable_interrupts(struct efx_nic *efx) efx 1600 drivers/net/ethernet/sfc/efx.c BUG_ON(efx->state == STATE_DISABLED); efx 1602 drivers/net/ethernet/sfc/efx.c efx->irq_soft_enabled = true; efx 1605 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 1614 drivers/net/ethernet/sfc/efx.c efx_mcdi_mode_event(efx); efx 1619 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 1630 drivers/net/ethernet/sfc/efx.c static void efx_soft_disable_interrupts(struct efx_nic *efx) efx 1634 drivers/net/ethernet/sfc/efx.c if (efx->state == STATE_DISABLED) efx 1637 drivers/net/ethernet/sfc/efx.c efx_mcdi_mode_poll(efx); efx 1639 drivers/net/ethernet/sfc/efx.c efx->irq_soft_enabled = false; efx 1642 drivers/net/ethernet/sfc/efx.c if (efx->legacy_irq) efx 1643 drivers/net/ethernet/sfc/efx.c synchronize_irq(efx->legacy_irq); efx 1645 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 1655 drivers/net/ethernet/sfc/efx.c efx_mcdi_flush_async(efx); efx 1658 drivers/net/ethernet/sfc/efx.c static int efx_enable_interrupts(struct efx_nic *efx) efx 1663 drivers/net/ethernet/sfc/efx.c BUG_ON(efx->state == STATE_DISABLED); efx 1665 drivers/net/ethernet/sfc/efx.c if (efx->eeh_disabled_legacy_irq) { efx 1666 drivers/net/ethernet/sfc/efx.c enable_irq(efx->legacy_irq); efx 1667 drivers/net/ethernet/sfc/efx.c efx->eeh_disabled_legacy_irq = false; efx 1670 drivers/net/ethernet/sfc/efx.c efx->type->irq_enable_master(efx); efx 1672 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 1680 drivers/net/ethernet/sfc/efx.c rc = efx_soft_enable_interrupts(efx); efx 1688 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 1695 drivers/net/ethernet/sfc/efx.c efx->type->irq_disable_non_ev(efx); efx 1700 drivers/net/ethernet/sfc/efx.c static void efx_disable_interrupts(struct efx_nic *efx) efx 1704 drivers/net/ethernet/sfc/efx.c efx_soft_disable_interrupts(efx); efx 1706 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 1711 drivers/net/ethernet/sfc/efx.c efx->type->irq_disable_non_ev(efx); efx 1714 drivers/net/ethernet/sfc/efx.c static void efx_remove_interrupts(struct efx_nic *efx) efx 1719 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) efx 1721 drivers/net/ethernet/sfc/efx.c pci_disable_msi(efx->pci_dev); efx 1722 drivers/net/ethernet/sfc/efx.c pci_disable_msix(efx->pci_dev); efx 1725 drivers/net/ethernet/sfc/efx.c efx->legacy_irq = 0; efx 1728 drivers/net/ethernet/sfc/efx.c static void efx_set_channels(struct efx_nic *efx) efx 1733 drivers/net/ethernet/sfc/efx.c efx->tx_channel_offset = efx 1735 drivers/net/ethernet/sfc/efx.c efx->n_channels - efx->n_tx_channels : 0; efx 1741 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 1742 drivers/net/ethernet/sfc/efx.c if (channel->channel < efx->n_rx_channels) efx 1748 drivers/net/ethernet/sfc/efx.c tx_queue->queue -= (efx->tx_channel_offset * efx 1753 drivers/net/ethernet/sfc/efx.c static int efx_probe_nic(struct efx_nic *efx) efx 1757 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, probe, efx->net_dev, "creating NIC\n"); efx 1760 drivers/net/ethernet/sfc/efx.c rc = efx->type->probe(efx); efx 1765 drivers/net/ethernet/sfc/efx.c if (!efx->max_channels || !efx->max_tx_channels) { efx 1766 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, efx 1776 drivers/net/ethernet/sfc/efx.c rc = efx_probe_interrupts(efx); efx 1780 drivers/net/ethernet/sfc/efx.c efx_set_channels(efx); efx 1783 drivers/net/ethernet/sfc/efx.c rc = efx->type->dimension_resources(efx); efx 1789 drivers/net/ethernet/sfc/efx.c efx_remove_interrupts(efx); efx 1793 drivers/net/ethernet/sfc/efx.c if (efx->n_channels > 1) efx 1794 drivers/net/ethernet/sfc/efx.c netdev_rss_key_fill(efx->rss_context.rx_hash_key, efx 1795 drivers/net/ethernet/sfc/efx.c sizeof(efx->rss_context.rx_hash_key)); efx 1796 drivers/net/ethernet/sfc/efx.c efx_set_default_rx_indir_table(efx, &efx->rss_context); efx 1798 drivers/net/ethernet/sfc/efx.c netif_set_real_num_tx_queues(efx->net_dev, efx->n_tx_channels); efx 1799 drivers/net/ethernet/sfc/efx.c netif_set_real_num_rx_queues(efx->net_dev, efx->n_rx_channels); efx 1802 drivers/net/ethernet/sfc/efx.c efx->irq_mod_step_us = DIV_ROUND_UP(efx->timer_quantum_ns, 1000); efx 1803 drivers/net/ethernet/sfc/efx.c efx_init_irq_moderation(efx, tx_irq_mod_usec, rx_irq_mod_usec, true, efx 1809 drivers/net/ethernet/sfc/efx.c efx_remove_interrupts(efx); efx 1811 drivers/net/ethernet/sfc/efx.c efx->type->remove(efx); efx 1815 drivers/net/ethernet/sfc/efx.c static void efx_remove_nic(struct efx_nic *efx) efx 1817 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, "destroying NIC\n"); efx 1819 drivers/net/ethernet/sfc/efx.c efx_remove_interrupts(efx); efx 1820 drivers/net/ethernet/sfc/efx.c efx->type->remove(efx); efx 1823 drivers/net/ethernet/sfc/efx.c static int efx_probe_filters(struct efx_nic *efx) efx 1827 drivers/net/ethernet/sfc/efx.c init_rwsem(&efx->filter_sem); efx 1828 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->mac_lock); efx 1829 drivers/net/ethernet/sfc/efx.c down_write(&efx->filter_sem); efx 1830 drivers/net/ethernet/sfc/efx.c rc = efx->type->filter_table_probe(efx); efx 1835 drivers/net/ethernet/sfc/efx.c if (efx->type->offload_features & NETIF_F_NTUPLE) { efx 1839 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 1841 drivers/net/ethernet/sfc/efx.c kcalloc(efx->type->max_rx_ip_filters, efx 1848 drivers/net/ethernet/sfc/efx.c i < efx->type->max_rx_ip_filters; efx 1855 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) efx 1857 drivers/net/ethernet/sfc/efx.c efx->type->filter_table_remove(efx); efx 1862 drivers/net/ethernet/sfc/efx.c efx->rps_expire_index = efx->rps_expire_channel = 0; efx 1866 drivers/net/ethernet/sfc/efx.c up_write(&efx->filter_sem); efx 1867 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 1871 drivers/net/ethernet/sfc/efx.c static void efx_remove_filters(struct efx_nic *efx) efx 1876 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) efx 1879 drivers/net/ethernet/sfc/efx.c down_write(&efx->filter_sem); efx 1880 drivers/net/ethernet/sfc/efx.c efx->type->filter_table_remove(efx); efx 1881 drivers/net/ethernet/sfc/efx.c up_write(&efx->filter_sem); efx 1891 drivers/net/ethernet/sfc/efx.c static int efx_probe_all(struct efx_nic *efx) efx 1895 drivers/net/ethernet/sfc/efx.c rc = efx_probe_nic(efx); efx 1897 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, "failed to create NIC\n"); efx 1901 drivers/net/ethernet/sfc/efx.c rc = efx_probe_port(efx); efx 1903 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, "failed to create port\n"); efx 1908 drivers/net/ethernet/sfc/efx.c if (WARN_ON(EFX_DEFAULT_DMAQ_SIZE < EFX_TXQ_MIN_ENT(efx))) { efx 1912 drivers/net/ethernet/sfc/efx.c efx->rxq_entries = efx->txq_entries = EFX_DEFAULT_DMAQ_SIZE; efx 1915 drivers/net/ethernet/sfc/efx.c rc = efx->type->vswitching_probe(efx); efx 1917 drivers/net/ethernet/sfc/efx.c netif_warn(efx, probe, efx->net_dev, efx 1922 drivers/net/ethernet/sfc/efx.c rc = efx_probe_filters(efx); efx 1924 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, efx 1929 drivers/net/ethernet/sfc/efx.c rc = efx_probe_channels(efx); efx 1936 drivers/net/ethernet/sfc/efx.c efx_remove_filters(efx); efx 1939 drivers/net/ethernet/sfc/efx.c efx->type->vswitching_remove(efx); efx 1942 drivers/net/ethernet/sfc/efx.c efx_remove_port(efx); efx 1944 drivers/net/ethernet/sfc/efx.c efx_remove_nic(efx); efx 1956 drivers/net/ethernet/sfc/efx.c static void efx_start_all(struct efx_nic *efx) efx 1958 drivers/net/ethernet/sfc/efx.c EFX_ASSERT_RESET_SERIALISED(efx); efx 1959 drivers/net/ethernet/sfc/efx.c BUG_ON(efx->state == STATE_DISABLED); efx 1963 drivers/net/ethernet/sfc/efx.c if (efx->port_enabled || !netif_running(efx->net_dev) || efx 1964 drivers/net/ethernet/sfc/efx.c efx->reset_pending) efx 1967 drivers/net/ethernet/sfc/efx.c efx_start_port(efx); efx 1968 drivers/net/ethernet/sfc/efx.c efx_start_datapath(efx); efx 1971 drivers/net/ethernet/sfc/efx.c if (efx->type->monitor != NULL) efx 1972 drivers/net/ethernet/sfc/efx.c queue_delayed_work(efx->workqueue, &efx->monitor_work, efx 1978 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->mac_lock); efx 1979 drivers/net/ethernet/sfc/efx.c if (efx->phy_op->poll(efx)) efx 1980 drivers/net/ethernet/sfc/efx.c efx_link_status_changed(efx); efx 1981 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 1983 drivers/net/ethernet/sfc/efx.c efx->type->start_stats(efx); efx 1984 drivers/net/ethernet/sfc/efx.c efx->type->pull_stats(efx); efx 1985 drivers/net/ethernet/sfc/efx.c spin_lock_bh(&efx->stats_lock); efx 1986 drivers/net/ethernet/sfc/efx.c efx->type->update_stats(efx, NULL, NULL); efx 1987 drivers/net/ethernet/sfc/efx.c spin_unlock_bh(&efx->stats_lock); efx 1995 drivers/net/ethernet/sfc/efx.c static void efx_stop_all(struct efx_nic *efx) efx 1997 drivers/net/ethernet/sfc/efx.c EFX_ASSERT_RESET_SERIALISED(efx); efx 2000 drivers/net/ethernet/sfc/efx.c if (!efx->port_enabled) efx 2006 drivers/net/ethernet/sfc/efx.c efx->type->pull_stats(efx); efx 2007 drivers/net/ethernet/sfc/efx.c spin_lock_bh(&efx->stats_lock); efx 2008 drivers/net/ethernet/sfc/efx.c efx->type->update_stats(efx, NULL, NULL); efx 2009 drivers/net/ethernet/sfc/efx.c spin_unlock_bh(&efx->stats_lock); efx 2010 drivers/net/ethernet/sfc/efx.c efx->type->stop_stats(efx); efx 2011 drivers/net/ethernet/sfc/efx.c efx_stop_port(efx); efx 2017 drivers/net/ethernet/sfc/efx.c WARN_ON(netif_running(efx->net_dev) && efx 2018 drivers/net/ethernet/sfc/efx.c netif_device_present(efx->net_dev)); efx 2019 drivers/net/ethernet/sfc/efx.c netif_tx_disable(efx->net_dev); efx 2021 drivers/net/ethernet/sfc/efx.c efx_stop_datapath(efx); efx 2024 drivers/net/ethernet/sfc/efx.c static void efx_remove_all(struct efx_nic *efx) efx 2026 drivers/net/ethernet/sfc/efx.c efx_remove_channels(efx); efx 2027 drivers/net/ethernet/sfc/efx.c efx_remove_filters(efx); efx 2029 drivers/net/ethernet/sfc/efx.c efx->type->vswitching_remove(efx); efx 2031 drivers/net/ethernet/sfc/efx.c efx_remove_port(efx); efx 2032 drivers/net/ethernet/sfc/efx.c efx_remove_nic(efx); efx 2040 drivers/net/ethernet/sfc/efx.c unsigned int efx_usecs_to_ticks(struct efx_nic *efx, unsigned int usecs) efx 2044 drivers/net/ethernet/sfc/efx.c if (usecs * 1000 < efx->timer_quantum_ns) efx 2046 drivers/net/ethernet/sfc/efx.c return usecs * 1000 / efx->timer_quantum_ns; efx 2049 drivers/net/ethernet/sfc/efx.c unsigned int efx_ticks_to_usecs(struct efx_nic *efx, unsigned int ticks) efx 2054 drivers/net/ethernet/sfc/efx.c return DIV_ROUND_UP(ticks * efx->timer_quantum_ns, 1000); efx 2058 drivers/net/ethernet/sfc/efx.c int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs, efx 2065 drivers/net/ethernet/sfc/efx.c EFX_ASSERT_RESET_SERIALISED(efx); efx 2067 drivers/net/ethernet/sfc/efx.c timer_max_us = efx->timer_max_ns / 1000; efx 2072 drivers/net/ethernet/sfc/efx.c if (tx_usecs != rx_usecs && efx->tx_channel_offset == 0 && efx 2074 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "Channels are shared. " efx 2079 drivers/net/ethernet/sfc/efx.c efx->irq_rx_adaptive = rx_adaptive; efx 2080 drivers/net/ethernet/sfc/efx.c efx->irq_rx_moderation_us = rx_usecs; efx 2081 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 2091 drivers/net/ethernet/sfc/efx.c void efx_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs, efx 2094 drivers/net/ethernet/sfc/efx.c *rx_adaptive = efx->irq_rx_adaptive; efx 2095 drivers/net/ethernet/sfc/efx.c *rx_usecs = efx->irq_rx_moderation_us; efx 2101 drivers/net/ethernet/sfc/efx.c if (efx->tx_channel_offset == 0) { efx 2106 drivers/net/ethernet/sfc/efx.c tx_channel = efx->channel[efx->tx_channel_offset]; efx 2120 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = container_of(data, struct efx_nic, efx 2123 drivers/net/ethernet/sfc/efx.c netif_vdbg(efx, timer, efx->net_dev, efx 2126 drivers/net/ethernet/sfc/efx.c BUG_ON(efx->type->monitor == NULL); efx 2131 drivers/net/ethernet/sfc/efx.c if (mutex_trylock(&efx->mac_lock)) { efx 2132 drivers/net/ethernet/sfc/efx.c if (efx->port_enabled) efx 2133 drivers/net/ethernet/sfc/efx.c efx->type->monitor(efx); efx 2134 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 2137 drivers/net/ethernet/sfc/efx.c queue_delayed_work(efx->workqueue, &efx->monitor_work, efx 2152 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2156 drivers/net/ethernet/sfc/efx.c return efx_ptp_set_ts_config(efx, ifr); efx 2158 drivers/net/ethernet/sfc/efx.c return efx_ptp_get_ts_config(efx, ifr); efx 2165 drivers/net/ethernet/sfc/efx.c return mdio_mii_ioctl(&efx->mdio, data, cmd); efx 2176 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = channel->efx; efx 2178 drivers/net/ethernet/sfc/efx.c channel->napi_dev = efx->net_dev; efx 2183 drivers/net/ethernet/sfc/efx.c static void efx_init_napi(struct efx_nic *efx) efx 2187 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) efx 2199 drivers/net/ethernet/sfc/efx.c static void efx_fini_napi(struct efx_nic *efx) efx 2203 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) efx 2216 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2219 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, ifup, efx->net_dev, "opening device on CPU %d\n", efx 2222 drivers/net/ethernet/sfc/efx.c rc = efx_check_disabled(efx); efx 2225 drivers/net/ethernet/sfc/efx.c if (efx->phy_mode & PHY_MODE_SPECIAL) efx 2227 drivers/net/ethernet/sfc/efx.c if (efx_mcdi_poll_reboot(efx) && efx_reset(efx, RESET_TYPE_ALL)) efx 2232 drivers/net/ethernet/sfc/efx.c efx_link_status_changed(efx); efx 2234 drivers/net/ethernet/sfc/efx.c efx_start_all(efx); efx 2235 drivers/net/ethernet/sfc/efx.c if (efx->state == STATE_DISABLED || efx->reset_pending) efx 2236 drivers/net/ethernet/sfc/efx.c netif_device_detach(efx->net_dev); efx 2237 drivers/net/ethernet/sfc/efx.c efx_selftest_async_start(efx); efx 2247 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2249 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n", efx 2253 drivers/net/ethernet/sfc/efx.c efx_stop_all(efx); efx 2262 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2264 drivers/net/ethernet/sfc/efx.c spin_lock_bh(&efx->stats_lock); efx 2265 drivers/net/ethernet/sfc/efx.c efx->type->update_stats(efx, NULL, stats); efx 2266 drivers/net/ethernet/sfc/efx.c spin_unlock_bh(&efx->stats_lock); efx 2272 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2274 drivers/net/ethernet/sfc/efx.c netif_err(efx, tx_err, efx->net_dev, efx 2276 drivers/net/ethernet/sfc/efx.c efx->port_enabled); efx 2278 drivers/net/ethernet/sfc/efx.c efx_schedule_reset(efx, RESET_TYPE_TX_WATCHDOG); efx 2285 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2288 drivers/net/ethernet/sfc/efx.c rc = efx_check_disabled(efx); efx 2292 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, "changing MTU to %d\n", new_mtu); efx 2294 drivers/net/ethernet/sfc/efx.c efx_device_detach_sync(efx); efx 2295 drivers/net/ethernet/sfc/efx.c efx_stop_all(efx); efx 2297 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->mac_lock); efx 2299 drivers/net/ethernet/sfc/efx.c efx_mac_reconfigure(efx); efx 2300 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 2302 drivers/net/ethernet/sfc/efx.c efx_start_all(efx); efx 2303 drivers/net/ethernet/sfc/efx.c efx_device_attach_if_not_resetting(efx); efx 2309 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2316 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, efx 2325 drivers/net/ethernet/sfc/efx.c if (efx->type->set_mac_address) { efx 2326 drivers/net/ethernet/sfc/efx.c rc = efx->type->set_mac_address(efx); efx 2334 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->mac_lock); efx 2335 drivers/net/ethernet/sfc/efx.c efx_mac_reconfigure(efx); efx 2336 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 2344 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2346 drivers/net/ethernet/sfc/efx.c if (efx->port_enabled) efx 2347 drivers/net/ethernet/sfc/efx.c queue_work(efx->workqueue, &efx->mac_work); efx 2353 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2358 drivers/net/ethernet/sfc/efx.c rc = efx->type->filter_clear_rx(efx, EFX_FILTER_PRI_MANUAL); efx 2380 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2382 drivers/net/ethernet/sfc/efx.c if (efx->type->get_phys_port_id) efx 2383 drivers/net/ethernet/sfc/efx.c return efx->type->get_phys_port_id(efx, ppid); efx 2391 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2393 drivers/net/ethernet/sfc/efx.c if (snprintf(name, len, "p%u", efx->port_num) >= len) efx 2400 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2402 drivers/net/ethernet/sfc/efx.c if (efx->type->vlan_rx_add_vid) efx 2403 drivers/net/ethernet/sfc/efx.c return efx->type->vlan_rx_add_vid(efx, proto, vid); efx 2410 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(net_dev); efx 2412 drivers/net/ethernet/sfc/efx.c if (efx->type->vlan_rx_kill_vid) efx 2413 drivers/net/ethernet/sfc/efx.c return efx->type->vlan_rx_kill_vid(efx, proto, vid); efx 2432 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(dev); efx 2443 drivers/net/ethernet/sfc/efx.c if (efx->type->udp_tnl_add_port) efx 2444 drivers/net/ethernet/sfc/efx.c (void)efx->type->udp_tnl_add_port(efx, tnl); efx 2449 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = netdev_priv(dev); efx 2460 drivers/net/ethernet/sfc/efx.c if (efx->type->udp_tnl_del_port) efx 2461 drivers/net/ethernet/sfc/efx.c (void)efx->type->udp_tnl_del_port(efx, tnl); efx 2495 drivers/net/ethernet/sfc/efx.c static void efx_update_name(struct efx_nic *efx) efx 2497 drivers/net/ethernet/sfc/efx.c strcpy(efx->name, efx->net_dev->name); efx 2498 drivers/net/ethernet/sfc/efx.c efx_mtd_rename(efx); efx 2499 drivers/net/ethernet/sfc/efx.c efx_set_channel_names(efx); efx 2521 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = dev_get_drvdata(dev); efx 2522 drivers/net/ethernet/sfc/efx.c return sprintf(buf, "%d\n", efx->phy_type); efx 2530 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = dev_get_drvdata(dev); efx 2531 drivers/net/ethernet/sfc/efx.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 2538 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = dev_get_drvdata(dev); efx 2539 drivers/net/ethernet/sfc/efx.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 2548 drivers/net/ethernet/sfc/efx.c static int efx_register_netdev(struct efx_nic *efx) efx 2550 drivers/net/ethernet/sfc/efx.c struct net_device *net_dev = efx->net_dev; efx 2555 drivers/net/ethernet/sfc/efx.c net_dev->irq = efx->pci_dev->irq; efx 2557 drivers/net/ethernet/sfc/efx.c if (efx_nic_rev(efx) >= EFX_REV_HUNT_A0) efx 2570 drivers/net/ethernet/sfc/efx.c efx->state = STATE_READY; efx 2572 drivers/net/ethernet/sfc/efx.c if (efx->reset_pending) { efx 2573 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, efx 2582 drivers/net/ethernet/sfc/efx.c efx_update_name(efx); efx 2591 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) { efx 2597 drivers/net/ethernet/sfc/efx.c efx_associate(efx); efx 2601 drivers/net/ethernet/sfc/efx.c rc = device_create_file(&efx->pci_dev->dev, &dev_attr_phy_type); efx 2603 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, efx 2608 drivers/net/ethernet/sfc/efx.c rc = device_create_file(&efx->pci_dev->dev, &dev_attr_mcdi_logging); efx 2610 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, efx 2620 drivers/net/ethernet/sfc/efx.c device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_type); efx 2624 drivers/net/ethernet/sfc/efx.c efx_dissociate(efx); efx 2627 drivers/net/ethernet/sfc/efx.c efx->state = STATE_UNINIT; efx 2629 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "could not register net dev\n"); efx 2633 drivers/net/ethernet/sfc/efx.c static void efx_unregister_netdev(struct efx_nic *efx) efx 2635 drivers/net/ethernet/sfc/efx.c if (!efx->net_dev) efx 2638 drivers/net/ethernet/sfc/efx.c BUG_ON(netdev_priv(efx->net_dev) != efx); efx 2640 drivers/net/ethernet/sfc/efx.c if (efx_dev_registered(efx)) { efx 2641 drivers/net/ethernet/sfc/efx.c strlcpy(efx->name, pci_name(efx->pci_dev), sizeof(efx->name)); efx 2643 drivers/net/ethernet/sfc/efx.c device_remove_file(&efx->pci_dev->dev, &dev_attr_mcdi_logging); efx 2645 drivers/net/ethernet/sfc/efx.c device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_type); efx 2646 drivers/net/ethernet/sfc/efx.c unregister_netdev(efx->net_dev); efx 2658 drivers/net/ethernet/sfc/efx.c void efx_reset_down(struct efx_nic *efx, enum reset_type method) efx 2660 drivers/net/ethernet/sfc/efx.c EFX_ASSERT_RESET_SERIALISED(efx); efx 2663 drivers/net/ethernet/sfc/efx.c efx->type->prepare_flr(efx); efx 2665 drivers/net/ethernet/sfc/efx.c efx_stop_all(efx); efx 2666 drivers/net/ethernet/sfc/efx.c efx_disable_interrupts(efx); efx 2668 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->mac_lock); efx 2669 drivers/net/ethernet/sfc/efx.c down_write(&efx->filter_sem); efx 2670 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->rss_lock); efx 2671 drivers/net/ethernet/sfc/efx.c if (efx->port_initialized && method != RESET_TYPE_INVISIBLE && efx 2673 drivers/net/ethernet/sfc/efx.c efx->phy_op->fini(efx); efx 2674 drivers/net/ethernet/sfc/efx.c efx->type->fini(efx); efx 2682 drivers/net/ethernet/sfc/efx.c int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok) efx 2686 drivers/net/ethernet/sfc/efx.c EFX_ASSERT_RESET_SERIALISED(efx); efx 2689 drivers/net/ethernet/sfc/efx.c efx->type->finish_flr(efx); efx 2692 drivers/net/ethernet/sfc/efx.c rc = efx->type->init(efx); efx 2694 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "failed to initialise NIC\n"); efx 2701 drivers/net/ethernet/sfc/efx.c if (efx->port_initialized && method != RESET_TYPE_INVISIBLE && efx 2703 drivers/net/ethernet/sfc/efx.c rc = efx->phy_op->init(efx); efx 2706 drivers/net/ethernet/sfc/efx.c rc = efx->phy_op->reconfigure(efx); efx 2708 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, efx 2712 drivers/net/ethernet/sfc/efx.c rc = efx_enable_interrupts(efx); efx 2717 drivers/net/ethernet/sfc/efx.c rc = efx->type->vswitching_restore(efx); efx 2719 drivers/net/ethernet/sfc/efx.c netif_warn(efx, probe, efx->net_dev, efx 2724 drivers/net/ethernet/sfc/efx.c if (efx->type->rx_restore_rss_contexts) efx 2725 drivers/net/ethernet/sfc/efx.c efx->type->rx_restore_rss_contexts(efx); efx 2726 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->rss_lock); efx 2727 drivers/net/ethernet/sfc/efx.c efx->type->filter_table_restore(efx); efx 2728 drivers/net/ethernet/sfc/efx.c up_write(&efx->filter_sem); efx 2729 drivers/net/ethernet/sfc/efx.c if (efx->type->sriov_reset) efx 2730 drivers/net/ethernet/sfc/efx.c efx->type->sriov_reset(efx); efx 2732 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 2734 drivers/net/ethernet/sfc/efx.c efx_start_all(efx); efx 2736 drivers/net/ethernet/sfc/efx.c if (efx->type->udp_tnl_push_ports) efx 2737 drivers/net/ethernet/sfc/efx.c efx->type->udp_tnl_push_ports(efx); efx 2742 drivers/net/ethernet/sfc/efx.c efx->port_initialized = false; efx 2744 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->rss_lock); efx 2745 drivers/net/ethernet/sfc/efx.c up_write(&efx->filter_sem); efx 2746 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 2756 drivers/net/ethernet/sfc/efx.c int efx_reset(struct efx_nic *efx, enum reset_type method) efx 2761 drivers/net/ethernet/sfc/efx.c netif_info(efx, drv, efx->net_dev, "resetting (%s)\n", efx 2764 drivers/net/ethernet/sfc/efx.c efx_device_detach_sync(efx); efx 2765 drivers/net/ethernet/sfc/efx.c efx_reset_down(efx, method); efx 2767 drivers/net/ethernet/sfc/efx.c rc = efx->type->reset(efx, method); efx 2769 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "failed to reset hardware\n"); efx 2777 drivers/net/ethernet/sfc/efx.c efx->reset_pending &= -(1 << (method + 1)); efx 2779 drivers/net/ethernet/sfc/efx.c __clear_bit(method, &efx->reset_pending); efx 2785 drivers/net/ethernet/sfc/efx.c pci_set_master(efx->pci_dev); efx 2792 drivers/net/ethernet/sfc/efx.c rc2 = efx_reset_up(efx, method, !disabled); efx 2800 drivers/net/ethernet/sfc/efx.c dev_close(efx->net_dev); efx 2801 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "has been disabled\n"); efx 2802 drivers/net/ethernet/sfc/efx.c efx->state = STATE_DISABLED; efx 2804 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, "reset complete\n"); efx 2805 drivers/net/ethernet/sfc/efx.c efx_device_attach_if_not_resetting(efx); efx 2815 drivers/net/ethernet/sfc/efx.c int efx_try_recovery(struct efx_nic *efx) efx 2823 drivers/net/ethernet/sfc/efx.c struct eeh_dev *eehdev = pci_dev_to_eeh_dev(efx->pci_dev); efx 2834 drivers/net/ethernet/sfc/efx.c static void efx_wait_for_bist_end(struct efx_nic *efx) efx 2839 drivers/net/ethernet/sfc/efx.c if (efx_mcdi_poll_reboot(efx)) efx 2844 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "Warning: No MC reboot after BIST mode\n"); efx 2849 drivers/net/ethernet/sfc/efx.c efx->mc_bist_for_other_fn = false; efx 2857 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = container_of(data, struct efx_nic, reset_work); efx 2861 drivers/net/ethernet/sfc/efx.c pending = READ_ONCE(efx->reset_pending); efx 2865 drivers/net/ethernet/sfc/efx.c efx_wait_for_bist_end(efx); efx 2869 drivers/net/ethernet/sfc/efx.c efx_try_recovery(efx)) efx 2881 drivers/net/ethernet/sfc/efx.c if (efx->state == STATE_READY) efx 2882 drivers/net/ethernet/sfc/efx.c (void)efx_reset(efx, method); efx 2887 drivers/net/ethernet/sfc/efx.c void efx_schedule_reset(struct efx_nic *efx, enum reset_type type) efx 2891 drivers/net/ethernet/sfc/efx.c if (efx->state == STATE_RECOVERY) { efx 2892 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, efx 2909 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, "scheduling %s reset\n", efx 2913 drivers/net/ethernet/sfc/efx.c method = efx->type->map_reset_reason(type); efx 2914 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, efx 2920 drivers/net/ethernet/sfc/efx.c set_bit(method, &efx->reset_pending); efx 2926 drivers/net/ethernet/sfc/efx.c if (READ_ONCE(efx->state) != STATE_READY) efx 2931 drivers/net/ethernet/sfc/efx.c efx_mcdi_mode_poll(efx); efx 2933 drivers/net/ethernet/sfc/efx.c queue_work(reset_workqueue, &efx->reset_work); efx 2976 drivers/net/ethernet/sfc/efx.c int efx_port_dummy_op_int(struct efx_nic *efx) efx 2980 drivers/net/ethernet/sfc/efx.c void efx_port_dummy_op_void(struct efx_nic *efx) {} efx 2982 drivers/net/ethernet/sfc/efx.c static bool efx_port_dummy_op_poll(struct efx_nic *efx) efx 3003 drivers/net/ethernet/sfc/efx.c static int efx_init_struct(struct efx_nic *efx, efx 3009 drivers/net/ethernet/sfc/efx.c INIT_LIST_HEAD(&efx->node); efx 3010 drivers/net/ethernet/sfc/efx.c INIT_LIST_HEAD(&efx->secondary_list); efx 3011 drivers/net/ethernet/sfc/efx.c spin_lock_init(&efx->biu_lock); efx 3013 drivers/net/ethernet/sfc/efx.c INIT_LIST_HEAD(&efx->mtd_list); efx 3015 drivers/net/ethernet/sfc/efx.c INIT_WORK(&efx->reset_work, efx_reset_work); efx 3016 drivers/net/ethernet/sfc/efx.c INIT_DELAYED_WORK(&efx->monitor_work, efx_monitor); efx 3017 drivers/net/ethernet/sfc/efx.c INIT_DELAYED_WORK(&efx->selftest_work, efx_selftest_async_work); efx 3018 drivers/net/ethernet/sfc/efx.c efx->pci_dev = pci_dev; efx 3019 drivers/net/ethernet/sfc/efx.c efx->msg_enable = debug; efx 3020 drivers/net/ethernet/sfc/efx.c efx->state = STATE_UNINIT; efx 3021 drivers/net/ethernet/sfc/efx.c strlcpy(efx->name, pci_name(pci_dev), sizeof(efx->name)); efx 3023 drivers/net/ethernet/sfc/efx.c efx->net_dev = net_dev; efx 3024 drivers/net/ethernet/sfc/efx.c efx->rx_prefix_size = efx->type->rx_prefix_size; efx 3025 drivers/net/ethernet/sfc/efx.c efx->rx_ip_align = efx 3026 drivers/net/ethernet/sfc/efx.c NET_IP_ALIGN ? (efx->rx_prefix_size + NET_IP_ALIGN) % 4 : 0; efx 3027 drivers/net/ethernet/sfc/efx.c efx->rx_packet_hash_offset = efx 3028 drivers/net/ethernet/sfc/efx.c efx->type->rx_hash_offset - efx->type->rx_prefix_size; efx 3029 drivers/net/ethernet/sfc/efx.c efx->rx_packet_ts_offset = efx 3030 drivers/net/ethernet/sfc/efx.c efx->type->rx_ts_offset - efx->type->rx_prefix_size; efx 3031 drivers/net/ethernet/sfc/efx.c INIT_LIST_HEAD(&efx->rss_context.list); efx 3032 drivers/net/ethernet/sfc/efx.c mutex_init(&efx->rss_lock); efx 3033 drivers/net/ethernet/sfc/efx.c spin_lock_init(&efx->stats_lock); efx 3034 drivers/net/ethernet/sfc/efx.c efx->vi_stride = EFX_DEFAULT_VI_STRIDE; efx 3035 drivers/net/ethernet/sfc/efx.c efx->num_mac_stats = MC_CMD_MAC_NSTATS; efx 3037 drivers/net/ethernet/sfc/efx.c mutex_init(&efx->mac_lock); efx 3039 drivers/net/ethernet/sfc/efx.c mutex_init(&efx->rps_mutex); efx 3040 drivers/net/ethernet/sfc/efx.c spin_lock_init(&efx->rps_hash_lock); efx 3042 drivers/net/ethernet/sfc/efx.c efx->rps_hash_table = kcalloc(EFX_ARFS_HASH_TABLE_SIZE, efx 3043 drivers/net/ethernet/sfc/efx.c sizeof(*efx->rps_hash_table), GFP_KERNEL); efx 3045 drivers/net/ethernet/sfc/efx.c efx->phy_op = &efx_dummy_phy_operations; efx 3046 drivers/net/ethernet/sfc/efx.c efx->mdio.dev = net_dev; efx 3047 drivers/net/ethernet/sfc/efx.c INIT_WORK(&efx->mac_work, efx_mac_work); efx 3048 drivers/net/ethernet/sfc/efx.c init_waitqueue_head(&efx->flush_wq); efx 3051 drivers/net/ethernet/sfc/efx.c efx->channel[i] = efx_alloc_channel(efx, i, NULL); efx 3052 drivers/net/ethernet/sfc/efx.c if (!efx->channel[i]) efx 3054 drivers/net/ethernet/sfc/efx.c efx->msi_context[i].efx = efx; efx 3055 drivers/net/ethernet/sfc/efx.c efx->msi_context[i].index = i; efx 3059 drivers/net/ethernet/sfc/efx.c if (WARN_ON_ONCE(efx->type->max_interrupt_mode > efx 3060 drivers/net/ethernet/sfc/efx.c efx->type->min_interrupt_mode)) { efx 3064 drivers/net/ethernet/sfc/efx.c efx->interrupt_mode = max(efx->type->max_interrupt_mode, efx 3066 drivers/net/ethernet/sfc/efx.c efx->interrupt_mode = min(efx->type->min_interrupt_mode, efx 3070 drivers/net/ethernet/sfc/efx.c snprintf(efx->workqueue_name, sizeof(efx->workqueue_name), "sfc%s", efx 3072 drivers/net/ethernet/sfc/efx.c efx->workqueue = create_singlethread_workqueue(efx->workqueue_name); efx 3073 drivers/net/ethernet/sfc/efx.c if (!efx->workqueue) efx 3079 drivers/net/ethernet/sfc/efx.c efx_fini_struct(efx); efx 3083 drivers/net/ethernet/sfc/efx.c static void efx_fini_struct(struct efx_nic *efx) efx 3088 drivers/net/ethernet/sfc/efx.c kfree(efx->rps_hash_table); efx 3092 drivers/net/ethernet/sfc/efx.c kfree(efx->channel[i]); efx 3094 drivers/net/ethernet/sfc/efx.c kfree(efx->vpd_sn); efx 3096 drivers/net/ethernet/sfc/efx.c if (efx->workqueue) { efx 3097 drivers/net/ethernet/sfc/efx.c destroy_workqueue(efx->workqueue); efx 3098 drivers/net/ethernet/sfc/efx.c efx->workqueue = NULL; efx 3102 drivers/net/ethernet/sfc/efx.c void efx_update_sw_stats(struct efx_nic *efx, u64 *stats) efx 3107 drivers/net/ethernet/sfc/efx.c efx_for_each_channel(channel, efx) efx 3110 drivers/net/ethernet/sfc/efx.c stats[GENERIC_STAT_rx_noskb_drops] = atomic_read(&efx->n_rx_noskb_drops); efx 3163 drivers/net/ethernet/sfc/efx.c struct hlist_head *efx_rps_hash_bucket(struct efx_nic *efx, efx 3168 drivers/net/ethernet/sfc/efx.c lockdep_assert_held(&efx->rps_hash_lock); efx 3169 drivers/net/ethernet/sfc/efx.c if (!efx->rps_hash_table) efx 3171 drivers/net/ethernet/sfc/efx.c return &efx->rps_hash_table[hash % EFX_ARFS_HASH_TABLE_SIZE]; efx 3174 drivers/net/ethernet/sfc/efx.c struct efx_arfs_rule *efx_rps_hash_find(struct efx_nic *efx, efx 3181 drivers/net/ethernet/sfc/efx.c head = efx_rps_hash_bucket(efx, spec); efx 3192 drivers/net/ethernet/sfc/efx.c struct efx_arfs_rule *efx_rps_hash_add(struct efx_nic *efx, efx 3200 drivers/net/ethernet/sfc/efx.c head = efx_rps_hash_bucket(efx, spec); efx 3219 drivers/net/ethernet/sfc/efx.c void efx_rps_hash_del(struct efx_nic *efx, const struct efx_filter_spec *spec) efx 3225 drivers/net/ethernet/sfc/efx.c head = efx_rps_hash_bucket(efx, spec); efx 3252 drivers/net/ethernet/sfc/efx.c struct efx_rss_context *efx_alloc_rss_context_entry(struct efx_nic *efx) efx 3254 drivers/net/ethernet/sfc/efx.c struct list_head *head = &efx->rss_context.list; efx 3258 drivers/net/ethernet/sfc/efx.c WARN_ON(!mutex_is_locked(&efx->rss_lock)); efx 3285 drivers/net/ethernet/sfc/efx.c struct efx_rss_context *efx_find_rss_context_entry(struct efx_nic *efx, u32 id) efx 3287 drivers/net/ethernet/sfc/efx.c struct list_head *head = &efx->rss_context.list; efx 3290 drivers/net/ethernet/sfc/efx.c WARN_ON(!mutex_is_locked(&efx->rss_lock)); efx 3313 drivers/net/ethernet/sfc/efx.c static void efx_pci_remove_main(struct efx_nic *efx) efx 3318 drivers/net/ethernet/sfc/efx.c BUG_ON(efx->state == STATE_READY); efx 3319 drivers/net/ethernet/sfc/efx.c cancel_work_sync(&efx->reset_work); efx 3321 drivers/net/ethernet/sfc/efx.c efx_disable_interrupts(efx); efx 3322 drivers/net/ethernet/sfc/efx.c efx_clear_interrupt_affinity(efx); efx 3323 drivers/net/ethernet/sfc/efx.c efx_nic_fini_interrupt(efx); efx 3324 drivers/net/ethernet/sfc/efx.c efx_fini_port(efx); efx 3325 drivers/net/ethernet/sfc/efx.c efx->type->fini(efx); efx 3326 drivers/net/ethernet/sfc/efx.c efx_fini_napi(efx); efx 3327 drivers/net/ethernet/sfc/efx.c efx_remove_all(efx); efx 3336 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx; efx 3338 drivers/net/ethernet/sfc/efx.c efx = pci_get_drvdata(pci_dev); efx 3339 drivers/net/ethernet/sfc/efx.c if (!efx) efx 3344 drivers/net/ethernet/sfc/efx.c efx_dissociate(efx); efx 3345 drivers/net/ethernet/sfc/efx.c dev_close(efx->net_dev); efx 3346 drivers/net/ethernet/sfc/efx.c efx_disable_interrupts(efx); efx 3347 drivers/net/ethernet/sfc/efx.c efx->state = STATE_UNINIT; efx 3350 drivers/net/ethernet/sfc/efx.c if (efx->type->sriov_fini) efx 3351 drivers/net/ethernet/sfc/efx.c efx->type->sriov_fini(efx); efx 3353 drivers/net/ethernet/sfc/efx.c efx_unregister_netdev(efx); efx 3355 drivers/net/ethernet/sfc/efx.c efx_mtd_remove(efx); efx 3357 drivers/net/ethernet/sfc/efx.c efx_pci_remove_main(efx); efx 3359 drivers/net/ethernet/sfc/efx.c efx_fini_io(efx); efx 3360 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, "shutdown successful\n"); efx 3362 drivers/net/ethernet/sfc/efx.c efx_fini_struct(efx); efx 3363 drivers/net/ethernet/sfc/efx.c free_netdev(efx->net_dev); efx 3374 drivers/net/ethernet/sfc/efx.c static void efx_probe_vpd_strings(struct efx_nic *efx) efx 3376 drivers/net/ethernet/sfc/efx.c struct pci_dev *dev = efx->pci_dev; efx 3384 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "Unable to read VPD\n"); efx 3391 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "VPD Read-only not found\n"); efx 3404 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "Part number not found\n"); efx 3411 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "Incomplete part number\n"); efx 3415 drivers/net/ethernet/sfc/efx.c netif_info(efx, drv, efx->net_dev, efx 3422 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "Serial number not found\n"); efx 3429 drivers/net/ethernet/sfc/efx.c netif_err(efx, drv, efx->net_dev, "Incomplete serial number\n"); efx 3433 drivers/net/ethernet/sfc/efx.c efx->vpd_sn = kmalloc(j + 1, GFP_KERNEL); efx 3434 drivers/net/ethernet/sfc/efx.c if (!efx->vpd_sn) efx 3437 drivers/net/ethernet/sfc/efx.c snprintf(efx->vpd_sn, j + 1, "%s", &vpd_data[i]); efx 3444 drivers/net/ethernet/sfc/efx.c static int efx_pci_probe_main(struct efx_nic *efx) efx 3449 drivers/net/ethernet/sfc/efx.c rc = efx_probe_all(efx); efx 3453 drivers/net/ethernet/sfc/efx.c efx_init_napi(efx); efx 3455 drivers/net/ethernet/sfc/efx.c down_write(&efx->filter_sem); efx 3456 drivers/net/ethernet/sfc/efx.c rc = efx->type->init(efx); efx 3457 drivers/net/ethernet/sfc/efx.c up_write(&efx->filter_sem); efx 3459 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, efx 3464 drivers/net/ethernet/sfc/efx.c rc = efx_init_port(efx); efx 3466 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, efx 3471 drivers/net/ethernet/sfc/efx.c rc = efx_nic_init_interrupt(efx); efx 3475 drivers/net/ethernet/sfc/efx.c efx_set_interrupt_affinity(efx); efx 3476 drivers/net/ethernet/sfc/efx.c rc = efx_enable_interrupts(efx); efx 3483 drivers/net/ethernet/sfc/efx.c efx_clear_interrupt_affinity(efx); efx 3484 drivers/net/ethernet/sfc/efx.c efx_nic_fini_interrupt(efx); efx 3486 drivers/net/ethernet/sfc/efx.c efx_fini_port(efx); efx 3488 drivers/net/ethernet/sfc/efx.c efx->type->fini(efx); efx 3490 drivers/net/ethernet/sfc/efx.c efx_fini_napi(efx); efx 3491 drivers/net/ethernet/sfc/efx.c efx_remove_all(efx); efx 3496 drivers/net/ethernet/sfc/efx.c static int efx_pci_probe_post_io(struct efx_nic *efx) efx 3498 drivers/net/ethernet/sfc/efx.c struct net_device *net_dev = efx->net_dev; efx 3499 drivers/net/ethernet/sfc/efx.c int rc = efx_pci_probe_main(efx); efx 3504 drivers/net/ethernet/sfc/efx.c if (efx->type->sriov_init) { efx 3505 drivers/net/ethernet/sfc/efx.c rc = efx->type->sriov_init(efx); efx 3507 drivers/net/ethernet/sfc/efx.c netif_err(efx, probe, efx->net_dev, efx 3512 drivers/net/ethernet/sfc/efx.c net_dev->features |= (efx->type->offload_features | NETIF_F_SG | efx 3514 drivers/net/ethernet/sfc/efx.c if (efx->type->offload_features & (NETIF_F_IPV6_CSUM | NETIF_F_HW_CSUM)) efx 3517 drivers/net/ethernet/sfc/efx.c if (!efx->type->tso_versions || !efx->type->tso_versions(efx)) efx 3524 drivers/net/ethernet/sfc/efx.c net_dev->hw_features |= net_dev->features & ~efx->fixed_features; efx 3534 drivers/net/ethernet/sfc/efx.c net_dev->features |= efx->fixed_features; efx 3536 drivers/net/ethernet/sfc/efx.c rc = efx_register_netdev(efx); efx 3540 drivers/net/ethernet/sfc/efx.c efx_pci_remove_main(efx); efx 3557 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx; efx 3561 drivers/net/ethernet/sfc/efx.c net_dev = alloc_etherdev_mqs(sizeof(*efx), EFX_MAX_CORE_TX_QUEUES, efx 3565 drivers/net/ethernet/sfc/efx.c efx = netdev_priv(net_dev); efx 3566 drivers/net/ethernet/sfc/efx.c efx->type = (const struct efx_nic_type *) entry->driver_data; efx 3567 drivers/net/ethernet/sfc/efx.c efx->fixed_features |= NETIF_F_HIGHDMA; efx 3569 drivers/net/ethernet/sfc/efx.c pci_set_drvdata(pci_dev, efx); efx 3571 drivers/net/ethernet/sfc/efx.c rc = efx_init_struct(efx, pci_dev, net_dev); efx 3575 drivers/net/ethernet/sfc/efx.c netif_info(efx, probe, efx->net_dev, efx 3578 drivers/net/ethernet/sfc/efx.c if (!efx->type->is_vf) efx 3579 drivers/net/ethernet/sfc/efx.c efx_probe_vpd_strings(efx); efx 3582 drivers/net/ethernet/sfc/efx.c rc = efx_init_io(efx); efx 3586 drivers/net/ethernet/sfc/efx.c rc = efx_pci_probe_post_io(efx); efx 3591 drivers/net/ethernet/sfc/efx.c efx->reset_pending = 0; efx 3592 drivers/net/ethernet/sfc/efx.c rc = efx_pci_probe_post_io(efx); efx 3601 drivers/net/ethernet/sfc/efx.c efx->reset_pending = 0; efx 3602 drivers/net/ethernet/sfc/efx.c rc = efx_pci_probe_post_io(efx); efx 3608 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, probe, efx->net_dev, "initialisation successful\n"); efx 3612 drivers/net/ethernet/sfc/efx.c rc = efx_mtd_probe(efx); efx 3615 drivers/net/ethernet/sfc/efx.c netif_warn(efx, probe, efx->net_dev, efx 3620 drivers/net/ethernet/sfc/efx.c if (efx->type->udp_tnl_push_ports) efx 3621 drivers/net/ethernet/sfc/efx.c efx->type->udp_tnl_push_ports(efx); efx 3626 drivers/net/ethernet/sfc/efx.c efx_fini_io(efx); efx 3628 drivers/net/ethernet/sfc/efx.c efx_fini_struct(efx); efx 3631 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, drv, efx->net_dev, "initialisation failed. rc=%d\n", rc); efx 3643 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = pci_get_drvdata(dev); efx 3645 drivers/net/ethernet/sfc/efx.c if (efx->type->sriov_configure) { efx 3646 drivers/net/ethernet/sfc/efx.c rc = efx->type->sriov_configure(efx, num_vfs); efx 3658 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = dev_get_drvdata(dev); efx 3662 drivers/net/ethernet/sfc/efx.c if (efx->state != STATE_DISABLED) { efx 3663 drivers/net/ethernet/sfc/efx.c efx->state = STATE_UNINIT; efx 3665 drivers/net/ethernet/sfc/efx.c efx_device_detach_sync(efx); efx 3667 drivers/net/ethernet/sfc/efx.c efx_stop_all(efx); efx 3668 drivers/net/ethernet/sfc/efx.c efx_disable_interrupts(efx); efx 3679 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = dev_get_drvdata(dev); efx 3683 drivers/net/ethernet/sfc/efx.c if (efx->state != STATE_DISABLED) { efx 3684 drivers/net/ethernet/sfc/efx.c rc = efx_enable_interrupts(efx); efx 3688 drivers/net/ethernet/sfc/efx.c mutex_lock(&efx->mac_lock); efx 3689 drivers/net/ethernet/sfc/efx.c efx->phy_op->reconfigure(efx); efx 3690 drivers/net/ethernet/sfc/efx.c mutex_unlock(&efx->mac_lock); efx 3692 drivers/net/ethernet/sfc/efx.c efx_start_all(efx); efx 3694 drivers/net/ethernet/sfc/efx.c efx_device_attach_if_not_resetting(efx); efx 3696 drivers/net/ethernet/sfc/efx.c efx->state = STATE_READY; efx 3698 drivers/net/ethernet/sfc/efx.c efx->type->resume_wol(efx); efx 3704 drivers/net/ethernet/sfc/efx.c queue_work(reset_workqueue, &efx->reset_work); efx 3717 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = pci_get_drvdata(pci_dev); efx 3719 drivers/net/ethernet/sfc/efx.c efx->type->fini(efx); efx 3721 drivers/net/ethernet/sfc/efx.c efx->reset_pending = 0; efx 3731 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = pci_get_drvdata(pci_dev); efx 3741 drivers/net/ethernet/sfc/efx.c pci_set_master(efx->pci_dev); efx 3742 drivers/net/ethernet/sfc/efx.c rc = efx->type->reset(efx, RESET_TYPE_ALL); efx 3745 drivers/net/ethernet/sfc/efx.c down_write(&efx->filter_sem); efx 3746 drivers/net/ethernet/sfc/efx.c rc = efx->type->init(efx); efx 3747 drivers/net/ethernet/sfc/efx.c up_write(&efx->filter_sem); efx 3782 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = pci_get_drvdata(pdev); efx 3789 drivers/net/ethernet/sfc/efx.c if (efx->state != STATE_DISABLED) { efx 3790 drivers/net/ethernet/sfc/efx.c efx->state = STATE_RECOVERY; efx 3791 drivers/net/ethernet/sfc/efx.c efx->reset_pending = 0; efx 3793 drivers/net/ethernet/sfc/efx.c efx_device_detach_sync(efx); efx 3795 drivers/net/ethernet/sfc/efx.c efx_stop_all(efx); efx 3796 drivers/net/ethernet/sfc/efx.c efx_disable_interrupts(efx); efx 3816 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = pci_get_drvdata(pdev); efx 3820 drivers/net/ethernet/sfc/efx.c netif_err(efx, hw, efx->net_dev, efx 3831 drivers/net/ethernet/sfc/efx.c struct efx_nic *efx = pci_get_drvdata(pdev); efx 3836 drivers/net/ethernet/sfc/efx.c if (efx->state == STATE_DISABLED) efx 3839 drivers/net/ethernet/sfc/efx.c rc = efx_reset(efx, RESET_TYPE_ALL); efx 3841 drivers/net/ethernet/sfc/efx.c netif_err(efx, hw, efx->net_dev, efx 3844 drivers/net/ethernet/sfc/efx.c efx->state = STATE_READY; efx 3845 drivers/net/ethernet/sfc/efx.c netif_dbg(efx, hw, efx->net_dev, efx 29 drivers/net/ethernet/sfc/efx.h unsigned int efx_tx_max_skb_descs(struct efx_nic *efx); efx 34 drivers/net/ethernet/sfc/efx.h void efx_set_default_rx_indir_table(struct efx_nic *efx, efx 36 drivers/net/ethernet/sfc/efx.h void efx_rx_config_page_split(struct efx_nic *efx); efx 68 drivers/net/ethernet/sfc/efx.h #define EFX_TXQ_MIN_ENT(efx) (2 * efx_tx_max_skb_descs(efx)) efx 73 drivers/net/ethernet/sfc/efx.h #define EFX_TXQ_MAX_ENT(efx) (EFX_WORKAROUND_EF10(efx) ? \ efx 76 drivers/net/ethernet/sfc/efx.h static inline bool efx_rss_enabled(struct efx_nic *efx) efx 78 drivers/net/ethernet/sfc/efx.h return efx->rss_spread > 1; efx 83 drivers/net/ethernet/sfc/efx.h void efx_mac_reconfigure(struct efx_nic *efx); efx 110 drivers/net/ethernet/sfc/efx.h static inline s32 efx_filter_insert_filter(struct efx_nic *efx, efx 114 drivers/net/ethernet/sfc/efx.h return efx->type->filter_insert(efx, spec, replace_equal); efx 126 drivers/net/ethernet/sfc/efx.h static inline int efx_filter_remove_id_safe(struct efx_nic *efx, efx 130 drivers/net/ethernet/sfc/efx.h return efx->type->filter_remove_safe(efx, priority, filter_id); efx 144 drivers/net/ethernet/sfc/efx.h efx_filter_get_filter_safe(struct efx_nic *efx, efx 148 drivers/net/ethernet/sfc/efx.h return efx->type->filter_get_safe(efx, priority, filter_id, spec); efx 151 drivers/net/ethernet/sfc/efx.h static inline u32 efx_filter_count_rx_used(struct efx_nic *efx, efx 154 drivers/net/ethernet/sfc/efx.h return efx->type->filter_count_rx_used(efx, priority); efx 156 drivers/net/ethernet/sfc/efx.h static inline u32 efx_filter_get_rx_id_limit(struct efx_nic *efx) efx 158 drivers/net/ethernet/sfc/efx.h return efx->type->filter_get_rx_id_limit(efx); efx 160 drivers/net/ethernet/sfc/efx.h static inline s32 efx_filter_get_rx_ids(struct efx_nic *efx, efx 164 drivers/net/ethernet/sfc/efx.h return efx->type->filter_get_rx_ids(efx, priority, buf, size); efx 169 drivers/net/ethernet/sfc/efx.h bool __efx_filter_rfs_expire(struct efx_nic *efx, unsigned quota); efx 176 drivers/net/ethernet/sfc/efx.h __efx_filter_rfs_expire(channel->efx, 100)) efx 194 drivers/net/ethernet/sfc/efx.h struct efx_arfs_rule *efx_rps_hash_find(struct efx_nic *efx, efx 200 drivers/net/ethernet/sfc/efx.h struct efx_arfs_rule *efx_rps_hash_add(struct efx_nic *efx, efx 204 drivers/net/ethernet/sfc/efx.h void efx_rps_hash_del(struct efx_nic *efx, const struct efx_filter_spec *spec); efx 208 drivers/net/ethernet/sfc/efx.h struct efx_rss_context *efx_alloc_rss_context_entry(struct efx_nic *efx); efx 209 drivers/net/ethernet/sfc/efx.h struct efx_rss_context *efx_find_rss_context_entry(struct efx_nic *efx, u32 id); efx 219 drivers/net/ethernet/sfc/efx.h int efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries); efx 222 drivers/net/ethernet/sfc/efx.h int efx_reconfigure_port(struct efx_nic *efx); efx 223 drivers/net/ethernet/sfc/efx.h int __efx_reconfigure_port(struct efx_nic *efx); efx 229 drivers/net/ethernet/sfc/efx.h int efx_reset(struct efx_nic *efx, enum reset_type method); efx 230 drivers/net/ethernet/sfc/efx.h void efx_reset_down(struct efx_nic *efx, enum reset_type method); efx 231 drivers/net/ethernet/sfc/efx.h int efx_reset_up(struct efx_nic *efx, enum reset_type method, bool ok); efx 232 drivers/net/ethernet/sfc/efx.h int efx_try_recovery(struct efx_nic *efx); efx 235 drivers/net/ethernet/sfc/efx.h void efx_schedule_reset(struct efx_nic *efx, enum reset_type type); efx 236 drivers/net/ethernet/sfc/efx.h unsigned int efx_usecs_to_ticks(struct efx_nic *efx, unsigned int usecs); efx 237 drivers/net/ethernet/sfc/efx.h unsigned int efx_ticks_to_usecs(struct efx_nic *efx, unsigned int ticks); efx 238 drivers/net/ethernet/sfc/efx.h int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs, efx 241 drivers/net/ethernet/sfc/efx.h void efx_get_irq_moderation(struct efx_nic *efx, unsigned int *tx_usecs, efx 247 drivers/net/ethernet/sfc/efx.h int efx_port_dummy_op_int(struct efx_nic *efx); efx 248 drivers/net/ethernet/sfc/efx.h void efx_port_dummy_op_void(struct efx_nic *efx); efx 251 drivers/net/ethernet/sfc/efx.h void efx_update_sw_stats(struct efx_nic *efx, u64 *stats); efx 255 drivers/net/ethernet/sfc/efx.h int efx_mtd_add(struct efx_nic *efx, struct efx_mtd_partition *parts, efx 257 drivers/net/ethernet/sfc/efx.h static inline int efx_mtd_probe(struct efx_nic *efx) efx 259 drivers/net/ethernet/sfc/efx.h return efx->type->mtd_probe(efx); efx 261 drivers/net/ethernet/sfc/efx.h void efx_mtd_rename(struct efx_nic *efx); efx 262 drivers/net/ethernet/sfc/efx.h void efx_mtd_remove(struct efx_nic *efx); efx 264 drivers/net/ethernet/sfc/efx.h static inline int efx_mtd_probe(struct efx_nic *efx) { return 0; } efx 265 drivers/net/ethernet/sfc/efx.h static inline void efx_mtd_rename(struct efx_nic *efx) {} efx 266 drivers/net/ethernet/sfc/efx.h static inline void efx_mtd_remove(struct efx_nic *efx) {} efx 270 drivers/net/ethernet/sfc/efx.h static inline unsigned int efx_vf_size(struct efx_nic *efx) efx 272 drivers/net/ethernet/sfc/efx.h return 1 << efx->vi_scale; efx 278 drivers/net/ethernet/sfc/efx.h netif_vdbg(channel->efx, intr, channel->efx->net_dev, efx 291 drivers/net/ethernet/sfc/efx.h void efx_link_status_changed(struct efx_nic *efx); efx 292 drivers/net/ethernet/sfc/efx.h void efx_link_set_advertising(struct efx_nic *efx, efx 294 drivers/net/ethernet/sfc/efx.h void efx_link_clear_advertising(struct efx_nic *efx); efx 295 drivers/net/ethernet/sfc/efx.h void efx_link_set_wanted_fc(struct efx_nic *efx, u8); efx 297 drivers/net/ethernet/sfc/efx.h static inline void efx_device_detach_sync(struct efx_nic *efx) efx 299 drivers/net/ethernet/sfc/efx.h struct net_device *dev = efx->net_dev; efx 310 drivers/net/ethernet/sfc/efx.h static inline void efx_device_attach_if_not_resetting(struct efx_nic *efx) efx 312 drivers/net/ethernet/sfc/efx.h if ((efx->state != STATE_DISABLED) && !efx->reset_pending) efx 313 drivers/net/ethernet/sfc/efx.h netif_device_attach(efx->net_dev); efx 103 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 120 drivers/net/ethernet/sfc/ethtool.c efx->type->set_id_led(efx, mode); efx 129 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 130 drivers/net/ethernet/sfc/ethtool.c struct efx_link_state *link_state = &efx->link_state; efx 133 drivers/net/ethernet/sfc/ethtool.c mutex_lock(&efx->mac_lock); efx 134 drivers/net/ethernet/sfc/ethtool.c efx->phy_op->get_link_ksettings(efx, cmd); efx 135 drivers/net/ethernet/sfc/ethtool.c mutex_unlock(&efx->mac_lock); efx 146 drivers/net/ethernet/sfc/ethtool.c if (LOOPBACK_INTERNAL(efx)) { efx 159 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 165 drivers/net/ethernet/sfc/ethtool.c netif_dbg(efx, drv, efx->net_dev, efx 170 drivers/net/ethernet/sfc/ethtool.c mutex_lock(&efx->mac_lock); efx 171 drivers/net/ethernet/sfc/ethtool.c rc = efx->phy_op->set_link_ksettings(efx, cmd); efx 172 drivers/net/ethernet/sfc/ethtool.c mutex_unlock(&efx->mac_lock); efx 179 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 183 drivers/net/ethernet/sfc/ethtool.c efx_mcdi_print_fwver(efx, info->fw_version, efx 185 drivers/net/ethernet/sfc/ethtool.c strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info)); efx 196 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 198 drivers/net/ethernet/sfc/ethtool.c regs->version = efx->type->revision; efx 199 drivers/net/ethernet/sfc/ethtool.c efx_nic_get_regs(efx, buf); efx 204 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 205 drivers/net/ethernet/sfc/ethtool.c return efx->msg_enable; efx 210 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 211 drivers/net/ethernet/sfc/ethtool.c efx->msg_enable = msg_enable; efx 269 drivers/net/ethernet/sfc/ethtool.c static int efx_fill_loopback_test(struct efx_nic *efx, efx 276 drivers/net/ethernet/sfc/ethtool.c efx_get_channel(efx, efx->tx_channel_offset); efx 314 drivers/net/ethernet/sfc/ethtool.c static int efx_ethtool_fill_self_tests(struct efx_nic *efx, efx 330 drivers/net/ethernet/sfc/ethtool.c efx_for_each_channel(channel, efx) { efx 346 drivers/net/ethernet/sfc/ethtool.c if (efx->phy_op->run_tests != NULL) { efx 347 drivers/net/ethernet/sfc/ethtool.c EFX_WARN_ON_PARANOID(efx->phy_op->test_name == NULL); efx 353 drivers/net/ethernet/sfc/ethtool.c name = efx->phy_op->test_name(efx, i); efx 364 drivers/net/ethernet/sfc/ethtool.c if (!(efx->loopback_modes & (1 << mode))) efx 366 drivers/net/ethernet/sfc/ethtool.c n = efx_fill_loopback_test(efx, efx 374 drivers/net/ethernet/sfc/ethtool.c static size_t efx_describe_per_queue_stats(struct efx_nic *efx, u8 *strings) efx 379 drivers/net/ethernet/sfc/ethtool.c efx_for_each_channel(channel, efx) { efx 392 drivers/net/ethernet/sfc/ethtool.c efx_for_each_channel(channel, efx) { efx 408 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 412 drivers/net/ethernet/sfc/ethtool.c return efx->type->describe_stats(efx, NULL) + efx 414 drivers/net/ethernet/sfc/ethtool.c efx_describe_per_queue_stats(efx, NULL) + efx 415 drivers/net/ethernet/sfc/ethtool.c efx_ptp_describe_stats(efx, NULL); efx 417 drivers/net/ethernet/sfc/ethtool.c return efx_ethtool_fill_self_tests(efx, NULL, NULL, NULL); efx 426 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 431 drivers/net/ethernet/sfc/ethtool.c strings += (efx->type->describe_stats(efx, strings) * efx 437 drivers/net/ethernet/sfc/ethtool.c strings += (efx_describe_per_queue_stats(efx, strings) * efx 439 drivers/net/ethernet/sfc/ethtool.c efx_ptp_describe_stats(efx, strings); efx 442 drivers/net/ethernet/sfc/ethtool.c efx_ethtool_fill_self_tests(efx, NULL, strings, NULL); efx 454 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 461 drivers/net/ethernet/sfc/ethtool.c spin_lock_bh(&efx->stats_lock); efx 464 drivers/net/ethernet/sfc/ethtool.c data += efx->type->update_stats(efx, data, NULL); efx 471 drivers/net/ethernet/sfc/ethtool.c data[i] = stat->get_stat((void *)efx + stat->offset); efx 475 drivers/net/ethernet/sfc/ethtool.c efx_for_each_channel(channel, efx) efx 481 drivers/net/ethernet/sfc/ethtool.c efx_for_each_channel(channel, efx) { efx 492 drivers/net/ethernet/sfc/ethtool.c spin_unlock_bh(&efx->stats_lock); efx 494 drivers/net/ethernet/sfc/ethtool.c efx_for_each_channel(channel, efx) { efx 503 drivers/net/ethernet/sfc/ethtool.c efx_for_each_channel(channel, efx) { efx 513 drivers/net/ethernet/sfc/ethtool.c efx_ptp_update_stats(efx, data); efx 519 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 528 drivers/net/ethernet/sfc/ethtool.c if (efx->state != STATE_READY) { efx 533 drivers/net/ethernet/sfc/ethtool.c netif_info(efx, drv, efx->net_dev, "starting %sline testing\n", efx 537 drivers/net/ethernet/sfc/ethtool.c already_up = (efx->net_dev->flags & IFF_UP); efx 539 drivers/net/ethernet/sfc/ethtool.c rc = dev_open(efx->net_dev, NULL); efx 541 drivers/net/ethernet/sfc/ethtool.c netif_err(efx, drv, efx->net_dev, efx 547 drivers/net/ethernet/sfc/ethtool.c rc = efx_selftest(efx, efx_tests, test->flags); efx 550 drivers/net/ethernet/sfc/ethtool.c dev_close(efx->net_dev); efx 552 drivers/net/ethernet/sfc/ethtool.c netif_info(efx, drv, efx->net_dev, "%s %sline self-tests\n", efx 557 drivers/net/ethernet/sfc/ethtool.c efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data); efx 567 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 569 drivers/net/ethernet/sfc/ethtool.c return mdio45_nway_restart(&efx->mdio); efx 604 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 608 drivers/net/ethernet/sfc/ethtool.c efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &rx_adaptive); efx 622 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 631 drivers/net/ethernet/sfc/ethtool.c efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &adaptive); efx 650 drivers/net/ethernet/sfc/ethtool.c rc = efx_init_irq_moderation(efx, tx_usecs, rx_usecs, adaptive, efx 655 drivers/net/ethernet/sfc/ethtool.c efx_for_each_channel(channel, efx) efx 656 drivers/net/ethernet/sfc/ethtool.c efx->type->push_irq_moderation(channel); efx 664 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 667 drivers/net/ethernet/sfc/ethtool.c ring->tx_max_pending = EFX_TXQ_MAX_ENT(efx); efx 668 drivers/net/ethernet/sfc/ethtool.c ring->rx_pending = efx->rxq_entries; efx 669 drivers/net/ethernet/sfc/ethtool.c ring->tx_pending = efx->txq_entries; efx 675 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 680 drivers/net/ethernet/sfc/ethtool.c ring->tx_pending > EFX_TXQ_MAX_ENT(efx)) efx 684 drivers/net/ethernet/sfc/ethtool.c netif_err(efx, drv, efx->net_dev, efx 690 drivers/net/ethernet/sfc/ethtool.c txq_entries = max(ring->tx_pending, EFX_TXQ_MIN_ENT(efx)); efx 692 drivers/net/ethernet/sfc/ethtool.c netif_warn(efx, drv, efx->net_dev, efx 696 drivers/net/ethernet/sfc/ethtool.c return efx_realloc_channels(efx, ring->rx_pending, txq_entries); efx 702 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 707 drivers/net/ethernet/sfc/ethtool.c mutex_lock(&efx->mac_lock); efx 714 drivers/net/ethernet/sfc/ethtool.c netif_dbg(efx, drv, efx->net_dev, efx 720 drivers/net/ethernet/sfc/ethtool.c if ((wanted_fc & EFX_FC_AUTO) && !efx->link_advertising[0]) { efx 721 drivers/net/ethernet/sfc/ethtool.c netif_dbg(efx, drv, efx->net_dev, efx 728 drivers/net/ethernet/sfc/ethtool.c if (efx->type->prepare_enable_fc_tx && efx 729 drivers/net/ethernet/sfc/ethtool.c (wanted_fc & EFX_FC_TX) && !(efx->wanted_fc & EFX_FC_TX)) efx 730 drivers/net/ethernet/sfc/ethtool.c efx->type->prepare_enable_fc_tx(efx); efx 732 drivers/net/ethernet/sfc/ethtool.c old_adv = efx->link_advertising[0]; efx 733 drivers/net/ethernet/sfc/ethtool.c old_fc = efx->wanted_fc; efx 734 drivers/net/ethernet/sfc/ethtool.c efx_link_set_wanted_fc(efx, wanted_fc); efx 735 drivers/net/ethernet/sfc/ethtool.c if (efx->link_advertising[0] != old_adv || efx 736 drivers/net/ethernet/sfc/ethtool.c (efx->wanted_fc ^ old_fc) & EFX_FC_AUTO) { efx 737 drivers/net/ethernet/sfc/ethtool.c rc = efx->phy_op->reconfigure(efx); efx 739 drivers/net/ethernet/sfc/ethtool.c netif_err(efx, drv, efx->net_dev, efx 749 drivers/net/ethernet/sfc/ethtool.c efx_mac_reconfigure(efx); efx 752 drivers/net/ethernet/sfc/ethtool.c mutex_unlock(&efx->mac_lock); efx 760 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 762 drivers/net/ethernet/sfc/ethtool.c pause->rx_pause = !!(efx->wanted_fc & EFX_FC_RX); efx 763 drivers/net/ethernet/sfc/ethtool.c pause->tx_pause = !!(efx->wanted_fc & EFX_FC_TX); efx 764 drivers/net/ethernet/sfc/ethtool.c pause->autoneg = !!(efx->wanted_fc & EFX_FC_AUTO); efx 770 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 771 drivers/net/ethernet/sfc/ethtool.c return efx->type->get_wol(efx, wol); efx 778 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 779 drivers/net/ethernet/sfc/ethtool.c return efx->type->set_wol(efx, wol->wolopts); efx 784 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 787 drivers/net/ethernet/sfc/ethtool.c rc = efx->type->map_reset_flags(flags); efx 791 drivers/net/ethernet/sfc/ethtool.c return efx_reset(efx, rc); efx 807 drivers/net/ethernet/sfc/ethtool.c static int efx_ethtool_get_class_rule(struct efx_nic *efx, efx 824 drivers/net/ethernet/sfc/ethtool.c rc = efx_filter_get_filter_safe(efx, EFX_FILTER_PRI_MANUAL, efx 977 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 983 drivers/net/ethernet/sfc/ethtool.c info->data = efx->n_rx_channels; efx 987 drivers/net/ethernet/sfc/ethtool.c struct efx_rss_context *ctx = &efx->rss_context; efx 989 drivers/net/ethernet/sfc/ethtool.c mutex_lock(&efx->rss_lock); efx 991 drivers/net/ethernet/sfc/ethtool.c ctx = efx_find_rss_context_entry(efx, info->rss_context); efx 1027 drivers/net/ethernet/sfc/ethtool.c mutex_unlock(&efx->rss_lock); efx 1032 drivers/net/ethernet/sfc/ethtool.c info->data = efx_filter_get_rx_id_limit(efx); efx 1037 drivers/net/ethernet/sfc/ethtool.c efx_filter_count_rx_used(efx, EFX_FILTER_PRI_MANUAL); efx 1041 drivers/net/ethernet/sfc/ethtool.c if (efx_filter_get_rx_id_limit(efx) == 0) efx 1043 drivers/net/ethernet/sfc/ethtool.c rc = efx_ethtool_get_class_rule(efx, &info->fs, &rss_context); efx 1051 drivers/net/ethernet/sfc/ethtool.c info->data = efx_filter_get_rx_id_limit(efx); efx 1054 drivers/net/ethernet/sfc/ethtool.c rc = efx_filter_get_rx_ids(efx, EFX_FILTER_PRI_MANUAL, efx 1076 drivers/net/ethernet/sfc/ethtool.c static int efx_ethtool_set_class_rule(struct efx_nic *efx, efx 1100 drivers/net/ethernet/sfc/ethtool.c if (rule->ring_cookie >= efx->n_rx_channels && efx 1110 drivers/net/ethernet/sfc/ethtool.c if (efx->rx_scatter) efx 1280 drivers/net/ethernet/sfc/ethtool.c rc = efx_filter_insert_filter(efx, &spec, true); efx 1291 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1293 drivers/net/ethernet/sfc/ethtool.c if (efx_filter_get_rx_id_limit(efx) == 0) efx 1298 drivers/net/ethernet/sfc/ethtool.c return efx_ethtool_set_class_rule(efx, &info->fs, efx 1302 drivers/net/ethernet/sfc/ethtool.c return efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_MANUAL, efx 1312 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1314 drivers/net/ethernet/sfc/ethtool.c if (efx->n_rx_channels == 1) efx 1316 drivers/net/ethernet/sfc/ethtool.c return ARRAY_SIZE(efx->rss_context.rx_indir_table); efx 1321 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1323 drivers/net/ethernet/sfc/ethtool.c return efx->type->rx_hash_key_size; efx 1329 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1332 drivers/net/ethernet/sfc/ethtool.c rc = efx->type->rx_pull_rss_config(efx); efx 1339 drivers/net/ethernet/sfc/ethtool.c memcpy(indir, efx->rss_context.rx_indir_table, efx 1340 drivers/net/ethernet/sfc/ethtool.c sizeof(efx->rss_context.rx_indir_table)); efx 1342 drivers/net/ethernet/sfc/ethtool.c memcpy(key, efx->rss_context.rx_hash_key, efx 1343 drivers/net/ethernet/sfc/ethtool.c efx->type->rx_hash_key_size); efx 1350 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1359 drivers/net/ethernet/sfc/ethtool.c key = efx->rss_context.rx_hash_key; efx 1361 drivers/net/ethernet/sfc/ethtool.c indir = efx->rss_context.rx_indir_table; efx 1363 drivers/net/ethernet/sfc/ethtool.c return efx->type->rx_push_rss_config(efx, true, indir, key); efx 1369 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1373 drivers/net/ethernet/sfc/ethtool.c if (!efx->type->rx_pull_rss_context_config) efx 1376 drivers/net/ethernet/sfc/ethtool.c mutex_lock(&efx->rss_lock); efx 1377 drivers/net/ethernet/sfc/ethtool.c ctx = efx_find_rss_context_entry(efx, rss_context); efx 1382 drivers/net/ethernet/sfc/ethtool.c rc = efx->type->rx_pull_rss_context_config(efx, ctx); efx 1391 drivers/net/ethernet/sfc/ethtool.c memcpy(key, ctx->rx_hash_key, efx->type->rx_hash_key_size); efx 1393 drivers/net/ethernet/sfc/ethtool.c mutex_unlock(&efx->rss_lock); efx 1402 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1407 drivers/net/ethernet/sfc/ethtool.c if (!efx->type->rx_push_rss_context_config) efx 1413 drivers/net/ethernet/sfc/ethtool.c mutex_lock(&efx->rss_lock); efx 1421 drivers/net/ethernet/sfc/ethtool.c ctx = efx_alloc_rss_context_entry(efx); efx 1428 drivers/net/ethernet/sfc/ethtool.c efx_set_default_rx_indir_table(efx, ctx); efx 1432 drivers/net/ethernet/sfc/ethtool.c ctx = efx_find_rss_context_entry(efx, *rss_context); efx 1441 drivers/net/ethernet/sfc/ethtool.c rc = efx->type->rx_push_rss_context_config(efx, ctx, NULL, NULL); efx 1452 drivers/net/ethernet/sfc/ethtool.c rc = efx->type->rx_push_rss_context_config(efx, ctx, indir, key); efx 1458 drivers/net/ethernet/sfc/ethtool.c mutex_unlock(&efx->rss_lock); efx 1465 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1472 drivers/net/ethernet/sfc/ethtool.c efx_ptp_get_ts_info(efx, ts_info); efx 1480 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1483 drivers/net/ethernet/sfc/ethtool.c if (!efx->phy_op || !efx->phy_op->get_module_eeprom) efx 1486 drivers/net/ethernet/sfc/ethtool.c mutex_lock(&efx->mac_lock); efx 1487 drivers/net/ethernet/sfc/ethtool.c ret = efx->phy_op->get_module_eeprom(efx, ee, data); efx 1488 drivers/net/ethernet/sfc/ethtool.c mutex_unlock(&efx->mac_lock); efx 1496 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1499 drivers/net/ethernet/sfc/ethtool.c if (!efx->phy_op || !efx->phy_op->get_module_info) efx 1502 drivers/net/ethernet/sfc/ethtool.c mutex_lock(&efx->mac_lock); efx 1503 drivers/net/ethernet/sfc/ethtool.c ret = efx->phy_op->get_module_info(efx, modinfo); efx 1504 drivers/net/ethernet/sfc/ethtool.c mutex_unlock(&efx->mac_lock); efx 1512 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1515 drivers/net/ethernet/sfc/ethtool.c if (!efx->phy_op || !efx->phy_op->get_fecparam) efx 1517 drivers/net/ethernet/sfc/ethtool.c mutex_lock(&efx->mac_lock); efx 1518 drivers/net/ethernet/sfc/ethtool.c rc = efx->phy_op->get_fecparam(efx, fecparam); efx 1519 drivers/net/ethernet/sfc/ethtool.c mutex_unlock(&efx->mac_lock); efx 1527 drivers/net/ethernet/sfc/ethtool.c struct efx_nic *efx = netdev_priv(net_dev); efx 1530 drivers/net/ethernet/sfc/ethtool.c if (!efx->phy_op || !efx->phy_op->get_fecparam) efx 1532 drivers/net/ethernet/sfc/ethtool.c mutex_lock(&efx->mac_lock); efx 1533 drivers/net/ethernet/sfc/ethtool.c rc = efx->phy_op->set_fecparam(efx, fecparam); efx 1534 drivers/net/ethernet/sfc/ethtool.c mutex_unlock(&efx->mac_lock); efx 194 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_soft_enable_interrupts(struct ef4_nic *efx); efx 195 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_soft_disable_interrupts(struct ef4_nic *efx); efx 197 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_remove_channels(struct ef4_nic *efx); efx 199 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_remove_port(struct ef4_nic *efx); efx 201 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_fini_napi(struct ef4_nic *efx); efx 203 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_fini_struct(struct ef4_nic *efx); efx 204 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_start_all(struct ef4_nic *efx); efx 205 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_stop_all(struct ef4_nic *efx); efx 207 drivers/net/ethernet/sfc/falcon/efx.c #define EF4_ASSERT_RESET_SERIALISED(efx) \ efx 209 drivers/net/ethernet/sfc/falcon/efx.c if ((efx->state == STATE_READY) || \ efx 210 drivers/net/ethernet/sfc/falcon/efx.c (efx->state == STATE_RECOVERY) || \ efx 211 drivers/net/ethernet/sfc/falcon/efx.c (efx->state == STATE_DISABLED)) \ efx 215 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_check_disabled(struct ef4_nic *efx) efx 217 drivers/net/ethernet/sfc/falcon/efx.c if (efx->state == STATE_DISABLED || efx->state == STATE_RECOVERY) { efx 218 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, efx 276 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_update_irq_mod(struct ef4_nic *efx, struct ef4_channel *channel) efx 278 drivers/net/ethernet/sfc/falcon/efx.c int step = efx->irq_mod_step_us; efx 283 drivers/net/ethernet/sfc/falcon/efx.c efx->type->push_irq_moderation(channel); efx 287 drivers/net/ethernet/sfc/falcon/efx.c efx->irq_rx_moderation_us) { efx 289 drivers/net/ethernet/sfc/falcon/efx.c efx->type->push_irq_moderation(channel); efx 301 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = channel->efx; efx 304 drivers/net/ethernet/sfc/falcon/efx.c netif_vdbg(efx, intr, efx->net_dev, efx 312 drivers/net/ethernet/sfc/falcon/efx.c efx->irq_rx_adaptive && efx 314 drivers/net/ethernet/sfc/falcon/efx.c ef4_update_irq_mod(efx, channel); efx 338 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = channel->efx; efx 341 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, probe, efx->net_dev, efx 346 drivers/net/ethernet/sfc/falcon/efx.c entries = roundup_pow_of_two(efx->rxq_entries + efx->txq_entries + 128); efx 356 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = channel->efx; efx 361 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, efx 366 drivers/net/ethernet/sfc/falcon/efx.c efx->type->push_irq_moderation(channel); efx 376 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(channel->efx, ifup, channel->efx->net_dev, efx 402 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(channel->efx, drv, channel->efx->net_dev, efx 411 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(channel->efx, drv, channel->efx->net_dev, efx 425 drivers/net/ethernet/sfc/falcon/efx.c ef4_alloc_channel(struct ef4_nic *efx, int i, struct ef4_channel *old_channel) efx 436 drivers/net/ethernet/sfc/falcon/efx.c channel->efx = efx; efx 442 drivers/net/ethernet/sfc/falcon/efx.c tx_queue->efx = efx; efx 448 drivers/net/ethernet/sfc/falcon/efx.c rx_queue->efx = efx; efx 499 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(channel->efx, probe, channel->efx->net_dev, efx 532 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = channel->efx; efx 537 drivers/net/ethernet/sfc/falcon/efx.c if (efx->tx_channel_offset == 0) { efx 539 drivers/net/ethernet/sfc/falcon/efx.c } else if (channel->channel < efx->tx_channel_offset) { efx 543 drivers/net/ethernet/sfc/falcon/efx.c number -= efx->tx_channel_offset; efx 545 drivers/net/ethernet/sfc/falcon/efx.c snprintf(buf, len, "%s%s-%d", efx->name, type, number); efx 548 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_set_channel_names(struct ef4_nic *efx) efx 552 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) efx 554 drivers/net/ethernet/sfc/falcon/efx.c efx->msi_context[channel->channel].name, efx 555 drivers/net/ethernet/sfc/falcon/efx.c sizeof(efx->msi_context[0].name)); efx 558 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_probe_channels(struct ef4_nic *efx) efx 564 drivers/net/ethernet/sfc/falcon/efx.c efx->next_buffer_table = 0; efx 571 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel_rev(channel, efx) { efx 574 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, probe, efx->net_dev, efx 580 drivers/net/ethernet/sfc/falcon/efx.c ef4_set_channel_names(efx); efx 585 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_channels(efx); efx 593 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_start_datapath(struct ef4_nic *efx) efx 595 drivers/net/ethernet/sfc/falcon/efx.c netdev_features_t old_features = efx->net_dev->features; efx 596 drivers/net/ethernet/sfc/falcon/efx.c bool old_rx_scatter = efx->rx_scatter; efx 606 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_dma_len = (efx->rx_prefix_size + efx 607 drivers/net/ethernet/sfc/falcon/efx.c EF4_MAX_FRAME_LEN(efx->net_dev->mtu) + efx 608 drivers/net/ethernet/sfc/falcon/efx.c efx->type->rx_buffer_padding); efx 610 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_ip_align + efx->rx_dma_len); efx 612 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_scatter = efx->type->always_rx_scatter; efx 613 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_buffer_order = 0; efx 614 drivers/net/ethernet/sfc/falcon/efx.c } else if (efx->type->can_rx_scatter) { efx 620 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_scatter = true; efx 621 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_dma_len = EF4_RX_USR_BUF_SIZE; efx 622 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_buffer_order = 0; efx 624 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_scatter = false; efx 625 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_buffer_order = get_order(rx_buf_len); efx 628 drivers/net/ethernet/sfc/falcon/efx.c ef4_rx_config_page_split(efx); efx 629 drivers/net/ethernet/sfc/falcon/efx.c if (efx->rx_buffer_order) efx 630 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, efx 632 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_dma_len, efx->rx_buffer_order, efx 633 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_pages_per_batch); efx 635 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, efx 637 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_dma_len, efx->rx_page_buf_step, efx 638 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_bufs_per_page, efx->rx_pages_per_batch); efx 643 drivers/net/ethernet/sfc/falcon/efx.c efx->net_dev->hw_features |= efx->net_dev->features; efx 644 drivers/net/ethernet/sfc/falcon/efx.c efx->net_dev->hw_features &= ~efx->fixed_features; efx 645 drivers/net/ethernet/sfc/falcon/efx.c efx->net_dev->features |= efx->fixed_features; efx 646 drivers/net/ethernet/sfc/falcon/efx.c if (efx->net_dev->features != old_features) efx 647 drivers/net/ethernet/sfc/falcon/efx.c netdev_features_change(efx->net_dev); efx 650 drivers/net/ethernet/sfc/falcon/efx.c if (efx->rx_scatter != old_rx_scatter) efx 651 drivers/net/ethernet/sfc/falcon/efx.c efx->type->filter_update_rx_scatter(efx); efx 660 drivers/net/ethernet/sfc/falcon/efx.c efx->txq_stop_thresh = efx->txq_entries - ef4_tx_max_skb_descs(efx); efx 661 drivers/net/ethernet/sfc/falcon/efx.c efx->txq_wake_thresh = efx->txq_stop_thresh / 2; efx 664 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 667 drivers/net/ethernet/sfc/falcon/efx.c atomic_inc(&efx->active_queues); efx 672 drivers/net/ethernet/sfc/falcon/efx.c atomic_inc(&efx->active_queues); efx 681 drivers/net/ethernet/sfc/falcon/efx.c if (netif_device_present(efx->net_dev)) efx 682 drivers/net/ethernet/sfc/falcon/efx.c netif_tx_wake_all_queues(efx->net_dev); efx 685 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_stop_datapath(struct ef4_nic *efx) efx 692 drivers/net/ethernet/sfc/falcon/efx.c EF4_ASSERT_RESET_SERIALISED(efx); efx 693 drivers/net/ethernet/sfc/falcon/efx.c BUG_ON(efx->port_enabled); efx 696 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 701 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 714 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->fini_dmaq(efx); efx 715 drivers/net/ethernet/sfc/falcon/efx.c if (rc && EF4_WORKAROUND_7803(efx)) { efx 721 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, efx 723 drivers/net/ethernet/sfc/falcon/efx.c ef4_schedule_reset(efx, RESET_TYPE_ALL); efx 725 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "failed to flush queues\n"); efx 727 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, efx 731 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 744 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(channel->efx, drv, channel->efx->net_dev, efx 755 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_remove_channels(struct ef4_nic *efx) efx 759 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) efx 764 drivers/net/ethernet/sfc/falcon/efx.c ef4_realloc_channels(struct ef4_nic *efx, u32 rxq_entries, u32 txq_entries) efx 771 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_check_disabled(efx); efx 778 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 797 drivers/net/ethernet/sfc/falcon/efx.c ef4_device_detach_sync(efx); efx 798 drivers/net/ethernet/sfc/falcon/efx.c ef4_stop_all(efx); efx 799 drivers/net/ethernet/sfc/falcon/efx.c ef4_soft_disable_interrupts(efx); efx 803 drivers/net/ethernet/sfc/falcon/efx.c for (i = 0; i < efx->n_channels; i++) { efx 804 drivers/net/ethernet/sfc/falcon/efx.c channel = efx->channel[i]; efx 815 drivers/net/ethernet/sfc/falcon/efx.c old_rxq_entries = efx->rxq_entries; efx 816 drivers/net/ethernet/sfc/falcon/efx.c old_txq_entries = efx->txq_entries; efx 817 drivers/net/ethernet/sfc/falcon/efx.c efx->rxq_entries = rxq_entries; efx 818 drivers/net/ethernet/sfc/falcon/efx.c efx->txq_entries = txq_entries; efx 819 drivers/net/ethernet/sfc/falcon/efx.c for (i = 0; i < efx->n_channels; i++) { efx 820 drivers/net/ethernet/sfc/falcon/efx.c channel = efx->channel[i]; efx 821 drivers/net/ethernet/sfc/falcon/efx.c efx->channel[i] = other_channel[i]; efx 826 drivers/net/ethernet/sfc/falcon/efx.c efx->next_buffer_table = next_buffer_table; efx 828 drivers/net/ethernet/sfc/falcon/efx.c for (i = 0; i < efx->n_channels; i++) { efx 829 drivers/net/ethernet/sfc/falcon/efx.c channel = efx->channel[i]; efx 835 drivers/net/ethernet/sfc/falcon/efx.c ef4_init_napi_channel(efx->channel[i]); efx 840 drivers/net/ethernet/sfc/falcon/efx.c for (i = 0; i < efx->n_channels; i++) { efx 849 drivers/net/ethernet/sfc/falcon/efx.c rc2 = ef4_soft_enable_interrupts(efx); efx 852 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, efx 854 drivers/net/ethernet/sfc/falcon/efx.c ef4_schedule_reset(efx, RESET_TYPE_DISABLE); efx 856 drivers/net/ethernet/sfc/falcon/efx.c ef4_start_all(efx); efx 857 drivers/net/ethernet/sfc/falcon/efx.c netif_device_attach(efx->net_dev); efx 863 drivers/net/ethernet/sfc/falcon/efx.c efx->rxq_entries = old_rxq_entries; efx 864 drivers/net/ethernet/sfc/falcon/efx.c efx->txq_entries = old_txq_entries; efx 865 drivers/net/ethernet/sfc/falcon/efx.c for (i = 0; i < efx->n_channels; i++) { efx 866 drivers/net/ethernet/sfc/falcon/efx.c channel = efx->channel[i]; efx 867 drivers/net/ethernet/sfc/falcon/efx.c efx->channel[i] = other_channel[i]; efx 905 drivers/net/ethernet/sfc/falcon/efx.c void ef4_link_status_changed(struct ef4_nic *efx) efx 907 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_link_state *link_state = &efx->link_state; efx 913 drivers/net/ethernet/sfc/falcon/efx.c if (!netif_running(efx->net_dev)) efx 916 drivers/net/ethernet/sfc/falcon/efx.c if (link_state->up != netif_carrier_ok(efx->net_dev)) { efx 917 drivers/net/ethernet/sfc/falcon/efx.c efx->n_link_state_changes++; efx 920 drivers/net/ethernet/sfc/falcon/efx.c netif_carrier_on(efx->net_dev); efx 922 drivers/net/ethernet/sfc/falcon/efx.c netif_carrier_off(efx->net_dev); efx 927 drivers/net/ethernet/sfc/falcon/efx.c netif_info(efx, link, efx->net_dev, efx 930 drivers/net/ethernet/sfc/falcon/efx.c efx->net_dev->mtu); efx 932 drivers/net/ethernet/sfc/falcon/efx.c netif_info(efx, link, efx->net_dev, "link down\n"); efx 935 drivers/net/ethernet/sfc/falcon/efx.c void ef4_link_set_advertising(struct ef4_nic *efx, u32 advertising) efx 937 drivers/net/ethernet/sfc/falcon/efx.c efx->link_advertising = advertising; efx 940 drivers/net/ethernet/sfc/falcon/efx.c efx->wanted_fc |= (EF4_FC_TX | EF4_FC_RX); efx 942 drivers/net/ethernet/sfc/falcon/efx.c efx->wanted_fc &= ~(EF4_FC_TX | EF4_FC_RX); efx 944 drivers/net/ethernet/sfc/falcon/efx.c efx->wanted_fc ^= EF4_FC_TX; efx 948 drivers/net/ethernet/sfc/falcon/efx.c void ef4_link_set_wanted_fc(struct ef4_nic *efx, u8 wanted_fc) efx 950 drivers/net/ethernet/sfc/falcon/efx.c efx->wanted_fc = wanted_fc; efx 951 drivers/net/ethernet/sfc/falcon/efx.c if (efx->link_advertising) { efx 953 drivers/net/ethernet/sfc/falcon/efx.c efx->link_advertising |= (ADVERTISED_Pause | efx 956 drivers/net/ethernet/sfc/falcon/efx.c efx->link_advertising &= ~(ADVERTISED_Pause | efx 959 drivers/net/ethernet/sfc/falcon/efx.c efx->link_advertising ^= ADVERTISED_Asym_Pause; efx 963 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_fini_port(struct ef4_nic *efx); efx 968 drivers/net/ethernet/sfc/falcon/efx.c void ef4_mac_reconfigure(struct ef4_nic *efx) efx 970 drivers/net/ethernet/sfc/falcon/efx.c down_read(&efx->filter_sem); efx 971 drivers/net/ethernet/sfc/falcon/efx.c efx->type->reconfigure_mac(efx); efx 972 drivers/net/ethernet/sfc/falcon/efx.c up_read(&efx->filter_sem); efx 982 drivers/net/ethernet/sfc/falcon/efx.c int __ef4_reconfigure_port(struct ef4_nic *efx) efx 987 drivers/net/ethernet/sfc/falcon/efx.c WARN_ON(!mutex_is_locked(&efx->mac_lock)); efx 990 drivers/net/ethernet/sfc/falcon/efx.c phy_mode = efx->phy_mode; efx 991 drivers/net/ethernet/sfc/falcon/efx.c if (LOOPBACK_INTERNAL(efx)) efx 992 drivers/net/ethernet/sfc/falcon/efx.c efx->phy_mode |= PHY_MODE_TX_DISABLED; efx 994 drivers/net/ethernet/sfc/falcon/efx.c efx->phy_mode &= ~PHY_MODE_TX_DISABLED; efx 996 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->reconfigure_port(efx); efx 999 drivers/net/ethernet/sfc/falcon/efx.c efx->phy_mode = phy_mode; efx 1006 drivers/net/ethernet/sfc/falcon/efx.c int ef4_reconfigure_port(struct ef4_nic *efx) efx 1010 drivers/net/ethernet/sfc/falcon/efx.c EF4_ASSERT_RESET_SERIALISED(efx); efx 1012 drivers/net/ethernet/sfc/falcon/efx.c mutex_lock(&efx->mac_lock); efx 1013 drivers/net/ethernet/sfc/falcon/efx.c rc = __ef4_reconfigure_port(efx); efx 1014 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 1024 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = container_of(data, struct ef4_nic, mac_work); efx 1026 drivers/net/ethernet/sfc/falcon/efx.c mutex_lock(&efx->mac_lock); efx 1027 drivers/net/ethernet/sfc/falcon/efx.c if (efx->port_enabled) efx 1028 drivers/net/ethernet/sfc/falcon/efx.c ef4_mac_reconfigure(efx); efx 1029 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 1032 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_probe_port(struct ef4_nic *efx) efx 1036 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, probe, efx->net_dev, "create port\n"); efx 1039 drivers/net/ethernet/sfc/falcon/efx.c efx->phy_mode = PHY_MODE_SPECIAL; efx 1042 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->probe_port(efx); efx 1047 drivers/net/ethernet/sfc/falcon/efx.c ether_addr_copy(efx->net_dev->dev_addr, efx->net_dev->perm_addr); efx 1052 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_init_port(struct ef4_nic *efx) efx 1056 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, "init port\n"); efx 1058 drivers/net/ethernet/sfc/falcon/efx.c mutex_lock(&efx->mac_lock); efx 1060 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->phy_op->init(efx); efx 1064 drivers/net/ethernet/sfc/falcon/efx.c efx->port_initialized = true; efx 1068 drivers/net/ethernet/sfc/falcon/efx.c ef4_mac_reconfigure(efx); efx 1071 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->phy_op->reconfigure(efx); efx 1075 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 1079 drivers/net/ethernet/sfc/falcon/efx.c efx->phy_op->fini(efx); efx 1081 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 1085 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_start_port(struct ef4_nic *efx) efx 1087 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, ifup, efx->net_dev, "start port\n"); efx 1088 drivers/net/ethernet/sfc/falcon/efx.c BUG_ON(efx->port_enabled); efx 1090 drivers/net/ethernet/sfc/falcon/efx.c mutex_lock(&efx->mac_lock); efx 1091 drivers/net/ethernet/sfc/falcon/efx.c efx->port_enabled = true; efx 1094 drivers/net/ethernet/sfc/falcon/efx.c ef4_mac_reconfigure(efx); efx 1096 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 1104 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_stop_port(struct ef4_nic *efx) efx 1106 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, ifdown, efx->net_dev, "stop port\n"); efx 1108 drivers/net/ethernet/sfc/falcon/efx.c EF4_ASSERT_RESET_SERIALISED(efx); efx 1110 drivers/net/ethernet/sfc/falcon/efx.c mutex_lock(&efx->mac_lock); efx 1111 drivers/net/ethernet/sfc/falcon/efx.c efx->port_enabled = false; efx 1112 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 1115 drivers/net/ethernet/sfc/falcon/efx.c netif_addr_lock_bh(efx->net_dev); efx 1116 drivers/net/ethernet/sfc/falcon/efx.c netif_addr_unlock_bh(efx->net_dev); efx 1118 drivers/net/ethernet/sfc/falcon/efx.c cancel_delayed_work_sync(&efx->monitor_work); efx 1119 drivers/net/ethernet/sfc/falcon/efx.c ef4_selftest_async_cancel(efx); efx 1120 drivers/net/ethernet/sfc/falcon/efx.c cancel_work_sync(&efx->mac_work); efx 1123 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_fini_port(struct ef4_nic *efx) efx 1125 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, "shut down port\n"); efx 1127 drivers/net/ethernet/sfc/falcon/efx.c if (!efx->port_initialized) efx 1130 drivers/net/ethernet/sfc/falcon/efx.c efx->phy_op->fini(efx); efx 1131 drivers/net/ethernet/sfc/falcon/efx.c efx->port_initialized = false; efx 1133 drivers/net/ethernet/sfc/falcon/efx.c efx->link_state.up = false; efx 1134 drivers/net/ethernet/sfc/falcon/efx.c ef4_link_status_changed(efx); efx 1137 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_remove_port(struct ef4_nic *efx) efx 1139 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, "destroying port\n"); efx 1141 drivers/net/ethernet/sfc/falcon/efx.c efx->type->remove_port(efx); efx 1160 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_associate(struct ef4_nic *efx) efx 1164 drivers/net/ethernet/sfc/falcon/efx.c if (efx->primary == efx) { efx 1167 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, probe, efx->net_dev, "adding to primary list\n"); efx 1168 drivers/net/ethernet/sfc/falcon/efx.c list_add_tail(&efx->node, &ef4_primary_list); efx 1172 drivers/net/ethernet/sfc/falcon/efx.c if (ef4_same_controller(efx, other)) { efx 1176 drivers/net/ethernet/sfc/falcon/efx.c pci_name(efx->pci_dev), efx 1177 drivers/net/ethernet/sfc/falcon/efx.c efx->net_dev->name); efx 1179 drivers/net/ethernet/sfc/falcon/efx.c &efx->secondary_list); efx 1180 drivers/net/ethernet/sfc/falcon/efx.c other->primary = efx; efx 1187 drivers/net/ethernet/sfc/falcon/efx.c if (ef4_same_controller(efx, other)) { efx 1188 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, probe, efx->net_dev, efx 1192 drivers/net/ethernet/sfc/falcon/efx.c list_add_tail(&efx->node, efx 1194 drivers/net/ethernet/sfc/falcon/efx.c efx->primary = other; efx 1199 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, probe, efx->net_dev, efx 1201 drivers/net/ethernet/sfc/falcon/efx.c list_add_tail(&efx->node, &ef4_unassociated_list); efx 1205 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_dissociate(struct ef4_nic *efx) efx 1209 drivers/net/ethernet/sfc/falcon/efx.c list_del(&efx->node); efx 1210 drivers/net/ethernet/sfc/falcon/efx.c efx->primary = NULL; efx 1212 drivers/net/ethernet/sfc/falcon/efx.c list_for_each_entry_safe(other, next, &efx->secondary_list, node) { efx 1222 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_init_io(struct ef4_nic *efx) efx 1224 drivers/net/ethernet/sfc/falcon/efx.c struct pci_dev *pci_dev = efx->pci_dev; efx 1225 drivers/net/ethernet/sfc/falcon/efx.c dma_addr_t dma_mask = efx->type->max_dma_mask; efx 1226 drivers/net/ethernet/sfc/falcon/efx.c unsigned int mem_map_size = efx->type->mem_map_size(efx); efx 1229 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, probe, efx->net_dev, "initialising I/O\n"); efx 1231 drivers/net/ethernet/sfc/falcon/efx.c bar = efx->type->mem_bar; efx 1235 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, probe, efx->net_dev, efx 1253 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, probe, efx->net_dev, efx 1257 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, probe, efx->net_dev, efx 1260 drivers/net/ethernet/sfc/falcon/efx.c efx->membase_phys = pci_resource_start(efx->pci_dev, bar); efx 1263 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, probe, efx->net_dev, efx 1268 drivers/net/ethernet/sfc/falcon/efx.c efx->membase = ioremap_nocache(efx->membase_phys, mem_map_size); efx 1269 drivers/net/ethernet/sfc/falcon/efx.c if (!efx->membase) { efx 1270 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, probe, efx->net_dev, efx 1272 drivers/net/ethernet/sfc/falcon/efx.c (unsigned long long)efx->membase_phys, mem_map_size); efx 1276 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, probe, efx->net_dev, efx 1278 drivers/net/ethernet/sfc/falcon/efx.c (unsigned long long)efx->membase_phys, mem_map_size, efx 1279 drivers/net/ethernet/sfc/falcon/efx.c efx->membase); efx 1284 drivers/net/ethernet/sfc/falcon/efx.c pci_release_region(efx->pci_dev, bar); efx 1286 drivers/net/ethernet/sfc/falcon/efx.c efx->membase_phys = 0; efx 1288 drivers/net/ethernet/sfc/falcon/efx.c pci_disable_device(efx->pci_dev); efx 1293 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_fini_io(struct ef4_nic *efx) efx 1297 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, "shutting down I/O\n"); efx 1299 drivers/net/ethernet/sfc/falcon/efx.c if (efx->membase) { efx 1300 drivers/net/ethernet/sfc/falcon/efx.c iounmap(efx->membase); efx 1301 drivers/net/ethernet/sfc/falcon/efx.c efx->membase = NULL; efx 1304 drivers/net/ethernet/sfc/falcon/efx.c if (efx->membase_phys) { efx 1305 drivers/net/ethernet/sfc/falcon/efx.c bar = efx->type->mem_bar; efx 1306 drivers/net/ethernet/sfc/falcon/efx.c pci_release_region(efx->pci_dev, bar); efx 1307 drivers/net/ethernet/sfc/falcon/efx.c efx->membase_phys = 0; efx 1311 drivers/net/ethernet/sfc/falcon/efx.c if (!pci_vfs_assigned(efx->pci_dev)) efx 1312 drivers/net/ethernet/sfc/falcon/efx.c pci_disable_device(efx->pci_dev); efx 1315 drivers/net/ethernet/sfc/falcon/efx.c void ef4_set_default_rx_indir_table(struct ef4_nic *efx) efx 1319 drivers/net/ethernet/sfc/falcon/efx.c for (i = 0; i < ARRAY_SIZE(efx->rx_indir_table); i++) efx 1320 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_indir_table[i] = efx 1321 drivers/net/ethernet/sfc/falcon/efx.c ethtool_rxfh_indir_default(i, efx->rss_spread); efx 1324 drivers/net/ethernet/sfc/falcon/efx.c static unsigned int ef4_wanted_parallelism(struct ef4_nic *efx) efx 1334 drivers/net/ethernet/sfc/falcon/efx.c netif_warn(efx, probe, efx->net_dev, efx 1352 drivers/net/ethernet/sfc/falcon/efx.c netif_cond_dbg(efx, probe, efx->net_dev, !rss_cpus, warn, efx 1364 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_probe_interrupts(struct ef4_nic *efx) efx 1371 drivers/net/ethernet/sfc/falcon/efx.c if (efx->extra_channel_type[i]) efx 1374 drivers/net/ethernet/sfc/falcon/efx.c if (efx->interrupt_mode == EF4_INT_MODE_MSIX) { efx 1378 drivers/net/ethernet/sfc/falcon/efx.c n_channels = ef4_wanted_parallelism(efx); efx 1382 drivers/net/ethernet/sfc/falcon/efx.c n_channels = min(n_channels, efx->max_channels); efx 1386 drivers/net/ethernet/sfc/falcon/efx.c rc = pci_enable_msix_range(efx->pci_dev, efx 1390 drivers/net/ethernet/sfc/falcon/efx.c efx->interrupt_mode = EF4_INT_MODE_MSI; efx 1391 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, efx 1394 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, efx 1397 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, efx 1403 drivers/net/ethernet/sfc/falcon/efx.c efx->n_channels = n_channels; efx 1407 drivers/net/ethernet/sfc/falcon/efx.c efx->n_tx_channels = min(max(n_channels / 2, efx 1409 drivers/net/ethernet/sfc/falcon/efx.c efx->max_tx_channels); efx 1410 drivers/net/ethernet/sfc/falcon/efx.c efx->n_rx_channels = max(n_channels - efx 1411 drivers/net/ethernet/sfc/falcon/efx.c efx->n_tx_channels, efx 1414 drivers/net/ethernet/sfc/falcon/efx.c efx->n_tx_channels = min(n_channels, efx 1415 drivers/net/ethernet/sfc/falcon/efx.c efx->max_tx_channels); efx 1416 drivers/net/ethernet/sfc/falcon/efx.c efx->n_rx_channels = n_channels; efx 1418 drivers/net/ethernet/sfc/falcon/efx.c for (i = 0; i < efx->n_channels; i++) efx 1419 drivers/net/ethernet/sfc/falcon/efx.c ef4_get_channel(efx, i)->irq = efx 1425 drivers/net/ethernet/sfc/falcon/efx.c if (efx->interrupt_mode == EF4_INT_MODE_MSI) { efx 1426 drivers/net/ethernet/sfc/falcon/efx.c efx->n_channels = 1; efx 1427 drivers/net/ethernet/sfc/falcon/efx.c efx->n_rx_channels = 1; efx 1428 drivers/net/ethernet/sfc/falcon/efx.c efx->n_tx_channels = 1; efx 1429 drivers/net/ethernet/sfc/falcon/efx.c rc = pci_enable_msi(efx->pci_dev); efx 1431 drivers/net/ethernet/sfc/falcon/efx.c ef4_get_channel(efx, 0)->irq = efx->pci_dev->irq; efx 1433 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, efx 1435 drivers/net/ethernet/sfc/falcon/efx.c efx->interrupt_mode = EF4_INT_MODE_LEGACY; efx 1440 drivers/net/ethernet/sfc/falcon/efx.c if (efx->interrupt_mode == EF4_INT_MODE_LEGACY) { efx 1441 drivers/net/ethernet/sfc/falcon/efx.c efx->n_channels = 1 + (ef4_separate_tx_channels ? 1 : 0); efx 1442 drivers/net/ethernet/sfc/falcon/efx.c efx->n_rx_channels = 1; efx 1443 drivers/net/ethernet/sfc/falcon/efx.c efx->n_tx_channels = 1; efx 1444 drivers/net/ethernet/sfc/falcon/efx.c efx->legacy_irq = efx->pci_dev->irq; efx 1448 drivers/net/ethernet/sfc/falcon/efx.c j = efx->n_channels; efx 1450 drivers/net/ethernet/sfc/falcon/efx.c if (!efx->extra_channel_type[i]) efx 1452 drivers/net/ethernet/sfc/falcon/efx.c if (efx->interrupt_mode != EF4_INT_MODE_MSIX || efx 1453 drivers/net/ethernet/sfc/falcon/efx.c efx->n_channels <= extra_channels) { efx 1454 drivers/net/ethernet/sfc/falcon/efx.c efx->extra_channel_type[i]->handle_no_channel(efx); efx 1457 drivers/net/ethernet/sfc/falcon/efx.c ef4_get_channel(efx, j)->type = efx 1458 drivers/net/ethernet/sfc/falcon/efx.c efx->extra_channel_type[i]; efx 1462 drivers/net/ethernet/sfc/falcon/efx.c efx->rss_spread = efx->n_rx_channels; efx 1467 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_soft_enable_interrupts(struct ef4_nic *efx) efx 1472 drivers/net/ethernet/sfc/falcon/efx.c BUG_ON(efx->state == STATE_DISABLED); efx 1474 drivers/net/ethernet/sfc/falcon/efx.c efx->irq_soft_enabled = true; efx 1477 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 1489 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 1500 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_soft_disable_interrupts(struct ef4_nic *efx) efx 1504 drivers/net/ethernet/sfc/falcon/efx.c if (efx->state == STATE_DISABLED) efx 1507 drivers/net/ethernet/sfc/falcon/efx.c efx->irq_soft_enabled = false; efx 1510 drivers/net/ethernet/sfc/falcon/efx.c if (efx->legacy_irq) efx 1511 drivers/net/ethernet/sfc/falcon/efx.c synchronize_irq(efx->legacy_irq); efx 1513 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 1523 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_enable_interrupts(struct ef4_nic *efx) efx 1528 drivers/net/ethernet/sfc/falcon/efx.c BUG_ON(efx->state == STATE_DISABLED); efx 1530 drivers/net/ethernet/sfc/falcon/efx.c if (efx->eeh_disabled_legacy_irq) { efx 1531 drivers/net/ethernet/sfc/falcon/efx.c enable_irq(efx->legacy_irq); efx 1532 drivers/net/ethernet/sfc/falcon/efx.c efx->eeh_disabled_legacy_irq = false; efx 1535 drivers/net/ethernet/sfc/falcon/efx.c efx->type->irq_enable_master(efx); efx 1537 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 1545 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_soft_enable_interrupts(efx); efx 1553 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 1560 drivers/net/ethernet/sfc/falcon/efx.c efx->type->irq_disable_non_ev(efx); efx 1565 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_disable_interrupts(struct ef4_nic *efx) efx 1569 drivers/net/ethernet/sfc/falcon/efx.c ef4_soft_disable_interrupts(efx); efx 1571 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 1576 drivers/net/ethernet/sfc/falcon/efx.c efx->type->irq_disable_non_ev(efx); efx 1579 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_remove_interrupts(struct ef4_nic *efx) efx 1584 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) efx 1586 drivers/net/ethernet/sfc/falcon/efx.c pci_disable_msi(efx->pci_dev); efx 1587 drivers/net/ethernet/sfc/falcon/efx.c pci_disable_msix(efx->pci_dev); efx 1590 drivers/net/ethernet/sfc/falcon/efx.c efx->legacy_irq = 0; efx 1593 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_set_channels(struct ef4_nic *efx) efx 1598 drivers/net/ethernet/sfc/falcon/efx.c efx->tx_channel_offset = efx 1600 drivers/net/ethernet/sfc/falcon/efx.c efx->n_channels - efx->n_tx_channels : 0; efx 1606 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 1607 drivers/net/ethernet/sfc/falcon/efx.c if (channel->channel < efx->n_rx_channels) efx 1613 drivers/net/ethernet/sfc/falcon/efx.c tx_queue->queue -= (efx->tx_channel_offset * efx 1618 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_probe_nic(struct ef4_nic *efx) efx 1622 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, probe, efx->net_dev, "creating NIC\n"); efx 1625 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->probe(efx); efx 1630 drivers/net/ethernet/sfc/falcon/efx.c if (!efx->max_channels || !efx->max_tx_channels) { efx 1631 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, efx 1641 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_probe_interrupts(efx); efx 1645 drivers/net/ethernet/sfc/falcon/efx.c ef4_set_channels(efx); efx 1648 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->dimension_resources(efx); efx 1654 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_interrupts(efx); efx 1658 drivers/net/ethernet/sfc/falcon/efx.c if (efx->n_channels > 1) efx 1659 drivers/net/ethernet/sfc/falcon/efx.c netdev_rss_key_fill(&efx->rx_hash_key, efx 1660 drivers/net/ethernet/sfc/falcon/efx.c sizeof(efx->rx_hash_key)); efx 1661 drivers/net/ethernet/sfc/falcon/efx.c ef4_set_default_rx_indir_table(efx); efx 1663 drivers/net/ethernet/sfc/falcon/efx.c netif_set_real_num_tx_queues(efx->net_dev, efx->n_tx_channels); efx 1664 drivers/net/ethernet/sfc/falcon/efx.c netif_set_real_num_rx_queues(efx->net_dev, efx->n_rx_channels); efx 1667 drivers/net/ethernet/sfc/falcon/efx.c efx->irq_mod_step_us = DIV_ROUND_UP(efx->timer_quantum_ns, 1000); efx 1668 drivers/net/ethernet/sfc/falcon/efx.c ef4_init_irq_moderation(efx, tx_irq_mod_usec, rx_irq_mod_usec, true, efx 1674 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_interrupts(efx); efx 1676 drivers/net/ethernet/sfc/falcon/efx.c efx->type->remove(efx); efx 1680 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_remove_nic(struct ef4_nic *efx) efx 1682 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, "destroying NIC\n"); efx 1684 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_interrupts(efx); efx 1685 drivers/net/ethernet/sfc/falcon/efx.c efx->type->remove(efx); efx 1688 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_probe_filters(struct ef4_nic *efx) efx 1692 drivers/net/ethernet/sfc/falcon/efx.c spin_lock_init(&efx->filter_lock); efx 1693 drivers/net/ethernet/sfc/falcon/efx.c init_rwsem(&efx->filter_sem); efx 1694 drivers/net/ethernet/sfc/falcon/efx.c mutex_lock(&efx->mac_lock); efx 1695 drivers/net/ethernet/sfc/falcon/efx.c down_write(&efx->filter_sem); efx 1696 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->filter_table_probe(efx); efx 1701 drivers/net/ethernet/sfc/falcon/efx.c if (efx->type->offload_features & NETIF_F_NTUPLE) { efx 1705 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 1707 drivers/net/ethernet/sfc/falcon/efx.c kcalloc(efx->type->max_rx_ip_filters, efx 1714 drivers/net/ethernet/sfc/falcon/efx.c i < efx->type->max_rx_ip_filters; efx 1721 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) efx 1723 drivers/net/ethernet/sfc/falcon/efx.c efx->type->filter_table_remove(efx); efx 1728 drivers/net/ethernet/sfc/falcon/efx.c efx->rps_expire_index = efx->rps_expire_channel = 0; efx 1732 drivers/net/ethernet/sfc/falcon/efx.c up_write(&efx->filter_sem); efx 1733 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 1737 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_remove_filters(struct ef4_nic *efx) efx 1742 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) efx 1745 drivers/net/ethernet/sfc/falcon/efx.c down_write(&efx->filter_sem); efx 1746 drivers/net/ethernet/sfc/falcon/efx.c efx->type->filter_table_remove(efx); efx 1747 drivers/net/ethernet/sfc/falcon/efx.c up_write(&efx->filter_sem); efx 1750 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_restore_filters(struct ef4_nic *efx) efx 1752 drivers/net/ethernet/sfc/falcon/efx.c down_read(&efx->filter_sem); efx 1753 drivers/net/ethernet/sfc/falcon/efx.c efx->type->filter_table_restore(efx); efx 1754 drivers/net/ethernet/sfc/falcon/efx.c up_read(&efx->filter_sem); efx 1763 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_probe_all(struct ef4_nic *efx) efx 1767 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_probe_nic(efx); efx 1769 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, probe, efx->net_dev, "failed to create NIC\n"); efx 1773 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_probe_port(efx); efx 1775 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, probe, efx->net_dev, "failed to create port\n"); efx 1780 drivers/net/ethernet/sfc/falcon/efx.c if (WARN_ON(EF4_DEFAULT_DMAQ_SIZE < EF4_TXQ_MIN_ENT(efx))) { efx 1784 drivers/net/ethernet/sfc/falcon/efx.c efx->rxq_entries = efx->txq_entries = EF4_DEFAULT_DMAQ_SIZE; efx 1786 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_probe_filters(efx); efx 1788 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, probe, efx->net_dev, efx 1793 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_probe_channels(efx); efx 1800 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_filters(efx); efx 1803 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_port(efx); efx 1805 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_nic(efx); efx 1817 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_start_all(struct ef4_nic *efx) efx 1819 drivers/net/ethernet/sfc/falcon/efx.c EF4_ASSERT_RESET_SERIALISED(efx); efx 1820 drivers/net/ethernet/sfc/falcon/efx.c BUG_ON(efx->state == STATE_DISABLED); efx 1824 drivers/net/ethernet/sfc/falcon/efx.c if (efx->port_enabled || !netif_running(efx->net_dev) || efx 1825 drivers/net/ethernet/sfc/falcon/efx.c efx->reset_pending) efx 1828 drivers/net/ethernet/sfc/falcon/efx.c ef4_start_port(efx); efx 1829 drivers/net/ethernet/sfc/falcon/efx.c ef4_start_datapath(efx); efx 1832 drivers/net/ethernet/sfc/falcon/efx.c if (efx->type->monitor != NULL) efx 1833 drivers/net/ethernet/sfc/falcon/efx.c queue_delayed_work(efx->workqueue, &efx->monitor_work, efx 1836 drivers/net/ethernet/sfc/falcon/efx.c efx->type->start_stats(efx); efx 1837 drivers/net/ethernet/sfc/falcon/efx.c efx->type->pull_stats(efx); efx 1838 drivers/net/ethernet/sfc/falcon/efx.c spin_lock_bh(&efx->stats_lock); efx 1839 drivers/net/ethernet/sfc/falcon/efx.c efx->type->update_stats(efx, NULL, NULL); efx 1840 drivers/net/ethernet/sfc/falcon/efx.c spin_unlock_bh(&efx->stats_lock); efx 1848 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_stop_all(struct ef4_nic *efx) efx 1850 drivers/net/ethernet/sfc/falcon/efx.c EF4_ASSERT_RESET_SERIALISED(efx); efx 1853 drivers/net/ethernet/sfc/falcon/efx.c if (!efx->port_enabled) efx 1859 drivers/net/ethernet/sfc/falcon/efx.c efx->type->pull_stats(efx); efx 1860 drivers/net/ethernet/sfc/falcon/efx.c spin_lock_bh(&efx->stats_lock); efx 1861 drivers/net/ethernet/sfc/falcon/efx.c efx->type->update_stats(efx, NULL, NULL); efx 1862 drivers/net/ethernet/sfc/falcon/efx.c spin_unlock_bh(&efx->stats_lock); efx 1863 drivers/net/ethernet/sfc/falcon/efx.c efx->type->stop_stats(efx); efx 1864 drivers/net/ethernet/sfc/falcon/efx.c ef4_stop_port(efx); efx 1870 drivers/net/ethernet/sfc/falcon/efx.c WARN_ON(netif_running(efx->net_dev) && efx 1871 drivers/net/ethernet/sfc/falcon/efx.c netif_device_present(efx->net_dev)); efx 1872 drivers/net/ethernet/sfc/falcon/efx.c netif_tx_disable(efx->net_dev); efx 1874 drivers/net/ethernet/sfc/falcon/efx.c ef4_stop_datapath(efx); efx 1877 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_remove_all(struct ef4_nic *efx) efx 1879 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_channels(efx); efx 1880 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_filters(efx); efx 1881 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_port(efx); efx 1882 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_nic(efx); efx 1890 drivers/net/ethernet/sfc/falcon/efx.c unsigned int ef4_usecs_to_ticks(struct ef4_nic *efx, unsigned int usecs) efx 1894 drivers/net/ethernet/sfc/falcon/efx.c if (usecs * 1000 < efx->timer_quantum_ns) efx 1896 drivers/net/ethernet/sfc/falcon/efx.c return usecs * 1000 / efx->timer_quantum_ns; efx 1899 drivers/net/ethernet/sfc/falcon/efx.c unsigned int ef4_ticks_to_usecs(struct ef4_nic *efx, unsigned int ticks) efx 1904 drivers/net/ethernet/sfc/falcon/efx.c return DIV_ROUND_UP(ticks * efx->timer_quantum_ns, 1000); efx 1908 drivers/net/ethernet/sfc/falcon/efx.c int ef4_init_irq_moderation(struct ef4_nic *efx, unsigned int tx_usecs, efx 1915 drivers/net/ethernet/sfc/falcon/efx.c EF4_ASSERT_RESET_SERIALISED(efx); efx 1917 drivers/net/ethernet/sfc/falcon/efx.c timer_max_us = efx->timer_max_ns / 1000; efx 1922 drivers/net/ethernet/sfc/falcon/efx.c if (tx_usecs != rx_usecs && efx->tx_channel_offset == 0 && efx 1924 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "Channels are shared. " efx 1929 drivers/net/ethernet/sfc/falcon/efx.c efx->irq_rx_adaptive = rx_adaptive; efx 1930 drivers/net/ethernet/sfc/falcon/efx.c efx->irq_rx_moderation_us = rx_usecs; efx 1931 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 1941 drivers/net/ethernet/sfc/falcon/efx.c void ef4_get_irq_moderation(struct ef4_nic *efx, unsigned int *tx_usecs, efx 1944 drivers/net/ethernet/sfc/falcon/efx.c *rx_adaptive = efx->irq_rx_adaptive; efx 1945 drivers/net/ethernet/sfc/falcon/efx.c *rx_usecs = efx->irq_rx_moderation_us; efx 1951 drivers/net/ethernet/sfc/falcon/efx.c if (efx->tx_channel_offset == 0) { efx 1956 drivers/net/ethernet/sfc/falcon/efx.c tx_channel = efx->channel[efx->tx_channel_offset]; efx 1970 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = container_of(data, struct ef4_nic, efx 1973 drivers/net/ethernet/sfc/falcon/efx.c netif_vdbg(efx, timer, efx->net_dev, efx 1976 drivers/net/ethernet/sfc/falcon/efx.c BUG_ON(efx->type->monitor == NULL); efx 1981 drivers/net/ethernet/sfc/falcon/efx.c if (mutex_trylock(&efx->mac_lock)) { efx 1982 drivers/net/ethernet/sfc/falcon/efx.c if (efx->port_enabled) efx 1983 drivers/net/ethernet/sfc/falcon/efx.c efx->type->monitor(efx); efx 1984 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 1987 drivers/net/ethernet/sfc/falcon/efx.c queue_delayed_work(efx->workqueue, &efx->monitor_work, efx 2002 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 2010 drivers/net/ethernet/sfc/falcon/efx.c return mdio_mii_ioctl(&efx->mdio, data, cmd); efx 2021 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = channel->efx; efx 2023 drivers/net/ethernet/sfc/falcon/efx.c channel->napi_dev = efx->net_dev; efx 2028 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_init_napi(struct ef4_nic *efx) efx 2032 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) efx 2044 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_fini_napi(struct ef4_nic *efx) efx 2048 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) efx 2061 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 2064 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, ifup, efx->net_dev, "opening device on CPU %d\n", efx 2067 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_check_disabled(efx); efx 2070 drivers/net/ethernet/sfc/falcon/efx.c if (efx->phy_mode & PHY_MODE_SPECIAL) efx 2075 drivers/net/ethernet/sfc/falcon/efx.c ef4_link_status_changed(efx); efx 2077 drivers/net/ethernet/sfc/falcon/efx.c ef4_start_all(efx); efx 2078 drivers/net/ethernet/sfc/falcon/efx.c ef4_selftest_async_start(efx); efx 2088 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 2090 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, ifdown, efx->net_dev, "closing on CPU %d\n", efx 2094 drivers/net/ethernet/sfc/falcon/efx.c ef4_stop_all(efx); efx 2103 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 2105 drivers/net/ethernet/sfc/falcon/efx.c spin_lock_bh(&efx->stats_lock); efx 2106 drivers/net/ethernet/sfc/falcon/efx.c efx->type->update_stats(efx, NULL, stats); efx 2107 drivers/net/ethernet/sfc/falcon/efx.c spin_unlock_bh(&efx->stats_lock); efx 2113 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 2115 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, tx_err, efx->net_dev, efx 2117 drivers/net/ethernet/sfc/falcon/efx.c efx->port_enabled); efx 2119 drivers/net/ethernet/sfc/falcon/efx.c ef4_schedule_reset(efx, RESET_TYPE_TX_WATCHDOG); efx 2126 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 2129 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_check_disabled(efx); efx 2133 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, "changing MTU to %d\n", new_mtu); efx 2135 drivers/net/ethernet/sfc/falcon/efx.c ef4_device_detach_sync(efx); efx 2136 drivers/net/ethernet/sfc/falcon/efx.c ef4_stop_all(efx); efx 2138 drivers/net/ethernet/sfc/falcon/efx.c mutex_lock(&efx->mac_lock); efx 2140 drivers/net/ethernet/sfc/falcon/efx.c ef4_mac_reconfigure(efx); efx 2141 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 2143 drivers/net/ethernet/sfc/falcon/efx.c ef4_start_all(efx); efx 2144 drivers/net/ethernet/sfc/falcon/efx.c netif_device_attach(efx->net_dev); efx 2150 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 2157 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, efx 2166 drivers/net/ethernet/sfc/falcon/efx.c if (efx->type->set_mac_address) { efx 2167 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->set_mac_address(efx); efx 2175 drivers/net/ethernet/sfc/falcon/efx.c mutex_lock(&efx->mac_lock); efx 2176 drivers/net/ethernet/sfc/falcon/efx.c ef4_mac_reconfigure(efx); efx 2177 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 2185 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 2187 drivers/net/ethernet/sfc/falcon/efx.c if (efx->port_enabled) efx 2188 drivers/net/ethernet/sfc/falcon/efx.c queue_work(efx->workqueue, &efx->mac_work); efx 2194 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 2199 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->filter_clear_rx(efx, EF4_FILTER_PRI_MANUAL); efx 2233 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_update_name(struct ef4_nic *efx) efx 2235 drivers/net/ethernet/sfc/falcon/efx.c strcpy(efx->name, efx->net_dev->name); efx 2236 drivers/net/ethernet/sfc/falcon/efx.c ef4_mtd_rename(efx); efx 2237 drivers/net/ethernet/sfc/falcon/efx.c ef4_set_channel_names(efx); efx 2259 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = dev_get_drvdata(dev); efx 2260 drivers/net/ethernet/sfc/falcon/efx.c return sprintf(buf, "%d\n", efx->phy_type); efx 2264 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_register_netdev(struct ef4_nic *efx) efx 2266 drivers/net/ethernet/sfc/falcon/efx.c struct net_device *net_dev = efx->net_dev; efx 2271 drivers/net/ethernet/sfc/falcon/efx.c net_dev->irq = efx->pci_dev->irq; efx 2284 drivers/net/ethernet/sfc/falcon/efx.c efx->state = STATE_READY; efx 2286 drivers/net/ethernet/sfc/falcon/efx.c if (efx->reset_pending) { efx 2287 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, probe, efx->net_dev, efx 2296 drivers/net/ethernet/sfc/falcon/efx.c ef4_update_name(efx); efx 2305 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) { efx 2311 drivers/net/ethernet/sfc/falcon/efx.c ef4_associate(efx); efx 2315 drivers/net/ethernet/sfc/falcon/efx.c rc = device_create_file(&efx->pci_dev->dev, &dev_attr_phy_type); efx 2317 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, efx 2325 drivers/net/ethernet/sfc/falcon/efx.c ef4_dissociate(efx); efx 2328 drivers/net/ethernet/sfc/falcon/efx.c efx->state = STATE_UNINIT; efx 2330 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "could not register net dev\n"); efx 2334 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_unregister_netdev(struct ef4_nic *efx) efx 2336 drivers/net/ethernet/sfc/falcon/efx.c if (!efx->net_dev) efx 2339 drivers/net/ethernet/sfc/falcon/efx.c BUG_ON(netdev_priv(efx->net_dev) != efx); efx 2341 drivers/net/ethernet/sfc/falcon/efx.c if (ef4_dev_registered(efx)) { efx 2342 drivers/net/ethernet/sfc/falcon/efx.c strlcpy(efx->name, pci_name(efx->pci_dev), sizeof(efx->name)); efx 2343 drivers/net/ethernet/sfc/falcon/efx.c device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_type); efx 2344 drivers/net/ethernet/sfc/falcon/efx.c unregister_netdev(efx->net_dev); efx 2356 drivers/net/ethernet/sfc/falcon/efx.c void ef4_reset_down(struct ef4_nic *efx, enum reset_type method) efx 2358 drivers/net/ethernet/sfc/falcon/efx.c EF4_ASSERT_RESET_SERIALISED(efx); efx 2360 drivers/net/ethernet/sfc/falcon/efx.c ef4_stop_all(efx); efx 2361 drivers/net/ethernet/sfc/falcon/efx.c ef4_disable_interrupts(efx); efx 2363 drivers/net/ethernet/sfc/falcon/efx.c mutex_lock(&efx->mac_lock); efx 2364 drivers/net/ethernet/sfc/falcon/efx.c if (efx->port_initialized && method != RESET_TYPE_INVISIBLE && efx 2366 drivers/net/ethernet/sfc/falcon/efx.c efx->phy_op->fini(efx); efx 2367 drivers/net/ethernet/sfc/falcon/efx.c efx->type->fini(efx); efx 2375 drivers/net/ethernet/sfc/falcon/efx.c int ef4_reset_up(struct ef4_nic *efx, enum reset_type method, bool ok) efx 2379 drivers/net/ethernet/sfc/falcon/efx.c EF4_ASSERT_RESET_SERIALISED(efx); efx 2382 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->init(efx); efx 2384 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "failed to initialise NIC\n"); efx 2391 drivers/net/ethernet/sfc/falcon/efx.c if (efx->port_initialized && method != RESET_TYPE_INVISIBLE && efx 2393 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->phy_op->init(efx); efx 2396 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->phy_op->reconfigure(efx); efx 2398 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, efx 2402 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_enable_interrupts(efx); efx 2406 drivers/net/ethernet/sfc/falcon/efx.c down_read(&efx->filter_sem); efx 2407 drivers/net/ethernet/sfc/falcon/efx.c ef4_restore_filters(efx); efx 2408 drivers/net/ethernet/sfc/falcon/efx.c up_read(&efx->filter_sem); efx 2410 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 2412 drivers/net/ethernet/sfc/falcon/efx.c ef4_start_all(efx); efx 2417 drivers/net/ethernet/sfc/falcon/efx.c efx->port_initialized = false; efx 2419 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 2429 drivers/net/ethernet/sfc/falcon/efx.c int ef4_reset(struct ef4_nic *efx, enum reset_type method) efx 2434 drivers/net/ethernet/sfc/falcon/efx.c netif_info(efx, drv, efx->net_dev, "resetting (%s)\n", efx 2437 drivers/net/ethernet/sfc/falcon/efx.c ef4_device_detach_sync(efx); efx 2438 drivers/net/ethernet/sfc/falcon/efx.c ef4_reset_down(efx, method); efx 2440 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->reset(efx, method); efx 2442 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "failed to reset hardware\n"); efx 2450 drivers/net/ethernet/sfc/falcon/efx.c efx->reset_pending &= -(1 << (method + 1)); efx 2452 drivers/net/ethernet/sfc/falcon/efx.c __clear_bit(method, &efx->reset_pending); efx 2458 drivers/net/ethernet/sfc/falcon/efx.c pci_set_master(efx->pci_dev); efx 2465 drivers/net/ethernet/sfc/falcon/efx.c rc2 = ef4_reset_up(efx, method, !disabled); efx 2473 drivers/net/ethernet/sfc/falcon/efx.c dev_close(efx->net_dev); efx 2474 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "has been disabled\n"); efx 2475 drivers/net/ethernet/sfc/falcon/efx.c efx->state = STATE_DISABLED; efx 2477 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, "reset complete\n"); efx 2478 drivers/net/ethernet/sfc/falcon/efx.c netif_device_attach(efx->net_dev); efx 2488 drivers/net/ethernet/sfc/falcon/efx.c int ef4_try_recovery(struct ef4_nic *efx) efx 2496 drivers/net/ethernet/sfc/falcon/efx.c struct eeh_dev *eehdev = pci_dev_to_eeh_dev(efx->pci_dev); efx 2512 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = container_of(data, struct ef4_nic, reset_work); efx 2516 drivers/net/ethernet/sfc/falcon/efx.c pending = READ_ONCE(efx->reset_pending); efx 2521 drivers/net/ethernet/sfc/falcon/efx.c ef4_try_recovery(efx)) efx 2533 drivers/net/ethernet/sfc/falcon/efx.c if (efx->state == STATE_READY) efx 2534 drivers/net/ethernet/sfc/falcon/efx.c (void)ef4_reset(efx, method); efx 2539 drivers/net/ethernet/sfc/falcon/efx.c void ef4_schedule_reset(struct ef4_nic *efx, enum reset_type type) efx 2543 drivers/net/ethernet/sfc/falcon/efx.c if (efx->state == STATE_RECOVERY) { efx 2544 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, efx 2559 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, "scheduling %s reset\n", efx 2563 drivers/net/ethernet/sfc/falcon/efx.c method = efx->type->map_reset_reason(type); efx 2564 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, efx 2570 drivers/net/ethernet/sfc/falcon/efx.c set_bit(method, &efx->reset_pending); efx 2576 drivers/net/ethernet/sfc/falcon/efx.c if (READ_ONCE(efx->state) != STATE_READY) efx 2579 drivers/net/ethernet/sfc/falcon/efx.c queue_work(reset_workqueue, &efx->reset_work); efx 2608 drivers/net/ethernet/sfc/falcon/efx.c int ef4_port_dummy_op_int(struct ef4_nic *efx) efx 2612 drivers/net/ethernet/sfc/falcon/efx.c void ef4_port_dummy_op_void(struct ef4_nic *efx) {} efx 2614 drivers/net/ethernet/sfc/falcon/efx.c static bool ef4_port_dummy_op_poll(struct ef4_nic *efx) efx 2635 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_init_struct(struct ef4_nic *efx, efx 2641 drivers/net/ethernet/sfc/falcon/efx.c INIT_LIST_HEAD(&efx->node); efx 2642 drivers/net/ethernet/sfc/falcon/efx.c INIT_LIST_HEAD(&efx->secondary_list); efx 2643 drivers/net/ethernet/sfc/falcon/efx.c spin_lock_init(&efx->biu_lock); efx 2645 drivers/net/ethernet/sfc/falcon/efx.c INIT_LIST_HEAD(&efx->mtd_list); efx 2647 drivers/net/ethernet/sfc/falcon/efx.c INIT_WORK(&efx->reset_work, ef4_reset_work); efx 2648 drivers/net/ethernet/sfc/falcon/efx.c INIT_DELAYED_WORK(&efx->monitor_work, ef4_monitor); efx 2649 drivers/net/ethernet/sfc/falcon/efx.c INIT_DELAYED_WORK(&efx->selftest_work, ef4_selftest_async_work); efx 2650 drivers/net/ethernet/sfc/falcon/efx.c efx->pci_dev = pci_dev; efx 2651 drivers/net/ethernet/sfc/falcon/efx.c efx->msg_enable = debug; efx 2652 drivers/net/ethernet/sfc/falcon/efx.c efx->state = STATE_UNINIT; efx 2653 drivers/net/ethernet/sfc/falcon/efx.c strlcpy(efx->name, pci_name(pci_dev), sizeof(efx->name)); efx 2655 drivers/net/ethernet/sfc/falcon/efx.c efx->net_dev = net_dev; efx 2656 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_prefix_size = efx->type->rx_prefix_size; efx 2657 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_ip_align = efx 2658 drivers/net/ethernet/sfc/falcon/efx.c NET_IP_ALIGN ? (efx->rx_prefix_size + NET_IP_ALIGN) % 4 : 0; efx 2659 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_packet_hash_offset = efx 2660 drivers/net/ethernet/sfc/falcon/efx.c efx->type->rx_hash_offset - efx->type->rx_prefix_size; efx 2661 drivers/net/ethernet/sfc/falcon/efx.c efx->rx_packet_ts_offset = efx 2662 drivers/net/ethernet/sfc/falcon/efx.c efx->type->rx_ts_offset - efx->type->rx_prefix_size; efx 2663 drivers/net/ethernet/sfc/falcon/efx.c spin_lock_init(&efx->stats_lock); efx 2664 drivers/net/ethernet/sfc/falcon/efx.c mutex_init(&efx->mac_lock); efx 2665 drivers/net/ethernet/sfc/falcon/efx.c efx->phy_op = &ef4_dummy_phy_operations; efx 2666 drivers/net/ethernet/sfc/falcon/efx.c efx->mdio.dev = net_dev; efx 2667 drivers/net/ethernet/sfc/falcon/efx.c INIT_WORK(&efx->mac_work, ef4_mac_work); efx 2668 drivers/net/ethernet/sfc/falcon/efx.c init_waitqueue_head(&efx->flush_wq); efx 2671 drivers/net/ethernet/sfc/falcon/efx.c efx->channel[i] = ef4_alloc_channel(efx, i, NULL); efx 2672 drivers/net/ethernet/sfc/falcon/efx.c if (!efx->channel[i]) efx 2674 drivers/net/ethernet/sfc/falcon/efx.c efx->msi_context[i].efx = efx; efx 2675 drivers/net/ethernet/sfc/falcon/efx.c efx->msi_context[i].index = i; efx 2679 drivers/net/ethernet/sfc/falcon/efx.c efx->interrupt_mode = max(efx->type->max_interrupt_mode, efx 2683 drivers/net/ethernet/sfc/falcon/efx.c snprintf(efx->workqueue_name, sizeof(efx->workqueue_name), "sfc%s", efx 2685 drivers/net/ethernet/sfc/falcon/efx.c efx->workqueue = create_singlethread_workqueue(efx->workqueue_name); efx 2686 drivers/net/ethernet/sfc/falcon/efx.c if (!efx->workqueue) efx 2692 drivers/net/ethernet/sfc/falcon/efx.c ef4_fini_struct(efx); efx 2696 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_fini_struct(struct ef4_nic *efx) efx 2701 drivers/net/ethernet/sfc/falcon/efx.c kfree(efx->channel[i]); efx 2703 drivers/net/ethernet/sfc/falcon/efx.c kfree(efx->vpd_sn); efx 2705 drivers/net/ethernet/sfc/falcon/efx.c if (efx->workqueue) { efx 2706 drivers/net/ethernet/sfc/falcon/efx.c destroy_workqueue(efx->workqueue); efx 2707 drivers/net/ethernet/sfc/falcon/efx.c efx->workqueue = NULL; efx 2711 drivers/net/ethernet/sfc/falcon/efx.c void ef4_update_sw_stats(struct ef4_nic *efx, u64 *stats) efx 2716 drivers/net/ethernet/sfc/falcon/efx.c ef4_for_each_channel(channel, efx) efx 2719 drivers/net/ethernet/sfc/falcon/efx.c stats[GENERIC_STAT_rx_noskb_drops] = atomic_read(&efx->n_rx_noskb_drops); efx 2731 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_pci_remove_main(struct ef4_nic *efx) efx 2736 drivers/net/ethernet/sfc/falcon/efx.c BUG_ON(efx->state == STATE_READY); efx 2737 drivers/net/ethernet/sfc/falcon/efx.c cancel_work_sync(&efx->reset_work); efx 2739 drivers/net/ethernet/sfc/falcon/efx.c ef4_disable_interrupts(efx); efx 2740 drivers/net/ethernet/sfc/falcon/efx.c ef4_nic_fini_interrupt(efx); efx 2741 drivers/net/ethernet/sfc/falcon/efx.c ef4_fini_port(efx); efx 2742 drivers/net/ethernet/sfc/falcon/efx.c efx->type->fini(efx); efx 2743 drivers/net/ethernet/sfc/falcon/efx.c ef4_fini_napi(efx); efx 2744 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_all(efx); efx 2753 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx; efx 2755 drivers/net/ethernet/sfc/falcon/efx.c efx = pci_get_drvdata(pci_dev); efx 2756 drivers/net/ethernet/sfc/falcon/efx.c if (!efx) efx 2761 drivers/net/ethernet/sfc/falcon/efx.c ef4_dissociate(efx); efx 2762 drivers/net/ethernet/sfc/falcon/efx.c dev_close(efx->net_dev); efx 2763 drivers/net/ethernet/sfc/falcon/efx.c ef4_disable_interrupts(efx); efx 2764 drivers/net/ethernet/sfc/falcon/efx.c efx->state = STATE_UNINIT; efx 2767 drivers/net/ethernet/sfc/falcon/efx.c ef4_unregister_netdev(efx); efx 2769 drivers/net/ethernet/sfc/falcon/efx.c ef4_mtd_remove(efx); efx 2771 drivers/net/ethernet/sfc/falcon/efx.c ef4_pci_remove_main(efx); efx 2773 drivers/net/ethernet/sfc/falcon/efx.c ef4_fini_io(efx); efx 2774 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, "shutdown successful\n"); efx 2776 drivers/net/ethernet/sfc/falcon/efx.c ef4_fini_struct(efx); efx 2777 drivers/net/ethernet/sfc/falcon/efx.c free_netdev(efx->net_dev); efx 2788 drivers/net/ethernet/sfc/falcon/efx.c static void ef4_probe_vpd_strings(struct ef4_nic *efx) efx 2790 drivers/net/ethernet/sfc/falcon/efx.c struct pci_dev *dev = efx->pci_dev; efx 2798 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "Unable to read VPD\n"); efx 2805 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "VPD Read-only not found\n"); efx 2818 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "Part number not found\n"); efx 2825 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "Incomplete part number\n"); efx 2829 drivers/net/ethernet/sfc/falcon/efx.c netif_info(efx, drv, efx->net_dev, efx 2836 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "Serial number not found\n"); efx 2843 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, drv, efx->net_dev, "Incomplete serial number\n"); efx 2847 drivers/net/ethernet/sfc/falcon/efx.c efx->vpd_sn = kmalloc(j + 1, GFP_KERNEL); efx 2848 drivers/net/ethernet/sfc/falcon/efx.c if (!efx->vpd_sn) efx 2851 drivers/net/ethernet/sfc/falcon/efx.c snprintf(efx->vpd_sn, j + 1, "%s", &vpd_data[i]); efx 2858 drivers/net/ethernet/sfc/falcon/efx.c static int ef4_pci_probe_main(struct ef4_nic *efx) efx 2863 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_probe_all(efx); efx 2867 drivers/net/ethernet/sfc/falcon/efx.c ef4_init_napi(efx); efx 2869 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->init(efx); efx 2871 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, probe, efx->net_dev, efx 2876 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_init_port(efx); efx 2878 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, probe, efx->net_dev, efx 2883 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_nic_init_interrupt(efx); efx 2886 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_enable_interrupts(efx); efx 2893 drivers/net/ethernet/sfc/falcon/efx.c ef4_nic_fini_interrupt(efx); efx 2895 drivers/net/ethernet/sfc/falcon/efx.c ef4_fini_port(efx); efx 2897 drivers/net/ethernet/sfc/falcon/efx.c efx->type->fini(efx); efx 2899 drivers/net/ethernet/sfc/falcon/efx.c ef4_fini_napi(efx); efx 2900 drivers/net/ethernet/sfc/falcon/efx.c ef4_remove_all(efx); efx 2918 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx; efx 2922 drivers/net/ethernet/sfc/falcon/efx.c net_dev = alloc_etherdev_mqs(sizeof(*efx), EF4_MAX_CORE_TX_QUEUES, efx 2926 drivers/net/ethernet/sfc/falcon/efx.c efx = netdev_priv(net_dev); efx 2927 drivers/net/ethernet/sfc/falcon/efx.c efx->type = (const struct ef4_nic_type *) entry->driver_data; efx 2928 drivers/net/ethernet/sfc/falcon/efx.c efx->fixed_features |= NETIF_F_HIGHDMA; efx 2930 drivers/net/ethernet/sfc/falcon/efx.c pci_set_drvdata(pci_dev, efx); efx 2932 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_init_struct(efx, pci_dev, net_dev); efx 2936 drivers/net/ethernet/sfc/falcon/efx.c netif_info(efx, probe, efx->net_dev, efx 2939 drivers/net/ethernet/sfc/falcon/efx.c ef4_probe_vpd_strings(efx); efx 2942 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_init_io(efx); efx 2946 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_pci_probe_main(efx); efx 2950 drivers/net/ethernet/sfc/falcon/efx.c net_dev->features |= (efx->type->offload_features | NETIF_F_SG | efx 2956 drivers/net/ethernet/sfc/falcon/efx.c net_dev->hw_features = net_dev->features & ~efx->fixed_features; efx 2963 drivers/net/ethernet/sfc/falcon/efx.c net_dev->features |= efx->fixed_features; efx 2965 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_register_netdev(efx); efx 2969 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, probe, efx->net_dev, "initialisation successful\n"); efx 2973 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_mtd_probe(efx); efx 2976 drivers/net/ethernet/sfc/falcon/efx.c netif_warn(efx, probe, efx->net_dev, efx 2981 drivers/net/ethernet/sfc/falcon/efx.c netif_notice(efx, probe, efx->net_dev, efx 2988 drivers/net/ethernet/sfc/falcon/efx.c ef4_pci_remove_main(efx); efx 2990 drivers/net/ethernet/sfc/falcon/efx.c ef4_fini_io(efx); efx 2992 drivers/net/ethernet/sfc/falcon/efx.c ef4_fini_struct(efx); efx 2995 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, drv, efx->net_dev, "initialisation failed. rc=%d\n", rc); efx 3002 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = dev_get_drvdata(dev); efx 3006 drivers/net/ethernet/sfc/falcon/efx.c if (efx->state != STATE_DISABLED) { efx 3007 drivers/net/ethernet/sfc/falcon/efx.c efx->state = STATE_UNINIT; efx 3009 drivers/net/ethernet/sfc/falcon/efx.c ef4_device_detach_sync(efx); efx 3011 drivers/net/ethernet/sfc/falcon/efx.c ef4_stop_all(efx); efx 3012 drivers/net/ethernet/sfc/falcon/efx.c ef4_disable_interrupts(efx); efx 3023 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = dev_get_drvdata(dev); efx 3027 drivers/net/ethernet/sfc/falcon/efx.c if (efx->state != STATE_DISABLED) { efx 3028 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_enable_interrupts(efx); efx 3032 drivers/net/ethernet/sfc/falcon/efx.c mutex_lock(&efx->mac_lock); efx 3033 drivers/net/ethernet/sfc/falcon/efx.c efx->phy_op->reconfigure(efx); efx 3034 drivers/net/ethernet/sfc/falcon/efx.c mutex_unlock(&efx->mac_lock); efx 3036 drivers/net/ethernet/sfc/falcon/efx.c ef4_start_all(efx); efx 3038 drivers/net/ethernet/sfc/falcon/efx.c netif_device_attach(efx->net_dev); efx 3040 drivers/net/ethernet/sfc/falcon/efx.c efx->state = STATE_READY; efx 3042 drivers/net/ethernet/sfc/falcon/efx.c efx->type->resume_wol(efx); efx 3048 drivers/net/ethernet/sfc/falcon/efx.c queue_work(reset_workqueue, &efx->reset_work); efx 3061 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = pci_get_drvdata(pci_dev); efx 3063 drivers/net/ethernet/sfc/falcon/efx.c efx->type->fini(efx); efx 3065 drivers/net/ethernet/sfc/falcon/efx.c efx->reset_pending = 0; efx 3075 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = pci_get_drvdata(pci_dev); efx 3085 drivers/net/ethernet/sfc/falcon/efx.c pci_set_master(efx->pci_dev); efx 3086 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->reset(efx, RESET_TYPE_ALL); efx 3089 drivers/net/ethernet/sfc/falcon/efx.c rc = efx->type->init(efx); efx 3124 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = pci_get_drvdata(pdev); efx 3131 drivers/net/ethernet/sfc/falcon/efx.c if (efx->state != STATE_DISABLED) { efx 3132 drivers/net/ethernet/sfc/falcon/efx.c efx->state = STATE_RECOVERY; efx 3133 drivers/net/ethernet/sfc/falcon/efx.c efx->reset_pending = 0; efx 3135 drivers/net/ethernet/sfc/falcon/efx.c ef4_device_detach_sync(efx); efx 3137 drivers/net/ethernet/sfc/falcon/efx.c ef4_stop_all(efx); efx 3138 drivers/net/ethernet/sfc/falcon/efx.c ef4_disable_interrupts(efx); efx 3158 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = pci_get_drvdata(pdev); efx 3162 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, hw, efx->net_dev, efx 3173 drivers/net/ethernet/sfc/falcon/efx.c struct ef4_nic *efx = pci_get_drvdata(pdev); efx 3178 drivers/net/ethernet/sfc/falcon/efx.c if (efx->state == STATE_DISABLED) efx 3181 drivers/net/ethernet/sfc/falcon/efx.c rc = ef4_reset(efx, RESET_TYPE_ALL); efx 3183 drivers/net/ethernet/sfc/falcon/efx.c netif_err(efx, hw, efx->net_dev, efx 3186 drivers/net/ethernet/sfc/falcon/efx.c efx->state = STATE_READY; efx 3187 drivers/net/ethernet/sfc/falcon/efx.c netif_dbg(efx, hw, efx->net_dev, efx 34 drivers/net/ethernet/sfc/falcon/efx.h unsigned int ef4_tx_max_skb_descs(struct ef4_nic *efx); efx 38 drivers/net/ethernet/sfc/falcon/efx.h void ef4_set_default_rx_indir_table(struct ef4_nic *efx); efx 39 drivers/net/ethernet/sfc/falcon/efx.h void ef4_rx_config_page_split(struct ef4_nic *efx); efx 71 drivers/net/ethernet/sfc/falcon/efx.h #define EF4_TXQ_MIN_ENT(efx) (2 * ef4_tx_max_skb_descs(efx)) efx 73 drivers/net/ethernet/sfc/falcon/efx.h static inline bool ef4_rss_enabled(struct ef4_nic *efx) efx 75 drivers/net/ethernet/sfc/falcon/efx.h return efx->rss_spread > 1; efx 80 drivers/net/ethernet/sfc/falcon/efx.h void ef4_mac_reconfigure(struct ef4_nic *efx); efx 107 drivers/net/ethernet/sfc/falcon/efx.h static inline s32 ef4_filter_insert_filter(struct ef4_nic *efx, efx 111 drivers/net/ethernet/sfc/falcon/efx.h return efx->type->filter_insert(efx, spec, replace_equal); efx 123 drivers/net/ethernet/sfc/falcon/efx.h static inline int ef4_filter_remove_id_safe(struct ef4_nic *efx, efx 127 drivers/net/ethernet/sfc/falcon/efx.h return efx->type->filter_remove_safe(efx, priority, filter_id); efx 141 drivers/net/ethernet/sfc/falcon/efx.h ef4_filter_get_filter_safe(struct ef4_nic *efx, efx 145 drivers/net/ethernet/sfc/falcon/efx.h return efx->type->filter_get_safe(efx, priority, filter_id, spec); efx 148 drivers/net/ethernet/sfc/falcon/efx.h static inline u32 ef4_filter_count_rx_used(struct ef4_nic *efx, efx 151 drivers/net/ethernet/sfc/falcon/efx.h return efx->type->filter_count_rx_used(efx, priority); efx 153 drivers/net/ethernet/sfc/falcon/efx.h static inline u32 ef4_filter_get_rx_id_limit(struct ef4_nic *efx) efx 155 drivers/net/ethernet/sfc/falcon/efx.h return efx->type->filter_get_rx_id_limit(efx); efx 157 drivers/net/ethernet/sfc/falcon/efx.h static inline s32 ef4_filter_get_rx_ids(struct ef4_nic *efx, efx 161 drivers/net/ethernet/sfc/falcon/efx.h return efx->type->filter_get_rx_ids(efx, priority, buf, size); efx 166 drivers/net/ethernet/sfc/falcon/efx.h bool __ef4_filter_rfs_expire(struct ef4_nic *efx, unsigned quota); efx 170 drivers/net/ethernet/sfc/falcon/efx.h __ef4_filter_rfs_expire(channel->efx, 100)) efx 183 drivers/net/ethernet/sfc/falcon/efx.h int ef4_realloc_channels(struct ef4_nic *efx, u32 rxq_entries, u32 txq_entries); efx 186 drivers/net/ethernet/sfc/falcon/efx.h int ef4_reconfigure_port(struct ef4_nic *efx); efx 187 drivers/net/ethernet/sfc/falcon/efx.h int __ef4_reconfigure_port(struct ef4_nic *efx); efx 193 drivers/net/ethernet/sfc/falcon/efx.h int ef4_reset(struct ef4_nic *efx, enum reset_type method); efx 194 drivers/net/ethernet/sfc/falcon/efx.h void ef4_reset_down(struct ef4_nic *efx, enum reset_type method); efx 195 drivers/net/ethernet/sfc/falcon/efx.h int ef4_reset_up(struct ef4_nic *efx, enum reset_type method, bool ok); efx 196 drivers/net/ethernet/sfc/falcon/efx.h int ef4_try_recovery(struct ef4_nic *efx); efx 199 drivers/net/ethernet/sfc/falcon/efx.h void ef4_schedule_reset(struct ef4_nic *efx, enum reset_type type); efx 200 drivers/net/ethernet/sfc/falcon/efx.h unsigned int ef4_usecs_to_ticks(struct ef4_nic *efx, unsigned int usecs); efx 201 drivers/net/ethernet/sfc/falcon/efx.h unsigned int ef4_ticks_to_usecs(struct ef4_nic *efx, unsigned int ticks); efx 202 drivers/net/ethernet/sfc/falcon/efx.h int ef4_init_irq_moderation(struct ef4_nic *efx, unsigned int tx_usecs, efx 205 drivers/net/ethernet/sfc/falcon/efx.h void ef4_get_irq_moderation(struct ef4_nic *efx, unsigned int *tx_usecs, efx 211 drivers/net/ethernet/sfc/falcon/efx.h int ef4_port_dummy_op_int(struct ef4_nic *efx); efx 212 drivers/net/ethernet/sfc/falcon/efx.h void ef4_port_dummy_op_void(struct ef4_nic *efx); efx 215 drivers/net/ethernet/sfc/falcon/efx.h void ef4_update_sw_stats(struct ef4_nic *efx, u64 *stats); efx 219 drivers/net/ethernet/sfc/falcon/efx.h int ef4_mtd_add(struct ef4_nic *efx, struct ef4_mtd_partition *parts, efx 221 drivers/net/ethernet/sfc/falcon/efx.h static inline int ef4_mtd_probe(struct ef4_nic *efx) efx 223 drivers/net/ethernet/sfc/falcon/efx.h return efx->type->mtd_probe(efx); efx 225 drivers/net/ethernet/sfc/falcon/efx.h void ef4_mtd_rename(struct ef4_nic *efx); efx 226 drivers/net/ethernet/sfc/falcon/efx.h void ef4_mtd_remove(struct ef4_nic *efx); efx 228 drivers/net/ethernet/sfc/falcon/efx.h static inline int ef4_mtd_probe(struct ef4_nic *efx) { return 0; } efx 229 drivers/net/ethernet/sfc/falcon/efx.h static inline void ef4_mtd_rename(struct ef4_nic *efx) {} efx 230 drivers/net/ethernet/sfc/falcon/efx.h static inline void ef4_mtd_remove(struct ef4_nic *efx) {} efx 235 drivers/net/ethernet/sfc/falcon/efx.h netif_vdbg(channel->efx, intr, channel->efx->net_dev, efx 248 drivers/net/ethernet/sfc/falcon/efx.h void ef4_link_status_changed(struct ef4_nic *efx); efx 249 drivers/net/ethernet/sfc/falcon/efx.h void ef4_link_set_advertising(struct ef4_nic *efx, u32); efx 250 drivers/net/ethernet/sfc/falcon/efx.h void ef4_link_set_wanted_fc(struct ef4_nic *efx, u8); efx 252 drivers/net/ethernet/sfc/falcon/efx.h static inline void ef4_device_detach_sync(struct ef4_nic *efx) efx 254 drivers/net/ethernet/sfc/falcon/efx.h struct net_device *dev = efx->net_dev; efx 93 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 110 drivers/net/ethernet/sfc/falcon/ethtool.c efx->type->set_id_led(efx, mode); efx 119 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 120 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_link_state *link_state = &efx->link_state; efx 122 drivers/net/ethernet/sfc/falcon/ethtool.c mutex_lock(&efx->mac_lock); efx 123 drivers/net/ethernet/sfc/falcon/ethtool.c efx->phy_op->get_link_ksettings(efx, cmd); efx 124 drivers/net/ethernet/sfc/falcon/ethtool.c mutex_unlock(&efx->mac_lock); efx 130 drivers/net/ethernet/sfc/falcon/ethtool.c if (LOOPBACK_INTERNAL(efx)) { efx 143 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 149 drivers/net/ethernet/sfc/falcon/ethtool.c netif_dbg(efx, drv, efx->net_dev, efx 154 drivers/net/ethernet/sfc/falcon/ethtool.c mutex_lock(&efx->mac_lock); efx 155 drivers/net/ethernet/sfc/falcon/ethtool.c rc = efx->phy_op->set_link_ksettings(efx, cmd); efx 156 drivers/net/ethernet/sfc/falcon/ethtool.c mutex_unlock(&efx->mac_lock); efx 163 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 167 drivers/net/ethernet/sfc/falcon/ethtool.c strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info)); efx 178 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 180 drivers/net/ethernet/sfc/falcon/ethtool.c regs->version = efx->type->revision; efx 181 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_nic_get_regs(efx, buf); efx 186 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 187 drivers/net/ethernet/sfc/falcon/ethtool.c return efx->msg_enable; efx 192 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 193 drivers/net/ethernet/sfc/falcon/ethtool.c efx->msg_enable = msg_enable; efx 251 drivers/net/ethernet/sfc/falcon/ethtool.c static int ef4_fill_loopback_test(struct ef4_nic *efx, efx 258 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_get_channel(efx, efx->tx_channel_offset); efx 296 drivers/net/ethernet/sfc/falcon/ethtool.c static int ef4_ethtool_fill_self_tests(struct ef4_nic *efx, efx 312 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_for_each_channel(channel, efx) { efx 328 drivers/net/ethernet/sfc/falcon/ethtool.c if (efx->phy_op->run_tests != NULL) { efx 329 drivers/net/ethernet/sfc/falcon/ethtool.c EF4_BUG_ON_PARANOID(efx->phy_op->test_name == NULL); efx 335 drivers/net/ethernet/sfc/falcon/ethtool.c name = efx->phy_op->test_name(efx, i); efx 346 drivers/net/ethernet/sfc/falcon/ethtool.c if (!(efx->loopback_modes & (1 << mode))) efx 348 drivers/net/ethernet/sfc/falcon/ethtool.c n = ef4_fill_loopback_test(efx, efx 356 drivers/net/ethernet/sfc/falcon/ethtool.c static size_t ef4_describe_per_queue_stats(struct ef4_nic *efx, u8 *strings) efx 361 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_for_each_channel(channel, efx) { efx 374 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_for_each_channel(channel, efx) { efx 390 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 394 drivers/net/ethernet/sfc/falcon/ethtool.c return efx->type->describe_stats(efx, NULL) + efx 396 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_describe_per_queue_stats(efx, NULL); efx 398 drivers/net/ethernet/sfc/falcon/ethtool.c return ef4_ethtool_fill_self_tests(efx, NULL, NULL, NULL); efx 407 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 412 drivers/net/ethernet/sfc/falcon/ethtool.c strings += (efx->type->describe_stats(efx, strings) * efx 418 drivers/net/ethernet/sfc/falcon/ethtool.c strings += (ef4_describe_per_queue_stats(efx, strings) * efx 422 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_ethtool_fill_self_tests(efx, NULL, strings, NULL); efx 434 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 441 drivers/net/ethernet/sfc/falcon/ethtool.c spin_lock_bh(&efx->stats_lock); efx 444 drivers/net/ethernet/sfc/falcon/ethtool.c data += efx->type->update_stats(efx, data, NULL); efx 451 drivers/net/ethernet/sfc/falcon/ethtool.c data[i] = stat->get_stat((void *)efx + stat->offset); efx 455 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_for_each_channel(channel, efx) efx 461 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_for_each_channel(channel, efx) { efx 472 drivers/net/ethernet/sfc/falcon/ethtool.c spin_unlock_bh(&efx->stats_lock); efx 474 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_for_each_channel(channel, efx) { efx 483 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_for_each_channel(channel, efx) { efx 497 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 506 drivers/net/ethernet/sfc/falcon/ethtool.c if (efx->state != STATE_READY) { efx 511 drivers/net/ethernet/sfc/falcon/ethtool.c netif_info(efx, drv, efx->net_dev, "starting %sline testing\n", efx 515 drivers/net/ethernet/sfc/falcon/ethtool.c already_up = (efx->net_dev->flags & IFF_UP); efx 517 drivers/net/ethernet/sfc/falcon/ethtool.c rc = dev_open(efx->net_dev, NULL); efx 519 drivers/net/ethernet/sfc/falcon/ethtool.c netif_err(efx, drv, efx->net_dev, efx 525 drivers/net/ethernet/sfc/falcon/ethtool.c rc = ef4_selftest(efx, ef4_tests, test->flags); efx 528 drivers/net/ethernet/sfc/falcon/ethtool.c dev_close(efx->net_dev); efx 530 drivers/net/ethernet/sfc/falcon/ethtool.c netif_info(efx, drv, efx->net_dev, "%s %sline self-tests\n", efx 535 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_ethtool_fill_self_tests(efx, ef4_tests, NULL, data); efx 545 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 547 drivers/net/ethernet/sfc/falcon/ethtool.c return mdio45_nway_restart(&efx->mdio); efx 582 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 586 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &rx_adaptive); efx 600 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 609 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &adaptive); efx 628 drivers/net/ethernet/sfc/falcon/ethtool.c rc = ef4_init_irq_moderation(efx, tx_usecs, rx_usecs, adaptive, efx 633 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_for_each_channel(channel, efx) efx 634 drivers/net/ethernet/sfc/falcon/ethtool.c efx->type->push_irq_moderation(channel); efx 642 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 646 drivers/net/ethernet/sfc/falcon/ethtool.c ring->rx_pending = efx->rxq_entries; efx 647 drivers/net/ethernet/sfc/falcon/ethtool.c ring->tx_pending = efx->txq_entries; efx 653 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 662 drivers/net/ethernet/sfc/falcon/ethtool.c netif_err(efx, drv, efx->net_dev, efx 668 drivers/net/ethernet/sfc/falcon/ethtool.c txq_entries = max(ring->tx_pending, EF4_TXQ_MIN_ENT(efx)); efx 670 drivers/net/ethernet/sfc/falcon/ethtool.c netif_warn(efx, drv, efx->net_dev, efx 674 drivers/net/ethernet/sfc/falcon/ethtool.c return ef4_realloc_channels(efx, ring->rx_pending, txq_entries); efx 680 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 685 drivers/net/ethernet/sfc/falcon/ethtool.c mutex_lock(&efx->mac_lock); efx 692 drivers/net/ethernet/sfc/falcon/ethtool.c netif_dbg(efx, drv, efx->net_dev, efx 698 drivers/net/ethernet/sfc/falcon/ethtool.c if ((wanted_fc & EF4_FC_AUTO) && !efx->link_advertising) { efx 699 drivers/net/ethernet/sfc/falcon/ethtool.c netif_dbg(efx, drv, efx->net_dev, efx 706 drivers/net/ethernet/sfc/falcon/ethtool.c if (efx->type->prepare_enable_fc_tx && efx 707 drivers/net/ethernet/sfc/falcon/ethtool.c (wanted_fc & EF4_FC_TX) && !(efx->wanted_fc & EF4_FC_TX)) efx 708 drivers/net/ethernet/sfc/falcon/ethtool.c efx->type->prepare_enable_fc_tx(efx); efx 710 drivers/net/ethernet/sfc/falcon/ethtool.c old_adv = efx->link_advertising; efx 711 drivers/net/ethernet/sfc/falcon/ethtool.c old_fc = efx->wanted_fc; efx 712 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_link_set_wanted_fc(efx, wanted_fc); efx 713 drivers/net/ethernet/sfc/falcon/ethtool.c if (efx->link_advertising != old_adv || efx 714 drivers/net/ethernet/sfc/falcon/ethtool.c (efx->wanted_fc ^ old_fc) & EF4_FC_AUTO) { efx 715 drivers/net/ethernet/sfc/falcon/ethtool.c rc = efx->phy_op->reconfigure(efx); efx 717 drivers/net/ethernet/sfc/falcon/ethtool.c netif_err(efx, drv, efx->net_dev, efx 727 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_mac_reconfigure(efx); efx 730 drivers/net/ethernet/sfc/falcon/ethtool.c mutex_unlock(&efx->mac_lock); efx 738 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 740 drivers/net/ethernet/sfc/falcon/ethtool.c pause->rx_pause = !!(efx->wanted_fc & EF4_FC_RX); efx 741 drivers/net/ethernet/sfc/falcon/ethtool.c pause->tx_pause = !!(efx->wanted_fc & EF4_FC_TX); efx 742 drivers/net/ethernet/sfc/falcon/ethtool.c pause->autoneg = !!(efx->wanted_fc & EF4_FC_AUTO); efx 748 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 749 drivers/net/ethernet/sfc/falcon/ethtool.c return efx->type->get_wol(efx, wol); efx 756 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 757 drivers/net/ethernet/sfc/falcon/ethtool.c return efx->type->set_wol(efx, wol->wolopts); efx 762 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 765 drivers/net/ethernet/sfc/falcon/ethtool.c rc = efx->type->map_reset_flags(flags); efx 769 drivers/net/ethernet/sfc/falcon/ethtool.c return ef4_reset(efx, rc); efx 785 drivers/net/ethernet/sfc/falcon/ethtool.c static int ef4_ethtool_get_class_rule(struct ef4_nic *efx, efx 801 drivers/net/ethernet/sfc/falcon/ethtool.c rc = ef4_filter_get_filter_safe(efx, EF4_FILTER_PRI_MANUAL, efx 949 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 953 drivers/net/ethernet/sfc/falcon/ethtool.c info->data = efx->n_rx_channels; efx 974 drivers/net/ethernet/sfc/falcon/ethtool.c if (ef4_nic_rev(efx) < min_revision) efx 980 drivers/net/ethernet/sfc/falcon/ethtool.c info->data = ef4_filter_get_rx_id_limit(efx); efx 985 drivers/net/ethernet/sfc/falcon/ethtool.c ef4_filter_count_rx_used(efx, EF4_FILTER_PRI_MANUAL); efx 989 drivers/net/ethernet/sfc/falcon/ethtool.c if (ef4_filter_get_rx_id_limit(efx) == 0) efx 991 drivers/net/ethernet/sfc/falcon/ethtool.c return ef4_ethtool_get_class_rule(efx, &info->fs); efx 995 drivers/net/ethernet/sfc/falcon/ethtool.c info->data = ef4_filter_get_rx_id_limit(efx); efx 998 drivers/net/ethernet/sfc/falcon/ethtool.c rc = ef4_filter_get_rx_ids(efx, EF4_FILTER_PRI_MANUAL, efx 1021 drivers/net/ethernet/sfc/falcon/ethtool.c static int ef4_ethtool_set_class_rule(struct ef4_nic *efx, efx 1042 drivers/net/ethernet/sfc/falcon/ethtool.c if (rule->ring_cookie >= efx->n_rx_channels && efx 1053 drivers/net/ethernet/sfc/falcon/ethtool.c efx->rx_scatter ? EF4_FILTER_FLAG_RX_SCATTER : 0, efx 1215 drivers/net/ethernet/sfc/falcon/ethtool.c rc = ef4_filter_insert_filter(efx, &spec, true); efx 1226 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 1228 drivers/net/ethernet/sfc/falcon/ethtool.c if (ef4_filter_get_rx_id_limit(efx) == 0) efx 1233 drivers/net/ethernet/sfc/falcon/ethtool.c return ef4_ethtool_set_class_rule(efx, &info->fs); efx 1236 drivers/net/ethernet/sfc/falcon/ethtool.c return ef4_filter_remove_id_safe(efx, EF4_FILTER_PRI_MANUAL, efx 1246 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 1248 drivers/net/ethernet/sfc/falcon/ethtool.c return ((ef4_nic_rev(efx) < EF4_REV_FALCON_B0 || efx 1249 drivers/net/ethernet/sfc/falcon/ethtool.c efx->n_rx_channels == 1) ? efx 1250 drivers/net/ethernet/sfc/falcon/ethtool.c 0 : ARRAY_SIZE(efx->rx_indir_table)); efx 1256 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 1261 drivers/net/ethernet/sfc/falcon/ethtool.c memcpy(indir, efx->rx_indir_table, sizeof(efx->rx_indir_table)); efx 1268 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 1277 drivers/net/ethernet/sfc/falcon/ethtool.c return efx->type->rx_push_rss_config(efx, true, indir); efx 1284 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 1287 drivers/net/ethernet/sfc/falcon/ethtool.c if (!efx->phy_op || !efx->phy_op->get_module_eeprom) efx 1290 drivers/net/ethernet/sfc/falcon/ethtool.c mutex_lock(&efx->mac_lock); efx 1291 drivers/net/ethernet/sfc/falcon/ethtool.c ret = efx->phy_op->get_module_eeprom(efx, ee, data); efx 1292 drivers/net/ethernet/sfc/falcon/ethtool.c mutex_unlock(&efx->mac_lock); efx 1300 drivers/net/ethernet/sfc/falcon/ethtool.c struct ef4_nic *efx = netdev_priv(net_dev); efx 1303 drivers/net/ethernet/sfc/falcon/ethtool.c if (!efx->phy_op || !efx->phy_op->get_module_info) efx 1306 drivers/net/ethernet/sfc/falcon/ethtool.c mutex_lock(&efx->mac_lock); efx 1307 drivers/net/ethernet/sfc/falcon/ethtool.c ret = efx->phy_op->get_module_info(efx, modinfo); efx 1308 drivers/net/ethernet/sfc/falcon/ethtool.c mutex_unlock(&efx->mac_lock); efx 133 drivers/net/ethernet/sfc/falcon/falcon.c #define FALCON_XMAC_STATS_DMA_FLAG(efx) \ efx 134 drivers/net/ethernet/sfc/falcon/falcon.c (*(u32 *)((efx)->stats_buffer.addr + XgDmaDone_offset)) efx 301 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_reset_hw(struct ef4_nic *efx, enum reset_type method); efx 302 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_reconfigure_mac_wrapper(struct ef4_nic *efx); efx 328 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = (struct ef4_nic *)data; efx 331 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_GPIO_CTL); efx 333 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_GPIO_CTL); efx 338 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = (struct ef4_nic *)data; efx 341 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_GPIO_CTL); efx 343 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_GPIO_CTL); efx 348 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = (struct ef4_nic *)data; efx 351 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_GPIO_CTL); efx 357 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = (struct ef4_nic *)data; efx 360 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_GPIO_CTL); efx 377 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = channel->efx; efx 383 drivers/net/ethernet/sfc/falcon/falcon.c ticks = ef4_usecs_to_ticks(efx, channel->irq_moderation_us); efx 396 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writed_page_locked(efx, &timer_cmd, FR_BZ_TIMER_COMMAND_P0, efx 400 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_deconfigure_mac_wrapper(struct ef4_nic *efx); efx 402 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_prepare_flush(struct ef4_nic *efx) efx 404 drivers/net/ethernet/sfc/falcon/falcon.c falcon_deconfigure_mac_wrapper(efx); efx 422 drivers/net/ethernet/sfc/falcon/falcon.c static inline void falcon_irq_ack_a1(struct ef4_nic *efx) efx 427 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writed(efx, ®, FR_AA_INT_ACK_KER); efx 428 drivers/net/ethernet/sfc/falcon/falcon.c ef4_readd(efx, ®, FR_AA_WORK_AROUND_BROKEN_PCI_READS); efx 433 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = dev_id; efx 434 drivers/net/ethernet/sfc/falcon/falcon.c ef4_oword_t *int_ker = efx->irq_status.addr; efx 442 drivers/net/ethernet/sfc/falcon/falcon.c netif_vdbg(efx, intr, efx->net_dev, efx 447 drivers/net/ethernet/sfc/falcon/falcon.c efx->last_irq_cpu = raw_smp_processor_id(); efx 448 drivers/net/ethernet/sfc/falcon/falcon.c netif_vdbg(efx, intr, efx->net_dev, efx 452 drivers/net/ethernet/sfc/falcon/falcon.c if (!likely(READ_ONCE(efx->irq_soft_enabled))) efx 458 drivers/net/ethernet/sfc/falcon/falcon.c return ef4_farch_fatal_interrupt(efx); efx 467 drivers/net/ethernet/sfc/falcon/falcon.c falcon_irq_ack_a1(efx); efx 470 drivers/net/ethernet/sfc/falcon/falcon.c ef4_schedule_channel_irq(ef4_get_channel(efx, 0)); efx 472 drivers/net/ethernet/sfc/falcon/falcon.c ef4_schedule_channel_irq(ef4_get_channel(efx, 1)); efx 482 drivers/net/ethernet/sfc/falcon/falcon.c static int dummy_rx_push_rss_config(struct ef4_nic *efx, bool user, efx 485 drivers/net/ethernet/sfc/falcon/falcon.c (void) efx; efx 491 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_b0_rx_push_rss_config(struct ef4_nic *efx, bool user, efx 498 drivers/net/ethernet/sfc/falcon/falcon.c memcpy(&temp, efx->rx_hash_key, sizeof(temp)); efx 499 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &temp, FR_BZ_RX_RSS_TKEY); efx 501 drivers/net/ethernet/sfc/falcon/falcon.c memcpy(efx->rx_indir_table, rx_indir_table, efx 502 drivers/net/ethernet/sfc/falcon/falcon.c sizeof(efx->rx_indir_table)); efx 503 drivers/net/ethernet/sfc/falcon/falcon.c ef4_farch_rx_push_indir_table(efx); efx 516 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_spi_poll(struct ef4_nic *efx) efx 519 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_EE_SPI_HCMD); efx 524 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_spi_wait(struct ef4_nic *efx) efx 534 drivers/net/ethernet/sfc/falcon/falcon.c if (!falcon_spi_poll(efx)) efx 540 drivers/net/ethernet/sfc/falcon/falcon.c if (!falcon_spi_poll(efx)) efx 543 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, efx 552 drivers/net/ethernet/sfc/falcon/falcon.c falcon_spi_cmd(struct ef4_nic *efx, const struct falcon_spi_device *spi, efx 566 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_poll(efx); efx 573 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_EE_SPI_HADR); efx 579 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_EE_SPI_HDATA); efx 592 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_EE_SPI_HCMD); efx 595 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_wait(efx); efx 601 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_EE_SPI_HDATA); efx 616 drivers/net/ethernet/sfc/falcon/falcon.c falcon_spi_read(struct ef4_nic *efx, const struct falcon_spi_device *spi, efx 627 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, command, start + pos, NULL, efx 666 drivers/net/ethernet/sfc/falcon/falcon.c falcon_spi_wait_write(struct ef4_nic *efx, const struct falcon_spi_device *spi) efx 673 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, SPI_RDSR, -1, NULL, efx 680 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, efx 691 drivers/net/ethernet/sfc/falcon/falcon.c falcon_spi_write(struct ef4_nic *efx, const struct falcon_spi_device *spi, efx 700 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, SPI_WREN, -1, NULL, NULL, 0); efx 707 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, command, start + pos, efx 712 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_wait_write(efx, spi); efx 717 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, command, start + pos, efx 743 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = part->common.mtd.priv; efx 752 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, SPI_RDSR, -1, NULL, efx 767 drivers/net/ethernet/sfc/falcon/falcon.c falcon_spi_unlock(struct ef4_nic *efx, const struct falcon_spi_device *spi) efx 774 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, SPI_RDSR, -1, NULL, efx 782 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, SPI_WREN, -1, NULL, NULL, 0); efx 785 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, SPI_SST_EWSR, -1, NULL, NULL, 0); efx 790 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, SPI_WRSR, -1, &status, efx 794 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_wait_write(efx, spi); efx 807 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = part->common.mtd.priv; efx 819 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_unlock(efx, spi); efx 822 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, SPI_WREN, -1, NULL, NULL, 0); efx 825 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_cmd(efx, spi, spi->erase_command, start, NULL, efx 835 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_read(efx, spi, start + pos, block_len, efx 853 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = part->mtd.priv; efx 856 drivers/net/ethernet/sfc/falcon/falcon.c efx->name, part->type_name); efx 863 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = mtd->priv; efx 864 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 870 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_read(efx, part->spi, part->offset + start, efx 879 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = mtd->priv; efx 880 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 895 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = mtd->priv; efx 896 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 902 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_write(efx, part->spi, part->offset + start, efx 911 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = mtd->priv; efx 912 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 921 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_mtd_probe(struct ef4_nic *efx) efx 923 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 965 drivers/net/ethernet/sfc/falcon/falcon.c rc = ef4_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts)); efx 981 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_setup_xaui(struct ef4_nic *efx) efx 987 drivers/net/ethernet/sfc/falcon/falcon.c if (efx->phy_type == PHY_TYPE_NONE) efx 990 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &sdctl, FR_AB_XX_SD_CTL); efx 999 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &sdctl, FR_AB_XX_SD_CTL); efx 1010 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &txdrv, FR_AB_XX_TXDRV_CTL); efx 1013 drivers/net/ethernet/sfc/falcon/falcon.c int falcon_reset_xaui(struct ef4_nic *efx) efx 1015 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1024 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XX_PWR_RST); efx 1028 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_XX_PWR_RST); efx 1031 drivers/net/ethernet/sfc/falcon/falcon.c falcon_setup_xaui(efx); efx 1036 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, efx 1041 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_ack_status_intr(struct ef4_nic *efx) efx 1043 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1046 drivers/net/ethernet/sfc/falcon/falcon.c if ((ef4_nic_rev(efx) != EF4_REV_FALCON_B0) || LOOPBACK_INTERNAL(efx)) efx 1050 drivers/net/ethernet/sfc/falcon/falcon.c if (!efx->link_state.up) efx 1058 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_XM_MGT_INT_MSK); efx 1061 drivers/net/ethernet/sfc/falcon/falcon.c static bool falcon_xgxs_link_ok(struct ef4_nic *efx) efx 1068 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_XX_CORE_STAT); efx 1079 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XX_CORE_STAT); efx 1084 drivers/net/ethernet/sfc/falcon/falcon.c static bool falcon_xmac_link_ok(struct ef4_nic *efx) efx 1092 drivers/net/ethernet/sfc/falcon/falcon.c return (efx->loopback_mode == LOOPBACK_XGMII || efx 1093 drivers/net/ethernet/sfc/falcon/falcon.c falcon_xgxs_link_ok(efx)) && efx 1094 drivers/net/ethernet/sfc/falcon/falcon.c (!(efx->mdio.mmds & (1 << MDIO_MMD_PHYXS)) || efx 1095 drivers/net/ethernet/sfc/falcon/falcon.c LOOPBACK_INTERNAL(efx) || efx 1096 drivers/net/ethernet/sfc/falcon/falcon.c ef4_mdio_phyxgxs_lane_sync(efx)); efx 1099 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_reconfigure_xmac_core(struct ef4_nic *efx) efx 1103 drivers/net/ethernet/sfc/falcon/falcon.c bool rx_fc = !!(efx->link_state.fc & EF4_FC_RX); efx 1104 drivers/net/ethernet/sfc/falcon/falcon.c bool tx_fc = !!(efx->link_state.fc & EF4_FC_TX); efx 1111 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XM_GLB_CFG); efx 1121 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XM_TX_CFG); efx 1128 drivers/net/ethernet/sfc/falcon/falcon.c FRF_AB_XM_ACPT_ALL_UCAST, !efx->unicast_filter, efx 1130 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XM_RX_CFG); efx 1133 drivers/net/ethernet/sfc/falcon/falcon.c max_frame_len = EF4_MAX_FRAME_LEN(efx->net_dev->mtu); efx 1135 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XM_RX_PARAM); efx 1139 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XM_TX_PARAM); efx 1144 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XM_FC); efx 1147 drivers/net/ethernet/sfc/falcon/falcon.c memcpy(®, &efx->net_dev->dev_addr[0], 4); efx 1148 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XM_ADR_LO); efx 1149 drivers/net/ethernet/sfc/falcon/falcon.c memcpy(®, &efx->net_dev->dev_addr[4], 2); efx 1150 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XM_ADR_HI); efx 1153 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_reconfigure_xgxs_core(struct ef4_nic *efx) efx 1156 drivers/net/ethernet/sfc/falcon/falcon.c bool xgxs_loopback = (efx->loopback_mode == LOOPBACK_XGXS); efx 1157 drivers/net/ethernet/sfc/falcon/falcon.c bool xaui_loopback = (efx->loopback_mode == LOOPBACK_XAUI); efx 1158 drivers/net/ethernet/sfc/falcon/falcon.c bool xgmii_loopback = (efx->loopback_mode == LOOPBACK_XGMII); efx 1163 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_XX_CORE_STAT); efx 1167 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_XX_SD_CTL); efx 1174 drivers/net/ethernet/sfc/falcon/falcon.c falcon_reset_xaui(efx); efx 1176 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_XX_CORE_STAT); efx 1182 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XX_CORE_STAT); efx 1184 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_XX_SD_CTL); efx 1189 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XX_SD_CTL); efx 1194 drivers/net/ethernet/sfc/falcon/falcon.c static bool falcon_xmac_link_ok_retry(struct ef4_nic *efx, int tries) efx 1196 drivers/net/ethernet/sfc/falcon/falcon.c bool mac_up = falcon_xmac_link_ok(efx); efx 1198 drivers/net/ethernet/sfc/falcon/falcon.c if (LOOPBACK_MASK(efx) & LOOPBACKS_EXTERNAL(efx) & LOOPBACKS_WS || efx 1199 drivers/net/ethernet/sfc/falcon/falcon.c ef4_phy_mode_disabled(efx->phy_mode)) efx 1203 drivers/net/ethernet/sfc/falcon/falcon.c falcon_stop_nic_stats(efx); efx 1206 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, hw, efx->net_dev, "bashing xaui\n"); efx 1207 drivers/net/ethernet/sfc/falcon/falcon.c falcon_reset_xaui(efx); efx 1210 drivers/net/ethernet/sfc/falcon/falcon.c mac_up = falcon_xmac_link_ok(efx); efx 1214 drivers/net/ethernet/sfc/falcon/falcon.c falcon_start_nic_stats(efx); efx 1219 drivers/net/ethernet/sfc/falcon/falcon.c static bool falcon_xmac_check_fault(struct ef4_nic *efx) efx 1221 drivers/net/ethernet/sfc/falcon/falcon.c return !falcon_xmac_link_ok_retry(efx, 5); efx 1224 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_reconfigure_xmac(struct ef4_nic *efx) efx 1226 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1228 drivers/net/ethernet/sfc/falcon/falcon.c ef4_farch_filter_sync_rx_mode(efx); efx 1230 drivers/net/ethernet/sfc/falcon/falcon.c falcon_reconfigure_xgxs_core(efx); efx 1231 drivers/net/ethernet/sfc/falcon/falcon.c falcon_reconfigure_xmac_core(efx); efx 1233 drivers/net/ethernet/sfc/falcon/falcon.c falcon_reconfigure_mac_wrapper(efx); efx 1235 drivers/net/ethernet/sfc/falcon/falcon.c nic_data->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 5); efx 1236 drivers/net/ethernet/sfc/falcon/falcon.c falcon_ack_status_intr(efx); efx 1241 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_poll_xmac(struct ef4_nic *efx) efx 1243 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1246 drivers/net/ethernet/sfc/falcon/falcon.c if (!efx->link_state.up || !nic_data->xmac_poll_required) efx 1249 drivers/net/ethernet/sfc/falcon/falcon.c nic_data->xmac_poll_required = !falcon_xmac_link_ok_retry(efx, 1); efx 1250 drivers/net/ethernet/sfc/falcon/falcon.c falcon_ack_status_intr(efx); efx 1260 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_push_multicast_hash(struct ef4_nic *efx) efx 1262 drivers/net/ethernet/sfc/falcon/falcon.c union ef4_multicast_hash *mc_hash = &efx->multicast_hash; efx 1264 drivers/net/ethernet/sfc/falcon/falcon.c WARN_ON(!mutex_is_locked(&efx->mac_lock)); efx 1266 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &mc_hash->oword[0], FR_AB_MAC_MC_HASH_REG0); efx 1267 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &mc_hash->oword[1], FR_AB_MAC_MC_HASH_REG1); efx 1270 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_reset_macs(struct ef4_nic *efx) efx 1272 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1276 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_nic_rev(efx) < EF4_REV_FALCON_B0) { efx 1281 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_XM_GLB_CFG); efx 1284 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_XM_GLB_CFG); efx 1291 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, efx 1298 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &mac_ctrl, FR_AB_MAC_CTRL); efx 1300 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &mac_ctrl, FR_AB_MAC_CTRL); efx 1302 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_GLB_CTL); efx 1306 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_GLB_CTL); efx 1310 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_GLB_CTL); efx 1314 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, hw, efx->net_dev, efx 1320 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, "MAC reset failed\n"); efx 1329 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &mac_ctrl, FR_AB_MAC_CTRL); efx 1331 drivers/net/ethernet/sfc/falcon/falcon.c falcon_setup_xaui(efx); efx 1334 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_drain_tx_fifo(struct ef4_nic *efx) efx 1338 drivers/net/ethernet/sfc/falcon/falcon.c if ((ef4_nic_rev(efx) < EF4_REV_FALCON_B0) || efx 1339 drivers/net/ethernet/sfc/falcon/falcon.c (efx->loopback_mode != LOOPBACK_NONE)) efx 1342 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_MAC_CTRL); efx 1347 drivers/net/ethernet/sfc/falcon/falcon.c falcon_reset_macs(efx); efx 1350 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_deconfigure_mac_wrapper(struct ef4_nic *efx) efx 1354 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_nic_rev(efx) < EF4_REV_FALCON_B0) efx 1358 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AZ_RX_CFG); efx 1360 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AZ_RX_CFG); efx 1363 drivers/net/ethernet/sfc/falcon/falcon.c falcon_drain_tx_fifo(efx); efx 1366 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_reconfigure_mac_wrapper(struct ef4_nic *efx) efx 1368 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_link_state *link_state = &efx->link_state; efx 1372 drivers/net/ethernet/sfc/falcon/falcon.c isolate = !!READ_ONCE(efx->reset_pending); efx 1388 drivers/net/ethernet/sfc/falcon/falcon.c FRF_AB_MAC_UC_PROM, !efx->unicast_filter, efx 1393 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) { efx 1398 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_MAC_CTRL); efx 1401 drivers/net/ethernet/sfc/falcon/falcon.c falcon_push_multicast_hash(efx); efx 1403 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AZ_RX_CFG); efx 1408 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) efx 1410 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AZ_RX_CFG); efx 1413 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_stats_request(struct ef4_nic *efx) efx 1415 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1421 drivers/net/ethernet/sfc/falcon/falcon.c FALCON_XMAC_STATS_DMA_FLAG(efx) = 0; efx 1429 drivers/net/ethernet/sfc/falcon/falcon.c efx->stats_buffer.dma_addr); efx 1430 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_MAC_STAT_DMA); efx 1435 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_stats_complete(struct ef4_nic *efx) efx 1437 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1443 drivers/net/ethernet/sfc/falcon/falcon.c if (FALCON_XMAC_STATS_DMA_FLAG(efx)) { efx 1447 drivers/net/ethernet/sfc/falcon/falcon.c efx->stats_buffer.addr, true); efx 1449 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, efx 1458 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = nic_data->efx; efx 1460 drivers/net/ethernet/sfc/falcon/falcon.c spin_lock(&efx->stats_lock); efx 1462 drivers/net/ethernet/sfc/falcon/falcon.c falcon_stats_complete(efx); efx 1464 drivers/net/ethernet/sfc/falcon/falcon.c falcon_stats_request(efx); efx 1466 drivers/net/ethernet/sfc/falcon/falcon.c spin_unlock(&efx->stats_lock); efx 1469 drivers/net/ethernet/sfc/falcon/falcon.c static bool falcon_loopback_link_poll(struct ef4_nic *efx) efx 1471 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_link_state old_state = efx->link_state; efx 1473 drivers/net/ethernet/sfc/falcon/falcon.c WARN_ON(!mutex_is_locked(&efx->mac_lock)); efx 1474 drivers/net/ethernet/sfc/falcon/falcon.c WARN_ON(!LOOPBACK_INTERNAL(efx)); efx 1476 drivers/net/ethernet/sfc/falcon/falcon.c efx->link_state.fd = true; efx 1477 drivers/net/ethernet/sfc/falcon/falcon.c efx->link_state.fc = efx->wanted_fc; efx 1478 drivers/net/ethernet/sfc/falcon/falcon.c efx->link_state.up = true; efx 1479 drivers/net/ethernet/sfc/falcon/falcon.c efx->link_state.speed = 10000; efx 1481 drivers/net/ethernet/sfc/falcon/falcon.c return !ef4_link_state_equal(&efx->link_state, &old_state); efx 1484 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_reconfigure_port(struct ef4_nic *efx) efx 1488 drivers/net/ethernet/sfc/falcon/falcon.c WARN_ON(ef4_nic_rev(efx) > EF4_REV_FALCON_B0); efx 1494 drivers/net/ethernet/sfc/falcon/falcon.c if (LOOPBACK_INTERNAL(efx)) efx 1495 drivers/net/ethernet/sfc/falcon/falcon.c falcon_loopback_link_poll(efx); efx 1497 drivers/net/ethernet/sfc/falcon/falcon.c efx->phy_op->poll(efx); efx 1499 drivers/net/ethernet/sfc/falcon/falcon.c falcon_stop_nic_stats(efx); efx 1500 drivers/net/ethernet/sfc/falcon/falcon.c falcon_deconfigure_mac_wrapper(efx); efx 1502 drivers/net/ethernet/sfc/falcon/falcon.c falcon_reset_macs(efx); efx 1504 drivers/net/ethernet/sfc/falcon/falcon.c efx->phy_op->reconfigure(efx); efx 1505 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_reconfigure_xmac(efx); efx 1508 drivers/net/ethernet/sfc/falcon/falcon.c falcon_start_nic_stats(efx); efx 1511 drivers/net/ethernet/sfc/falcon/falcon.c ef4_link_status_changed(efx); efx 1523 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_a1_prepare_enable_fc_tx(struct ef4_nic *efx) efx 1526 drivers/net/ethernet/sfc/falcon/falcon.c ef4_schedule_reset(efx, RESET_TYPE_INVISIBLE); efx 1529 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_b0_prepare_enable_fc_tx(struct ef4_nic *efx) efx 1532 drivers/net/ethernet/sfc/falcon/falcon.c falcon_stop_nic_stats(efx); efx 1533 drivers/net/ethernet/sfc/falcon/falcon.c falcon_drain_tx_fifo(efx); efx 1534 drivers/net/ethernet/sfc/falcon/falcon.c falcon_reconfigure_xmac(efx); efx 1535 drivers/net/ethernet/sfc/falcon/falcon.c falcon_start_nic_stats(efx); efx 1546 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_gmii_wait(struct ef4_nic *efx) efx 1553 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &md_stat, FR_AB_MD_STAT); efx 1557 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, efx 1567 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, "timed out waiting for GMII\n"); efx 1575 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = netdev_priv(net_dev); efx 1576 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1580 drivers/net/ethernet/sfc/falcon/falcon.c netif_vdbg(efx, hw, efx->net_dev, efx 1587 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_gmii_wait(efx); efx 1593 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_MD_PHY_ADR); efx 1597 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_MD_ID); efx 1601 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_MD_TXD); efx 1606 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_MD_CS); efx 1609 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_gmii_wait(efx); efx 1615 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_MD_CS); efx 1628 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = netdev_priv(net_dev); efx 1629 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1636 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_gmii_wait(efx); efx 1641 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_MD_PHY_ADR); efx 1645 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_MD_ID); efx 1649 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_MD_CS); efx 1652 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_gmii_wait(efx); efx 1654 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AB_MD_RXD); efx 1656 drivers/net/ethernet/sfc/falcon/falcon.c netif_vdbg(efx, hw, efx->net_dev, efx 1664 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AB_MD_CS); efx 1666 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, hw, efx->net_dev, efx 1677 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_probe_port(struct ef4_nic *efx) efx 1679 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1682 drivers/net/ethernet/sfc/falcon/falcon.c switch (efx->phy_type) { efx 1684 drivers/net/ethernet/sfc/falcon/falcon.c efx->phy_op = &falcon_sfx7101_phy_ops; efx 1688 drivers/net/ethernet/sfc/falcon/falcon.c efx->phy_op = &falcon_qt202x_phy_ops; efx 1691 drivers/net/ethernet/sfc/falcon/falcon.c efx->phy_op = &falcon_txc_phy_ops; efx 1694 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, probe, efx->net_dev, "Unknown PHY type %d\n", efx 1695 drivers/net/ethernet/sfc/falcon/falcon.c efx->phy_type); efx 1701 drivers/net/ethernet/sfc/falcon/falcon.c efx->mdio.mdio_read = falcon_mdio_read; efx 1702 drivers/net/ethernet/sfc/falcon/falcon.c efx->mdio.mdio_write = falcon_mdio_write; efx 1703 drivers/net/ethernet/sfc/falcon/falcon.c rc = efx->phy_op->probe(efx); efx 1708 drivers/net/ethernet/sfc/falcon/falcon.c efx->link_state.speed = 10000; efx 1709 drivers/net/ethernet/sfc/falcon/falcon.c efx->link_state.fd = true; efx 1712 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) efx 1713 drivers/net/ethernet/sfc/falcon/falcon.c efx->wanted_fc = EF4_FC_RX | EF4_FC_TX; efx 1715 drivers/net/ethernet/sfc/falcon/falcon.c efx->wanted_fc = EF4_FC_RX; efx 1716 drivers/net/ethernet/sfc/falcon/falcon.c if (efx->mdio.mmds & MDIO_DEVS_AN) efx 1717 drivers/net/ethernet/sfc/falcon/falcon.c efx->wanted_fc |= EF4_FC_AUTO; efx 1720 drivers/net/ethernet/sfc/falcon/falcon.c rc = ef4_nic_alloc_buffer(efx, &efx->stats_buffer, efx 1724 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, probe, efx->net_dev, efx 1726 drivers/net/ethernet/sfc/falcon/falcon.c (u64)efx->stats_buffer.dma_addr, efx 1727 drivers/net/ethernet/sfc/falcon/falcon.c efx->stats_buffer.addr, efx 1728 drivers/net/ethernet/sfc/falcon/falcon.c (u64)virt_to_phys(efx->stats_buffer.addr)); efx 1733 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_remove_port(struct ef4_nic *efx) efx 1735 drivers/net/ethernet/sfc/falcon/falcon.c efx->phy_op->remove(efx); efx 1736 drivers/net/ethernet/sfc/falcon/falcon.c ef4_nic_free_buffer(efx, &efx->stats_buffer); efx 1743 drivers/net/ethernet/sfc/falcon/falcon.c struct ef4_nic *efx = channel->efx; efx 1744 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1752 drivers/net/ethernet/sfc/falcon/falcon.c if ((ef4_nic_rev(efx) == EF4_REV_FALCON_B0) && efx 1758 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_nic_rev(efx) <= EF4_REV_FALCON_A1 ? efx 1761 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, rx_err, efx->net_dev, efx 1765 drivers/net/ethernet/sfc/falcon/falcon.c atomic_inc(&efx->rx_reset); efx 1766 drivers/net/ethernet/sfc/falcon/falcon.c ef4_schedule_reset(efx, EF4_WORKAROUND_6555(efx) ? efx 1781 drivers/net/ethernet/sfc/falcon/falcon.c falcon_read_nvram(struct ef4_nic *efx, struct falcon_nvconfig *nvconfig_out) efx 1783 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1804 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_spi_read(efx, spi, 0, FALCON_NVCONFIG_END, NULL, region); efx 1807 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, "Failed to read %s\n", efx 1819 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, efx 1824 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, efx 1838 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, efx 1852 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_test_nvram(struct ef4_nic *efx) efx 1854 drivers/net/ethernet/sfc/falcon/falcon.c return falcon_read_nvram(efx, NULL); efx 1897 drivers/net/ethernet/sfc/falcon/falcon.c falcon_b0_test_chip(struct ef4_nic *efx, struct ef4_self_tests *tests) efx 1902 drivers/net/ethernet/sfc/falcon/falcon.c mutex_lock(&efx->mac_lock); efx 1903 drivers/net/ethernet/sfc/falcon/falcon.c if (efx->loopback_modes) { efx 1906 drivers/net/ethernet/sfc/falcon/falcon.c if (efx->loopback_modes & (1 << LOOPBACK_XGMII)) efx 1907 drivers/net/ethernet/sfc/falcon/falcon.c efx->loopback_mode = LOOPBACK_XGMII; efx 1909 drivers/net/ethernet/sfc/falcon/falcon.c efx->loopback_mode = __ffs(efx->loopback_modes); efx 1911 drivers/net/ethernet/sfc/falcon/falcon.c __ef4_reconfigure_port(efx); efx 1912 drivers/net/ethernet/sfc/falcon/falcon.c mutex_unlock(&efx->mac_lock); efx 1914 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reset_down(efx, reset_method); efx 1917 drivers/net/ethernet/sfc/falcon/falcon.c ef4_farch_test_registers(efx, falcon_b0_register_tests, efx 1921 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_reset_hw(efx, reset_method); efx 1922 drivers/net/ethernet/sfc/falcon/falcon.c rc2 = ef4_reset_up(efx, reset_method, rc == 0); efx 1977 drivers/net/ethernet/sfc/falcon/falcon.c static int __falcon_reset_hw(struct ef4_nic *efx, enum reset_type method) efx 1979 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1983 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, hw, efx->net_dev, "performing %s hardware reset\n", efx 1988 drivers/net/ethernet/sfc/falcon/falcon.c rc = pci_save_state(efx->pci_dev); efx 1990 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, drv, efx->net_dev, efx 1995 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_nic_is_dual_func(efx)) { efx 1998 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, drv, efx->net_dev, efx 2024 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &glb_ctl_reg_ker, FR_AB_GLB_CTL); efx 2026 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, hw, efx->net_dev, "waiting for hardware reset\n"); efx 2031 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_nic_is_dual_func(efx)) efx 2033 drivers/net/ethernet/sfc/falcon/falcon.c pci_restore_state(efx->pci_dev); efx 2034 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, drv, efx->net_dev, efx 2039 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &glb_ctl_reg_ker, FR_AB_GLB_CTL); efx 2042 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, efx 2046 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, hw, efx->net_dev, "hardware reset complete\n"); efx 2052 drivers/net/ethernet/sfc/falcon/falcon.c pci_restore_state(efx->pci_dev); efx 2058 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_reset_hw(struct ef4_nic *efx, enum reset_type method) efx 2060 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 2064 drivers/net/ethernet/sfc/falcon/falcon.c rc = __falcon_reset_hw(efx, method); efx 2070 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_monitor(struct ef4_nic *efx) efx 2075 drivers/net/ethernet/sfc/falcon/falcon.c BUG_ON(!mutex_is_locked(&efx->mac_lock)); efx 2077 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_board(efx)->type->monitor(efx); efx 2079 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, efx 2082 drivers/net/ethernet/sfc/falcon/falcon.c efx->phy_mode |= PHY_MODE_LOW_POWER; efx 2083 drivers/net/ethernet/sfc/falcon/falcon.c rc = __ef4_reconfigure_port(efx); efx 2087 drivers/net/ethernet/sfc/falcon/falcon.c if (LOOPBACK_INTERNAL(efx)) efx 2088 drivers/net/ethernet/sfc/falcon/falcon.c link_changed = falcon_loopback_link_poll(efx); efx 2090 drivers/net/ethernet/sfc/falcon/falcon.c link_changed = efx->phy_op->poll(efx); efx 2093 drivers/net/ethernet/sfc/falcon/falcon.c falcon_stop_nic_stats(efx); efx 2094 drivers/net/ethernet/sfc/falcon/falcon.c falcon_deconfigure_mac_wrapper(efx); efx 2096 drivers/net/ethernet/sfc/falcon/falcon.c falcon_reset_macs(efx); efx 2097 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_reconfigure_xmac(efx); efx 2100 drivers/net/ethernet/sfc/falcon/falcon.c falcon_start_nic_stats(efx); efx 2102 drivers/net/ethernet/sfc/falcon/falcon.c ef4_link_status_changed(efx); efx 2105 drivers/net/ethernet/sfc/falcon/falcon.c falcon_poll_xmac(efx); efx 2111 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_reset_sram(struct ef4_nic *efx) efx 2117 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &gpio_cfg_reg_ker, FR_AB_GPIO_CTL); efx 2120 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &gpio_cfg_reg_ker, FR_AB_GPIO_CTL); efx 2126 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &srm_cfg_reg_ker, FR_AZ_SRM_CFG); efx 2131 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, hw, efx->net_dev, efx 2138 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &srm_cfg_reg_ker, FR_AZ_SRM_CFG); efx 2140 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, hw, efx->net_dev, efx 2147 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, hw, efx->net_dev, "timed out waiting for SRAM reset\n"); efx 2151 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_spi_device_init(struct ef4_nic *efx, efx 2177 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_probe_nvconfig(struct ef4_nic *efx) efx 2179 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 2187 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_read_nvram(efx, nvconfig); efx 2191 drivers/net/ethernet/sfc/falcon/falcon.c efx->phy_type = nvconfig->board_v2.port0_phy_type; efx 2192 drivers/net/ethernet/sfc/falcon/falcon.c efx->mdio.prtad = nvconfig->board_v2.port0_phy_addr; efx 2196 drivers/net/ethernet/sfc/falcon/falcon.c efx, &nic_data->spi_flash, FFE_AB_SPI_DEVICE_FLASH, efx 2200 drivers/net/ethernet/sfc/falcon/falcon.c efx, &nic_data->spi_eeprom, FFE_AB_SPI_DEVICE_EEPROM, efx 2206 drivers/net/ethernet/sfc/falcon/falcon.c ether_addr_copy(efx->net_dev->perm_addr, nvconfig->mac_address[0]); efx 2208 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, probe, efx->net_dev, "PHY is %d phy_id %d\n", efx 2209 drivers/net/ethernet/sfc/falcon/falcon.c efx->phy_type, efx->mdio.prtad); efx 2211 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_probe_board(efx, efx 2218 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_dimension_resources(struct ef4_nic *efx) efx 2220 drivers/net/ethernet/sfc/falcon/falcon.c efx->rx_dc_base = 0x20000; efx 2221 drivers/net/ethernet/sfc/falcon/falcon.c efx->tx_dc_base = 0x26000; efx 2226 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_probe_spi_devices(struct ef4_nic *efx) efx 2228 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 2232 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &gpio_ctl, FR_AB_GPIO_CTL); efx 2233 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &nic_stat, FR_AB_NIC_STAT); efx 2234 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &ee_vpd_cfg, FR_AB_EE_VPD_CFG0); efx 2239 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, probe, efx->net_dev, "Booted from %s\n", efx 2246 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, probe, efx->net_dev, efx 2254 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &ee_vpd_cfg, FR_AB_EE_VPD_CFG0); efx 2260 drivers/net/ethernet/sfc/falcon/falcon.c falcon_spi_device_init(efx, &nic_data->spi_flash, efx 2264 drivers/net/ethernet/sfc/falcon/falcon.c falcon_spi_device_init(efx, &nic_data->spi_eeprom, efx 2269 drivers/net/ethernet/sfc/falcon/falcon.c static unsigned int falcon_a1_mem_map_size(struct ef4_nic *efx) efx 2274 drivers/net/ethernet/sfc/falcon/falcon.c static unsigned int falcon_b0_mem_map_size(struct ef4_nic *efx) efx 2283 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_probe_nic(struct ef4_nic *efx) efx 2289 drivers/net/ethernet/sfc/falcon/falcon.c efx->primary = efx; /* only one usable function per controller */ efx 2295 drivers/net/ethernet/sfc/falcon/falcon.c efx->nic_data = nic_data; efx 2296 drivers/net/ethernet/sfc/falcon/falcon.c nic_data->efx = efx; efx 2300 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_farch_fpga_ver(efx) != 0) { efx 2301 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, probe, efx->net_dev, efx 2306 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_nic_rev(efx) <= EF4_REV_FALCON_A1) { efx 2309 drivers/net/ethernet/sfc/falcon/falcon.c u8 pci_rev = efx->pci_dev->revision; efx 2312 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, probe, efx->net_dev, efx 2316 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &nic_stat, FR_AB_NIC_STAT); efx 2318 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, probe, efx->net_dev, efx 2323 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, probe, efx->net_dev, efx 2328 drivers/net/ethernet/sfc/falcon/falcon.c dev = pci_dev_get(efx->pci_dev); efx 2332 drivers/net/ethernet/sfc/falcon/falcon.c if (dev->bus == efx->pci_dev->bus && efx 2333 drivers/net/ethernet/sfc/falcon/falcon.c dev->devfn == efx->pci_dev->devfn + 1) { efx 2339 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, probe, efx->net_dev, efx 2347 drivers/net/ethernet/sfc/falcon/falcon.c rc = __falcon_reset_hw(efx, RESET_TYPE_ALL); efx 2349 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, probe, efx->net_dev, "failed to reset NIC\n"); efx 2354 drivers/net/ethernet/sfc/falcon/falcon.c rc = ef4_nic_alloc_buffer(efx, &efx->irq_status, sizeof(ef4_oword_t), efx 2358 drivers/net/ethernet/sfc/falcon/falcon.c BUG_ON(efx->irq_status.dma_addr & 0x0f); efx 2360 drivers/net/ethernet/sfc/falcon/falcon.c netif_dbg(efx, probe, efx->net_dev, efx 2362 drivers/net/ethernet/sfc/falcon/falcon.c (u64)efx->irq_status.dma_addr, efx 2363 drivers/net/ethernet/sfc/falcon/falcon.c efx->irq_status.addr, efx 2364 drivers/net/ethernet/sfc/falcon/falcon.c (u64)virt_to_phys(efx->irq_status.addr)); efx 2366 drivers/net/ethernet/sfc/falcon/falcon.c falcon_probe_spi_devices(efx); efx 2369 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_probe_nvconfig(efx); efx 2372 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, probe, efx->net_dev, "NVRAM is invalid\n"); efx 2376 drivers/net/ethernet/sfc/falcon/falcon.c efx->max_channels = (ef4_nic_rev(efx) <= EF4_REV_FALCON_A1 ? 4 : efx 2378 drivers/net/ethernet/sfc/falcon/falcon.c efx->max_tx_channels = efx->max_channels; efx 2379 drivers/net/ethernet/sfc/falcon/falcon.c efx->timer_quantum_ns = 4968; /* 621 cycles */ efx 2380 drivers/net/ethernet/sfc/falcon/falcon.c efx->timer_max_ns = efx->type->timer_period_max * efx 2381 drivers/net/ethernet/sfc/falcon/falcon.c efx->timer_quantum_ns; efx 2384 drivers/net/ethernet/sfc/falcon/falcon.c board = falcon_board(efx); efx 2387 drivers/net/ethernet/sfc/falcon/falcon.c board->i2c_data.data = efx; efx 2389 drivers/net/ethernet/sfc/falcon/falcon.c board->i2c_adap.dev.parent = &efx->pci_dev->dev; efx 2396 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_board(efx)->type->init(efx); efx 2398 drivers/net/ethernet/sfc/falcon/falcon.c netif_err(efx, probe, efx->net_dev, efx 2412 drivers/net/ethernet/sfc/falcon/falcon.c ef4_nic_free_buffer(efx, &efx->irq_status); efx 2421 drivers/net/ethernet/sfc/falcon/falcon.c kfree(efx->nic_data); efx 2425 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_init_rx_cfg(struct ef4_nic *efx) efx 2432 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, ®, FR_AZ_RX_CFG); efx 2433 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_nic_rev(efx) <= EF4_REV_FALCON_A1) { efx 2469 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, ®, FR_AZ_RX_CFG); efx 2476 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_init_nic(struct ef4_nic *efx) efx 2482 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &temp, FR_AB_NIC_STAT); efx 2484 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &temp, FR_AB_NIC_STAT); efx 2486 drivers/net/ethernet/sfc/falcon/falcon.c rc = falcon_reset_sram(efx); efx 2493 drivers/net/ethernet/sfc/falcon/falcon.c if (EF4_WORKAROUND_5129(efx)) { efx 2494 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &temp, FR_AZ_CSR_SPARE); efx 2496 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &temp, FR_AZ_CSR_SPARE); efx 2499 drivers/net/ethernet/sfc/falcon/falcon.c if (EF4_WORKAROUND_7244(efx)) { efx 2500 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &temp, FR_BZ_RX_FILTER_CTL); efx 2505 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &temp, FR_BZ_RX_FILTER_CTL); efx 2512 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &temp, FR_AA_RX_SELF_RST); efx 2515 drivers/net/ethernet/sfc/falcon/falcon.c if (EF4_WORKAROUND_5583(efx)) efx 2517 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &temp, FR_AA_RX_SELF_RST); efx 2522 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &temp, FR_AZ_TX_CFG); efx 2524 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &temp, FR_AZ_TX_CFG); efx 2526 drivers/net/ethernet/sfc/falcon/falcon.c falcon_init_rx_cfg(efx); efx 2528 drivers/net/ethernet/sfc/falcon/falcon.c if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) { efx 2529 drivers/net/ethernet/sfc/falcon/falcon.c falcon_b0_rx_push_rss_config(efx, false, efx->rx_indir_table); efx 2533 drivers/net/ethernet/sfc/falcon/falcon.c ef4_writeo(efx, &temp, FR_BZ_DP_CTRL); efx 2536 drivers/net/ethernet/sfc/falcon/falcon.c ef4_farch_init_common(efx); efx 2541 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_remove_nic(struct ef4_nic *efx) efx 2543 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 2544 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_board *board = falcon_board(efx); efx 2546 drivers/net/ethernet/sfc/falcon/falcon.c board->type->fini(efx); efx 2552 drivers/net/ethernet/sfc/falcon/falcon.c ef4_nic_free_buffer(efx, &efx->irq_status); efx 2554 drivers/net/ethernet/sfc/falcon/falcon.c __falcon_reset_hw(efx, RESET_TYPE_ALL); efx 2563 drivers/net/ethernet/sfc/falcon/falcon.c kfree(efx->nic_data); efx 2564 drivers/net/ethernet/sfc/falcon/falcon.c efx->nic_data = NULL; efx 2567 drivers/net/ethernet/sfc/falcon/falcon.c static size_t falcon_describe_nic_stats(struct ef4_nic *efx, u8 *names) efx 2573 drivers/net/ethernet/sfc/falcon/falcon.c static size_t falcon_update_nic_stats(struct ef4_nic *efx, u64 *full_stats, efx 2576 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 2581 drivers/net/ethernet/sfc/falcon/falcon.c ef4_reado(efx, &cnt, FR_AZ_RX_NODESC_DROP); efx 2586 drivers/net/ethernet/sfc/falcon/falcon.c FALCON_XMAC_STATS_DMA_FLAG(efx)) { efx 2592 drivers/net/ethernet/sfc/falcon/falcon.c stats, efx->stats_buffer.addr, true); efx 2600 drivers/net/ethernet/sfc/falcon/falcon.c ef4_update_sw_stats(efx, stats); efx 2631 drivers/net/ethernet/sfc/falcon/falcon.c void falcon_start_nic_stats(struct ef4_nic *efx) efx 2633 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 2635 drivers/net/ethernet/sfc/falcon/falcon.c spin_lock_bh(&efx->stats_lock); efx 2637 drivers/net/ethernet/sfc/falcon/falcon.c falcon_stats_request(efx); efx 2638 drivers/net/ethernet/sfc/falcon/falcon.c spin_unlock_bh(&efx->stats_lock); efx 2644 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_pull_nic_stats(struct ef4_nic *efx) efx 2649 drivers/net/ethernet/sfc/falcon/falcon.c void falcon_stop_nic_stats(struct ef4_nic *efx) efx 2651 drivers/net/ethernet/sfc/falcon/falcon.c struct falcon_nic_data *nic_data = efx->nic_data; efx 2656 drivers/net/ethernet/sfc/falcon/falcon.c spin_lock_bh(&efx->stats_lock); efx 2658 drivers/net/ethernet/sfc/falcon/falcon.c spin_unlock_bh(&efx->stats_lock); efx 2665 drivers/net/ethernet/sfc/falcon/falcon.c if (FALCON_XMAC_STATS_DMA_FLAG(efx)) efx 2670 drivers/net/ethernet/sfc/falcon/falcon.c spin_lock_bh(&efx->stats_lock); efx 2671 drivers/net/ethernet/sfc/falcon/falcon.c falcon_stats_complete(efx); efx 2672 drivers/net/ethernet/sfc/falcon/falcon.c spin_unlock_bh(&efx->stats_lock); efx 2675 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_set_id_led(struct ef4_nic *efx, enum ef4_led_mode mode) efx 2677 drivers/net/ethernet/sfc/falcon/falcon.c falcon_board(efx)->type->set_id_led(efx, mode); efx 2687 drivers/net/ethernet/sfc/falcon/falcon.c static void falcon_get_wol(struct ef4_nic *efx, struct ethtool_wolinfo *wol) efx 2694 drivers/net/ethernet/sfc/falcon/falcon.c static int falcon_set_wol(struct ef4_nic *efx, u32 type) efx 87 drivers/net/ethernet/sfc/falcon/falcon_boards.c static int ef4_init_lm87(struct ef4_nic *efx, const struct i2c_board_info *info, efx 90 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct falcon_board *board = falcon_board(efx); efx 116 drivers/net/ethernet/sfc/falcon/falcon_boards.c static void ef4_fini_lm87(struct ef4_nic *efx) efx 118 drivers/net/ethernet/sfc/falcon/falcon_boards.c i2c_unregister_device(falcon_board(efx)->hwmon_client); efx 121 drivers/net/ethernet/sfc/falcon/falcon_boards.c static int ef4_check_lm87(struct ef4_nic *efx, unsigned mask) efx 123 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct i2c_client *client = falcon_board(efx)->hwmon_client; efx 129 drivers/net/ethernet/sfc/falcon/falcon_boards.c if (EF4_WORKAROUND_7884(efx) && efx->link_state.up) efx 161 drivers/net/ethernet/sfc/falcon/falcon_boards.c netif_err(efx, hw, efx->net_dev, efx 179 drivers/net/ethernet/sfc/falcon/falcon_boards.c ef4_init_lm87(struct ef4_nic *efx, const struct i2c_board_info *info, efx 184 drivers/net/ethernet/sfc/falcon/falcon_boards.c static inline void ef4_fini_lm87(struct ef4_nic *efx) efx 187 drivers/net/ethernet/sfc/falcon/falcon_boards.c static inline int ef4_check_lm87(struct ef4_nic *efx, unsigned mask) efx 255 drivers/net/ethernet/sfc/falcon/falcon_boards.c static void sfe4001_poweroff(struct ef4_nic *efx) efx 257 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct i2c_client *ioexp_client = falcon_board(efx)->ioexp_client; efx 258 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct i2c_client *hwmon_client = falcon_board(efx)->hwmon_client; efx 269 drivers/net/ethernet/sfc/falcon/falcon_boards.c static int sfe4001_poweron(struct ef4_nic *efx) efx 271 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct i2c_client *ioexp_client = falcon_board(efx)->ioexp_client; efx 272 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct i2c_client *hwmon_client = falcon_board(efx)->hwmon_client; efx 301 drivers/net/ethernet/sfc/falcon/falcon_boards.c netif_info(efx, hw, efx->net_dev, "power-cycling PHY\n"); efx 313 drivers/net/ethernet/sfc/falcon/falcon_boards.c if (efx->phy_mode & PHY_MODE_SPECIAL) efx 327 drivers/net/ethernet/sfc/falcon/falcon_boards.c netif_info(efx, hw, efx->net_dev, efx 333 drivers/net/ethernet/sfc/falcon/falcon_boards.c if (efx->phy_mode & PHY_MODE_SPECIAL) { efx 350 drivers/net/ethernet/sfc/falcon/falcon_boards.c netif_info(efx, hw, efx->net_dev, "timed out waiting for DSP boot\n"); efx 353 drivers/net/ethernet/sfc/falcon/falcon_boards.c sfe4001_poweroff(efx); efx 360 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct ef4_nic *efx = dev_get_drvdata(dev); efx 361 drivers/net/ethernet/sfc/falcon/falcon_boards.c return sprintf(buf, "%d\n", !!(efx->phy_mode & PHY_MODE_SPECIAL)); efx 368 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct ef4_nic *efx = dev_get_drvdata(dev); efx 373 drivers/net/ethernet/sfc/falcon/falcon_boards.c old_mode = efx->phy_mode; efx 380 drivers/net/ethernet/sfc/falcon/falcon_boards.c } else if (efx->state != STATE_READY || netif_running(efx->net_dev)) { efx 385 drivers/net/ethernet/sfc/falcon/falcon_boards.c efx->phy_mode = new_mode; efx 387 drivers/net/ethernet/sfc/falcon/falcon_boards.c falcon_stop_nic_stats(efx); efx 388 drivers/net/ethernet/sfc/falcon/falcon_boards.c err = sfe4001_poweron(efx); efx 390 drivers/net/ethernet/sfc/falcon/falcon_boards.c err = ef4_reconfigure_port(efx); efx 392 drivers/net/ethernet/sfc/falcon/falcon_boards.c falcon_start_nic_stats(efx); efx 401 drivers/net/ethernet/sfc/falcon/falcon_boards.c static void sfe4001_fini(struct ef4_nic *efx) efx 403 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct falcon_board *board = falcon_board(efx); efx 405 drivers/net/ethernet/sfc/falcon/falcon_boards.c netif_info(efx, drv, efx->net_dev, "%s\n", __func__); efx 407 drivers/net/ethernet/sfc/falcon/falcon_boards.c device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg); efx 408 drivers/net/ethernet/sfc/falcon/falcon_boards.c sfe4001_poweroff(efx); efx 413 drivers/net/ethernet/sfc/falcon/falcon_boards.c static int sfe4001_check_hw(struct ef4_nic *efx) efx 415 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct falcon_nic_data *nic_data = efx->nic_data; efx 419 drivers/net/ethernet/sfc/falcon/falcon_boards.c if (EF4_WORKAROUND_7884(efx) && !nic_data->xmac_poll_required) efx 430 drivers/net/ethernet/sfc/falcon/falcon_boards.c status = i2c_smbus_read_byte_data(falcon_board(efx)->ioexp_client, P1_IN); efx 436 drivers/net/ethernet/sfc/falcon/falcon_boards.c sfe4001_poweroff(efx); efx 437 drivers/net/ethernet/sfc/falcon/falcon_boards.c efx->phy_mode = PHY_MODE_OFF; efx 450 drivers/net/ethernet/sfc/falcon/falcon_boards.c static int sfe4001_init(struct ef4_nic *efx) efx 452 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct falcon_board *board = falcon_board(efx); efx 477 drivers/net/ethernet/sfc/falcon/falcon_boards.c if (efx->phy_mode & PHY_MODE_SPECIAL) { efx 480 drivers/net/ethernet/sfc/falcon/falcon_boards.c falcon_stop_nic_stats(efx); efx 482 drivers/net/ethernet/sfc/falcon/falcon_boards.c rc = sfe4001_poweron(efx); efx 486 drivers/net/ethernet/sfc/falcon/falcon_boards.c rc = device_create_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg); efx 490 drivers/net/ethernet/sfc/falcon/falcon_boards.c netif_info(efx, hw, efx->net_dev, "PHY is powered on\n"); efx 494 drivers/net/ethernet/sfc/falcon/falcon_boards.c sfe4001_poweroff(efx); efx 537 drivers/net/ethernet/sfc/falcon/falcon_boards.c static void sfe4002_init_phy(struct ef4_nic *efx) efx 541 drivers/net/ethernet/sfc/falcon/falcon_boards.c falcon_qt202x_set_led(efx, SFE4002_TX_LED, efx 543 drivers/net/ethernet/sfc/falcon/falcon_boards.c falcon_qt202x_set_led(efx, SFE4002_RX_LED, efx 545 drivers/net/ethernet/sfc/falcon/falcon_boards.c falcon_qt202x_set_led(efx, SFE4002_FAULT_LED, QUAKE_LED_OFF); efx 548 drivers/net/ethernet/sfc/falcon/falcon_boards.c static void sfe4002_set_id_led(struct ef4_nic *efx, enum ef4_led_mode mode) efx 551 drivers/net/ethernet/sfc/falcon/falcon_boards.c efx, SFE4002_FAULT_LED, efx 555 drivers/net/ethernet/sfc/falcon/falcon_boards.c static int sfe4002_check_hw(struct ef4_nic *efx) efx 557 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct falcon_board *board = falcon_board(efx); efx 565 drivers/net/ethernet/sfc/falcon/falcon_boards.c return ef4_check_lm87(efx, alarm_mask); efx 568 drivers/net/ethernet/sfc/falcon/falcon_boards.c static int sfe4002_init(struct ef4_nic *efx) efx 570 drivers/net/ethernet/sfc/falcon/falcon_boards.c return ef4_init_lm87(efx, &sfe4002_hwmon_info, sfe4002_lm87_regs); efx 599 drivers/net/ethernet/sfc/falcon/falcon_boards.c static void sfn4112f_init_phy(struct ef4_nic *efx) efx 601 drivers/net/ethernet/sfc/falcon/falcon_boards.c falcon_qt202x_set_led(efx, SFN4112F_ACT_LED, efx 603 drivers/net/ethernet/sfc/falcon/falcon_boards.c falcon_qt202x_set_led(efx, SFN4112F_LINK_LED, efx 607 drivers/net/ethernet/sfc/falcon/falcon_boards.c static void sfn4112f_set_id_led(struct ef4_nic *efx, enum ef4_led_mode mode) efx 623 drivers/net/ethernet/sfc/falcon/falcon_boards.c falcon_qt202x_set_led(efx, SFN4112F_LINK_LED, reg); efx 626 drivers/net/ethernet/sfc/falcon/falcon_boards.c static int sfn4112f_check_hw(struct ef4_nic *efx) efx 629 drivers/net/ethernet/sfc/falcon/falcon_boards.c return ef4_check_lm87(efx, ~0x48); efx 632 drivers/net/ethernet/sfc/falcon/falcon_boards.c static int sfn4112f_init(struct ef4_nic *efx) efx 634 drivers/net/ethernet/sfc/falcon/falcon_boards.c return ef4_init_lm87(efx, &sfn4112f_hwmon_info, sfn4112f_lm87_regs); efx 663 drivers/net/ethernet/sfc/falcon/falcon_boards.c static void sfe4003_set_id_led(struct ef4_nic *efx, enum ef4_led_mode mode) efx 665 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct falcon_board *board = falcon_board(efx); efx 672 drivers/net/ethernet/sfc/falcon/falcon_boards.c efx, SFE4003_RED_LED_GPIO, efx 676 drivers/net/ethernet/sfc/falcon/falcon_boards.c static void sfe4003_init_phy(struct ef4_nic *efx) efx 678 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct falcon_board *board = falcon_board(efx); efx 684 drivers/net/ethernet/sfc/falcon/falcon_boards.c falcon_txc_set_gpio_dir(efx, SFE4003_RED_LED_GPIO, TXC_GPIO_DIR_OUTPUT); efx 685 drivers/net/ethernet/sfc/falcon/falcon_boards.c falcon_txc_set_gpio_val(efx, SFE4003_RED_LED_GPIO, SFE4003_LED_OFF); efx 688 drivers/net/ethernet/sfc/falcon/falcon_boards.c static int sfe4003_check_hw(struct ef4_nic *efx) efx 690 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct falcon_board *board = falcon_board(efx); efx 698 drivers/net/ethernet/sfc/falcon/falcon_boards.c return ef4_check_lm87(efx, alarm_mask); efx 701 drivers/net/ethernet/sfc/falcon/falcon_boards.c static int sfe4003_init(struct ef4_nic *efx) efx 703 drivers/net/ethernet/sfc/falcon/falcon_boards.c return ef4_init_lm87(efx, &sfe4003_hwmon_info, sfe4003_lm87_regs); efx 741 drivers/net/ethernet/sfc/falcon/falcon_boards.c int falcon_probe_board(struct ef4_nic *efx, u16 revision_info) efx 743 drivers/net/ethernet/sfc/falcon/falcon_boards.c struct falcon_board *board = falcon_board(efx); efx 757 drivers/net/ethernet/sfc/falcon/falcon_boards.c netif_err(efx, probe, efx->net_dev, "unknown board type %d\n", efx 84 drivers/net/ethernet/sfc/falcon/farch.c static inline void ef4_write_buf_tbl(struct ef4_nic *efx, ef4_qword_t *value, efx 87 drivers/net/ethernet/sfc/falcon/farch.c ef4_sram_writeq(efx, efx->membase + efx->type->buf_tbl_base, efx 98 drivers/net/ethernet/sfc/falcon/farch.c int ef4_farch_test_registers(struct ef4_nic *efx, efx 111 drivers/net/ethernet/sfc/falcon/farch.c ef4_reado(efx, &original, address); efx 122 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, ®, address); efx 123 drivers/net/ethernet/sfc/falcon/farch.c ef4_reado(efx, &buf, address); efx 132 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, ®, address); efx 133 drivers/net/ethernet/sfc/falcon/farch.c ef4_reado(efx, &buf, address); efx 139 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &original, address); efx 145 drivers/net/ethernet/sfc/falcon/farch.c netif_err(efx, hw, efx->net_dev, efx 168 drivers/net/ethernet/sfc/falcon/farch.c ef4_init_special_buffer(struct ef4_nic *efx, struct ef4_special_buffer *buffer) efx 181 drivers/net/ethernet/sfc/falcon/farch.c netif_dbg(efx, probe, efx->net_dev, efx 188 drivers/net/ethernet/sfc/falcon/farch.c ef4_write_buf_tbl(efx, &buf_desc, index); efx 194 drivers/net/ethernet/sfc/falcon/farch.c ef4_fini_special_buffer(struct ef4_nic *efx, struct ef4_special_buffer *buffer) efx 203 drivers/net/ethernet/sfc/falcon/farch.c netif_dbg(efx, hw, efx->net_dev, "unmapping special buffers %d-%d\n", efx 211 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &buf_tbl_upd, FR_AZ_BUF_TBL_UPD); efx 223 drivers/net/ethernet/sfc/falcon/farch.c static int ef4_alloc_special_buffer(struct ef4_nic *efx, efx 229 drivers/net/ethernet/sfc/falcon/farch.c if (ef4_nic_alloc_buffer(efx, &buffer->buf, len, GFP_KERNEL)) efx 235 drivers/net/ethernet/sfc/falcon/farch.c buffer->index = efx->next_buffer_table; efx 236 drivers/net/ethernet/sfc/falcon/farch.c efx->next_buffer_table += buffer->entries; efx 238 drivers/net/ethernet/sfc/falcon/farch.c netif_dbg(efx, probe, efx->net_dev, efx 249 drivers/net/ethernet/sfc/falcon/farch.c ef4_free_special_buffer(struct ef4_nic *efx, struct ef4_special_buffer *buffer) efx 254 drivers/net/ethernet/sfc/falcon/farch.c netif_dbg(efx, hw, efx->net_dev, efx 261 drivers/net/ethernet/sfc/falcon/farch.c ef4_nic_free_buffer(efx, &buffer->buf); efx 279 drivers/net/ethernet/sfc/falcon/farch.c ef4_writed_page(tx_queue->efx, ®, efx 297 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo_page(tx_queue->efx, ®, efx 355 drivers/net/ethernet/sfc/falcon/farch.c if (EF4_WORKAROUND_5391(tx_queue->efx) && (dma_addr & 0xf)) efx 365 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = tx_queue->efx; efx 369 drivers/net/ethernet/sfc/falcon/farch.c return ef4_alloc_special_buffer(efx, &tx_queue->txd, efx 375 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = tx_queue->efx; efx 379 drivers/net/ethernet/sfc/falcon/farch.c ef4_init_special_buffer(efx, &tx_queue->txd); efx 396 drivers/net/ethernet/sfc/falcon/farch.c if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) { efx 403 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo_table(efx, ®, efx->type->txd_ptr_tbl_base, efx 406 drivers/net/ethernet/sfc/falcon/farch.c if (ef4_nic_rev(efx) < EF4_REV_FALCON_B0) { efx 410 drivers/net/ethernet/sfc/falcon/farch.c ef4_reado(efx, ®, FR_AA_TX_CHKSM_CFG); efx 415 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, ®, FR_AA_TX_CHKSM_CFG); efx 418 drivers/net/ethernet/sfc/falcon/farch.c if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) { efx 424 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo_table(efx, ®, FR_BZ_TX_PACE_TBL, efx 431 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = tx_queue->efx; efx 440 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &tx_flush_descq, FR_AZ_TX_FLUSH_DESCQ); efx 445 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = tx_queue->efx; efx 450 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo_table(efx, &tx_desc_ptr, efx->type->txd_ptr_tbl_base, efx 454 drivers/net/ethernet/sfc/falcon/farch.c ef4_fini_special_buffer(efx, &tx_queue->txd); efx 460 drivers/net/ethernet/sfc/falcon/farch.c ef4_free_special_buffer(tx_queue->efx, &tx_queue->txd); efx 481 drivers/net/ethernet/sfc/falcon/farch.c rx_queue->efx->type->rx_buffer_padding, efx 491 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = rx_queue->efx; efx 505 drivers/net/ethernet/sfc/falcon/farch.c ef4_writed_page(efx, ®, FR_AZ_RX_DESC_UPD_DWORD_P0, efx 511 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = rx_queue->efx; efx 515 drivers/net/ethernet/sfc/falcon/farch.c return ef4_alloc_special_buffer(efx, &rx_queue->rxd, efx 522 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = rx_queue->efx; efx 523 drivers/net/ethernet/sfc/falcon/farch.c bool is_b0 = ef4_nic_rev(efx) >= EF4_REV_FALCON_B0; efx 532 drivers/net/ethernet/sfc/falcon/farch.c jumbo_en = !is_b0 || efx->rx_scatter; efx 534 drivers/net/ethernet/sfc/falcon/farch.c netif_dbg(efx, hw, efx->net_dev, efx 542 drivers/net/ethernet/sfc/falcon/farch.c ef4_init_special_buffer(efx, &rx_queue->rxd); efx 559 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base, efx 565 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = rx_queue->efx; efx 572 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &rx_flush_descq, FR_AZ_RX_FLUSH_DESCQ); efx 578 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = rx_queue->efx; efx 582 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base, efx 586 drivers/net/ethernet/sfc/falcon/farch.c ef4_fini_special_buffer(efx, &rx_queue->rxd); efx 592 drivers/net/ethernet/sfc/falcon/farch.c ef4_free_special_buffer(rx_queue->efx, &rx_queue->rxd); efx 604 drivers/net/ethernet/sfc/falcon/farch.c static bool ef4_farch_flush_wake(struct ef4_nic *efx) efx 609 drivers/net/ethernet/sfc/falcon/farch.c return (atomic_read(&efx->active_queues) == 0 || efx 610 drivers/net/ethernet/sfc/falcon/farch.c (atomic_read(&efx->rxq_flush_outstanding) < EF4_RX_FLUSH_COUNT efx 611 drivers/net/ethernet/sfc/falcon/farch.c && atomic_read(&efx->rxq_flush_pending) > 0)); efx 614 drivers/net/ethernet/sfc/falcon/farch.c static bool ef4_check_tx_flush_complete(struct ef4_nic *efx) efx 621 drivers/net/ethernet/sfc/falcon/farch.c ef4_for_each_channel(channel, efx) { efx 623 drivers/net/ethernet/sfc/falcon/farch.c ef4_reado_table(efx, &txd_ptr_tbl, efx 629 drivers/net/ethernet/sfc/falcon/farch.c netif_dbg(efx, hw, efx->net_dev, efx 638 drivers/net/ethernet/sfc/falcon/farch.c netif_dbg(efx, hw, efx->net_dev, efx 658 drivers/net/ethernet/sfc/falcon/farch.c static int ef4_farch_do_flush(struct ef4_nic *efx) efx 666 drivers/net/ethernet/sfc/falcon/farch.c ef4_for_each_channel(channel, efx) { efx 672 drivers/net/ethernet/sfc/falcon/farch.c atomic_inc(&efx->rxq_flush_pending); efx 676 drivers/net/ethernet/sfc/falcon/farch.c while (timeout && atomic_read(&efx->active_queues) > 0) { efx 681 drivers/net/ethernet/sfc/falcon/farch.c ef4_for_each_channel(channel, efx) { efx 683 drivers/net/ethernet/sfc/falcon/farch.c if (atomic_read(&efx->rxq_flush_outstanding) >= efx 689 drivers/net/ethernet/sfc/falcon/farch.c atomic_dec(&efx->rxq_flush_pending); efx 690 drivers/net/ethernet/sfc/falcon/farch.c atomic_inc(&efx->rxq_flush_outstanding); efx 696 drivers/net/ethernet/sfc/falcon/farch.c timeout = wait_event_timeout(efx->flush_wq, efx 697 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_flush_wake(efx), efx 701 drivers/net/ethernet/sfc/falcon/farch.c if (atomic_read(&efx->active_queues) && efx 702 drivers/net/ethernet/sfc/falcon/farch.c !ef4_check_tx_flush_complete(efx)) { efx 703 drivers/net/ethernet/sfc/falcon/farch.c netif_err(efx, hw, efx->net_dev, "failed to flush %d queues " efx 704 drivers/net/ethernet/sfc/falcon/farch.c "(rx %d+%d)\n", atomic_read(&efx->active_queues), efx 705 drivers/net/ethernet/sfc/falcon/farch.c atomic_read(&efx->rxq_flush_outstanding), efx 706 drivers/net/ethernet/sfc/falcon/farch.c atomic_read(&efx->rxq_flush_pending)); efx 709 drivers/net/ethernet/sfc/falcon/farch.c atomic_set(&efx->active_queues, 0); efx 710 drivers/net/ethernet/sfc/falcon/farch.c atomic_set(&efx->rxq_flush_pending, 0); efx 711 drivers/net/ethernet/sfc/falcon/farch.c atomic_set(&efx->rxq_flush_outstanding, 0); efx 717 drivers/net/ethernet/sfc/falcon/farch.c int ef4_farch_fini_dmaq(struct ef4_nic *efx) efx 725 drivers/net/ethernet/sfc/falcon/farch.c if (efx->state != STATE_RECOVERY) { efx 727 drivers/net/ethernet/sfc/falcon/farch.c if (efx->pci_dev->is_busmaster) { efx 728 drivers/net/ethernet/sfc/falcon/farch.c efx->type->prepare_flush(efx); efx 729 drivers/net/ethernet/sfc/falcon/farch.c rc = ef4_farch_do_flush(efx); efx 730 drivers/net/ethernet/sfc/falcon/farch.c efx->type->finish_flush(efx); efx 733 drivers/net/ethernet/sfc/falcon/farch.c ef4_for_each_channel(channel, efx) { efx 758 drivers/net/ethernet/sfc/falcon/farch.c void ef4_farch_finish_flr(struct ef4_nic *efx) efx 760 drivers/net/ethernet/sfc/falcon/farch.c atomic_set(&efx->rxq_flush_pending, 0); efx 761 drivers/net/ethernet/sfc/falcon/farch.c atomic_set(&efx->rxq_flush_outstanding, 0); efx 762 drivers/net/ethernet/sfc/falcon/farch.c atomic_set(&efx->active_queues, 0); efx 781 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = channel->efx; efx 789 drivers/net/ethernet/sfc/falcon/farch.c ef4_writed(efx, ®, efx 790 drivers/net/ethernet/sfc/falcon/farch.c efx->type->evq_rptr_tbl_base + efx 795 drivers/net/ethernet/sfc/falcon/farch.c void ef4_farch_generate_event(struct ef4_nic *efx, unsigned int evq, efx 807 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &drv_ev_reg, FR_AZ_DRV_EV); efx 817 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_generate_event(channel->efx, channel->channel, &event); efx 831 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = channel->efx; efx 834 drivers/net/ethernet/sfc/falcon/farch.c if (unlikely(READ_ONCE(efx->reset_pending))) efx 852 drivers/net/ethernet/sfc/falcon/farch.c netif_tx_lock(efx->net_dev); efx 854 drivers/net/ethernet/sfc/falcon/farch.c netif_tx_unlock(efx->net_dev); efx 856 drivers/net/ethernet/sfc/falcon/farch.c ef4_schedule_reset(efx, RESET_TYPE_DMA_ERROR); efx 858 drivers/net/ethernet/sfc/falcon/farch.c netif_err(efx, tx_err, efx->net_dev, efx 872 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = rx_queue->efx; efx 892 drivers/net/ethernet/sfc/falcon/farch.c rx_ev_drib_nib = ((ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) ? efx 907 drivers/net/ethernet/sfc/falcon/farch.c else if (!efx->loopback_selftest) { efx 920 drivers/net/ethernet/sfc/falcon/farch.c netif_dbg(efx, rx_err, efx->net_dev, efx 951 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = rx_queue->efx; efx 963 drivers/net/ethernet/sfc/falcon/farch.c netif_info(efx, rx_err, efx->net_dev, efx 967 drivers/net/ethernet/sfc/falcon/farch.c ef4_schedule_reset(efx, EF4_WORKAROUND_5676(efx) ? efx 988 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = channel->efx; efx 990 drivers/net/ethernet/sfc/falcon/farch.c if (unlikely(READ_ONCE(efx->reset_pending))) efx 1091 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_handle_tx_flush_done(struct ef4_nic *efx, ef4_qword_t *event) efx 1097 drivers/net/ethernet/sfc/falcon/farch.c if (qid < EF4_TXQ_TYPES * efx->n_tx_channels) { efx 1098 drivers/net/ethernet/sfc/falcon/farch.c tx_queue = ef4_get_tx_queue(efx, qid / EF4_TXQ_TYPES, efx 1112 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_handle_rx_flush_done(struct ef4_nic *efx, ef4_qword_t *event) efx 1121 drivers/net/ethernet/sfc/falcon/farch.c if (qid >= efx->n_channels) efx 1123 drivers/net/ethernet/sfc/falcon/farch.c channel = ef4_get_channel(efx, qid); efx 1129 drivers/net/ethernet/sfc/falcon/farch.c netif_info(efx, hw, efx->net_dev, efx 1132 drivers/net/ethernet/sfc/falcon/farch.c atomic_inc(&efx->rxq_flush_pending); efx 1137 drivers/net/ethernet/sfc/falcon/farch.c atomic_dec(&efx->rxq_flush_outstanding); efx 1138 drivers/net/ethernet/sfc/falcon/farch.c if (ef4_farch_flush_wake(efx)) efx 1139 drivers/net/ethernet/sfc/falcon/farch.c wake_up(&efx->flush_wq); efx 1145 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = channel->efx; efx 1147 drivers/net/ethernet/sfc/falcon/farch.c WARN_ON(atomic_read(&efx->active_queues) == 0); efx 1148 drivers/net/ethernet/sfc/falcon/farch.c atomic_dec(&efx->active_queues); efx 1149 drivers/net/ethernet/sfc/falcon/farch.c if (ef4_farch_flush_wake(efx)) efx 1150 drivers/net/ethernet/sfc/falcon/farch.c wake_up(&efx->flush_wq); efx 1156 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = channel->efx; efx 1177 drivers/net/ethernet/sfc/falcon/farch.c netif_dbg(efx, hw, efx->net_dev, "channel %d received " efx 1186 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = channel->efx; efx 1195 drivers/net/ethernet/sfc/falcon/farch.c netif_vdbg(efx, hw, efx->net_dev, "channel %d TXQ %d flushed\n", efx 1197 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_handle_tx_flush_done(efx, event); efx 1200 drivers/net/ethernet/sfc/falcon/farch.c netif_vdbg(efx, hw, efx->net_dev, "channel %d RXQ %d flushed\n", efx 1202 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_handle_rx_flush_done(efx, event); efx 1205 drivers/net/ethernet/sfc/falcon/farch.c netif_dbg(efx, hw, efx->net_dev, efx 1210 drivers/net/ethernet/sfc/falcon/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 1214 drivers/net/ethernet/sfc/falcon/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 1219 drivers/net/ethernet/sfc/falcon/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 1224 drivers/net/ethernet/sfc/falcon/farch.c netif_err(efx, rx_err, efx->net_dev, efx 1227 drivers/net/ethernet/sfc/falcon/farch.c atomic_inc(&efx->rx_reset); efx 1228 drivers/net/ethernet/sfc/falcon/farch.c ef4_schedule_reset(efx, efx 1229 drivers/net/ethernet/sfc/falcon/farch.c EF4_WORKAROUND_6555(efx) ? efx 1234 drivers/net/ethernet/sfc/falcon/farch.c netif_err(efx, rx_err, efx->net_dev, efx 1238 drivers/net/ethernet/sfc/falcon/farch.c ef4_schedule_reset(efx, RESET_TYPE_DMA_ERROR); efx 1241 drivers/net/ethernet/sfc/falcon/farch.c netif_err(efx, tx_err, efx->net_dev, efx 1245 drivers/net/ethernet/sfc/falcon/farch.c ef4_schedule_reset(efx, RESET_TYPE_DMA_ERROR); efx 1248 drivers/net/ethernet/sfc/falcon/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 1258 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = channel->efx; efx 1278 drivers/net/ethernet/sfc/falcon/farch.c netif_vdbg(channel->efx, intr, channel->efx->net_dev, efx 1298 drivers/net/ethernet/sfc/falcon/farch.c if (tx_packets > efx->txq_entries) { efx 1310 drivers/net/ethernet/sfc/falcon/farch.c if (efx->type->handle_global_event && efx 1311 drivers/net/ethernet/sfc/falcon/farch.c efx->type->handle_global_event(channel, &event)) efx 1315 drivers/net/ethernet/sfc/falcon/farch.c netif_err(channel->efx, hw, channel->efx->net_dev, efx 1330 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = channel->efx; efx 1334 drivers/net/ethernet/sfc/falcon/farch.c return ef4_alloc_special_buffer(efx, &channel->eventq, efx 1341 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = channel->efx; efx 1343 drivers/net/ethernet/sfc/falcon/farch.c netif_dbg(efx, hw, efx->net_dev, efx 1349 drivers/net/ethernet/sfc/falcon/farch.c ef4_init_special_buffer(efx, &channel->eventq); efx 1359 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo_table(efx, ®, efx->type->evq_ptr_tbl_base, efx 1368 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = channel->efx; efx 1372 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo_table(efx, ®, efx->type->evq_ptr_tbl_base, efx 1376 drivers/net/ethernet/sfc/falcon/farch.c ef4_fini_special_buffer(efx, &channel->eventq); efx 1382 drivers/net/ethernet/sfc/falcon/farch.c ef4_free_special_buffer(channel->efx, &channel->eventq); efx 1406 drivers/net/ethernet/sfc/falcon/farch.c static inline void ef4_farch_interrupts(struct ef4_nic *efx, efx 1412 drivers/net/ethernet/sfc/falcon/farch.c FRF_AZ_KER_INT_LEVE_SEL, efx->irq_level, efx 1415 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &int_en_reg_ker, FR_AZ_INT_EN_KER); efx 1418 drivers/net/ethernet/sfc/falcon/farch.c void ef4_farch_irq_enable_master(struct ef4_nic *efx) efx 1420 drivers/net/ethernet/sfc/falcon/farch.c EF4_ZERO_OWORD(*((ef4_oword_t *) efx->irq_status.addr)); efx 1423 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_interrupts(efx, true, false); efx 1426 drivers/net/ethernet/sfc/falcon/farch.c void ef4_farch_irq_disable_master(struct ef4_nic *efx) efx 1429 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_interrupts(efx, false, false); efx 1436 drivers/net/ethernet/sfc/falcon/farch.c int ef4_farch_irq_test_generate(struct ef4_nic *efx) efx 1438 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_interrupts(efx, true, true); efx 1445 drivers/net/ethernet/sfc/falcon/farch.c irqreturn_t ef4_farch_fatal_interrupt(struct ef4_nic *efx) efx 1447 drivers/net/ethernet/sfc/falcon/farch.c struct falcon_nic_data *nic_data = efx->nic_data; efx 1448 drivers/net/ethernet/sfc/falcon/farch.c ef4_oword_t *int_ker = efx->irq_status.addr; efx 1452 drivers/net/ethernet/sfc/falcon/farch.c ef4_reado(efx, &fatal_intr, FR_AZ_FATAL_INTR_KER); efx 1455 drivers/net/ethernet/sfc/falcon/farch.c netif_err(efx, hw, efx->net_dev, "SYSTEM ERROR "EF4_OWORD_FMT" status " efx 1465 drivers/net/ethernet/sfc/falcon/farch.c ef4_reado(efx, ®, FR_AZ_MEM_STAT); efx 1466 drivers/net/ethernet/sfc/falcon/farch.c netif_err(efx, hw, efx->net_dev, efx 1472 drivers/net/ethernet/sfc/falcon/farch.c pci_clear_master(efx->pci_dev); efx 1473 drivers/net/ethernet/sfc/falcon/farch.c if (ef4_nic_is_dual_func(efx)) efx 1475 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_irq_disable_master(efx); efx 1478 drivers/net/ethernet/sfc/falcon/farch.c if (efx->int_error_count == 0 || efx 1479 drivers/net/ethernet/sfc/falcon/farch.c time_after(jiffies, efx->int_error_expire)) { efx 1480 drivers/net/ethernet/sfc/falcon/farch.c efx->int_error_count = 0; efx 1481 drivers/net/ethernet/sfc/falcon/farch.c efx->int_error_expire = efx 1484 drivers/net/ethernet/sfc/falcon/farch.c if (++efx->int_error_count < EF4_MAX_INT_ERRORS) { efx 1485 drivers/net/ethernet/sfc/falcon/farch.c netif_err(efx, hw, efx->net_dev, efx 1487 drivers/net/ethernet/sfc/falcon/farch.c ef4_schedule_reset(efx, RESET_TYPE_INT_ERROR); efx 1489 drivers/net/ethernet/sfc/falcon/farch.c netif_err(efx, hw, efx->net_dev, efx 1492 drivers/net/ethernet/sfc/falcon/farch.c ef4_schedule_reset(efx, RESET_TYPE_DISABLE); efx 1503 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = dev_id; efx 1504 drivers/net/ethernet/sfc/falcon/farch.c bool soft_enabled = READ_ONCE(efx->irq_soft_enabled); efx 1505 drivers/net/ethernet/sfc/falcon/farch.c ef4_oword_t *int_ker = efx->irq_status.addr; efx 1513 drivers/net/ethernet/sfc/falcon/farch.c ef4_readd(efx, ®, FR_BZ_INT_ISR0); efx 1520 drivers/net/ethernet/sfc/falcon/farch.c if (EF4_DWORD_IS_ALL_ONES(reg) && ef4_try_recovery(efx) && efx 1521 drivers/net/ethernet/sfc/falcon/farch.c !efx->eeh_disabled_legacy_irq) { efx 1522 drivers/net/ethernet/sfc/falcon/farch.c disable_irq_nosync(efx->legacy_irq); efx 1523 drivers/net/ethernet/sfc/falcon/farch.c efx->eeh_disabled_legacy_irq = true; efx 1527 drivers/net/ethernet/sfc/falcon/farch.c if (queues & (1U << efx->irq_level) && soft_enabled) { efx 1530 drivers/net/ethernet/sfc/falcon/farch.c return ef4_farch_fatal_interrupt(efx); efx 1531 drivers/net/ethernet/sfc/falcon/farch.c efx->last_irq_cpu = raw_smp_processor_id(); efx 1535 drivers/net/ethernet/sfc/falcon/farch.c efx->irq_zero_count = 0; efx 1539 drivers/net/ethernet/sfc/falcon/farch.c ef4_for_each_channel(channel, efx) { efx 1554 drivers/net/ethernet/sfc/falcon/farch.c if (efx->irq_zero_count++ == 0) efx 1559 drivers/net/ethernet/sfc/falcon/farch.c ef4_for_each_channel(channel, efx) { efx 1571 drivers/net/ethernet/sfc/falcon/farch.c netif_vdbg(efx, intr, efx->net_dev, efx 1588 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_nic *efx = context->efx; efx 1589 drivers/net/ethernet/sfc/falcon/farch.c ef4_oword_t *int_ker = efx->irq_status.addr; efx 1592 drivers/net/ethernet/sfc/falcon/farch.c netif_vdbg(efx, intr, efx->net_dev, efx 1596 drivers/net/ethernet/sfc/falcon/farch.c if (!likely(READ_ONCE(efx->irq_soft_enabled))) efx 1600 drivers/net/ethernet/sfc/falcon/farch.c if (context->index == efx->irq_level) { efx 1603 drivers/net/ethernet/sfc/falcon/farch.c return ef4_farch_fatal_interrupt(efx); efx 1604 drivers/net/ethernet/sfc/falcon/farch.c efx->last_irq_cpu = raw_smp_processor_id(); efx 1608 drivers/net/ethernet/sfc/falcon/farch.c ef4_schedule_channel_irq(efx->channel[context->index]); efx 1616 drivers/net/ethernet/sfc/falcon/farch.c void ef4_farch_rx_push_indir_table(struct ef4_nic *efx) efx 1621 drivers/net/ethernet/sfc/falcon/farch.c BUG_ON(ef4_nic_rev(efx) < EF4_REV_FALCON_B0); efx 1623 drivers/net/ethernet/sfc/falcon/farch.c BUILD_BUG_ON(ARRAY_SIZE(efx->rx_indir_table) != efx 1628 drivers/net/ethernet/sfc/falcon/farch.c efx->rx_indir_table[i]); efx 1629 drivers/net/ethernet/sfc/falcon/farch.c ef4_writed(efx, &dword, efx 1644 drivers/net/ethernet/sfc/falcon/farch.c void ef4_farch_dimension_resources(struct ef4_nic *efx, unsigned sram_lim_qw) efx 1651 drivers/net/ethernet/sfc/falcon/farch.c buftbl_min = ((efx->n_rx_channels * EF4_MAX_DMAQ_SIZE + efx 1652 drivers/net/ethernet/sfc/falcon/farch.c efx->n_tx_channels * EF4_TXQ_TYPES * EF4_MAX_DMAQ_SIZE + efx 1653 drivers/net/ethernet/sfc/falcon/farch.c efx->n_channels * EF4_MAX_EVQ_SIZE) efx 1655 drivers/net/ethernet/sfc/falcon/farch.c vi_count = max(efx->n_channels, efx->n_tx_channels * EF4_TXQ_TYPES); efx 1657 drivers/net/ethernet/sfc/falcon/farch.c efx->tx_dc_base = sram_lim_qw - vi_count * TX_DC_ENTRIES; efx 1658 drivers/net/ethernet/sfc/falcon/farch.c efx->rx_dc_base = efx->tx_dc_base - vi_count * RX_DC_ENTRIES; efx 1661 drivers/net/ethernet/sfc/falcon/farch.c u32 ef4_farch_fpga_ver(struct ef4_nic *efx) efx 1664 drivers/net/ethernet/sfc/falcon/farch.c ef4_reado(efx, &altera_build, FR_AZ_ALTERA_BUILD); efx 1668 drivers/net/ethernet/sfc/falcon/farch.c void ef4_farch_init_common(struct ef4_nic *efx) efx 1673 drivers/net/ethernet/sfc/falcon/farch.c EF4_POPULATE_OWORD_1(temp, FRF_AZ_SRM_TX_DC_BASE_ADR, efx->tx_dc_base); efx 1674 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &temp, FR_AZ_SRM_TX_DC_CFG); efx 1675 drivers/net/ethernet/sfc/falcon/farch.c EF4_POPULATE_OWORD_1(temp, FRF_AZ_SRM_RX_DC_BASE_ADR, efx->rx_dc_base); efx 1676 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &temp, FR_AZ_SRM_RX_DC_CFG); efx 1681 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &temp, FR_AZ_TX_DC_CFG); efx 1688 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &temp, FR_AZ_RX_DC_CFG); efx 1690 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &temp, FR_AZ_RX_DC_PF_WM); efx 1695 drivers/net/ethernet/sfc/falcon/farch.c EF4_INT_MODE_USE_MSI(efx), efx 1696 drivers/net/ethernet/sfc/falcon/farch.c FRF_AZ_INT_ADR_KER, efx->irq_status.dma_addr); efx 1697 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &temp, FR_AZ_INT_ADR_KER); efx 1700 drivers/net/ethernet/sfc/falcon/farch.c efx->irq_level = 0; efx 1713 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &temp, FR_AZ_FATAL_INTR_KER); efx 1718 drivers/net/ethernet/sfc/falcon/farch.c ef4_reado(efx, &temp, FR_AZ_TX_RESERVED); efx 1731 drivers/net/ethernet/sfc/falcon/farch.c if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) efx 1733 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &temp, FR_AZ_TX_RESERVED); efx 1735 drivers/net/ethernet/sfc/falcon/farch.c if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) { efx 1745 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &temp, FR_BZ_TX_PACE); efx 1823 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_table_clear_entry(struct ef4_nic *efx, efx 1870 drivers/net/ethernet/sfc/falcon/farch.c static void ef4_farch_filter_push_rx_config(struct ef4_nic *efx) efx 1872 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 1876 drivers/net/ethernet/sfc/falcon/farch.c ef4_reado(efx, &filter_ctl, FR_BZ_RX_FILTER_CTL); efx 1930 drivers/net/ethernet/sfc/falcon/farch.c } else if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) { efx 1938 drivers/net/ethernet/sfc/falcon/farch.c efx->rx_scatter); efx 1941 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &filter_ctl, FR_BZ_RX_FILTER_CTL); efx 1944 drivers/net/ethernet/sfc/falcon/farch.c static void ef4_farch_filter_push_tx_limits(struct ef4_nic *efx) efx 1946 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 1950 drivers/net/ethernet/sfc/falcon/farch.c ef4_reado(efx, &tx_cfg, FR_AZ_TX_CFG); efx 1964 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &tx_cfg, FR_AZ_TX_CFG); efx 2155 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_init_rx_auto(struct ef4_nic *efx, efx 2163 drivers/net/ethernet/sfc/falcon/farch.c (ef4_rss_enabled(efx) ? EF4_FILTER_FLAG_RX_RSS : 0) | efx 2164 drivers/net/ethernet/sfc/falcon/farch.c (efx->rx_scatter ? EF4_FILTER_FLAG_RX_SCATTER : 0)); efx 2307 drivers/net/ethernet/sfc/falcon/farch.c u32 ef4_farch_filter_get_rx_id_limit(struct ef4_nic *efx) efx 2309 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 2323 drivers/net/ethernet/sfc/falcon/farch.c s32 ef4_farch_filter_insert(struct ef4_nic *efx, efx 2327 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 2343 drivers/net/ethernet/sfc/falcon/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 2355 drivers/net/ethernet/sfc/falcon/farch.c spin_lock_bh(&efx->filter_lock); efx 2385 drivers/net/ethernet/sfc/falcon/farch.c spin_lock_bh(&efx->filter_lock); efx 2444 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_push_rx_config(efx); efx 2449 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_push_tx_limits(efx); efx 2451 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_push_rx_config(efx); efx 2454 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &filter, efx 2461 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_table_clear_entry(efx, table, efx 2465 drivers/net/ethernet/sfc/falcon/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 2471 drivers/net/ethernet/sfc/falcon/farch.c spin_unlock_bh(&efx->filter_lock); efx 2476 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_table_clear_entry(struct ef4_nic *efx, efx 2489 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &filter, table->offset + table->step * filter_idx); efx 2500 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_push_tx_limits(efx); efx 2502 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_push_rx_config(efx); efx 2506 drivers/net/ethernet/sfc/falcon/farch.c static int ef4_farch_filter_remove(struct ef4_nic *efx, efx 2518 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_init_rx_auto(efx, spec); efx 2519 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_push_rx_config(efx); efx 2521 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_table_clear_entry(efx, table, filter_idx); efx 2527 drivers/net/ethernet/sfc/falcon/farch.c int ef4_farch_filter_remove_safe(struct ef4_nic *efx, efx 2531 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 2548 drivers/net/ethernet/sfc/falcon/farch.c spin_lock_bh(&efx->filter_lock); efx 2549 drivers/net/ethernet/sfc/falcon/farch.c rc = ef4_farch_filter_remove(efx, table, filter_idx, priority); efx 2550 drivers/net/ethernet/sfc/falcon/farch.c spin_unlock_bh(&efx->filter_lock); efx 2555 drivers/net/ethernet/sfc/falcon/farch.c int ef4_farch_filter_get_safe(struct ef4_nic *efx, efx 2559 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 2576 drivers/net/ethernet/sfc/falcon/farch.c spin_lock_bh(&efx->filter_lock); efx 2586 drivers/net/ethernet/sfc/falcon/farch.c spin_unlock_bh(&efx->filter_lock); efx 2592 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_table_clear(struct ef4_nic *efx, efx 2596 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 2600 drivers/net/ethernet/sfc/falcon/farch.c spin_lock_bh(&efx->filter_lock); efx 2603 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_remove(efx, table, efx 2606 drivers/net/ethernet/sfc/falcon/farch.c spin_unlock_bh(&efx->filter_lock); efx 2609 drivers/net/ethernet/sfc/falcon/farch.c int ef4_farch_filter_clear_rx(struct ef4_nic *efx, efx 2612 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_table_clear(efx, EF4_FARCH_FILTER_TABLE_RX_IP, efx 2614 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_table_clear(efx, EF4_FARCH_FILTER_TABLE_RX_MAC, efx 2616 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_table_clear(efx, EF4_FARCH_FILTER_TABLE_RX_DEF, efx 2621 drivers/net/ethernet/sfc/falcon/farch.c u32 ef4_farch_filter_count_rx_used(struct ef4_nic *efx, efx 2624 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 2630 drivers/net/ethernet/sfc/falcon/farch.c spin_lock_bh(&efx->filter_lock); efx 2643 drivers/net/ethernet/sfc/falcon/farch.c spin_unlock_bh(&efx->filter_lock); efx 2648 drivers/net/ethernet/sfc/falcon/farch.c s32 ef4_farch_filter_get_rx_ids(struct ef4_nic *efx, efx 2652 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 2658 drivers/net/ethernet/sfc/falcon/farch.c spin_lock_bh(&efx->filter_lock); efx 2677 drivers/net/ethernet/sfc/falcon/farch.c spin_unlock_bh(&efx->filter_lock); efx 2683 drivers/net/ethernet/sfc/falcon/farch.c void ef4_farch_filter_table_restore(struct ef4_nic *efx) efx 2685 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 2691 drivers/net/ethernet/sfc/falcon/farch.c spin_lock_bh(&efx->filter_lock); efx 2704 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &filter, efx 2709 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_push_rx_config(efx); efx 2710 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_push_tx_limits(efx); efx 2712 drivers/net/ethernet/sfc/falcon/farch.c spin_unlock_bh(&efx->filter_lock); efx 2715 drivers/net/ethernet/sfc/falcon/farch.c void ef4_farch_filter_table_remove(struct ef4_nic *efx) efx 2717 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 2727 drivers/net/ethernet/sfc/falcon/farch.c int ef4_farch_filter_table_probe(struct ef4_nic *efx) efx 2736 drivers/net/ethernet/sfc/falcon/farch.c efx->filter_state = state; efx 2738 drivers/net/ethernet/sfc/falcon/farch.c if (ef4_nic_rev(efx) >= EF4_REV_FALCON_B0) { efx 2770 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_init_rx_auto(efx, spec); efx 2775 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_push_rx_config(efx); efx 2780 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_table_remove(efx); efx 2785 drivers/net/ethernet/sfc/falcon/farch.c void ef4_farch_filter_update_rx_scatter(struct ef4_nic *efx) efx 2787 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 2793 drivers/net/ethernet/sfc/falcon/farch.c spin_lock_bh(&efx->filter_lock); efx 2803 drivers/net/ethernet/sfc/falcon/farch.c efx->n_rx_channels) efx 2806 drivers/net/ethernet/sfc/falcon/farch.c if (efx->rx_scatter) efx 2818 drivers/net/ethernet/sfc/falcon/farch.c ef4_writeo(efx, &filter, efx 2823 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_push_rx_config(efx); efx 2825 drivers/net/ethernet/sfc/falcon/farch.c spin_unlock_bh(&efx->filter_lock); efx 2830 drivers/net/ethernet/sfc/falcon/farch.c s32 ef4_farch_filter_rfs_insert(struct ef4_nic *efx, efx 2833 drivers/net/ethernet/sfc/falcon/farch.c return ef4_farch_filter_insert(efx, gen_spec, true); efx 2836 drivers/net/ethernet/sfc/falcon/farch.c bool ef4_farch_filter_rfs_expire_one(struct ef4_nic *efx, u32 flow_id, efx 2839 drivers/net/ethernet/sfc/falcon/farch.c struct ef4_farch_filter_state *state = efx->filter_state; efx 2845 drivers/net/ethernet/sfc/falcon/farch.c rps_may_expire_flow(efx->net_dev, table->spec[index].dmaq_id, efx 2847 drivers/net/ethernet/sfc/falcon/farch.c ef4_farch_filter_table_clear_entry(efx, table, index); efx 2856 drivers/net/ethernet/sfc/falcon/farch.c void ef4_farch_filter_sync_rx_mode(struct ef4_nic *efx) efx 2858 drivers/net/ethernet/sfc/falcon/farch.c struct net_device *net_dev = efx->net_dev; efx 2860 drivers/net/ethernet/sfc/falcon/farch.c union ef4_multicast_hash *mc_hash = &efx->multicast_hash; efx 2864 drivers/net/ethernet/sfc/falcon/farch.c if (!ef4_dev_registered(efx)) efx 2869 drivers/net/ethernet/sfc/falcon/farch.c efx->unicast_filter = !(net_dev->flags & IFF_PROMISC); efx 67 drivers/net/ethernet/sfc/falcon/io.h static inline void _ef4_writeq(struct ef4_nic *efx, __le64 value, efx 70 drivers/net/ethernet/sfc/falcon/io.h __raw_writeq((__force u64)value, efx->membase + reg); efx 72 drivers/net/ethernet/sfc/falcon/io.h static inline __le64 _ef4_readq(struct ef4_nic *efx, unsigned int reg) efx 74 drivers/net/ethernet/sfc/falcon/io.h return (__force __le64)__raw_readq(efx->membase + reg); efx 78 drivers/net/ethernet/sfc/falcon/io.h static inline void _ef4_writed(struct ef4_nic *efx, __le32 value, efx 81 drivers/net/ethernet/sfc/falcon/io.h __raw_writel((__force u32)value, efx->membase + reg); efx 83 drivers/net/ethernet/sfc/falcon/io.h static inline __le32 _ef4_readd(struct ef4_nic *efx, unsigned int reg) efx 85 drivers/net/ethernet/sfc/falcon/io.h return (__force __le32)__raw_readl(efx->membase + reg); efx 89 drivers/net/ethernet/sfc/falcon/io.h static inline void ef4_writeo(struct ef4_nic *efx, const ef4_oword_t *value, efx 94 drivers/net/ethernet/sfc/falcon/io.h netif_vdbg(efx, hw, efx->net_dev, efx 98 drivers/net/ethernet/sfc/falcon/io.h spin_lock_irqsave(&efx->biu_lock, flags); efx 100 drivers/net/ethernet/sfc/falcon/io.h _ef4_writeq(efx, value->u64[0], reg + 0); efx 101 drivers/net/ethernet/sfc/falcon/io.h _ef4_writeq(efx, value->u64[1], reg + 8); efx 103 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed(efx, value->u32[0], reg + 0); efx 104 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed(efx, value->u32[1], reg + 4); efx 105 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed(efx, value->u32[2], reg + 8); efx 106 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed(efx, value->u32[3], reg + 12); efx 108 drivers/net/ethernet/sfc/falcon/io.h spin_unlock_irqrestore(&efx->biu_lock, flags); efx 112 drivers/net/ethernet/sfc/falcon/io.h static inline void ef4_sram_writeq(struct ef4_nic *efx, void __iomem *membase, efx 118 drivers/net/ethernet/sfc/falcon/io.h netif_vdbg(efx, hw, efx->net_dev, efx 122 drivers/net/ethernet/sfc/falcon/io.h spin_lock_irqsave(&efx->biu_lock, flags); efx 129 drivers/net/ethernet/sfc/falcon/io.h spin_unlock_irqrestore(&efx->biu_lock, flags); efx 133 drivers/net/ethernet/sfc/falcon/io.h static inline void ef4_writed(struct ef4_nic *efx, const ef4_dword_t *value, efx 136 drivers/net/ethernet/sfc/falcon/io.h netif_vdbg(efx, hw, efx->net_dev, efx 141 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed(efx, value->u32[0], reg); efx 145 drivers/net/ethernet/sfc/falcon/io.h static inline void ef4_reado(struct ef4_nic *efx, ef4_oword_t *value, efx 150 drivers/net/ethernet/sfc/falcon/io.h spin_lock_irqsave(&efx->biu_lock, flags); efx 151 drivers/net/ethernet/sfc/falcon/io.h value->u32[0] = _ef4_readd(efx, reg + 0); efx 152 drivers/net/ethernet/sfc/falcon/io.h value->u32[1] = _ef4_readd(efx, reg + 4); efx 153 drivers/net/ethernet/sfc/falcon/io.h value->u32[2] = _ef4_readd(efx, reg + 8); efx 154 drivers/net/ethernet/sfc/falcon/io.h value->u32[3] = _ef4_readd(efx, reg + 12); efx 155 drivers/net/ethernet/sfc/falcon/io.h spin_unlock_irqrestore(&efx->biu_lock, flags); efx 157 drivers/net/ethernet/sfc/falcon/io.h netif_vdbg(efx, hw, efx->net_dev, efx 163 drivers/net/ethernet/sfc/falcon/io.h static inline void ef4_sram_readq(struct ef4_nic *efx, void __iomem *membase, efx 169 drivers/net/ethernet/sfc/falcon/io.h spin_lock_irqsave(&efx->biu_lock, flags); efx 176 drivers/net/ethernet/sfc/falcon/io.h spin_unlock_irqrestore(&efx->biu_lock, flags); efx 178 drivers/net/ethernet/sfc/falcon/io.h netif_vdbg(efx, hw, efx->net_dev, efx 184 drivers/net/ethernet/sfc/falcon/io.h static inline void ef4_readd(struct ef4_nic *efx, ef4_dword_t *value, efx 187 drivers/net/ethernet/sfc/falcon/io.h value->u32[0] = _ef4_readd(efx, reg); efx 188 drivers/net/ethernet/sfc/falcon/io.h netif_vdbg(efx, hw, efx->net_dev, efx 195 drivers/net/ethernet/sfc/falcon/io.h ef4_writeo_table(struct ef4_nic *efx, const ef4_oword_t *value, efx 198 drivers/net/ethernet/sfc/falcon/io.h ef4_writeo(efx, value, reg + index * sizeof(ef4_oword_t)); efx 202 drivers/net/ethernet/sfc/falcon/io.h static inline void ef4_reado_table(struct ef4_nic *efx, ef4_oword_t *value, efx 205 drivers/net/ethernet/sfc/falcon/io.h ef4_reado(efx, value, reg + index * sizeof(ef4_oword_t)); efx 216 drivers/net/ethernet/sfc/falcon/io.h static inline void _ef4_writeo_page(struct ef4_nic *efx, ef4_oword_t *value, efx 221 drivers/net/ethernet/sfc/falcon/io.h netif_vdbg(efx, hw, efx->net_dev, efx 226 drivers/net/ethernet/sfc/falcon/io.h _ef4_writeq(efx, value->u64[0], reg + 0); efx 227 drivers/net/ethernet/sfc/falcon/io.h _ef4_writeq(efx, value->u64[1], reg + 8); efx 229 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed(efx, value->u32[0], reg + 0); efx 230 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed(efx, value->u32[1], reg + 4); efx 231 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed(efx, value->u32[2], reg + 8); efx 232 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed(efx, value->u32[3], reg + 12); efx 235 drivers/net/ethernet/sfc/falcon/io.h #define ef4_writeo_page(efx, value, reg, page) \ efx 236 drivers/net/ethernet/sfc/falcon/io.h _ef4_writeo_page(efx, value, \ efx 245 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed_page(struct ef4_nic *efx, const ef4_dword_t *value, efx 248 drivers/net/ethernet/sfc/falcon/io.h ef4_writed(efx, value, EF4_PAGED_REG(page, reg)); efx 250 drivers/net/ethernet/sfc/falcon/io.h #define ef4_writed_page(efx, value, reg, page) \ efx 251 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed_page(efx, value, \ efx 265 drivers/net/ethernet/sfc/falcon/io.h static inline void _ef4_writed_page_locked(struct ef4_nic *efx, efx 273 drivers/net/ethernet/sfc/falcon/io.h spin_lock_irqsave(&efx->biu_lock, flags); efx 274 drivers/net/ethernet/sfc/falcon/io.h ef4_writed(efx, value, EF4_PAGED_REG(page, reg)); efx 275 drivers/net/ethernet/sfc/falcon/io.h spin_unlock_irqrestore(&efx->biu_lock, flags); efx 277 drivers/net/ethernet/sfc/falcon/io.h ef4_writed(efx, value, EF4_PAGED_REG(page, reg)); efx 280 drivers/net/ethernet/sfc/falcon/io.h #define ef4_writed_page_locked(efx, value, reg, page) \ efx 281 drivers/net/ethernet/sfc/falcon/io.h _ef4_writed_page_locked(efx, value, \ efx 51 drivers/net/ethernet/sfc/falcon/mdio_10g.c static int ef4_mdio_check_mmd(struct ef4_nic *efx, int mmd) efx 57 drivers/net/ethernet/sfc/falcon/mdio_10g.c status = ef4_mdio_read(efx, mmd, MDIO_STAT2); efx 59 drivers/net/ethernet/sfc/falcon/mdio_10g.c netif_err(efx, hw, efx->net_dev, efx 72 drivers/net/ethernet/sfc/falcon/mdio_10g.c int ef4_mdio_wait_reset_mmds(struct ef4_nic *efx, unsigned int mmd_mask) efx 86 drivers/net/ethernet/sfc/falcon/mdio_10g.c stat = ef4_mdio_read(efx, mmd, MDIO_CTRL1); efx 88 drivers/net/ethernet/sfc/falcon/mdio_10g.c netif_err(efx, hw, efx->net_dev, efx 105 drivers/net/ethernet/sfc/falcon/mdio_10g.c netif_err(efx, hw, efx->net_dev, efx 113 drivers/net/ethernet/sfc/falcon/mdio_10g.c int ef4_mdio_check_mmds(struct ef4_nic *efx, unsigned int mmd_mask) efx 125 drivers/net/ethernet/sfc/falcon/mdio_10g.c devs1 = ef4_mdio_read(efx, probe_mmd, MDIO_DEVS1); efx 126 drivers/net/ethernet/sfc/falcon/mdio_10g.c devs2 = ef4_mdio_read(efx, probe_mmd, MDIO_DEVS2); efx 128 drivers/net/ethernet/sfc/falcon/mdio_10g.c netif_err(efx, hw, efx->net_dev, efx 134 drivers/net/ethernet/sfc/falcon/mdio_10g.c netif_err(efx, hw, efx->net_dev, efx 139 drivers/net/ethernet/sfc/falcon/mdio_10g.c netif_vdbg(efx, hw, efx->net_dev, "Devices present: %x\n", devices); efx 143 drivers/net/ethernet/sfc/falcon/mdio_10g.c if ((mmd_mask & 1) && ef4_mdio_check_mmd(efx, mmd)) efx 152 drivers/net/ethernet/sfc/falcon/mdio_10g.c bool ef4_mdio_links_ok(struct ef4_nic *efx, unsigned int mmd_mask) efx 156 drivers/net/ethernet/sfc/falcon/mdio_10g.c if (LOOPBACK_INTERNAL(efx)) efx 158 drivers/net/ethernet/sfc/falcon/mdio_10g.c else if (LOOPBACK_MASK(efx) & LOOPBACKS_WS) efx 160 drivers/net/ethernet/sfc/falcon/mdio_10g.c else if (ef4_phy_mode_disabled(efx->phy_mode)) efx 162 drivers/net/ethernet/sfc/falcon/mdio_10g.c else if (efx->loopback_mode == LOOPBACK_PHYXS) efx 167 drivers/net/ethernet/sfc/falcon/mdio_10g.c else if (efx->loopback_mode == LOOPBACK_PCS) efx 171 drivers/net/ethernet/sfc/falcon/mdio_10g.c else if (efx->loopback_mode == LOOPBACK_PMAPMD) efx 175 drivers/net/ethernet/sfc/falcon/mdio_10g.c return mdio45_links_ok(&efx->mdio, mmd_mask); efx 178 drivers/net/ethernet/sfc/falcon/mdio_10g.c void ef4_mdio_transmit_disable(struct ef4_nic *efx) efx 180 drivers/net/ethernet/sfc/falcon/mdio_10g.c ef4_mdio_set_flag(efx, MDIO_MMD_PMAPMD, efx 182 drivers/net/ethernet/sfc/falcon/mdio_10g.c efx->phy_mode & PHY_MODE_TX_DISABLED); efx 185 drivers/net/ethernet/sfc/falcon/mdio_10g.c void ef4_mdio_phy_reconfigure(struct ef4_nic *efx) efx 187 drivers/net/ethernet/sfc/falcon/mdio_10g.c ef4_mdio_set_flag(efx, MDIO_MMD_PMAPMD, efx 189 drivers/net/ethernet/sfc/falcon/mdio_10g.c efx->loopback_mode == LOOPBACK_PMAPMD); efx 190 drivers/net/ethernet/sfc/falcon/mdio_10g.c ef4_mdio_set_flag(efx, MDIO_MMD_PCS, efx 192 drivers/net/ethernet/sfc/falcon/mdio_10g.c efx->loopback_mode == LOOPBACK_PCS); efx 193 drivers/net/ethernet/sfc/falcon/mdio_10g.c ef4_mdio_set_flag(efx, MDIO_MMD_PHYXS, efx 195 drivers/net/ethernet/sfc/falcon/mdio_10g.c efx->loopback_mode == LOOPBACK_PHYXS_WS); efx 198 drivers/net/ethernet/sfc/falcon/mdio_10g.c static void ef4_mdio_set_mmd_lpower(struct ef4_nic *efx, efx 201 drivers/net/ethernet/sfc/falcon/mdio_10g.c int stat = ef4_mdio_read(efx, mmd, MDIO_STAT1); efx 203 drivers/net/ethernet/sfc/falcon/mdio_10g.c netif_vdbg(efx, drv, efx->net_dev, "Setting low power mode for MMD %d to %d\n", efx 207 drivers/net/ethernet/sfc/falcon/mdio_10g.c ef4_mdio_set_flag(efx, mmd, MDIO_CTRL1, efx 212 drivers/net/ethernet/sfc/falcon/mdio_10g.c void ef4_mdio_set_mmds_lpower(struct ef4_nic *efx, efx 219 drivers/net/ethernet/sfc/falcon/mdio_10g.c ef4_mdio_set_mmd_lpower(efx, low_power, mmd); efx 230 drivers/net/ethernet/sfc/falcon/mdio_10g.c int ef4_mdio_set_link_ksettings(struct ef4_nic *efx, efx 239 drivers/net/ethernet/sfc/falcon/mdio_10g.c efx->phy_op->get_link_ksettings(efx, &prev); efx 264 drivers/net/ethernet/sfc/falcon/mdio_10g.c ef4_link_set_advertising(efx, advertising | ADVERTISED_Autoneg); efx 265 drivers/net/ethernet/sfc/falcon/mdio_10g.c ef4_mdio_an_reconfigure(efx); efx 273 drivers/net/ethernet/sfc/falcon/mdio_10g.c void ef4_mdio_an_reconfigure(struct ef4_nic *efx) efx 277 drivers/net/ethernet/sfc/falcon/mdio_10g.c WARN_ON(!(efx->mdio.mmds & MDIO_DEVS_AN)); efx 281 drivers/net/ethernet/sfc/falcon/mdio_10g.c if (efx->link_advertising & ADVERTISED_Pause) efx 283 drivers/net/ethernet/sfc/falcon/mdio_10g.c if (efx->link_advertising & ADVERTISED_Asym_Pause) efx 285 drivers/net/ethernet/sfc/falcon/mdio_10g.c ef4_mdio_write(efx, MDIO_MMD_AN, MDIO_AN_ADVERTISE, reg); efx 288 drivers/net/ethernet/sfc/falcon/mdio_10g.c efx->phy_op->set_npage_adv(efx, efx->link_advertising); efx 291 drivers/net/ethernet/sfc/falcon/mdio_10g.c reg = ef4_mdio_read(efx, MDIO_MMD_AN, MDIO_CTRL1); efx 293 drivers/net/ethernet/sfc/falcon/mdio_10g.c ef4_mdio_write(efx, MDIO_MMD_AN, MDIO_CTRL1, reg); efx 296 drivers/net/ethernet/sfc/falcon/mdio_10g.c u8 ef4_mdio_get_pause(struct ef4_nic *efx) efx 300 drivers/net/ethernet/sfc/falcon/mdio_10g.c if (!(efx->wanted_fc & EF4_FC_AUTO)) efx 301 drivers/net/ethernet/sfc/falcon/mdio_10g.c return efx->wanted_fc; efx 303 drivers/net/ethernet/sfc/falcon/mdio_10g.c WARN_ON(!(efx->mdio.mmds & MDIO_DEVS_AN)); efx 306 drivers/net/ethernet/sfc/falcon/mdio_10g.c mii_advertise_flowctrl(efx->wanted_fc), efx 307 drivers/net/ethernet/sfc/falcon/mdio_10g.c ef4_mdio_read(efx, MDIO_MMD_AN, MDIO_AN_LPA)); efx 310 drivers/net/ethernet/sfc/falcon/mdio_10g.c int ef4_mdio_test_alive(struct ef4_nic *efx) efx 313 drivers/net/ethernet/sfc/falcon/mdio_10g.c int devad = __ffs(efx->mdio.mmds); efx 316 drivers/net/ethernet/sfc/falcon/mdio_10g.c mutex_lock(&efx->mac_lock); efx 318 drivers/net/ethernet/sfc/falcon/mdio_10g.c physid1 = ef4_mdio_read(efx, devad, MDIO_DEVID1); efx 319 drivers/net/ethernet/sfc/falcon/mdio_10g.c physid2 = ef4_mdio_read(efx, devad, MDIO_DEVID2); efx 323 drivers/net/ethernet/sfc/falcon/mdio_10g.c netif_err(efx, hw, efx->net_dev, efx 324 drivers/net/ethernet/sfc/falcon/mdio_10g.c "no MDIO PHY present with ID %d\n", efx->mdio.prtad); efx 327 drivers/net/ethernet/sfc/falcon/mdio_10g.c rc = ef4_mdio_check_mmds(efx, efx->mdio.mmds); efx 330 drivers/net/ethernet/sfc/falcon/mdio_10g.c mutex_unlock(&efx->mac_lock); efx 22 drivers/net/ethernet/sfc/falcon/mdio_10g.h static inline int ef4_mdio_read(struct ef4_nic *efx, int devad, int addr) efx 24 drivers/net/ethernet/sfc/falcon/mdio_10g.h return efx->mdio.mdio_read(efx->net_dev, efx->mdio.prtad, devad, addr); efx 28 drivers/net/ethernet/sfc/falcon/mdio_10g.h ef4_mdio_write(struct ef4_nic *efx, int devad, int addr, int value) efx 30 drivers/net/ethernet/sfc/falcon/mdio_10g.h efx->mdio.mdio_write(efx->net_dev, efx->mdio.prtad, devad, addr, value); efx 33 drivers/net/ethernet/sfc/falcon/mdio_10g.h static inline u32 ef4_mdio_read_id(struct ef4_nic *efx, int mmd) efx 35 drivers/net/ethernet/sfc/falcon/mdio_10g.h u16 id_low = ef4_mdio_read(efx, mmd, MDIO_DEVID2); efx 36 drivers/net/ethernet/sfc/falcon/mdio_10g.h u16 id_hi = ef4_mdio_read(efx, mmd, MDIO_DEVID1); efx 40 drivers/net/ethernet/sfc/falcon/mdio_10g.h static inline bool ef4_mdio_phyxgxs_lane_sync(struct ef4_nic *efx) efx 46 drivers/net/ethernet/sfc/falcon/mdio_10g.h lane_status = ef4_mdio_read(efx, MDIO_MMD_PHYXS, efx 51 drivers/net/ethernet/sfc/falcon/mdio_10g.h netif_dbg(efx, hw, efx->net_dev, "XGXS lane status: %x\n", efx 64 drivers/net/ethernet/sfc/falcon/mdio_10g.h int ef4_mdio_reset_mmd(struct ef4_nic *efx, int mmd, int spins, int spintime); efx 67 drivers/net/ethernet/sfc/falcon/mdio_10g.h int ef4_mdio_check_mmds(struct ef4_nic *efx, unsigned int mmd_mask); efx 70 drivers/net/ethernet/sfc/falcon/mdio_10g.h bool ef4_mdio_links_ok(struct ef4_nic *efx, unsigned int mmd_mask); efx 73 drivers/net/ethernet/sfc/falcon/mdio_10g.h void ef4_mdio_transmit_disable(struct ef4_nic *efx); efx 76 drivers/net/ethernet/sfc/falcon/mdio_10g.h void ef4_mdio_phy_reconfigure(struct ef4_nic *efx); efx 79 drivers/net/ethernet/sfc/falcon/mdio_10g.h void ef4_mdio_set_mmds_lpower(struct ef4_nic *efx, int low_power, efx 83 drivers/net/ethernet/sfc/falcon/mdio_10g.h int ef4_mdio_set_link_ksettings(struct ef4_nic *efx, efx 87 drivers/net/ethernet/sfc/falcon/mdio_10g.h void ef4_mdio_an_reconfigure(struct ef4_nic *efx); efx 92 drivers/net/ethernet/sfc/falcon/mdio_10g.h u8 ef4_mdio_get_pause(struct ef4_nic *efx); efx 95 drivers/net/ethernet/sfc/falcon/mdio_10g.h int ef4_mdio_wait_reset_mmds(struct ef4_nic *efx, unsigned int mmd_mask); efx 99 drivers/net/ethernet/sfc/falcon/mdio_10g.h ef4_mdio_set_flag(struct ef4_nic *efx, int devad, int addr, efx 102 drivers/net/ethernet/sfc/falcon/mdio_10g.h mdio_set_flag(&efx->mdio, efx->mdio.prtad, devad, addr, mask, state); efx 106 drivers/net/ethernet/sfc/falcon/mdio_10g.h int ef4_mdio_test_alive(struct ef4_nic *efx); efx 23 drivers/net/ethernet/sfc/falcon/mtd.c struct ef4_nic *efx = mtd->priv; efx 25 drivers/net/ethernet/sfc/falcon/mtd.c return efx->type->mtd_erase(mtd, erase->addr, erase->len); efx 31 drivers/net/ethernet/sfc/falcon/mtd.c struct ef4_nic *efx = mtd->priv; efx 34 drivers/net/ethernet/sfc/falcon/mtd.c rc = efx->type->mtd_sync(mtd); efx 54 drivers/net/ethernet/sfc/falcon/mtd.c int ef4_mtd_add(struct ef4_nic *efx, struct ef4_mtd_partition *parts, efx 67 drivers/net/ethernet/sfc/falcon/mtd.c part->mtd.priv = efx; efx 70 drivers/net/ethernet/sfc/falcon/mtd.c part->mtd._read = efx->type->mtd_read; efx 71 drivers/net/ethernet/sfc/falcon/mtd.c part->mtd._write = efx->type->mtd_write; efx 74 drivers/net/ethernet/sfc/falcon/mtd.c efx->type->mtd_rename(part); efx 80 drivers/net/ethernet/sfc/falcon/mtd.c list_add_tail(&part->node, &efx->mtd_list); efx 95 drivers/net/ethernet/sfc/falcon/mtd.c void ef4_mtd_remove(struct ef4_nic *efx) efx 99 drivers/net/ethernet/sfc/falcon/mtd.c WARN_ON(ef4_dev_registered(efx)); efx 101 drivers/net/ethernet/sfc/falcon/mtd.c if (list_empty(&efx->mtd_list)) efx 104 drivers/net/ethernet/sfc/falcon/mtd.c parts = list_first_entry(&efx->mtd_list, struct ef4_mtd_partition, efx 107 drivers/net/ethernet/sfc/falcon/mtd.c list_for_each_entry_safe(part, next, &efx->mtd_list, node) efx 113 drivers/net/ethernet/sfc/falcon/mtd.c void ef4_mtd_rename(struct ef4_nic *efx) efx 119 drivers/net/ethernet/sfc/falcon/mtd.c list_for_each_entry(part, &efx->mtd_list, node) efx 120 drivers/net/ethernet/sfc/falcon/mtd.c efx->type->mtd_rename(part); efx 214 drivers/net/ethernet/sfc/falcon/net_driver.h struct ef4_nic *efx ____cacheline_aligned_in_smp; efx 329 drivers/net/ethernet/sfc/falcon/net_driver.h struct ef4_nic *efx; efx 405 drivers/net/ethernet/sfc/falcon/net_driver.h struct ef4_nic *efx; efx 458 drivers/net/ethernet/sfc/falcon/net_driver.h struct ef4_nic *efx; efx 497 drivers/net/ethernet/sfc/falcon/net_driver.h #define LOOPBACK_MODE(efx) \ efx 498 drivers/net/ethernet/sfc/falcon/net_driver.h STRING_TABLE_LOOKUP((efx)->loopback_mode, ef4_loopback_mode) efx 569 drivers/net/ethernet/sfc/falcon/net_driver.h int (*probe) (struct ef4_nic *efx); efx 570 drivers/net/ethernet/sfc/falcon/net_driver.h int (*init) (struct ef4_nic *efx); efx 571 drivers/net/ethernet/sfc/falcon/net_driver.h void (*fini) (struct ef4_nic *efx); efx 572 drivers/net/ethernet/sfc/falcon/net_driver.h void (*remove) (struct ef4_nic *efx); efx 573 drivers/net/ethernet/sfc/falcon/net_driver.h int (*reconfigure) (struct ef4_nic *efx); efx 574 drivers/net/ethernet/sfc/falcon/net_driver.h bool (*poll) (struct ef4_nic *efx); efx 575 drivers/net/ethernet/sfc/falcon/net_driver.h void (*get_link_ksettings)(struct ef4_nic *efx, efx 577 drivers/net/ethernet/sfc/falcon/net_driver.h int (*set_link_ksettings)(struct ef4_nic *efx, efx 579 drivers/net/ethernet/sfc/falcon/net_driver.h void (*set_npage_adv) (struct ef4_nic *efx, u32); efx 580 drivers/net/ethernet/sfc/falcon/net_driver.h int (*test_alive) (struct ef4_nic *efx); efx 581 drivers/net/ethernet/sfc/falcon/net_driver.h const char *(*test_name) (struct ef4_nic *efx, unsigned int index); efx 582 drivers/net/ethernet/sfc/falcon/net_driver.h int (*run_tests) (struct ef4_nic *efx, int *results, unsigned flags); efx 583 drivers/net/ethernet/sfc/falcon/net_driver.h int (*get_module_eeprom) (struct ef4_nic *efx, efx 586 drivers/net/ethernet/sfc/falcon/net_driver.h int (*get_module_info) (struct ef4_nic *efx, efx 904 drivers/net/ethernet/sfc/falcon/net_driver.h static inline int ef4_dev_registered(struct ef4_nic *efx) efx 906 drivers/net/ethernet/sfc/falcon/net_driver.h return efx->net_dev->reg_state == NETREG_REGISTERED; efx 909 drivers/net/ethernet/sfc/falcon/net_driver.h static inline unsigned int ef4_port_num(struct ef4_nic *efx) efx 911 drivers/net/ethernet/sfc/falcon/net_driver.h return efx->port_num; efx 1042 drivers/net/ethernet/sfc/falcon/net_driver.h unsigned int (*mem_map_size)(struct ef4_nic *efx); efx 1043 drivers/net/ethernet/sfc/falcon/net_driver.h int (*probe)(struct ef4_nic *efx); efx 1044 drivers/net/ethernet/sfc/falcon/net_driver.h void (*remove)(struct ef4_nic *efx); efx 1045 drivers/net/ethernet/sfc/falcon/net_driver.h int (*init)(struct ef4_nic *efx); efx 1046 drivers/net/ethernet/sfc/falcon/net_driver.h int (*dimension_resources)(struct ef4_nic *efx); efx 1047 drivers/net/ethernet/sfc/falcon/net_driver.h void (*fini)(struct ef4_nic *efx); efx 1048 drivers/net/ethernet/sfc/falcon/net_driver.h void (*monitor)(struct ef4_nic *efx); efx 1051 drivers/net/ethernet/sfc/falcon/net_driver.h int (*reset)(struct ef4_nic *efx, enum reset_type method); efx 1052 drivers/net/ethernet/sfc/falcon/net_driver.h int (*probe_port)(struct ef4_nic *efx); efx 1053 drivers/net/ethernet/sfc/falcon/net_driver.h void (*remove_port)(struct ef4_nic *efx); efx 1055 drivers/net/ethernet/sfc/falcon/net_driver.h int (*fini_dmaq)(struct ef4_nic *efx); efx 1056 drivers/net/ethernet/sfc/falcon/net_driver.h void (*prepare_flush)(struct ef4_nic *efx); efx 1057 drivers/net/ethernet/sfc/falcon/net_driver.h void (*finish_flush)(struct ef4_nic *efx); efx 1058 drivers/net/ethernet/sfc/falcon/net_driver.h void (*prepare_flr)(struct ef4_nic *efx); efx 1059 drivers/net/ethernet/sfc/falcon/net_driver.h void (*finish_flr)(struct ef4_nic *efx); efx 1060 drivers/net/ethernet/sfc/falcon/net_driver.h size_t (*describe_stats)(struct ef4_nic *efx, u8 *names); efx 1061 drivers/net/ethernet/sfc/falcon/net_driver.h size_t (*update_stats)(struct ef4_nic *efx, u64 *full_stats, efx 1063 drivers/net/ethernet/sfc/falcon/net_driver.h void (*start_stats)(struct ef4_nic *efx); efx 1064 drivers/net/ethernet/sfc/falcon/net_driver.h void (*pull_stats)(struct ef4_nic *efx); efx 1065 drivers/net/ethernet/sfc/falcon/net_driver.h void (*stop_stats)(struct ef4_nic *efx); efx 1066 drivers/net/ethernet/sfc/falcon/net_driver.h void (*set_id_led)(struct ef4_nic *efx, enum ef4_led_mode mode); efx 1068 drivers/net/ethernet/sfc/falcon/net_driver.h int (*reconfigure_port)(struct ef4_nic *efx); efx 1069 drivers/net/ethernet/sfc/falcon/net_driver.h void (*prepare_enable_fc_tx)(struct ef4_nic *efx); efx 1070 drivers/net/ethernet/sfc/falcon/net_driver.h int (*reconfigure_mac)(struct ef4_nic *efx); efx 1071 drivers/net/ethernet/sfc/falcon/net_driver.h bool (*check_mac_fault)(struct ef4_nic *efx); efx 1072 drivers/net/ethernet/sfc/falcon/net_driver.h void (*get_wol)(struct ef4_nic *efx, struct ethtool_wolinfo *wol); efx 1073 drivers/net/ethernet/sfc/falcon/net_driver.h int (*set_wol)(struct ef4_nic *efx, u32 type); efx 1074 drivers/net/ethernet/sfc/falcon/net_driver.h void (*resume_wol)(struct ef4_nic *efx); efx 1075 drivers/net/ethernet/sfc/falcon/net_driver.h int (*test_chip)(struct ef4_nic *efx, struct ef4_self_tests *tests); efx 1076 drivers/net/ethernet/sfc/falcon/net_driver.h int (*test_nvram)(struct ef4_nic *efx); efx 1077 drivers/net/ethernet/sfc/falcon/net_driver.h void (*irq_enable_master)(struct ef4_nic *efx); efx 1078 drivers/net/ethernet/sfc/falcon/net_driver.h int (*irq_test_generate)(struct ef4_nic *efx); efx 1079 drivers/net/ethernet/sfc/falcon/net_driver.h void (*irq_disable_non_ev)(struct ef4_nic *efx); efx 1088 drivers/net/ethernet/sfc/falcon/net_driver.h int (*rx_push_rss_config)(struct ef4_nic *efx, bool user, efx 1102 drivers/net/ethernet/sfc/falcon/net_driver.h int (*filter_table_probe)(struct ef4_nic *efx); efx 1103 drivers/net/ethernet/sfc/falcon/net_driver.h void (*filter_table_restore)(struct ef4_nic *efx); efx 1104 drivers/net/ethernet/sfc/falcon/net_driver.h void (*filter_table_remove)(struct ef4_nic *efx); efx 1105 drivers/net/ethernet/sfc/falcon/net_driver.h void (*filter_update_rx_scatter)(struct ef4_nic *efx); efx 1106 drivers/net/ethernet/sfc/falcon/net_driver.h s32 (*filter_insert)(struct ef4_nic *efx, efx 1108 drivers/net/ethernet/sfc/falcon/net_driver.h int (*filter_remove_safe)(struct ef4_nic *efx, efx 1111 drivers/net/ethernet/sfc/falcon/net_driver.h int (*filter_get_safe)(struct ef4_nic *efx, efx 1114 drivers/net/ethernet/sfc/falcon/net_driver.h int (*filter_clear_rx)(struct ef4_nic *efx, efx 1116 drivers/net/ethernet/sfc/falcon/net_driver.h u32 (*filter_count_rx_used)(struct ef4_nic *efx, efx 1118 drivers/net/ethernet/sfc/falcon/net_driver.h u32 (*filter_get_rx_id_limit)(struct ef4_nic *efx); efx 1119 drivers/net/ethernet/sfc/falcon/net_driver.h s32 (*filter_get_rx_ids)(struct ef4_nic *efx, efx 1123 drivers/net/ethernet/sfc/falcon/net_driver.h s32 (*filter_rfs_insert)(struct ef4_nic *efx, efx 1125 drivers/net/ethernet/sfc/falcon/net_driver.h bool (*filter_rfs_expire_one)(struct ef4_nic *efx, u32 flow_id, efx 1129 drivers/net/ethernet/sfc/falcon/net_driver.h int (*mtd_probe)(struct ef4_nic *efx); efx 1138 drivers/net/ethernet/sfc/falcon/net_driver.h int (*get_mac_address)(struct ef4_nic *efx, unsigned char *perm_addr); efx 1139 drivers/net/ethernet/sfc/falcon/net_driver.h int (*set_mac_address)(struct ef4_nic *efx); efx 1167 drivers/net/ethernet/sfc/falcon/net_driver.h ef4_get_channel(struct ef4_nic *efx, unsigned index) efx 1169 drivers/net/ethernet/sfc/falcon/net_driver.h EF4_BUG_ON_PARANOID(index >= efx->n_channels); efx 1170 drivers/net/ethernet/sfc/falcon/net_driver.h return efx->channel[index]; efx 1188 drivers/net/ethernet/sfc/falcon/net_driver.h ef4_get_tx_queue(struct ef4_nic *efx, unsigned index, unsigned type) efx 1190 drivers/net/ethernet/sfc/falcon/net_driver.h EF4_BUG_ON_PARANOID(index >= efx->n_tx_channels || efx 1192 drivers/net/ethernet/sfc/falcon/net_driver.h return &efx->channel[efx->tx_channel_offset + index]->tx_queue[type]; efx 1197 drivers/net/ethernet/sfc/falcon/net_driver.h return channel->channel - channel->efx->tx_channel_offset < efx 1198 drivers/net/ethernet/sfc/falcon/net_driver.h channel->efx->n_tx_channels; efx 1211 drivers/net/ethernet/sfc/falcon/net_driver.h return !(tx_queue->efx->net_dev->num_tc < 2 && efx 1301 drivers/net/ethernet/sfc/falcon/net_driver.h static inline netdev_features_t ef4_supported_features(const struct ef4_nic *efx) efx 1303 drivers/net/ethernet/sfc/falcon/net_driver.h const struct net_device *net_dev = efx->net_dev; efx 30 drivers/net/ethernet/sfc/falcon/nic.c int ef4_nic_alloc_buffer(struct ef4_nic *efx, struct ef4_buffer *buffer, efx 33 drivers/net/ethernet/sfc/falcon/nic.c buffer->addr = dma_alloc_coherent(&efx->pci_dev->dev, len, efx 41 drivers/net/ethernet/sfc/falcon/nic.c void ef4_nic_free_buffer(struct ef4_nic *efx, struct ef4_buffer *buffer) efx 44 drivers/net/ethernet/sfc/falcon/nic.c dma_free_coherent(&efx->pci_dev->dev, buffer->len, efx 62 drivers/net/ethernet/sfc/falcon/nic.c channel->efx->type->ev_test_generate(channel); efx 65 drivers/net/ethernet/sfc/falcon/nic.c int ef4_nic_irq_test_start(struct ef4_nic *efx) efx 67 drivers/net/ethernet/sfc/falcon/nic.c efx->last_irq_cpu = -1; efx 69 drivers/net/ethernet/sfc/falcon/nic.c return efx->type->irq_test_generate(efx); efx 75 drivers/net/ethernet/sfc/falcon/nic.c int ef4_nic_init_interrupt(struct ef4_nic *efx) efx 81 drivers/net/ethernet/sfc/falcon/nic.c if (!EF4_INT_MODE_USE_MSI(efx)) { efx 82 drivers/net/ethernet/sfc/falcon/nic.c rc = request_irq(efx->legacy_irq, efx 83 drivers/net/ethernet/sfc/falcon/nic.c efx->type->irq_handle_legacy, IRQF_SHARED, efx 84 drivers/net/ethernet/sfc/falcon/nic.c efx->name, efx); efx 86 drivers/net/ethernet/sfc/falcon/nic.c netif_err(efx, drv, efx->net_dev, efx 88 drivers/net/ethernet/sfc/falcon/nic.c efx->pci_dev->irq); efx 95 drivers/net/ethernet/sfc/falcon/nic.c if (efx->interrupt_mode == EF4_INT_MODE_MSIX) { efx 96 drivers/net/ethernet/sfc/falcon/nic.c efx->net_dev->rx_cpu_rmap = efx 97 drivers/net/ethernet/sfc/falcon/nic.c alloc_irq_cpu_rmap(efx->n_rx_channels); efx 98 drivers/net/ethernet/sfc/falcon/nic.c if (!efx->net_dev->rx_cpu_rmap) { efx 107 drivers/net/ethernet/sfc/falcon/nic.c ef4_for_each_channel(channel, efx) { efx 108 drivers/net/ethernet/sfc/falcon/nic.c rc = request_irq(channel->irq, efx->type->irq_handle_msi, efx 110 drivers/net/ethernet/sfc/falcon/nic.c efx->msi_context[channel->channel].name, efx 111 drivers/net/ethernet/sfc/falcon/nic.c &efx->msi_context[channel->channel]); efx 113 drivers/net/ethernet/sfc/falcon/nic.c netif_err(efx, drv, efx->net_dev, efx 120 drivers/net/ethernet/sfc/falcon/nic.c if (efx->interrupt_mode == EF4_INT_MODE_MSIX && efx 121 drivers/net/ethernet/sfc/falcon/nic.c channel->channel < efx->n_rx_channels) { efx 122 drivers/net/ethernet/sfc/falcon/nic.c rc = irq_cpu_rmap_add(efx->net_dev->rx_cpu_rmap, efx 134 drivers/net/ethernet/sfc/falcon/nic.c free_irq_cpu_rmap(efx->net_dev->rx_cpu_rmap); efx 135 drivers/net/ethernet/sfc/falcon/nic.c efx->net_dev->rx_cpu_rmap = NULL; efx 137 drivers/net/ethernet/sfc/falcon/nic.c ef4_for_each_channel(channel, efx) { efx 140 drivers/net/ethernet/sfc/falcon/nic.c free_irq(channel->irq, &efx->msi_context[channel->channel]); efx 146 drivers/net/ethernet/sfc/falcon/nic.c void ef4_nic_fini_interrupt(struct ef4_nic *efx) efx 151 drivers/net/ethernet/sfc/falcon/nic.c free_irq_cpu_rmap(efx->net_dev->rx_cpu_rmap); efx 152 drivers/net/ethernet/sfc/falcon/nic.c efx->net_dev->rx_cpu_rmap = NULL; efx 155 drivers/net/ethernet/sfc/falcon/nic.c if (EF4_INT_MODE_USE_MSI(efx)) { efx 157 drivers/net/ethernet/sfc/falcon/nic.c ef4_for_each_channel(channel, efx) efx 159 drivers/net/ethernet/sfc/falcon/nic.c &efx->msi_context[channel->channel]); efx 162 drivers/net/ethernet/sfc/falcon/nic.c free_irq(efx->legacy_irq, efx); efx 361 drivers/net/ethernet/sfc/falcon/nic.c size_t ef4_nic_get_regs_len(struct ef4_nic *efx) efx 370 drivers/net/ethernet/sfc/falcon/nic.c if (efx->type->revision >= reg->min_revision && efx 371 drivers/net/ethernet/sfc/falcon/nic.c efx->type->revision <= reg->max_revision) efx 377 drivers/net/ethernet/sfc/falcon/nic.c if (efx->type->revision >= table->min_revision && efx 378 drivers/net/ethernet/sfc/falcon/nic.c efx->type->revision <= table->max_revision) efx 384 drivers/net/ethernet/sfc/falcon/nic.c void ef4_nic_get_regs(struct ef4_nic *efx, void *buf) efx 392 drivers/net/ethernet/sfc/falcon/nic.c if (efx->type->revision >= reg->min_revision && efx 393 drivers/net/ethernet/sfc/falcon/nic.c efx->type->revision <= reg->max_revision) { efx 394 drivers/net/ethernet/sfc/falcon/nic.c ef4_reado(efx, (ef4_oword_t *)buf, reg->offset); efx 404 drivers/net/ethernet/sfc/falcon/nic.c if (!(efx->type->revision >= table->min_revision && efx 405 drivers/net/ethernet/sfc/falcon/nic.c efx->type->revision <= table->max_revision)) efx 413 drivers/net/ethernet/sfc/falcon/nic.c ef4_readd(efx, buf, table->offset + 4 * i); efx 416 drivers/net/ethernet/sfc/falcon/nic.c ef4_sram_readq(efx, efx 417 drivers/net/ethernet/sfc/falcon/nic.c efx->membase + table->offset, efx 421 drivers/net/ethernet/sfc/falcon/nic.c ef4_reado_table(efx, buf, table->offset, i); efx 424 drivers/net/ethernet/sfc/falcon/nic.c ef4_reado_table(efx, buf, table->offset, 2 * i); efx 515 drivers/net/ethernet/sfc/falcon/nic.c void ef4_nic_fix_nodesc_drop_stat(struct ef4_nic *efx, u64 *rx_nodesc_drops) efx 518 drivers/net/ethernet/sfc/falcon/nic.c if (!(efx->net_dev->flags & IFF_UP) || !efx->rx_nodesc_drops_prev_state) efx 519 drivers/net/ethernet/sfc/falcon/nic.c efx->rx_nodesc_drops_while_down += efx 520 drivers/net/ethernet/sfc/falcon/nic.c *rx_nodesc_drops - efx->rx_nodesc_drops_total; efx 521 drivers/net/ethernet/sfc/falcon/nic.c efx->rx_nodesc_drops_total = *rx_nodesc_drops; efx 522 drivers/net/ethernet/sfc/falcon/nic.c efx->rx_nodesc_drops_prev_state = !!(efx->net_dev->flags & IFF_UP); efx 523 drivers/net/ethernet/sfc/falcon/nic.c *rx_nodesc_drops -= efx->rx_nodesc_drops_while_down; efx 22 drivers/net/ethernet/sfc/falcon/nic.h static inline int ef4_nic_rev(struct ef4_nic *efx) efx 24 drivers/net/ethernet/sfc/falcon/nic.h return efx->type->revision; efx 27 drivers/net/ethernet/sfc/falcon/nic.h u32 ef4_farch_fpga_ver(struct ef4_nic *efx); efx 30 drivers/net/ethernet/sfc/falcon/nic.h static inline bool ef4_nic_is_dual_func(struct ef4_nic *efx) efx 32 drivers/net/ethernet/sfc/falcon/nic.h return ef4_nic_rev(efx) < EF4_REV_FALCON_B0; efx 156 drivers/net/ethernet/sfc/falcon/nic.h void (*init_phy) (struct ef4_nic *efx); efx 158 drivers/net/ethernet/sfc/falcon/nic.h void (*set_id_led) (struct ef4_nic *efx, enum ef4_led_mode mode); efx 281 drivers/net/ethernet/sfc/falcon/nic.h struct ef4_nic *efx; efx 294 drivers/net/ethernet/sfc/falcon/nic.h static inline struct falcon_board *falcon_board(struct ef4_nic *efx) efx 296 drivers/net/ethernet/sfc/falcon/nic.h struct falcon_nic_data *data = efx->nic_data; efx 312 drivers/net/ethernet/sfc/falcon/nic.h int falcon_probe_board(struct ef4_nic *efx, u16 revision_info); efx 317 drivers/net/ethernet/sfc/falcon/nic.h return tx_queue->efx->type->tx_probe(tx_queue); efx 321 drivers/net/ethernet/sfc/falcon/nic.h tx_queue->efx->type->tx_init(tx_queue); efx 325 drivers/net/ethernet/sfc/falcon/nic.h tx_queue->efx->type->tx_remove(tx_queue); efx 329 drivers/net/ethernet/sfc/falcon/nic.h tx_queue->efx->type->tx_write(tx_queue); efx 335 drivers/net/ethernet/sfc/falcon/nic.h return rx_queue->efx->type->rx_probe(rx_queue); efx 339 drivers/net/ethernet/sfc/falcon/nic.h rx_queue->efx->type->rx_init(rx_queue); efx 343 drivers/net/ethernet/sfc/falcon/nic.h rx_queue->efx->type->rx_remove(rx_queue); efx 347 drivers/net/ethernet/sfc/falcon/nic.h rx_queue->efx->type->rx_write(rx_queue); efx 351 drivers/net/ethernet/sfc/falcon/nic.h rx_queue->efx->type->rx_defer_refill(rx_queue); efx 357 drivers/net/ethernet/sfc/falcon/nic.h return channel->efx->type->ev_probe(channel); efx 361 drivers/net/ethernet/sfc/falcon/nic.h return channel->efx->type->ev_init(channel); efx 365 drivers/net/ethernet/sfc/falcon/nic.h channel->efx->type->ev_fini(channel); efx 369 drivers/net/ethernet/sfc/falcon/nic.h channel->efx->type->ev_remove(channel); efx 374 drivers/net/ethernet/sfc/falcon/nic.h return channel->efx->type->ev_process(channel, quota); efx 378 drivers/net/ethernet/sfc/falcon/nic.h channel->efx->type->ev_read_ack(channel); efx 405 drivers/net/ethernet/sfc/falcon/nic.h int ef4_farch_filter_table_probe(struct ef4_nic *efx); efx 406 drivers/net/ethernet/sfc/falcon/nic.h void ef4_farch_filter_table_restore(struct ef4_nic *efx); efx 407 drivers/net/ethernet/sfc/falcon/nic.h void ef4_farch_filter_table_remove(struct ef4_nic *efx); efx 408 drivers/net/ethernet/sfc/falcon/nic.h void ef4_farch_filter_update_rx_scatter(struct ef4_nic *efx); efx 409 drivers/net/ethernet/sfc/falcon/nic.h s32 ef4_farch_filter_insert(struct ef4_nic *efx, struct ef4_filter_spec *spec, efx 411 drivers/net/ethernet/sfc/falcon/nic.h int ef4_farch_filter_remove_safe(struct ef4_nic *efx, efx 414 drivers/net/ethernet/sfc/falcon/nic.h int ef4_farch_filter_get_safe(struct ef4_nic *efx, efx 417 drivers/net/ethernet/sfc/falcon/nic.h int ef4_farch_filter_clear_rx(struct ef4_nic *efx, efx 419 drivers/net/ethernet/sfc/falcon/nic.h u32 ef4_farch_filter_count_rx_used(struct ef4_nic *efx, efx 421 drivers/net/ethernet/sfc/falcon/nic.h u32 ef4_farch_filter_get_rx_id_limit(struct ef4_nic *efx); efx 422 drivers/net/ethernet/sfc/falcon/nic.h s32 ef4_farch_filter_get_rx_ids(struct ef4_nic *efx, efx 426 drivers/net/ethernet/sfc/falcon/nic.h s32 ef4_farch_filter_rfs_insert(struct ef4_nic *efx, efx 428 drivers/net/ethernet/sfc/falcon/nic.h bool ef4_farch_filter_rfs_expire_one(struct ef4_nic *efx, u32 flow_id, efx 431 drivers/net/ethernet/sfc/falcon/nic.h void ef4_farch_filter_sync_rx_mode(struct ef4_nic *efx); efx 454 drivers/net/ethernet/sfc/falcon/nic.h int ef4_nic_init_interrupt(struct ef4_nic *efx); efx 455 drivers/net/ethernet/sfc/falcon/nic.h int ef4_nic_irq_test_start(struct ef4_nic *efx); efx 456 drivers/net/ethernet/sfc/falcon/nic.h void ef4_nic_fini_interrupt(struct ef4_nic *efx); efx 457 drivers/net/ethernet/sfc/falcon/nic.h void ef4_farch_irq_enable_master(struct ef4_nic *efx); efx 458 drivers/net/ethernet/sfc/falcon/nic.h int ef4_farch_irq_test_generate(struct ef4_nic *efx); efx 459 drivers/net/ethernet/sfc/falcon/nic.h void ef4_farch_irq_disable_master(struct ef4_nic *efx); efx 462 drivers/net/ethernet/sfc/falcon/nic.h irqreturn_t ef4_farch_fatal_interrupt(struct ef4_nic *efx); efx 468 drivers/net/ethernet/sfc/falcon/nic.h static inline int ef4_nic_irq_test_irq_cpu(struct ef4_nic *efx) efx 470 drivers/net/ethernet/sfc/falcon/nic.h return READ_ONCE(efx->last_irq_cpu); efx 474 drivers/net/ethernet/sfc/falcon/nic.h int ef4_nic_flush_queues(struct ef4_nic *efx); efx 475 drivers/net/ethernet/sfc/falcon/nic.h int ef4_farch_fini_dmaq(struct ef4_nic *efx); efx 476 drivers/net/ethernet/sfc/falcon/nic.h void ef4_farch_finish_flr(struct ef4_nic *efx); efx 477 drivers/net/ethernet/sfc/falcon/nic.h void falcon_start_nic_stats(struct ef4_nic *efx); efx 478 drivers/net/ethernet/sfc/falcon/nic.h void falcon_stop_nic_stats(struct ef4_nic *efx); efx 479 drivers/net/ethernet/sfc/falcon/nic.h int falcon_reset_xaui(struct ef4_nic *efx); efx 480 drivers/net/ethernet/sfc/falcon/nic.h void ef4_farch_dimension_resources(struct ef4_nic *efx, unsigned sram_lim_qw); efx 481 drivers/net/ethernet/sfc/falcon/nic.h void ef4_farch_init_common(struct ef4_nic *efx); efx 482 drivers/net/ethernet/sfc/falcon/nic.h void ef4_farch_rx_push_indir_table(struct ef4_nic *efx); efx 484 drivers/net/ethernet/sfc/falcon/nic.h int ef4_nic_alloc_buffer(struct ef4_nic *efx, struct ef4_buffer *buffer, efx 486 drivers/net/ethernet/sfc/falcon/nic.h void ef4_nic_free_buffer(struct ef4_nic *efx, struct ef4_buffer *buffer); efx 493 drivers/net/ethernet/sfc/falcon/nic.h int ef4_farch_test_registers(struct ef4_nic *efx, efx 497 drivers/net/ethernet/sfc/falcon/nic.h size_t ef4_nic_get_regs_len(struct ef4_nic *efx); efx 498 drivers/net/ethernet/sfc/falcon/nic.h void ef4_nic_get_regs(struct ef4_nic *efx, void *buf); efx 505 drivers/net/ethernet/sfc/falcon/nic.h void ef4_nic_fix_nodesc_drop_stat(struct ef4_nic *efx, u64 *stat); efx 509 drivers/net/ethernet/sfc/falcon/nic.h void ef4_farch_generate_event(struct ef4_nic *efx, unsigned int evq, efx 15 drivers/net/ethernet/sfc/falcon/phy.h void tenxpress_set_id_led(struct ef4_nic *efx, enum ef4_led_mode mode); efx 44 drivers/net/ethernet/sfc/falcon/phy.h void falcon_txc_set_gpio_dir(struct ef4_nic *efx, int pin, int dir); efx 45 drivers/net/ethernet/sfc/falcon/phy.h void falcon_txc_set_gpio_val(struct ef4_nic *efx, int pin, int val); efx 73 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static int qt2025c_wait_heartbeat(struct ef4_nic *efx) efx 81 drivers/net/ethernet/sfc/falcon/qt202x_phy.c reg = ef4_mdio_read(efx, MDIO_MMD_PCS, PCS_FW_HEARTBEAT_REG); efx 93 drivers/net/ethernet/sfc/falcon/qt202x_phy.c netif_err(efx, hw, efx->net_dev, efx 105 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static int qt2025c_wait_fw_status_good(struct ef4_nic *efx) efx 112 drivers/net/ethernet/sfc/falcon/qt202x_phy.c reg = ef4_mdio_read(efx, MDIO_MMD_PCS, PCS_UC8051_STATUS_REG); efx 127 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static void qt2025c_restart_firmware(struct ef4_nic *efx) efx 130 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 3, 0xe854, 0x00c0); efx 131 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 3, 0xe854, 0x0040); efx 135 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static int qt2025c_wait_reset(struct ef4_nic *efx) efx 139 drivers/net/ethernet/sfc/falcon/qt202x_phy.c rc = qt2025c_wait_heartbeat(efx); efx 143 drivers/net/ethernet/sfc/falcon/qt202x_phy.c rc = qt2025c_wait_fw_status_good(efx); efx 148 drivers/net/ethernet/sfc/falcon/qt202x_phy.c netif_dbg(efx, hw, efx->net_dev, efx 150 drivers/net/ethernet/sfc/falcon/qt202x_phy.c qt2025c_restart_firmware(efx); efx 151 drivers/net/ethernet/sfc/falcon/qt202x_phy.c rc = qt2025c_wait_heartbeat(efx); efx 154 drivers/net/ethernet/sfc/falcon/qt202x_phy.c rc = qt2025c_wait_fw_status_good(efx); efx 160 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static void qt2025c_firmware_id(struct ef4_nic *efx) efx 162 drivers/net/ethernet/sfc/falcon/qt202x_phy.c struct qt202x_phy_data *phy_data = efx->phy_data; efx 167 drivers/net/ethernet/sfc/falcon/qt202x_phy.c firmware_id[i] = ef4_mdio_read(efx, MDIO_MMD_PCS, efx 169 drivers/net/ethernet/sfc/falcon/qt202x_phy.c netif_info(efx, probe, efx->net_dev, efx 180 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static void qt2025c_bug17190_workaround(struct ef4_nic *efx) efx 182 drivers/net/ethernet/sfc/falcon/qt202x_phy.c struct qt202x_phy_data *phy_data = efx->phy_data; efx 190 drivers/net/ethernet/sfc/falcon/qt202x_phy.c if (efx->link_state.up || efx 191 drivers/net/ethernet/sfc/falcon/qt202x_phy.c !ef4_mdio_links_ok(efx, MDIO_DEVS_PMAPMD | MDIO_DEVS_PHYXS)) { efx 203 drivers/net/ethernet/sfc/falcon/qt202x_phy.c netif_dbg(efx, hw, efx->net_dev, "bashing QT2025C PMA/PMD\n"); efx 204 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_set_flag(efx, MDIO_MMD_PMAPMD, MDIO_CTRL1, efx 207 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_set_flag(efx, MDIO_MMD_PMAPMD, MDIO_CTRL1, efx 213 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static int qt2025c_select_phy_mode(struct ef4_nic *efx) efx 215 drivers/net/ethernet/sfc/falcon/qt202x_phy.c struct qt202x_phy_data *phy_data = efx->phy_data; efx 216 drivers/net/ethernet/sfc/falcon/qt202x_phy.c struct falcon_board *board = falcon_board(efx); efx 230 drivers/net/ethernet/sfc/falcon/qt202x_phy.c phy_op_mode = (efx->loopback_mode == LOOPBACK_NONE) ? 0x0038 : 0x0020; efx 233 drivers/net/ethernet/sfc/falcon/qt202x_phy.c reg = ef4_mdio_read(efx, 1, 0xc319); efx 236 drivers/net/ethernet/sfc/falcon/qt202x_phy.c netif_dbg(efx, hw, efx->net_dev, "Switching PHY to mode 0x%04x\n", efx 243 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc300, 0x0000); efx 249 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc303, 0x4498); efx 251 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc303, 0x4488); efx 252 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc303, 0x4480); efx 253 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc303, 0x4490); efx 254 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc303, 0x4498); efx 257 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc303, 0x0920); efx 258 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xd008, 0x0004); efx 260 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc303, 0x0900); efx 261 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xd008, 0x0005); efx 262 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc303, 0x0920); efx 263 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xd008, 0x0004); efx 265 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc303, 0x4900); efx 267 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc303, 0x4900); efx 268 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc302, 0x0004); efx 269 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc316, 0x0013); efx 270 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc318, 0x0054); efx 271 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc319, phy_op_mode); efx 272 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc31a, 0x0098); efx 273 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 3, 0x0026, 0x0e00); efx 274 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 3, 0x0027, 0x0013); efx 275 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 3, 0x0028, 0xa528); efx 276 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xd006, 0x000a); efx 277 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xd007, 0x0009); efx 278 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xd008, 0x0004); efx 283 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc317, 0x00ff); efx 286 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_set_flag(efx, 1, PMA_PMD_MODE_REG, efx 288 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_write(efx, 1, 0xc300, 0x0002); efx 292 drivers/net/ethernet/sfc/falcon/qt202x_phy.c qt2025c_restart_firmware(efx); efx 295 drivers/net/ethernet/sfc/falcon/qt202x_phy.c rc = qt2025c_wait_reset(efx); efx 297 drivers/net/ethernet/sfc/falcon/qt202x_phy.c netif_err(efx, hw, efx->net_dev, efx 306 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static int qt202x_reset_phy(struct ef4_nic *efx) efx 310 drivers/net/ethernet/sfc/falcon/qt202x_phy.c if (efx->phy_type == PHY_TYPE_QT2025C) { efx 313 drivers/net/ethernet/sfc/falcon/qt202x_phy.c rc = qt2025c_wait_reset(efx); efx 319 drivers/net/ethernet/sfc/falcon/qt202x_phy.c rc = ef4_mdio_reset_mmd(efx, MDIO_MMD_PHYXS, efx 330 drivers/net/ethernet/sfc/falcon/qt202x_phy.c falcon_board(efx)->type->init_phy(efx); efx 335 drivers/net/ethernet/sfc/falcon/qt202x_phy.c netif_err(efx, hw, efx->net_dev, "PHY reset timed out\n"); efx 339 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static int qt202x_phy_probe(struct ef4_nic *efx) efx 346 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->phy_data = phy_data; efx 347 drivers/net/ethernet/sfc/falcon/qt202x_phy.c phy_data->phy_mode = efx->phy_mode; efx 351 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->mdio.mmds = QT202X_REQUIRED_DEVS; efx 352 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22; efx 353 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->loopback_modes = QT202X_LOOPBACKS | FALCON_XMAC_LOOPBACKS; efx 357 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static int qt202x_phy_init(struct ef4_nic *efx) efx 362 drivers/net/ethernet/sfc/falcon/qt202x_phy.c rc = qt202x_reset_phy(efx); efx 364 drivers/net/ethernet/sfc/falcon/qt202x_phy.c netif_err(efx, probe, efx->net_dev, "PHY init failed\n"); efx 368 drivers/net/ethernet/sfc/falcon/qt202x_phy.c devid = ef4_mdio_read_id(efx, MDIO_MMD_PHYXS); efx 369 drivers/net/ethernet/sfc/falcon/qt202x_phy.c netif_info(efx, probe, efx->net_dev, efx 374 drivers/net/ethernet/sfc/falcon/qt202x_phy.c if (efx->phy_type == PHY_TYPE_QT2025C) efx 375 drivers/net/ethernet/sfc/falcon/qt202x_phy.c qt2025c_firmware_id(efx); efx 380 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static int qt202x_link_ok(struct ef4_nic *efx) efx 382 drivers/net/ethernet/sfc/falcon/qt202x_phy.c return ef4_mdio_links_ok(efx, QT202X_REQUIRED_DEVS); efx 385 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static bool qt202x_phy_poll(struct ef4_nic *efx) efx 387 drivers/net/ethernet/sfc/falcon/qt202x_phy.c bool was_up = efx->link_state.up; efx 389 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->link_state.up = qt202x_link_ok(efx); efx 390 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->link_state.speed = 10000; efx 391 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->link_state.fd = true; efx 392 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->link_state.fc = efx->wanted_fc; efx 394 drivers/net/ethernet/sfc/falcon/qt202x_phy.c if (efx->phy_type == PHY_TYPE_QT2025C) efx 395 drivers/net/ethernet/sfc/falcon/qt202x_phy.c qt2025c_bug17190_workaround(efx); efx 397 drivers/net/ethernet/sfc/falcon/qt202x_phy.c return efx->link_state.up != was_up; efx 400 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static int qt202x_phy_reconfigure(struct ef4_nic *efx) efx 402 drivers/net/ethernet/sfc/falcon/qt202x_phy.c struct qt202x_phy_data *phy_data = efx->phy_data; efx 404 drivers/net/ethernet/sfc/falcon/qt202x_phy.c if (efx->phy_type == PHY_TYPE_QT2025C) { efx 405 drivers/net/ethernet/sfc/falcon/qt202x_phy.c int rc = qt2025c_select_phy_mode(efx); efx 415 drivers/net/ethernet/sfc/falcon/qt202x_phy.c &efx->mdio, efx->mdio.prtad, MDIO_MMD_PMAPMD, efx 417 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->phy_mode & PHY_MODE_TX_DISABLED || efx 418 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->phy_mode & PHY_MODE_LOW_POWER || efx 419 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->loopback_mode == LOOPBACK_PCS || efx 420 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->loopback_mode == LOOPBACK_PMAPMD); efx 423 drivers/net/ethernet/sfc/falcon/qt202x_phy.c if (!(efx->phy_mode & PHY_MODE_TX_DISABLED) && efx 425 drivers/net/ethernet/sfc/falcon/qt202x_phy.c qt202x_reset_phy(efx); efx 427 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_transmit_disable(efx); efx 430 drivers/net/ethernet/sfc/falcon/qt202x_phy.c ef4_mdio_phy_reconfigure(efx); efx 432 drivers/net/ethernet/sfc/falcon/qt202x_phy.c phy_data->phy_mode = efx->phy_mode; efx 437 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static void qt202x_phy_get_link_ksettings(struct ef4_nic *efx, efx 440 drivers/net/ethernet/sfc/falcon/qt202x_phy.c mdio45_ethtool_ksettings_get(&efx->mdio, cmd); efx 443 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static void qt202x_phy_remove(struct ef4_nic *efx) efx 446 drivers/net/ethernet/sfc/falcon/qt202x_phy.c kfree(efx->phy_data); efx 447 drivers/net/ethernet/sfc/falcon/qt202x_phy.c efx->phy_data = NULL; efx 450 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static int qt202x_phy_get_module_info(struct ef4_nic *efx, efx 458 drivers/net/ethernet/sfc/falcon/qt202x_phy.c static int qt202x_phy_get_module_eeprom(struct ef4_nic *efx, efx 463 drivers/net/ethernet/sfc/falcon/qt202x_phy.c if (efx->phy_type == PHY_TYPE_QT2025C) { efx 472 drivers/net/ethernet/sfc/falcon/qt202x_phy.c rc = ef4_mdio_read(efx, mmd, reg_base + ee->offset + i); efx 62 drivers/net/ethernet/sfc/falcon/rx.c static inline u32 ef4_rx_buf_hash(struct ef4_nic *efx, const u8 *eh) efx 65 drivers/net/ethernet/sfc/falcon/rx.c return __le32_to_cpup((const __le32 *)(eh + efx->rx_packet_hash_offset)); efx 67 drivers/net/ethernet/sfc/falcon/rx.c const u8 *data = eh + efx->rx_packet_hash_offset; efx 84 drivers/net/ethernet/sfc/falcon/rx.c static inline void ef4_sync_rx_buffer(struct ef4_nic *efx, efx 88 drivers/net/ethernet/sfc/falcon/rx.c dma_sync_single_for_cpu(&efx->pci_dev->dev, rx_buf->dma_addr, len, efx 92 drivers/net/ethernet/sfc/falcon/rx.c void ef4_rx_config_page_split(struct ef4_nic *efx) efx 94 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_page_buf_step = ALIGN(efx->rx_dma_len + efx->rx_ip_align, efx 96 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_bufs_per_page = efx->rx_buffer_order ? 1 : efx 98 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_page_buf_step); efx 99 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_buffer_truesize = (PAGE_SIZE << efx->rx_buffer_order) / efx 100 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_bufs_per_page; efx 101 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_pages_per_batch = DIV_ROUND_UP(EF4_RX_PREFERRED_BATCH, efx 102 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_bufs_per_page); efx 108 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = rx_queue->efx; efx 129 drivers/net/ethernet/sfc/falcon/rx.c dma_unmap_page(&efx->pci_dev->dev, state->dma_addr, efx 130 drivers/net/ethernet/sfc/falcon/rx.c PAGE_SIZE << efx->rx_buffer_order, efx 151 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = rx_queue->efx; efx 165 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_buffer_order); efx 169 drivers/net/ethernet/sfc/falcon/rx.c dma_map_page(&efx->pci_dev->dev, page, 0, efx 170 drivers/net/ethernet/sfc/falcon/rx.c PAGE_SIZE << efx->rx_buffer_order, efx 172 drivers/net/ethernet/sfc/falcon/rx.c if (unlikely(dma_mapping_error(&efx->pci_dev->dev, efx 174 drivers/net/ethernet/sfc/falcon/rx.c __free_pages(page, efx->rx_buffer_order); efx 190 drivers/net/ethernet/sfc/falcon/rx.c rx_buf->dma_addr = dma_addr + efx->rx_ip_align; efx 192 drivers/net/ethernet/sfc/falcon/rx.c rx_buf->page_offset = page_offset + efx->rx_ip_align; efx 193 drivers/net/ethernet/sfc/falcon/rx.c rx_buf->len = efx->rx_dma_len; efx 197 drivers/net/ethernet/sfc/falcon/rx.c dma_addr += efx->rx_page_buf_step; efx 198 drivers/net/ethernet/sfc/falcon/rx.c page_offset += efx->rx_page_buf_step; efx 199 drivers/net/ethernet/sfc/falcon/rx.c } while (page_offset + efx->rx_page_buf_step <= PAGE_SIZE); efx 202 drivers/net/ethernet/sfc/falcon/rx.c } while (++count < efx->rx_pages_per_batch); efx 210 drivers/net/ethernet/sfc/falcon/rx.c static void ef4_unmap_rx_buffer(struct ef4_nic *efx, efx 217 drivers/net/ethernet/sfc/falcon/rx.c dma_unmap_page(&efx->pci_dev->dev, efx 219 drivers/net/ethernet/sfc/falcon/rx.c PAGE_SIZE << efx->rx_buffer_order, efx 246 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = rx_queue->efx; efx 269 drivers/net/ethernet/sfc/falcon/rx.c ef4_unmap_rx_buffer(efx, rx_buf); efx 282 drivers/net/ethernet/sfc/falcon/rx.c ef4_unmap_rx_buffer(rx_queue->efx, rx_buf); efx 326 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = rx_queue->efx; efx 335 drivers/net/ethernet/sfc/falcon/rx.c EF4_BUG_ON_PARANOID(fill_level > rx_queue->efx->rxq_entries); efx 345 drivers/net/ethernet/sfc/falcon/rx.c batch_size = efx->rx_pages_per_batch * efx->rx_bufs_per_page; efx 349 drivers/net/ethernet/sfc/falcon/rx.c netif_vdbg(rx_queue->efx, rx_status, rx_queue->efx->net_dev, efx 366 drivers/net/ethernet/sfc/falcon/rx.c netif_vdbg(rx_queue->efx, rx_status, rx_queue->efx->net_dev, efx 389 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = rx_queue->efx; efx 390 drivers/net/ethernet/sfc/falcon/rx.c unsigned max_len = rx_buf->len - efx->type->rx_buffer_padding; efx 400 drivers/net/ethernet/sfc/falcon/rx.c if ((len > rx_buf->len) && EF4_WORKAROUND_8071(efx)) { efx 402 drivers/net/ethernet/sfc/falcon/rx.c netif_err(efx, rx_err, efx->net_dev, efx 406 drivers/net/ethernet/sfc/falcon/rx.c efx->type->rx_buffer_padding); efx 407 drivers/net/ethernet/sfc/falcon/rx.c ef4_schedule_reset(efx, RESET_TYPE_RX_RECOVERY); efx 410 drivers/net/ethernet/sfc/falcon/rx.c netif_err(efx, rx_err, efx->net_dev, efx 427 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = channel->efx; efx 439 drivers/net/ethernet/sfc/falcon/rx.c if (efx->net_dev->features & NETIF_F_RXHASH) efx 440 drivers/net/ethernet/sfc/falcon/rx.c skb_set_hash(skb, ef4_rx_buf_hash(efx, eh), efx 458 drivers/net/ethernet/sfc/falcon/rx.c skb->truesize += n_frags * efx->rx_buffer_truesize; efx 471 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = channel->efx; efx 475 drivers/net/ethernet/sfc/falcon/rx.c skb = netdev_alloc_skb(efx->net_dev, efx 476 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_ip_align + efx->rx_prefix_size + efx 479 drivers/net/ethernet/sfc/falcon/rx.c atomic_inc(&efx->n_rx_noskb_drops); efx 485 drivers/net/ethernet/sfc/falcon/rx.c memcpy(skb->data + efx->rx_ip_align, eh - efx->rx_prefix_size, efx 486 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_prefix_size + hdr_len); efx 487 drivers/net/ethernet/sfc/falcon/rx.c skb_reserve(skb, efx->rx_ip_align + efx->rx_prefix_size); efx 508 drivers/net/ethernet/sfc/falcon/rx.c __free_pages(rx_buf->page, efx->rx_buffer_order); efx 513 drivers/net/ethernet/sfc/falcon/rx.c skb->truesize += n_frags * efx->rx_buffer_truesize; efx 516 drivers/net/ethernet/sfc/falcon/rx.c skb->protocol = eth_type_trans(skb, efx->net_dev); efx 526 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = rx_queue->efx; efx 540 drivers/net/ethernet/sfc/falcon/rx.c unlikely(len <= (n_frags - 1) * efx->rx_dma_len) || efx 541 drivers/net/ethernet/sfc/falcon/rx.c unlikely(len > n_frags * efx->rx_dma_len) || efx 542 drivers/net/ethernet/sfc/falcon/rx.c unlikely(!efx->rx_scatter)) { efx 550 drivers/net/ethernet/sfc/falcon/rx.c netif_vdbg(efx, rx_status, efx->net_dev, efx 572 drivers/net/ethernet/sfc/falcon/rx.c ef4_sync_rx_buffer(efx, rx_buf, rx_buf->len); efx 579 drivers/net/ethernet/sfc/falcon/rx.c rx_buf->page_offset += efx->rx_prefix_size; efx 580 drivers/net/ethernet/sfc/falcon/rx.c rx_buf->len -= efx->rx_prefix_size; efx 592 drivers/net/ethernet/sfc/falcon/rx.c ef4_sync_rx_buffer(efx, rx_buf, efx->rx_dma_len); efx 594 drivers/net/ethernet/sfc/falcon/rx.c rx_buf->len = len - (n_frags - 1) * efx->rx_dma_len; efx 595 drivers/net/ethernet/sfc/falcon/rx.c ef4_sync_rx_buffer(efx, rx_buf, rx_buf->len); efx 643 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = channel->efx; efx 653 drivers/net/ethernet/sfc/falcon/rx.c (eh + efx->rx_packet_len_offset)); efx 658 drivers/net/ethernet/sfc/falcon/rx.c if (unlikely(efx->loopback_selftest)) { efx 661 drivers/net/ethernet/sfc/falcon/rx.c ef4_loopback_rx_packet(efx, eh, rx_buf->len); efx 668 drivers/net/ethernet/sfc/falcon/rx.c if (unlikely(!(efx->net_dev->features & NETIF_F_RXCSUM))) efx 681 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = rx_queue->efx; efx 686 drivers/net/ethernet/sfc/falcon/rx.c entries = max(roundup_pow_of_two(efx->rxq_entries), EF4_MIN_DMAQ_SIZE); efx 690 drivers/net/ethernet/sfc/falcon/rx.c netif_dbg(efx, probe, efx->net_dev, efx 692 drivers/net/ethernet/sfc/falcon/rx.c ef4_rx_queue_index(rx_queue), efx->rxq_entries, efx 710 drivers/net/ethernet/sfc/falcon/rx.c static void ef4_init_rx_recycle_ring(struct ef4_nic *efx, efx 726 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_bufs_per_page); efx 734 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = rx_queue->efx; efx 737 drivers/net/ethernet/sfc/falcon/rx.c netif_dbg(rx_queue->efx, drv, rx_queue->efx->net_dev, efx 745 drivers/net/ethernet/sfc/falcon/rx.c ef4_init_rx_recycle_ring(efx, rx_queue); efx 754 drivers/net/ethernet/sfc/falcon/rx.c max_fill = efx->rxq_entries - EF4_RXD_HEAD_ROOM; efx 756 drivers/net/ethernet/sfc/falcon/rx.c max_fill - efx->rx_pages_per_batch * efx->rx_bufs_per_page; efx 776 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = rx_queue->efx; efx 779 drivers/net/ethernet/sfc/falcon/rx.c netif_dbg(rx_queue->efx, drv, rx_queue->efx->net_dev, efx 803 drivers/net/ethernet/sfc/falcon/rx.c dma_unmap_page(&efx->pci_dev->dev, state->dma_addr, efx 804 drivers/net/ethernet/sfc/falcon/rx.c PAGE_SIZE << efx->rx_buffer_order, efx 814 drivers/net/ethernet/sfc/falcon/rx.c netif_dbg(rx_queue->efx, drv, rx_queue->efx->net_dev, efx 833 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 851 drivers/net/ethernet/sfc/falcon/rx.c efx->rx_scatter ? EF4_FILTER_FLAG_RX_SCATTER : 0, efx 871 drivers/net/ethernet/sfc/falcon/rx.c rc = efx->type->filter_rfs_insert(efx, &spec); efx 876 drivers/net/ethernet/sfc/falcon/rx.c channel = ef4_get_channel(efx, rxq_index); efx 881 drivers/net/ethernet/sfc/falcon/rx.c netif_info(efx, rx_status, efx->net_dev, efx 887 drivers/net/ethernet/sfc/falcon/rx.c netif_info(efx, rx_status, efx->net_dev, efx 896 drivers/net/ethernet/sfc/falcon/rx.c bool __ef4_filter_rfs_expire(struct ef4_nic *efx, unsigned int quota) efx 898 drivers/net/ethernet/sfc/falcon/rx.c bool (*expire_one)(struct ef4_nic *efx, u32 flow_id, unsigned int index); efx 902 drivers/net/ethernet/sfc/falcon/rx.c if (!spin_trylock_bh(&efx->filter_lock)) efx 905 drivers/net/ethernet/sfc/falcon/rx.c expire_one = efx->type->filter_rfs_expire_one; efx 906 drivers/net/ethernet/sfc/falcon/rx.c channel_idx = efx->rps_expire_channel; efx 907 drivers/net/ethernet/sfc/falcon/rx.c index = efx->rps_expire_index; efx 908 drivers/net/ethernet/sfc/falcon/rx.c size = efx->type->max_rx_ip_filters; efx 910 drivers/net/ethernet/sfc/falcon/rx.c struct ef4_channel *channel = ef4_get_channel(efx, channel_idx); efx 914 drivers/net/ethernet/sfc/falcon/rx.c expire_one(efx, flow_id, index)) { efx 915 drivers/net/ethernet/sfc/falcon/rx.c netif_info(efx, rx_status, efx->net_dev, efx 921 drivers/net/ethernet/sfc/falcon/rx.c if (++channel_idx == efx->n_channels) efx 926 drivers/net/ethernet/sfc/falcon/rx.c efx->rps_expire_channel = channel_idx; efx 927 drivers/net/ethernet/sfc/falcon/rx.c efx->rps_expire_index = index; efx 929 drivers/net/ethernet/sfc/falcon/rx.c spin_unlock_bh(&efx->filter_lock); efx 64 drivers/net/ethernet/sfc/falcon/selftest.c #define INT_MODE(efx) \ efx 65 drivers/net/ethernet/sfc/falcon/selftest.c STRING_TABLE_LOOKUP(efx->interrupt_mode, ef4_interrupt_mode) efx 96 drivers/net/ethernet/sfc/falcon/selftest.c static int ef4_test_phy_alive(struct ef4_nic *efx, struct ef4_self_tests *tests) efx 100 drivers/net/ethernet/sfc/falcon/selftest.c if (efx->phy_op->test_alive) { efx 101 drivers/net/ethernet/sfc/falcon/selftest.c rc = efx->phy_op->test_alive(efx); efx 108 drivers/net/ethernet/sfc/falcon/selftest.c static int ef4_test_nvram(struct ef4_nic *efx, struct ef4_self_tests *tests) efx 112 drivers/net/ethernet/sfc/falcon/selftest.c if (efx->type->test_nvram) { efx 113 drivers/net/ethernet/sfc/falcon/selftest.c rc = efx->type->test_nvram(efx); efx 130 drivers/net/ethernet/sfc/falcon/selftest.c static int ef4_test_interrupts(struct ef4_nic *efx, efx 137 drivers/net/ethernet/sfc/falcon/selftest.c netif_dbg(efx, drv, efx->net_dev, "testing interrupts\n"); efx 140 drivers/net/ethernet/sfc/falcon/selftest.c rc = ef4_nic_irq_test_start(efx); efx 142 drivers/net/ethernet/sfc/falcon/selftest.c netif_dbg(efx, drv, efx->net_dev, efx 152 drivers/net/ethernet/sfc/falcon/selftest.c netif_dbg(efx, drv, efx->net_dev, "waiting for test interrupt\n"); efx 155 drivers/net/ethernet/sfc/falcon/selftest.c cpu = ef4_nic_irq_test_irq_cpu(efx); efx 161 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, "timed out waiting for interrupt\n"); efx 165 drivers/net/ethernet/sfc/falcon/selftest.c netif_dbg(efx, drv, efx->net_dev, "%s test interrupt seen on CPU%d\n", efx 166 drivers/net/ethernet/sfc/falcon/selftest.c INT_MODE(efx), cpu); efx 172 drivers/net/ethernet/sfc/falcon/selftest.c static int ef4_test_eventq_irq(struct ef4_nic *efx, efx 182 drivers/net/ethernet/sfc/falcon/selftest.c ef4_for_each_channel(channel, efx) { efx 198 drivers/net/ethernet/sfc/falcon/selftest.c ef4_for_each_channel(channel, efx) { efx 217 drivers/net/ethernet/sfc/falcon/selftest.c ef4_for_each_channel(channel, efx) { efx 225 drivers/net/ethernet/sfc/falcon/selftest.c netif_dbg(efx, drv, efx->net_dev, efx 234 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 238 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 243 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 253 drivers/net/ethernet/sfc/falcon/selftest.c static int ef4_test_phy(struct ef4_nic *efx, struct ef4_self_tests *tests, efx 258 drivers/net/ethernet/sfc/falcon/selftest.c if (!efx->phy_op->run_tests) efx 261 drivers/net/ethernet/sfc/falcon/selftest.c mutex_lock(&efx->mac_lock); efx 262 drivers/net/ethernet/sfc/falcon/selftest.c rc = efx->phy_op->run_tests(efx, tests->phy_ext, flags); efx 263 drivers/net/ethernet/sfc/falcon/selftest.c mutex_unlock(&efx->mac_lock); efx 267 drivers/net/ethernet/sfc/falcon/selftest.c netif_info(efx, drv, efx->net_dev, efx 283 drivers/net/ethernet/sfc/falcon/selftest.c void ef4_loopback_rx_packet(struct ef4_nic *efx, efx 286 drivers/net/ethernet/sfc/falcon/selftest.c struct ef4_loopback_state *state = efx->loopback_selftest; efx 305 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 307 drivers/net/ethernet/sfc/falcon/selftest.c "test\n", pkt_len, LOOPBACK_MODE(efx)); efx 313 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 315 drivers/net/ethernet/sfc/falcon/selftest.c LOOPBACK_MODE(efx)); efx 321 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 324 drivers/net/ethernet/sfc/falcon/selftest.c LOOPBACK_MODE(efx)); efx 330 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 332 drivers/net/ethernet/sfc/falcon/selftest.c LOOPBACK_MODE(efx)); efx 338 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 340 drivers/net/ethernet/sfc/falcon/selftest.c LOOPBACK_MODE(efx)); efx 346 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 349 drivers/net/ethernet/sfc/falcon/selftest.c ntohs(payload->iteration), LOOPBACK_MODE(efx)); efx 354 drivers/net/ethernet/sfc/falcon/selftest.c netif_vdbg(efx, drv, efx->net_dev, efx 355 drivers/net/ethernet/sfc/falcon/selftest.c "got loopback RX in %s loopback test\n", LOOPBACK_MODE(efx)); efx 363 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, "received packet:\n"); efx 366 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, "expected packet:\n"); efx 375 drivers/net/ethernet/sfc/falcon/selftest.c static void ef4_iterate_state(struct ef4_nic *efx) efx 377 drivers/net/ethernet/sfc/falcon/selftest.c struct ef4_loopback_state *state = efx->loopback_selftest; efx 378 drivers/net/ethernet/sfc/falcon/selftest.c struct net_device *net_dev = efx->net_dev; efx 412 drivers/net/ethernet/sfc/falcon/selftest.c struct ef4_nic *efx = tx_queue->efx; efx 413 drivers/net/ethernet/sfc/falcon/selftest.c struct ef4_loopback_state *state = efx->loopback_selftest; efx 439 drivers/net/ethernet/sfc/falcon/selftest.c netif_tx_lock_bh(efx->net_dev); efx 441 drivers/net/ethernet/sfc/falcon/selftest.c netif_tx_unlock_bh(efx->net_dev); efx 444 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 448 drivers/net/ethernet/sfc/falcon/selftest.c LOOPBACK_MODE(efx)); efx 459 drivers/net/ethernet/sfc/falcon/selftest.c static int ef4_poll_loopback(struct ef4_nic *efx) efx 461 drivers/net/ethernet/sfc/falcon/selftest.c struct ef4_loopback_state *state = efx->loopback_selftest; efx 469 drivers/net/ethernet/sfc/falcon/selftest.c struct ef4_nic *efx = tx_queue->efx; efx 470 drivers/net/ethernet/sfc/falcon/selftest.c struct ef4_loopback_state *state = efx->loopback_selftest; efx 475 drivers/net/ethernet/sfc/falcon/selftest.c netif_tx_lock_bh(efx->net_dev); efx 486 drivers/net/ethernet/sfc/falcon/selftest.c netif_tx_unlock_bh(efx->net_dev); efx 495 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 499 drivers/net/ethernet/sfc/falcon/selftest.c LOOPBACK_MODE(efx)); efx 506 drivers/net/ethernet/sfc/falcon/selftest.c netif_dbg(efx, drv, efx->net_dev, efx 510 drivers/net/ethernet/sfc/falcon/selftest.c LOOPBACK_MODE(efx)); efx 528 drivers/net/ethernet/sfc/falcon/selftest.c struct ef4_nic *efx = tx_queue->efx; efx 529 drivers/net/ethernet/sfc/falcon/selftest.c struct ef4_loopback_state *state = efx->loopback_selftest; efx 534 drivers/net/ethernet/sfc/falcon/selftest.c state->packet_count = efx->txq_entries / 3; efx 542 drivers/net/ethernet/sfc/falcon/selftest.c netif_dbg(efx, drv, efx->net_dev, efx 544 drivers/net/ethernet/sfc/falcon/selftest.c tx_queue->queue, LOOPBACK_MODE(efx), efx 547 drivers/net/ethernet/sfc/falcon/selftest.c ef4_iterate_state(efx); efx 553 drivers/net/ethernet/sfc/falcon/selftest.c if (!ef4_poll_loopback(efx)) { efx 555 drivers/net/ethernet/sfc/falcon/selftest.c ef4_poll_loopback(efx); efx 569 drivers/net/ethernet/sfc/falcon/selftest.c netif_dbg(efx, drv, efx->net_dev, efx 571 drivers/net/ethernet/sfc/falcon/selftest.c "of %d packets\n", tx_queue->queue, LOOPBACK_MODE(efx), efx 581 drivers/net/ethernet/sfc/falcon/selftest.c static int ef4_wait_for_link(struct ef4_nic *efx) efx 583 drivers/net/ethernet/sfc/falcon/selftest.c struct ef4_link_state *link_state = &efx->link_state; efx 590 drivers/net/ethernet/sfc/falcon/selftest.c if (efx->type->monitor != NULL) { efx 591 drivers/net/ethernet/sfc/falcon/selftest.c mutex_lock(&efx->mac_lock); efx 592 drivers/net/ethernet/sfc/falcon/selftest.c efx->type->monitor(efx); efx 593 drivers/net/ethernet/sfc/falcon/selftest.c mutex_unlock(&efx->mac_lock); efx 596 drivers/net/ethernet/sfc/falcon/selftest.c mutex_lock(&efx->mac_lock); efx 599 drivers/net/ethernet/sfc/falcon/selftest.c link_up = !efx->type->check_mac_fault(efx); efx 600 drivers/net/ethernet/sfc/falcon/selftest.c mutex_unlock(&efx->mac_lock); efx 613 drivers/net/ethernet/sfc/falcon/selftest.c static int ef4_test_loopbacks(struct ef4_nic *efx, struct ef4_self_tests *tests, efx 619 drivers/net/ethernet/sfc/falcon/selftest.c ef4_get_channel(efx, efx->tx_channel_offset); efx 629 drivers/net/ethernet/sfc/falcon/selftest.c BUG_ON(efx->loopback_selftest); efx 631 drivers/net/ethernet/sfc/falcon/selftest.c efx->loopback_selftest = state; efx 640 drivers/net/ethernet/sfc/falcon/selftest.c mutex_lock(&efx->mac_lock); efx 641 drivers/net/ethernet/sfc/falcon/selftest.c efx->loopback_mode = mode; efx 642 drivers/net/ethernet/sfc/falcon/selftest.c rc = __ef4_reconfigure_port(efx); efx 643 drivers/net/ethernet/sfc/falcon/selftest.c mutex_unlock(&efx->mac_lock); efx 645 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 647 drivers/net/ethernet/sfc/falcon/selftest.c LOOPBACK_MODE(efx)); efx 651 drivers/net/ethernet/sfc/falcon/selftest.c rc = ef4_wait_for_link(efx); efx 653 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, drv, efx->net_dev, efx 655 drivers/net/ethernet/sfc/falcon/selftest.c LOOPBACK_MODE(efx)); efx 673 drivers/net/ethernet/sfc/falcon/selftest.c efx->loopback_selftest = NULL; efx 689 drivers/net/ethernet/sfc/falcon/selftest.c int ef4_selftest(struct ef4_nic *efx, struct ef4_self_tests *tests, efx 692 drivers/net/ethernet/sfc/falcon/selftest.c enum ef4_loopback_mode loopback_mode = efx->loopback_mode; efx 693 drivers/net/ethernet/sfc/falcon/selftest.c int phy_mode = efx->phy_mode; efx 696 drivers/net/ethernet/sfc/falcon/selftest.c ef4_selftest_async_cancel(efx); efx 701 drivers/net/ethernet/sfc/falcon/selftest.c rc = ef4_test_phy_alive(efx, tests); efx 705 drivers/net/ethernet/sfc/falcon/selftest.c rc = ef4_test_nvram(efx, tests); efx 709 drivers/net/ethernet/sfc/falcon/selftest.c rc = ef4_test_interrupts(efx, tests); efx 713 drivers/net/ethernet/sfc/falcon/selftest.c rc = ef4_test_eventq_irq(efx, tests); efx 721 drivers/net/ethernet/sfc/falcon/selftest.c return ef4_test_phy(efx, tests, flags); efx 729 drivers/net/ethernet/sfc/falcon/selftest.c ef4_device_detach_sync(efx); efx 731 drivers/net/ethernet/sfc/falcon/selftest.c if (efx->type->test_chip) { efx 732 drivers/net/ethernet/sfc/falcon/selftest.c rc_reset = efx->type->test_chip(efx, tests); efx 734 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, hw, efx->net_dev, efx 736 drivers/net/ethernet/sfc/falcon/selftest.c ef4_schedule_reset(efx, RESET_TYPE_DISABLE); efx 746 drivers/net/ethernet/sfc/falcon/selftest.c mutex_lock(&efx->mac_lock); efx 747 drivers/net/ethernet/sfc/falcon/selftest.c efx->phy_mode &= ~PHY_MODE_LOW_POWER; efx 748 drivers/net/ethernet/sfc/falcon/selftest.c efx->loopback_mode = LOOPBACK_NONE; efx 749 drivers/net/ethernet/sfc/falcon/selftest.c __ef4_reconfigure_port(efx); efx 750 drivers/net/ethernet/sfc/falcon/selftest.c mutex_unlock(&efx->mac_lock); efx 752 drivers/net/ethernet/sfc/falcon/selftest.c rc = ef4_test_phy(efx, tests, flags); efx 756 drivers/net/ethernet/sfc/falcon/selftest.c rc = ef4_test_loopbacks(efx, tests, efx->loopback_modes); efx 761 drivers/net/ethernet/sfc/falcon/selftest.c mutex_lock(&efx->mac_lock); efx 762 drivers/net/ethernet/sfc/falcon/selftest.c efx->phy_mode = phy_mode; efx 763 drivers/net/ethernet/sfc/falcon/selftest.c efx->loopback_mode = loopback_mode; efx 764 drivers/net/ethernet/sfc/falcon/selftest.c __ef4_reconfigure_port(efx); efx 765 drivers/net/ethernet/sfc/falcon/selftest.c mutex_unlock(&efx->mac_lock); efx 767 drivers/net/ethernet/sfc/falcon/selftest.c netif_device_attach(efx->net_dev); efx 772 drivers/net/ethernet/sfc/falcon/selftest.c void ef4_selftest_async_start(struct ef4_nic *efx) efx 776 drivers/net/ethernet/sfc/falcon/selftest.c ef4_for_each_channel(channel, efx) efx 778 drivers/net/ethernet/sfc/falcon/selftest.c schedule_delayed_work(&efx->selftest_work, IRQ_TIMEOUT); efx 781 drivers/net/ethernet/sfc/falcon/selftest.c void ef4_selftest_async_cancel(struct ef4_nic *efx) efx 783 drivers/net/ethernet/sfc/falcon/selftest.c cancel_delayed_work_sync(&efx->selftest_work); efx 788 drivers/net/ethernet/sfc/falcon/selftest.c struct ef4_nic *efx = container_of(data, struct ef4_nic, efx 793 drivers/net/ethernet/sfc/falcon/selftest.c ef4_for_each_channel(channel, efx) { efx 796 drivers/net/ethernet/sfc/falcon/selftest.c netif_err(efx, ifup, efx->net_dev, efx 800 drivers/net/ethernet/sfc/falcon/selftest.c netif_dbg(efx, ifup, efx->net_dev, efx 44 drivers/net/ethernet/sfc/falcon/selftest.h void ef4_loopback_rx_packet(struct ef4_nic *efx, const char *buf_ptr, efx 46 drivers/net/ethernet/sfc/falcon/selftest.h int ef4_selftest(struct ef4_nic *efx, struct ef4_self_tests *tests, efx 48 drivers/net/ethernet/sfc/falcon/selftest.h void ef4_selftest_async_start(struct ef4_nic *efx); efx 49 drivers/net/ethernet/sfc/falcon/selftest.h void ef4_selftest_async_cancel(struct ef4_nic *efx); efx 148 drivers/net/ethernet/sfc/falcon/tenxpress.c static int tenxpress_init(struct ef4_nic *efx) efx 151 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_write(efx, MDIO_MMD_PCS, PCS_TEST_SELECT_REG, efx 155 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_set_flag(efx, MDIO_MMD_PMAPMD, PMA_PMD_LED_CTRL_REG, efx 157 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_write(efx, MDIO_MMD_PMAPMD, PMA_PMD_LED_OVERR_REG, efx 163 drivers/net/ethernet/sfc/falcon/tenxpress.c static int tenxpress_phy_probe(struct ef4_nic *efx) efx 171 drivers/net/ethernet/sfc/falcon/tenxpress.c efx->phy_data = phy_data; efx 172 drivers/net/ethernet/sfc/falcon/tenxpress.c phy_data->phy_mode = efx->phy_mode; efx 174 drivers/net/ethernet/sfc/falcon/tenxpress.c efx->mdio.mmds = TENXPRESS_REQUIRED_DEVS; efx 175 drivers/net/ethernet/sfc/falcon/tenxpress.c efx->mdio.mode_support = MDIO_SUPPORTS_C45; efx 177 drivers/net/ethernet/sfc/falcon/tenxpress.c efx->loopback_modes = SFX7101_LOOPBACKS | FALCON_XMAC_LOOPBACKS; efx 179 drivers/net/ethernet/sfc/falcon/tenxpress.c efx->link_advertising = (ADVERTISED_TP | ADVERTISED_Autoneg | efx 185 drivers/net/ethernet/sfc/falcon/tenxpress.c static int tenxpress_phy_init(struct ef4_nic *efx) efx 189 drivers/net/ethernet/sfc/falcon/tenxpress.c falcon_board(efx)->type->init_phy(efx); efx 191 drivers/net/ethernet/sfc/falcon/tenxpress.c if (!(efx->phy_mode & PHY_MODE_SPECIAL)) { efx 192 drivers/net/ethernet/sfc/falcon/tenxpress.c rc = ef4_mdio_wait_reset_mmds(efx, TENXPRESS_REQUIRED_DEVS); efx 196 drivers/net/ethernet/sfc/falcon/tenxpress.c rc = ef4_mdio_check_mmds(efx, TENXPRESS_REQUIRED_DEVS); efx 201 drivers/net/ethernet/sfc/falcon/tenxpress.c rc = tenxpress_init(efx); efx 206 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_link_set_wanted_fc(efx, efx->wanted_fc); efx 207 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_an_reconfigure(efx); efx 212 drivers/net/ethernet/sfc/falcon/tenxpress.c falcon_reset_xaui(efx); efx 220 drivers/net/ethernet/sfc/falcon/tenxpress.c static int tenxpress_special_reset(struct ef4_nic *efx) efx 227 drivers/net/ethernet/sfc/falcon/tenxpress.c falcon_stop_nic_stats(efx); efx 230 drivers/net/ethernet/sfc/falcon/tenxpress.c reg = ef4_mdio_read(efx, MDIO_MMD_PMAPMD, PMA_PMD_XCONTROL_REG); efx 232 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_write(efx, MDIO_MMD_PMAPMD, PMA_PMD_XCONTROL_REG, reg); efx 237 drivers/net/ethernet/sfc/falcon/tenxpress.c rc = ef4_mdio_wait_reset_mmds(efx, TENXPRESS_REQUIRED_DEVS); efx 242 drivers/net/ethernet/sfc/falcon/tenxpress.c rc = tenxpress_init(efx); efx 249 drivers/net/ethernet/sfc/falcon/tenxpress.c falcon_start_nic_stats(efx); efx 253 drivers/net/ethernet/sfc/falcon/tenxpress.c static void sfx7101_check_bad_lp(struct ef4_nic *efx, bool link_ok) efx 255 drivers/net/ethernet/sfc/falcon/tenxpress.c struct tenxpress_phy_data *pd = efx->phy_data; efx 263 drivers/net/ethernet/sfc/falcon/tenxpress.c reg = ef4_mdio_read(efx, MDIO_MMD_AN, MDIO_STAT1); efx 278 drivers/net/ethernet/sfc/falcon/tenxpress.c reg = ef4_mdio_read(efx, MDIO_MMD_PMAPMD, efx 285 drivers/net/ethernet/sfc/falcon/tenxpress.c netif_err(efx, link, efx->net_dev, efx 291 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_write(efx, MDIO_MMD_PMAPMD, efx 297 drivers/net/ethernet/sfc/falcon/tenxpress.c static bool sfx7101_link_ok(struct ef4_nic *efx) efx 299 drivers/net/ethernet/sfc/falcon/tenxpress.c return ef4_mdio_links_ok(efx, efx 305 drivers/net/ethernet/sfc/falcon/tenxpress.c static void tenxpress_ext_loopback(struct ef4_nic *efx) efx 307 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_set_flag(efx, MDIO_MMD_PHYXS, PHYXS_TEST1, efx 309 drivers/net/ethernet/sfc/falcon/tenxpress.c efx->loopback_mode == LOOPBACK_PHYXS); efx 312 drivers/net/ethernet/sfc/falcon/tenxpress.c static void tenxpress_low_power(struct ef4_nic *efx) efx 315 drivers/net/ethernet/sfc/falcon/tenxpress.c efx, !!(efx->phy_mode & PHY_MODE_LOW_POWER), efx 319 drivers/net/ethernet/sfc/falcon/tenxpress.c static int tenxpress_phy_reconfigure(struct ef4_nic *efx) efx 321 drivers/net/ethernet/sfc/falcon/tenxpress.c struct tenxpress_phy_data *phy_data = efx->phy_data; efx 324 drivers/net/ethernet/sfc/falcon/tenxpress.c if (efx->phy_mode & (PHY_MODE_OFF | PHY_MODE_SPECIAL)) { efx 325 drivers/net/ethernet/sfc/falcon/tenxpress.c phy_data->phy_mode = efx->phy_mode; efx 329 drivers/net/ethernet/sfc/falcon/tenxpress.c phy_mode_change = (efx->phy_mode == PHY_MODE_NORMAL && efx 331 drivers/net/ethernet/sfc/falcon/tenxpress.c loop_reset = (LOOPBACK_OUT_OF(phy_data, efx, LOOPBACKS_EXTERNAL(efx)) || efx 332 drivers/net/ethernet/sfc/falcon/tenxpress.c LOOPBACK_CHANGED(phy_data, efx, 1 << LOOPBACK_GPHY)); efx 335 drivers/net/ethernet/sfc/falcon/tenxpress.c tenxpress_special_reset(efx); efx 336 drivers/net/ethernet/sfc/falcon/tenxpress.c falcon_reset_xaui(efx); efx 339 drivers/net/ethernet/sfc/falcon/tenxpress.c tenxpress_low_power(efx); efx 340 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_transmit_disable(efx); efx 341 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_phy_reconfigure(efx); efx 342 drivers/net/ethernet/sfc/falcon/tenxpress.c tenxpress_ext_loopback(efx); efx 343 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_an_reconfigure(efx); efx 345 drivers/net/ethernet/sfc/falcon/tenxpress.c phy_data->loopback_mode = efx->loopback_mode; efx 346 drivers/net/ethernet/sfc/falcon/tenxpress.c phy_data->phy_mode = efx->phy_mode; efx 352 drivers/net/ethernet/sfc/falcon/tenxpress.c static bool tenxpress_phy_poll(struct ef4_nic *efx) efx 354 drivers/net/ethernet/sfc/falcon/tenxpress.c struct ef4_link_state old_state = efx->link_state; efx 356 drivers/net/ethernet/sfc/falcon/tenxpress.c efx->link_state.up = sfx7101_link_ok(efx); efx 357 drivers/net/ethernet/sfc/falcon/tenxpress.c efx->link_state.speed = 10000; efx 358 drivers/net/ethernet/sfc/falcon/tenxpress.c efx->link_state.fd = true; efx 359 drivers/net/ethernet/sfc/falcon/tenxpress.c efx->link_state.fc = ef4_mdio_get_pause(efx); efx 361 drivers/net/ethernet/sfc/falcon/tenxpress.c sfx7101_check_bad_lp(efx, efx->link_state.up); efx 363 drivers/net/ethernet/sfc/falcon/tenxpress.c return !ef4_link_state_equal(&efx->link_state, &old_state); efx 366 drivers/net/ethernet/sfc/falcon/tenxpress.c static void sfx7101_phy_fini(struct ef4_nic *efx) efx 372 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_write(efx, MDIO_MMD_PMAPMD, PMA_PMD_XCONTROL_REG, reg); efx 380 drivers/net/ethernet/sfc/falcon/tenxpress.c static void tenxpress_phy_remove(struct ef4_nic *efx) efx 382 drivers/net/ethernet/sfc/falcon/tenxpress.c kfree(efx->phy_data); efx 383 drivers/net/ethernet/sfc/falcon/tenxpress.c efx->phy_data = NULL; efx 388 drivers/net/ethernet/sfc/falcon/tenxpress.c void tenxpress_set_id_led(struct ef4_nic *efx, enum ef4_led_mode mode) efx 408 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_write(efx, MDIO_MMD_PMAPMD, PMA_PMD_LED_OVERR_REG, reg); efx 415 drivers/net/ethernet/sfc/falcon/tenxpress.c static const char *sfx7101_test_name(struct ef4_nic *efx, unsigned int index) efx 423 drivers/net/ethernet/sfc/falcon/tenxpress.c sfx7101_run_tests(struct ef4_nic *efx, int *results, unsigned flags) efx 431 drivers/net/ethernet/sfc/falcon/tenxpress.c rc = tenxpress_special_reset(efx); efx 434 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_an_reconfigure(efx); efx 440 drivers/net/ethernet/sfc/falcon/tenxpress.c tenxpress_get_link_ksettings(struct ef4_nic *efx, efx 446 drivers/net/ethernet/sfc/falcon/tenxpress.c reg = ef4_mdio_read(efx, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL); efx 449 drivers/net/ethernet/sfc/falcon/tenxpress.c reg = ef4_mdio_read(efx, MDIO_MMD_AN, MDIO_AN_10GBT_STAT); efx 453 drivers/net/ethernet/sfc/falcon/tenxpress.c mdio45_ethtool_ksettings_get_npage(&efx->mdio, cmd, adv, lpa); efx 457 drivers/net/ethernet/sfc/falcon/tenxpress.c if (LOOPBACK_EXTERNAL(efx)) efx 462 drivers/net/ethernet/sfc/falcon/tenxpress.c tenxpress_set_link_ksettings(struct ef4_nic *efx, efx 468 drivers/net/ethernet/sfc/falcon/tenxpress.c return ef4_mdio_set_link_ksettings(efx, cmd); efx 471 drivers/net/ethernet/sfc/falcon/tenxpress.c static void sfx7101_set_npage_adv(struct ef4_nic *efx, u32 advertising) efx 473 drivers/net/ethernet/sfc/falcon/tenxpress.c ef4_mdio_set_flag(efx, MDIO_MMD_AN, MDIO_AN_10GBT_CTRL, efx 35 drivers/net/ethernet/sfc/falcon/tx.c ef4_nic_alloc_buffer(tx_queue->efx, page_buf, PAGE_SIZE, efx 57 drivers/net/ethernet/sfc/falcon/tx.c struct device *dma_dev = &tx_queue->efx->pci_dev->dev; efx 72 drivers/net/ethernet/sfc/falcon/tx.c netif_vdbg(tx_queue->efx, tx_done, tx_queue->efx->net_dev, efx 81 drivers/net/ethernet/sfc/falcon/tx.c unsigned int ef4_tx_max_skb_descs(struct ef4_nic *efx) efx 95 drivers/net/ethernet/sfc/falcon/tx.c if (EF4_WORKAROUND_5391(efx)) efx 110 drivers/net/ethernet/sfc/falcon/tx.c struct ef4_nic *efx = txq1->efx; efx 115 drivers/net/ethernet/sfc/falcon/tx.c if (likely(fill_level < efx->txq_stop_thresh)) efx 139 drivers/net/ethernet/sfc/falcon/tx.c EF4_BUG_ON_PARANOID(fill_level >= efx->txq_entries); efx 140 drivers/net/ethernet/sfc/falcon/tx.c if (likely(fill_level < efx->txq_stop_thresh)) { efx 142 drivers/net/ethernet/sfc/falcon/tx.c if (likely(!efx->loopback_selftest)) efx 184 drivers/net/ethernet/sfc/falcon/tx.c const struct ef4_nic_type *nic_type = tx_queue->efx->type; efx 208 drivers/net/ethernet/sfc/falcon/tx.c struct ef4_nic *efx = tx_queue->efx; efx 209 drivers/net/ethernet/sfc/falcon/tx.c struct device *dma_dev = &efx->pci_dev->dev; efx 359 drivers/net/ethernet/sfc/falcon/tx.c struct ef4_nic *efx = tx_queue->efx; efx 370 drivers/net/ethernet/sfc/falcon/tx.c netif_err(efx, tx_err, efx->net_dev, efx 373 drivers/net/ethernet/sfc/falcon/tx.c ef4_schedule_reset(efx, RESET_TYPE_TX_SKIP); efx 396 drivers/net/ethernet/sfc/falcon/tx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 404 drivers/net/ethernet/sfc/falcon/tx.c if (index >= efx->n_tx_channels) { efx 405 drivers/net/ethernet/sfc/falcon/tx.c index -= efx->n_tx_channels; efx 408 drivers/net/ethernet/sfc/falcon/tx.c tx_queue = ef4_get_tx_queue(efx, index, type); efx 415 drivers/net/ethernet/sfc/falcon/tx.c struct ef4_nic *efx = tx_queue->efx; efx 419 drivers/net/ethernet/sfc/falcon/tx.c netdev_get_tx_queue(efx->net_dev, efx 422 drivers/net/ethernet/sfc/falcon/tx.c efx->n_tx_channels : 0)); efx 428 drivers/net/ethernet/sfc/falcon/tx.c struct ef4_nic *efx = netdev_priv(net_dev); efx 440 drivers/net/ethernet/sfc/falcon/tx.c if (ef4_nic_rev(efx) < EF4_REV_FALCON_B0 || num_tc > EF4_MAX_TX_TC) efx 449 drivers/net/ethernet/sfc/falcon/tx.c net_dev->tc_to_txq[tc].offset = tc * efx->n_tx_channels; efx 450 drivers/net/ethernet/sfc/falcon/tx.c net_dev->tc_to_txq[tc].count = efx->n_tx_channels; efx 455 drivers/net/ethernet/sfc/falcon/tx.c ef4_for_each_channel(channel, efx) { efx 477 drivers/net/ethernet/sfc/falcon/tx.c efx->n_tx_channels); efx 494 drivers/net/ethernet/sfc/falcon/tx.c struct ef4_nic *efx = tx_queue->efx; efx 513 drivers/net/ethernet/sfc/falcon/tx.c likely(efx->port_enabled) && efx 514 drivers/net/ethernet/sfc/falcon/tx.c likely(netif_device_present(efx->net_dev))) { efx 518 drivers/net/ethernet/sfc/falcon/tx.c if (fill_level <= efx->txq_wake_thresh) efx 540 drivers/net/ethernet/sfc/falcon/tx.c struct ef4_nic *efx = tx_queue->efx; efx 545 drivers/net/ethernet/sfc/falcon/tx.c entries = max(roundup_pow_of_two(efx->txq_entries), EF4_MIN_DMAQ_SIZE); efx 549 drivers/net/ethernet/sfc/falcon/tx.c netif_dbg(efx, probe, efx->net_dev, efx 551 drivers/net/ethernet/sfc/falcon/tx.c tx_queue->queue, efx->txq_entries, tx_queue->ptr_mask); efx 584 drivers/net/ethernet/sfc/falcon/tx.c struct ef4_nic *efx = tx_queue->efx; efx 586 drivers/net/ethernet/sfc/falcon/tx.c netif_dbg(efx, drv, efx->net_dev, efx 598 drivers/net/ethernet/sfc/falcon/tx.c tx_queue->tx_min_size = EF4_WORKAROUND_15592(efx) ? 33 : 0; efx 610 drivers/net/ethernet/sfc/falcon/tx.c netif_dbg(tx_queue->efx, drv, tx_queue->efx->net_dev, efx 635 drivers/net/ethernet/sfc/falcon/tx.c netif_dbg(tx_queue->efx, drv, tx_queue->efx->net_dev, efx 641 drivers/net/ethernet/sfc/falcon/tx.c ef4_nic_free_buffer(tx_queue->efx, efx 168 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static void txc_reset_logic(struct ef4_nic *efx); efx 171 drivers/net/ethernet/sfc/falcon/txc43128_phy.c void falcon_txc_set_gpio_val(struct ef4_nic *efx, int pin, int on) efx 173 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_set_flag(efx, MDIO_MMD_PHYXS, TXC_GPIO_OUTPUT, 1 << pin, on); efx 177 drivers/net/ethernet/sfc/falcon/txc43128_phy.c void falcon_txc_set_gpio_dir(struct ef4_nic *efx, int pin, int dir) efx 179 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_set_flag(efx, MDIO_MMD_PHYXS, TXC_GPIO_DIR, 1 << pin, dir); efx 184 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static int txc_reset_phy(struct ef4_nic *efx) efx 186 drivers/net/ethernet/sfc/falcon/txc43128_phy.c int rc = ef4_mdio_reset_mmd(efx, MDIO_MMD_PMAPMD, efx 193 drivers/net/ethernet/sfc/falcon/txc43128_phy.c rc = ef4_mdio_check_mmds(efx, TXC_REQUIRED_DEVS); efx 200 drivers/net/ethernet/sfc/falcon/txc43128_phy.c netif_err(efx, hw, efx->net_dev, TXCNAME ": reset timed out!\n"); efx 205 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static int txc_bist_one(struct ef4_nic *efx, int mmd, int test) efx 212 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ctrl = ef4_mdio_read(efx, MDIO_MMD_PCS, TXC_MTDIABLO_CTRL); efx 214 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PCS, TXC_MTDIABLO_CTRL, ctrl); efx 219 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, mmd, TXC_BIST_CTL, bctl); efx 223 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, mmd, TXC_BIST_CTL, bctl); efx 226 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, mmd, TXC_BIST_CTL, efx 234 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, mmd, TXC_BIST_CTL, bctl); efx 238 drivers/net/ethernet/sfc/falcon/txc43128_phy.c bctl = ef4_mdio_read(efx, mmd, TXC_BIST_CTL); efx 243 drivers/net/ethernet/sfc/falcon/txc43128_phy.c int count = ef4_mdio_read(efx, mmd, TXC_BIST_RX0ERRCNT + lane); efx 245 drivers/net/ethernet/sfc/falcon/txc43128_phy.c netif_err(efx, hw, efx->net_dev, TXCNAME": BIST error. " efx 249 drivers/net/ethernet/sfc/falcon/txc43128_phy.c count = ef4_mdio_read(efx, mmd, TXC_BIST_RX0FRMCNT + lane); efx 251 drivers/net/ethernet/sfc/falcon/txc43128_phy.c netif_err(efx, hw, efx->net_dev, TXCNAME": BIST error. " efx 258 drivers/net/ethernet/sfc/falcon/txc43128_phy.c netif_info(efx, hw, efx->net_dev, TXCNAME": BIST pass\n"); efx 261 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, mmd, TXC_BIST_CTL, 0); efx 265 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PCS, TXC_MTDIABLO_CTRL, ctrl); efx 270 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static int txc_bist(struct ef4_nic *efx) efx 272 drivers/net/ethernet/sfc/falcon/txc43128_phy.c return txc_bist_one(efx, MDIO_MMD_PCS, TXC_BIST_CTRL_TYPE_TSD); efx 277 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static void txc_apply_defaults(struct ef4_nic *efx) efx 287 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PHYXS, TXC_ALRGS_ATXPRE0, TXC_ATXPRE_NONE); efx 288 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PHYXS, TXC_ALRGS_ATXPRE1, TXC_ATXPRE_NONE); efx 291 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PHYXS, efx 293 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PHYXS, efx 299 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PMAPMD, efx 301 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PMAPMD, efx 303 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PMAPMD, efx 305 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PMAPMD, efx 309 drivers/net/ethernet/sfc/falcon/txc43128_phy.c mctrl = ef4_mdio_read(efx, MDIO_MMD_PHYXS, TXC_MRGS_CTL); efx 313 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PHYXS, TXC_MRGS_CTL, mctrl); efx 316 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_reset_logic(efx); efx 318 drivers/net/ethernet/sfc/falcon/txc43128_phy.c falcon_board(efx)->type->init_phy(efx); efx 321 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static int txc43128_phy_probe(struct ef4_nic *efx) efx 329 drivers/net/ethernet/sfc/falcon/txc43128_phy.c efx->phy_data = phy_data; efx 330 drivers/net/ethernet/sfc/falcon/txc43128_phy.c phy_data->phy_mode = efx->phy_mode; efx 332 drivers/net/ethernet/sfc/falcon/txc43128_phy.c efx->mdio.mmds = TXC_REQUIRED_DEVS; efx 333 drivers/net/ethernet/sfc/falcon/txc43128_phy.c efx->mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22; efx 335 drivers/net/ethernet/sfc/falcon/txc43128_phy.c efx->loopback_modes = TXC_LOOPBACKS | FALCON_XMAC_LOOPBACKS; efx 341 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static int txc43128_phy_init(struct ef4_nic *efx) efx 345 drivers/net/ethernet/sfc/falcon/txc43128_phy.c rc = txc_reset_phy(efx); efx 349 drivers/net/ethernet/sfc/falcon/txc43128_phy.c rc = txc_bist(efx); efx 353 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_apply_defaults(efx); efx 359 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static void txc_glrgs_lane_power(struct ef4_nic *efx, int mmd) efx 362 drivers/net/ethernet/sfc/falcon/txc43128_phy.c int ctl = ef4_mdio_read(efx, mmd, TXC_GLRGS_GLCMD); efx 364 drivers/net/ethernet/sfc/falcon/txc43128_phy.c if (!(efx->phy_mode & PHY_MODE_LOW_POWER)) efx 369 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, mmd, TXC_GLRGS_GLCMD, ctl); efx 373 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static void txc_analog_lane_power(struct ef4_nic *efx, int mmd) efx 379 drivers/net/ethernet/sfc/falcon/txc43128_phy.c int txctl = ef4_mdio_read(efx, mmd, TXC_ALRGS_ATXCTL); efx 380 drivers/net/ethernet/sfc/falcon/txc43128_phy.c int rxctl = ef4_mdio_read(efx, mmd, TXC_ALRGS_ARXCTL); efx 382 drivers/net/ethernet/sfc/falcon/txc43128_phy.c if (!(efx->phy_mode & PHY_MODE_LOW_POWER)) { efx 390 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, mmd, TXC_ALRGS_ATXCTL, txctl); efx 391 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, mmd, TXC_ALRGS_ARXCTL, rxctl); efx 394 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static void txc_set_power(struct ef4_nic *efx) efx 397 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_set_mmds_lpower(efx, efx 398 drivers/net/ethernet/sfc/falcon/txc43128_phy.c !!(efx->phy_mode & PHY_MODE_LOW_POWER), efx 403 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_glrgs_lane_power(efx, MDIO_MMD_PCS); efx 404 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_glrgs_lane_power(efx, MDIO_MMD_PHYXS); efx 407 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_analog_lane_power(efx, MDIO_MMD_PMAPMD); efx 408 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_analog_lane_power(efx, MDIO_MMD_PHYXS); efx 411 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static void txc_reset_logic_mmd(struct ef4_nic *efx, int mmd) efx 413 drivers/net/ethernet/sfc/falcon/txc43128_phy.c int val = ef4_mdio_read(efx, mmd, TXC_GLRGS_GLCMD); efx 417 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, mmd, TXC_GLRGS_GLCMD, val); efx 419 drivers/net/ethernet/sfc/falcon/txc43128_phy.c val = ef4_mdio_read(efx, mmd, TXC_GLRGS_GLCMD); efx 425 drivers/net/ethernet/sfc/falcon/txc43128_phy.c netif_info(efx, hw, efx->net_dev, efx 431 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static void txc_reset_logic(struct ef4_nic *efx) efx 436 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_reset_logic_mmd(efx, MDIO_MMD_PCS); efx 439 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static bool txc43128_phy_read_link(struct ef4_nic *efx) efx 441 drivers/net/ethernet/sfc/falcon/txc43128_phy.c return ef4_mdio_links_ok(efx, TXC_REQUIRED_DEVS); efx 444 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static int txc43128_phy_reconfigure(struct ef4_nic *efx) efx 446 drivers/net/ethernet/sfc/falcon/txc43128_phy.c struct txc43128_data *phy_data = efx->phy_data; efx 447 drivers/net/ethernet/sfc/falcon/txc43128_phy.c enum ef4_phy_mode mode_change = efx->phy_mode ^ phy_data->phy_mode; efx 448 drivers/net/ethernet/sfc/falcon/txc43128_phy.c bool loop_change = LOOPBACK_CHANGED(phy_data, efx, TXC_LOOPBACKS); efx 450 drivers/net/ethernet/sfc/falcon/txc43128_phy.c if (efx->phy_mode & mode_change & PHY_MODE_TX_DISABLED) { efx 451 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_reset_phy(efx); efx 452 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_apply_defaults(efx); efx 453 drivers/net/ethernet/sfc/falcon/txc43128_phy.c falcon_reset_xaui(efx); efx 457 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_transmit_disable(efx); efx 458 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_phy_reconfigure(efx); efx 460 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_set_power(efx); efx 467 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_reset_logic(efx); efx 469 drivers/net/ethernet/sfc/falcon/txc43128_phy.c phy_data->phy_mode = efx->phy_mode; efx 470 drivers/net/ethernet/sfc/falcon/txc43128_phy.c phy_data->loopback_mode = efx->loopback_mode; efx 475 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static void txc43128_phy_fini(struct ef4_nic *efx) efx 478 drivers/net/ethernet/sfc/falcon/txc43128_phy.c ef4_mdio_write(efx, MDIO_MMD_PMAPMD, MDIO_PMA_LASI_CTRL, 0); efx 481 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static void txc43128_phy_remove(struct ef4_nic *efx) efx 483 drivers/net/ethernet/sfc/falcon/txc43128_phy.c kfree(efx->phy_data); efx 484 drivers/net/ethernet/sfc/falcon/txc43128_phy.c efx->phy_data = NULL; efx 489 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static bool txc43128_phy_poll(struct ef4_nic *efx) efx 491 drivers/net/ethernet/sfc/falcon/txc43128_phy.c struct txc43128_data *data = efx->phy_data; efx 492 drivers/net/ethernet/sfc/falcon/txc43128_phy.c bool was_up = efx->link_state.up; efx 494 drivers/net/ethernet/sfc/falcon/txc43128_phy.c efx->link_state.up = txc43128_phy_read_link(efx); efx 495 drivers/net/ethernet/sfc/falcon/txc43128_phy.c efx->link_state.speed = 10000; efx 496 drivers/net/ethernet/sfc/falcon/txc43128_phy.c efx->link_state.fd = true; efx 497 drivers/net/ethernet/sfc/falcon/txc43128_phy.c efx->link_state.fc = efx->wanted_fc; efx 499 drivers/net/ethernet/sfc/falcon/txc43128_phy.c if (efx->link_state.up || (efx->loopback_mode != LOOPBACK_NONE)) { efx 505 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_reset_logic(efx); efx 509 drivers/net/ethernet/sfc/falcon/txc43128_phy.c return efx->link_state.up != was_up; efx 516 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static const char *txc43128_test_name(struct ef4_nic *efx, unsigned int index) efx 523 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static int txc43128_run_tests(struct ef4_nic *efx, int *results, unsigned flags) efx 530 drivers/net/ethernet/sfc/falcon/txc43128_phy.c rc = txc_reset_phy(efx); efx 534 drivers/net/ethernet/sfc/falcon/txc43128_phy.c rc = txc_bist(efx); efx 535 drivers/net/ethernet/sfc/falcon/txc43128_phy.c txc_apply_defaults(efx); efx 540 drivers/net/ethernet/sfc/falcon/txc43128_phy.c static void txc43128_get_link_ksettings(struct ef4_nic *efx, efx 543 drivers/net/ethernet/sfc/falcon/txc43128_phy.c mdio45_ethtool_ksettings_get(&efx->mdio, cmd); efx 15 drivers/net/ethernet/sfc/falcon/workarounds.h #define EF4_WORKAROUND_FALCON_A(efx) (ef4_nic_rev(efx) <= EF4_REV_FALCON_A1) efx 16 drivers/net/ethernet/sfc/falcon/workarounds.h #define EF4_WORKAROUND_FALCON_AB(efx) (ef4_nic_rev(efx) <= EF4_REV_FALCON_B0) efx 17 drivers/net/ethernet/sfc/falcon/workarounds.h #define EF4_WORKAROUND_10G(efx) 1 efx 86 drivers/net/ethernet/sfc/farch.c static inline void efx_write_buf_tbl(struct efx_nic *efx, efx_qword_t *value, efx 89 drivers/net/ethernet/sfc/farch.c efx_sram_writeq(efx, efx->membase + efx->type->buf_tbl_base, efx 100 drivers/net/ethernet/sfc/farch.c int efx_farch_test_registers(struct efx_nic *efx, efx 113 drivers/net/ethernet/sfc/farch.c efx_reado(efx, &original, address); efx 124 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, ®, address); efx 125 drivers/net/ethernet/sfc/farch.c efx_reado(efx, &buf, address); efx 134 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, ®, address); efx 135 drivers/net/ethernet/sfc/farch.c efx_reado(efx, &buf, address); efx 141 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &original, address); efx 147 drivers/net/ethernet/sfc/farch.c netif_err(efx, hw, efx->net_dev, efx 170 drivers/net/ethernet/sfc/farch.c efx_init_special_buffer(struct efx_nic *efx, struct efx_special_buffer *buffer) efx 183 drivers/net/ethernet/sfc/farch.c netif_dbg(efx, probe, efx->net_dev, efx 190 drivers/net/ethernet/sfc/farch.c efx_write_buf_tbl(efx, &buf_desc, index); efx 196 drivers/net/ethernet/sfc/farch.c efx_fini_special_buffer(struct efx_nic *efx, struct efx_special_buffer *buffer) efx 205 drivers/net/ethernet/sfc/farch.c netif_dbg(efx, hw, efx->net_dev, "unmapping special buffers %d-%d\n", efx 213 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &buf_tbl_upd, FR_AZ_BUF_TBL_UPD); efx 225 drivers/net/ethernet/sfc/farch.c static int efx_alloc_special_buffer(struct efx_nic *efx, efx 230 drivers/net/ethernet/sfc/farch.c struct siena_nic_data *nic_data = efx->nic_data; efx 234 drivers/net/ethernet/sfc/farch.c if (efx_nic_alloc_buffer(efx, &buffer->buf, len, GFP_KERNEL)) efx 240 drivers/net/ethernet/sfc/farch.c buffer->index = efx->next_buffer_table; efx 241 drivers/net/ethernet/sfc/farch.c efx->next_buffer_table += buffer->entries; efx 243 drivers/net/ethernet/sfc/farch.c BUG_ON(efx_siena_sriov_enabled(efx) && efx 244 drivers/net/ethernet/sfc/farch.c nic_data->vf_buftbl_base < efx->next_buffer_table); efx 247 drivers/net/ethernet/sfc/farch.c netif_dbg(efx, probe, efx->net_dev, efx 258 drivers/net/ethernet/sfc/farch.c efx_free_special_buffer(struct efx_nic *efx, struct efx_special_buffer *buffer) efx 263 drivers/net/ethernet/sfc/farch.c netif_dbg(efx, hw, efx->net_dev, efx 270 drivers/net/ethernet/sfc/farch.c efx_nic_free_buffer(efx, &buffer->buf); efx 288 drivers/net/ethernet/sfc/farch.c efx_writed_page(tx_queue->efx, ®, efx 306 drivers/net/ethernet/sfc/farch.c efx_writeo_page(tx_queue->efx, ®, efx 371 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = tx_queue->efx; efx 375 drivers/net/ethernet/sfc/farch.c return efx_alloc_special_buffer(efx, &tx_queue->txd, efx 382 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = tx_queue->efx; efx 386 drivers/net/ethernet/sfc/farch.c efx_init_special_buffer(efx, &tx_queue->txd); efx 406 drivers/net/ethernet/sfc/farch.c efx_writeo_table(efx, ®, efx->type->txd_ptr_tbl_base, efx 414 drivers/net/ethernet/sfc/farch.c efx_writeo_table(efx, ®, FR_BZ_TX_PACE_TBL, tx_queue->queue); efx 419 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = tx_queue->efx; efx 428 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &tx_flush_descq, FR_AZ_TX_FLUSH_DESCQ); efx 433 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = tx_queue->efx; efx 438 drivers/net/ethernet/sfc/farch.c efx_writeo_table(efx, &tx_desc_ptr, efx->type->txd_ptr_tbl_base, efx 442 drivers/net/ethernet/sfc/farch.c efx_fini_special_buffer(efx, &tx_queue->txd); efx 448 drivers/net/ethernet/sfc/farch.c efx_free_special_buffer(tx_queue->efx, &tx_queue->txd); efx 469 drivers/net/ethernet/sfc/farch.c rx_queue->efx->type->rx_buffer_padding, efx 479 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = rx_queue->efx; efx 493 drivers/net/ethernet/sfc/farch.c efx_writed_page(efx, ®, FR_AZ_RX_DESC_UPD_DWORD_P0, efx 499 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = rx_queue->efx; efx 503 drivers/net/ethernet/sfc/farch.c return efx_alloc_special_buffer(efx, &rx_queue->rxd, efx 510 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = rx_queue->efx; efx 514 drivers/net/ethernet/sfc/farch.c jumbo_en = efx->rx_scatter; efx 516 drivers/net/ethernet/sfc/farch.c netif_dbg(efx, hw, efx->net_dev, efx 524 drivers/net/ethernet/sfc/farch.c efx_init_special_buffer(efx, &rx_queue->rxd); efx 541 drivers/net/ethernet/sfc/farch.c efx_writeo_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base, efx 547 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = rx_queue->efx; efx 554 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &rx_flush_descq, FR_AZ_RX_FLUSH_DESCQ); efx 560 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = rx_queue->efx; efx 564 drivers/net/ethernet/sfc/farch.c efx_writeo_table(efx, &rx_desc_ptr, efx->type->rxd_ptr_tbl_base, efx 568 drivers/net/ethernet/sfc/farch.c efx_fini_special_buffer(efx, &rx_queue->rxd); efx 574 drivers/net/ethernet/sfc/farch.c efx_free_special_buffer(rx_queue->efx, &rx_queue->rxd); efx 586 drivers/net/ethernet/sfc/farch.c static bool efx_farch_flush_wake(struct efx_nic *efx) efx 591 drivers/net/ethernet/sfc/farch.c return (atomic_read(&efx->active_queues) == 0 || efx 592 drivers/net/ethernet/sfc/farch.c (atomic_read(&efx->rxq_flush_outstanding) < EFX_RX_FLUSH_COUNT efx 593 drivers/net/ethernet/sfc/farch.c && atomic_read(&efx->rxq_flush_pending) > 0)); efx 596 drivers/net/ethernet/sfc/farch.c static bool efx_check_tx_flush_complete(struct efx_nic *efx) efx 603 drivers/net/ethernet/sfc/farch.c efx_for_each_channel(channel, efx) { efx 605 drivers/net/ethernet/sfc/farch.c efx_reado_table(efx, &txd_ptr_tbl, efx 611 drivers/net/ethernet/sfc/farch.c netif_dbg(efx, hw, efx->net_dev, efx 620 drivers/net/ethernet/sfc/farch.c netif_dbg(efx, hw, efx->net_dev, efx 640 drivers/net/ethernet/sfc/farch.c static int efx_farch_do_flush(struct efx_nic *efx) efx 648 drivers/net/ethernet/sfc/farch.c efx_for_each_channel(channel, efx) { efx 654 drivers/net/ethernet/sfc/farch.c atomic_inc(&efx->rxq_flush_pending); efx 658 drivers/net/ethernet/sfc/farch.c while (timeout && atomic_read(&efx->active_queues) > 0) { efx 663 drivers/net/ethernet/sfc/farch.c if (efx_siena_sriov_enabled(efx)) { efx 664 drivers/net/ethernet/sfc/farch.c rc = efx_mcdi_flush_rxqs(efx); efx 673 drivers/net/ethernet/sfc/farch.c efx_for_each_channel(channel, efx) { efx 675 drivers/net/ethernet/sfc/farch.c if (atomic_read(&efx->rxq_flush_outstanding) >= efx 681 drivers/net/ethernet/sfc/farch.c atomic_dec(&efx->rxq_flush_pending); efx 682 drivers/net/ethernet/sfc/farch.c atomic_inc(&efx->rxq_flush_outstanding); efx 689 drivers/net/ethernet/sfc/farch.c timeout = wait_event_timeout(efx->flush_wq, efx 690 drivers/net/ethernet/sfc/farch.c efx_farch_flush_wake(efx), efx 694 drivers/net/ethernet/sfc/farch.c if (atomic_read(&efx->active_queues) && efx 695 drivers/net/ethernet/sfc/farch.c !efx_check_tx_flush_complete(efx)) { efx 696 drivers/net/ethernet/sfc/farch.c netif_err(efx, hw, efx->net_dev, "failed to flush %d queues " efx 697 drivers/net/ethernet/sfc/farch.c "(rx %d+%d)\n", atomic_read(&efx->active_queues), efx 698 drivers/net/ethernet/sfc/farch.c atomic_read(&efx->rxq_flush_outstanding), efx 699 drivers/net/ethernet/sfc/farch.c atomic_read(&efx->rxq_flush_pending)); efx 702 drivers/net/ethernet/sfc/farch.c atomic_set(&efx->active_queues, 0); efx 703 drivers/net/ethernet/sfc/farch.c atomic_set(&efx->rxq_flush_pending, 0); efx 704 drivers/net/ethernet/sfc/farch.c atomic_set(&efx->rxq_flush_outstanding, 0); efx 710 drivers/net/ethernet/sfc/farch.c int efx_farch_fini_dmaq(struct efx_nic *efx) efx 718 drivers/net/ethernet/sfc/farch.c if (efx->state != STATE_RECOVERY) { efx 720 drivers/net/ethernet/sfc/farch.c if (efx->pci_dev->is_busmaster) { efx 721 drivers/net/ethernet/sfc/farch.c efx->type->prepare_flush(efx); efx 722 drivers/net/ethernet/sfc/farch.c rc = efx_farch_do_flush(efx); efx 723 drivers/net/ethernet/sfc/farch.c efx->type->finish_flush(efx); efx 726 drivers/net/ethernet/sfc/farch.c efx_for_each_channel(channel, efx) { efx 751 drivers/net/ethernet/sfc/farch.c void efx_farch_finish_flr(struct efx_nic *efx) efx 753 drivers/net/ethernet/sfc/farch.c atomic_set(&efx->rxq_flush_pending, 0); efx 754 drivers/net/ethernet/sfc/farch.c atomic_set(&efx->rxq_flush_outstanding, 0); efx 755 drivers/net/ethernet/sfc/farch.c atomic_set(&efx->active_queues, 0); efx 774 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = channel->efx; efx 782 drivers/net/ethernet/sfc/farch.c efx_writed(efx, ®, efx 783 drivers/net/ethernet/sfc/farch.c efx->type->evq_rptr_tbl_base + efx 788 drivers/net/ethernet/sfc/farch.c void efx_farch_generate_event(struct efx_nic *efx, unsigned int evq, efx 800 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &drv_ev_reg, FR_AZ_DRV_EV); efx 810 drivers/net/ethernet/sfc/farch.c efx_farch_generate_event(channel->efx, channel->channel, &event); efx 824 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = channel->efx; efx 826 drivers/net/ethernet/sfc/farch.c if (unlikely(READ_ONCE(efx->reset_pending))) efx 842 drivers/net/ethernet/sfc/farch.c netif_tx_lock(efx->net_dev); efx 844 drivers/net/ethernet/sfc/farch.c netif_tx_unlock(efx->net_dev); efx 846 drivers/net/ethernet/sfc/farch.c efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR); efx 848 drivers/net/ethernet/sfc/farch.c netif_err(efx, tx_err, efx->net_dev, efx 860 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = rx_queue->efx; efx 893 drivers/net/ethernet/sfc/farch.c else if (!efx->loopback_selftest) { efx 906 drivers/net/ethernet/sfc/farch.c netif_dbg(efx, rx_err, efx->net_dev, efx 922 drivers/net/ethernet/sfc/farch.c if (efx->net_dev->features & NETIF_F_RXALL) efx 940 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = rx_queue->efx; efx 952 drivers/net/ethernet/sfc/farch.c netif_info(efx, rx_err, efx->net_dev, efx 956 drivers/net/ethernet/sfc/farch.c efx_schedule_reset(efx, RESET_TYPE_DISABLE); efx 976 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = channel->efx; efx 978 drivers/net/ethernet/sfc/farch.c if (unlikely(READ_ONCE(efx->reset_pending))) efx 1079 drivers/net/ethernet/sfc/farch.c efx_farch_handle_tx_flush_done(struct efx_nic *efx, efx_qword_t *event) efx 1085 drivers/net/ethernet/sfc/farch.c if (qid < EFX_TXQ_TYPES * (efx->n_tx_channels + efx->n_extra_tx_channels)) { efx 1086 drivers/net/ethernet/sfc/farch.c tx_queue = efx_get_tx_queue(efx, qid / EFX_TXQ_TYPES, efx 1100 drivers/net/ethernet/sfc/farch.c efx_farch_handle_rx_flush_done(struct efx_nic *efx, efx_qword_t *event) efx 1109 drivers/net/ethernet/sfc/farch.c if (qid >= efx->n_channels) efx 1111 drivers/net/ethernet/sfc/farch.c channel = efx_get_channel(efx, qid); efx 1117 drivers/net/ethernet/sfc/farch.c netif_info(efx, hw, efx->net_dev, efx 1120 drivers/net/ethernet/sfc/farch.c atomic_inc(&efx->rxq_flush_pending); efx 1125 drivers/net/ethernet/sfc/farch.c atomic_dec(&efx->rxq_flush_outstanding); efx 1126 drivers/net/ethernet/sfc/farch.c if (efx_farch_flush_wake(efx)) efx 1127 drivers/net/ethernet/sfc/farch.c wake_up(&efx->flush_wq); efx 1133 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = channel->efx; efx 1135 drivers/net/ethernet/sfc/farch.c WARN_ON(atomic_read(&efx->active_queues) == 0); efx 1136 drivers/net/ethernet/sfc/farch.c atomic_dec(&efx->active_queues); efx 1137 drivers/net/ethernet/sfc/farch.c if (efx_farch_flush_wake(efx)) efx 1138 drivers/net/ethernet/sfc/farch.c wake_up(&efx->flush_wq); efx 1144 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = channel->efx; efx 1165 drivers/net/ethernet/sfc/farch.c netif_dbg(efx, hw, efx->net_dev, "channel %d received " efx 1174 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = channel->efx; efx 1183 drivers/net/ethernet/sfc/farch.c netif_vdbg(efx, hw, efx->net_dev, "channel %d TXQ %d flushed\n", efx 1185 drivers/net/ethernet/sfc/farch.c efx_farch_handle_tx_flush_done(efx, event); efx 1187 drivers/net/ethernet/sfc/farch.c efx_siena_sriov_tx_flush_done(efx, event); efx 1191 drivers/net/ethernet/sfc/farch.c netif_vdbg(efx, hw, efx->net_dev, "channel %d RXQ %d flushed\n", efx 1193 drivers/net/ethernet/sfc/farch.c efx_farch_handle_rx_flush_done(efx, event); efx 1195 drivers/net/ethernet/sfc/farch.c efx_siena_sriov_rx_flush_done(efx, event); efx 1199 drivers/net/ethernet/sfc/farch.c netif_dbg(efx, hw, efx->net_dev, efx 1204 drivers/net/ethernet/sfc/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 1208 drivers/net/ethernet/sfc/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 1213 drivers/net/ethernet/sfc/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 1218 drivers/net/ethernet/sfc/farch.c netif_err(efx, rx_err, efx->net_dev, efx 1221 drivers/net/ethernet/sfc/farch.c atomic_inc(&efx->rx_reset); efx 1222 drivers/net/ethernet/sfc/farch.c efx_schedule_reset(efx, RESET_TYPE_DISABLE); efx 1226 drivers/net/ethernet/sfc/farch.c netif_err(efx, rx_err, efx->net_dev, efx 1230 drivers/net/ethernet/sfc/farch.c efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR); efx 1234 drivers/net/ethernet/sfc/farch.c efx_siena_sriov_desc_fetch_err(efx, ev_sub_data); efx 1239 drivers/net/ethernet/sfc/farch.c netif_err(efx, tx_err, efx->net_dev, efx 1243 drivers/net/ethernet/sfc/farch.c efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR); efx 1247 drivers/net/ethernet/sfc/farch.c efx_siena_sriov_desc_fetch_err(efx, ev_sub_data); efx 1251 drivers/net/ethernet/sfc/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 1261 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = channel->efx; efx 1280 drivers/net/ethernet/sfc/farch.c netif_vdbg(channel->efx, intr, channel->efx->net_dev, efx 1315 drivers/net/ethernet/sfc/farch.c if (efx->type->handle_global_event && efx 1316 drivers/net/ethernet/sfc/farch.c efx->type->handle_global_event(channel, &event)) efx 1320 drivers/net/ethernet/sfc/farch.c netif_err(channel->efx, hw, channel->efx->net_dev, efx 1335 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = channel->efx; efx 1339 drivers/net/ethernet/sfc/farch.c return efx_alloc_special_buffer(efx, &channel->eventq, efx 1346 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = channel->efx; efx 1348 drivers/net/ethernet/sfc/farch.c netif_dbg(efx, hw, efx->net_dev, efx 1357 drivers/net/ethernet/sfc/farch.c efx_writeo_table(efx, ®, FR_BZ_TIMER_TBL, channel->channel); efx 1360 drivers/net/ethernet/sfc/farch.c efx_init_special_buffer(efx, &channel->eventq); efx 1370 drivers/net/ethernet/sfc/farch.c efx_writeo_table(efx, ®, efx->type->evq_ptr_tbl_base, efx 1379 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = channel->efx; efx 1383 drivers/net/ethernet/sfc/farch.c efx_writeo_table(efx, ®, efx->type->evq_ptr_tbl_base, efx 1385 drivers/net/ethernet/sfc/farch.c efx_writeo_table(efx, ®, FR_BZ_TIMER_TBL, channel->channel); efx 1388 drivers/net/ethernet/sfc/farch.c efx_fini_special_buffer(efx, &channel->eventq); efx 1394 drivers/net/ethernet/sfc/farch.c efx_free_special_buffer(channel->efx, &channel->eventq); efx 1418 drivers/net/ethernet/sfc/farch.c static inline void efx_farch_interrupts(struct efx_nic *efx, efx 1424 drivers/net/ethernet/sfc/farch.c FRF_AZ_KER_INT_LEVE_SEL, efx->irq_level, efx 1427 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &int_en_reg_ker, FR_AZ_INT_EN_KER); efx 1430 drivers/net/ethernet/sfc/farch.c void efx_farch_irq_enable_master(struct efx_nic *efx) efx 1432 drivers/net/ethernet/sfc/farch.c EFX_ZERO_OWORD(*((efx_oword_t *) efx->irq_status.addr)); efx 1435 drivers/net/ethernet/sfc/farch.c efx_farch_interrupts(efx, true, false); efx 1438 drivers/net/ethernet/sfc/farch.c void efx_farch_irq_disable_master(struct efx_nic *efx) efx 1441 drivers/net/ethernet/sfc/farch.c efx_farch_interrupts(efx, false, false); efx 1448 drivers/net/ethernet/sfc/farch.c int efx_farch_irq_test_generate(struct efx_nic *efx) efx 1450 drivers/net/ethernet/sfc/farch.c efx_farch_interrupts(efx, true, true); efx 1457 drivers/net/ethernet/sfc/farch.c irqreturn_t efx_farch_fatal_interrupt(struct efx_nic *efx) efx 1459 drivers/net/ethernet/sfc/farch.c efx_oword_t *int_ker = efx->irq_status.addr; efx 1463 drivers/net/ethernet/sfc/farch.c efx_reado(efx, &fatal_intr, FR_AZ_FATAL_INTR_KER); efx 1466 drivers/net/ethernet/sfc/farch.c netif_err(efx, hw, efx->net_dev, "SYSTEM ERROR "EFX_OWORD_FMT" status " efx 1476 drivers/net/ethernet/sfc/farch.c efx_reado(efx, ®, FR_AZ_MEM_STAT); efx 1477 drivers/net/ethernet/sfc/farch.c netif_err(efx, hw, efx->net_dev, efx 1483 drivers/net/ethernet/sfc/farch.c pci_clear_master(efx->pci_dev); efx 1484 drivers/net/ethernet/sfc/farch.c efx_farch_irq_disable_master(efx); efx 1487 drivers/net/ethernet/sfc/farch.c if (efx->int_error_count == 0 || efx 1488 drivers/net/ethernet/sfc/farch.c time_after(jiffies, efx->int_error_expire)) { efx 1489 drivers/net/ethernet/sfc/farch.c efx->int_error_count = 0; efx 1490 drivers/net/ethernet/sfc/farch.c efx->int_error_expire = efx 1493 drivers/net/ethernet/sfc/farch.c if (++efx->int_error_count < EFX_MAX_INT_ERRORS) { efx 1494 drivers/net/ethernet/sfc/farch.c netif_err(efx, hw, efx->net_dev, efx 1496 drivers/net/ethernet/sfc/farch.c efx_schedule_reset(efx, RESET_TYPE_INT_ERROR); efx 1498 drivers/net/ethernet/sfc/farch.c netif_err(efx, hw, efx->net_dev, efx 1501 drivers/net/ethernet/sfc/farch.c efx_schedule_reset(efx, RESET_TYPE_DISABLE); efx 1512 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = dev_id; efx 1513 drivers/net/ethernet/sfc/farch.c bool soft_enabled = READ_ONCE(efx->irq_soft_enabled); efx 1514 drivers/net/ethernet/sfc/farch.c efx_oword_t *int_ker = efx->irq_status.addr; efx 1522 drivers/net/ethernet/sfc/farch.c efx_readd(efx, ®, FR_BZ_INT_ISR0); efx 1529 drivers/net/ethernet/sfc/farch.c if (EFX_DWORD_IS_ALL_ONES(reg) && efx_try_recovery(efx) && efx 1530 drivers/net/ethernet/sfc/farch.c !efx->eeh_disabled_legacy_irq) { efx 1531 drivers/net/ethernet/sfc/farch.c disable_irq_nosync(efx->legacy_irq); efx 1532 drivers/net/ethernet/sfc/farch.c efx->eeh_disabled_legacy_irq = true; efx 1536 drivers/net/ethernet/sfc/farch.c if (queues & (1U << efx->irq_level) && soft_enabled) { efx 1539 drivers/net/ethernet/sfc/farch.c return efx_farch_fatal_interrupt(efx); efx 1540 drivers/net/ethernet/sfc/farch.c efx->last_irq_cpu = raw_smp_processor_id(); efx 1544 drivers/net/ethernet/sfc/farch.c efx->irq_zero_count = 0; efx 1548 drivers/net/ethernet/sfc/farch.c efx_for_each_channel(channel, efx) { efx 1563 drivers/net/ethernet/sfc/farch.c if (efx->irq_zero_count++ == 0) efx 1568 drivers/net/ethernet/sfc/farch.c efx_for_each_channel(channel, efx) { efx 1580 drivers/net/ethernet/sfc/farch.c netif_vdbg(efx, intr, efx->net_dev, efx 1597 drivers/net/ethernet/sfc/farch.c struct efx_nic *efx = context->efx; efx 1598 drivers/net/ethernet/sfc/farch.c efx_oword_t *int_ker = efx->irq_status.addr; efx 1601 drivers/net/ethernet/sfc/farch.c netif_vdbg(efx, intr, efx->net_dev, efx 1605 drivers/net/ethernet/sfc/farch.c if (!likely(READ_ONCE(efx->irq_soft_enabled))) efx 1609 drivers/net/ethernet/sfc/farch.c if (context->index == efx->irq_level) { efx 1612 drivers/net/ethernet/sfc/farch.c return efx_farch_fatal_interrupt(efx); efx 1613 drivers/net/ethernet/sfc/farch.c efx->last_irq_cpu = raw_smp_processor_id(); efx 1617 drivers/net/ethernet/sfc/farch.c efx_schedule_channel_irq(efx->channel[context->index]); efx 1625 drivers/net/ethernet/sfc/farch.c void efx_farch_rx_push_indir_table(struct efx_nic *efx) efx 1630 drivers/net/ethernet/sfc/farch.c BUILD_BUG_ON(ARRAY_SIZE(efx->rss_context.rx_indir_table) != efx 1635 drivers/net/ethernet/sfc/farch.c efx->rss_context.rx_indir_table[i]); efx 1636 drivers/net/ethernet/sfc/farch.c efx_writed(efx, &dword, efx 1642 drivers/net/ethernet/sfc/farch.c void efx_farch_rx_pull_indir_table(struct efx_nic *efx) efx 1647 drivers/net/ethernet/sfc/farch.c BUILD_BUG_ON(ARRAY_SIZE(efx->rss_context.rx_indir_table) != efx 1651 drivers/net/ethernet/sfc/farch.c efx_readd(efx, &dword, efx 1654 drivers/net/ethernet/sfc/farch.c efx->rss_context.rx_indir_table[i] = EFX_DWORD_FIELD(dword, FRF_BZ_IT_QUEUE); efx 1667 drivers/net/ethernet/sfc/farch.c void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw) efx 1672 drivers/net/ethernet/sfc/farch.c struct siena_nic_data *nic_data = efx->nic_data; efx 1675 drivers/net/ethernet/sfc/farch.c total_tx_channels = efx->n_tx_channels + efx->n_extra_tx_channels; efx 1679 drivers/net/ethernet/sfc/farch.c buftbl_min = ((efx->n_rx_channels * EFX_MAX_DMAQ_SIZE + efx 1681 drivers/net/ethernet/sfc/farch.c efx->n_channels * EFX_MAX_EVQ_SIZE) efx 1683 drivers/net/ethernet/sfc/farch.c vi_count = max(efx->n_channels, total_tx_channels * EFX_TXQ_TYPES); efx 1686 drivers/net/ethernet/sfc/farch.c if (efx->type->sriov_wanted) { efx 1687 drivers/net/ethernet/sfc/farch.c if (efx->type->sriov_wanted(efx)) { efx 1700 drivers/net/ethernet/sfc/farch.c efx_vf_size(efx)); efx 1702 drivers/net/ethernet/sfc/farch.c (1024U - EFX_VI_BASE) >> efx->vi_scale); efx 1704 drivers/net/ethernet/sfc/farch.c if (efx->vf_count > vf_limit) { efx 1705 drivers/net/ethernet/sfc/farch.c netif_err(efx, probe, efx->net_dev, efx 1707 drivers/net/ethernet/sfc/farch.c efx->vf_count, vf_limit); efx 1708 drivers/net/ethernet/sfc/farch.c efx->vf_count = vf_limit; efx 1710 drivers/net/ethernet/sfc/farch.c vi_count += efx->vf_count * efx_vf_size(efx); efx 1715 drivers/net/ethernet/sfc/farch.c efx->tx_dc_base = sram_lim_qw - vi_count * TX_DC_ENTRIES; efx 1716 drivers/net/ethernet/sfc/farch.c efx->rx_dc_base = efx->tx_dc_base - vi_count * RX_DC_ENTRIES; efx 1719 drivers/net/ethernet/sfc/farch.c u32 efx_farch_fpga_ver(struct efx_nic *efx) efx 1722 drivers/net/ethernet/sfc/farch.c efx_reado(efx, &altera_build, FR_AZ_ALTERA_BUILD); efx 1726 drivers/net/ethernet/sfc/farch.c void efx_farch_init_common(struct efx_nic *efx) efx 1731 drivers/net/ethernet/sfc/farch.c EFX_POPULATE_OWORD_1(temp, FRF_AZ_SRM_TX_DC_BASE_ADR, efx->tx_dc_base); efx 1732 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &temp, FR_AZ_SRM_TX_DC_CFG); efx 1733 drivers/net/ethernet/sfc/farch.c EFX_POPULATE_OWORD_1(temp, FRF_AZ_SRM_RX_DC_BASE_ADR, efx->rx_dc_base); efx 1734 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &temp, FR_AZ_SRM_RX_DC_CFG); efx 1739 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &temp, FR_AZ_TX_DC_CFG); efx 1746 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &temp, FR_AZ_RX_DC_CFG); efx 1748 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &temp, FR_AZ_RX_DC_PF_WM); efx 1753 drivers/net/ethernet/sfc/farch.c EFX_INT_MODE_USE_MSI(efx), efx 1754 drivers/net/ethernet/sfc/farch.c FRF_AZ_INT_ADR_KER, efx->irq_status.dma_addr); efx 1755 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &temp, FR_AZ_INT_ADR_KER); efx 1757 drivers/net/ethernet/sfc/farch.c if (EFX_WORKAROUND_17213(efx) && !EFX_INT_MODE_USE_MSI(efx)) efx 1759 drivers/net/ethernet/sfc/farch.c efx->irq_level = 0x1f; efx 1762 drivers/net/ethernet/sfc/farch.c efx->irq_level = 0; efx 1776 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &temp, FR_AZ_FATAL_INTR_KER); efx 1781 drivers/net/ethernet/sfc/farch.c efx_reado(efx, &temp, FR_AZ_TX_RESERVED); efx 1795 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &temp, FR_AZ_TX_RESERVED); efx 1805 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &temp, FR_BZ_TX_PACE); efx 1883 drivers/net/ethernet/sfc/farch.c efx_farch_filter_table_clear_entry(struct efx_nic *efx, efx 1930 drivers/net/ethernet/sfc/farch.c static void efx_farch_filter_push_rx_config(struct efx_nic *efx) efx 1932 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 1936 drivers/net/ethernet/sfc/farch.c efx_reado(efx, &filter_ctl, FR_BZ_RX_FILTER_CTL); efx 1998 drivers/net/ethernet/sfc/farch.c efx->rx_scatter); efx 2001 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &filter_ctl, FR_BZ_RX_FILTER_CTL); efx 2004 drivers/net/ethernet/sfc/farch.c static void efx_farch_filter_push_tx_limits(struct efx_nic *efx) efx 2006 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2010 drivers/net/ethernet/sfc/farch.c efx_reado(efx, &tx_cfg, FR_AZ_TX_CFG); efx 2024 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &tx_cfg, FR_AZ_TX_CFG); efx 2214 drivers/net/ethernet/sfc/farch.c efx_farch_filter_init_rx_auto(struct efx_nic *efx, efx 2222 drivers/net/ethernet/sfc/farch.c (efx_rss_enabled(efx) ? EFX_FILTER_FLAG_RX_RSS : 0) | efx 2223 drivers/net/ethernet/sfc/farch.c (efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0)); efx 2366 drivers/net/ethernet/sfc/farch.c u32 efx_farch_filter_get_rx_id_limit(struct efx_nic *efx) efx 2368 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2382 drivers/net/ethernet/sfc/farch.c s32 efx_farch_filter_insert(struct efx_nic *efx, efx 2386 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2406 drivers/net/ethernet/sfc/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 2503 drivers/net/ethernet/sfc/farch.c efx_farch_filter_push_rx_config(efx); efx 2508 drivers/net/ethernet/sfc/farch.c efx_farch_filter_push_tx_limits(efx); efx 2510 drivers/net/ethernet/sfc/farch.c efx_farch_filter_push_rx_config(efx); efx 2513 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &filter, efx 2520 drivers/net/ethernet/sfc/farch.c efx_farch_filter_table_clear_entry(efx, table, efx 2524 drivers/net/ethernet/sfc/farch.c netif_vdbg(efx, hw, efx->net_dev, efx 2535 drivers/net/ethernet/sfc/farch.c efx_farch_filter_table_clear_entry(struct efx_nic *efx, efx 2548 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &filter, table->offset + table->step * filter_idx); efx 2559 drivers/net/ethernet/sfc/farch.c efx_farch_filter_push_tx_limits(efx); efx 2561 drivers/net/ethernet/sfc/farch.c efx_farch_filter_push_rx_config(efx); efx 2565 drivers/net/ethernet/sfc/farch.c static int efx_farch_filter_remove(struct efx_nic *efx, efx 2577 drivers/net/ethernet/sfc/farch.c efx_farch_filter_init_rx_auto(efx, spec); efx 2578 drivers/net/ethernet/sfc/farch.c efx_farch_filter_push_rx_config(efx); efx 2580 drivers/net/ethernet/sfc/farch.c efx_farch_filter_table_clear_entry(efx, table, filter_idx); efx 2586 drivers/net/ethernet/sfc/farch.c int efx_farch_filter_remove_safe(struct efx_nic *efx, efx 2590 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2608 drivers/net/ethernet/sfc/farch.c rc = efx_farch_filter_remove(efx, table, filter_idx, priority); efx 2614 drivers/net/ethernet/sfc/farch.c int efx_farch_filter_get_safe(struct efx_nic *efx, efx 2618 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2649 drivers/net/ethernet/sfc/farch.c efx_farch_filter_table_clear(struct efx_nic *efx, efx 2653 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2660 drivers/net/ethernet/sfc/farch.c efx_farch_filter_remove(efx, table, efx 2666 drivers/net/ethernet/sfc/farch.c int efx_farch_filter_clear_rx(struct efx_nic *efx, efx 2669 drivers/net/ethernet/sfc/farch.c efx_farch_filter_table_clear(efx, EFX_FARCH_FILTER_TABLE_RX_IP, efx 2671 drivers/net/ethernet/sfc/farch.c efx_farch_filter_table_clear(efx, EFX_FARCH_FILTER_TABLE_RX_MAC, efx 2673 drivers/net/ethernet/sfc/farch.c efx_farch_filter_table_clear(efx, EFX_FARCH_FILTER_TABLE_RX_DEF, efx 2678 drivers/net/ethernet/sfc/farch.c u32 efx_farch_filter_count_rx_used(struct efx_nic *efx, efx 2681 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2705 drivers/net/ethernet/sfc/farch.c s32 efx_farch_filter_get_rx_ids(struct efx_nic *efx, efx 2709 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2740 drivers/net/ethernet/sfc/farch.c void efx_farch_filter_table_restore(struct efx_nic *efx) efx 2742 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2761 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &filter, efx 2766 drivers/net/ethernet/sfc/farch.c efx_farch_filter_push_rx_config(efx); efx 2767 drivers/net/ethernet/sfc/farch.c efx_farch_filter_push_tx_limits(efx); efx 2772 drivers/net/ethernet/sfc/farch.c void efx_farch_filter_table_remove(struct efx_nic *efx) efx 2774 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2784 drivers/net/ethernet/sfc/farch.c int efx_farch_filter_table_probe(struct efx_nic *efx) efx 2793 drivers/net/ethernet/sfc/farch.c efx->filter_state = state; efx 2842 drivers/net/ethernet/sfc/farch.c efx_farch_filter_init_rx_auto(efx, spec); efx 2847 drivers/net/ethernet/sfc/farch.c efx_farch_filter_push_rx_config(efx); efx 2852 drivers/net/ethernet/sfc/farch.c efx_farch_filter_table_remove(efx); efx 2857 drivers/net/ethernet/sfc/farch.c void efx_farch_filter_update_rx_scatter(struct efx_nic *efx) efx 2859 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2875 drivers/net/ethernet/sfc/farch.c efx->n_rx_channels) efx 2878 drivers/net/ethernet/sfc/farch.c if (efx->rx_scatter) efx 2890 drivers/net/ethernet/sfc/farch.c efx_writeo(efx, &filter, efx 2895 drivers/net/ethernet/sfc/farch.c efx_farch_filter_push_rx_config(efx); efx 2902 drivers/net/ethernet/sfc/farch.c bool efx_farch_filter_rfs_expire_one(struct efx_nic *efx, u32 flow_id, efx 2905 drivers/net/ethernet/sfc/farch.c struct efx_farch_filter_state *state = efx->filter_state; efx 2911 drivers/net/ethernet/sfc/farch.c spin_lock_bh(&efx->rps_hash_lock); efx 2919 drivers/net/ethernet/sfc/farch.c if (!efx->rps_hash_table) { efx 2925 drivers/net/ethernet/sfc/farch.c rule = efx_rps_hash_find(efx, &spec); efx 2935 drivers/net/ethernet/sfc/farch.c if (force || rps_may_expire_flow(efx->net_dev, spec.dmaq_id, efx 2939 drivers/net/ethernet/sfc/farch.c efx_rps_hash_del(efx, &spec); efx 2940 drivers/net/ethernet/sfc/farch.c efx_farch_filter_table_clear_entry(efx, table, index); efx 2945 drivers/net/ethernet/sfc/farch.c spin_unlock_bh(&efx->rps_hash_lock); efx 2952 drivers/net/ethernet/sfc/farch.c void efx_farch_filter_sync_rx_mode(struct efx_nic *efx) efx 2954 drivers/net/ethernet/sfc/farch.c struct net_device *net_dev = efx->net_dev; efx 2956 drivers/net/ethernet/sfc/farch.c union efx_multicast_hash *mc_hash = &efx->multicast_hash; efx 2960 drivers/net/ethernet/sfc/farch.c if (!efx_dev_registered(efx)) efx 2965 drivers/net/ethernet/sfc/farch.c efx->unicast_filter = !(net_dev->flags & IFF_PROMISC); efx 79 drivers/net/ethernet/sfc/io.h static inline void _efx_writeq(struct efx_nic *efx, __le64 value, efx 82 drivers/net/ethernet/sfc/io.h __raw_writeq((__force u64)value, efx->membase + reg); efx 84 drivers/net/ethernet/sfc/io.h static inline __le64 _efx_readq(struct efx_nic *efx, unsigned int reg) efx 86 drivers/net/ethernet/sfc/io.h return (__force __le64)__raw_readq(efx->membase + reg); efx 90 drivers/net/ethernet/sfc/io.h static inline void _efx_writed(struct efx_nic *efx, __le32 value, efx 93 drivers/net/ethernet/sfc/io.h __raw_writel((__force u32)value, efx->membase + reg); efx 95 drivers/net/ethernet/sfc/io.h static inline __le32 _efx_readd(struct efx_nic *efx, unsigned int reg) efx 97 drivers/net/ethernet/sfc/io.h return (__force __le32)__raw_readl(efx->membase + reg); efx 101 drivers/net/ethernet/sfc/io.h static inline void efx_writeo(struct efx_nic *efx, const efx_oword_t *value, efx 106 drivers/net/ethernet/sfc/io.h netif_vdbg(efx, hw, efx->net_dev, efx 110 drivers/net/ethernet/sfc/io.h spin_lock_irqsave(&efx->biu_lock, flags); efx 112 drivers/net/ethernet/sfc/io.h _efx_writeq(efx, value->u64[0], reg + 0); efx 113 drivers/net/ethernet/sfc/io.h _efx_writeq(efx, value->u64[1], reg + 8); efx 115 drivers/net/ethernet/sfc/io.h _efx_writed(efx, value->u32[0], reg + 0); efx 116 drivers/net/ethernet/sfc/io.h _efx_writed(efx, value->u32[1], reg + 4); efx 117 drivers/net/ethernet/sfc/io.h _efx_writed(efx, value->u32[2], reg + 8); efx 118 drivers/net/ethernet/sfc/io.h _efx_writed(efx, value->u32[3], reg + 12); efx 120 drivers/net/ethernet/sfc/io.h spin_unlock_irqrestore(&efx->biu_lock, flags); efx 124 drivers/net/ethernet/sfc/io.h static inline void efx_sram_writeq(struct efx_nic *efx, void __iomem *membase, efx 130 drivers/net/ethernet/sfc/io.h netif_vdbg(efx, hw, efx->net_dev, efx 134 drivers/net/ethernet/sfc/io.h spin_lock_irqsave(&efx->biu_lock, flags); efx 141 drivers/net/ethernet/sfc/io.h spin_unlock_irqrestore(&efx->biu_lock, flags); efx 145 drivers/net/ethernet/sfc/io.h static inline void efx_writed(struct efx_nic *efx, const efx_dword_t *value, efx 148 drivers/net/ethernet/sfc/io.h netif_vdbg(efx, hw, efx->net_dev, efx 153 drivers/net/ethernet/sfc/io.h _efx_writed(efx, value->u32[0], reg); efx 157 drivers/net/ethernet/sfc/io.h static inline void efx_reado(struct efx_nic *efx, efx_oword_t *value, efx 162 drivers/net/ethernet/sfc/io.h spin_lock_irqsave(&efx->biu_lock, flags); efx 163 drivers/net/ethernet/sfc/io.h value->u32[0] = _efx_readd(efx, reg + 0); efx 164 drivers/net/ethernet/sfc/io.h value->u32[1] = _efx_readd(efx, reg + 4); efx 165 drivers/net/ethernet/sfc/io.h value->u32[2] = _efx_readd(efx, reg + 8); efx 166 drivers/net/ethernet/sfc/io.h value->u32[3] = _efx_readd(efx, reg + 12); efx 167 drivers/net/ethernet/sfc/io.h spin_unlock_irqrestore(&efx->biu_lock, flags); efx 169 drivers/net/ethernet/sfc/io.h netif_vdbg(efx, hw, efx->net_dev, efx 175 drivers/net/ethernet/sfc/io.h static inline void efx_sram_readq(struct efx_nic *efx, void __iomem *membase, efx 181 drivers/net/ethernet/sfc/io.h spin_lock_irqsave(&efx->biu_lock, flags); efx 188 drivers/net/ethernet/sfc/io.h spin_unlock_irqrestore(&efx->biu_lock, flags); efx 190 drivers/net/ethernet/sfc/io.h netif_vdbg(efx, hw, efx->net_dev, efx 196 drivers/net/ethernet/sfc/io.h static inline void efx_readd(struct efx_nic *efx, efx_dword_t *value, efx 199 drivers/net/ethernet/sfc/io.h value->u32[0] = _efx_readd(efx, reg); efx 200 drivers/net/ethernet/sfc/io.h netif_vdbg(efx, hw, efx->net_dev, efx 207 drivers/net/ethernet/sfc/io.h efx_writeo_table(struct efx_nic *efx, const efx_oword_t *value, efx 210 drivers/net/ethernet/sfc/io.h efx_writeo(efx, value, reg + index * sizeof(efx_oword_t)); efx 214 drivers/net/ethernet/sfc/io.h static inline void efx_reado_table(struct efx_nic *efx, efx_oword_t *value, efx 217 drivers/net/ethernet/sfc/io.h efx_reado(efx, value, reg + index * sizeof(efx_oword_t)); efx 224 drivers/net/ethernet/sfc/io.h static inline unsigned int efx_paged_reg(struct efx_nic *efx, unsigned int page, efx 227 drivers/net/ethernet/sfc/io.h return page * efx->vi_stride + reg; efx 231 drivers/net/ethernet/sfc/io.h static inline void _efx_writeo_page(struct efx_nic *efx, efx_oword_t *value, efx 234 drivers/net/ethernet/sfc/io.h reg = efx_paged_reg(efx, page, reg); efx 236 drivers/net/ethernet/sfc/io.h netif_vdbg(efx, hw, efx->net_dev, efx 241 drivers/net/ethernet/sfc/io.h _efx_writeq(efx, value->u64[0], reg + 0); efx 242 drivers/net/ethernet/sfc/io.h _efx_writeq(efx, value->u64[1], reg + 8); efx 244 drivers/net/ethernet/sfc/io.h _efx_writed(efx, value->u32[0], reg + 0); efx 245 drivers/net/ethernet/sfc/io.h _efx_writed(efx, value->u32[1], reg + 4); efx 246 drivers/net/ethernet/sfc/io.h _efx_writed(efx, value->u32[2], reg + 8); efx 247 drivers/net/ethernet/sfc/io.h _efx_writed(efx, value->u32[3], reg + 12); efx 250 drivers/net/ethernet/sfc/io.h #define efx_writeo_page(efx, value, reg, page) \ efx 251 drivers/net/ethernet/sfc/io.h _efx_writeo_page(efx, value, \ efx 260 drivers/net/ethernet/sfc/io.h _efx_writed_page(struct efx_nic *efx, const efx_dword_t *value, efx 263 drivers/net/ethernet/sfc/io.h efx_writed(efx, value, efx_paged_reg(efx, page, reg)); efx 265 drivers/net/ethernet/sfc/io.h #define efx_writed_page(efx, value, reg, page) \ efx 266 drivers/net/ethernet/sfc/io.h _efx_writed_page(efx, value, \ efx 280 drivers/net/ethernet/sfc/io.h static inline void _efx_writed_page_locked(struct efx_nic *efx, efx 288 drivers/net/ethernet/sfc/io.h spin_lock_irqsave(&efx->biu_lock, flags); efx 289 drivers/net/ethernet/sfc/io.h efx_writed(efx, value, efx_paged_reg(efx, page, reg)); efx 290 drivers/net/ethernet/sfc/io.h spin_unlock_irqrestore(&efx->biu_lock, flags); efx 292 drivers/net/ethernet/sfc/io.h efx_writed(efx, value, efx_paged_reg(efx, page, reg)); efx 295 drivers/net/ethernet/sfc/io.h #define efx_writed_page_locked(efx, value, reg, page) \ efx 296 drivers/net/ethernet/sfc/io.h _efx_writed_page_locked(efx, value, \ efx 49 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating, efx 51 drivers/net/ethernet/sfc/mcdi.c static bool efx_mcdi_poll_once(struct efx_nic *efx); efx 52 drivers/net/ethernet/sfc/mcdi.c static void efx_mcdi_abandon(struct efx_nic *efx); efx 61 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_init(struct efx_nic *efx) efx 67 drivers/net/ethernet/sfc/mcdi.c efx->mcdi = kzalloc(sizeof(*efx->mcdi), GFP_KERNEL); efx 68 drivers/net/ethernet/sfc/mcdi.c if (!efx->mcdi) efx 71 drivers/net/ethernet/sfc/mcdi.c mcdi = efx_mcdi(efx); efx 72 drivers/net/ethernet/sfc/mcdi.c mcdi->efx = efx; efx 89 drivers/net/ethernet/sfc/mcdi.c (void) efx_mcdi_poll_reboot(efx); efx 93 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_handle_assertion(efx); efx 100 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_drv_attach(efx, true, &already_attached); efx 102 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, probe, efx->net_dev, efx 108 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, probe, efx->net_dev, efx 111 drivers/net/ethernet/sfc/mcdi.c if (efx->mcdi->fn_flags & efx 113 drivers/net/ethernet/sfc/mcdi.c efx->primary = efx; efx 121 drivers/net/ethernet/sfc/mcdi.c kfree(efx->mcdi); efx 122 drivers/net/ethernet/sfc/mcdi.c efx->mcdi = NULL; efx 127 drivers/net/ethernet/sfc/mcdi.c void efx_mcdi_detach(struct efx_nic *efx) efx 129 drivers/net/ethernet/sfc/mcdi.c if (!efx->mcdi) efx 132 drivers/net/ethernet/sfc/mcdi.c BUG_ON(efx->mcdi->iface.state != MCDI_STATE_QUIESCENT); efx 135 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_drv_attach(efx, false, NULL); efx 138 drivers/net/ethernet/sfc/mcdi.c void efx_mcdi_fini(struct efx_nic *efx) efx 140 drivers/net/ethernet/sfc/mcdi.c if (!efx->mcdi) efx 144 drivers/net/ethernet/sfc/mcdi.c free_page((unsigned long)efx->mcdi->iface.logging_buffer); efx 147 drivers/net/ethernet/sfc/mcdi.c kfree(efx->mcdi); efx 150 drivers/net/ethernet/sfc/mcdi.c static void efx_mcdi_send_request(struct efx_nic *efx, unsigned cmd, efx 153 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 173 drivers/net/ethernet/sfc/mcdi.c if (efx->type->mcdi_max_ver == 1) { efx 222 drivers/net/ethernet/sfc/mcdi.c netif_info(efx, hw, efx->net_dev, "MCDI RPC REQ:%s\n", buf); efx 226 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_request(efx, hdr, hdr_len, inbuf, inlen); efx 263 drivers/net/ethernet/sfc/mcdi.c static void efx_mcdi_read_response_header(struct efx_nic *efx) efx 265 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 272 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_read_response(efx, &hdr, 0, 4); efx 281 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_read_response(efx, &hdr, 4, 4); efx 304 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_read_response(efx, &hdr, (i * 4), 4); efx 310 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_read_response(efx, &hdr, efx 316 drivers/net/ethernet/sfc/mcdi.c netif_info(efx, hw, efx->net_dev, "MCDI RPC RESP:%s\n", buf); efx 322 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, "MC rebooted\n"); efx 325 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, efx 330 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_read_response(efx, &hdr, mcdi->resp_hdr_len, 4); efx 338 drivers/net/ethernet/sfc/mcdi.c static bool efx_mcdi_poll_once(struct efx_nic *efx) efx 340 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 343 drivers/net/ethernet/sfc/mcdi.c if (!efx->type->mcdi_poll_response(efx)) efx 347 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_read_response_header(efx); efx 353 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_poll(struct efx_nic *efx) efx 355 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 361 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_poll_reboot(efx); efx 388 drivers/net/ethernet/sfc/mcdi.c if (efx_mcdi_poll_once(efx)) efx 402 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_poll_reboot(struct efx_nic *efx) efx 404 drivers/net/ethernet/sfc/mcdi.c if (!efx->mcdi) efx 407 drivers/net/ethernet/sfc/mcdi.c return efx->type->mcdi_poll_reboot(efx); efx 428 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_await_completion(struct efx_nic *efx) efx 430 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 445 drivers/net/ethernet/sfc/mcdi.c return efx_mcdi_poll(efx); efx 469 drivers/net/ethernet/sfc/mcdi.c struct efx_nic *efx = mcdi->efx; efx 477 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_send_request(efx, async->cmd, efx 500 drivers/net/ethernet/sfc/mcdi.c struct efx_nic *efx = mcdi->efx; efx 543 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_read_response(efx, outbuf, hdr_len, efx 547 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_read_response(efx, errbuf, hdr_len, efx 549 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_display_error(efx, async->cmd, async->inlen, errbuf, efx 554 drivers/net/ethernet/sfc/mcdi.c async->complete(efx, async->cookie, rc, outbuf, efx 563 drivers/net/ethernet/sfc/mcdi.c static void efx_mcdi_ev_cpl(struct efx_nic *efx, unsigned int seqno, efx 566 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 576 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, efx 580 drivers/net/ethernet/sfc/mcdi.c if (efx->type->mcdi_max_ver >= 2) { efx 582 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_read_response_header(efx); efx 615 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_check_supported(struct efx_nic *efx, unsigned int cmd, size_t inlen) efx 617 drivers/net/ethernet/sfc/mcdi.c if (efx->type->mcdi_max_ver < 0 || efx 618 drivers/net/ethernet/sfc/mcdi.c (efx->type->mcdi_max_ver < 2 && efx 623 drivers/net/ethernet/sfc/mcdi.c (efx->type->mcdi_max_ver < 2 && efx 630 drivers/net/ethernet/sfc/mcdi.c static bool efx_mcdi_get_proxy_handle(struct efx_nic *efx, efx 640 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_read_response(efx, testbuf, hdr_len, buflen); efx 649 drivers/net/ethernet/sfc/mcdi.c static int _efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned int cmd, efx 655 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 660 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_poll(efx); efx 662 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_await_completion(efx); efx 665 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, efx 669 drivers/net/ethernet/sfc/mcdi.c if (mcdi->mode == MCDI_MODE_EVENTS && efx_mcdi_poll_once(efx)) { efx 670 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, efx 675 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_abandon(efx); efx 711 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_read_response(efx, outbuf, hdr_len, efx 716 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_read_response(efx, errbuf, hdr_len, err_len); efx 721 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, "MC reboot detected\n"); efx 722 drivers/net/ethernet/sfc/mcdi.c netif_dbg(efx, hw, efx->net_dev, "MC rebooted during command %d rc %d\n", efx 724 drivers/net/ethernet/sfc/mcdi.c if (efx->type->mcdi_reboot_detected) efx 725 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_reboot_detected(efx); efx 726 drivers/net/ethernet/sfc/mcdi.c efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE); efx 728 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_get_proxy_handle(efx, hdr_len, data_len, efx 734 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_display_error(efx, cmd, inlen, errbuf, err_len, efx 740 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_poll_reboot(efx); efx 759 drivers/net/ethernet/sfc/mcdi.c static void efx_mcdi_ev_proxy_response(struct efx_nic *efx, efx 762 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 775 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_proxy_wait(struct efx_nic *efx, u32 handle, bool quiet) efx 777 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 787 drivers/net/ethernet/sfc/mcdi.c netif_dbg(efx, hw, efx->net_dev, efx 791 drivers/net/ethernet/sfc/mcdi.c netif_warn(efx, hw, efx->net_dev, efx 800 drivers/net/ethernet/sfc/mcdi.c static int _efx_mcdi_rpc(struct efx_nic *efx, unsigned int cmd, efx 814 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc_start(efx, cmd, inbuf, inlen); efx 818 drivers/net/ethernet/sfc/mcdi.c rc = _efx_mcdi_rpc_finish(efx, cmd, inlen, outbuf, outlen, efx 826 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 828 drivers/net/ethernet/sfc/mcdi.c netif_dbg(efx, hw, efx->net_dev, efx 831 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_proxy_wait(efx, proxy_handle, quiet); efx 834 drivers/net/ethernet/sfc/mcdi.c netif_dbg(efx, hw, efx->net_dev, efx 839 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_send_request(efx, cmd, inbuf, inlen); efx 841 drivers/net/ethernet/sfc/mcdi.c rc = _efx_mcdi_rpc_finish(efx, cmd, inlen, efx 845 drivers/net/ethernet/sfc/mcdi.c netif_cond_dbg(efx, hw, efx->net_dev, rc == -EPERM, err, efx 850 drivers/net/ethernet/sfc/mcdi.c efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE); efx 858 drivers/net/ethernet/sfc/mcdi.c static int _efx_mcdi_rpc_evb_retry(struct efx_nic *efx, unsigned cmd, efx 866 drivers/net/ethernet/sfc/mcdi.c rc = _efx_mcdi_rpc(efx, cmd, inbuf, inlen, efx 870 drivers/net/ethernet/sfc/mcdi.c efx->type->is_vf) { efx 878 drivers/net/ethernet/sfc/mcdi.c netif_dbg(efx, hw, efx->net_dev, efx 884 drivers/net/ethernet/sfc/mcdi.c rc = _efx_mcdi_rpc(efx, cmd, inbuf, inlen, efx 895 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_display_error(efx, cmd, inlen, efx 925 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, efx 930 drivers/net/ethernet/sfc/mcdi.c return _efx_mcdi_rpc_evb_retry(efx, cmd, inbuf, inlen, outbuf, outlen, efx 942 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_rpc_quiet(struct efx_nic *efx, unsigned cmd, efx 947 drivers/net/ethernet/sfc/mcdi.c return _efx_mcdi_rpc_evb_retry(efx, cmd, inbuf, inlen, outbuf, outlen, efx 951 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd, efx 954 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 957 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_check_supported(efx, cmd, inlen); efx 961 drivers/net/ethernet/sfc/mcdi.c if (efx->mc_bist_for_other_fn) efx 968 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_send_request(efx, cmd, inbuf, inlen); efx 972 drivers/net/ethernet/sfc/mcdi.c static int _efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd, efx 978 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 982 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_check_supported(efx, cmd, inlen); efx 986 drivers/net/ethernet/sfc/mcdi.c if (efx->mc_bist_for_other_fn) efx 1012 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_send_request(efx, cmd, inbuf, inlen); efx 1047 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd, efx 1051 drivers/net/ethernet/sfc/mcdi.c return _efx_mcdi_rpc_async(efx, cmd, inbuf, inlen, outlen, complete, efx 1055 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_rpc_async_quiet(struct efx_nic *efx, unsigned int cmd, efx 1060 drivers/net/ethernet/sfc/mcdi.c return _efx_mcdi_rpc_async(efx, cmd, inbuf, inlen, outlen, complete, efx 1064 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen, efx 1068 drivers/net/ethernet/sfc/mcdi.c return _efx_mcdi_rpc_finish(efx, cmd, inlen, outbuf, outlen, efx 1072 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_rpc_finish_quiet(struct efx_nic *efx, unsigned cmd, size_t inlen, efx 1076 drivers/net/ethernet/sfc/mcdi.c return _efx_mcdi_rpc_finish(efx, cmd, inlen, outbuf, outlen, efx 1080 drivers/net/ethernet/sfc/mcdi.c void efx_mcdi_display_error(struct efx_nic *efx, unsigned cmd, efx 1090 drivers/net/ethernet/sfc/mcdi.c netif_cond_dbg(efx, hw, efx->net_dev, rc == -EPERM, err, efx 1099 drivers/net/ethernet/sfc/mcdi.c void efx_mcdi_mode_poll(struct efx_nic *efx) efx 1103 drivers/net/ethernet/sfc/mcdi.c if (!efx->mcdi) efx 1106 drivers/net/ethernet/sfc/mcdi.c mcdi = efx_mcdi(efx); efx 1130 drivers/net/ethernet/sfc/mcdi.c void efx_mcdi_flush_async(struct efx_nic *efx) efx 1135 drivers/net/ethernet/sfc/mcdi.c if (!efx->mcdi) efx 1138 drivers/net/ethernet/sfc/mcdi.c mcdi = efx_mcdi(efx); efx 1150 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_poll(efx); efx 1161 drivers/net/ethernet/sfc/mcdi.c async->complete(efx, async->cookie, -ENETDOWN, NULL, 0); efx 1167 drivers/net/ethernet/sfc/mcdi.c void efx_mcdi_mode_event(struct efx_nic *efx) efx 1171 drivers/net/ethernet/sfc/mcdi.c if (!efx->mcdi) efx 1174 drivers/net/ethernet/sfc/mcdi.c mcdi = efx_mcdi(efx); efx 1194 drivers/net/ethernet/sfc/mcdi.c static void efx_mcdi_ev_death(struct efx_nic *efx, int rc) efx 1196 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 1237 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_poll_reboot(efx); efx 1249 drivers/net/ethernet/sfc/mcdi.c if (!rc && efx->type->mcdi_reboot_detected) efx 1250 drivers/net/ethernet/sfc/mcdi.c efx->type->mcdi_reboot_detected(efx); efx 1255 drivers/net/ethernet/sfc/mcdi.c efx_schedule_reset(efx, RESET_TYPE_MC_FAILURE); efx 1266 drivers/net/ethernet/sfc/mcdi.c static void efx_mcdi_ev_bist(struct efx_nic *efx) efx 1268 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 1271 drivers/net/ethernet/sfc/mcdi.c efx->mc_bist_for_other_fn = true; efx 1283 drivers/net/ethernet/sfc/mcdi.c efx_schedule_reset(efx, RESET_TYPE_MC_BIST); efx 1290 drivers/net/ethernet/sfc/mcdi.c static void efx_mcdi_abandon(struct efx_nic *efx) efx 1292 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 1296 drivers/net/ethernet/sfc/mcdi.c netif_dbg(efx, hw, efx->net_dev, "MCDI is timing out; trying to recover\n"); efx 1297 drivers/net/ethernet/sfc/mcdi.c efx_schedule_reset(efx, RESET_TYPE_MCDI_TIMEOUT); efx 1304 drivers/net/ethernet/sfc/mcdi.c struct efx_nic *efx = channel->efx; efx 1310 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, efx 1312 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_ev_death(efx, -EINTR); efx 1316 drivers/net/ethernet/sfc/mcdi.c netif_info(efx, wol, efx->net_dev, "MCDI PM event.\n"); efx 1320 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_ev_cpl(efx, efx 1327 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_process_link_change(efx, event); efx 1330 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_sensor_event(efx, event); efx 1333 drivers/net/ethernet/sfc/mcdi.c netif_dbg(efx, hw, efx->net_dev, efx 1338 drivers/net/ethernet/sfc/mcdi.c netif_info(efx, hw, efx->net_dev, "MC Reboot\n"); efx 1339 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_ev_death(efx, -EIO); efx 1342 drivers/net/ethernet/sfc/mcdi.c netif_info(efx, hw, efx->net_dev, "MC entered BIST mode\n"); efx 1343 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_ev_bist(efx); efx 1349 drivers/net/ethernet/sfc/mcdi.c if (efx->type->sriov_flr) efx 1350 drivers/net/ethernet/sfc/mcdi.c efx->type->sriov_flr(efx, efx 1356 drivers/net/ethernet/sfc/mcdi.c efx_ptp_event(efx, event); efx 1372 drivers/net/ethernet/sfc/mcdi.c efx_ef10_handle_drain_event(efx); efx 1376 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, efx 1380 drivers/net/ethernet/sfc/mcdi.c efx_schedule_reset(efx, RESET_TYPE_DMA_ERROR); efx 1383 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_ev_proxy_response(efx, efx 1388 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, efx 1401 drivers/net/ethernet/sfc/mcdi.c void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len) efx 1410 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_VERSION, NULL, 0, efx 1427 drivers/net/ethernet/sfc/mcdi.c if (efx_nic_rev(efx) >= EFX_REV_HUNT_A0) { efx 1428 drivers/net/ethernet/sfc/mcdi.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1445 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, probe, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); efx 1449 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating, efx 1462 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_DRV_ATTACH, inbuf, sizeof(inbuf), efx 1469 drivers/net/ethernet/sfc/mcdi.c netif_dbg(efx, probe, efx->net_dev, efx 1473 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_DRV_ATTACH, inbuf, efx 1478 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_display_error(efx, MC_CMD_DRV_ATTACH, sizeof(inbuf), efx 1489 drivers/net/ethernet/sfc/mcdi.c efx->mcdi->fn_flags = efx 1494 drivers/net/ethernet/sfc/mcdi.c efx->mcdi->fn_flags = efx 1497 drivers/net/ethernet/sfc/mcdi.c (efx_port_num(efx) == 0) << efx 1512 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, probe, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); efx 1516 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, efx 1521 drivers/net/ethernet/sfc/mcdi.c int port_num = efx_port_num(efx); efx 1529 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_BOARD_CFG, NULL, 0, efx 1566 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d len=%d\n", efx 1572 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_log_ctrl(struct efx_nic *efx, bool evq, bool uart, u32 dest_evq) efx 1588 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_LOG_CTRL, inbuf, sizeof(inbuf), efx 1593 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_nvram_types(struct efx_nic *efx, u32 *nvram_types_out) efx 1601 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_TYPES, NULL, 0, efx 1614 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", efx 1619 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type, efx 1630 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_INFO, inbuf, sizeof(inbuf), efx 1646 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); efx 1650 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_nvram_test(struct efx_nic *efx, unsigned int type) efx 1658 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_TEST, inbuf, sizeof(inbuf), efx 1672 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_nvram_test_all(struct efx_nic *efx) efx 1678 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_nvram_types(efx, &nvram_types); efx 1685 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_nvram_test(efx, type); efx 1696 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, "%s: failed type=%u\n", efx 1699 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); efx 1706 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_read_assertion(struct efx_nic *efx) efx 1724 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_GET_ASSERTS, efx 1732 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_display_error(efx, MC_CMD_GET_ASSERTS, efx 1752 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, efx 1761 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, "R%.2d (?): 0x%.8x\n", efx 1769 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_exit_assertion(struct efx_nic *efx) efx 1783 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_REBOOT, inbuf, MC_CMD_REBOOT_IN_LEN, efx 1788 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_display_error(efx, MC_CMD_REBOOT, MC_CMD_REBOOT_IN_LEN, efx 1793 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_handle_assertion(struct efx_nic *efx) efx 1797 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_read_assertion(efx); efx 1801 drivers/net/ethernet/sfc/mcdi.c return efx_mcdi_exit_assertion(efx); efx 1804 drivers/net/ethernet/sfc/mcdi.c void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode) efx 1817 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_SET_ID_LED, inbuf, sizeof(inbuf), efx 1821 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_reset_func(struct efx_nic *efx) efx 1829 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_ENTITY_RESET, inbuf, sizeof(inbuf), efx 1834 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_reset_mc(struct efx_nic *efx) efx 1841 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_REBOOT, inbuf, sizeof(inbuf), efx 1856 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method) efx 1862 drivers/net/ethernet/sfc/mcdi.c rc = pci_reset_function(efx->pci_dev); efx 1866 drivers/net/ethernet/sfc/mcdi.c if (efx->mcdi) { efx 1867 drivers/net/ethernet/sfc/mcdi.c struct efx_mcdi_iface *mcdi = efx_mcdi(efx); efx 1874 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_handle_assertion(efx); efx 1881 drivers/net/ethernet/sfc/mcdi.c return efx_mcdi_reset_mc(efx); efx 1883 drivers/net/ethernet/sfc/mcdi.c return efx_mcdi_reset_func(efx); efx 1886 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_wol_filter_set(struct efx_nic *efx, u32 type, efx 1899 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_WOL_FILTER_SET, inbuf, sizeof(inbuf), efx 1915 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); efx 1922 drivers/net/ethernet/sfc/mcdi.c efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac, int *id_out) efx 1924 drivers/net/ethernet/sfc/mcdi.c return efx_mcdi_wol_filter_set(efx, MC_CMD_WOL_TYPE_MAGIC, mac, id_out); efx 1928 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out) efx 1934 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_WOL_FILTER_GET, NULL, 0, efx 1950 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); efx 1955 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id) efx 1962 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_WOL_FILTER_REMOVE, inbuf, sizeof(inbuf), efx 1967 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_flush_rxqs(struct efx_nic *efx) efx 1979 drivers/net/ethernet/sfc/mcdi.c efx_for_each_channel(channel, efx) { efx 1983 drivers/net/ethernet/sfc/mcdi.c atomic_dec(&efx->rxq_flush_pending); efx 1992 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_FLUSH_RX_QUEUES, inbuf, efx 1999 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_wol_filter_reset(struct efx_nic *efx) efx 2003 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_WOL_FILTER_RESET, NULL, 0, NULL, 0, NULL); efx 2007 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled, efx 2018 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_WORKAROUND, inbuf, sizeof(inbuf), efx 2034 drivers/net/ethernet/sfc/mcdi.c int efx_mcdi_get_workarounds(struct efx_nic *efx, unsigned int *impl_out, efx 2041 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_WORKAROUNDS, NULL, 0, efx 2063 drivers/net/ethernet/sfc/mcdi.c netif_cond_dbg(efx, hw, efx->net_dev, rc == -ENOSYS, err, efx 2072 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_nvram_update_start(struct efx_nic *efx, unsigned int type) efx 2084 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_UPDATE_START, inbuf, sizeof(inbuf), efx 2090 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_nvram_read(struct efx_nic *efx, unsigned int type, efx 2105 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_READ, inbuf, sizeof(inbuf), efx 2114 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_nvram_write(struct efx_nic *efx, unsigned int type, efx 2128 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_WRITE, inbuf, efx 2134 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_nvram_erase(struct efx_nic *efx, unsigned int type, efx 2146 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_ERASE, inbuf, sizeof(inbuf), efx 2151 drivers/net/ethernet/sfc/mcdi.c static int efx_mcdi_nvram_update_finish(struct efx_nic *efx, unsigned int type) efx 2164 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_UPDATE_FINISH, inbuf, sizeof(inbuf), efx 2169 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, drv, efx->net_dev, efx 2192 drivers/net/ethernet/sfc/mcdi.c netif_err(efx, drv, efx->net_dev, efx 2205 drivers/net/ethernet/sfc/mcdi.c struct efx_nic *efx = mtd->priv; efx 2213 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_nvram_read(efx, part->nvram_type, offset, efx 2228 drivers/net/ethernet/sfc/mcdi.c struct efx_nic *efx = mtd->priv; efx 2235 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_nvram_update_start(efx, part->nvram_type); efx 2245 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_nvram_erase(efx, part->nvram_type, offset, efx 2259 drivers/net/ethernet/sfc/mcdi.c struct efx_nic *efx = mtd->priv; efx 2266 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_nvram_update_start(efx, part->nvram_type); efx 2274 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_nvram_write(efx, part->nvram_type, offset, efx 2289 drivers/net/ethernet/sfc/mcdi.c struct efx_nic *efx = mtd->priv; efx 2294 drivers/net/ethernet/sfc/mcdi.c rc = efx_mcdi_nvram_update_finish(efx, part->nvram_type); efx 2304 drivers/net/ethernet/sfc/mcdi.c struct efx_nic *efx = part->mtd.priv; efx 2307 drivers/net/ethernet/sfc/mcdi.c efx->name, part->type_name, mcdi_part->fw_subtype); efx 68 drivers/net/ethernet/sfc/mcdi.h struct efx_nic *efx; efx 127 drivers/net/ethernet/sfc/mcdi.h static inline struct efx_mcdi_iface *efx_mcdi(struct efx_nic *efx) efx 129 drivers/net/ethernet/sfc/mcdi.h EFX_WARN_ON_PARANOID(!efx->mcdi); efx 130 drivers/net/ethernet/sfc/mcdi.h return &efx->mcdi->iface; efx 134 drivers/net/ethernet/sfc/mcdi.h static inline struct efx_mcdi_mon *efx_mcdi_mon(struct efx_nic *efx) efx 136 drivers/net/ethernet/sfc/mcdi.h EFX_WARN_ON_PARANOID(!efx->mcdi); efx 137 drivers/net/ethernet/sfc/mcdi.h return &efx->mcdi->hwmon; efx 141 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_init(struct efx_nic *efx); efx 142 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_detach(struct efx_nic *efx); efx 143 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_fini(struct efx_nic *efx); efx 145 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_rpc(struct efx_nic *efx, unsigned cmd, const efx_dword_t *inbuf, efx 148 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_rpc_quiet(struct efx_nic *efx, unsigned cmd, efx 153 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd, efx 155 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen, efx 158 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_rpc_finish_quiet(struct efx_nic *efx, unsigned cmd, efx 162 drivers/net/ethernet/sfc/mcdi.h typedef void efx_mcdi_async_completer(struct efx_nic *efx, efx 166 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd, efx 170 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_rpc_async_quiet(struct efx_nic *efx, unsigned int cmd, efx 176 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_display_error(struct efx_nic *efx, unsigned cmd, efx 180 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_poll_reboot(struct efx_nic *efx); efx 181 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_mode_poll(struct efx_nic *efx); efx 182 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_mode_event(struct efx_nic *efx); efx 183 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_flush_async(struct efx_nic *efx); efx 186 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev); efx 329 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_print_fwver(struct efx_nic *efx, char *buf, size_t len); efx 330 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, efx 332 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_log_ctrl(struct efx_nic *efx, bool evq, bool uart, u32 dest_evq); efx 333 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_nvram_types(struct efx_nic *efx, u32 *nvram_types_out); efx 334 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type, efx 337 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_nvram_test_all(struct efx_nic *efx); efx 338 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_handle_assertion(struct efx_nic *efx); efx 339 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode); efx 340 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac, efx 342 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out); efx 343 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id); efx 344 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_wol_filter_reset(struct efx_nic *efx); efx 345 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_flush_rxqs(struct efx_nic *efx); efx 346 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_port_probe(struct efx_nic *efx); efx 347 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_port_remove(struct efx_nic *efx); efx 348 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_port_reconfigure(struct efx_nic *efx); efx 349 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_port_get_number(struct efx_nic *efx); efx 350 drivers/net/ethernet/sfc/mcdi.h u32 efx_mcdi_phy_get_caps(struct efx_nic *efx); efx 351 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev); efx 352 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_set_mac(struct efx_nic *efx); efx 354 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_mac_start_stats(struct efx_nic *efx); efx 355 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_mac_stop_stats(struct efx_nic *efx); efx 356 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_mac_pull_stats(struct efx_nic *efx); efx 357 drivers/net/ethernet/sfc/mcdi.h bool efx_mcdi_mac_check_fault(struct efx_nic *efx); efx 359 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_reset(struct efx_nic *efx, enum reset_type method); efx 360 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_set_workaround(struct efx_nic *efx, u32 type, bool enabled, efx 362 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_get_workarounds(struct efx_nic *efx, unsigned int *impl_out, efx 366 drivers/net/ethernet/sfc/mcdi.h int efx_mcdi_mon_probe(struct efx_nic *efx); efx 367 drivers/net/ethernet/sfc/mcdi.h void efx_mcdi_mon_remove(struct efx_nic *efx); efx 369 drivers/net/ethernet/sfc/mcdi.h static inline int efx_mcdi_mon_probe(struct efx_nic *efx) { return 0; } efx 370 drivers/net/ethernet/sfc/mcdi.h static inline void efx_mcdi_mon_remove(struct efx_nic *efx) {} efx 103 drivers/net/ethernet/sfc/mcdi_mon.c void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev) efx 128 drivers/net/ethernet/sfc/mcdi_mon.c netif_err(efx, hw, efx->net_dev, efx 144 drivers/net/ethernet/sfc/mcdi_mon.c static int efx_mcdi_mon_update(struct efx_nic *efx) efx 146 drivers/net/ethernet/sfc/mcdi_mon.c struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); efx 154 drivers/net/ethernet/sfc/mcdi_mon.c rc = efx_mcdi_rpc(efx, MC_CMD_READ_SENSORS, efx 164 drivers/net/ethernet/sfc/mcdi_mon.c struct efx_nic *efx = dev_get_drvdata(dev->parent); efx 165 drivers/net/ethernet/sfc/mcdi_mon.c struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); efx 176 drivers/net/ethernet/sfc/mcdi_mon.c rc = efx_mcdi_mon_update(efx); efx 279 drivers/net/ethernet/sfc/mcdi_mon.c efx_mcdi_mon_add_attr(struct efx_nic *efx, const char *name, efx 285 drivers/net/ethernet/sfc/mcdi_mon.c struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); efx 303 drivers/net/ethernet/sfc/mcdi_mon.c int efx_mcdi_mon_probe(struct efx_nic *efx) efx 306 drivers/net/ethernet/sfc/mcdi_mon.c struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); efx 321 drivers/net/ethernet/sfc/mcdi_mon.c rc = efx_mcdi_rpc(efx, MC_CMD_SENSOR_INFO, inbuf, sizeof(inbuf), efx 339 drivers/net/ethernet/sfc/mcdi_mon.c efx, &hwmon->dma_buf, efx 346 drivers/net/ethernet/sfc/mcdi_mon.c efx_mcdi_mon_update(efx); efx 383 drivers/net/ethernet/sfc/mcdi_mon.c rc = efx_mcdi_rpc(efx, MC_CMD_SENSOR_INFO, efx 415 drivers/net/ethernet/sfc/mcdi_mon.c efx_port_num(efx)) efx 461 drivers/net/ethernet/sfc/mcdi_mon.c efx, name, efx_mcdi_mon_show_value, i, type, 0); efx 467 drivers/net/ethernet/sfc/mcdi_mon.c efx, name, efx_mcdi_mon_show_limit, efx 474 drivers/net/ethernet/sfc/mcdi_mon.c efx, name, efx_mcdi_mon_show_limit, efx 484 drivers/net/ethernet/sfc/mcdi_mon.c efx, name, efx_mcdi_mon_show_limit, efx 492 drivers/net/ethernet/sfc/mcdi_mon.c efx, name, efx_mcdi_mon_show_alarm, i, type, 0); efx 499 drivers/net/ethernet/sfc/mcdi_mon.c efx, name, efx_mcdi_mon_show_label, i, type, 0); efx 505 drivers/net/ethernet/sfc/mcdi_mon.c hwmon->device = hwmon_device_register_with_groups(&efx->pci_dev->dev, efx 516 drivers/net/ethernet/sfc/mcdi_mon.c efx_mcdi_mon_remove(efx); efx 520 drivers/net/ethernet/sfc/mcdi_mon.c void efx_mcdi_mon_remove(struct efx_nic *efx) efx 522 drivers/net/ethernet/sfc/mcdi_mon.c struct efx_mcdi_mon *hwmon = efx_mcdi_mon(efx); efx 528 drivers/net/ethernet/sfc/mcdi_mon.c efx_nic_free_buffer(efx, &hwmon->dma_buf); efx 33 drivers/net/ethernet/sfc/mcdi_port.c efx_mcdi_get_phy_cfg(struct efx_nic *efx, struct efx_mcdi_phy_data *cfg) efx 42 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_PHY_CFG, NULL, 0, efx 69 drivers/net/ethernet/sfc/mcdi_port.c netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); efx 73 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_set_link(struct efx_nic *efx, u32 capabilities, efx 87 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_SET_LINK, inbuf, sizeof(inbuf), efx 92 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_loopback_modes(struct efx_nic *efx, u64 *loopback_modes) efx 98 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_LOOPBACK_MODES, NULL, 0, efx 114 drivers/net/ethernet/sfc/mcdi_port.c netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); efx 121 drivers/net/ethernet/sfc/mcdi_port.c struct efx_nic *efx = netdev_priv(net_dev); efx 127 drivers/net/ethernet/sfc/mcdi_port.c MCDI_SET_DWORD(inbuf, MDIO_READ_IN_BUS, efx->mdio_bus); efx 132 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_MDIO_READ, inbuf, sizeof(inbuf), efx 147 drivers/net/ethernet/sfc/mcdi_port.c struct efx_nic *efx = netdev_priv(net_dev); efx 153 drivers/net/ethernet/sfc/mcdi_port.c MCDI_SET_DWORD(inbuf, MDIO_WRITE_IN_BUS, efx->mdio_bus); efx 159 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_MDIO_WRITE, inbuf, sizeof(inbuf), efx 276 drivers/net/ethernet/sfc/mcdi_port.c static u32 efx_get_mcdi_phy_flags(struct efx_nic *efx) efx 278 drivers/net/ethernet/sfc/mcdi_port.c struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; efx 291 drivers/net/ethernet/sfc/mcdi_port.c mode = efx->phy_mode & supported; efx 325 drivers/net/ethernet/sfc/mcdi_port.c static void efx_mcdi_phy_decode_link(struct efx_nic *efx, efx 411 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_phy_probe(struct efx_nic *efx) efx 423 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_get_phy_cfg(efx, phy_data); efx 429 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_LINK, NULL, 0, efx 435 drivers/net/ethernet/sfc/mcdi_port.c efx->phy_data = phy_data; efx 436 drivers/net/ethernet/sfc/mcdi_port.c efx->phy_type = phy_data->type; efx 438 drivers/net/ethernet/sfc/mcdi_port.c efx->mdio_bus = phy_data->channel; efx 439 drivers/net/ethernet/sfc/mcdi_port.c efx->mdio.prtad = phy_data->port; efx 440 drivers/net/ethernet/sfc/mcdi_port.c efx->mdio.mmds = phy_data->mmd_mask & ~(1 << MC_CMD_MMD_CLAUSE22); efx 441 drivers/net/ethernet/sfc/mcdi_port.c efx->mdio.mode_support = 0; efx 443 drivers/net/ethernet/sfc/mcdi_port.c efx->mdio.mode_support |= MDIO_SUPPORTS_C22; efx 445 drivers/net/ethernet/sfc/mcdi_port.c efx->mdio.mode_support |= MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22; efx 450 drivers/net/ethernet/sfc/mcdi_port.c efx->link_advertising); efx 483 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_loopback_modes(efx, &efx->loopback_modes); efx 488 drivers/net/ethernet/sfc/mcdi_port.c efx->loopback_modes &= ~(1 << LOOPBACK_NONE); efx 492 drivers/net/ethernet/sfc/mcdi_port.c efx, &efx->link_state, efx 500 drivers/net/ethernet/sfc/mcdi_port.c efx->fec_config = mcdi_fec_caps_to_ethtool(caps, efx 501 drivers/net/ethernet/sfc/mcdi_port.c efx->link_state.speed == 25000 || efx 502 drivers/net/ethernet/sfc/mcdi_port.c efx->link_state.speed == 50000); efx 505 drivers/net/ethernet/sfc/mcdi_port.c efx->wanted_fc = EFX_FC_RX | EFX_FC_TX; efx 507 drivers/net/ethernet/sfc/mcdi_port.c efx->wanted_fc |= EFX_FC_AUTO; efx 508 drivers/net/ethernet/sfc/mcdi_port.c efx_link_set_wanted_fc(efx, efx->wanted_fc); efx 517 drivers/net/ethernet/sfc/mcdi_port.c int efx_mcdi_port_reconfigure(struct efx_nic *efx) efx 519 drivers/net/ethernet/sfc/mcdi_port.c struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; efx 520 drivers/net/ethernet/sfc/mcdi_port.c u32 caps = (efx->link_advertising[0] ? efx 521 drivers/net/ethernet/sfc/mcdi_port.c ethtool_linkset_to_mcdi_cap(efx->link_advertising) : efx 524 drivers/net/ethernet/sfc/mcdi_port.c caps |= ethtool_fec_caps_to_mcdi(efx->fec_config); efx 526 drivers/net/ethernet/sfc/mcdi_port.c return efx_mcdi_set_link(efx, caps, efx_get_mcdi_phy_flags(efx), efx 527 drivers/net/ethernet/sfc/mcdi_port.c efx->loopback_mode, 0); efx 533 drivers/net/ethernet/sfc/mcdi_port.c static void efx_mcdi_phy_check_fcntl(struct efx_nic *efx, u32 lpa) efx 535 drivers/net/ethernet/sfc/mcdi_port.c struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; efx 544 drivers/net/ethernet/sfc/mcdi_port.c if (efx->wanted_fc & EFX_FC_AUTO) efx 553 drivers/net/ethernet/sfc/mcdi_port.c if ((efx->wanted_fc & EFX_FC_TX) && rmtadv == ADVERTISED_Asym_Pause) efx 554 drivers/net/ethernet/sfc/mcdi_port.c netif_err(efx, link, efx->net_dev, efx 558 drivers/net/ethernet/sfc/mcdi_port.c static bool efx_mcdi_phy_poll(struct efx_nic *efx) efx 560 drivers/net/ethernet/sfc/mcdi_port.c struct efx_link_state old_state = efx->link_state; efx 564 drivers/net/ethernet/sfc/mcdi_port.c WARN_ON(!mutex_is_locked(&efx->mac_lock)); efx 568 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_LINK, NULL, 0, efx 571 drivers/net/ethernet/sfc/mcdi_port.c efx->link_state.up = false; efx 574 drivers/net/ethernet/sfc/mcdi_port.c efx, &efx->link_state, efx 579 drivers/net/ethernet/sfc/mcdi_port.c return !efx_link_state_equal(&efx->link_state, &old_state); efx 582 drivers/net/ethernet/sfc/mcdi_port.c static void efx_mcdi_phy_remove(struct efx_nic *efx) efx 584 drivers/net/ethernet/sfc/mcdi_port.c struct efx_mcdi_phy_data *phy_data = efx->phy_data; efx 586 drivers/net/ethernet/sfc/mcdi_port.c efx->phy_data = NULL; efx 590 drivers/net/ethernet/sfc/mcdi_port.c static void efx_mcdi_phy_get_link_ksettings(struct efx_nic *efx, efx 593 drivers/net/ethernet/sfc/mcdi_port.c struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; efx 597 drivers/net/ethernet/sfc/mcdi_port.c cmd->base.speed = efx->link_state.speed; efx 598 drivers/net/ethernet/sfc/mcdi_port.c cmd->base.duplex = efx->link_state.fd; efx 601 drivers/net/ethernet/sfc/mcdi_port.c cmd->base.autoneg = !!(efx->link_advertising[0] & ADVERTISED_Autoneg); efx 602 drivers/net/ethernet/sfc/mcdi_port.c cmd->base.mdio_support = (efx->mdio.mode_support & efx 607 drivers/net/ethernet/sfc/mcdi_port.c memcpy(cmd->link_modes.advertising, efx->link_advertising, efx 611 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_LINK, NULL, 0, efx 621 drivers/net/ethernet/sfc/mcdi_port.c efx_mcdi_phy_set_link_ksettings(struct efx_nic *efx, efx 624 drivers/net/ethernet/sfc/mcdi_port.c struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; efx 652 drivers/net/ethernet/sfc/mcdi_port.c caps |= ethtool_fec_caps_to_mcdi(efx->fec_config); efx 654 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_set_link(efx, caps, efx_get_mcdi_phy_flags(efx), efx 655 drivers/net/ethernet/sfc/mcdi_port.c efx->loopback_mode, 0); efx 660 drivers/net/ethernet/sfc/mcdi_port.c efx_link_set_advertising(efx, cmd->link_modes.advertising); efx 663 drivers/net/ethernet/sfc/mcdi_port.c efx_link_clear_advertising(efx); efx 669 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_phy_get_fecparam(struct efx_nic *efx, efx 679 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_LINK, NULL, 0, efx 708 drivers/net/ethernet/sfc/mcdi_port.c netif_warn(efx, hw, efx->net_dev, efx 721 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_phy_set_fecparam(struct efx_nic *efx, efx 724 drivers/net/ethernet/sfc/mcdi_port.c struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; efx 731 drivers/net/ethernet/sfc/mcdi_port.c if (test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, efx->link_advertising)) efx 732 drivers/net/ethernet/sfc/mcdi_port.c caps = (ethtool_linkset_to_mcdi_cap(efx->link_advertising) | efx 738 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_set_link(efx, caps, efx_get_mcdi_phy_flags(efx), efx 739 drivers/net/ethernet/sfc/mcdi_port.c efx->loopback_mode, 0); efx 744 drivers/net/ethernet/sfc/mcdi_port.c efx->fec_config = fec->fec; efx 748 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_phy_test_alive(struct efx_nic *efx) efx 756 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_PHY_STATE, NULL, 0, efx 780 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_bist(struct efx_nic *efx, unsigned int bist_mode, efx 793 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_START_BIST, efx 801 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_POLL_BIST, NULL, 0, efx 820 drivers/net/ethernet/sfc/mcdi_port.c if (efx->phy_type == PHY_TYPE_SFT9001B && efx 840 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_phy_run_tests(struct efx_nic *efx, int *results, efx 843 drivers/net/ethernet/sfc/mcdi_port.c struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; efx 848 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_bist(efx, MC_CMD_PHY_BIST, results); efx 870 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_bist(efx, mode, results); efx 879 drivers/net/ethernet/sfc/mcdi_port.c static const char *efx_mcdi_phy_test_name(struct efx_nic *efx, efx 882 drivers/net/ethernet/sfc/mcdi_port.c struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; efx 896 drivers/net/ethernet/sfc/mcdi_port.c if (efx->phy_type == PHY_TYPE_SFT9001B) { efx 925 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_phy_get_module_eeprom_page(struct efx_nic *efx, efx 943 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_GET_PHY_MEDIA_INFO, efx 965 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_phy_get_module_eeprom_byte(struct efx_nic *efx, efx 972 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_phy_get_module_eeprom_page(efx, page, &data, byte, 1); efx 979 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_phy_diag_type(struct efx_nic *efx) efx 982 drivers/net/ethernet/sfc/mcdi_port.c return efx_mcdi_phy_get_module_eeprom_byte(efx, 0, efx 986 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_phy_sff_8472_level(struct efx_nic *efx) efx 989 drivers/net/ethernet/sfc/mcdi_port.c return efx_mcdi_phy_get_module_eeprom_byte(efx, 0, efx 993 drivers/net/ethernet/sfc/mcdi_port.c static u32 efx_mcdi_phy_module_type(struct efx_nic *efx) efx 995 drivers/net/ethernet/sfc/mcdi_port.c struct efx_mcdi_phy_data *phy_data = efx->phy_data; efx 1003 drivers/net/ethernet/sfc/mcdi_port.c switch (efx_mcdi_phy_get_module_eeprom_byte(efx, 0, 0)) { efx 1014 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_phy_get_module_eeprom(struct efx_nic *efx, efx 1024 drivers/net/ethernet/sfc/mcdi_port.c switch (efx_mcdi_phy_module_type(efx)) { efx 1026 drivers/net/ethernet/sfc/mcdi_port.c num_pages = efx_mcdi_phy_sff_8472_level(efx) > 0 ? efx 1044 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_phy_get_module_eeprom_page(efx, page, efx 1076 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_phy_get_module_info(struct efx_nic *efx, efx 1082 drivers/net/ethernet/sfc/mcdi_port.c switch (efx_mcdi_phy_module_type(efx)) { efx 1084 drivers/net/ethernet/sfc/mcdi_port.c sff_8472_level = efx_mcdi_phy_sff_8472_level(efx); efx 1093 drivers/net/ethernet/sfc/mcdi_port.c diag_type = efx_mcdi_phy_diag_type(efx); efx 1135 drivers/net/ethernet/sfc/mcdi_port.c u32 efx_mcdi_phy_get_caps(struct efx_nic *efx) efx 1137 drivers/net/ethernet/sfc/mcdi_port.c struct efx_mcdi_phy_data *phy_data = efx->phy_data; efx 1152 drivers/net/ethernet/sfc/mcdi_port.c void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev) efx 1168 drivers/net/ethernet/sfc/mcdi_port.c efx_mcdi_phy_decode_link(efx, &efx->link_state, speed, flags, fcntl); efx 1170 drivers/net/ethernet/sfc/mcdi_port.c efx_mcdi_phy_check_fcntl(efx, lpa); efx 1172 drivers/net/ethernet/sfc/mcdi_port.c efx_link_status_changed(efx); efx 1175 drivers/net/ethernet/sfc/mcdi_port.c int efx_mcdi_set_mac(struct efx_nic *efx) efx 1184 drivers/net/ethernet/sfc/mcdi_port.c efx->net_dev->dev_addr); efx 1187 drivers/net/ethernet/sfc/mcdi_port.c EFX_MAX_FRAME_LEN(efx->net_dev->mtu)); efx 1192 drivers/net/ethernet/sfc/mcdi_port.c SET_MAC_IN_REJECT_UNCST, efx->unicast_filter); efx 1196 drivers/net/ethernet/sfc/mcdi_port.c !!(efx->net_dev->features & NETIF_F_RXFCS)); efx 1198 drivers/net/ethernet/sfc/mcdi_port.c switch (efx->wanted_fc) { efx 1209 drivers/net/ethernet/sfc/mcdi_port.c if (efx->wanted_fc & EFX_FC_AUTO) efx 1211 drivers/net/ethernet/sfc/mcdi_port.c if (efx->fc_disable) efx 1216 drivers/net/ethernet/sfc/mcdi_port.c return efx_mcdi_rpc(efx, MC_CMD_SET_MAC, cmdbytes, sizeof(cmdbytes), efx 1220 drivers/net/ethernet/sfc/mcdi_port.c bool efx_mcdi_mac_check_fault(struct efx_nic *efx) efx 1228 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_LINK, NULL, 0, efx 1242 drivers/net/ethernet/sfc/mcdi_port.c static int efx_mcdi_mac_stats(struct efx_nic *efx, efx 1250 drivers/net/ethernet/sfc/mcdi_port.c dma_addr_t dma_addr = efx->stats_buffer.dma_addr; efx 1252 drivers/net/ethernet/sfc/mcdi_port.c efx->num_mac_stats * sizeof(u64) : 0; efx 1267 drivers/net/ethernet/sfc/mcdi_port.c if (efx_nic_rev(efx) >= EFX_REV_HUNT_A0) { efx 1268 drivers/net/ethernet/sfc/mcdi_port.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1273 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_MAC_STATS, inbuf, sizeof(inbuf), efx 1276 drivers/net/ethernet/sfc/mcdi_port.c if (rc && (rc != -ENOENT || atomic_read(&efx->active_queues))) efx 1277 drivers/net/ethernet/sfc/mcdi_port.c efx_mcdi_display_error(efx, MC_CMD_MAC_STATS, sizeof(inbuf), efx 1282 drivers/net/ethernet/sfc/mcdi_port.c void efx_mcdi_mac_start_stats(struct efx_nic *efx) efx 1284 drivers/net/ethernet/sfc/mcdi_port.c __le64 *dma_stats = efx->stats_buffer.addr; efx 1286 drivers/net/ethernet/sfc/mcdi_port.c dma_stats[efx->num_mac_stats - 1] = EFX_MC_STATS_GENERATION_INVALID; efx 1288 drivers/net/ethernet/sfc/mcdi_port.c efx_mcdi_mac_stats(efx, EFX_STATS_ENABLE, 0); efx 1291 drivers/net/ethernet/sfc/mcdi_port.c void efx_mcdi_mac_stop_stats(struct efx_nic *efx) efx 1293 drivers/net/ethernet/sfc/mcdi_port.c efx_mcdi_mac_stats(efx, EFX_STATS_DISABLE, 0); efx 1299 drivers/net/ethernet/sfc/mcdi_port.c void efx_mcdi_mac_pull_stats(struct efx_nic *efx) efx 1301 drivers/net/ethernet/sfc/mcdi_port.c __le64 *dma_stats = efx->stats_buffer.addr; efx 1304 drivers/net/ethernet/sfc/mcdi_port.c dma_stats[efx->num_mac_stats - 1] = EFX_MC_STATS_GENERATION_INVALID; efx 1305 drivers/net/ethernet/sfc/mcdi_port.c efx_mcdi_mac_stats(efx, EFX_STATS_PULL, 0); efx 1307 drivers/net/ethernet/sfc/mcdi_port.c while (dma_stats[efx->num_mac_stats - 1] == efx 1313 drivers/net/ethernet/sfc/mcdi_port.c int efx_mcdi_port_probe(struct efx_nic *efx) efx 1318 drivers/net/ethernet/sfc/mcdi_port.c efx->phy_op = &efx_mcdi_phy_ops; efx 1321 drivers/net/ethernet/sfc/mcdi_port.c efx->mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22; efx 1322 drivers/net/ethernet/sfc/mcdi_port.c efx->mdio.mdio_read = efx_mcdi_mdio_read; efx 1323 drivers/net/ethernet/sfc/mcdi_port.c efx->mdio.mdio_write = efx_mcdi_mdio_write; efx 1326 drivers/net/ethernet/sfc/mcdi_port.c rc = efx->phy_op->probe(efx); efx 1331 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_nic_alloc_buffer(efx, &efx->stats_buffer, efx 1332 drivers/net/ethernet/sfc/mcdi_port.c efx->num_mac_stats * sizeof(u64), GFP_KERNEL); efx 1335 drivers/net/ethernet/sfc/mcdi_port.c netif_dbg(efx, probe, efx->net_dev, efx 1337 drivers/net/ethernet/sfc/mcdi_port.c (u64)efx->stats_buffer.dma_addr, efx 1338 drivers/net/ethernet/sfc/mcdi_port.c efx->stats_buffer.addr, efx 1339 drivers/net/ethernet/sfc/mcdi_port.c (u64)virt_to_phys(efx->stats_buffer.addr)); efx 1341 drivers/net/ethernet/sfc/mcdi_port.c efx_mcdi_mac_stats(efx, EFX_STATS_DISABLE, 1); efx 1346 drivers/net/ethernet/sfc/mcdi_port.c void efx_mcdi_port_remove(struct efx_nic *efx) efx 1348 drivers/net/ethernet/sfc/mcdi_port.c efx->phy_op->remove(efx); efx 1349 drivers/net/ethernet/sfc/mcdi_port.c efx_nic_free_buffer(efx, &efx->stats_buffer); efx 1353 drivers/net/ethernet/sfc/mcdi_port.c int efx_mcdi_port_get_number(struct efx_nic *efx) efx 1358 drivers/net/ethernet/sfc/mcdi_port.c rc = efx_mcdi_rpc(efx, MC_CMD_GET_PORT_ASSIGNMENT, NULL, 0, efx 23 drivers/net/ethernet/sfc/mtd.c struct efx_nic *efx = mtd->priv; efx 25 drivers/net/ethernet/sfc/mtd.c return efx->type->mtd_erase(mtd, erase->addr, erase->len); efx 31 drivers/net/ethernet/sfc/mtd.c struct efx_nic *efx = mtd->priv; efx 34 drivers/net/ethernet/sfc/mtd.c rc = efx->type->mtd_sync(mtd); efx 54 drivers/net/ethernet/sfc/mtd.c int efx_mtd_add(struct efx_nic *efx, struct efx_mtd_partition *parts, efx 70 drivers/net/ethernet/sfc/mtd.c part->mtd.priv = efx; efx 73 drivers/net/ethernet/sfc/mtd.c part->mtd._read = efx->type->mtd_read; efx 74 drivers/net/ethernet/sfc/mtd.c part->mtd._write = efx->type->mtd_write; efx 77 drivers/net/ethernet/sfc/mtd.c efx->type->mtd_rename(part); efx 83 drivers/net/ethernet/sfc/mtd.c list_add_tail(&part->node, &efx->mtd_list); efx 98 drivers/net/ethernet/sfc/mtd.c void efx_mtd_remove(struct efx_nic *efx) efx 102 drivers/net/ethernet/sfc/mtd.c WARN_ON(efx_dev_registered(efx)); efx 104 drivers/net/ethernet/sfc/mtd.c if (list_empty(&efx->mtd_list)) efx 107 drivers/net/ethernet/sfc/mtd.c parts = list_first_entry(&efx->mtd_list, struct efx_mtd_partition, efx 110 drivers/net/ethernet/sfc/mtd.c list_for_each_entry_safe(part, next, &efx->mtd_list, node) efx 116 drivers/net/ethernet/sfc/mtd.c void efx_mtd_rename(struct efx_nic *efx) efx 122 drivers/net/ethernet/sfc/mtd.c list_for_each_entry(part, &efx->mtd_list, node) efx 123 drivers/net/ethernet/sfc/mtd.c efx->type->mtd_rename(part); efx 240 drivers/net/ethernet/sfc/net_driver.h struct efx_nic *efx ____cacheline_aligned_in_smp; efx 368 drivers/net/ethernet/sfc/net_driver.h struct efx_nic *efx; efx 456 drivers/net/ethernet/sfc/net_driver.h struct efx_nic *efx; efx 521 drivers/net/ethernet/sfc/net_driver.h struct efx_nic *efx; efx 566 drivers/net/ethernet/sfc/net_driver.h #define LOOPBACK_MODE(efx) \ efx 567 drivers/net/ethernet/sfc/net_driver.h STRING_TABLE_LOOKUP((efx)->loopback_mode, efx_loopback_mode) efx 642 drivers/net/ethernet/sfc/net_driver.h int (*probe) (struct efx_nic *efx); efx 643 drivers/net/ethernet/sfc/net_driver.h int (*init) (struct efx_nic *efx); efx 644 drivers/net/ethernet/sfc/net_driver.h void (*fini) (struct efx_nic *efx); efx 645 drivers/net/ethernet/sfc/net_driver.h void (*remove) (struct efx_nic *efx); efx 646 drivers/net/ethernet/sfc/net_driver.h int (*reconfigure) (struct efx_nic *efx); efx 647 drivers/net/ethernet/sfc/net_driver.h bool (*poll) (struct efx_nic *efx); efx 648 drivers/net/ethernet/sfc/net_driver.h void (*get_link_ksettings)(struct efx_nic *efx, efx 650 drivers/net/ethernet/sfc/net_driver.h int (*set_link_ksettings)(struct efx_nic *efx, efx 652 drivers/net/ethernet/sfc/net_driver.h int (*get_fecparam)(struct efx_nic *efx, struct ethtool_fecparam *fec); efx 653 drivers/net/ethernet/sfc/net_driver.h int (*set_fecparam)(struct efx_nic *efx, efx 655 drivers/net/ethernet/sfc/net_driver.h void (*set_npage_adv) (struct efx_nic *efx, u32); efx 656 drivers/net/ethernet/sfc/net_driver.h int (*test_alive) (struct efx_nic *efx); efx 657 drivers/net/ethernet/sfc/net_driver.h const char *(*test_name) (struct efx_nic *efx, unsigned int index); efx 658 drivers/net/ethernet/sfc/net_driver.h int (*run_tests) (struct efx_nic *efx, int *results, unsigned flags); efx 659 drivers/net/ethernet/sfc/net_driver.h int (*get_module_eeprom) (struct efx_nic *efx, efx 662 drivers/net/ethernet/sfc/net_driver.h int (*get_module_info) (struct efx_nic *efx, efx 1095 drivers/net/ethernet/sfc/net_driver.h static inline int efx_dev_registered(struct efx_nic *efx) efx 1097 drivers/net/ethernet/sfc/net_driver.h return efx->net_dev->reg_state == NETREG_REGISTERED; efx 1100 drivers/net/ethernet/sfc/net_driver.h static inline unsigned int efx_port_num(struct efx_nic *efx) efx 1102 drivers/net/ethernet/sfc/net_driver.h return efx->port_num; efx 1272 drivers/net/ethernet/sfc/net_driver.h unsigned int (*mem_bar)(struct efx_nic *efx); efx 1273 drivers/net/ethernet/sfc/net_driver.h unsigned int (*mem_map_size)(struct efx_nic *efx); efx 1274 drivers/net/ethernet/sfc/net_driver.h int (*probe)(struct efx_nic *efx); efx 1275 drivers/net/ethernet/sfc/net_driver.h void (*remove)(struct efx_nic *efx); efx 1276 drivers/net/ethernet/sfc/net_driver.h int (*init)(struct efx_nic *efx); efx 1277 drivers/net/ethernet/sfc/net_driver.h int (*dimension_resources)(struct efx_nic *efx); efx 1278 drivers/net/ethernet/sfc/net_driver.h void (*fini)(struct efx_nic *efx); efx 1279 drivers/net/ethernet/sfc/net_driver.h void (*monitor)(struct efx_nic *efx); efx 1282 drivers/net/ethernet/sfc/net_driver.h int (*reset)(struct efx_nic *efx, enum reset_type method); efx 1283 drivers/net/ethernet/sfc/net_driver.h int (*probe_port)(struct efx_nic *efx); efx 1284 drivers/net/ethernet/sfc/net_driver.h void (*remove_port)(struct efx_nic *efx); efx 1286 drivers/net/ethernet/sfc/net_driver.h int (*fini_dmaq)(struct efx_nic *efx); efx 1287 drivers/net/ethernet/sfc/net_driver.h void (*prepare_flush)(struct efx_nic *efx); efx 1288 drivers/net/ethernet/sfc/net_driver.h void (*finish_flush)(struct efx_nic *efx); efx 1289 drivers/net/ethernet/sfc/net_driver.h void (*prepare_flr)(struct efx_nic *efx); efx 1290 drivers/net/ethernet/sfc/net_driver.h void (*finish_flr)(struct efx_nic *efx); efx 1291 drivers/net/ethernet/sfc/net_driver.h size_t (*describe_stats)(struct efx_nic *efx, u8 *names); efx 1292 drivers/net/ethernet/sfc/net_driver.h size_t (*update_stats)(struct efx_nic *efx, u64 *full_stats, efx 1294 drivers/net/ethernet/sfc/net_driver.h void (*start_stats)(struct efx_nic *efx); efx 1295 drivers/net/ethernet/sfc/net_driver.h void (*pull_stats)(struct efx_nic *efx); efx 1296 drivers/net/ethernet/sfc/net_driver.h void (*stop_stats)(struct efx_nic *efx); efx 1297 drivers/net/ethernet/sfc/net_driver.h void (*set_id_led)(struct efx_nic *efx, enum efx_led_mode mode); efx 1299 drivers/net/ethernet/sfc/net_driver.h int (*reconfigure_port)(struct efx_nic *efx); efx 1300 drivers/net/ethernet/sfc/net_driver.h void (*prepare_enable_fc_tx)(struct efx_nic *efx); efx 1301 drivers/net/ethernet/sfc/net_driver.h int (*reconfigure_mac)(struct efx_nic *efx); efx 1302 drivers/net/ethernet/sfc/net_driver.h bool (*check_mac_fault)(struct efx_nic *efx); efx 1303 drivers/net/ethernet/sfc/net_driver.h void (*get_wol)(struct efx_nic *efx, struct ethtool_wolinfo *wol); efx 1304 drivers/net/ethernet/sfc/net_driver.h int (*set_wol)(struct efx_nic *efx, u32 type); efx 1305 drivers/net/ethernet/sfc/net_driver.h void (*resume_wol)(struct efx_nic *efx); efx 1306 drivers/net/ethernet/sfc/net_driver.h int (*test_chip)(struct efx_nic *efx, struct efx_self_tests *tests); efx 1307 drivers/net/ethernet/sfc/net_driver.h int (*test_nvram)(struct efx_nic *efx); efx 1308 drivers/net/ethernet/sfc/net_driver.h void (*mcdi_request)(struct efx_nic *efx, efx 1311 drivers/net/ethernet/sfc/net_driver.h bool (*mcdi_poll_response)(struct efx_nic *efx); efx 1312 drivers/net/ethernet/sfc/net_driver.h void (*mcdi_read_response)(struct efx_nic *efx, efx_dword_t *pdu, efx 1314 drivers/net/ethernet/sfc/net_driver.h int (*mcdi_poll_reboot)(struct efx_nic *efx); efx 1315 drivers/net/ethernet/sfc/net_driver.h void (*mcdi_reboot_detected)(struct efx_nic *efx); efx 1316 drivers/net/ethernet/sfc/net_driver.h void (*irq_enable_master)(struct efx_nic *efx); efx 1317 drivers/net/ethernet/sfc/net_driver.h int (*irq_test_generate)(struct efx_nic *efx); efx 1318 drivers/net/ethernet/sfc/net_driver.h void (*irq_disable_non_ev)(struct efx_nic *efx); efx 1327 drivers/net/ethernet/sfc/net_driver.h int (*rx_push_rss_config)(struct efx_nic *efx, bool user, efx 1329 drivers/net/ethernet/sfc/net_driver.h int (*rx_pull_rss_config)(struct efx_nic *efx); efx 1330 drivers/net/ethernet/sfc/net_driver.h int (*rx_push_rss_context_config)(struct efx_nic *efx, efx 1334 drivers/net/ethernet/sfc/net_driver.h int (*rx_pull_rss_context_config)(struct efx_nic *efx, efx 1336 drivers/net/ethernet/sfc/net_driver.h void (*rx_restore_rss_contexts)(struct efx_nic *efx); efx 1349 drivers/net/ethernet/sfc/net_driver.h int (*filter_table_probe)(struct efx_nic *efx); efx 1350 drivers/net/ethernet/sfc/net_driver.h void (*filter_table_restore)(struct efx_nic *efx); efx 1351 drivers/net/ethernet/sfc/net_driver.h void (*filter_table_remove)(struct efx_nic *efx); efx 1352 drivers/net/ethernet/sfc/net_driver.h void (*filter_update_rx_scatter)(struct efx_nic *efx); efx 1353 drivers/net/ethernet/sfc/net_driver.h s32 (*filter_insert)(struct efx_nic *efx, efx 1355 drivers/net/ethernet/sfc/net_driver.h int (*filter_remove_safe)(struct efx_nic *efx, efx 1358 drivers/net/ethernet/sfc/net_driver.h int (*filter_get_safe)(struct efx_nic *efx, efx 1361 drivers/net/ethernet/sfc/net_driver.h int (*filter_clear_rx)(struct efx_nic *efx, efx 1363 drivers/net/ethernet/sfc/net_driver.h u32 (*filter_count_rx_used)(struct efx_nic *efx, efx 1365 drivers/net/ethernet/sfc/net_driver.h u32 (*filter_get_rx_id_limit)(struct efx_nic *efx); efx 1366 drivers/net/ethernet/sfc/net_driver.h s32 (*filter_get_rx_ids)(struct efx_nic *efx, efx 1370 drivers/net/ethernet/sfc/net_driver.h bool (*filter_rfs_expire_one)(struct efx_nic *efx, u32 flow_id, efx 1374 drivers/net/ethernet/sfc/net_driver.h int (*mtd_probe)(struct efx_nic *efx); efx 1383 drivers/net/ethernet/sfc/net_driver.h void (*ptp_write_host_time)(struct efx_nic *efx, u32 host_time); efx 1384 drivers/net/ethernet/sfc/net_driver.h int (*ptp_set_ts_sync_events)(struct efx_nic *efx, bool en, bool temp); efx 1385 drivers/net/ethernet/sfc/net_driver.h int (*ptp_set_ts_config)(struct efx_nic *efx, efx 1387 drivers/net/ethernet/sfc/net_driver.h int (*sriov_configure)(struct efx_nic *efx, int num_vfs); efx 1388 drivers/net/ethernet/sfc/net_driver.h int (*vlan_rx_add_vid)(struct efx_nic *efx, __be16 proto, u16 vid); efx 1389 drivers/net/ethernet/sfc/net_driver.h int (*vlan_rx_kill_vid)(struct efx_nic *efx, __be16 proto, u16 vid); efx 1390 drivers/net/ethernet/sfc/net_driver.h int (*get_phys_port_id)(struct efx_nic *efx, efx 1392 drivers/net/ethernet/sfc/net_driver.h int (*sriov_init)(struct efx_nic *efx); efx 1393 drivers/net/ethernet/sfc/net_driver.h void (*sriov_fini)(struct efx_nic *efx); efx 1394 drivers/net/ethernet/sfc/net_driver.h bool (*sriov_wanted)(struct efx_nic *efx); efx 1395 drivers/net/ethernet/sfc/net_driver.h void (*sriov_reset)(struct efx_nic *efx); efx 1396 drivers/net/ethernet/sfc/net_driver.h void (*sriov_flr)(struct efx_nic *efx, unsigned vf_i); efx 1397 drivers/net/ethernet/sfc/net_driver.h int (*sriov_set_vf_mac)(struct efx_nic *efx, int vf_i, u8 *mac); efx 1398 drivers/net/ethernet/sfc/net_driver.h int (*sriov_set_vf_vlan)(struct efx_nic *efx, int vf_i, u16 vlan, efx 1400 drivers/net/ethernet/sfc/net_driver.h int (*sriov_set_vf_spoofchk)(struct efx_nic *efx, int vf_i, efx 1402 drivers/net/ethernet/sfc/net_driver.h int (*sriov_get_vf_config)(struct efx_nic *efx, int vf_i, efx 1404 drivers/net/ethernet/sfc/net_driver.h int (*sriov_set_vf_link_state)(struct efx_nic *efx, int vf_i, efx 1406 drivers/net/ethernet/sfc/net_driver.h int (*vswitching_probe)(struct efx_nic *efx); efx 1407 drivers/net/ethernet/sfc/net_driver.h int (*vswitching_restore)(struct efx_nic *efx); efx 1408 drivers/net/ethernet/sfc/net_driver.h void (*vswitching_remove)(struct efx_nic *efx); efx 1409 drivers/net/ethernet/sfc/net_driver.h int (*get_mac_address)(struct efx_nic *efx, unsigned char *perm_addr); efx 1410 drivers/net/ethernet/sfc/net_driver.h int (*set_mac_address)(struct efx_nic *efx); efx 1411 drivers/net/ethernet/sfc/net_driver.h u32 (*tso_versions)(struct efx_nic *efx); efx 1412 drivers/net/ethernet/sfc/net_driver.h int (*udp_tnl_push_ports)(struct efx_nic *efx); efx 1413 drivers/net/ethernet/sfc/net_driver.h int (*udp_tnl_add_port)(struct efx_nic *efx, struct efx_udp_tunnel tnl); efx 1414 drivers/net/ethernet/sfc/net_driver.h bool (*udp_tnl_has_port)(struct efx_nic *efx, __be16 port); efx 1415 drivers/net/ethernet/sfc/net_driver.h int (*udp_tnl_del_port)(struct efx_nic *efx, struct efx_udp_tunnel tnl); efx 1448 drivers/net/ethernet/sfc/net_driver.h efx_get_channel(struct efx_nic *efx, unsigned index) efx 1450 drivers/net/ethernet/sfc/net_driver.h EFX_WARN_ON_ONCE_PARANOID(index >= efx->n_channels); efx 1451 drivers/net/ethernet/sfc/net_driver.h return efx->channel[index]; efx 1469 drivers/net/ethernet/sfc/net_driver.h efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type) efx 1471 drivers/net/ethernet/sfc/net_driver.h EFX_WARN_ON_ONCE_PARANOID(index >= efx->n_tx_channels || efx 1473 drivers/net/ethernet/sfc/net_driver.h return &efx->channel[efx->tx_channel_offset + index]->tx_queue[type]; efx 1492 drivers/net/ethernet/sfc/net_driver.h return !(tx_queue->efx->net_dev->num_tc < 2 && efx 1591 drivers/net/ethernet/sfc/net_driver.h static inline netdev_features_t efx_supported_features(const struct efx_nic *efx) efx 1593 drivers/net/ethernet/sfc/net_driver.h const struct net_device *net_dev = efx->net_dev; efx 31 drivers/net/ethernet/sfc/nic.c int efx_nic_alloc_buffer(struct efx_nic *efx, struct efx_buffer *buffer, efx 34 drivers/net/ethernet/sfc/nic.c buffer->addr = dma_alloc_coherent(&efx->pci_dev->dev, len, efx 42 drivers/net/ethernet/sfc/nic.c void efx_nic_free_buffer(struct efx_nic *efx, struct efx_buffer *buffer) efx 45 drivers/net/ethernet/sfc/nic.c dma_free_coherent(&efx->pci_dev->dev, buffer->len, efx 63 drivers/net/ethernet/sfc/nic.c channel->efx->type->ev_test_generate(channel); efx 66 drivers/net/ethernet/sfc/nic.c int efx_nic_irq_test_start(struct efx_nic *efx) efx 68 drivers/net/ethernet/sfc/nic.c efx->last_irq_cpu = -1; efx 70 drivers/net/ethernet/sfc/nic.c return efx->type->irq_test_generate(efx); efx 76 drivers/net/ethernet/sfc/nic.c int efx_nic_init_interrupt(struct efx_nic *efx) efx 82 drivers/net/ethernet/sfc/nic.c if (!EFX_INT_MODE_USE_MSI(efx)) { efx 83 drivers/net/ethernet/sfc/nic.c rc = request_irq(efx->legacy_irq, efx 84 drivers/net/ethernet/sfc/nic.c efx->type->irq_handle_legacy, IRQF_SHARED, efx 85 drivers/net/ethernet/sfc/nic.c efx->name, efx); efx 87 drivers/net/ethernet/sfc/nic.c netif_err(efx, drv, efx->net_dev, efx 89 drivers/net/ethernet/sfc/nic.c efx->pci_dev->irq); efx 96 drivers/net/ethernet/sfc/nic.c if (efx->interrupt_mode == EFX_INT_MODE_MSIX) { efx 97 drivers/net/ethernet/sfc/nic.c efx->net_dev->rx_cpu_rmap = efx 98 drivers/net/ethernet/sfc/nic.c alloc_irq_cpu_rmap(efx->n_rx_channels); efx 99 drivers/net/ethernet/sfc/nic.c if (!efx->net_dev->rx_cpu_rmap) { efx 108 drivers/net/ethernet/sfc/nic.c efx_for_each_channel(channel, efx) { efx 109 drivers/net/ethernet/sfc/nic.c rc = request_irq(channel->irq, efx->type->irq_handle_msi, efx 111 drivers/net/ethernet/sfc/nic.c efx->msi_context[channel->channel].name, efx 112 drivers/net/ethernet/sfc/nic.c &efx->msi_context[channel->channel]); efx 114 drivers/net/ethernet/sfc/nic.c netif_err(efx, drv, efx->net_dev, efx 121 drivers/net/ethernet/sfc/nic.c if (efx->interrupt_mode == EFX_INT_MODE_MSIX && efx 122 drivers/net/ethernet/sfc/nic.c channel->channel < efx->n_rx_channels) { efx 123 drivers/net/ethernet/sfc/nic.c rc = irq_cpu_rmap_add(efx->net_dev->rx_cpu_rmap, efx 135 drivers/net/ethernet/sfc/nic.c free_irq_cpu_rmap(efx->net_dev->rx_cpu_rmap); efx 136 drivers/net/ethernet/sfc/nic.c efx->net_dev->rx_cpu_rmap = NULL; efx 138 drivers/net/ethernet/sfc/nic.c efx_for_each_channel(channel, efx) { efx 141 drivers/net/ethernet/sfc/nic.c free_irq(channel->irq, &efx->msi_context[channel->channel]); efx 147 drivers/net/ethernet/sfc/nic.c void efx_nic_fini_interrupt(struct efx_nic *efx) efx 152 drivers/net/ethernet/sfc/nic.c free_irq_cpu_rmap(efx->net_dev->rx_cpu_rmap); efx 153 drivers/net/ethernet/sfc/nic.c efx->net_dev->rx_cpu_rmap = NULL; efx 156 drivers/net/ethernet/sfc/nic.c if (EFX_INT_MODE_USE_MSI(efx)) { efx 158 drivers/net/ethernet/sfc/nic.c efx_for_each_channel(channel, efx) efx 160 drivers/net/ethernet/sfc/nic.c &efx->msi_context[channel->channel]); efx 163 drivers/net/ethernet/sfc/nic.c free_irq(efx->legacy_irq, efx); efx 368 drivers/net/ethernet/sfc/nic.c size_t efx_nic_get_regs_len(struct efx_nic *efx) efx 377 drivers/net/ethernet/sfc/nic.c if (efx->type->revision >= reg->min_revision && efx 378 drivers/net/ethernet/sfc/nic.c efx->type->revision <= reg->max_revision) efx 384 drivers/net/ethernet/sfc/nic.c if (efx->type->revision >= table->min_revision && efx 385 drivers/net/ethernet/sfc/nic.c efx->type->revision <= table->max_revision) efx 391 drivers/net/ethernet/sfc/nic.c void efx_nic_get_regs(struct efx_nic *efx, void *buf) efx 399 drivers/net/ethernet/sfc/nic.c if (efx->type->revision >= reg->min_revision && efx 400 drivers/net/ethernet/sfc/nic.c efx->type->revision <= reg->max_revision) { efx 401 drivers/net/ethernet/sfc/nic.c efx_reado(efx, (efx_oword_t *)buf, reg->offset); efx 411 drivers/net/ethernet/sfc/nic.c if (!(efx->type->revision >= table->min_revision && efx 412 drivers/net/ethernet/sfc/nic.c efx->type->revision <= table->max_revision)) efx 420 drivers/net/ethernet/sfc/nic.c efx_readd(efx, buf, table->offset + 4 * i); efx 423 drivers/net/ethernet/sfc/nic.c efx_sram_readq(efx, efx 424 drivers/net/ethernet/sfc/nic.c efx->membase + table->offset, efx 428 drivers/net/ethernet/sfc/nic.c efx_reado_table(efx, buf, table->offset, i); efx 431 drivers/net/ethernet/sfc/nic.c efx_reado_table(efx, buf, table->offset, 2 * i); efx 522 drivers/net/ethernet/sfc/nic.c void efx_nic_fix_nodesc_drop_stat(struct efx_nic *efx, u64 *rx_nodesc_drops) efx 525 drivers/net/ethernet/sfc/nic.c if (!(efx->net_dev->flags & IFF_UP) || !efx->rx_nodesc_drops_prev_state) efx 526 drivers/net/ethernet/sfc/nic.c efx->rx_nodesc_drops_while_down += efx 527 drivers/net/ethernet/sfc/nic.c *rx_nodesc_drops - efx->rx_nodesc_drops_total; efx 528 drivers/net/ethernet/sfc/nic.c efx->rx_nodesc_drops_total = *rx_nodesc_drops; efx 529 drivers/net/ethernet/sfc/nic.c efx->rx_nodesc_drops_prev_state = !!(efx->net_dev->flags & IFF_UP); efx 530 drivers/net/ethernet/sfc/nic.c *rx_nodesc_drops -= efx->rx_nodesc_drops_while_down; efx 26 drivers/net/ethernet/sfc/nic.h static inline int efx_nic_rev(struct efx_nic *efx) efx 28 drivers/net/ethernet/sfc/nic.h return efx->type->revision; efx 31 drivers/net/ethernet/sfc/nic.h u32 efx_farch_fpga_ver(struct efx_nic *efx); efx 96 drivers/net/ethernet/sfc/nic.h EFX_WARN_ON_ONCE_PARANOID(!tx_queue->efx->type->option_descriptors); efx 238 drivers/net/ethernet/sfc/nic.h struct efx_nic *efx; efx 447 drivers/net/ethernet/sfc/nic.h int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel); efx 448 drivers/net/ethernet/sfc/nic.h void efx_ptp_defer_probe_with_channel(struct efx_nic *efx); efx 449 drivers/net/ethernet/sfc/nic.h struct efx_channel *efx_ptp_channel(struct efx_nic *efx); efx 450 drivers/net/ethernet/sfc/nic.h void efx_ptp_remove(struct efx_nic *efx); efx 451 drivers/net/ethernet/sfc/nic.h int efx_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr); efx 452 drivers/net/ethernet/sfc/nic.h int efx_ptp_get_ts_config(struct efx_nic *efx, struct ifreq *ifr); efx 453 drivers/net/ethernet/sfc/nic.h void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info); efx 454 drivers/net/ethernet/sfc/nic.h bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb); efx 455 drivers/net/ethernet/sfc/nic.h int efx_ptp_get_mode(struct efx_nic *efx); efx 456 drivers/net/ethernet/sfc/nic.h int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted, efx 458 drivers/net/ethernet/sfc/nic.h int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb); efx 459 drivers/net/ethernet/sfc/nic.h void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev); efx 460 drivers/net/ethernet/sfc/nic.h size_t efx_ptp_describe_stats(struct efx_nic *efx, u8 *strings); efx 461 drivers/net/ethernet/sfc/nic.h size_t efx_ptp_update_stats(struct efx_nic *efx, u64 *stats); efx 471 drivers/net/ethernet/sfc/nic.h void efx_ptp_start_datapath(struct efx_nic *efx); efx 472 drivers/net/ethernet/sfc/nic.h void efx_ptp_stop_datapath(struct efx_nic *efx); efx 473 drivers/net/ethernet/sfc/nic.h bool efx_ptp_use_mac_tx_timestamps(struct efx_nic *efx); efx 489 drivers/net/ethernet/sfc/nic.h int falcon_probe_board(struct efx_nic *efx, u16 revision_info); efx 494 drivers/net/ethernet/sfc/nic.h return tx_queue->efx->type->tx_probe(tx_queue); efx 498 drivers/net/ethernet/sfc/nic.h tx_queue->efx->type->tx_init(tx_queue); efx 502 drivers/net/ethernet/sfc/nic.h tx_queue->efx->type->tx_remove(tx_queue); efx 506 drivers/net/ethernet/sfc/nic.h tx_queue->efx->type->tx_write(tx_queue); efx 512 drivers/net/ethernet/sfc/nic.h return rx_queue->efx->type->rx_probe(rx_queue); efx 516 drivers/net/ethernet/sfc/nic.h rx_queue->efx->type->rx_init(rx_queue); efx 520 drivers/net/ethernet/sfc/nic.h rx_queue->efx->type->rx_remove(rx_queue); efx 524 drivers/net/ethernet/sfc/nic.h rx_queue->efx->type->rx_write(rx_queue); efx 528 drivers/net/ethernet/sfc/nic.h rx_queue->efx->type->rx_defer_refill(rx_queue); efx 534 drivers/net/ethernet/sfc/nic.h return channel->efx->type->ev_probe(channel); efx 538 drivers/net/ethernet/sfc/nic.h return channel->efx->type->ev_init(channel); efx 542 drivers/net/ethernet/sfc/nic.h channel->efx->type->ev_fini(channel); efx 546 drivers/net/ethernet/sfc/nic.h channel->efx->type->ev_remove(channel); efx 551 drivers/net/ethernet/sfc/nic.h return channel->efx->type->ev_process(channel, quota); efx 555 drivers/net/ethernet/sfc/nic.h channel->efx->type->ev_read_ack(channel); efx 582 drivers/net/ethernet/sfc/nic.h int efx_farch_filter_table_probe(struct efx_nic *efx); efx 583 drivers/net/ethernet/sfc/nic.h void efx_farch_filter_table_restore(struct efx_nic *efx); efx 584 drivers/net/ethernet/sfc/nic.h void efx_farch_filter_table_remove(struct efx_nic *efx); efx 585 drivers/net/ethernet/sfc/nic.h void efx_farch_filter_update_rx_scatter(struct efx_nic *efx); efx 586 drivers/net/ethernet/sfc/nic.h s32 efx_farch_filter_insert(struct efx_nic *efx, struct efx_filter_spec *spec, efx 588 drivers/net/ethernet/sfc/nic.h int efx_farch_filter_remove_safe(struct efx_nic *efx, efx 591 drivers/net/ethernet/sfc/nic.h int efx_farch_filter_get_safe(struct efx_nic *efx, efx 594 drivers/net/ethernet/sfc/nic.h int efx_farch_filter_clear_rx(struct efx_nic *efx, efx 596 drivers/net/ethernet/sfc/nic.h u32 efx_farch_filter_count_rx_used(struct efx_nic *efx, efx 598 drivers/net/ethernet/sfc/nic.h u32 efx_farch_filter_get_rx_id_limit(struct efx_nic *efx); efx 599 drivers/net/ethernet/sfc/nic.h s32 efx_farch_filter_get_rx_ids(struct efx_nic *efx, efx 603 drivers/net/ethernet/sfc/nic.h bool efx_farch_filter_rfs_expire_one(struct efx_nic *efx, u32 flow_id, efx 606 drivers/net/ethernet/sfc/nic.h void efx_farch_filter_sync_rx_mode(struct efx_nic *efx); efx 629 drivers/net/ethernet/sfc/nic.h int efx_nic_init_interrupt(struct efx_nic *efx); efx 630 drivers/net/ethernet/sfc/nic.h int efx_nic_irq_test_start(struct efx_nic *efx); efx 631 drivers/net/ethernet/sfc/nic.h void efx_nic_fini_interrupt(struct efx_nic *efx); efx 634 drivers/net/ethernet/sfc/nic.h void efx_farch_irq_enable_master(struct efx_nic *efx); efx 635 drivers/net/ethernet/sfc/nic.h int efx_farch_irq_test_generate(struct efx_nic *efx); efx 636 drivers/net/ethernet/sfc/nic.h void efx_farch_irq_disable_master(struct efx_nic *efx); efx 639 drivers/net/ethernet/sfc/nic.h irqreturn_t efx_farch_fatal_interrupt(struct efx_nic *efx); efx 645 drivers/net/ethernet/sfc/nic.h static inline int efx_nic_irq_test_irq_cpu(struct efx_nic *efx) efx 647 drivers/net/ethernet/sfc/nic.h return READ_ONCE(efx->last_irq_cpu); efx 651 drivers/net/ethernet/sfc/nic.h int efx_nic_flush_queues(struct efx_nic *efx); efx 652 drivers/net/ethernet/sfc/nic.h void siena_prepare_flush(struct efx_nic *efx); efx 653 drivers/net/ethernet/sfc/nic.h int efx_farch_fini_dmaq(struct efx_nic *efx); efx 654 drivers/net/ethernet/sfc/nic.h void efx_farch_finish_flr(struct efx_nic *efx); efx 655 drivers/net/ethernet/sfc/nic.h void siena_finish_flush(struct efx_nic *efx); efx 656 drivers/net/ethernet/sfc/nic.h void falcon_start_nic_stats(struct efx_nic *efx); efx 657 drivers/net/ethernet/sfc/nic.h void falcon_stop_nic_stats(struct efx_nic *efx); efx 658 drivers/net/ethernet/sfc/nic.h int falcon_reset_xaui(struct efx_nic *efx); efx 659 drivers/net/ethernet/sfc/nic.h void efx_farch_dimension_resources(struct efx_nic *efx, unsigned sram_lim_qw); efx 660 drivers/net/ethernet/sfc/nic.h void efx_farch_init_common(struct efx_nic *efx); efx 661 drivers/net/ethernet/sfc/nic.h void efx_ef10_handle_drain_event(struct efx_nic *efx); efx 662 drivers/net/ethernet/sfc/nic.h void efx_farch_rx_push_indir_table(struct efx_nic *efx); efx 663 drivers/net/ethernet/sfc/nic.h void efx_farch_rx_pull_indir_table(struct efx_nic *efx); efx 665 drivers/net/ethernet/sfc/nic.h int efx_nic_alloc_buffer(struct efx_nic *efx, struct efx_buffer *buffer, efx 667 drivers/net/ethernet/sfc/nic.h void efx_nic_free_buffer(struct efx_nic *efx, struct efx_buffer *buffer); efx 674 drivers/net/ethernet/sfc/nic.h int efx_farch_test_registers(struct efx_nic *efx, efx 678 drivers/net/ethernet/sfc/nic.h size_t efx_nic_get_regs_len(struct efx_nic *efx); efx 679 drivers/net/ethernet/sfc/nic.h void efx_nic_get_regs(struct efx_nic *efx, void *buf); efx 686 drivers/net/ethernet/sfc/nic.h void efx_nic_fix_nodesc_drop_stat(struct efx_nic *efx, u64 *stat); efx 690 drivers/net/ethernet/sfc/nic.h void efx_farch_generate_event(struct efx_nic *efx, unsigned int evq, efx 280 drivers/net/ethernet/sfc/ptp.c struct efx_nic *efx; efx 342 drivers/net/ethernet/sfc/ptp.c void (*xmit_skb)(struct efx_nic *efx, struct sk_buff *skb); efx 353 drivers/net/ethernet/sfc/ptp.c bool efx_ptp_use_mac_tx_timestamps(struct efx_nic *efx) efx 355 drivers/net/ethernet/sfc/ptp.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 357 drivers/net/ethernet/sfc/ptp.c return ((efx_nic_rev(efx) >= EFX_REV_HUNT_A0) && efx 368 drivers/net/ethernet/sfc/ptp.c return efx_ptp_use_mac_tx_timestamps(channel->efx); efx 396 drivers/net/ethernet/sfc/ptp.c size_t efx_ptp_describe_stats(struct efx_nic *efx, u8 *strings) efx 398 drivers/net/ethernet/sfc/ptp.c if (!efx->ptp_data) efx 405 drivers/net/ethernet/sfc/ptp.c size_t efx_ptp_update_stats(struct efx_nic *efx, u64 *stats) efx 412 drivers/net/ethernet/sfc/ptp.c if (!efx->ptp_data) efx 419 drivers/net/ethernet/sfc/ptp.c stats[i] = *(unsigned int *)((char *)efx->ptp_data + efx 429 drivers/net/ethernet/sfc/ptp.c rc = efx_mcdi_rpc(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), efx 539 drivers/net/ethernet/sfc/ptp.c struct efx_channel *efx_ptp_channel(struct efx_nic *efx) efx 541 drivers/net/ethernet/sfc/ptp.c return efx->ptp_data ? efx->ptp_data->channel : NULL; efx 544 drivers/net/ethernet/sfc/ptp.c static u32 last_sync_timestamp_major(struct efx_nic *efx) efx 546 drivers/net/ethernet/sfc/ptp.c struct efx_channel *channel = efx_ptp_channel(efx); efx 558 drivers/net/ethernet/sfc/ptp.c efx_ptp_mac_nic_to_ktime_correction(struct efx_nic *efx, efx 588 drivers/net/ethernet/sfc/ptp.c sync_timestamp = last_sync_timestamp_major(efx); efx 611 drivers/net/ethernet/sfc/ptp.c struct efx_nic *efx = tx_queue->efx; efx 612 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 615 drivers/net/ethernet/sfc/ptp.c if (efx_ptp_use_mac_tx_timestamps(efx)) efx 616 drivers/net/ethernet/sfc/ptp.c kt = efx_ptp_mac_nic_to_ktime_correction(efx, ptp, efx 629 drivers/net/ethernet/sfc/ptp.c static int efx_ptp_get_attributes(struct efx_nic *efx) efx 633 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 644 drivers/net/ethernet/sfc/ptp.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), efx 651 drivers/net/ethernet/sfc/ptp.c netif_info(efx, probe, efx->net_dev, "no PTP support\n"); efx 654 drivers/net/ethernet/sfc/ptp.c efx_mcdi_display_error(efx, MC_CMD_PTP, sizeof(inbuf), efx 728 drivers/net/ethernet/sfc/ptp.c static int efx_ptp_get_timestamp_corrections(struct efx_nic *efx) efx 742 drivers/net/ethernet/sfc/ptp.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), efx 745 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.ptp_tx = MCDI_DWORD(outbuf, efx 747 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.ptp_rx = MCDI_DWORD(outbuf, efx 749 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.pps_out = MCDI_DWORD(outbuf, efx 751 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.pps_in = MCDI_DWORD(outbuf, efx 755 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.general_tx = MCDI_DWORD( efx 758 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.general_rx = MCDI_DWORD( efx 762 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.general_tx = efx 763 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.ptp_tx; efx 764 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.general_rx = efx 765 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.ptp_rx; efx 768 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.ptp_tx = 0; efx 769 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.ptp_rx = 0; efx 770 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.pps_out = 0; efx 771 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.pps_in = 0; efx 772 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.general_tx = 0; efx 773 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ts_corrections.general_rx = 0; efx 775 drivers/net/ethernet/sfc/ptp.c efx_mcdi_display_error(efx, MC_CMD_PTP, sizeof(inbuf), outbuf, efx 784 drivers/net/ethernet/sfc/ptp.c static int efx_ptp_enable(struct efx_nic *efx) efx 793 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->channel ? efx 794 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->channel->channel : 0); efx 795 drivers/net/ethernet/sfc/ptp.c MCDI_SET_DWORD(inbuf, PTP_IN_ENABLE_MODE, efx->ptp_data->mode); efx 797 drivers/net/ethernet/sfc/ptp.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), efx 801 drivers/net/ethernet/sfc/ptp.c efx_mcdi_display_error(efx, MC_CMD_PTP, efx 812 drivers/net/ethernet/sfc/ptp.c static int efx_ptp_disable(struct efx_nic *efx) efx 820 drivers/net/ethernet/sfc/ptp.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), efx 827 drivers/net/ethernet/sfc/ptp.c netif_info(efx, probe, efx->net_dev, "no PTP support\n"); efx 829 drivers/net/ethernet/sfc/ptp.c efx_mcdi_display_error(efx, MC_CMD_PTP, efx 846 drivers/net/ethernet/sfc/ptp.c static void efx_ptp_handle_no_channel(struct efx_nic *efx) efx 848 drivers/net/ethernet/sfc/ptp.c netif_err(efx, drv, efx->net_dev, efx 856 drivers/net/ethernet/sfc/ptp.c static void efx_ptp_send_times(struct efx_nic *efx, efx 861 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 886 drivers/net/ethernet/sfc/ptp.c efx->type->ptp_write_host_time(efx, host_time); efx 922 drivers/net/ethernet/sfc/ptp.c efx_ptp_process_times(struct efx_nic *efx, MCDI_DECLARE_STRUCT_PTR(synch_buf), efx 932 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 983 drivers/net/ethernet/sfc/ptp.c netif_warn(efx, drv, efx->net_dev, efx 998 drivers/net/ethernet/sfc/ptp.c netif_warn(efx, hw, efx->net_dev, efx 1025 drivers/net/ethernet/sfc/ptp.c static int efx_ptp_synchronize(struct efx_nic *efx, unsigned int num_readings) efx 1027 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1045 drivers/net/ethernet/sfc/ptp.c rc = efx_mcdi_rpc_start(efx, MC_CMD_PTP, synch_buf, efx 1062 drivers/net/ethernet/sfc/ptp.c efx_ptp_send_times(efx, &last_time); efx 1065 drivers/net/ethernet/sfc/ptp.c rc = efx_mcdi_rpc_finish(efx, MC_CMD_PTP, efx 1070 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_process_times(efx, synch_buf, response_length, efx 1088 drivers/net/ethernet/sfc/ptp.c static void efx_ptp_xmit_skb_queue(struct efx_nic *efx, struct sk_buff *skb) efx 1090 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp_data = efx->ptp_data; efx 1104 drivers/net/ethernet/sfc/ptp.c static void efx_ptp_xmit_skb_mc(struct efx_nic *efx, struct sk_buff *skb) efx 1106 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp_data = efx->ptp_data; efx 1130 drivers/net/ethernet/sfc/ptp.c rc = efx_mcdi_rpc(efx, MC_CMD_PTP, efx 1152 drivers/net/ethernet/sfc/ptp.c static void efx_ptp_drop_time_expired_events(struct efx_nic *efx) efx 1154 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1171 drivers/net/ethernet/sfc/ptp.c netif_warn(efx, hw, efx->net_dev, efx 1179 drivers/net/ethernet/sfc/ptp.c static enum ptp_packet_state efx_ptp_match_rx(struct efx_nic *efx, efx 1182 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1228 drivers/net/ethernet/sfc/ptp.c static void efx_ptp_process_events(struct efx_nic *efx, struct sk_buff_head *q) efx 1230 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1239 drivers/net/ethernet/sfc/ptp.c } else if (efx_ptp_match_rx(efx, skb) == efx 1255 drivers/net/ethernet/sfc/ptp.c static inline void efx_ptp_process_rx(struct efx_nic *efx, struct sk_buff *skb) efx 1262 drivers/net/ethernet/sfc/ptp.c static void efx_ptp_remove_multicast_filters(struct efx_nic *efx) efx 1264 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1267 drivers/net/ethernet/sfc/ptp.c efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_REQUIRED, efx 1269 drivers/net/ethernet/sfc/ptp.c efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_REQUIRED, efx 1275 drivers/net/ethernet/sfc/ptp.c static int efx_ptp_insert_multicast_filters(struct efx_nic *efx) efx 1277 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1296 drivers/net/ethernet/sfc/ptp.c rc = efx_filter_insert_filter(efx, &rxfilter, true); efx 1310 drivers/net/ethernet/sfc/ptp.c rc = efx_filter_insert_filter(efx, &rxfilter, true); efx 1319 drivers/net/ethernet/sfc/ptp.c efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_REQUIRED, efx 1324 drivers/net/ethernet/sfc/ptp.c static int efx_ptp_start(struct efx_nic *efx) efx 1326 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1331 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_insert_multicast_filters(efx); efx 1335 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_enable(efx); efx 1345 drivers/net/ethernet/sfc/ptp.c efx_ptp_remove_multicast_filters(efx); efx 1349 drivers/net/ethernet/sfc/ptp.c static int efx_ptp_stop(struct efx_nic *efx) efx 1351 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1359 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_disable(efx); efx 1361 drivers/net/ethernet/sfc/ptp.c efx_ptp_remove_multicast_filters(efx); efx 1364 drivers/net/ethernet/sfc/ptp.c efx_ptp_deliver_rx_queue(&efx->ptp_data->rxq); efx 1365 drivers/net/ethernet/sfc/ptp.c skb_queue_purge(&efx->ptp_data->txq); efx 1368 drivers/net/ethernet/sfc/ptp.c spin_lock_bh(&efx->ptp_data->evt_lock); efx 1369 drivers/net/ethernet/sfc/ptp.c list_for_each_safe(cursor, next, &efx->ptp_data->evt_list) { efx 1370 drivers/net/ethernet/sfc/ptp.c list_move(cursor, &efx->ptp_data->evt_free_list); efx 1372 drivers/net/ethernet/sfc/ptp.c spin_unlock_bh(&efx->ptp_data->evt_lock); efx 1377 drivers/net/ethernet/sfc/ptp.c static int efx_ptp_restart(struct efx_nic *efx) efx 1379 drivers/net/ethernet/sfc/ptp.c if (efx->ptp_data && efx->ptp_data->enabled) efx 1380 drivers/net/ethernet/sfc/ptp.c return efx_ptp_start(efx); efx 1388 drivers/net/ethernet/sfc/ptp.c struct efx_nic *efx = ptp->efx; efx 1391 drivers/net/ethernet/sfc/ptp.c if (efx_ptp_synchronize(efx, PTP_SYNC_ATTEMPTS)) efx 1403 drivers/net/ethernet/sfc/ptp.c struct efx_nic *efx = ptp_data->efx; efx 1408 drivers/net/ethernet/sfc/ptp.c efx_ptp_stop(efx); efx 1409 drivers/net/ethernet/sfc/ptp.c efx_ptp_start(efx); efx 1413 drivers/net/ethernet/sfc/ptp.c efx_ptp_drop_time_expired_events(efx); efx 1416 drivers/net/ethernet/sfc/ptp.c efx_ptp_process_events(efx, &tempq); efx 1419 drivers/net/ethernet/sfc/ptp.c ptp_data->xmit_skb(efx, skb); efx 1422 drivers/net/ethernet/sfc/ptp.c efx_ptp_process_rx(efx, skb); efx 1442 drivers/net/ethernet/sfc/ptp.c int efx_ptp_probe(struct efx_nic *efx, struct efx_channel *channel) efx 1449 drivers/net/ethernet/sfc/ptp.c efx->ptp_data = ptp; efx 1450 drivers/net/ethernet/sfc/ptp.c if (!efx->ptp_data) efx 1453 drivers/net/ethernet/sfc/ptp.c ptp->efx = efx; efx 1455 drivers/net/ethernet/sfc/ptp.c ptp->rx_ts_inline = efx_nic_rev(efx) >= EFX_REV_HUNT_A0; efx 1457 drivers/net/ethernet/sfc/ptp.c rc = efx_nic_alloc_buffer(efx, &ptp->start, sizeof(int), GFP_KERNEL); efx 1469 drivers/net/ethernet/sfc/ptp.c if (efx_ptp_use_mac_tx_timestamps(efx)) { efx 1488 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_get_attributes(efx); efx 1493 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_get_timestamp_corrections(efx); efx 1497 drivers/net/ethernet/sfc/ptp.c if (efx->mcdi->fn_flags & efx 1501 drivers/net/ethernet/sfc/ptp.c &efx->pci_dev->dev); efx 1518 drivers/net/ethernet/sfc/ptp.c ptp_clock_unregister(efx->ptp_data->phc_clock); efx 1521 drivers/net/ethernet/sfc/ptp.c destroy_workqueue(efx->ptp_data->workwq); efx 1524 drivers/net/ethernet/sfc/ptp.c efx_nic_free_buffer(efx, &ptp->start); efx 1527 drivers/net/ethernet/sfc/ptp.c kfree(efx->ptp_data); efx 1528 drivers/net/ethernet/sfc/ptp.c efx->ptp_data = NULL; efx 1540 drivers/net/ethernet/sfc/ptp.c struct efx_nic *efx = channel->efx; efx 1546 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_probe(efx, channel); efx 1553 drivers/net/ethernet/sfc/ptp.c netif_warn(efx, drv, efx->net_dev, efx 1558 drivers/net/ethernet/sfc/ptp.c void efx_ptp_remove(struct efx_nic *efx) efx 1560 drivers/net/ethernet/sfc/ptp.c if (!efx->ptp_data) efx 1563 drivers/net/ethernet/sfc/ptp.c (void)efx_ptp_disable(efx); efx 1565 drivers/net/ethernet/sfc/ptp.c cancel_work_sync(&efx->ptp_data->work); efx 1566 drivers/net/ethernet/sfc/ptp.c if (efx->ptp_data->pps_workwq) efx 1567 drivers/net/ethernet/sfc/ptp.c cancel_work_sync(&efx->ptp_data->pps_work); efx 1569 drivers/net/ethernet/sfc/ptp.c skb_queue_purge(&efx->ptp_data->rxq); efx 1570 drivers/net/ethernet/sfc/ptp.c skb_queue_purge(&efx->ptp_data->txq); efx 1572 drivers/net/ethernet/sfc/ptp.c if (efx->ptp_data->phc_clock) { efx 1573 drivers/net/ethernet/sfc/ptp.c destroy_workqueue(efx->ptp_data->pps_workwq); efx 1574 drivers/net/ethernet/sfc/ptp.c ptp_clock_unregister(efx->ptp_data->phc_clock); efx 1577 drivers/net/ethernet/sfc/ptp.c destroy_workqueue(efx->ptp_data->workwq); efx 1579 drivers/net/ethernet/sfc/ptp.c efx_nic_free_buffer(efx, &efx->ptp_data->start); efx 1580 drivers/net/ethernet/sfc/ptp.c kfree(efx->ptp_data); efx 1581 drivers/net/ethernet/sfc/ptp.c efx->ptp_data = NULL; efx 1586 drivers/net/ethernet/sfc/ptp.c efx_ptp_remove(channel->efx); efx 1592 drivers/net/ethernet/sfc/ptp.c snprintf(buf, len, "%s-ptp", channel->efx->name); efx 1598 drivers/net/ethernet/sfc/ptp.c bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb) efx 1600 drivers/net/ethernet/sfc/ptp.c return efx->ptp_data && efx 1601 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->enabled && efx 1619 drivers/net/ethernet/sfc/ptp.c struct efx_nic *efx = channel->efx; efx 1620 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1704 drivers/net/ethernet/sfc/ptp.c int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb) efx 1706 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1718 drivers/net/ethernet/sfc/ptp.c int efx_ptp_get_mode(struct efx_nic *efx) efx 1720 drivers/net/ethernet/sfc/ptp.c return efx->ptp_data->mode; efx 1723 drivers/net/ethernet/sfc/ptp.c int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted, efx 1726 drivers/net/ethernet/sfc/ptp.c if ((enable_wanted != efx->ptp_data->enabled) || efx 1727 drivers/net/ethernet/sfc/ptp.c (enable_wanted && (efx->ptp_data->mode != new_mode))) { efx 1732 drivers/net/ethernet/sfc/ptp.c if (efx->ptp_data->enabled && efx 1733 drivers/net/ethernet/sfc/ptp.c (efx->ptp_data->mode != new_mode)) { efx 1734 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->enabled = false; efx 1735 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_stop(efx); efx 1744 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->mode = new_mode; efx 1745 drivers/net/ethernet/sfc/ptp.c if (netif_running(efx->net_dev)) efx 1746 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_start(efx); efx 1748 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_synchronize(efx, efx 1751 drivers/net/ethernet/sfc/ptp.c efx_ptp_stop(efx); efx 1754 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_stop(efx); efx 1760 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->enabled = enable_wanted; efx 1766 drivers/net/ethernet/sfc/ptp.c static int efx_ptp_ts_init(struct efx_nic *efx, struct hwtstamp_config *init) efx 1777 drivers/net/ethernet/sfc/ptp.c rc = efx->type->ptp_set_ts_config(efx, init); efx 1781 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->config = *init; efx 1785 drivers/net/ethernet/sfc/ptp.c void efx_ptp_get_ts_info(struct efx_nic *efx, struct ethtool_ts_info *ts_info) efx 1787 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1788 drivers/net/ethernet/sfc/ptp.c struct efx_nic *primary = efx->primary; efx 1801 drivers/net/ethernet/sfc/ptp.c if (efx_ptp_use_mac_tx_timestamps(efx)) { efx 1802 drivers/net/ethernet/sfc/ptp.c struct efx_ef10_nic_data *nic_data = efx->nic_data; efx 1813 drivers/net/ethernet/sfc/ptp.c ts_info->rx_filters = ptp->efx->type->hwtstamp_filters; efx 1816 drivers/net/ethernet/sfc/ptp.c int efx_ptp_set_ts_config(struct efx_nic *efx, struct ifreq *ifr) efx 1822 drivers/net/ethernet/sfc/ptp.c if (!efx->ptp_data) efx 1828 drivers/net/ethernet/sfc/ptp.c rc = efx_ptp_ts_init(efx, &config); efx 1836 drivers/net/ethernet/sfc/ptp.c int efx_ptp_get_ts_config(struct efx_nic *efx, struct ifreq *ifr) efx 1838 drivers/net/ethernet/sfc/ptp.c if (!efx->ptp_data) efx 1841 drivers/net/ethernet/sfc/ptp.c return copy_to_user(ifr->ifr_data, &efx->ptp_data->config, efx 1842 drivers/net/ethernet/sfc/ptp.c sizeof(efx->ptp_data->config)) ? -EFAULT : 0; efx 1845 drivers/net/ethernet/sfc/ptp.c static void ptp_event_failure(struct efx_nic *efx, int expected_frag_len) efx 1847 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1849 drivers/net/ethernet/sfc/ptp.c netif_err(efx, hw, efx->net_dev, efx 1860 drivers/net/ethernet/sfc/ptp.c static void ptp_event_rx(struct efx_nic *efx, struct efx_ptp_data *ptp) efx 1868 drivers/net/ethernet/sfc/ptp.c ptp_event_failure(efx, 3); efx 1885 drivers/net/ethernet/sfc/ptp.c evt->hwtimestamp = efx->ptp_data->nic_to_kernel_time( efx 1895 drivers/net/ethernet/sfc/ptp.c netif_err(efx, rx_err, efx->net_dev, "PTP event queue overflow\n"); efx 1900 drivers/net/ethernet/sfc/ptp.c static void ptp_event_fault(struct efx_nic *efx, struct efx_ptp_data *ptp) efx 1904 drivers/net/ethernet/sfc/ptp.c ptp_event_failure(efx, 1); efx 1908 drivers/net/ethernet/sfc/ptp.c netif_err(efx, hw, efx->net_dev, "PTP error %d\n", code); efx 1911 drivers/net/ethernet/sfc/ptp.c static void ptp_event_pps(struct efx_nic *efx, struct efx_ptp_data *ptp) efx 1917 drivers/net/ethernet/sfc/ptp.c void efx_ptp_event(struct efx_nic *efx, efx_qword_t *ev) efx 1919 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1923 drivers/net/ethernet/sfc/ptp.c if (!efx->ptp_warned) { efx 1924 drivers/net/ethernet/sfc/ptp.c netif_warn(efx, drv, efx->net_dev, efx 1926 drivers/net/ethernet/sfc/ptp.c efx->ptp_warned = true; efx 1937 drivers/net/ethernet/sfc/ptp.c netif_err(efx, hw, efx->net_dev, efx 1947 drivers/net/ethernet/sfc/ptp.c ptp_event_rx(efx, ptp); efx 1950 drivers/net/ethernet/sfc/ptp.c ptp_event_fault(efx, ptp); efx 1953 drivers/net/ethernet/sfc/ptp.c ptp_event_pps(efx, ptp); efx 1956 drivers/net/ethernet/sfc/ptp.c netif_err(efx, hw, efx->net_dev, efx 1962 drivers/net/ethernet/sfc/ptp.c netif_err(efx, hw, efx->net_dev, efx 1970 drivers/net/ethernet/sfc/ptp.c struct efx_nic *efx = channel->efx; efx 1971 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 1991 drivers/net/ethernet/sfc/ptp.c static inline u32 efx_rx_buf_timestamp_minor(struct efx_nic *efx, const u8 *eh) efx 1994 drivers/net/ethernet/sfc/ptp.c return __le32_to_cpup((const __le32 *)(eh + efx->rx_packet_ts_offset)); efx 1996 drivers/net/ethernet/sfc/ptp.c const u8 *data = eh + efx->rx_packet_ts_offset; efx 2007 drivers/net/ethernet/sfc/ptp.c struct efx_nic *efx = channel->efx; efx 2008 drivers/net/ethernet/sfc/ptp.c struct efx_ptp_data *ptp = efx->ptp_data; efx 2016 drivers/net/ethernet/sfc/ptp.c pkt_timestamp_minor = efx_rx_buf_timestamp_minor(efx, skb_mac_header(skb)); efx 2046 drivers/net/ethernet/sfc/ptp.c netif_vdbg(efx, drv, efx->net_dev, efx 2066 drivers/net/ethernet/sfc/ptp.c struct efx_nic *efx = ptp_data->efx; efx 2086 drivers/net/ethernet/sfc/ptp.c rc = efx_mcdi_rpc(efx, MC_CMD_PTP, inadj, sizeof(inadj), efx 2101 drivers/net/ethernet/sfc/ptp.c struct efx_nic *efx = ptp_data->efx; efx 2104 drivers/net/ethernet/sfc/ptp.c efx->ptp_data->ns_to_nic_time(delta, &nic_major, &nic_minor); efx 2111 drivers/net/ethernet/sfc/ptp.c return efx_mcdi_rpc(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), efx 2120 drivers/net/ethernet/sfc/ptp.c struct efx_nic *efx = ptp_data->efx; efx 2129 drivers/net/ethernet/sfc/ptp.c rc = efx_mcdi_rpc(efx, MC_CMD_PTP, inbuf, sizeof(inbuf), efx 2190 drivers/net/ethernet/sfc/ptp.c void efx_ptp_defer_probe_with_channel(struct efx_nic *efx) efx 2195 drivers/net/ethernet/sfc/ptp.c if (efx_ptp_disable(efx) == 0) efx 2196 drivers/net/ethernet/sfc/ptp.c efx->extra_channel_type[EFX_EXTRA_CHANNEL_PTP] = efx 2200 drivers/net/ethernet/sfc/ptp.c void efx_ptp_start_datapath(struct efx_nic *efx) efx 2202 drivers/net/ethernet/sfc/ptp.c if (efx_ptp_restart(efx)) efx 2203 drivers/net/ethernet/sfc/ptp.c netif_err(efx, drv, efx->net_dev, "Failed to restart PTP.\n"); efx 2205 drivers/net/ethernet/sfc/ptp.c if (efx->type->ptp_set_ts_sync_events) efx 2206 drivers/net/ethernet/sfc/ptp.c efx->type->ptp_set_ts_sync_events(efx, true, true); efx 2209 drivers/net/ethernet/sfc/ptp.c void efx_ptp_stop_datapath(struct efx_nic *efx) efx 2212 drivers/net/ethernet/sfc/ptp.c if (efx->type->ptp_set_ts_sync_events) efx 2213 drivers/net/ethernet/sfc/ptp.c efx->type->ptp_set_ts_sync_events(efx, false, true); efx 2214 drivers/net/ethernet/sfc/ptp.c efx_ptp_stop(efx); efx 62 drivers/net/ethernet/sfc/rx.c static inline u32 efx_rx_buf_hash(struct efx_nic *efx, const u8 *eh) efx 65 drivers/net/ethernet/sfc/rx.c return __le32_to_cpup((const __le32 *)(eh + efx->rx_packet_hash_offset)); efx 67 drivers/net/ethernet/sfc/rx.c const u8 *data = eh + efx->rx_packet_hash_offset; efx 84 drivers/net/ethernet/sfc/rx.c static inline void efx_sync_rx_buffer(struct efx_nic *efx, efx 88 drivers/net/ethernet/sfc/rx.c dma_sync_single_for_cpu(&efx->pci_dev->dev, rx_buf->dma_addr, len, efx 92 drivers/net/ethernet/sfc/rx.c void efx_rx_config_page_split(struct efx_nic *efx) efx 94 drivers/net/ethernet/sfc/rx.c efx->rx_page_buf_step = ALIGN(efx->rx_dma_len + efx->rx_ip_align, efx 96 drivers/net/ethernet/sfc/rx.c efx->rx_bufs_per_page = efx->rx_buffer_order ? 1 : efx 98 drivers/net/ethernet/sfc/rx.c efx->rx_page_buf_step); efx 99 drivers/net/ethernet/sfc/rx.c efx->rx_buffer_truesize = (PAGE_SIZE << efx->rx_buffer_order) / efx 100 drivers/net/ethernet/sfc/rx.c efx->rx_bufs_per_page; efx 101 drivers/net/ethernet/sfc/rx.c efx->rx_pages_per_batch = DIV_ROUND_UP(EFX_RX_PREFERRED_BATCH, efx 102 drivers/net/ethernet/sfc/rx.c efx->rx_bufs_per_page); efx 108 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = rx_queue->efx; efx 129 drivers/net/ethernet/sfc/rx.c dma_unmap_page(&efx->pci_dev->dev, state->dma_addr, efx 130 drivers/net/ethernet/sfc/rx.c PAGE_SIZE << efx->rx_buffer_order, efx 151 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = rx_queue->efx; efx 165 drivers/net/ethernet/sfc/rx.c efx->rx_buffer_order); efx 169 drivers/net/ethernet/sfc/rx.c dma_map_page(&efx->pci_dev->dev, page, 0, efx 170 drivers/net/ethernet/sfc/rx.c PAGE_SIZE << efx->rx_buffer_order, efx 172 drivers/net/ethernet/sfc/rx.c if (unlikely(dma_mapping_error(&efx->pci_dev->dev, efx 174 drivers/net/ethernet/sfc/rx.c __free_pages(page, efx->rx_buffer_order); efx 190 drivers/net/ethernet/sfc/rx.c rx_buf->dma_addr = dma_addr + efx->rx_ip_align; efx 192 drivers/net/ethernet/sfc/rx.c rx_buf->page_offset = page_offset + efx->rx_ip_align; efx 193 drivers/net/ethernet/sfc/rx.c rx_buf->len = efx->rx_dma_len; efx 197 drivers/net/ethernet/sfc/rx.c dma_addr += efx->rx_page_buf_step; efx 198 drivers/net/ethernet/sfc/rx.c page_offset += efx->rx_page_buf_step; efx 199 drivers/net/ethernet/sfc/rx.c } while (page_offset + efx->rx_page_buf_step <= PAGE_SIZE); efx 202 drivers/net/ethernet/sfc/rx.c } while (++count < efx->rx_pages_per_batch); efx 210 drivers/net/ethernet/sfc/rx.c static void efx_unmap_rx_buffer(struct efx_nic *efx, efx 217 drivers/net/ethernet/sfc/rx.c dma_unmap_page(&efx->pci_dev->dev, efx 219 drivers/net/ethernet/sfc/rx.c PAGE_SIZE << efx->rx_buffer_order, efx 246 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = rx_queue->efx; efx 269 drivers/net/ethernet/sfc/rx.c efx_unmap_rx_buffer(efx, rx_buf); efx 282 drivers/net/ethernet/sfc/rx.c efx_unmap_rx_buffer(rx_queue->efx, rx_buf); efx 326 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = rx_queue->efx; efx 335 drivers/net/ethernet/sfc/rx.c EFX_WARN_ON_ONCE_PARANOID(fill_level > rx_queue->efx->rxq_entries); efx 345 drivers/net/ethernet/sfc/rx.c batch_size = efx->rx_pages_per_batch * efx->rx_bufs_per_page; efx 349 drivers/net/ethernet/sfc/rx.c netif_vdbg(rx_queue->efx, rx_status, rx_queue->efx->net_dev, efx 365 drivers/net/ethernet/sfc/rx.c netif_vdbg(rx_queue->efx, rx_status, rx_queue->efx->net_dev, efx 388 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = rx_queue->efx; efx 389 drivers/net/ethernet/sfc/rx.c unsigned max_len = rx_buf->len - efx->type->rx_buffer_padding; efx 400 drivers/net/ethernet/sfc/rx.c netif_err(efx, rx_err, efx->net_dev, efx 415 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = channel->efx; efx 427 drivers/net/ethernet/sfc/rx.c if (efx->net_dev->features & NETIF_F_RXHASH) efx 428 drivers/net/ethernet/sfc/rx.c skb_set_hash(skb, efx_rx_buf_hash(efx, eh), efx 447 drivers/net/ethernet/sfc/rx.c skb->truesize += n_frags * efx->rx_buffer_truesize; efx 460 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = channel->efx; efx 464 drivers/net/ethernet/sfc/rx.c skb = netdev_alloc_skb(efx->net_dev, efx 465 drivers/net/ethernet/sfc/rx.c efx->rx_ip_align + efx->rx_prefix_size + efx 468 drivers/net/ethernet/sfc/rx.c atomic_inc(&efx->n_rx_noskb_drops); efx 474 drivers/net/ethernet/sfc/rx.c memcpy(skb->data + efx->rx_ip_align, eh - efx->rx_prefix_size, efx 475 drivers/net/ethernet/sfc/rx.c efx->rx_prefix_size + hdr_len); efx 476 drivers/net/ethernet/sfc/rx.c skb_reserve(skb, efx->rx_ip_align + efx->rx_prefix_size); efx 497 drivers/net/ethernet/sfc/rx.c __free_pages(rx_buf->page, efx->rx_buffer_order); efx 502 drivers/net/ethernet/sfc/rx.c skb->truesize += n_frags * efx->rx_buffer_truesize; efx 505 drivers/net/ethernet/sfc/rx.c skb->protocol = eth_type_trans(skb, efx->net_dev); efx 515 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = rx_queue->efx; efx 529 drivers/net/ethernet/sfc/rx.c unlikely(len <= (n_frags - 1) * efx->rx_dma_len) || efx 530 drivers/net/ethernet/sfc/rx.c unlikely(len > n_frags * efx->rx_dma_len) || efx 531 drivers/net/ethernet/sfc/rx.c unlikely(!efx->rx_scatter)) { efx 539 drivers/net/ethernet/sfc/rx.c netif_vdbg(efx, rx_status, efx->net_dev, efx 561 drivers/net/ethernet/sfc/rx.c efx_sync_rx_buffer(efx, rx_buf, rx_buf->len); efx 568 drivers/net/ethernet/sfc/rx.c rx_buf->page_offset += efx->rx_prefix_size; efx 569 drivers/net/ethernet/sfc/rx.c rx_buf->len -= efx->rx_prefix_size; efx 581 drivers/net/ethernet/sfc/rx.c efx_sync_rx_buffer(efx, rx_buf, efx->rx_dma_len); efx 583 drivers/net/ethernet/sfc/rx.c rx_buf->len = len - (n_frags - 1) * efx->rx_dma_len; efx 584 drivers/net/ethernet/sfc/rx.c efx_sync_rx_buffer(efx, rx_buf, rx_buf->len); efx 641 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = channel->efx; efx 651 drivers/net/ethernet/sfc/rx.c (eh + efx->rx_packet_len_offset)); efx 656 drivers/net/ethernet/sfc/rx.c if (unlikely(efx->loopback_selftest)) { efx 659 drivers/net/ethernet/sfc/rx.c efx_loopback_rx_packet(efx, eh, rx_buf->len); efx 666 drivers/net/ethernet/sfc/rx.c if (unlikely(!(efx->net_dev->features & NETIF_F_RXCSUM))) efx 679 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = rx_queue->efx; efx 684 drivers/net/ethernet/sfc/rx.c entries = max(roundup_pow_of_two(efx->rxq_entries), EFX_MIN_DMAQ_SIZE); efx 688 drivers/net/ethernet/sfc/rx.c netif_dbg(efx, probe, efx->net_dev, efx 690 drivers/net/ethernet/sfc/rx.c efx_rx_queue_index(rx_queue), efx->rxq_entries, efx 708 drivers/net/ethernet/sfc/rx.c static void efx_init_rx_recycle_ring(struct efx_nic *efx, efx 724 drivers/net/ethernet/sfc/rx.c efx->rx_bufs_per_page); efx 732 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = rx_queue->efx; efx 735 drivers/net/ethernet/sfc/rx.c netif_dbg(rx_queue->efx, drv, rx_queue->efx->net_dev, efx 743 drivers/net/ethernet/sfc/rx.c efx_init_rx_recycle_ring(efx, rx_queue); efx 752 drivers/net/ethernet/sfc/rx.c max_fill = efx->rxq_entries - EFX_RXD_HEAD_ROOM; efx 754 drivers/net/ethernet/sfc/rx.c max_fill - efx->rx_pages_per_batch * efx->rx_bufs_per_page; efx 774 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = rx_queue->efx; efx 777 drivers/net/ethernet/sfc/rx.c netif_dbg(rx_queue->efx, drv, rx_queue->efx->net_dev, efx 801 drivers/net/ethernet/sfc/rx.c dma_unmap_page(&efx->pci_dev->dev, state->dma_addr, efx 802 drivers/net/ethernet/sfc/rx.c PAGE_SIZE << efx->rx_buffer_order, efx 812 drivers/net/ethernet/sfc/rx.c netif_dbg(rx_queue->efx, drv, rx_queue->efx->net_dev, efx 832 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = netdev_priv(req->net_dev); efx 833 drivers/net/ethernet/sfc/rx.c struct efx_channel *channel = efx_get_channel(efx, req->rxq_index); efx 834 drivers/net/ethernet/sfc/rx.c int slot_idx = req - efx->rps_slot; efx 839 drivers/net/ethernet/sfc/rx.c rc = efx->type->filter_insert(efx, &req->spec, true); efx 841 drivers/net/ethernet/sfc/rx.c rc %= efx->type->max_rx_ip_filters; efx 842 drivers/net/ethernet/sfc/rx.c if (efx->rps_hash_table) { efx 843 drivers/net/ethernet/sfc/rx.c spin_lock_bh(&efx->rps_hash_lock); efx 844 drivers/net/ethernet/sfc/rx.c rule = efx_rps_hash_find(efx, &req->spec); efx 858 drivers/net/ethernet/sfc/rx.c spin_unlock_bh(&efx->rps_hash_lock); efx 864 drivers/net/ethernet/sfc/rx.c mutex_lock(&efx->rps_mutex); efx 867 drivers/net/ethernet/sfc/rx.c mutex_unlock(&efx->rps_mutex); efx 870 drivers/net/ethernet/sfc/rx.c netif_info(efx, rx_status, efx->net_dev, efx 877 drivers/net/ethernet/sfc/rx.c netif_info(efx, rx_status, efx->net_dev, efx 886 drivers/net/ethernet/sfc/rx.c clear_bit(slot_idx, &efx->rps_slot_map); efx 893 drivers/net/ethernet/sfc/rx.c struct efx_nic *efx = netdev_priv(net_dev); efx 903 drivers/net/ethernet/sfc/rx.c if (!test_and_set_bit(slot_idx, &efx->rps_slot_map)) efx 927 drivers/net/ethernet/sfc/rx.c req = efx->rps_slot + slot_idx; efx 929 drivers/net/ethernet/sfc/rx.c efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0, efx 951 drivers/net/ethernet/sfc/rx.c if (efx->rps_hash_table) { efx 953 drivers/net/ethernet/sfc/rx.c spin_lock(&efx->rps_hash_lock); efx 954 drivers/net/ethernet/sfc/rx.c rule = efx_rps_hash_add(efx, &req->spec, &new); efx 960 drivers/net/ethernet/sfc/rx.c rule->arfs_id = efx->rps_next_id++ % RPS_NO_FILTER; efx 968 drivers/net/ethernet/sfc/rx.c spin_unlock(&efx->rps_hash_lock); efx 986 drivers/net/ethernet/sfc/rx.c spin_unlock(&efx->rps_hash_lock); efx 988 drivers/net/ethernet/sfc/rx.c clear_bit(slot_idx, &efx->rps_slot_map); efx 992 drivers/net/ethernet/sfc/rx.c bool __efx_filter_rfs_expire(struct efx_nic *efx, unsigned int quota) efx 994 drivers/net/ethernet/sfc/rx.c bool (*expire_one)(struct efx_nic *efx, u32 flow_id, unsigned int index); efx 998 drivers/net/ethernet/sfc/rx.c if (!mutex_trylock(&efx->rps_mutex)) efx 1000 drivers/net/ethernet/sfc/rx.c expire_one = efx->type->filter_rfs_expire_one; efx 1001 drivers/net/ethernet/sfc/rx.c channel_idx = efx->rps_expire_channel; efx 1002 drivers/net/ethernet/sfc/rx.c index = efx->rps_expire_index; efx 1003 drivers/net/ethernet/sfc/rx.c size = efx->type->max_rx_ip_filters; efx 1005 drivers/net/ethernet/sfc/rx.c struct efx_channel *channel = efx_get_channel(efx, channel_idx); efx 1009 drivers/net/ethernet/sfc/rx.c expire_one(efx, flow_id, index)) { efx 1010 drivers/net/ethernet/sfc/rx.c netif_info(efx, rx_status, efx->net_dev, efx 1016 drivers/net/ethernet/sfc/rx.c if (++channel_idx == efx->n_channels) efx 1021 drivers/net/ethernet/sfc/rx.c efx->rps_expire_channel = channel_idx; efx 1022 drivers/net/ethernet/sfc/rx.c efx->rps_expire_index = index; efx 1024 drivers/net/ethernet/sfc/rx.c mutex_unlock(&efx->rps_mutex); efx 64 drivers/net/ethernet/sfc/selftest.c #define INT_MODE(efx) \ efx 65 drivers/net/ethernet/sfc/selftest.c STRING_TABLE_LOOKUP(efx->interrupt_mode, efx_interrupt_mode) efx 96 drivers/net/ethernet/sfc/selftest.c static int efx_test_phy_alive(struct efx_nic *efx, struct efx_self_tests *tests) efx 100 drivers/net/ethernet/sfc/selftest.c if (efx->phy_op->test_alive) { efx 101 drivers/net/ethernet/sfc/selftest.c rc = efx->phy_op->test_alive(efx); efx 108 drivers/net/ethernet/sfc/selftest.c static int efx_test_nvram(struct efx_nic *efx, struct efx_self_tests *tests) efx 112 drivers/net/ethernet/sfc/selftest.c if (efx->type->test_nvram) { efx 113 drivers/net/ethernet/sfc/selftest.c rc = efx->type->test_nvram(efx); efx 130 drivers/net/ethernet/sfc/selftest.c static int efx_test_interrupts(struct efx_nic *efx, efx 137 drivers/net/ethernet/sfc/selftest.c netif_dbg(efx, drv, efx->net_dev, "testing interrupts\n"); efx 140 drivers/net/ethernet/sfc/selftest.c rc = efx_nic_irq_test_start(efx); efx 142 drivers/net/ethernet/sfc/selftest.c netif_dbg(efx, drv, efx->net_dev, efx 152 drivers/net/ethernet/sfc/selftest.c netif_dbg(efx, drv, efx->net_dev, "waiting for test interrupt\n"); efx 155 drivers/net/ethernet/sfc/selftest.c cpu = efx_nic_irq_test_irq_cpu(efx); efx 161 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, "timed out waiting for interrupt\n"); efx 165 drivers/net/ethernet/sfc/selftest.c netif_dbg(efx, drv, efx->net_dev, "%s test interrupt seen on CPU%d\n", efx 166 drivers/net/ethernet/sfc/selftest.c INT_MODE(efx), cpu); efx 172 drivers/net/ethernet/sfc/selftest.c static int efx_test_eventq_irq(struct efx_nic *efx, efx 182 drivers/net/ethernet/sfc/selftest.c efx_for_each_channel(channel, efx) { efx 198 drivers/net/ethernet/sfc/selftest.c efx_for_each_channel(channel, efx) { efx 217 drivers/net/ethernet/sfc/selftest.c efx_for_each_channel(channel, efx) { efx 225 drivers/net/ethernet/sfc/selftest.c netif_dbg(efx, drv, efx->net_dev, efx 234 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 238 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 243 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 253 drivers/net/ethernet/sfc/selftest.c static int efx_test_phy(struct efx_nic *efx, struct efx_self_tests *tests, efx 258 drivers/net/ethernet/sfc/selftest.c if (!efx->phy_op->run_tests) efx 261 drivers/net/ethernet/sfc/selftest.c mutex_lock(&efx->mac_lock); efx 262 drivers/net/ethernet/sfc/selftest.c rc = efx->phy_op->run_tests(efx, tests->phy_ext, flags); efx 263 drivers/net/ethernet/sfc/selftest.c mutex_unlock(&efx->mac_lock); efx 267 drivers/net/ethernet/sfc/selftest.c netif_info(efx, drv, efx->net_dev, efx 283 drivers/net/ethernet/sfc/selftest.c void efx_loopback_rx_packet(struct efx_nic *efx, efx 286 drivers/net/ethernet/sfc/selftest.c struct efx_loopback_state *state = efx->loopback_selftest; efx 305 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 307 drivers/net/ethernet/sfc/selftest.c "test\n", pkt_len, LOOPBACK_MODE(efx)); efx 313 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 315 drivers/net/ethernet/sfc/selftest.c LOOPBACK_MODE(efx)); efx 321 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 324 drivers/net/ethernet/sfc/selftest.c LOOPBACK_MODE(efx)); efx 330 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 332 drivers/net/ethernet/sfc/selftest.c LOOPBACK_MODE(efx)); efx 338 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 340 drivers/net/ethernet/sfc/selftest.c LOOPBACK_MODE(efx)); efx 346 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 349 drivers/net/ethernet/sfc/selftest.c ntohs(payload->iteration), LOOPBACK_MODE(efx)); efx 354 drivers/net/ethernet/sfc/selftest.c netif_vdbg(efx, drv, efx->net_dev, efx 355 drivers/net/ethernet/sfc/selftest.c "got loopback RX in %s loopback test\n", LOOPBACK_MODE(efx)); efx 363 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, "received packet:\n"); efx 366 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, "expected packet:\n"); efx 375 drivers/net/ethernet/sfc/selftest.c static void efx_iterate_state(struct efx_nic *efx) efx 377 drivers/net/ethernet/sfc/selftest.c struct efx_loopback_state *state = efx->loopback_selftest; efx 378 drivers/net/ethernet/sfc/selftest.c struct net_device *net_dev = efx->net_dev; efx 412 drivers/net/ethernet/sfc/selftest.c struct efx_nic *efx = tx_queue->efx; efx 413 drivers/net/ethernet/sfc/selftest.c struct efx_loopback_state *state = efx->loopback_selftest; efx 439 drivers/net/ethernet/sfc/selftest.c netif_tx_lock_bh(efx->net_dev); efx 441 drivers/net/ethernet/sfc/selftest.c netif_tx_unlock_bh(efx->net_dev); efx 444 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 448 drivers/net/ethernet/sfc/selftest.c LOOPBACK_MODE(efx)); efx 459 drivers/net/ethernet/sfc/selftest.c static int efx_poll_loopback(struct efx_nic *efx) efx 461 drivers/net/ethernet/sfc/selftest.c struct efx_loopback_state *state = efx->loopback_selftest; efx 469 drivers/net/ethernet/sfc/selftest.c struct efx_nic *efx = tx_queue->efx; efx 470 drivers/net/ethernet/sfc/selftest.c struct efx_loopback_state *state = efx->loopback_selftest; efx 475 drivers/net/ethernet/sfc/selftest.c netif_tx_lock_bh(efx->net_dev); efx 486 drivers/net/ethernet/sfc/selftest.c netif_tx_unlock_bh(efx->net_dev); efx 495 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 499 drivers/net/ethernet/sfc/selftest.c LOOPBACK_MODE(efx)); efx 506 drivers/net/ethernet/sfc/selftest.c netif_dbg(efx, drv, efx->net_dev, efx 510 drivers/net/ethernet/sfc/selftest.c LOOPBACK_MODE(efx)); efx 528 drivers/net/ethernet/sfc/selftest.c struct efx_nic *efx = tx_queue->efx; efx 529 drivers/net/ethernet/sfc/selftest.c struct efx_loopback_state *state = efx->loopback_selftest; efx 534 drivers/net/ethernet/sfc/selftest.c state->packet_count = efx->txq_entries / 3; efx 542 drivers/net/ethernet/sfc/selftest.c netif_dbg(efx, drv, efx->net_dev, efx 544 drivers/net/ethernet/sfc/selftest.c tx_queue->queue, LOOPBACK_MODE(efx), efx 547 drivers/net/ethernet/sfc/selftest.c efx_iterate_state(efx); efx 553 drivers/net/ethernet/sfc/selftest.c if (!efx_poll_loopback(efx)) { efx 555 drivers/net/ethernet/sfc/selftest.c efx_poll_loopback(efx); efx 569 drivers/net/ethernet/sfc/selftest.c netif_dbg(efx, drv, efx->net_dev, efx 571 drivers/net/ethernet/sfc/selftest.c "of %d packets\n", tx_queue->queue, LOOPBACK_MODE(efx), efx 581 drivers/net/ethernet/sfc/selftest.c static int efx_wait_for_link(struct efx_nic *efx) efx 583 drivers/net/ethernet/sfc/selftest.c struct efx_link_state *link_state = &efx->link_state; efx 590 drivers/net/ethernet/sfc/selftest.c if (efx->type->monitor != NULL) { efx 591 drivers/net/ethernet/sfc/selftest.c mutex_lock(&efx->mac_lock); efx 592 drivers/net/ethernet/sfc/selftest.c efx->type->monitor(efx); efx 593 drivers/net/ethernet/sfc/selftest.c mutex_unlock(&efx->mac_lock); efx 596 drivers/net/ethernet/sfc/selftest.c mutex_lock(&efx->mac_lock); efx 599 drivers/net/ethernet/sfc/selftest.c link_up = !efx->type->check_mac_fault(efx); efx 600 drivers/net/ethernet/sfc/selftest.c mutex_unlock(&efx->mac_lock); efx 613 drivers/net/ethernet/sfc/selftest.c static int efx_test_loopbacks(struct efx_nic *efx, struct efx_self_tests *tests, efx 619 drivers/net/ethernet/sfc/selftest.c efx_get_channel(efx, efx->tx_channel_offset); efx 629 drivers/net/ethernet/sfc/selftest.c BUG_ON(efx->loopback_selftest); efx 631 drivers/net/ethernet/sfc/selftest.c efx->loopback_selftest = state; efx 640 drivers/net/ethernet/sfc/selftest.c mutex_lock(&efx->mac_lock); efx 641 drivers/net/ethernet/sfc/selftest.c efx->loopback_mode = mode; efx 642 drivers/net/ethernet/sfc/selftest.c rc = __efx_reconfigure_port(efx); efx 643 drivers/net/ethernet/sfc/selftest.c mutex_unlock(&efx->mac_lock); efx 645 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 647 drivers/net/ethernet/sfc/selftest.c LOOPBACK_MODE(efx)); efx 651 drivers/net/ethernet/sfc/selftest.c rc = efx_wait_for_link(efx); efx 653 drivers/net/ethernet/sfc/selftest.c netif_err(efx, drv, efx->net_dev, efx 655 drivers/net/ethernet/sfc/selftest.c LOOPBACK_MODE(efx)); efx 673 drivers/net/ethernet/sfc/selftest.c efx->loopback_selftest = NULL; efx 689 drivers/net/ethernet/sfc/selftest.c int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, efx 692 drivers/net/ethernet/sfc/selftest.c enum efx_loopback_mode loopback_mode = efx->loopback_mode; efx 693 drivers/net/ethernet/sfc/selftest.c int phy_mode = efx->phy_mode; efx 696 drivers/net/ethernet/sfc/selftest.c efx_selftest_async_cancel(efx); efx 701 drivers/net/ethernet/sfc/selftest.c rc = efx_test_phy_alive(efx, tests); efx 705 drivers/net/ethernet/sfc/selftest.c rc = efx_test_nvram(efx, tests); efx 709 drivers/net/ethernet/sfc/selftest.c rc = efx_test_interrupts(efx, tests); efx 713 drivers/net/ethernet/sfc/selftest.c rc = efx_test_eventq_irq(efx, tests); efx 721 drivers/net/ethernet/sfc/selftest.c return efx_test_phy(efx, tests, flags); efx 729 drivers/net/ethernet/sfc/selftest.c efx_device_detach_sync(efx); efx 731 drivers/net/ethernet/sfc/selftest.c if (efx->type->test_chip) { efx 732 drivers/net/ethernet/sfc/selftest.c rc_reset = efx->type->test_chip(efx, tests); efx 734 drivers/net/ethernet/sfc/selftest.c netif_err(efx, hw, efx->net_dev, efx 736 drivers/net/ethernet/sfc/selftest.c efx_schedule_reset(efx, RESET_TYPE_DISABLE); efx 746 drivers/net/ethernet/sfc/selftest.c mutex_lock(&efx->mac_lock); efx 747 drivers/net/ethernet/sfc/selftest.c efx->phy_mode &= ~PHY_MODE_LOW_POWER; efx 748 drivers/net/ethernet/sfc/selftest.c efx->loopback_mode = LOOPBACK_NONE; efx 749 drivers/net/ethernet/sfc/selftest.c __efx_reconfigure_port(efx); efx 750 drivers/net/ethernet/sfc/selftest.c mutex_unlock(&efx->mac_lock); efx 752 drivers/net/ethernet/sfc/selftest.c rc = efx_test_phy(efx, tests, flags); efx 756 drivers/net/ethernet/sfc/selftest.c rc = efx_test_loopbacks(efx, tests, efx->loopback_modes); efx 761 drivers/net/ethernet/sfc/selftest.c mutex_lock(&efx->mac_lock); efx 762 drivers/net/ethernet/sfc/selftest.c efx->phy_mode = phy_mode; efx 763 drivers/net/ethernet/sfc/selftest.c efx->loopback_mode = loopback_mode; efx 764 drivers/net/ethernet/sfc/selftest.c __efx_reconfigure_port(efx); efx 765 drivers/net/ethernet/sfc/selftest.c mutex_unlock(&efx->mac_lock); efx 767 drivers/net/ethernet/sfc/selftest.c efx_device_attach_if_not_resetting(efx); efx 772 drivers/net/ethernet/sfc/selftest.c void efx_selftest_async_start(struct efx_nic *efx) efx 776 drivers/net/ethernet/sfc/selftest.c efx_for_each_channel(channel, efx) efx 778 drivers/net/ethernet/sfc/selftest.c schedule_delayed_work(&efx->selftest_work, IRQ_TIMEOUT); efx 781 drivers/net/ethernet/sfc/selftest.c void efx_selftest_async_cancel(struct efx_nic *efx) efx 783 drivers/net/ethernet/sfc/selftest.c cancel_delayed_work_sync(&efx->selftest_work); efx 788 drivers/net/ethernet/sfc/selftest.c struct efx_nic *efx = container_of(data, struct efx_nic, efx 793 drivers/net/ethernet/sfc/selftest.c efx_for_each_channel(channel, efx) { efx 796 drivers/net/ethernet/sfc/selftest.c netif_err(efx, ifup, efx->net_dev, efx 800 drivers/net/ethernet/sfc/selftest.c netif_dbg(efx, ifup, efx->net_dev, efx 44 drivers/net/ethernet/sfc/selftest.h void efx_loopback_rx_packet(struct efx_nic *efx, const char *buf_ptr, efx 46 drivers/net/ethernet/sfc/selftest.h int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests, efx 48 drivers/net/ethernet/sfc/selftest.h void efx_selftest_async_start(struct efx_nic *efx); efx 49 drivers/net/ethernet/sfc/selftest.h void efx_selftest_async_cancel(struct efx_nic *efx); efx 28 drivers/net/ethernet/sfc/siena.c static void siena_init_wol(struct efx_nic *efx); efx 33 drivers/net/ethernet/sfc/siena.c struct efx_nic *efx = channel->efx; efx 39 drivers/net/ethernet/sfc/siena.c ticks = efx_usecs_to_ticks(efx, channel->irq_moderation_us); efx 51 drivers/net/ethernet/sfc/siena.c efx_writed_page_locked(channel->efx, &timer_cmd, FR_BZ_TIMER_COMMAND_P0, efx 55 drivers/net/ethernet/sfc/siena.c void siena_prepare_flush(struct efx_nic *efx) efx 57 drivers/net/ethernet/sfc/siena.c if (efx->fc_disable++ == 0) efx 58 drivers/net/ethernet/sfc/siena.c efx_mcdi_set_mac(efx); efx 61 drivers/net/ethernet/sfc/siena.c void siena_finish_flush(struct efx_nic *efx) efx 63 drivers/net/ethernet/sfc/siena.c if (--efx->fc_disable == 0) efx 64 drivers/net/ethernet/sfc/siena.c efx_mcdi_set_mac(efx); efx 96 drivers/net/ethernet/sfc/siena.c static int siena_test_chip(struct efx_nic *efx, struct efx_self_tests *tests) efx 101 drivers/net/ethernet/sfc/siena.c efx_reset_down(efx, reset_method); efx 106 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_reset(efx, reset_method); efx 111 drivers/net/ethernet/sfc/siena.c efx_farch_test_registers(efx, siena_register_tests, efx 115 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_reset(efx, reset_method); efx 117 drivers/net/ethernet/sfc/siena.c rc2 = efx_reset_up(efx, reset_method, rc == 0); efx 128 drivers/net/ethernet/sfc/siena.c static void siena_ptp_write_host_time(struct efx_nic *efx, u32 host_time) efx 130 drivers/net/ethernet/sfc/siena.c _efx_writed(efx, cpu_to_le32(host_time), efx 134 drivers/net/ethernet/sfc/siena.c static int siena_ptp_set_ts_config(struct efx_nic *efx, efx 142 drivers/net/ethernet/sfc/siena.c return efx_ptp_change_mode(efx, efx 144 drivers/net/ethernet/sfc/siena.c efx_ptp_get_mode(efx)); efx 149 drivers/net/ethernet/sfc/siena.c return efx_ptp_change_mode(efx, true, MC_CMD_PTP_MODE_V1); efx 154 drivers/net/ethernet/sfc/siena.c rc = efx_ptp_change_mode(efx, true, efx 162 drivers/net/ethernet/sfc/siena.c rc = efx_ptp_change_mode(efx, true, MC_CMD_PTP_MODE_V2); efx 208 drivers/net/ethernet/sfc/siena.c static void siena_monitor(struct efx_nic *efx) efx 210 drivers/net/ethernet/sfc/siena.c struct eeh_dev *eehdev = pci_dev_to_eeh_dev(efx->pci_dev); efx 216 drivers/net/ethernet/sfc/siena.c static int siena_probe_nvconfig(struct efx_nic *efx) efx 221 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_get_board_cfg(efx, efx->net_dev->perm_addr, NULL, &caps); efx 223 drivers/net/ethernet/sfc/siena.c efx->timer_quantum_ns = efx 226 drivers/net/ethernet/sfc/siena.c efx->timer_max_ns = efx->type->timer_period_max * efx 227 drivers/net/ethernet/sfc/siena.c efx->timer_quantum_ns; efx 232 drivers/net/ethernet/sfc/siena.c static int siena_dimension_resources(struct efx_nic *efx) efx 238 drivers/net/ethernet/sfc/siena.c efx_farch_dimension_resources(efx, FR_CZ_BUF_FULL_TBL_ROWS / 2); efx 245 drivers/net/ethernet/sfc/siena.c static unsigned int siena_mem_bar(struct efx_nic *efx) efx 250 drivers/net/ethernet/sfc/siena.c static unsigned int siena_mem_map_size(struct efx_nic *efx) efx 256 drivers/net/ethernet/sfc/siena.c static int siena_probe_nic(struct efx_nic *efx) efx 266 drivers/net/ethernet/sfc/siena.c nic_data->efx = efx; efx 267 drivers/net/ethernet/sfc/siena.c efx->nic_data = nic_data; efx 269 drivers/net/ethernet/sfc/siena.c if (efx_farch_fpga_ver(efx) != 0) { efx 270 drivers/net/ethernet/sfc/siena.c netif_err(efx, probe, efx->net_dev, efx 276 drivers/net/ethernet/sfc/siena.c efx->max_channels = EFX_MAX_CHANNELS; efx 277 drivers/net/ethernet/sfc/siena.c efx->max_tx_channels = EFX_MAX_CHANNELS; efx 279 drivers/net/ethernet/sfc/siena.c efx_reado(efx, ®, FR_AZ_CS_DEBUG); efx 280 drivers/net/ethernet/sfc/siena.c efx->port_num = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1; efx 282 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_init(efx); efx 287 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_reset(efx, RESET_TYPE_ALL); efx 289 drivers/net/ethernet/sfc/siena.c netif_err(efx, probe, efx->net_dev, "failed to reset NIC\n"); efx 293 drivers/net/ethernet/sfc/siena.c siena_init_wol(efx); efx 296 drivers/net/ethernet/sfc/siena.c rc = efx_nic_alloc_buffer(efx, &efx->irq_status, sizeof(efx_oword_t), efx 300 drivers/net/ethernet/sfc/siena.c BUG_ON(efx->irq_status.dma_addr & 0x0f); efx 302 drivers/net/ethernet/sfc/siena.c netif_dbg(efx, probe, efx->net_dev, efx 304 drivers/net/ethernet/sfc/siena.c (unsigned long long)efx->irq_status.dma_addr, efx 305 drivers/net/ethernet/sfc/siena.c efx->irq_status.addr, efx 306 drivers/net/ethernet/sfc/siena.c (unsigned long long)virt_to_phys(efx->irq_status.addr)); efx 309 drivers/net/ethernet/sfc/siena.c rc = siena_probe_nvconfig(efx); efx 311 drivers/net/ethernet/sfc/siena.c netif_err(efx, probe, efx->net_dev, efx 313 drivers/net/ethernet/sfc/siena.c efx->phy_type = PHY_TYPE_NONE; efx 314 drivers/net/ethernet/sfc/siena.c efx->mdio.prtad = MDIO_PRTAD_NONE; efx 319 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_mon_probe(efx); efx 324 drivers/net/ethernet/sfc/siena.c efx_siena_sriov_probe(efx); efx 326 drivers/net/ethernet/sfc/siena.c efx_ptp_defer_probe_with_channel(efx); efx 331 drivers/net/ethernet/sfc/siena.c efx_nic_free_buffer(efx, &efx->irq_status); efx 334 drivers/net/ethernet/sfc/siena.c efx_mcdi_detach(efx); efx 335 drivers/net/ethernet/sfc/siena.c efx_mcdi_fini(efx); efx 337 drivers/net/ethernet/sfc/siena.c kfree(efx->nic_data); efx 341 drivers/net/ethernet/sfc/siena.c static int siena_rx_pull_rss_config(struct efx_nic *efx) efx 349 drivers/net/ethernet/sfc/siena.c efx_reado(efx, &temp, FR_CZ_RX_RSS_IPV6_REG1); efx 350 drivers/net/ethernet/sfc/siena.c memcpy(efx->rss_context.rx_hash_key, &temp, sizeof(temp)); efx 351 drivers/net/ethernet/sfc/siena.c efx_reado(efx, &temp, FR_CZ_RX_RSS_IPV6_REG2); efx 352 drivers/net/ethernet/sfc/siena.c memcpy(efx->rss_context.rx_hash_key + sizeof(temp), &temp, sizeof(temp)); efx 353 drivers/net/ethernet/sfc/siena.c efx_reado(efx, &temp, FR_CZ_RX_RSS_IPV6_REG3); efx 354 drivers/net/ethernet/sfc/siena.c memcpy(efx->rss_context.rx_hash_key + 2 * sizeof(temp), &temp, efx 356 drivers/net/ethernet/sfc/siena.c efx_farch_rx_pull_indir_table(efx); efx 360 drivers/net/ethernet/sfc/siena.c static int siena_rx_push_rss_config(struct efx_nic *efx, bool user, efx 367 drivers/net/ethernet/sfc/siena.c memcpy(efx->rss_context.rx_hash_key, key, sizeof(temp)); efx 368 drivers/net/ethernet/sfc/siena.c memcpy(&temp, efx->rss_context.rx_hash_key, sizeof(temp)); efx 369 drivers/net/ethernet/sfc/siena.c efx_writeo(efx, &temp, FR_BZ_RX_RSS_TKEY); efx 372 drivers/net/ethernet/sfc/siena.c BUILD_BUG_ON(sizeof(efx->rss_context.rx_hash_key) < efx 375 drivers/net/ethernet/sfc/siena.c memcpy(&temp, efx->rss_context.rx_hash_key, sizeof(temp)); efx 376 drivers/net/ethernet/sfc/siena.c efx_writeo(efx, &temp, FR_CZ_RX_RSS_IPV6_REG1); efx 377 drivers/net/ethernet/sfc/siena.c memcpy(&temp, efx->rss_context.rx_hash_key + sizeof(temp), sizeof(temp)); efx 378 drivers/net/ethernet/sfc/siena.c efx_writeo(efx, &temp, FR_CZ_RX_RSS_IPV6_REG2); efx 381 drivers/net/ethernet/sfc/siena.c memcpy(&temp, efx->rss_context.rx_hash_key + 2 * sizeof(temp), efx 383 drivers/net/ethernet/sfc/siena.c efx_writeo(efx, &temp, FR_CZ_RX_RSS_IPV6_REG3); efx 385 drivers/net/ethernet/sfc/siena.c memcpy(efx->rss_context.rx_indir_table, rx_indir_table, efx 386 drivers/net/ethernet/sfc/siena.c sizeof(efx->rss_context.rx_indir_table)); efx 387 drivers/net/ethernet/sfc/siena.c efx_farch_rx_push_indir_table(efx); efx 396 drivers/net/ethernet/sfc/siena.c static int siena_init_nic(struct efx_nic *efx) efx 402 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_handle_assertion(efx); efx 407 drivers/net/ethernet/sfc/siena.c efx_reado(efx, &temp, FR_AZ_TX_RESERVED); efx 409 drivers/net/ethernet/sfc/siena.c efx_writeo(efx, &temp, FR_AZ_TX_RESERVED); efx 414 drivers/net/ethernet/sfc/siena.c efx_reado(efx, &temp, FR_AZ_TX_CFG); efx 417 drivers/net/ethernet/sfc/siena.c efx_writeo(efx, &temp, FR_AZ_TX_CFG); efx 419 drivers/net/ethernet/sfc/siena.c efx_reado(efx, &temp, FR_AZ_RX_CFG); efx 430 drivers/net/ethernet/sfc/siena.c efx_writeo(efx, &temp, FR_AZ_RX_CFG); efx 432 drivers/net/ethernet/sfc/siena.c siena_rx_push_rss_config(efx, false, efx->rss_context.rx_indir_table, NULL); efx 433 drivers/net/ethernet/sfc/siena.c efx->rss_context.context_id = 0; /* indicates RSS is active */ efx 436 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_log_ctrl(efx, true, false, 0); efx 442 drivers/net/ethernet/sfc/siena.c efx_writeo(efx, &temp, FR_BZ_DP_CTRL); efx 445 drivers/net/ethernet/sfc/siena.c efx_writeo(efx, &temp, FR_CZ_USR_EV_CFG); efx 447 drivers/net/ethernet/sfc/siena.c efx_farch_init_common(efx); efx 451 drivers/net/ethernet/sfc/siena.c static void siena_remove_nic(struct efx_nic *efx) efx 453 drivers/net/ethernet/sfc/siena.c efx_mcdi_mon_remove(efx); efx 455 drivers/net/ethernet/sfc/siena.c efx_nic_free_buffer(efx, &efx->irq_status); efx 457 drivers/net/ethernet/sfc/siena.c efx_mcdi_reset(efx, RESET_TYPE_ALL); efx 459 drivers/net/ethernet/sfc/siena.c efx_mcdi_detach(efx); efx 460 drivers/net/ethernet/sfc/siena.c efx_mcdi_fini(efx); efx 463 drivers/net/ethernet/sfc/siena.c kfree(efx->nic_data); efx 464 drivers/net/ethernet/sfc/siena.c efx->nic_data = NULL; efx 540 drivers/net/ethernet/sfc/siena.c static size_t siena_describe_nic_stats(struct efx_nic *efx, u8 *names) efx 546 drivers/net/ethernet/sfc/siena.c static int siena_try_update_nic_stats(struct efx_nic *efx) efx 548 drivers/net/ethernet/sfc/siena.c struct siena_nic_data *nic_data = efx->nic_data; efx 553 drivers/net/ethernet/sfc/siena.c dma_stats = efx->stats_buffer.addr; efx 555 drivers/net/ethernet/sfc/siena.c generation_end = dma_stats[efx->num_mac_stats - 1]; efx 560 drivers/net/ethernet/sfc/siena.c stats, efx->stats_buffer.addr, false); efx 567 drivers/net/ethernet/sfc/siena.c efx_nic_fix_nodesc_drop_stat(efx, efx 580 drivers/net/ethernet/sfc/siena.c efx_update_sw_stats(efx, stats); efx 584 drivers/net/ethernet/sfc/siena.c static size_t siena_update_nic_stats(struct efx_nic *efx, u64 *full_stats, efx 587 drivers/net/ethernet/sfc/siena.c struct siena_nic_data *nic_data = efx->nic_data; efx 594 drivers/net/ethernet/sfc/siena.c if (siena_try_update_nic_stats(efx) == 0) efx 632 drivers/net/ethernet/sfc/siena.c static int siena_mac_reconfigure(struct efx_nic *efx) efx 639 drivers/net/ethernet/sfc/siena.c sizeof(efx->multicast_hash)); efx 641 drivers/net/ethernet/sfc/siena.c efx_farch_filter_sync_rx_mode(efx); efx 643 drivers/net/ethernet/sfc/siena.c WARN_ON(!mutex_is_locked(&efx->mac_lock)); efx 645 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_set_mac(efx); efx 650 drivers/net/ethernet/sfc/siena.c efx->multicast_hash.byte, sizeof(efx->multicast_hash)); efx 651 drivers/net/ethernet/sfc/siena.c return efx_mcdi_rpc(efx, MC_CMD_SET_MCAST_HASH, efx 662 drivers/net/ethernet/sfc/siena.c static void siena_get_wol(struct efx_nic *efx, struct ethtool_wolinfo *wol) efx 664 drivers/net/ethernet/sfc/siena.c struct siena_nic_data *nic_data = efx->nic_data; efx 675 drivers/net/ethernet/sfc/siena.c static int siena_set_wol(struct efx_nic *efx, u32 type) efx 677 drivers/net/ethernet/sfc/siena.c struct siena_nic_data *nic_data = efx->nic_data; efx 685 drivers/net/ethernet/sfc/siena.c efx_mcdi_wol_filter_remove(efx, efx 687 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_wol_filter_set_magic(efx, efx->net_dev->dev_addr, efx 692 drivers/net/ethernet/sfc/siena.c pci_wake_from_d3(efx->pci_dev, true); efx 694 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_wol_filter_reset(efx); efx 696 drivers/net/ethernet/sfc/siena.c pci_wake_from_d3(efx->pci_dev, false); efx 703 drivers/net/ethernet/sfc/siena.c netif_err(efx, hw, efx->net_dev, "%s failed: type=%d rc=%d\n", efx 709 drivers/net/ethernet/sfc/siena.c static void siena_init_wol(struct efx_nic *efx) efx 711 drivers/net/ethernet/sfc/siena.c struct siena_nic_data *nic_data = efx->nic_data; efx 714 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_wol_filter_get_magic(efx, &nic_data->wol_filter_id); efx 719 drivers/net/ethernet/sfc/siena.c efx_mcdi_wol_filter_reset(efx); efx 722 drivers/net/ethernet/sfc/siena.c pci_wake_from_d3(efx->pci_dev, true); efx 733 drivers/net/ethernet/sfc/siena.c #define MCDI_PDU(efx) \ efx 734 drivers/net/ethernet/sfc/siena.c (efx_port_num(efx) ? MC_SMEM_P1_PDU_OFST : MC_SMEM_P0_PDU_OFST) efx 735 drivers/net/ethernet/sfc/siena.c #define MCDI_DOORBELL(efx) \ efx 736 drivers/net/ethernet/sfc/siena.c (efx_port_num(efx) ? MC_SMEM_P1_DOORBELL_OFST : MC_SMEM_P0_DOORBELL_OFST) efx 737 drivers/net/ethernet/sfc/siena.c #define MCDI_STATUS(efx) \ efx 738 drivers/net/ethernet/sfc/siena.c (efx_port_num(efx) ? MC_SMEM_P1_STATUS_OFST : MC_SMEM_P0_STATUS_OFST) efx 740 drivers/net/ethernet/sfc/siena.c static void siena_mcdi_request(struct efx_nic *efx, efx 744 drivers/net/ethernet/sfc/siena.c unsigned pdu = FR_CZ_MC_TREG_SMEM + MCDI_PDU(efx); efx 745 drivers/net/ethernet/sfc/siena.c unsigned doorbell = FR_CZ_MC_TREG_SMEM + MCDI_DOORBELL(efx); efx 751 drivers/net/ethernet/sfc/siena.c efx_writed(efx, hdr, pdu); efx 754 drivers/net/ethernet/sfc/siena.c efx_writed(efx, &sdu[i], pdu + hdr_len + 4 * i); efx 760 drivers/net/ethernet/sfc/siena.c _efx_writed(efx, (__force __le32) 0x45789abc, doorbell); efx 763 drivers/net/ethernet/sfc/siena.c static bool siena_mcdi_poll_response(struct efx_nic *efx) efx 765 drivers/net/ethernet/sfc/siena.c unsigned int pdu = FR_CZ_MC_TREG_SMEM + MCDI_PDU(efx); efx 768 drivers/net/ethernet/sfc/siena.c efx_readd(efx, &hdr, pdu); efx 778 drivers/net/ethernet/sfc/siena.c static void siena_mcdi_read_response(struct efx_nic *efx, efx_dword_t *outbuf, efx 781 drivers/net/ethernet/sfc/siena.c unsigned int pdu = FR_CZ_MC_TREG_SMEM + MCDI_PDU(efx); efx 786 drivers/net/ethernet/sfc/siena.c efx_readd(efx, &outbuf[i], pdu + offset + 4 * i); efx 789 drivers/net/ethernet/sfc/siena.c static int siena_mcdi_poll_reboot(struct efx_nic *efx) efx 791 drivers/net/ethernet/sfc/siena.c struct siena_nic_data *nic_data = efx->nic_data; efx 792 drivers/net/ethernet/sfc/siena.c unsigned int addr = FR_CZ_MC_TREG_SMEM + MCDI_STATUS(efx); efx 796 drivers/net/ethernet/sfc/siena.c efx_readd(efx, ®, addr); efx 803 drivers/net/ethernet/sfc/siena.c efx_writed(efx, ®, addr); efx 847 drivers/net/ethernet/sfc/siena.c static int siena_mtd_probe_partition(struct efx_nic *efx, efx 862 drivers/net/ethernet/sfc/siena.c if (info->port != efx_port_num(efx)) efx 865 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_nvram_info(efx, type, &size, &erase_size, &protected); efx 883 drivers/net/ethernet/sfc/siena.c static int siena_mtd_get_fw_subtypes(struct efx_nic *efx, efx 892 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_get_board_cfg(efx, NULL, fw_subtype_list, NULL); efx 902 drivers/net/ethernet/sfc/siena.c static int siena_mtd_probe(struct efx_nic *efx) efx 912 drivers/net/ethernet/sfc/siena.c rc = efx_mcdi_nvram_types(efx, &nvram_types); efx 925 drivers/net/ethernet/sfc/siena.c rc = siena_mtd_probe_partition(efx, &parts[n_parts], efx 936 drivers/net/ethernet/sfc/siena.c rc = siena_mtd_get_fw_subtypes(efx, parts, n_parts); efx 940 drivers/net/ethernet/sfc/siena.c rc = efx_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts)); efx 85 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx; efx 192 drivers/net/ethernet/sfc/siena_sriov.c return EFX_VI_BASE + vf->index * efx_vf_size(vf->efx) + index; efx 195 drivers/net/ethernet/sfc/siena_sriov.c static int efx_siena_sriov_cmd(struct efx_nic *efx, bool enable, efx 206 drivers/net/ethernet/sfc/siena_sriov.c MCDI_SET_DWORD(inbuf, SRIOV_IN_VF_COUNT, efx->vf_count); efx 208 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_mcdi_rpc_quiet(efx, MC_CMD_SRIOV, inbuf, MC_CMD_SRIOV_IN_LEN, efx 228 drivers/net/ethernet/sfc/siena_sriov.c static void efx_siena_sriov_usrev(struct efx_nic *efx, bool enabled) efx 230 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 236 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo(efx, ®, FR_CZ_USR_EV_CFG); efx 239 drivers/net/ethernet/sfc/siena_sriov.c static int efx_siena_sriov_memcpy(struct efx_nic *efx, efx 290 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_mcdi_rpc(efx, MC_CMD_MEMCPY, inbuf, used, NULL, 0, NULL); efx 302 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 308 drivers/net/ethernet/sfc/siena_sriov.c efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_REQUIRED, efx 310 drivers/net/ethernet/sfc/siena_sriov.c netif_dbg(efx, hw, efx->net_dev, "Removed vf %s tx filter %d\n", efx 331 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_filter_insert_filter(efx, &filter, true); efx 333 drivers/net/ethernet/sfc/siena_sriov.c netif_warn(efx, hw, efx->net_dev, efx 337 drivers/net/ethernet/sfc/siena_sriov.c netif_dbg(efx, hw, efx->net_dev, "Inserted vf %s tx filter %d\n", efx 346 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 352 drivers/net/ethernet/sfc/siena_sriov.c efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_REQUIRED, efx 354 drivers/net/ethernet/sfc/siena_sriov.c netif_dbg(efx, hw, efx->net_dev, "Removed vf %s rx filter %d\n", efx 371 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_filter_insert_filter(efx, &filter, true); efx 373 drivers/net/ethernet/sfc/siena_sriov.c netif_warn(efx, hw, efx->net_dev, efx 377 drivers/net/ethernet/sfc/siena_sriov.c netif_dbg(efx, hw, efx->net_dev, "Inserted vf %s rx filter %d\n", efx 385 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 386 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 400 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 401 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 427 drivers/net/ethernet/sfc/siena_sriov.c copy[1].from_rid = efx->pci_dev->devfn; efx 444 drivers/net/ethernet/sfc/siena_sriov.c copy[pos].from_rid = efx->pci_dev->devfn; efx 451 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_memcpy(efx, copy, ARRAY_SIZE(copy)); efx 463 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_memcpy(efx, copy, pos + 1); efx 471 drivers/net/ethernet/sfc/siena_sriov.c efx_farch_generate_event(efx, efx 472 drivers/net/ethernet/sfc/siena_sriov.c EFX_VI_BASE + vf->index * efx_vf_size(efx), efx 476 drivers/net/ethernet/sfc/siena_sriov.c static void efx_siena_sriov_bufs(struct efx_nic *efx, unsigned offset, efx 488 drivers/net/ethernet/sfc/siena_sriov.c efx_sram_writeq(efx, efx->membase + FR_BZ_BUF_FULL_TBL, efx 493 drivers/net/ethernet/sfc/siena_sriov.c static bool bad_vf_index(struct efx_nic *efx, unsigned index) efx 495 drivers/net/ethernet/sfc/siena_sriov.c return index >= efx_vf_size(efx); efx 509 drivers/net/ethernet/sfc/siena_sriov.c static bool map_vi_index(struct efx_nic *efx, unsigned abs_index, efx 512 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 517 drivers/net/ethernet/sfc/siena_sriov.c vf_i = (abs_index - EFX_VI_BASE) / efx_vf_size(efx); efx 518 drivers/net/ethernet/sfc/siena_sriov.c if (vf_i >= efx->vf_init_count) efx 524 drivers/net/ethernet/sfc/siena_sriov.c *rel_index_out = abs_index % efx_vf_size(efx); efx 530 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 538 drivers/net/ethernet/sfc/siena_sriov.c if (bad_vf_index(efx, vf_evq) || efx 541 drivers/net/ethernet/sfc/siena_sriov.c netif_err(efx, hw, efx->net_dev, efx 547 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_bufs(efx, buftbl, req->u.init_evq.addr, buf_count); efx 553 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo_table(efx, ®, FR_BZ_TIMER_TBL, abs_evq); efx 558 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo_table(efx, ®, FR_BZ_EVQ_PTR_TBL, abs_evq); efx 571 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 580 drivers/net/ethernet/sfc/siena_sriov.c if (bad_vf_index(efx, vf_evq) || bad_vf_index(efx, vf_rxq) || efx 584 drivers/net/ethernet/sfc/siena_sriov.c netif_err(efx, hw, efx->net_dev, efx 592 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_bufs(efx, buftbl, req->u.init_rxq.addr, buf_count); efx 604 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo_table(efx, ®, FR_BZ_RX_DESC_PTR_TBL, efx 612 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 621 drivers/net/ethernet/sfc/siena_sriov.c if (bad_vf_index(efx, vf_evq) || bad_vf_index(efx, vf_txq) || efx 625 drivers/net/ethernet/sfc/siena_sriov.c netif_err(efx, hw, efx->net_dev, efx 636 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_bufs(efx, buftbl, req->u.init_txq.addr, buf_count); efx 642 drivers/net/ethernet/sfc/siena_sriov.c FRF_CZ_TX_DPT_Q_MASK_WIDTH, min(efx->vi_scale, 1U), efx 650 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo_table(efx, ®, FR_BZ_TX_DESC_PTR_TBL, efx 678 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 680 drivers/net/ethernet/sfc/siena_sriov.c unsigned count = efx_vf_size(efx); efx 681 drivers/net/ethernet/sfc/siena_sriov.c unsigned vf_offset = EFX_VI_BASE + vf->index * efx_vf_size(efx); efx 691 drivers/net/ethernet/sfc/siena_sriov.c siena_prepare_flush(efx); efx 702 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo(efx, ®, FR_AZ_TX_FLUSH_DESCQ); efx 714 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_mcdi_rpc(efx, MC_CMD_FLUSH_RX_QUEUES, inbuf, efx 735 drivers/net/ethernet/sfc/siena_sriov.c siena_finish_flush(efx); efx 741 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo_table(efx, ®, FR_BZ_RX_DESC_PTR_TBL, efx 743 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo_table(efx, ®, FR_BZ_TX_DESC_PTR_TBL, efx 745 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo_table(efx, ®, FR_BZ_EVQ_PTR_TBL, efx 747 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo_table(efx, ®, FR_BZ_TIMER_TBL, efx 750 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_bufs(efx, vf->buftbl_base, NULL, efx 751 drivers/net/ethernet/sfc/siena_sriov.c EFX_VF_BUFTBL_PER_VI * efx_vf_size(efx)); efx 761 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 762 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 767 drivers/net/ethernet/sfc/siena_sriov.c if (bad_vf_index(efx, vf_rxq) || vf->rx_filtering) { efx 769 drivers/net/ethernet/sfc/siena_sriov.c netif_err(efx, hw, efx->net_dev, efx 793 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 794 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 805 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 806 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 816 drivers/net/ethernet/sfc/siena_sriov.c netif_err(efx, hw, efx->net_dev, efx 873 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 882 drivers/net/ethernet/sfc/siena_sriov.c copy[0].to_rid = efx->pci_dev->devfn; efx 885 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_siena_sriov_memcpy(efx, copy, 1); efx 889 drivers/net/ethernet/sfc/siena_sriov.c netif_err(efx, hw, efx->net_dev, efx 899 drivers/net/ethernet/sfc/siena_sriov.c netif_dbg(efx, hw, efx->net_dev, efx 904 drivers/net/ethernet/sfc/siena_sriov.c netif_dbg(efx, hw, efx->net_dev, efx 929 drivers/net/ethernet/sfc/siena_sriov.c (void)efx_siena_sriov_memcpy(efx, copy, ARRAY_SIZE(copy)); efx 942 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 970 drivers/net/ethernet/sfc/siena_sriov.c copy_req[k].from_rid = efx->pci_dev->devfn; efx 976 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_siena_sriov_memcpy(efx, copy_req, count); efx 979 drivers/net/ethernet/sfc/siena_sriov.c netif_err(efx, hw, efx->net_dev, efx 989 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_bufs(efx, buftbl, vf->evq0_addrs, vf->evq0_count); efx 995 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo_table(efx, ®, FR_BZ_TIMER_TBL, abs_evq); efx 1000 drivers/net/ethernet/sfc/siena_sriov.c efx_writeo_table(efx, ®, FR_BZ_EVQ_PTR_TBL, abs_evq); efx 1002 drivers/net/ethernet/sfc/siena_sriov.c efx_writed(efx, &ptr, FR_BZ_EVQ_RPTR + FR_BZ_EVQ_RPTR_STEP * abs_evq); efx 1010 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = vf->efx; efx 1013 drivers/net/ethernet/sfc/siena_sriov.c if (!efx_nic_alloc_buffer(efx, &buf, EFX_PAGE_SIZE, GFP_NOIO)) { efx 1015 drivers/net/ethernet/sfc/siena_sriov.c efx_nic_free_buffer(efx, &buf); efx 1019 drivers/net/ethernet/sfc/siena_sriov.c static void efx_siena_sriov_handle_no_channel(struct efx_nic *efx) efx 1021 drivers/net/ethernet/sfc/siena_sriov.c netif_err(efx, drv, efx->net_dev, efx 1024 drivers/net/ethernet/sfc/siena_sriov.c efx->vf_count = 0; efx 1029 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = channel->efx->nic_data; efx 1039 drivers/net/ethernet/sfc/siena_sriov.c snprintf(buf, len, "%s-iov", channel->efx->name); efx 1051 drivers/net/ethernet/sfc/siena_sriov.c void efx_siena_sriov_probe(struct efx_nic *efx) efx 1058 drivers/net/ethernet/sfc/siena_sriov.c if (efx_siena_sriov_cmd(efx, false, &efx->vi_scale, &count)) { efx 1059 drivers/net/ethernet/sfc/siena_sriov.c netif_info(efx, probe, efx->net_dev, "no SR-IOV VFs probed\n"); efx 1066 drivers/net/ethernet/sfc/siena_sriov.c efx->vf_count = count; efx 1068 drivers/net/ethernet/sfc/siena_sriov.c efx->extra_channel_type[EFX_EXTRA_CHANNEL_IOV] = &efx_siena_sriov_channel_type; efx 1080 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = nic_data->efx; efx 1103 drivers/net/ethernet/sfc/siena_sriov.c for (pos = 0; pos < efx->vf_count; ++pos) { efx 1128 drivers/net/ethernet/sfc/siena_sriov.c &efx->pci_dev->dev, EFX_PAGE_SIZE, efx 1153 drivers/net/ethernet/sfc/siena_sriov.c dma_free_coherent(&efx->pci_dev->dev, EFX_PAGE_SIZE, efx 1159 drivers/net/ethernet/sfc/siena_sriov.c for (pos = 0; pos < efx->vf_count; ++pos) { efx 1169 drivers/net/ethernet/sfc/siena_sriov.c static void efx_siena_sriov_free_local(struct efx_nic *efx) efx 1171 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1186 drivers/net/ethernet/sfc/siena_sriov.c dma_free_coherent(&efx->pci_dev->dev, EFX_PAGE_SIZE, efx 1192 drivers/net/ethernet/sfc/siena_sriov.c static int efx_siena_sriov_vf_alloc(struct efx_nic *efx) efx 1196 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1198 drivers/net/ethernet/sfc/siena_sriov.c nic_data->vf = kcalloc(efx->vf_count, sizeof(*nic_data->vf), efx 1203 drivers/net/ethernet/sfc/siena_sriov.c for (index = 0; index < efx->vf_count; ++index) { efx 1206 drivers/net/ethernet/sfc/siena_sriov.c vf->efx = efx; efx 1221 drivers/net/ethernet/sfc/siena_sriov.c static void efx_siena_sriov_vfs_fini(struct efx_nic *efx) efx 1223 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1227 drivers/net/ethernet/sfc/siena_sriov.c for (pos = 0; pos < efx->vf_count; ++pos) { efx 1230 drivers/net/ethernet/sfc/siena_sriov.c efx_nic_free_buffer(efx, &vf->buf); efx 1239 drivers/net/ethernet/sfc/siena_sriov.c static int efx_siena_sriov_vfs_init(struct efx_nic *efx) efx 1241 drivers/net/ethernet/sfc/siena_sriov.c struct pci_dev *pci_dev = efx->pci_dev; efx 1242 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1257 drivers/net/ethernet/sfc/siena_sriov.c for (index = 0; index < efx->vf_count; ++index) { efx 1262 drivers/net/ethernet/sfc/siena_sriov.c buftbl_base += EFX_VF_BUFTBL_PER_VI * efx_vf_size(efx); efx 1270 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_nic_alloc_buffer(efx, &vf->buf, EFX_PAGE_SIZE, efx 1281 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_vfs_fini(efx); efx 1285 drivers/net/ethernet/sfc/siena_sriov.c int efx_siena_sriov_init(struct efx_nic *efx) efx 1287 drivers/net/ethernet/sfc/siena_sriov.c struct net_device *net_dev = efx->net_dev; efx 1288 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1297 drivers/net/ethernet/sfc/siena_sriov.c if (efx->vf_count == 0) efx 1300 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_siena_sriov_cmd(efx, true, NULL, NULL); efx 1304 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_nic_alloc_buffer(efx, &nic_data->vfdi_status, efx 1313 drivers/net/ethernet/sfc/siena_sriov.c vfdi_status->vi_scale = efx->vi_scale; efx 1314 drivers/net/ethernet/sfc/siena_sriov.c vfdi_status->rss_rxq_count = efx->rss_spread; efx 1315 drivers/net/ethernet/sfc/siena_sriov.c vfdi_status->peer_count = 1 + efx->vf_count; efx 1316 drivers/net/ethernet/sfc/siena_sriov.c vfdi_status->timer_quantum_ns = efx->timer_quantum_ns; efx 1318 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_siena_sriov_vf_alloc(efx); efx 1327 drivers/net/ethernet/sfc/siena_sriov.c rc = efx_siena_sriov_vfs_init(efx); efx 1333 drivers/net/ethernet/sfc/siena_sriov.c efx->vf_init_count = efx->vf_count; efx 1336 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_usrev(efx, true); efx 1340 drivers/net/ethernet/sfc/siena_sriov.c rc = pci_enable_sriov(efx->pci_dev, efx->vf_count); efx 1344 drivers/net/ethernet/sfc/siena_sriov.c netif_info(efx, probe, net_dev, efx 1346 drivers/net/ethernet/sfc/siena_sriov.c efx->vf_count, efx_vf_size(efx)); efx 1350 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_usrev(efx, false); efx 1352 drivers/net/ethernet/sfc/siena_sriov.c efx->vf_init_count = 0; efx 1354 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_vfs_fini(efx); efx 1357 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_free_local(efx); efx 1360 drivers/net/ethernet/sfc/siena_sriov.c efx_nic_free_buffer(efx, &nic_data->vfdi_status); efx 1362 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_cmd(efx, false, NULL, NULL); efx 1367 drivers/net/ethernet/sfc/siena_sriov.c void efx_siena_sriov_fini(struct efx_nic *efx) efx 1371 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1373 drivers/net/ethernet/sfc/siena_sriov.c if (efx->vf_init_count == 0) efx 1378 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_usrev(efx, false); efx 1380 drivers/net/ethernet/sfc/siena_sriov.c efx->vf_init_count = 0; efx 1384 drivers/net/ethernet/sfc/siena_sriov.c for (pos = 0; pos < efx->vf_count; ++pos) { efx 1391 drivers/net/ethernet/sfc/siena_sriov.c pci_disable_sriov(efx->pci_dev); efx 1394 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_vfs_fini(efx); efx 1395 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_free_local(efx); efx 1397 drivers/net/ethernet/sfc/siena_sriov.c efx_nic_free_buffer(efx, &nic_data->vfdi_status); efx 1398 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_cmd(efx, false, NULL, NULL); efx 1403 drivers/net/ethernet/sfc/siena_sriov.c struct efx_nic *efx = channel->efx; efx 1415 drivers/net/ethernet/sfc/siena_sriov.c netif_vdbg(efx, hw, efx->net_dev, efx 1419 drivers/net/ethernet/sfc/siena_sriov.c if (map_vi_index(efx, qid, &vf, NULL)) efx 1450 drivers/net/ethernet/sfc/siena_sriov.c netif_err(efx, hw, efx->net_dev, efx 1458 drivers/net/ethernet/sfc/siena_sriov.c void efx_siena_sriov_flr(struct efx_nic *efx, unsigned vf_i) efx 1460 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1463 drivers/net/ethernet/sfc/siena_sriov.c if (vf_i > efx->vf_init_count) efx 1466 drivers/net/ethernet/sfc/siena_sriov.c netif_info(efx, hw, efx->net_dev, efx 1476 drivers/net/ethernet/sfc/siena_sriov.c int efx_siena_sriov_mac_address_changed(struct efx_nic *efx) efx 1478 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1481 drivers/net/ethernet/sfc/siena_sriov.c if (!efx->vf_init_count) efx 1484 drivers/net/ethernet/sfc/siena_sriov.c efx->net_dev->dev_addr); efx 1490 drivers/net/ethernet/sfc/siena_sriov.c void efx_siena_sriov_tx_flush_done(struct efx_nic *efx, efx_qword_t *event) efx 1496 drivers/net/ethernet/sfc/siena_sriov.c if (map_vi_index(efx, queue, &vf, &qid)) efx 1509 drivers/net/ethernet/sfc/siena_sriov.c void efx_siena_sriov_rx_flush_done(struct efx_nic *efx, efx_qword_t *event) efx 1517 drivers/net/ethernet/sfc/siena_sriov.c if (map_vi_index(efx, queue, &vf, &qid)) efx 1534 drivers/net/ethernet/sfc/siena_sriov.c void efx_siena_sriov_desc_fetch_err(struct efx_nic *efx, unsigned dmaq) efx 1539 drivers/net/ethernet/sfc/siena_sriov.c if (map_vi_index(efx, dmaq, &vf, &rel)) efx 1543 drivers/net/ethernet/sfc/siena_sriov.c netif_err(efx, hw, efx->net_dev, efx 1550 drivers/net/ethernet/sfc/siena_sriov.c void efx_siena_sriov_reset(struct efx_nic *efx) efx 1552 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1559 drivers/net/ethernet/sfc/siena_sriov.c if (efx->vf_init_count == 0) efx 1562 drivers/net/ethernet/sfc/siena_sriov.c efx_siena_sriov_usrev(efx, true); efx 1563 drivers/net/ethernet/sfc/siena_sriov.c (void)efx_siena_sriov_cmd(efx, true, NULL, NULL); efx 1565 drivers/net/ethernet/sfc/siena_sriov.c if (efx_nic_alloc_buffer(efx, &buf, EFX_PAGE_SIZE, GFP_NOIO)) efx 1568 drivers/net/ethernet/sfc/siena_sriov.c for (vf_i = 0; vf_i < efx->vf_init_count; ++vf_i) { efx 1573 drivers/net/ethernet/sfc/siena_sriov.c efx_nic_free_buffer(efx, &buf); efx 1593 drivers/net/ethernet/sfc/siena_sriov.c int efx_siena_sriov_set_vf_mac(struct efx_nic *efx, int vf_i, u8 *mac) efx 1595 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1598 drivers/net/ethernet/sfc/siena_sriov.c if (vf_i >= efx->vf_init_count) efx 1610 drivers/net/ethernet/sfc/siena_sriov.c int efx_siena_sriov_set_vf_vlan(struct efx_nic *efx, int vf_i, efx 1613 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1617 drivers/net/ethernet/sfc/siena_sriov.c if (vf_i >= efx->vf_init_count) efx 1630 drivers/net/ethernet/sfc/siena_sriov.c int efx_siena_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf_i, efx 1633 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1637 drivers/net/ethernet/sfc/siena_sriov.c if (vf_i >= efx->vf_init_count) efx 1654 drivers/net/ethernet/sfc/siena_sriov.c int efx_siena_sriov_get_vf_config(struct efx_nic *efx, int vf_i, efx 1657 drivers/net/ethernet/sfc/siena_sriov.c struct siena_nic_data *nic_data = efx->nic_data; efx 1661 drivers/net/ethernet/sfc/siena_sriov.c if (vf_i >= efx->vf_init_count) efx 1677 drivers/net/ethernet/sfc/siena_sriov.c bool efx_siena_sriov_wanted(struct efx_nic *efx) efx 1679 drivers/net/ethernet/sfc/siena_sriov.c return efx->vf_count != 0; efx 1682 drivers/net/ethernet/sfc/siena_sriov.c int efx_siena_sriov_configure(struct efx_nic *efx, int num_vfs) efx 41 drivers/net/ethernet/sfc/siena_sriov.h int efx_siena_sriov_configure(struct efx_nic *efx, int num_vfs); efx 42 drivers/net/ethernet/sfc/siena_sriov.h int efx_siena_sriov_init(struct efx_nic *efx); efx 43 drivers/net/ethernet/sfc/siena_sriov.h void efx_siena_sriov_fini(struct efx_nic *efx); efx 44 drivers/net/ethernet/sfc/siena_sriov.h int efx_siena_sriov_mac_address_changed(struct efx_nic *efx); efx 45 drivers/net/ethernet/sfc/siena_sriov.h bool efx_siena_sriov_wanted(struct efx_nic *efx); efx 46 drivers/net/ethernet/sfc/siena_sriov.h void efx_siena_sriov_reset(struct efx_nic *efx); efx 47 drivers/net/ethernet/sfc/siena_sriov.h void efx_siena_sriov_flr(struct efx_nic *efx, unsigned flr); efx 49 drivers/net/ethernet/sfc/siena_sriov.h int efx_siena_sriov_set_vf_mac(struct efx_nic *efx, int vf, u8 *mac); efx 50 drivers/net/ethernet/sfc/siena_sriov.h int efx_siena_sriov_set_vf_vlan(struct efx_nic *efx, int vf, efx 52 drivers/net/ethernet/sfc/siena_sriov.h int efx_siena_sriov_set_vf_spoofchk(struct efx_nic *efx, int vf, efx 54 drivers/net/ethernet/sfc/siena_sriov.h int efx_siena_sriov_get_vf_config(struct efx_nic *efx, int vf, efx 59 drivers/net/ethernet/sfc/siena_sriov.h static inline bool efx_siena_sriov_enabled(struct efx_nic *efx) efx 61 drivers/net/ethernet/sfc/siena_sriov.h return efx->vf_init_count != 0; efx 64 drivers/net/ethernet/sfc/siena_sriov.h static inline bool efx_siena_sriov_enabled(struct efx_nic *efx) efx 70 drivers/net/ethernet/sfc/siena_sriov.h void efx_siena_sriov_probe(struct efx_nic *efx); efx 71 drivers/net/ethernet/sfc/siena_sriov.h void efx_siena_sriov_tx_flush_done(struct efx_nic *efx, efx_qword_t *event); efx 72 drivers/net/ethernet/sfc/siena_sriov.h void efx_siena_sriov_rx_flush_done(struct efx_nic *efx, efx_qword_t *event); efx 74 drivers/net/ethernet/sfc/siena_sriov.h void efx_siena_sriov_desc_fetch_err(struct efx_nic *efx, unsigned dmaq); efx 13 drivers/net/ethernet/sfc/sriov.c struct efx_nic *efx = netdev_priv(net_dev); efx 15 drivers/net/ethernet/sfc/sriov.c if (efx->type->sriov_set_vf_mac) efx 16 drivers/net/ethernet/sfc/sriov.c return efx->type->sriov_set_vf_mac(efx, vf_i, mac); efx 24 drivers/net/ethernet/sfc/sriov.c struct efx_nic *efx = netdev_priv(net_dev); efx 26 drivers/net/ethernet/sfc/sriov.c if (efx->type->sriov_set_vf_vlan) { efx 34 drivers/net/ethernet/sfc/sriov.c return efx->type->sriov_set_vf_vlan(efx, vf_i, vlan, qos); efx 43 drivers/net/ethernet/sfc/sriov.c struct efx_nic *efx = netdev_priv(net_dev); efx 45 drivers/net/ethernet/sfc/sriov.c if (efx->type->sriov_set_vf_spoofchk) efx 46 drivers/net/ethernet/sfc/sriov.c return efx->type->sriov_set_vf_spoofchk(efx, vf_i, spoofchk); efx 54 drivers/net/ethernet/sfc/sriov.c struct efx_nic *efx = netdev_priv(net_dev); efx 56 drivers/net/ethernet/sfc/sriov.c if (efx->type->sriov_get_vf_config) efx 57 drivers/net/ethernet/sfc/sriov.c return efx->type->sriov_get_vf_config(efx, vf_i, ivi); efx 65 drivers/net/ethernet/sfc/sriov.c struct efx_nic *efx = netdev_priv(net_dev); efx 67 drivers/net/ethernet/sfc/sriov.c if (efx->type->sriov_set_vf_link_state) efx 68 drivers/net/ethernet/sfc/sriov.c return efx->type->sriov_set_vf_link_state(efx, vf_i, efx 43 drivers/net/ethernet/sfc/tx.c efx_nic_alloc_buffer(tx_queue->efx, page_buf, PAGE_SIZE, efx 65 drivers/net/ethernet/sfc/tx.c struct device *dma_dev = &tx_queue->efx->pci_dev->dev; efx 95 drivers/net/ethernet/sfc/tx.c netif_vdbg(tx_queue->efx, tx_done, tx_queue->efx->net_dev, efx 104 drivers/net/ethernet/sfc/tx.c unsigned int efx_tx_max_skb_descs(struct efx_nic *efx) efx 112 drivers/net/ethernet/sfc/tx.c if (efx_nic_rev(efx) >= EFX_REV_HUNT_A0) efx 127 drivers/net/ethernet/sfc/tx.c struct efx_nic *efx = txq1->efx; efx 132 drivers/net/ethernet/sfc/tx.c if (likely(fill_level < efx->txq_stop_thresh)) efx 156 drivers/net/ethernet/sfc/tx.c EFX_WARN_ON_ONCE_PARANOID(fill_level >= efx->txq_entries); efx 157 drivers/net/ethernet/sfc/tx.c if (likely(fill_level < efx->txq_stop_thresh)) { efx 159 drivers/net/ethernet/sfc/tx.c if (likely(!efx->loopback_selftest)) efx 201 drivers/net/ethernet/sfc/tx.c static void efx_memcpy_toio_aligned(struct efx_nic *efx, u8 __iomem **piobuf, efx 223 drivers/net/ethernet/sfc/tx.c static void efx_memcpy_toio_aligned_cb(struct efx_nic *efx, u8 __iomem **piobuf, efx 247 drivers/net/ethernet/sfc/tx.c efx_memcpy_toio_aligned(efx, piobuf, data, len, copy_buf); efx 250 drivers/net/ethernet/sfc/tx.c static void efx_flush_copy_buffer(struct efx_nic *efx, u8 __iomem *piobuf, efx 262 drivers/net/ethernet/sfc/tx.c static void efx_skb_copy_bits_to_pio(struct efx_nic *efx, struct sk_buff *skb, efx 268 drivers/net/ethernet/sfc/tx.c efx_memcpy_toio_aligned(efx, piobuf, skb->data, skb_headlen(skb), efx 277 drivers/net/ethernet/sfc/tx.c efx_memcpy_toio_aligned_cb(efx, piobuf, vaddr + skb_frag_off(f), efx 305 drivers/net/ethernet/sfc/tx.c efx_skb_copy_bits_to_pio(tx_queue->efx, skb, efx 307 drivers/net/ethernet/sfc/tx.c efx_flush_copy_buffer(tx_queue->efx, piobuf, ©_buf); efx 338 drivers/net/ethernet/sfc/tx.c const struct efx_nic_type *nic_type = tx_queue->efx->type; efx 363 drivers/net/ethernet/sfc/tx.c struct efx_nic *efx = tx_queue->efx; efx 364 drivers/net/ethernet/sfc/tx.c struct device *dma_dev = &efx->pci_dev->dev; efx 610 drivers/net/ethernet/sfc/tx.c struct efx_nic *efx = tx_queue->efx; efx 621 drivers/net/ethernet/sfc/tx.c netif_err(efx, tx_err, efx->net_dev, efx 624 drivers/net/ethernet/sfc/tx.c efx_schedule_reset(efx, RESET_TYPE_TX_SKIP); efx 647 drivers/net/ethernet/sfc/tx.c struct efx_nic *efx = netdev_priv(net_dev); efx 655 drivers/net/ethernet/sfc/tx.c unlikely(efx_ptp_is_ptp_tx(efx, skb))) { efx 656 drivers/net/ethernet/sfc/tx.c return efx_ptp_tx(efx, skb); efx 661 drivers/net/ethernet/sfc/tx.c if (index >= efx->n_tx_channels) { efx 662 drivers/net/ethernet/sfc/tx.c index -= efx->n_tx_channels; efx 665 drivers/net/ethernet/sfc/tx.c tx_queue = efx_get_tx_queue(efx, index, type); efx 672 drivers/net/ethernet/sfc/tx.c struct efx_nic *efx = tx_queue->efx; efx 676 drivers/net/ethernet/sfc/tx.c netdev_get_tx_queue(efx->net_dev, efx 679 drivers/net/ethernet/sfc/tx.c efx->n_tx_channels : 0)); efx 685 drivers/net/ethernet/sfc/tx.c struct efx_nic *efx = netdev_priv(net_dev); efx 706 drivers/net/ethernet/sfc/tx.c net_dev->tc_to_txq[tc].offset = tc * efx->n_tx_channels; efx 707 drivers/net/ethernet/sfc/tx.c net_dev->tc_to_txq[tc].count = efx->n_tx_channels; efx 712 drivers/net/ethernet/sfc/tx.c efx_for_each_channel(channel, efx) { efx 734 drivers/net/ethernet/sfc/tx.c efx->n_tx_channels); efx 751 drivers/net/ethernet/sfc/tx.c struct efx_nic *efx = tx_queue->efx; efx 770 drivers/net/ethernet/sfc/tx.c likely(efx->port_enabled) && efx 771 drivers/net/ethernet/sfc/tx.c likely(netif_device_present(efx->net_dev))) { efx 775 drivers/net/ethernet/sfc/tx.c if (fill_level <= efx->txq_wake_thresh) efx 797 drivers/net/ethernet/sfc/tx.c struct efx_nic *efx = tx_queue->efx; efx 802 drivers/net/ethernet/sfc/tx.c entries = max(roundup_pow_of_two(efx->txq_entries), EFX_MIN_DMAQ_SIZE); efx 806 drivers/net/ethernet/sfc/tx.c netif_dbg(efx, probe, efx->net_dev, efx 808 drivers/net/ethernet/sfc/tx.c tx_queue->queue, efx->txq_entries, tx_queue->ptr_mask); efx 841 drivers/net/ethernet/sfc/tx.c struct efx_nic *efx = tx_queue->efx; efx 843 drivers/net/ethernet/sfc/tx.c netif_dbg(efx, drv, efx->net_dev, efx 854 drivers/net/ethernet/sfc/tx.c tx_queue->timestamping = (efx_ptp_use_mac_tx_timestamps(efx) && efx 855 drivers/net/ethernet/sfc/tx.c tx_queue->channel == efx_ptp_channel(efx)); efx 875 drivers/net/ethernet/sfc/tx.c netif_dbg(tx_queue->efx, drv, tx_queue->efx->net_dev, efx 900 drivers/net/ethernet/sfc/tx.c netif_dbg(tx_queue->efx, drv, tx_queue->efx->net_dev, efx 906 drivers/net/ethernet/sfc/tx.c efx_nic_free_buffer(tx_queue->efx, efx 117 drivers/net/ethernet/sfc/tx_tso.c tx_queue->efx->txq_entries); efx 121 drivers/net/ethernet/sfc/tx_tso.c dma_len = tx_queue->efx->type->tx_limit_len(tx_queue, efx 169 drivers/net/ethernet/sfc/tx_tso.c static int tso_start(struct tso_state *st, struct efx_nic *efx, efx 173 drivers/net/ethernet/sfc/tx_tso.c struct device *dma_dev = &efx->pci_dev->dev; efx 208 drivers/net/ethernet/sfc/tx_tso.c static int tso_get_fragment(struct tso_state *st, struct efx_nic *efx, efx 211 drivers/net/ethernet/sfc/tx_tso.c st->unmap_addr = skb_frag_dma_map(&efx->pci_dev->dev, frag, 0, efx 213 drivers/net/ethernet/sfc/tx_tso.c if (likely(!dma_mapping_error(&efx->pci_dev->dev, st->unmap_addr))) { efx 366 drivers/net/ethernet/sfc/tx_tso.c struct efx_nic *efx = tx_queue->efx; efx 380 drivers/net/ethernet/sfc/tx_tso.c rc = tso_start(&state, efx, tx_queue, skb); efx 388 drivers/net/ethernet/sfc/tx_tso.c rc = tso_get_fragment(&state, efx, efx 411 drivers/net/ethernet/sfc/tx_tso.c rc = tso_get_fragment(&state, efx, efx 431 drivers/net/ethernet/sfc/tx_tso.c netif_err(efx, tx_err, efx->net_dev, efx 434 drivers/net/ethernet/sfc/tx_tso.c netif_err(efx, tx_err, efx->net_dev, "TSO failed, rc = %d\n", rc); efx 438 drivers/net/ethernet/sfc/tx_tso.c dma_unmap_page(&efx->pci_dev->dev, state.unmap_addr, efx 444 drivers/net/ethernet/sfc/tx_tso.c dma_unmap_single(&efx->pci_dev->dev, state.header_dma_addr, efx 15 drivers/net/ethernet/sfc/workarounds.h #define EFX_WORKAROUND_SIENA(efx) (efx_nic_rev(efx) == EFX_REV_SIENA_A0) efx 16 drivers/net/ethernet/sfc/workarounds.h #define EFX_WORKAROUND_EF10(efx) (efx_nic_rev(efx) >= EFX_REV_HUNT_A0) efx 17 drivers/net/ethernet/sfc/workarounds.h #define EFX_WORKAROUND_10G(efx) 1 efx 25 drivers/net/ethernet/sfc/workarounds.h #define EFX_EF10_WORKAROUND_35388(efx) \ efx 26 drivers/net/ethernet/sfc/workarounds.h (((struct efx_ef10_nic_data *)efx->nic_data)->workaround_35388) efx 27 drivers/net/ethernet/sfc/workarounds.h #define EFX_WORKAROUND_35388(efx) \ efx 28 drivers/net/ethernet/sfc/workarounds.h (efx_nic_rev(efx) == EFX_REV_HUNT_A0 && EFX_EF10_WORKAROUND_35388(efx)) efx 31 drivers/net/ethernet/sfc/workarounds.h #define EFX_EF10_WORKAROUND_61265(efx) \ efx 32 drivers/net/ethernet/sfc/workarounds.h (((struct efx_ef10_nic_data *)efx->nic_data)->workaround_61265) efx 1492 include/sound/emu10k1.h efx: 1, efx 376 sound/pci/emu10k1/emuproc.c voice->efx, efx 93 sound/pci/emu10k1/voice.c voice->efx = 1; efx 124 sound/pci/emu10k1/voice.c pvoice->use = pvoice->pcm = pvoice->synth = pvoice->midi = pvoice->efx = 0; efx 147 sound/pci/emu10k1/voice.c pvoice->use = pvoice->pcm = pvoice->synth = pvoice->midi = pvoice->efx = 0;