diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-29 10:08:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-29 20:23:53 -0500 |
commit | e58f69f4082f60076885798fae8f3a17ea713bf6 (patch) | |
tree | afd86e4023e266747c8f63d5369c268e1269ff22 /drivers/net/sfc/enum.h | |
parent | 5784946068f81c5f1cce2906a7655652e34f44f3 (diff) |
sfc: Extend loopback mode enumeration
New NICs and PHYs support a wider variety of loopback modes.
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 | 106 |
1 files changed, 86 insertions, 20 deletions
diff --git a/drivers/net/sfc/enum.h b/drivers/net/sfc/enum.h index fcd14b73f24d..7a9e79ab9313 100644 --- a/drivers/net/sfc/enum.h +++ b/drivers/net/sfc/enum.h | |||
@@ -13,38 +13,101 @@ | |||
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_GMAC: loopback within GMAC at unspecified level | 16 | * @LOOPBACK_DATA: data path loopback |
17 | * @LOOPBACK_XGMII: loopback within XMAC at XGMII level | 17 | * @LOOPBACK_GMAC: loopback within GMAC |
18 | * @LOOPBACK_XGXS: loopback within XMAC at XGXS level | 18 | * @LOOPBACK_XGMII: loopback after XMAC |
19 | * @LOOPBACK_XAUI: loopback within XMAC at XAUI level | 19 | * @LOOPBACK_XGXS: loopback within BPX after XGXS |
20 | * @LOOPBACK_XAUI: loopback within BPX before XAUI serdes | ||
21 | * @LOOPBACK_GMII: loopback within BPX after GMAC | ||
22 | * @LOOPBACK_SGMII: loopback within BPX within SGMII | ||
23 | * @LOOPBACK_XGBR: loopback within BPX within XGBR | ||
24 | * @LOOPBACK_XFI: loopback within BPX before XFI serdes | ||
25 | * @LOOPBACK_XAUI_FAR: loopback within BPX after XAUI serdes | ||
26 | * @LOOPBACK_GMII_FAR: loopback within BPX before SGMII | ||
27 | * @LOOPBACK_SGMII_FAR: loopback within BPX after SGMII | ||
28 | * @LOOPBACK_XFI_FAR: loopback after XFI serdes | ||
20 | * @LOOPBACK_GPHY: loopback within 1G PHY at unspecified level | 29 | * @LOOPBACK_GPHY: loopback within 1G PHY at unspecified level |
21 | * @LOOPBACK_PHYXS: loopback within 10G PHY at PHYXS level | 30 | * @LOOPBACK_PHYXS: loopback within 10G PHY at PHYXS level |
22 | * @LOOPBACK_PCS: loopback within 10G PHY at PCS level | 31 | * @LOOPBACK_PCS: loopback within 10G PHY at PCS level |
23 | * @LOOPBACK_PMAPMD: loopback within 10G PHY at PMAPMD level | 32 | * @LOOPBACK_PMAPMD: loopback within 10G PHY at PMAPMD level |
24 | * @LOOPBACK_NETWORK: reflecting loopback (even further than furthest!) | 33 | * @LOOPBACK_XPORT: cross port loopback |
34 | * @LOOPBACK_XGMII_WS: wireside loopback excluding XMAC | ||
35 | * @LOOPBACK_XAUI_WS: wireside loopback within BPX within XAUI serdes | ||
36 | * @LOOPBACK_XAUI_WS_FAR: wireside loopback within BPX including XAUI serdes | ||
37 | * @LOOPBACK_XAUI_WS_NEAR: wireside loopback within BPX excluding XAUI serdes | ||
38 | * @LOOPBACK_GMII_WS: wireside loopback excluding GMAC | ||
39 | * @LOOPBACK_XFI_WS: wireside loopback excluding XFI serdes | ||
40 | * @LOOPBACK_XFI_WS_FAR: wireside loopback including XFI serdes | ||
41 | * @LOOPBACK_PHYXS_WS: wireside loopback within 10G PHY at PHYXS level | ||
25 | */ | 42 | */ |
26 | /* Please keep in order and up-to-date w.r.t the following two #defines */ | 43 | /* Please keep up-to-date w.r.t the following two #defines */ |
27 | enum efx_loopback_mode { | 44 | enum efx_loopback_mode { |
28 | LOOPBACK_NONE = 0, | 45 | LOOPBACK_NONE = 0, |
29 | LOOPBACK_GMAC = 1, | 46 | LOOPBACK_DATA = 1, |
30 | LOOPBACK_XGMII = 2, | 47 | LOOPBACK_GMAC = 2, |
31 | LOOPBACK_XGXS = 3, | 48 | LOOPBACK_XGMII = 3, |
32 | LOOPBACK_XAUI = 4, | 49 | LOOPBACK_XGXS = 4, |
33 | LOOPBACK_GPHY = 5, | 50 | LOOPBACK_XAUI = 5, |
34 | LOOPBACK_PHYXS = 6, | 51 | LOOPBACK_GMII = 6, |
35 | LOOPBACK_PCS = 7, | 52 | LOOPBACK_SGMII = 7, |
36 | LOOPBACK_PMAPMD = 8, | 53 | LOOPBACK_XGBR = 8, |
37 | LOOPBACK_NETWORK = 9, | 54 | LOOPBACK_XFI = 9, |
55 | LOOPBACK_XAUI_FAR = 10, | ||
56 | LOOPBACK_GMII_FAR = 11, | ||
57 | LOOPBACK_SGMII_FAR = 12, | ||
58 | LOOPBACK_XFI_FAR = 13, | ||
59 | LOOPBACK_GPHY = 14, | ||
60 | LOOPBACK_PHYXS = 15, | ||
61 | LOOPBACK_PCS = 16, | ||
62 | LOOPBACK_PMAPMD = 17, | ||
63 | LOOPBACK_XPORT = 18, | ||
64 | LOOPBACK_XGMII_WS = 19, | ||
65 | LOOPBACK_XAUI_WS = 20, | ||
66 | LOOPBACK_XAUI_WS_FAR = 21, | ||
67 | LOOPBACK_XAUI_WS_NEAR = 22, | ||
68 | LOOPBACK_GMII_WS = 23, | ||
69 | LOOPBACK_XFI_WS = 24, | ||
70 | LOOPBACK_XFI_WS_FAR = 25, | ||
71 | LOOPBACK_PHYXS_WS = 26, | ||
38 | LOOPBACK_MAX | 72 | LOOPBACK_MAX |
39 | }; | 73 | }; |
40 | |||
41 | #define LOOPBACK_TEST_MAX LOOPBACK_PMAPMD | 74 | #define LOOPBACK_TEST_MAX LOOPBACK_PMAPMD |
42 | 75 | ||
43 | /* These loopbacks occur within the controller */ | 76 | /* These loopbacks occur within the controller */ |
44 | #define LOOPBACKS_INTERNAL ((1 << LOOPBACK_GMAC) | \ | 77 | #define LOOPBACKS_INTERNAL ((1 << LOOPBACK_DATA) | \ |
45 | (1 << LOOPBACK_XGMII)| \ | 78 | (1 << LOOPBACK_GMAC) | \ |
46 | (1 << LOOPBACK_XGXS) | \ | 79 | (1 << LOOPBACK_XGMII)| \ |
47 | (1 << LOOPBACK_XAUI)) | 80 | (1 << LOOPBACK_XGXS) | \ |
81 | (1 << LOOPBACK_XAUI) | \ | ||
82 | (1 << LOOPBACK_GMII) | \ | ||
83 | (1 << LOOPBACK_SGMII) | \ | ||
84 | (1 << LOOPBACK_SGMII) | \ | ||
85 | (1 << LOOPBACK_XGBR) | \ | ||
86 | (1 << LOOPBACK_XFI) | \ | ||
87 | (1 << LOOPBACK_XAUI_FAR) | \ | ||
88 | (1 << LOOPBACK_GMII_FAR) | \ | ||
89 | (1 << LOOPBACK_SGMII_FAR) | \ | ||
90 | (1 << LOOPBACK_XFI_FAR) | \ | ||
91 | (1 << LOOPBACK_XGMII_WS) | \ | ||
92 | (1 << LOOPBACK_XAUI_WS) | \ | ||
93 | (1 << LOOPBACK_XAUI_WS_FAR) | \ | ||
94 | (1 << LOOPBACK_XAUI_WS_NEAR) | \ | ||
95 | (1 << LOOPBACK_GMII_WS) | \ | ||
96 | (1 << LOOPBACK_XFI_WS) | \ | ||
97 | (1 << LOOPBACK_XFI_WS_FAR)) | ||
98 | |||
99 | #define LOOPBACKS_WS ((1 << LOOPBACK_XGMII_WS) | \ | ||
100 | (1 << LOOPBACK_XAUI_WS) | \ | ||
101 | (1 << LOOPBACK_XAUI_WS_FAR) | \ | ||
102 | (1 << LOOPBACK_XAUI_WS_NEAR) | \ | ||
103 | (1 << LOOPBACK_GMII_WS) | \ | ||
104 | (1 << LOOPBACK_XFI_WS) | \ | ||
105 | (1 << LOOPBACK_XFI_WS_FAR) | \ | ||
106 | (1 << LOOPBACK_PHYXS_WS)) | ||
107 | |||
108 | #define LOOPBACKS_EXTERNAL(_efx) \ | ||
109 | ((_efx)->loopback_modes & ~LOOPBACKS_INTERNAL & \ | ||
110 | ~(1 << LOOPBACK_NONE)) | ||
48 | 111 | ||
49 | #define LOOPBACK_MASK(_efx) \ | 112 | #define LOOPBACK_MASK(_efx) \ |
50 | (1 << (_efx)->loopback_mode) | 113 | (1 << (_efx)->loopback_mode) |
@@ -52,6 +115,9 @@ enum efx_loopback_mode { | |||
52 | #define LOOPBACK_INTERNAL(_efx) \ | 115 | #define LOOPBACK_INTERNAL(_efx) \ |
53 | (!!(LOOPBACKS_INTERNAL & LOOPBACK_MASK(_efx))) | 116 | (!!(LOOPBACKS_INTERNAL & LOOPBACK_MASK(_efx))) |
54 | 117 | ||
118 | #define LOOPBACK_EXTERNAL(_efx) \ | ||
119 | (!!(LOOPBACK_MASK(_efx) & LOOPBACKS_EXTERNAL(_efx))) | ||
120 | |||
55 | #define LOOPBACK_CHANGED(_from, _to, _mask) \ | 121 | #define LOOPBACK_CHANGED(_from, _to, _mask) \ |
56 | (!!((LOOPBACK_MASK(_from) ^ LOOPBACK_MASK(_to)) & (_mask))) | 122 | (!!((LOOPBACK_MASK(_from) ^ LOOPBACK_MASK(_to)) & (_mask))) |
57 | 123 | ||