diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-12-13 00:50:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-13 00:58:17 -0500 |
commit | 177dfcd80f28f8fbc3e22c2d8b24d21cb86f1d97 (patch) | |
tree | a6e5e9949f388d48ac20c4efbb2811762ac5f9d4 /drivers/net/sfc/enum.h | |
parent | 356eebb2b3af24cc701823f1e025f04eef333239 (diff) |
sfc: Add support for sub-10G speeds
The SFC4000 has a separate MAC for use at sub-10G speeds. Introduce
an efx_mac_operations structure with implementations for the two MACs.
Switch between the MACs as necessary.
PHY settings are independent of the MAC, so add get_settings() and
set_settings() to efx_phy_operations. Also add macs field to indicate
which MACs the PHY is connected to.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/enum.h')
-rw-r--r-- | drivers/net/sfc/enum.h | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/net/sfc/enum.h b/drivers/net/sfc/enum.h index 41e758e8fdb1..0c2e41ce8b4a 100644 --- a/drivers/net/sfc/enum.h +++ b/drivers/net/sfc/enum.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | * Driver for Solarflare Solarstorm network controllers and boards | 2 | * Driver for Solarflare Solarstorm network controllers and boards |
3 | * Copyright 2007 Solarflare Communications Inc. | 3 | * Copyright 2007-2008 Solarflare Communications Inc. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of the GNU General Public License version 2 as published | 6 | * under the terms of the GNU General Public License version 2 as published |
@@ -13,22 +13,24 @@ | |||
13 | /** | 13 | /** |
14 | * enum efx_loopback_mode - loopback modes | 14 | * enum efx_loopback_mode - loopback modes |
15 | * @LOOPBACK_NONE: no loopback | 15 | * @LOOPBACK_NONE: no loopback |
16 | * @LOOPBACK_XGMII: loopback within MAC at XGMII level | 16 | * @LOOPBACK_GMAC: loopback within GMAC at unspecified level |
17 | * @LOOPBACK_XGXS: loopback within MAC at XGXS level | 17 | * @LOOPBACK_XGMII: loopback within XMAC at XGMII level |
18 | * @LOOPBACK_XAUI: loopback within MAC at XAUI level | 18 | * @LOOPBACK_XGXS: loopback within XMAC at XGXS level |
19 | * @LOOPBACK_PHYXS: loopback within PHY at PHYXS level | 19 | * @LOOPBACK_XAUI: loopback within XMAC at XAUI level |
20 | * @LOOPBACK_PCS: loopback within PHY at PCS level | 20 | * @LOOPBACK_GPHY: loopback within 1G PHY at unspecified level |
21 | * @LOOPBACK_PMAPMD: loopback within PHY at PMAPMD level | 21 | * @LOOPBACK_PHYXS: loopback within 10G PHY at PHYXS level |
22 | * @LOOPBACK_PCS: loopback within 10G PHY at PCS level | ||
23 | * @LOOPBACK_PMAPMD: loopback within 10G PHY at PMAPMD level | ||
22 | * @LOOPBACK_NETWORK: reflecting loopback (even further than furthest!) | 24 | * @LOOPBACK_NETWORK: reflecting loopback (even further than furthest!) |
23 | */ | 25 | */ |
24 | /* Please keep in order and up-to-date w.r.t the following two #defines */ | 26 | /* Please keep in order and up-to-date w.r.t the following two #defines */ |
25 | enum efx_loopback_mode { | 27 | enum efx_loopback_mode { |
26 | LOOPBACK_NONE = 0, | 28 | LOOPBACK_NONE = 0, |
27 | LOOPBACK_MAC = 1, | 29 | LOOPBACK_GMAC = 1, |
28 | LOOPBACK_XGMII = 2, | 30 | LOOPBACK_XGMII = 2, |
29 | LOOPBACK_XGXS = 3, | 31 | LOOPBACK_XGXS = 3, |
30 | LOOPBACK_XAUI = 4, | 32 | LOOPBACK_XAUI = 4, |
31 | LOOPBACK_PHY = 5, | 33 | LOOPBACK_GPHY = 5, |
32 | LOOPBACK_PHYXS = 6, | 34 | LOOPBACK_PHYXS = 6, |
33 | LOOPBACK_PCS = 7, | 35 | LOOPBACK_PCS = 7, |
34 | LOOPBACK_PMAPMD = 8, | 36 | LOOPBACK_PMAPMD = 8, |
@@ -45,15 +47,16 @@ extern const char *efx_loopback_mode_names[]; | |||
45 | LOOPBACK_MODE_NAME(efx->loopback_mode) | 47 | LOOPBACK_MODE_NAME(efx->loopback_mode) |
46 | 48 | ||
47 | /* These loopbacks occur within the controller */ | 49 | /* These loopbacks occur within the controller */ |
48 | #define LOOPBACKS_10G_INTERNAL ((1 << LOOPBACK_XGMII)| \ | 50 | #define LOOPBACKS_INTERNAL ((1 << LOOPBACK_GMAC) | \ |
49 | (1 << LOOPBACK_XGXS) | \ | 51 | (1 << LOOPBACK_XGMII)| \ |
50 | (1 << LOOPBACK_XAUI)) | 52 | (1 << LOOPBACK_XGXS) | \ |
53 | (1 << LOOPBACK_XAUI)) | ||
51 | 54 | ||
52 | #define LOOPBACK_MASK(_efx) \ | 55 | #define LOOPBACK_MASK(_efx) \ |
53 | (1 << (_efx)->loopback_mode) | 56 | (1 << (_efx)->loopback_mode) |
54 | 57 | ||
55 | #define LOOPBACK_INTERNAL(_efx) \ | 58 | #define LOOPBACK_INTERNAL(_efx) \ |
56 | (!!(LOOPBACKS_10G_INTERNAL & LOOPBACK_MASK(_efx))) | 59 | (!!(LOOPBACKS_INTERNAL & LOOPBACK_MASK(_efx))) |
57 | 60 | ||
58 | #define LOOPBACK_OUT_OF(_from, _to, _mask) \ | 61 | #define LOOPBACK_OUT_OF(_from, _to, _mask) \ |
59 | ((LOOPBACK_MASK(_from) & (_mask)) && !(LOOPBACK_MASK(_to) & (_mask))) | 62 | ((LOOPBACK_MASK(_from) & (_mask)) && !(LOOPBACK_MASK(_to) & (_mask))) |