Skip to contentSkip to conversation

m68k/atari - smc91x: remove Atari special case handling for SMC_PUSH_DATA

PATCH Applied Michael Schmitz 2 participants 2 messages Nov 30, 2014 – Jan 13, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68k/atari - smc91x: remove Atari special case handling for SMC_PUSH_DATA

Use of string accessors for unaligned writes (see mainstream commit e9e4ea74f06635f2ffc1dffe5ef40c854faa0a90) have fixed the swapped first unaligned byte problem for the Atari EtherNAT. Drop the redundant special case code now.

---
 drivers/net/ethernet/smsc/smc91x.h |   37 ------------------------------------
 1 files changed, 0 insertions(+), 37 deletions(-)
drivers/net/ethernet/smsc/smc91x.h +0 -37
index 3a8069f..14c5325 100644
@@ -223,8 +223,6 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
 #define SMC_CAN_USE_32BIT       1
 #define SMC_NOWAIT              1
 
-#define writew_be(val, addr) out_be16((addr), (val))
-
 #define SMC_inb(a, r)           readb((a) + (r))
 #define SMC_inw(a, r)           readw((a) + (r))
 #define SMC_inl(a, r)           readl((a) + (r))
@@ -1128,40 +1126,6 @@ static const char * chip_ids[ 16 ] =  {
 		}							\
 	} while (0)
 
-#if defined(CONFIG_ATARI)
-/*
- * MSch: EtherNAT is 32 bit, so the misaligned data buffer hack applies.
- * This appears to hurt quite a lot ... we actually need to byte swap the
- * misaligned write because the data end up in the packet buffer swapped
- * otherwise (resulting in the first two bytes of the target MAC address
- * being swapped)
- */
-#define SMC_PUSH_DATA(lp, p, l)					\
-	do {								\
-		if (SMC_32BIT(lp)) {				\
-			void *__ptr = (p);				\
-			int __len = (l);				\
-			void __iomem *__ioaddr = ioaddr;		\
-			if (__len >= 2 && (unsigned long)__ptr & 2) {	\
-				__len -= 2;				\
-				SMC_outw_be(*(u16 *)__ptr, ioaddr,	\
-					DATA_REG(lp));		\
-				__ptr += 2;				\
-			}						\
-			if (SMC_CAN_USE_DATACS && lp->datacs)		\
-				__ioaddr = lp->datacs;			\
-			SMC_outsl(__ioaddr, DATA_REG(lp), __ptr, __len>>2); \
-			if (__len & 2) {				\
-				__ptr += (__len & ~3);			\
-				SMC_outw_be(*((u16 *)__ptr), ioaddr,	\
-					 DATA_REG(lp));		\
-			}						\
-		} else if (SMC_16BIT(lp))				\
-			SMC_outsw(ioaddr, DATA_REG(lp), (u16 *) p, (l) >> 1); \
-		else if (SMC_8BIT(lp))				\
-			SMC_outsb(ioaddr, DATA_REG(lp), p, l);	\
-	} while (0)
-#else
 #define SMC_PUSH_DATA(lp, p, l)					\
 	do {								\
 		if (SMC_32BIT(lp)) {				\
@@ -1185,7 +1149,6 @@ static const char * chip_ids[ 16 ] =  {
 		else if (SMC_8BIT(lp))				\
 			SMC_outsb(ioaddr, DATA_REG(lp), p, l);	\
 	} while (0)
-#endif
 
 #define SMC_PULL_DATA(lp, p, l)					\
 	do {								\
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 7 lines · Michael Schmitz

Use of string accessors for unaligned writes (see mainstream commit e9e4ea74f06635f2ffc1dffe5ef40c854faa0a90) have fixed the swapped first unaligned byte problem for the Atari EtherNAT. Drop the redundant special case code now.

Thanks, applied and folded into "net: smc91x: Add Atari EtherNAT support".

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds