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>
This commit is contained in:

committed by
Michael Grzeschik

parent
e5fcfc1f8d
commit
0fec65130b
@@ -56,25 +56,26 @@ static void regdump(struct net_device *dev)
|
||||
int count;
|
||||
|
||||
netdev_dbg(dev, "register dump:\n");
|
||||
for (count = ioaddr; count < ioaddr + 16; count++) {
|
||||
for (count = 0; count < 16; count++) {
|
||||
if (!(count % 16))
|
||||
pr_cont("%04X:", count);
|
||||
pr_cont(" %02X", inb(count));
|
||||
pr_cont("%04X:", ioaddr + count);
|
||||
pr_cont(" %02X", arcnet_inb(ioaddr, count));
|
||||
}
|
||||
pr_cont("\n");
|
||||
|
||||
netdev_dbg(dev, "buffer0 dump:\n");
|
||||
/* set up the address register */
|
||||
count = 0;
|
||||
outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI);
|
||||
outb(count & 0xff, _ADDR_LO);
|
||||
arcnet_outb((count >> 8) | RDDATAflag | AUTOINCflag,
|
||||
ioaddr, com20020_REG_W_ADDR_HI);
|
||||
arcnet_outb(count & 0xff, ioaddr, COM20020_REG_W_ADDR_LO);
|
||||
|
||||
for (count = 0; count < 256 + 32; count++) {
|
||||
if (!(count % 16))
|
||||
pr_cont("%04X:", count);
|
||||
|
||||
/* copy the data */
|
||||
pr_cont(" %02X", inb(_MEMDATA));
|
||||
pr_cont(" %02X", arcnet_inb(ioaddr, COM20020_REG_RW_MEMDATA));
|
||||
}
|
||||
pr_cont("\n");
|
||||
#endif
|
||||
@@ -292,7 +293,9 @@ static int com20020_resume(struct pcmcia_device *link)
|
||||
int ioaddr = dev->base_addr;
|
||||
struct arcnet_local *lp = netdev_priv(dev);
|
||||
|
||||
ARCRESET;
|
||||
arcnet_outb(lp->config | 0x80, ioaddr, COM20020_REG_W_CONFIG);
|
||||
udelay(5);
|
||||
arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user