sfc: Make PHY flash mode a device attribute, not a module parameter
This allows updating PHY firmware for one interface without removing all other interfaces handled by the driver. Replace tx_disabled flags and 10Xpress status enumeration with flags in enum efx_phy_mode. Prevent an interface from being brought up while in PHY flash mode. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
This commit is contained in:

committed by
Jeff Garzik

parent
3594e131b2
commit
f8b87c1701
@@ -519,6 +519,23 @@ struct efx_phy_operations {
|
||||
unsigned loopbacks;
|
||||
};
|
||||
|
||||
/**
|
||||
* @enum efx_phy_mode - PHY operating mode flags
|
||||
* @PHY_MODE_NORMAL: on and should pass traffic
|
||||
* @PHY_MODE_TX_DISABLED: on with TX disabled
|
||||
* @PHY_MODE_SPECIAL: on but will not pass traffic
|
||||
*/
|
||||
enum efx_phy_mode {
|
||||
PHY_MODE_NORMAL = 0,
|
||||
PHY_MODE_TX_DISABLED = 1,
|
||||
PHY_MODE_SPECIAL = 8,
|
||||
};
|
||||
|
||||
static inline bool efx_phy_mode_disabled(enum efx_phy_mode mode)
|
||||
{
|
||||
return (mode & ~PHY_MODE_TX_DISABLED) != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Efx extended statistics
|
||||
*
|
||||
@@ -661,7 +678,7 @@ union efx_multicast_hash {
|
||||
* @phy_op: PHY interface
|
||||
* @phy_data: PHY private data (including PHY-specific stats)
|
||||
* @mii: PHY interface
|
||||
* @tx_disabled: PHY transmitter turned off
|
||||
* @phy_mode: PHY operating mode
|
||||
* @link_up: Link status
|
||||
* @link_options: Link options (MII/GMII format)
|
||||
* @n_link_state_changes: Number of times the link has changed state
|
||||
@@ -735,7 +752,7 @@ struct efx_nic {
|
||||
struct efx_phy_operations *phy_op;
|
||||
void *phy_data;
|
||||
struct mii_if_info mii;
|
||||
bool tx_disabled;
|
||||
enum efx_phy_mode phy_mode;
|
||||
|
||||
bool link_up;
|
||||
unsigned int link_options;
|
||||
|
Reference in New Issue
Block a user