Skip to content

Commit

Permalink
sfc: Store port number in private data, not net_device::dev_id
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Jun 12, 2013
1 parent 503b47e commit 6602041
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/sfc/net_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ struct efx_nic {

char name[IFNAMSIZ];
struct pci_dev *pci_dev;
unsigned int port_num;
const struct efx_nic_type *type;
int legacy_irq;
bool legacy_irq_enabled;
Expand Down Expand Up @@ -916,7 +917,7 @@ static inline int efx_dev_registered(struct efx_nic *efx)

static inline unsigned int efx_port_num(struct efx_nic *efx)
{
return efx->net_dev->dev_id;
return efx->port_num;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/sfc/siena.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ static int siena_probe_nic(struct efx_nic *efx)
}

efx_reado(efx, &reg, FR_AZ_CS_DEBUG);
efx->net_dev->dev_id = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;
efx->port_num = EFX_OWORD_FIELD(reg, FRF_CZ_CS_PORT_NUM) - 1;

efx_mcdi_init(efx);

Expand Down

0 comments on commit 6602041

Please sign in to comment.