@@ -93,7 +93,10 @@ static int efx_ef10_get_warm_boot_count(struct efx_nic *efx)
93
93
94
94
static unsigned int efx_ef10_mem_map_size (struct efx_nic * efx )
95
95
{
96
- return resource_size (& efx -> pci_dev -> resource [EFX_MEM_BAR ]);
96
+ int bar ;
97
+
98
+ bar = efx -> type -> mem_bar ;
99
+ return resource_size (& efx -> pci_dev -> resource [bar ]);
97
100
}
98
101
99
102
static int efx_ef10_get_pf_index (struct efx_nic * efx )
@@ -204,7 +207,7 @@ static int efx_ef10_probe(struct efx_nic *efx)
204
207
efx -> max_channels =
205
208
min_t (unsigned int ,
206
209
EFX_MAX_CHANNELS ,
207
- resource_size ( & efx -> pci_dev -> resource [ EFX_MEM_BAR ] ) /
210
+ efx_ef10_mem_map_size ( efx ) /
208
211
(EFX_VI_PAGE_SIZE * EFX_TXQ_TYPES ));
209
212
if (WARN_ON (efx -> max_channels == 0 ))
210
213
return - EIO ;
@@ -311,6 +314,23 @@ static int efx_ef10_probe(struct efx_nic *efx)
311
314
return rc ;
312
315
}
313
316
317
+ static int efx_ef10_probe_pf (struct efx_nic * efx )
318
+ {
319
+ return efx_ef10_probe (efx );
320
+ }
321
+
322
+ #ifdef CONFIG_SFC_SRIOV
323
+ static int efx_ef10_probe_vf (struct efx_nic * efx )
324
+ {
325
+ return efx_ef10_probe (efx );
326
+ }
327
+ #else
328
+ static int efx_ef10_probe_vf (struct efx_nic * efx __attribute__ ((unused )))
329
+ {
330
+ return 0 ;
331
+ }
332
+ #endif
333
+
314
334
static int efx_ef10_free_vis (struct efx_nic * efx )
315
335
{
316
336
MCDI_DECLARE_BUF_OUT_OR_ERR (outbuf , 0 );
@@ -1076,6 +1096,14 @@ static void efx_ef10_push_irq_moderation(struct efx_channel *channel)
1076
1096
}
1077
1097
}
1078
1098
1099
+ static void efx_ef10_get_wol_vf (struct efx_nic * efx ,
1100
+ struct ethtool_wolinfo * wol ) {}
1101
+
1102
+ static int efx_ef10_set_wol_vf (struct efx_nic * efx , u32 type )
1103
+ {
1104
+ return - EOPNOTSUPP ;
1105
+ }
1106
+
1079
1107
static void efx_ef10_get_wol (struct efx_nic * efx , struct ethtool_wolinfo * wol )
1080
1108
{
1081
1109
wol -> supported = 0 ;
@@ -3534,6 +3562,9 @@ static void efx_ef10_ptp_write_host_time(struct efx_nic *efx, u32 host_time)
3534
3562
_efx_writed (efx , cpu_to_le32 (host_time ), ER_DZ_MC_DB_LWRD );
3535
3563
}
3536
3564
3565
+ static void efx_ef10_ptp_write_host_time_vf (struct efx_nic * efx ,
3566
+ u32 host_time ) {}
3567
+
3537
3568
static int efx_ef10_rx_enable_timestamping (struct efx_channel * channel ,
3538
3569
bool temp )
3539
3570
{
@@ -3611,6 +3642,12 @@ static int efx_ef10_ptp_set_ts_sync_events(struct efx_nic *efx, bool en,
3611
3642
return 0 ;
3612
3643
}
3613
3644
3645
+ static int efx_ef10_ptp_set_ts_config_vf (struct efx_nic * efx ,
3646
+ struct hwtstamp_config * init )
3647
+ {
3648
+ return - EOPNOTSUPP ;
3649
+ }
3650
+
3614
3651
static int efx_ef10_ptp_set_ts_config (struct efx_nic * efx ,
3615
3652
struct hwtstamp_config * init )
3616
3653
{
@@ -3647,9 +3684,107 @@ static int efx_ef10_ptp_set_ts_config(struct efx_nic *efx,
3647
3684
}
3648
3685
}
3649
3686
3687
+ const struct efx_nic_type efx_hunt_a0_vf_nic_type = {
3688
+ .mem_bar = EFX_MEM_VF_BAR ,
3689
+ .mem_map_size = efx_ef10_mem_map_size ,
3690
+ .probe = efx_ef10_probe_vf ,
3691
+ .remove = efx_ef10_remove ,
3692
+ .dimension_resources = efx_ef10_dimension_resources ,
3693
+ .init = efx_ef10_init_nic ,
3694
+ .fini = efx_port_dummy_op_void ,
3695
+ .map_reset_reason = efx_mcdi_map_reset_reason ,
3696
+ .map_reset_flags = efx_ef10_map_reset_flags ,
3697
+ .reset = efx_ef10_reset ,
3698
+ .probe_port = efx_mcdi_port_probe ,
3699
+ .remove_port = efx_mcdi_port_remove ,
3700
+ .fini_dmaq = efx_ef10_fini_dmaq ,
3701
+ .prepare_flr = efx_ef10_prepare_flr ,
3702
+ .finish_flr = efx_port_dummy_op_void ,
3703
+ .describe_stats = efx_ef10_describe_stats ,
3704
+ .update_stats = efx_ef10_update_stats ,
3705
+ .start_stats = efx_port_dummy_op_void ,
3706
+ .pull_stats = efx_port_dummy_op_void ,
3707
+ .stop_stats = efx_port_dummy_op_void ,
3708
+ .set_id_led = efx_mcdi_set_id_led ,
3709
+ .push_irq_moderation = efx_ef10_push_irq_moderation ,
3710
+ .reconfigure_mac = efx_ef10_mac_reconfigure ,
3711
+ .check_mac_fault = efx_mcdi_mac_check_fault ,
3712
+ .reconfigure_port = efx_mcdi_port_reconfigure ,
3713
+ .get_wol = efx_ef10_get_wol_vf ,
3714
+ .set_wol = efx_ef10_set_wol_vf ,
3715
+ .resume_wol = efx_port_dummy_op_void ,
3716
+ .mcdi_request = efx_ef10_mcdi_request ,
3717
+ .mcdi_poll_response = efx_ef10_mcdi_poll_response ,
3718
+ .mcdi_read_response = efx_ef10_mcdi_read_response ,
3719
+ .mcdi_poll_reboot = efx_ef10_mcdi_poll_reboot ,
3720
+ .irq_enable_master = efx_port_dummy_op_void ,
3721
+ .irq_test_generate = efx_ef10_irq_test_generate ,
3722
+ .irq_disable_non_ev = efx_port_dummy_op_void ,
3723
+ .irq_handle_msi = efx_ef10_msi_interrupt ,
3724
+ .irq_handle_legacy = efx_ef10_legacy_interrupt ,
3725
+ .tx_probe = efx_ef10_tx_probe ,
3726
+ .tx_init = efx_ef10_tx_init ,
3727
+ .tx_remove = efx_ef10_tx_remove ,
3728
+ .tx_write = efx_ef10_tx_write ,
3729
+ .rx_push_rss_config = efx_ef10_rx_push_rss_config ,
3730
+ .rx_probe = efx_ef10_rx_probe ,
3731
+ .rx_init = efx_ef10_rx_init ,
3732
+ .rx_remove = efx_ef10_rx_remove ,
3733
+ .rx_write = efx_ef10_rx_write ,
3734
+ .rx_defer_refill = efx_ef10_rx_defer_refill ,
3735
+ .ev_probe = efx_ef10_ev_probe ,
3736
+ .ev_init = efx_ef10_ev_init ,
3737
+ .ev_fini = efx_ef10_ev_fini ,
3738
+ .ev_remove = efx_ef10_ev_remove ,
3739
+ .ev_process = efx_ef10_ev_process ,
3740
+ .ev_read_ack = efx_ef10_ev_read_ack ,
3741
+ .ev_test_generate = efx_ef10_ev_test_generate ,
3742
+ .filter_table_probe = efx_ef10_filter_table_probe ,
3743
+ .filter_table_restore = efx_ef10_filter_table_restore ,
3744
+ .filter_table_remove = efx_ef10_filter_table_remove ,
3745
+ .filter_update_rx_scatter = efx_ef10_filter_update_rx_scatter ,
3746
+ .filter_insert = efx_ef10_filter_insert ,
3747
+ .filter_remove_safe = efx_ef10_filter_remove_safe ,
3748
+ .filter_get_safe = efx_ef10_filter_get_safe ,
3749
+ .filter_clear_rx = efx_ef10_filter_clear_rx ,
3750
+ .filter_count_rx_used = efx_ef10_filter_count_rx_used ,
3751
+ .filter_get_rx_id_limit = efx_ef10_filter_get_rx_id_limit ,
3752
+ .filter_get_rx_ids = efx_ef10_filter_get_rx_ids ,
3753
+ #ifdef CONFIG_RFS_ACCEL
3754
+ .filter_rfs_insert = efx_ef10_filter_rfs_insert ,
3755
+ .filter_rfs_expire_one = efx_ef10_filter_rfs_expire_one ,
3756
+ #endif
3757
+ #ifdef CONFIG_SFC_MTD
3758
+ .mtd_probe = efx_port_dummy_op_int ,
3759
+ #endif
3760
+ .ptp_write_host_time = efx_ef10_ptp_write_host_time_vf ,
3761
+ .ptp_set_ts_config = efx_ef10_ptp_set_ts_config_vf ,
3762
+ #ifdef CONFIG_SFC_SRIOV
3763
+ .vswitching_probe = efx_port_dummy_op_int ,
3764
+ .vswitching_restore = efx_port_dummy_op_int ,
3765
+ .vswitching_remove = efx_port_dummy_op_void ,
3766
+ #endif
3767
+ .revision = EFX_REV_HUNT_A0 ,
3768
+ .max_dma_mask = DMA_BIT_MASK (ESF_DZ_TX_KER_BUF_ADDR_WIDTH ),
3769
+ .rx_prefix_size = ES_DZ_RX_PREFIX_SIZE ,
3770
+ .rx_hash_offset = ES_DZ_RX_PREFIX_HASH_OFST ,
3771
+ .rx_ts_offset = ES_DZ_RX_PREFIX_TSTAMP_OFST ,
3772
+ .can_rx_scatter = true,
3773
+ .always_rx_scatter = true,
3774
+ .max_interrupt_mode = EFX_INT_MODE_MSIX ,
3775
+ .timer_period_max = 1 << ERF_DD_EVQ_IND_TIMER_VAL_WIDTH ,
3776
+ .offload_features = (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
3777
+ NETIF_F_RXHASH | NETIF_F_NTUPLE ),
3778
+ .mcdi_max_ver = 2 ,
3779
+ .max_rx_ip_filters = HUNT_FILTER_TBL_ROWS ,
3780
+ .hwtstamp_filters = 1 << HWTSTAMP_FILTER_NONE |
3781
+ 1 << HWTSTAMP_FILTER_ALL ,
3782
+ };
3783
+
3650
3784
const struct efx_nic_type efx_hunt_a0_nic_type = {
3785
+ .mem_bar = EFX_MEM_BAR ,
3651
3786
.mem_map_size = efx_ef10_mem_map_size ,
3652
- .probe = efx_ef10_probe ,
3787
+ .probe = efx_ef10_probe_pf ,
3653
3788
.remove = efx_ef10_remove ,
3654
3789
.dimension_resources = efx_ef10_dimension_resources ,
3655
3790
.init = efx_ef10_init_nic ,
0 commit comments