From: Marc Singer Adds support for the Logic Product Development variant of the smc91x implementation. The SMC_IOBARRIER is necessary to work-around a peculiarity of the memory controller that interfaces the network controller to the bus. Signed-off-by: Andrew Morton --- 25-akpm/drivers/net/smc91x.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 43 insertions(+) diff -puN drivers/net/smc91x.h~add-smc91x-ethernet-for-lpd7a40x drivers/net/smc91x.h --- 25/drivers/net/smc91x.h~add-smc91x-ethernet-for-lpd7a40x 2004-08-31 23:17:13.247756920 -0700 +++ 25-akpm/drivers/net/smc91x.h 2004-08-31 23:17:13.253756008 -0700 @@ -160,6 +160,49 @@ SMC_outw(u16 val, unsigned long ioaddr, #define SMC_insw(a, r, p, l) insw((a) + (r), p, l) #define SMC_outsw(a, r, p, l) outsw((a) + (r), p, l) +#elif defined(CONFIG_MACH_LPD7A400) || defined(CONFIG_MACH_LPD7A404) + +#include /* IOBARRIER_VIRT */ + +#define SMC_CAN_USE_8BIT 0 +#define SMC_CAN_USE_16BIT 1 +#define SMC_CAN_USE_32BIT 0 +#define SMC_NOWAIT 0 +#define SMC_IOBARRIER ({ barrier (); readl (IOBARRIER_VIRT); }) + +static inline unsigned short SMC_inw (unsigned long a, int r) +{ + unsigned short v; + v = readw (a + r); + SMC_IOBARRIER; + return v; +} + +static inline void SMC_outw (unsigned short v, unsigned long a, int r) +{ + writew (v, a + r); + SMC_IOBARRIER; +} + +static inline void SMC_insw (unsigned long a, int r, unsigned char* p, int l) +{ + while (l-- > 0) { + *((unsigned short*)p)++ = readw (a + r); + SMC_IOBARRIER; + } +} + +static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l) +{ + while (l-- > 0) { + writew (*((unsigned short*)p)++, a + r); + SMC_IOBARRIER; + } +} + +#define RPC_LSA_DEFAULT RPC_LED_TX_RX +#define RPC_LSB_DEFAULT RPC_LED_100_10 + #else #define SMC_CAN_USE_8BIT 1 _