Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sfc: Remove netdev init from efx_init_struct

Move functionality involving the struct net_device out of
efx_init_struct so that we can initialise without a net dev
for VDPA operation.

Signed-off-by: Jonathan Cooper <jonathan.s.cooper@amd.com>
Co-developed-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jonathan Cooper and committed by
David S. Miller
62ac3ce5 8b39db19

+7 -8
+3 -1
drivers/net/ethernet/sfc/ef100.c
··· 469 469 470 470 pci_set_drvdata(pci_dev, efx); 471 471 SET_NETDEV_DEV(net_dev, &pci_dev->dev); 472 - rc = efx_init_struct(efx, pci_dev, net_dev); 472 + efx->net_dev = net_dev; 473 + rc = efx_init_struct(efx, pci_dev); 473 474 if (rc) 474 475 goto fail; 475 476 477 + efx->mdio.dev = net_dev; 476 478 efx->vi_stride = EF100_DEFAULT_VI_STRIDE; 477 479 netif_info(efx, probe, efx->net_dev, 478 480 "Solarflare EF100 NIC detected\n");
+2 -1
drivers/net/ethernet/sfc/efx.c
··· 1056 1056 1057 1057 pci_set_drvdata(pci_dev, efx); 1058 1058 SET_NETDEV_DEV(net_dev, &pci_dev->dev); 1059 - rc = efx_init_struct(efx, pci_dev, net_dev); 1059 + rc = efx_init_struct(efx, pci_dev); 1060 1060 if (rc) 1061 1061 goto fail1; 1062 + efx->mdio.dev = net_dev; 1062 1063 1063 1064 pci_info(pci_dev, "Solarflare NIC detected\n"); 1064 1065
+1 -4
drivers/net/ethernet/sfc/efx_common.c
··· 978 978 /* This zeroes out and then fills in the invariants in a struct 979 979 * efx_nic (including all sub-structures). 980 980 */ 981 - int efx_init_struct(struct efx_nic *efx, 982 - struct pci_dev *pci_dev, struct net_device *net_dev) 981 + int efx_init_struct(struct efx_nic *efx, struct pci_dev *pci_dev) 983 982 { 984 983 int rc = -ENOMEM; 985 984 ··· 997 998 efx->state = STATE_UNINIT; 998 999 strlcpy(efx->name, pci_name(pci_dev), sizeof(efx->name)); 999 1000 1000 - efx->net_dev = net_dev; 1001 1001 efx->rx_prefix_size = efx->type->rx_prefix_size; 1002 1002 efx->rx_ip_align = 1003 1003 NET_IP_ALIGN ? (efx->rx_prefix_size + NET_IP_ALIGN) % 4 : 0; ··· 1021 1023 efx->rps_hash_table = kcalloc(EFX_ARFS_HASH_TABLE_SIZE, 1022 1024 sizeof(*efx->rps_hash_table), GFP_KERNEL); 1023 1025 #endif 1024 - efx->mdio.dev = net_dev; 1025 1026 INIT_WORK(&efx->mac_work, efx_mac_work); 1026 1027 init_waitqueue_head(&efx->flush_wq); 1027 1028
+1 -2
drivers/net/ethernet/sfc/efx_common.h
··· 14 14 int efx_init_io(struct efx_nic *efx, int bar, dma_addr_t dma_mask, 15 15 unsigned int mem_map_size); 16 16 void efx_fini_io(struct efx_nic *efx); 17 - int efx_init_struct(struct efx_nic *efx, struct pci_dev *pci_dev, 18 - struct net_device *net_dev); 17 + int efx_init_struct(struct efx_nic *efx, struct pci_dev *pci_dev); 19 18 void efx_fini_struct(struct efx_nic *efx); 20 19 21 20 #define EFX_MAX_DMAQ_SIZE 4096UL