Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
enum.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Driver for Solarflare Solarstorm network controllers and boards
3  * Copyright 2007-2009 Solarflare Communications Inc.
4  *
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
7  * by the Free Software Foundation, incorporated herein by reference.
8  */
9 
10 #ifndef EFX_ENUM_H
11 #define EFX_ENUM_H
12 
43 /* Please keep up-to-date w.r.t the following two #defines */
73 };
74 #define LOOPBACK_TEST_MAX LOOPBACK_PMAPMD
75 
76 /* These loopbacks occur within the controller */
77 #define LOOPBACKS_INTERNAL ((1 << LOOPBACK_DATA) | \
78  (1 << LOOPBACK_GMAC) | \
79  (1 << LOOPBACK_XGMII)| \
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))
111 
112 #define LOOPBACK_MASK(_efx) \
113  (1 << (_efx)->loopback_mode)
114 
115 #define LOOPBACK_INTERNAL(_efx) \
116  (!!(LOOPBACKS_INTERNAL & LOOPBACK_MASK(_efx)))
117 
118 #define LOOPBACK_EXTERNAL(_efx) \
119  (!!(LOOPBACK_MASK(_efx) & LOOPBACKS_EXTERNAL(_efx)))
120 
121 #define LOOPBACK_CHANGED(_from, _to, _mask) \
122  (!!((LOOPBACK_MASK(_from) ^ LOOPBACK_MASK(_to)) & (_mask)))
123 
124 #define LOOPBACK_OUT_OF(_from, _to, _mask) \
125  ((LOOPBACK_MASK(_from) & (_mask)) && !(LOOPBACK_MASK(_to) & (_mask)))
126 
127 /*****************************************************************************/
128 
165 };
166 
167 #endif /* EFX_ENUM_H */