summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2016-10-17 15:45:30 -0400
committerDavid S. Miller <davem@davemloft.net>2016-10-18 14:14:21 -0400
commitd09d747ae4c25a89aa04c0881ea52e90a09bedfd (patch)
treeaa2152bf6253451a3abdbe40eda23024e815899d
parent9a97434215819872b054c3d0c067e5e4fa768b0e (diff)
net: smc91x: isolate u16 writes alignment workaround
Writes to u16 has a special handling on 3 PXA platforms, where the hardware wiring forces these writes to be u32 aligned. This patch isolates this handling for PXA platforms as before, but enables this "workaround" to be set up dynamically, which will be the case in device-tree build types. This patch was tested on 2 PXA platforms : mainstone, which relies on the workaround, and lubbock, which doesn't. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--arch/mn10300/unit-asb2303/include/unit/smc91111.h2
-rw-r--r--drivers/net/ethernet/smsc/smc91x.c3
-rw-r--r--drivers/net/ethernet/smsc/smc91x.h82
3 files changed, 47 insertions, 40 deletions
diff --git a/arch/mn10300/unit-asb2303/include/unit/smc91111.h b/arch/mn10300/unit-asb2303/include/unit/smc91111.h
index dd456e9c513f..dd4e2946438e 100644
--- a/arch/mn10300/unit-asb2303/include/unit/smc91111.h
+++ b/arch/mn10300/unit-asb2303/include/unit/smc91111.h
@@ -30,7 +30,7 @@
30 30
31#if SMC_CAN_USE_16BIT 31#if SMC_CAN_USE_16BIT
32#define SMC_inw(a, r) inw((unsigned long) ((a) + (r))) 32#define SMC_inw(a, r) inw((unsigned long) ((a) + (r)))
33#define SMC_outw(v, a, r) outw(v, (unsigned long) ((a) + (r))) 33#define SMC_outw(lp, v, a, r) outw(v, (unsigned long) ((a) + (r)))
34#define SMC_insw(a, r, p, l) insw((unsigned long) ((a) + (r)), (p), (l)) 34#define SMC_insw(a, r, p, l) insw((unsigned long) ((a) + (r)), (p), (l))
35#define SMC_outsw(a, r, p, l) outsw((unsigned long) ((a) + (r)), (p), (l)) 35#define SMC_outsw(a, r, p, l) outsw((unsigned long) ((a) + (r)), (p), (l))
36#endif 36#endif
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 9b4780f87863..705d99b2d947 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -602,7 +602,8 @@ static void smc_hardware_send_pkt(unsigned long data)
602 SMC_PUSH_DATA(lp, buf, len & ~1); 602 SMC_PUSH_DATA(lp, buf, len & ~1);
603 603
604 /* Send final ctl word with the last byte if there is one */ 604 /* Send final ctl word with the last byte if there is one */
605 SMC_outw(((len & 1) ? (0x2000 | buf[len-1]) : 0), ioaddr, DATA_REG(lp)); 605 SMC_outw(lp, ((len & 1) ? (0x2000 | buf[len - 1]) : 0), ioaddr,
606 DATA_REG(lp));
606 607
607 /* 608 /*
608 * If THROTTLE_TX_PKTS is set, we stop the queue here. This will 609 * If THROTTLE_TX_PKTS is set, we stop the queue here. This will
diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h
index ea8465467469..45e6b81a6a92 100644
--- a/drivers/net/ethernet/smsc/smc91x.h
+++ b/drivers/net/ethernet/smsc/smc91x.h
@@ -63,8 +63,6 @@
63 63
64#if defined(CONFIG_ARM) 64#if defined(CONFIG_ARM)
65 65
66#include <asm/mach-types.h>
67
68/* Now the bus width is specified in the platform data 66/* Now the bus width is specified in the platform data
69 * pretend here to support all I/O access types 67 * pretend here to support all I/O access types
70 */ 68 */
@@ -86,11 +84,11 @@
86 84
87#define SMC_inl(a, r) readl((a) + (r)) 85#define SMC_inl(a, r) readl((a) + (r))
88#define SMC_outb(v, a, r) writeb(v, (a) + (r)) 86#define SMC_outb(v, a, r) writeb(v, (a) + (r))
89#define SMC_outw(v, a, r) \ 87#define SMC_outw(lp, v, a, r) \
90 do { \ 88 do { \
91 unsigned int __v = v, __smc_r = r; \ 89 unsigned int __v = v, __smc_r = r; \
92 if (SMC_16BIT(lp)) \ 90 if (SMC_16BIT(lp)) \
93 __SMC_outw(__v, a, __smc_r); \ 91 __SMC_outw(lp, __v, a, __smc_r); \
94 else if (SMC_8BIT(lp)) \ 92 else if (SMC_8BIT(lp)) \
95 SMC_outw_b(__v, a, __smc_r); \ 93 SMC_outw_b(__v, a, __smc_r); \
96 else \ 94 else \
@@ -107,10 +105,10 @@
107#define SMC_IRQ_FLAGS (-1) /* from resource */ 105#define SMC_IRQ_FLAGS (-1) /* from resource */
108 106
109/* We actually can't write halfwords properly if not word aligned */ 107/* We actually can't write halfwords properly if not word aligned */
110static inline void __SMC_outw(u16 val, void __iomem *ioaddr, int reg) 108static inline void _SMC_outw_align4(u16 val, void __iomem *ioaddr, int reg,
109 bool use_align4_workaround)
111{ 110{
112 if ((machine_is_mainstone() || machine_is_stargate2() || 111 if (use_align4_workaround) {
113 machine_is_pxa_idp()) && reg & 2) {
114 unsigned int v = val << 16; 112 unsigned int v = val << 16;
115 v |= readl(ioaddr + (reg & ~2)) & 0xffff; 113 v |= readl(ioaddr + (reg & ~2)) & 0xffff;
116 writel(v, ioaddr + (reg & ~2)); 114 writel(v, ioaddr + (reg & ~2));
@@ -119,6 +117,12 @@ static inline void __SMC_outw(u16 val, void __iomem *ioaddr, int reg)
119 } 117 }
120} 118}
121 119
120#define __SMC_outw(lp, v, a, r) \
121 _SMC_outw_align4((v), (a), (r), \
122 IS_BUILTIN(CONFIG_ARCH_PXA) && ((r) & 2) && \
123 (lp)->cfg.pxa_u16_align4)
124
125
122#elif defined(CONFIG_SH_SH4202_MICRODEV) 126#elif defined(CONFIG_SH_SH4202_MICRODEV)
123 127
124#define SMC_CAN_USE_8BIT 0 128#define SMC_CAN_USE_8BIT 0
@@ -129,7 +133,7 @@ static inline void __SMC_outw(u16 val, void __iomem *ioaddr, int reg)
129#define SMC_inw(a, r) inw((a) + (r) - 0xa0000000) 133#define SMC_inw(a, r) inw((a) + (r) - 0xa0000000)
130#define SMC_inl(a, r) inl((a) + (r) - 0xa0000000) 134#define SMC_inl(a, r) inl((a) + (r) - 0xa0000000)
131#define SMC_outb(v, a, r) outb(v, (a) + (r) - 0xa0000000) 135#define SMC_outb(v, a, r) outb(v, (a) + (r) - 0xa0000000)
132#define SMC_outw(v, a, r) outw(v, (a) + (r) - 0xa0000000) 136#define SMC_outw(lp, v, a, r) outw(v, (a) + (r) - 0xa0000000)
133#define SMC_outl(v, a, r) outl(v, (a) + (r) - 0xa0000000) 137#define SMC_outl(v, a, r) outl(v, (a) + (r) - 0xa0000000)
134#define SMC_insl(a, r, p, l) insl((a) + (r) - 0xa0000000, p, l) 138#define SMC_insl(a, r, p, l) insl((a) + (r) - 0xa0000000, p, l)
135#define SMC_outsl(a, r, p, l) outsl((a) + (r) - 0xa0000000, p, l) 139#define SMC_outsl(a, r, p, l) outsl((a) + (r) - 0xa0000000, p, l)
@@ -147,7 +151,7 @@ static inline void __SMC_outw(u16 val, void __iomem *ioaddr, int reg)
147#define SMC_inb(a, r) inb(((u32)a) + (r)) 151#define SMC_inb(a, r) inb(((u32)a) + (r))
148#define SMC_inw(a, r) inw(((u32)a) + (r)) 152#define SMC_inw(a, r) inw(((u32)a) + (r))
149#define SMC_outb(v, a, r) outb(v, ((u32)a) + (r)) 153#define SMC_outb(v, a, r) outb(v, ((u32)a) + (r))
150#define SMC_outw(v, a, r) outw(v, ((u32)a) + (r)) 154#define SMC_outw(lp, v, a, r) outw(v, ((u32)a) + (r))
151#define SMC_insw(a, r, p, l) insw(((u32)a) + (r), p, l) 155#define SMC_insw(a, r, p, l) insw(((u32)a) + (r), p, l)
152#define SMC_outsw(a, r, p, l) outsw(((u32)a) + (r), p, l) 156#define SMC_outsw(a, r, p, l) outsw(((u32)a) + (r), p, l)
153 157
@@ -175,7 +179,7 @@ static inline void __SMC_outw(u16 val, void __iomem *ioaddr, int reg)
175#define SMC_inw(a, r) readw((a) + (r)) 179#define SMC_inw(a, r) readw((a) + (r))
176#define SMC_inl(a, r) readl((a) + (r)) 180#define SMC_inl(a, r) readl((a) + (r))
177#define SMC_outb(v, a, r) writeb(v, (a) + (r)) 181#define SMC_outb(v, a, r) writeb(v, (a) + (r))
178#define SMC_outw(v, a, r) writew(v, (a) + (r)) 182#define SMC_outw(lp, v, a, r) writew(v, (a) + (r))
179#define SMC_outl(v, a, r) writel(v, (a) + (r)) 183#define SMC_outl(v, a, r) writel(v, (a) + (r))
180#define SMC_insw(a, r, p, l) readsw((a) + (r), p, l) 184#define SMC_insw(a, r, p, l) readsw((a) + (r), p, l)
181#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l) 185#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l)
@@ -207,7 +211,7 @@ static inline void mcf_outsw(void *a, unsigned char *p, int l)
207} 211}
208 212
209#define SMC_inw(a, r) _swapw(readw((a) + (r))) 213#define SMC_inw(a, r) _swapw(readw((a) + (r)))
210#define SMC_outw(v, a, r) writew(_swapw(v), (a) + (r)) 214#define SMC_outw(lp, v, a, r) writew(_swapw(v), (a) + (r))
211#define SMC_insw(a, r, p, l) mcf_insw(a + r, p, l) 215#define SMC_insw(a, r, p, l) mcf_insw(a + r, p, l)
212#define SMC_outsw(a, r, p, l) mcf_outsw(a + r, p, l) 216#define SMC_outsw(a, r, p, l) mcf_outsw(a + r, p, l)
213 217
@@ -241,7 +245,7 @@ static inline void mcf_outsw(void *a, unsigned char *p, int l)
241#define SMC_inw(a, r) ioread16((a) + (r)) 245#define SMC_inw(a, r) ioread16((a) + (r))
242#define SMC_inl(a, r) ioread32((a) + (r)) 246#define SMC_inl(a, r) ioread32((a) + (r))
243#define SMC_outb(v, a, r) iowrite8(v, (a) + (r)) 247#define SMC_outb(v, a, r) iowrite8(v, (a) + (r))
244#define SMC_outw(v, a, r) iowrite16(v, (a) + (r)) 248#define SMC_outw(lp, v, a, r) iowrite16(v, (a) + (r))
245#define SMC_outl(v, a, r) iowrite32(v, (a) + (r)) 249#define SMC_outl(v, a, r) iowrite32(v, (a) + (r))
246#define SMC_insw(a, r, p, l) ioread16_rep((a) + (r), p, l) 250#define SMC_insw(a, r, p, l) ioread16_rep((a) + (r), p, l)
247#define SMC_outsw(a, r, p, l) iowrite16_rep((a) + (r), p, l) 251#define SMC_outsw(a, r, p, l) iowrite16_rep((a) + (r), p, l)
@@ -303,6 +307,8 @@ struct smc_local {
303 307
304 /* the low address lines on some platforms aren't connected... */ 308 /* the low address lines on some platforms aren't connected... */
305 int io_shift; 309 int io_shift;
310 /* on some platforms a u16 write must be 4-bytes aligned */
311 bool half_word_align4;
306 312
307 struct smc91x_platdata cfg; 313 struct smc91x_platdata cfg;
308}; 314};
@@ -457,7 +463,7 @@ smc_pxa_dma_insw(void __iomem *ioaddr, struct smc_local *lp, int reg, int dma,
457 463
458#if ! SMC_CAN_USE_16BIT 464#if ! SMC_CAN_USE_16BIT
459 465
460#define SMC_outw(x, ioaddr, reg) SMC_outw_b(x, ioaddr, reg) 466#define SMC_outw(lp, x, ioaddr, reg) SMC_outw_b(x, ioaddr, reg)
461#define SMC_inw(ioaddr, reg) SMC_inw_b(ioaddr, reg) 467#define SMC_inw(ioaddr, reg) SMC_inw_b(ioaddr, reg)
462#define SMC_insw(a, r, p, l) BUG() 468#define SMC_insw(a, r, p, l) BUG()
463#define SMC_outsw(a, r, p, l) BUG() 469#define SMC_outsw(a, r, p, l) BUG()
@@ -909,7 +915,7 @@ static const char * chip_ids[ 16 ] = {
909 else if (SMC_8BIT(lp)) \ 915 else if (SMC_8BIT(lp)) \
910 SMC_outb(x, ioaddr, PN_REG(lp)); \ 916 SMC_outb(x, ioaddr, PN_REG(lp)); \
911 else \ 917 else \
912 SMC_outw(x, ioaddr, PN_REG(lp)); \ 918 SMC_outw(lp, x, ioaddr, PN_REG(lp)); \
913 } while (0) 919 } while (0)
914 920
915#define SMC_GET_AR(lp) \ 921#define SMC_GET_AR(lp) \
@@ -937,7 +943,7 @@ static const char * chip_ids[ 16 ] = {
937 int __mask; \ 943 int __mask; \
938 local_irq_save(__flags); \ 944 local_irq_save(__flags); \
939 __mask = SMC_inw(ioaddr, INT_REG(lp)) & ~0xff; \ 945 __mask = SMC_inw(ioaddr, INT_REG(lp)) & ~0xff; \
940 SMC_outw(__mask | (x), ioaddr, INT_REG(lp)); \ 946 SMC_outw(lp, __mask | (x), ioaddr, INT_REG(lp)); \
941 local_irq_restore(__flags); \ 947 local_irq_restore(__flags); \
942 } \ 948 } \
943 } while (0) 949 } while (0)
@@ -951,7 +957,7 @@ static const char * chip_ids[ 16 ] = {
951 if (SMC_8BIT(lp)) \ 957 if (SMC_8BIT(lp)) \
952 SMC_outb(x, ioaddr, IM_REG(lp)); \ 958 SMC_outb(x, ioaddr, IM_REG(lp)); \
953 else \ 959 else \
954 SMC_outw((x) << 8, ioaddr, INT_REG(lp)); \ 960 SMC_outw(lp, (x) << 8, ioaddr, INT_REG(lp)); \
955 } while (0) 961 } while (0)
956 962
957#define SMC_CURRENT_BANK(lp) SMC_inw(ioaddr, BANK_SELECT) 963#define SMC_CURRENT_BANK(lp) SMC_inw(ioaddr, BANK_SELECT)
@@ -961,22 +967,22 @@ static const char * chip_ids[ 16 ] = {
961 if (SMC_MUST_ALIGN_WRITE(lp)) \ 967 if (SMC_MUST_ALIGN_WRITE(lp)) \
962 SMC_outl((x)<<16, ioaddr, 12<<SMC_IO_SHIFT); \ 968 SMC_outl((x)<<16, ioaddr, 12<<SMC_IO_SHIFT); \
963 else \ 969 else \
964 SMC_outw(x, ioaddr, BANK_SELECT); \ 970 SMC_outw(lp, x, ioaddr, BANK_SELECT); \
965 } while (0) 971 } while (0)
966 972
967#define SMC_GET_BASE(lp) SMC_inw(ioaddr, BASE_REG(lp)) 973#define SMC_GET_BASE(lp) SMC_inw(ioaddr, BASE_REG(lp))
968 974
969#define SMC_SET_BASE(lp, x) SMC_outw(x, ioaddr, BASE_REG(lp)) 975#define SMC_SET_BASE(lp, x) SMC_outw(lp, x, ioaddr, BASE_REG(lp))
970 976
971#define SMC_GET_CONFIG(lp) SMC_inw(ioaddr, CONFIG_REG(lp)) 977#define SMC_GET_CONFIG(lp) SMC_inw(ioaddr, CONFIG_REG(lp))
972 978
973#define SMC_SET_CONFIG(lp, x) SMC_outw(x, ioaddr, CONFIG_REG(lp)) 979#define SMC_SET_CONFIG(lp, x) SMC_outw(lp, x, ioaddr, CONFIG_REG(lp))
974 980
975#define SMC_GET_COUNTER(lp) SMC_inw(ioaddr, COUNTER_REG(lp)) 981#define SMC_GET_COUNTER(lp) SMC_inw(ioaddr, COUNTER_REG(lp))
976 982
977#define SMC_GET_CTL(lp) SMC_inw(ioaddr, CTL_REG(lp)) 983#define SMC_GET_CTL(lp) SMC_inw(ioaddr, CTL_REG(lp))
978 984
979#define SMC_SET_CTL(lp, x) SMC_outw(x, ioaddr, CTL_REG(lp)) 985#define SMC_SET_CTL(lp, x) SMC_outw(lp, x, ioaddr, CTL_REG(lp))
980 986
981#define SMC_GET_MII(lp) SMC_inw(ioaddr, MII_REG(lp)) 987#define SMC_GET_MII(lp) SMC_inw(ioaddr, MII_REG(lp))
982 988
@@ -987,20 +993,20 @@ static const char * chip_ids[ 16 ] = {
987 if (SMC_MUST_ALIGN_WRITE(lp)) \ 993 if (SMC_MUST_ALIGN_WRITE(lp)) \
988 SMC_outl((x)<<16, ioaddr, SMC_REG(lp, 8, 1)); \ 994 SMC_outl((x)<<16, ioaddr, SMC_REG(lp, 8, 1)); \
989 else \ 995 else \
990 SMC_outw(x, ioaddr, GP_REG(lp)); \ 996 SMC_outw(lp, x, ioaddr, GP_REG(lp)); \
991 } while (0) 997 } while (0)
992 998
993#define SMC_SET_MII(lp, x) SMC_outw(x, ioaddr, MII_REG(lp)) 999#define SMC_SET_MII(lp, x) SMC_outw(lp, x, ioaddr, MII_REG(lp))
994 1000
995#define SMC_GET_MIR(lp) SMC_inw(ioaddr, MIR_REG(lp)) 1001#define SMC_GET_MIR(lp) SMC_inw(ioaddr, MIR_REG(lp))
996 1002
997#define SMC_SET_MIR(lp, x) SMC_outw(x, ioaddr, MIR_REG(lp)) 1003#define SMC_SET_MIR(lp, x) SMC_outw(lp, x, ioaddr, MIR_REG(lp))
998 1004
999#define SMC_GET_MMU_CMD(lp) SMC_inw(ioaddr, MMU_CMD_REG(lp)) 1005#define SMC_GET_MMU_CMD(lp) SMC_inw(ioaddr, MMU_CMD_REG(lp))
1000 1006
1001#define SMC_SET_MMU_CMD(lp, x) SMC_outw(x, ioaddr, MMU_CMD_REG(lp)) 1007#define SMC_SET_MMU_CMD(lp, x) SMC_outw(lp, x, ioaddr, MMU_CMD_REG(lp))
1002 1008
1003#define SMC_GET_FIFO(lp) SMC_inw(ioaddr, FIFO_REG(lp)) 1009#define SMC_GET_FIFO(lp) SMC_inw(ioaddr, FIFO_REG(lp))
1004 1010
1005#define SMC_GET_PTR(lp) SMC_inw(ioaddr, PTR_REG(lp)) 1011#define SMC_GET_PTR(lp) SMC_inw(ioaddr, PTR_REG(lp))
1006 1012
@@ -1009,14 +1015,14 @@ static const char * chip_ids[ 16 ] = {
1009 if (SMC_MUST_ALIGN_WRITE(lp)) \ 1015 if (SMC_MUST_ALIGN_WRITE(lp)) \
1010 SMC_outl((x)<<16, ioaddr, SMC_REG(lp, 4, 2)); \ 1016 SMC_outl((x)<<16, ioaddr, SMC_REG(lp, 4, 2)); \
1011 else \ 1017 else \
1012 SMC_outw(x, ioaddr, PTR_REG(lp)); \ 1018 SMC_outw(lp, x, ioaddr, PTR_REG(lp)); \
1013 } while (0) 1019 } while (0)
1014 1020
1015#define SMC_GET_EPH_STATUS(lp) SMC_inw(ioaddr, EPH_STATUS_REG(lp)) 1021#define SMC_GET_EPH_STATUS(lp) SMC_inw(ioaddr, EPH_STATUS_REG(lp))
1016 1022
1017#define SMC_GET_RCR(lp) SMC_inw(ioaddr, RCR_REG(lp)) 1023#define SMC_GET_RCR(lp) SMC_inw(ioaddr, RCR_REG(lp))
1018 1024
1019#define SMC_SET_RCR(lp, x) SMC_outw(x, ioaddr, RCR_REG(lp)) 1025#define SMC_SET_RCR(lp, x) SMC_outw(lp, x, ioaddr, RCR_REG(lp))
1020 1026
1021#define SMC_GET_REV(lp) SMC_inw(ioaddr, REV_REG(lp)) 1027#define SMC_GET_REV(lp) SMC_inw(ioaddr, REV_REG(lp))
1022 1028
@@ -1027,12 +1033,12 @@ static const char * chip_ids[ 16 ] = {
1027 if (SMC_MUST_ALIGN_WRITE(lp)) \ 1033 if (SMC_MUST_ALIGN_WRITE(lp)) \
1028 SMC_outl((x)<<16, ioaddr, SMC_REG(lp, 8, 0)); \ 1034 SMC_outl((x)<<16, ioaddr, SMC_REG(lp, 8, 0)); \
1029 else \ 1035 else \
1030 SMC_outw(x, ioaddr, RPC_REG(lp)); \ 1036 SMC_outw(lp, x, ioaddr, RPC_REG(lp)); \
1031 } while (0) 1037 } while (0)
1032 1038
1033#define SMC_GET_TCR(lp) SMC_inw(ioaddr, TCR_REG(lp)) 1039#define SMC_GET_TCR(lp) SMC_inw(ioaddr, TCR_REG(lp))
1034 1040
1035#define SMC_SET_TCR(lp, x) SMC_outw(x, ioaddr, TCR_REG(lp)) 1041#define SMC_SET_TCR(lp, x) SMC_outw(lp, x, ioaddr, TCR_REG(lp))
1036 1042
1037#ifndef SMC_GET_MAC_ADDR 1043#ifndef SMC_GET_MAC_ADDR
1038#define SMC_GET_MAC_ADDR(lp, addr) \ 1044#define SMC_GET_MAC_ADDR(lp, addr) \
@@ -1049,18 +1055,18 @@ static const char * chip_ids[ 16 ] = {
1049 1055
1050#define SMC_SET_MAC_ADDR(lp, addr) \ 1056#define SMC_SET_MAC_ADDR(lp, addr) \
1051 do { \ 1057 do { \
1052 SMC_outw(addr[0]|(addr[1] << 8), ioaddr, ADDR0_REG(lp)); \ 1058 SMC_outw(lp, addr[0] | (addr[1] << 8), ioaddr, ADDR0_REG(lp)); \
1053 SMC_outw(addr[2]|(addr[3] << 8), ioaddr, ADDR1_REG(lp)); \ 1059 SMC_outw(lp, addr[2] | (addr[3] << 8), ioaddr, ADDR1_REG(lp)); \
1054 SMC_outw(addr[4]|(addr[5] << 8), ioaddr, ADDR2_REG(lp)); \ 1060 SMC_outw(lp, addr[4] | (addr[5] << 8), ioaddr, ADDR2_REG(lp)); \
1055 } while (0) 1061 } while (0)
1056 1062
1057#define SMC_SET_MCAST(lp, x) \ 1063#define SMC_SET_MCAST(lp, x) \
1058 do { \ 1064 do { \
1059 const unsigned char *mt = (x); \ 1065 const unsigned char *mt = (x); \
1060 SMC_outw(mt[0] | (mt[1] << 8), ioaddr, MCAST_REG1(lp)); \ 1066 SMC_outw(lp, mt[0] | (mt[1] << 8), ioaddr, MCAST_REG1(lp)); \
1061 SMC_outw(mt[2] | (mt[3] << 8), ioaddr, MCAST_REG2(lp)); \ 1067 SMC_outw(lp, mt[2] | (mt[3] << 8), ioaddr, MCAST_REG2(lp)); \
1062 SMC_outw(mt[4] | (mt[5] << 8), ioaddr, MCAST_REG3(lp)); \ 1068 SMC_outw(lp, mt[4] | (mt[5] << 8), ioaddr, MCAST_REG3(lp)); \
1063 SMC_outw(mt[6] | (mt[7] << 8), ioaddr, MCAST_REG4(lp)); \ 1069 SMC_outw(lp, mt[6] | (mt[7] << 8), ioaddr, MCAST_REG4(lp)); \
1064 } while (0) 1070 } while (0)
1065 1071
1066#define SMC_PUT_PKT_HDR(lp, status, length) \ 1072#define SMC_PUT_PKT_HDR(lp, status, length) \
@@ -1069,8 +1075,8 @@ static const char * chip_ids[ 16 ] = {
1069 SMC_outl((status) | (length)<<16, ioaddr, \ 1075 SMC_outl((status) | (length)<<16, ioaddr, \
1070 DATA_REG(lp)); \ 1076 DATA_REG(lp)); \
1071 else { \ 1077 else { \
1072 SMC_outw(status, ioaddr, DATA_REG(lp)); \ 1078 SMC_outw(lp, status, ioaddr, DATA_REG(lp)); \
1073 SMC_outw(length, ioaddr, DATA_REG(lp)); \ 1079 SMC_outw(lp, length, ioaddr, DATA_REG(lp)); \
1074 } \ 1080 } \
1075 } while (0) 1081 } while (0)
1076 1082