diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-10-23 04:33:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-24 07:27:25 -0400 |
commit | 18ea024fd6abd1a857de9dc0f588a222cf279521 (patch) | |
tree | a4300e54144d2f508f8f9ce3b98170ca943f7903 /drivers/net | |
parent | a5211bb5f72c55d936dab56363ca9755981164bd (diff) |
sfc: Merge efx_fc_resolve() into efx_mdio_get_pause()
efx_fc_resolve() is specific to MDIO and is not used by any other
function.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/sfc/mdio_10g.c | 12 | ||||
-rw-r--r-- | drivers/net/sfc/net_driver.h | 11 |
2 files changed, 8 insertions, 15 deletions
diff --git a/drivers/net/sfc/mdio_10g.c b/drivers/net/sfc/mdio_10g.c index b355872de6c2..25fb20adf4b7 100644 --- a/drivers/net/sfc/mdio_10g.c +++ b/drivers/net/sfc/mdio_10g.c | |||
@@ -341,10 +341,14 @@ int efx_mdio_set_settings(struct efx_nic *efx, struct ethtool_cmd *ecmd) | |||
341 | 341 | ||
342 | enum efx_fc_type efx_mdio_get_pause(struct efx_nic *efx) | 342 | enum efx_fc_type efx_mdio_get_pause(struct efx_nic *efx) |
343 | { | 343 | { |
344 | int lpa; | 344 | BUILD_BUG_ON(EFX_FC_AUTO & (EFX_FC_RX | EFX_FC_TX)); |
345 | 345 | ||
346 | if (!(efx->phy_op->mmds & MDIO_DEVS_AN)) | 346 | if (!(efx->wanted_fc & EFX_FC_AUTO)) |
347 | return efx->wanted_fc; | 347 | return efx->wanted_fc; |
348 | lpa = efx_mdio_read(efx, MDIO_MMD_AN, MDIO_AN_LPA); | 348 | |
349 | return efx_fc_resolve(efx->wanted_fc, lpa); | 349 | WARN_ON(!(efx->mdio.mmds & MDIO_DEVS_AN)); |
350 | |||
351 | return mii_resolve_flowctrl_fdx( | ||
352 | mii_advertise_flowctrl(efx->wanted_fc), | ||
353 | efx_mdio_read(efx, MDIO_MMD_AN, MDIO_AN_LPA)); | ||
350 | } | 354 | } |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 13bc1b496da8..bb3d258bd5e8 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -497,17 +497,6 @@ enum efx_mac_type { | |||
497 | EFX_XMAC = 2, | 497 | EFX_XMAC = 2, |
498 | }; | 498 | }; |
499 | 499 | ||
500 | static inline enum efx_fc_type efx_fc_resolve(enum efx_fc_type wanted_fc, | ||
501 | unsigned int lpa) | ||
502 | { | ||
503 | BUILD_BUG_ON(EFX_FC_AUTO & (EFX_FC_RX | EFX_FC_TX)); | ||
504 | |||
505 | if (!(wanted_fc & EFX_FC_AUTO)) | ||
506 | return wanted_fc; | ||
507 | |||
508 | return mii_resolve_flowctrl_fdx(mii_advertise_flowctrl(wanted_fc), lpa); | ||
509 | } | ||
510 | |||
511 | /** | 500 | /** |
512 | * struct efx_mac_operations - Efx MAC operations table | 501 | * struct efx_mac_operations - Efx MAC operations table |
513 | * @reconfigure: Reconfigure MAC. Serialised by the mac_lock | 502 | * @reconfigure: Reconfigure MAC. Serialised by the mac_lock |