Commit 6602041b8343fcdb6433cc72ca6cb6c2e189da6d

Authored by Ben Hutchings
Committed by David S. Miller
1 parent 503b47eafc

sfc: Store port number in private data, not net_device::dev_id

We should not use net_device::dev_id to indicate the port number, as
this affects the way the local part of IPv6 addresses is normally
generated.

This field was intended for use where multiple devices may share a
single assigned MAC address and need to have different IPv6 addresses.
Siena's two ports each have their own MAC addresses.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 2 changed files with 3 additions and 2 deletions Side-by-side Diff

drivers/net/ethernet/sfc/net_driver.h
... ... @@ -784,6 +784,7 @@
784 784  
785 785 char name[IFNAMSIZ];
786 786 struct pci_dev *pci_dev;
  787 + unsigned int port_num;
787 788 const struct efx_nic_type *type;
788 789 int legacy_irq;
789 790 bool legacy_irq_enabled;
... ... @@ -916,7 +917,7 @@
916 917  
917 918 static inline unsigned int efx_port_num(struct efx_nic *efx)
918 919 {
919   - return efx->net_dev->dev_id;
  920 + return efx->port_num;
920 921 }
921 922  
922 923 /**
drivers/net/ethernet/sfc/siena.c
... ... @@ -304,7 +304,7 @@
304 304 }
305 305  
306 306 efx_reado(efx, &reg, FR_AZ_CS_DEBUG);
307   - efx->net_dev->dev_id = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;
  307 + efx->port_num = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;
308 308  
309 309 efx_mcdi_init(efx);
310 310