Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arcnet: com20020: Use arcnet_<I/O> routines

Simplify and make consistent the current uses of inb/outb
by using the newly introduced arcnet_<I/O> equivalents.

o Add new #defines for register offsets
There is an register offset, 8, that is unnamed and used as-is.
o Remove old #defines that included the ioaddr
o Remove obfuscating macros by expanding them in-place where appropriate
o Create static inline com20020_set_subaddress for the SET_SUBADR macro

There is an unused arcnet config entry CONFIGSA100_CT6001 which added a
special #define BUS_ALIGN which was introduced but never used in fullhist git
tree commit 22cfce4b82b0 ("[ARCNET]: Fixes.") in Nov 2004 for Linux v2.6.10.

This BUS_ALIGN #define tries to allow 8 bit devices to work on a 16 bit
bus by aligning addresses to 16 bit boundaries.

Move this currently unused CONFIG_SA1100_CT6001 BUS_ALIGN macro from
com20020.h to arcdevice.h.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>

authored by

Joe Perches and committed by
Michael Grzeschik
0fec6513 e5fcfc1f

+114 -122
+14 -8
drivers/net/arcnet/arcdevice.h
··· 344 344 345 345 /* I/O equivalents */ 346 346 347 + #ifdef CONFIG_SA1100_CT6001 348 + #define BUS_ALIGN 2 /* 8 bit device on a 16 bit bus - needs padding */ 349 + #else 350 + #define BUS_ALIGN 1 351 + #endif 352 + 347 353 /* addr and offset allow register like names to define the actual IO address. 348 354 * A configuration option multiplies the offset for alignment. 349 355 */ 350 356 #define arcnet_inb(addr, offset) \ 351 - inb((addr) + (offset)) 357 + inb((addr) + BUS_ALIGN * (offset)) 352 358 #define arcnet_outb(value, addr, offset) \ 353 - outb(value, (addr) + (offset)) 359 + outb(value, (addr) + BUS_ALIGN * (offset)) 354 360 355 361 #define arcnet_insb(addr, offset, buffer, count) \ 356 - insb((addr) + (offset), buffer, count) 362 + insb((addr) + BUS_ALIGN * (offset), buffer, count) 357 363 #define arcnet_outsb(addr, offset, buffer, count) \ 358 - outsb((addr) + (offset), buffer, count) 364 + outsb((addr) + BUS_ALIGN * (offset), buffer, count) 359 365 360 366 #define arcnet_inw(addr, offset) \ 361 - inw((addr) + (offset)) 367 + inw((addr) + BUS_ALIGN * (offset)) 362 368 #define arcnet_outw(value, addr, offset) \ 363 - outw(value, (addr) + (offset)) 369 + outw(value, (addr) + BUS_ALIGN * (offset)) 364 370 365 371 #define arcnet_insw(addr, offset, buffer, count) \ 366 - insw((addr) + (offset), buffer, count) 372 + insw((addr) + BUS_ALIGN * (offset), buffer, count) 367 373 #define arcnet_outsw(addr, offset, buffer, count) \ 368 - outsw((addr) + (offset), buffer, count) 374 + outsw((addr) + BUS_ALIGN * (offset), buffer, count) 369 375 370 376 #endif /* __KERNEL__ */ 371 377 #endif /* _LINUX_ARCDEVICE_H */
+7 -7
drivers/net/arcnet/com20020-isa.c
··· 67 67 ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1); 68 68 return -ENXIO; 69 69 } 70 - if (ASTATUS() == 0xFF) { 70 + if (arcnet_inb(ioaddr, COM20020_REG_R_STATUS) == 0xFF) { 71 71 arc_printk(D_NORMAL, dev, "IO address %x empty\n", ioaddr); 72 72 err = -ENODEV; 73 73 goto out; ··· 83 83 * we tell it to start receiving. 84 84 */ 85 85 arc_printk(D_INIT_REASONS, dev, "intmask was %02Xh\n", 86 - inb(_INTMASK)); 87 - outb(0, _INTMASK); 86 + arcnet_inb(ioaddr, COM20020_REG_R_STATUS)); 87 + arcnet_outb(0, ioaddr, COM20020_REG_W_INTMASK); 88 88 airqmask = probe_irq_on(); 89 - outb(NORXflag, _INTMASK); 89 + arcnet_outb(NORXflag, ioaddr, COM20020_REG_W_INTMASK); 90 90 udelay(1); 91 - outb(0, _INTMASK); 91 + arcnet_outb(0, ioaddr, COM20020_REG_W_INTMASK); 92 92 dev->irq = probe_irq_off(airqmask); 93 93 94 94 if ((int)dev->irq <= 0) { 95 95 arc_printk(D_INIT_REASONS, dev, "Autoprobe IRQ failed first time\n"); 96 96 airqmask = probe_irq_on(); 97 - outb(NORXflag, _INTMASK); 97 + arcnet_outb(NORXflag, ioaddr, COM20020_REG_W_INTMASK); 98 98 udelay(5); 99 - outb(0, _INTMASK); 99 + arcnet_outb(0, ioaddr, COM20020_REG_W_INTMASK); 100 100 dev->irq = probe_irq_off(airqmask); 101 101 if ((int)dev->irq <= 0) { 102 102 arc_printk(D_NORMAL, dev, "Autoprobe IRQ failed.\n");
+3 -3
drivers/net/arcnet/com20020-pci.c
··· 117 117 * ARCNET controller needs 118 118 * this access to detect bustype 119 119 */ 120 - outb(0x00, ioaddr + 1); 121 - inb(ioaddr + 1); 120 + arcnet_outb(0x00, ioaddr, COM20020_REG_W_COMMAND); 121 + arcnet_inb(ioaddr, COM20020_REG_R_DIAGSTAT); 122 122 123 123 dev->base_addr = ioaddr; 124 124 dev->dev_addr[0] = node; ··· 131 131 lp->timeout = timeout; 132 132 lp->hw.owner = THIS_MODULE; 133 133 134 - if (ASTATUS() == 0xFF) { 134 + if (arcnet_inb(ioaddr, COM20020_REG_R_STATUS) == 0xFF) { 135 135 pr_err("IO address %Xh is empty!\n", ioaddr); 136 136 ret = -EIO; 137 137 goto out_port;
+57 -46
drivers/net/arcnet/com20020.c
··· 65 65 int ioaddr = dev->base_addr, ofs = 512 * bufnum + offset; 66 66 67 67 /* set up the address register */ 68 - outb((ofs >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); 69 - outb(ofs & 0xff, _ADDR_LO); 68 + arcnet_outb((ofs >> 8) | RDDATAflag | AUTOINCflag, 69 + ioaddr, COM20020_REG_W_ADDR_HI); 70 + arcnet_outb(ofs & 0xff, ioaddr, COM20020_REG_W_ADDR_LO); 70 71 71 72 /* copy the data */ 72 - TIME(dev, "insb", count, insb(_MEMDATA, buf, count)); 73 + TIME(dev, "insb", count, 74 + arcnet_insb(ioaddr, COM20020_REG_RW_MEMDATA, buf, count)); 73 75 } 74 76 75 77 static void com20020_copy_to_card(struct net_device *dev, int bufnum, ··· 80 78 int ioaddr = dev->base_addr, ofs = 512 * bufnum + offset; 81 79 82 80 /* set up the address register */ 83 - outb((ofs >> 8) | AUTOINCflag, _ADDR_HI); 84 - outb(ofs & 0xff, _ADDR_LO); 81 + arcnet_outb((ofs >> 8) | AUTOINCflag, ioaddr, COM20020_REG_W_ADDR_HI); 82 + arcnet_outb(ofs & 0xff, ioaddr, COM20020_REG_W_ADDR_LO); 85 83 86 84 /* copy the data */ 87 - TIME(dev, "outsb", count, outsb(_MEMDATA, buf, count)); 85 + TIME(dev, "outsb", count, 86 + arcnet_outsb(ioaddr, COM20020_REG_RW_MEMDATA, buf, count)); 88 87 } 89 88 90 89 /* Reset the card and check some basic stuff during the detection stage. */ ··· 94 91 int ioaddr = dev->base_addr, status; 95 92 struct arcnet_local *lp = netdev_priv(dev); 96 93 97 - ARCRESET0; 94 + arcnet_outb(0x18 | 0x80, ioaddr, COM20020_REG_W_CONFIG); 95 + udelay(5); 96 + arcnet_outb(0x18 , ioaddr, COM20020_REG_W_CONFIG); 98 97 mdelay(RESETtime); 99 98 100 99 lp->setup = lp->clockm ? 0 : (lp->clockp << 1); ··· 106 101 /* Enable P1Mode for backplane mode */ 107 102 lp->setup = lp->setup | P1MODE; 108 103 109 - SET_SUBADR(SUB_SETUP1); 110 - outb(lp->setup, _XREG); 104 + com20020_set_subaddress(lp, ioaddr, SUB_SETUP1); 105 + arcnet_outb(lp->setup, ioaddr, COM20020_REG_W_XREG); 111 106 112 107 if (lp->clockm != 0) { 113 - SET_SUBADR(SUB_SETUP2); 114 - outb(lp->setup2, _XREG); 108 + com20020_set_subaddress(lp, ioaddr, SUB_SETUP2); 109 + arcnet_outb(lp->setup2, ioaddr, COM20020_REG_W_XREG); 115 110 116 111 /* must now write the magic "restart operation" command */ 117 112 mdelay(1); 118 - outb(0x18, _COMMAND); 113 + arcnet_outb(0x18, ioaddr, COM20020_REG_W_COMMAND); 119 114 } 120 115 121 116 lp->config = 0x21 | (lp->timeout << 3) | (lp->backplane << 2); 122 117 /* set node ID to 0x42 (but transmitter is disabled, so it's okay) */ 123 - SETCONF; 124 - outb(0x42, ioaddr + BUS_ALIGN * 7); 118 + arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG); 119 + arcnet_outb(0x42, ioaddr, COM20020_REG_W_XREG); 125 120 126 - status = ASTATUS(); 121 + status = arcnet_inb(ioaddr, COM20020_REG_R_STATUS); 127 122 128 123 if ((status & 0x99) != (NORXflag | TXFREEflag | RESETflag)) { 129 124 arc_printk(D_NORMAL, dev, "status invalid (%Xh).\n", status); ··· 132 127 arc_printk(D_INIT_REASONS, dev, "status after reset: %X\n", status); 133 128 134 129 /* Enable TX */ 135 - outb(0x39, _CONFIG); 136 - outb(inb(ioaddr + BUS_ALIGN * 8), ioaddr + BUS_ALIGN * 7); 130 + arcnet_outb(0x39, ioaddr, COM20020_REG_W_CONFIG); 131 + arcnet_outb(arcnet_inb(ioaddr, 8), ioaddr, COM20020_REG_W_XREG); 137 132 138 - ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear); 139 - 140 - status = ASTATUS(); 133 + arcnet_outb(CFLAGScmd | RESETclear | CONFIGclear, 134 + ioaddr, COM20020_REG_W_COMMAND); 135 + status = arcnet_inb(ioaddr, COM20020_REG_R_STATUS); 141 136 arc_printk(D_INIT_REASONS, dev, "status after reset acknowledged: %X\n", 142 137 status); 143 138 144 139 /* Read first location of memory */ 145 - outb(0 | RDDATAflag | AUTOINCflag, _ADDR_HI); 146 - outb(0, _ADDR_LO); 140 + arcnet_outb(0 | RDDATAflag | AUTOINCflag, 141 + ioaddr, COM20020_REG_W_ADDR_HI); 142 + arcnet_outb(0, ioaddr, COM20020_REG_W_ADDR_LO); 147 143 148 - status = inb(_MEMDATA); 144 + status = arcnet_inb(ioaddr, COM20020_REG_RW_MEMDATA); 149 145 if (status != TESTvalue) { 150 146 arc_printk(D_NORMAL, dev, "Signature byte not found (%02Xh != D1h).\n", 151 147 status); ··· 162 156 struct sockaddr *hwaddr = addr; 163 157 164 158 memcpy(dev->dev_addr, hwaddr->sa_data, 1); 165 - SET_SUBADR(SUB_NODE); 166 - outb(dev->dev_addr[0], _XREG); 159 + com20020_set_subaddress(lp, ioaddr, SUB_NODE); 160 + arcnet_outb(dev->dev_addr[0], ioaddr, COM20020_REG_W_XREG); 167 161 168 162 return 0; 169 163 } ··· 200 194 201 195 /* FIXME: do this some other way! */ 202 196 if (!dev->dev_addr[0]) 203 - dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN * 8); 197 + dev->dev_addr[0] = arcnet_inb(ioaddr, 8); 204 198 205 - SET_SUBADR(SUB_SETUP1); 206 - outb(lp->setup, _XREG); 199 + com20020_set_subaddress(lp, ioaddr, SUB_SETUP1); 200 + arcnet_outb(lp->setup, ioaddr, COM20020_REG_W_XREG); 207 201 208 202 if (lp->card_flags & ARC_CAN_10MBIT) { 209 - SET_SUBADR(SUB_SETUP2); 210 - outb(lp->setup2, _XREG); 203 + com20020_set_subaddress(lp, ioaddr, SUB_SETUP2); 204 + arcnet_outb(lp->setup2, ioaddr, COM20020_REG_W_XREG); 211 205 212 206 /* must now write the magic "restart operation" command */ 213 207 mdelay(1); 214 - outb(0x18, _COMMAND); 208 + arcnet_outb(0x18, ioaddr, COM20020_REG_W_COMMAND); 215 209 } 216 210 217 211 lp->config = 0x20 | (lp->timeout << 3) | (lp->backplane << 2) | 1; 218 212 /* Default 0x38 + register: Node ID */ 219 - SETCONF; 220 - outb(dev->dev_addr[0], _XREG); 213 + arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG); 214 + arcnet_outb(dev->dev_addr[0], ioaddr, COM20020_REG_W_XREG); 221 215 222 216 /* reserve the irq */ 223 217 if (request_irq(dev->irq, arcnet_interrupt, shared, ··· 270 264 arc_printk(D_DEBUG, dev, "%s: %d: %s: dev: %p, lp: %p, dev->name: %s\n", 271 265 __FILE__, __LINE__, __func__, dev, lp, dev->name); 272 266 arc_printk(D_INIT, dev, "Resetting %s (status=%02Xh)\n", 273 - dev->name, ASTATUS()); 267 + dev->name, arcnet_inb(ioaddr, COM20020_REG_R_STATUS)); 274 268 275 269 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 276 270 lp->config = TXENcfg | (lp->timeout << 3) | (lp->backplane << 2); 277 271 /* power-up defaults */ 278 - SETCONF; 272 + arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG); 279 273 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 280 274 281 275 if (really_reset) { 282 276 /* reset the card */ 283 - ARCRESET; 277 + arcnet_outb(lp->config | 0x80, ioaddr, COM20020_REG_W_CONFIG); 278 + udelay(5); 279 + arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG); 284 280 mdelay(RESETtime * 2); 285 281 /* COM20020 seems to be slower sometimes */ 286 282 } 287 283 /* clear flags & end reset */ 288 284 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 289 - ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear); 285 + arcnet_outb(CFLAGScmd | RESETclear | CONFIGclear, 286 + ioaddr, COM20020_REG_W_COMMAND); 290 287 291 288 /* verify that the ARCnet signature byte is present */ 292 289 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__); ··· 303 294 return 1; 304 295 } 305 296 /* enable extended (512-byte) packets */ 306 - ACOMMAND(CONFIGcmd | EXTconf); 297 + arcnet_outb(CONFIGcmd | EXTconf, ioaddr, COM20020_REG_W_COMMAND); 298 + 307 299 arc_printk(D_DEBUG, dev, "%s: %d: %s\n", __FILE__, __LINE__, __func__); 308 300 309 301 /* done! return success. */ ··· 316 306 u_int ioaddr = dev->base_addr; 317 307 318 308 arc_printk(D_DURING, dev, "Setting mask to %x at %x\n", mask, ioaddr); 319 - AINTMASK(mask); 309 + arcnet_outb(mask, ioaddr, COM20020_REG_W_INTMASK); 320 310 } 321 311 322 312 static void com20020_command(struct net_device *dev, int cmd) 323 313 { 324 314 u_int ioaddr = dev->base_addr; 325 315 326 - ACOMMAND(cmd); 316 + arcnet_outb(cmd, ioaddr, COM20020_REG_W_COMMAND); 327 317 } 328 318 329 319 static int com20020_status(struct net_device *dev) 330 320 { 331 321 u_int ioaddr = dev->base_addr; 332 322 333 - return ASTATUS() + (ADIAGSTATUS() << 8); 323 + return arcnet_inb(ioaddr, COM20020_REG_R_STATUS) + 324 + (arcnet_inb(ioaddr, COM20020_REG_R_DIAGSTAT) << 8); 334 325 } 335 326 336 327 static void com20020_close(struct net_device *dev) ··· 341 330 342 331 /* disable transmitter */ 343 332 lp->config &= ~TXENcfg; 344 - SETCONF; 333 + arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG); 345 334 } 346 335 347 336 /* Set or clear the multicast filter for this adaptor. ··· 360 349 /* Enable promiscuous mode */ 361 350 if (!(lp->setup & PROMISCset)) 362 351 arc_printk(D_NORMAL, dev, "Setting promiscuous flag...\n"); 363 - SET_SUBADR(SUB_SETUP1); 352 + com20020_set_subaddress(lp, ioaddr, SUB_SETUP1); 364 353 lp->setup |= PROMISCset; 365 - outb(lp->setup, _XREG); 354 + arcnet_outb(lp->setup, ioaddr, COM20020_REG_W_XREG); 366 355 } else { 367 356 /* Disable promiscuous mode, use normal mode */ 368 357 if ((lp->setup & PROMISCset)) 369 358 arc_printk(D_NORMAL, dev, "Resetting promiscuous flag...\n"); 370 - SET_SUBADR(SUB_SETUP1); 359 + com20020_set_subaddress(lp, ioaddr, SUB_SETUP1); 371 360 lp->setup &= ~PROMISCset; 372 - outb(lp->setup, _XREG); 361 + arcnet_outb(lp->setup, ioaddr, COM20020_REG_W_XREG); 373 362 } 374 363 } 375 364
+23 -51
drivers/net/arcnet/com20020.h
··· 1 1 /* 2 2 * Linux ARCnet driver - COM20020 chipset support - function declarations 3 - * 3 + * 4 4 * Written 1997 by David Woodhouse. 5 5 * Written 1994-1999 by Avery Pennarun. 6 6 * Derived from skeleton.c by Donald Becker. ··· 34 34 /* The number of low I/O ports used by the card. */ 35 35 #define ARCNET_TOTAL_SIZE 8 36 36 37 - /* various register addresses */ 38 - #ifdef CONFIG_SA1100_CT6001 39 - #define BUS_ALIGN 2 /* 8 bit device on a 16 bit bus - needs padding */ 40 - #else 41 - #define BUS_ALIGN 1 42 - #endif 43 - 44 37 #define PLX_PCI_MAX_CARDS 2 45 38 46 39 struct com20020_pci_channel_map { ··· 64 71 int index; 65 72 }; 66 73 67 - #define _INTMASK (ioaddr+BUS_ALIGN*0) /* writable */ 68 - #define _STATUS (ioaddr+BUS_ALIGN*0) /* readable */ 69 - #define _COMMAND (ioaddr+BUS_ALIGN*1) /* standard arcnet commands */ 70 - #define _DIAGSTAT (ioaddr+BUS_ALIGN*1) /* diagnostic status register */ 71 - #define _ADDR_HI (ioaddr+BUS_ALIGN*2) /* control registers for IO-mapped memory */ 72 - #define _ADDR_LO (ioaddr+BUS_ALIGN*3) 73 - #define _MEMDATA (ioaddr+BUS_ALIGN*4) /* data port for IO-mapped memory */ 74 - #define _SUBADR (ioaddr+BUS_ALIGN*5) /* the extended port _XREG refers to */ 75 - #define _CONFIG (ioaddr+BUS_ALIGN*6) /* configuration register */ 76 - #define _XREG (ioaddr+BUS_ALIGN*7) /* extra registers (indexed by _CONFIG 77 - or _SUBADR) */ 74 + #define COM20020_REG_W_INTMASK 0 /* writable */ 75 + #define COM20020_REG_R_STATUS 0 /* readable */ 76 + #define COM20020_REG_W_COMMAND 1 /* standard arcnet commands */ 77 + #define COM20020_REG_R_DIAGSTAT 1 /* diagnostic status */ 78 + #define COM20020_REG_W_ADDR_HI 2 /* control for IO-mapped memory */ 79 + #define COM20020_REG_W_ADDR_LO 3 80 + #define COM20020_REG_RW_MEMDATA 4 /* data port for IO-mapped memory */ 81 + #define COM20020_REG_W_SUBADR 5 /* the extended port _XREG refers to */ 82 + #define COM20020_REG_W_CONFIG 6 /* configuration */ 83 + #define COM20020_REG_W_XREG 7 /* extra 84 + * (indexed by _CONFIG or _SUBADDR) 85 + */ 78 86 79 87 /* in the ADDR_HI register */ 80 88 #define RDDATAflag 0x80 /* next access is a read (not a write) */ ··· 103 109 #define SUB_BUSCTL 5 /* bus control options */ 104 110 #define SUB_DMACOUNT 6 /* DMA count options */ 105 111 106 - #define SET_SUBADR(x) do { \ 107 - if ((x) < 4) \ 108 - { \ 109 - lp->config = (lp->config & ~0x03) | (x); \ 110 - SETCONF; \ 111 - } \ 112 - else \ 113 - { \ 114 - outb(x, _SUBADR); \ 115 - } \ 116 - } while (0) 117 - 118 - #undef ARCRESET 119 - #undef ASTATUS 120 - #undef ACOMMAND 121 - #undef AINTMASK 122 - 123 - #define ARCRESET { outb(lp->config | 0x80, _CONFIG); \ 124 - udelay(5); \ 125 - outb(lp->config , _CONFIG); \ 126 - } 127 - #define ARCRESET0 { outb(0x18 | 0x80, _CONFIG); \ 128 - udelay(5); \ 129 - outb(0x18 , _CONFIG); \ 130 - } 131 - 132 - #define ASTATUS() inb(_STATUS) 133 - #define ADIAGSTATUS() inb(_DIAGSTAT) 134 - #define ACOMMAND(cmd) outb((cmd),_COMMAND) 135 - #define AINTMASK(msk) outb((msk),_INTMASK) 136 - 137 - #define SETCONF outb(lp->config, _CONFIG) 112 + static inline void com20020_set_subaddress(struct arcnet_local *lp, 113 + int ioaddr, int val) 114 + { 115 + if (val < 4) { 116 + lp->config = (lp->config & ~0x03) | val; 117 + arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG); 118 + } else { 119 + arcnet_outb(val, ioaddr, COM20020_REG_W_SUBADR); 120 + } 121 + } 138 122 139 123 #endif /* __COM20020_H */
+10 -7
drivers/net/arcnet/com20020_cs.c
··· 56 56 int count; 57 57 58 58 netdev_dbg(dev, "register dump:\n"); 59 - for (count = ioaddr; count < ioaddr + 16; count++) { 59 + for (count = 0; count < 16; count++) { 60 60 if (!(count % 16)) 61 - pr_cont("%04X:", count); 62 - pr_cont(" %02X", inb(count)); 61 + pr_cont("%04X:", ioaddr + count); 62 + pr_cont(" %02X", arcnet_inb(ioaddr, count)); 63 63 } 64 64 pr_cont("\n"); 65 65 66 66 netdev_dbg(dev, "buffer0 dump:\n"); 67 67 /* set up the address register */ 68 68 count = 0; 69 - outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); 70 - outb(count & 0xff, _ADDR_LO); 69 + arcnet_outb((count >> 8) | RDDATAflag | AUTOINCflag, 70 + ioaddr, com20020_REG_W_ADDR_HI); 71 + arcnet_outb(count & 0xff, ioaddr, COM20020_REG_W_ADDR_LO); 71 72 72 73 for (count = 0; count < 256 + 32; count++) { 73 74 if (!(count % 16)) 74 75 pr_cont("%04X:", count); 75 76 76 77 /* copy the data */ 77 - pr_cont(" %02X", inb(_MEMDATA)); 78 + pr_cont(" %02X", arcnet_inb(ioaddr, COM20020_REG_RW_MEMDATA)); 78 79 } 79 80 pr_cont("\n"); 80 81 #endif ··· 293 292 int ioaddr = dev->base_addr; 294 293 struct arcnet_local *lp = netdev_priv(dev); 295 294 296 - ARCRESET; 295 + arcnet_outb(lp->config | 0x80, ioaddr, COM20020_REG_W_CONFIG); 296 + udelay(5); 297 + arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG); 297 298 } 298 299 299 300 return 0;