diff options
-rw-r--r-- | drivers/net/ibm_newemac/Kconfig | 8 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/mal.h | 34 |
2 files changed, 42 insertions, 0 deletions
diff --git a/drivers/net/ibm_newemac/Kconfig b/drivers/net/ibm_newemac/Kconfig index dfb6547c37cb..44e5a0e9922a 100644 --- a/drivers/net/ibm_newemac/Kconfig +++ b/drivers/net/ibm_newemac/Kconfig | |||
@@ -66,3 +66,11 @@ config IBM_NEW_EMAC_EMAC4 | |||
66 | config IBM_NEW_EMAC_NO_FLOW_CTRL | 66 | config IBM_NEW_EMAC_NO_FLOW_CTRL |
67 | bool | 67 | bool |
68 | default n | 68 | default n |
69 | |||
70 | config IBM_NEW_EMAC_MAL_CLR_ICINTSTAT | ||
71 | bool | ||
72 | default n | ||
73 | |||
74 | config IBM_NEW_EMAC_MAL_COMMON_ERR | ||
75 | bool | ||
76 | default n | ||
diff --git a/drivers/net/ibm_newemac/mal.h b/drivers/net/ibm_newemac/mal.h index eaa7262dc079..0b2413839b78 100644 --- a/drivers/net/ibm_newemac/mal.h +++ b/drivers/net/ibm_newemac/mal.h | |||
@@ -213,6 +213,8 @@ struct mal_instance { | |||
213 | struct of_device *ofdev; | 213 | struct of_device *ofdev; |
214 | int index; | 214 | int index; |
215 | spinlock_t lock; | 215 | spinlock_t lock; |
216 | |||
217 | unsigned int features; | ||
216 | }; | 218 | }; |
217 | 219 | ||
218 | static inline u32 get_mal_dcrn(struct mal_instance *mal, int reg) | 220 | static inline u32 get_mal_dcrn(struct mal_instance *mal, int reg) |
@@ -225,6 +227,38 @@ static inline void set_mal_dcrn(struct mal_instance *mal, int reg, u32 val) | |||
225 | dcr_write(mal->dcr_host, reg, val); | 227 | dcr_write(mal->dcr_host, reg, val); |
226 | } | 228 | } |
227 | 229 | ||
230 | /* Features of various MAL implementations */ | ||
231 | |||
232 | /* Set if you have interrupt coalescing and you have to clear the SDR | ||
233 | * register for TXEOB and RXEOB interrupts to work | ||
234 | */ | ||
235 | #define MAL_FTR_CLEAR_ICINTSTAT 0x00000001 | ||
236 | |||
237 | /* Set if your MAL has SERR, TXDE, and RXDE OR'd into a single UIC | ||
238 | * interrupt | ||
239 | */ | ||
240 | #define MAL_FTR_COMMON_ERR_INT 0x00000002 | ||
241 | |||
242 | enum { | ||
243 | MAL_FTRS_ALWAYS = 0, | ||
244 | |||
245 | MAL_FTRS_POSSIBLE = | ||
246 | #ifdef CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT | ||
247 | MAL_FTR_CLEAR_ICINTSTAT | | ||
248 | #endif | ||
249 | #ifdef CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR | ||
250 | MAL_FTR_COMMON_ERR_INT | | ||
251 | #endif | ||
252 | 0, | ||
253 | }; | ||
254 | |||
255 | static inline int mal_has_feature(struct mal_instance *dev, | ||
256 | unsigned long feature) | ||
257 | { | ||
258 | return (MAL_FTRS_ALWAYS & feature) || | ||
259 | (MAL_FTRS_POSSIBLE & dev->features & feature); | ||
260 | } | ||
261 | |||
228 | /* Register MAL devices */ | 262 | /* Register MAL devices */ |
229 | int mal_init(void); | 263 | int mal_init(void); |
230 | void mal_exit(void); | 264 | void mal_exit(void); |