diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-09-01 07:48:17 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-09-03 09:53:47 -0400 |
commit | f8b87c17017f2ce1890fb9a7f85fb0fbf5643e37 (patch) | |
tree | 261a31a95d2fa296ef7abaf6019ff5b7c86bbc63 /drivers/net/sfc/xfp_phy.c | |
parent | 3594e131b23665b728b4c98daaf0b61b1d4aaa7a (diff) |
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>
Diffstat (limited to 'drivers/net/sfc/xfp_phy.c')
-rw-r--r-- | drivers/net/sfc/xfp_phy.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/sfc/xfp_phy.c b/drivers/net/sfc/xfp_phy.c index fd4045b4d9d0..f6edecc2e588 100644 --- a/drivers/net/sfc/xfp_phy.c +++ b/drivers/net/sfc/xfp_phy.c | |||
@@ -40,7 +40,7 @@ void xfp_set_led(struct efx_nic *p, int led, int mode) | |||
40 | } | 40 | } |
41 | 41 | ||
42 | struct xfp_phy_data { | 42 | struct xfp_phy_data { |
43 | bool tx_disabled; | 43 | enum efx_phy_mode phy_mode; |
44 | }; | 44 | }; |
45 | 45 | ||
46 | #define XFP_MAX_RESET_TIME 500 | 46 | #define XFP_MAX_RESET_TIME 500 |
@@ -93,7 +93,7 @@ static int xfp_phy_init(struct efx_nic *efx) | |||
93 | " %x)\n", devid, MDIO_ID_OUI(devid), MDIO_ID_MODEL(devid), | 93 | " %x)\n", devid, MDIO_ID_OUI(devid), MDIO_ID_MODEL(devid), |
94 | MDIO_ID_REV(devid)); | 94 | MDIO_ID_REV(devid)); |
95 | 95 | ||
96 | phy_data->tx_disabled = efx->tx_disabled; | 96 | phy_data->phy_mode = efx->phy_mode; |
97 | 97 | ||
98 | rc = xfp_reset_phy(efx); | 98 | rc = xfp_reset_phy(efx); |
99 | 99 | ||
@@ -136,13 +136,14 @@ static void xfp_phy_reconfigure(struct efx_nic *efx) | |||
136 | struct xfp_phy_data *phy_data = efx->phy_data; | 136 | struct xfp_phy_data *phy_data = efx->phy_data; |
137 | 137 | ||
138 | /* Reset the PHY when moving from tx off to tx on */ | 138 | /* Reset the PHY when moving from tx off to tx on */ |
139 | if (phy_data->tx_disabled && !efx->tx_disabled) | 139 | if (!(efx->phy_mode & PHY_MODE_TX_DISABLED) && |
140 | (phy_data->phy_mode & PHY_MODE_TX_DISABLED)) | ||
140 | xfp_reset_phy(efx); | 141 | xfp_reset_phy(efx); |
141 | 142 | ||
142 | mdio_clause45_transmit_disable(efx); | 143 | mdio_clause45_transmit_disable(efx); |
143 | mdio_clause45_phy_reconfigure(efx); | 144 | mdio_clause45_phy_reconfigure(efx); |
144 | 145 | ||
145 | phy_data->tx_disabled = efx->tx_disabled; | 146 | phy_data->phy_mode = efx->phy_mode; |
146 | efx->link_up = xfp_link_ok(efx); | 147 | efx->link_up = xfp_link_ok(efx); |
147 | efx->link_options = GM_LPA_10000FULL; | 148 | efx->link_options = GM_LPA_10000FULL; |
148 | } | 149 | } |