diff options
author | Joe Perches <joe@perches.com> | 2015-05-05 10:06:05 -0700 |
---|---|---|
committer | Michael Grzeschik <m.grzeschik@pengutronix.de> | 2015-09-23 08:44:26 +0200 |
commit | e5fcfc1f8d3cfaf432a93d39df3e5d7718c58848 (patch) | |
tree | 554a74f45005628e2e5fe7eede627bcc677d0a9f /drivers/net/arcnet | |
parent | 4e299b922c44d242ac855805aee94d938b06944f (diff) |
arcnet: Add arcnet_<I/O> macros
arcnet uses an I/O scheme which can align I/O addresses to word boundaries
on different architectures.
Add arcnet specific macros which can hide this alignment calculation.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Diffstat (limited to 'drivers/net/arcnet')
-rw-r--r-- | drivers/net/arcnet/arcdevice.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/arcnet/arcdevice.h b/drivers/net/arcnet/arcdevice.h index 9ca135d0f114..95e7ed6781c3 100644 --- a/drivers/net/arcnet/arcdevice.h +++ b/drivers/net/arcnet/arcdevice.h @@ -342,5 +342,30 @@ netdev_tx_t arcnet_send_packet(struct sk_buff *skb, struct net_device *dev); void arcnet_timeout(struct net_device *dev); +/* I/O equivalents */ + +/* addr and offset allow register like names to define the actual IO address. + * A configuration option multiplies the offset for alignment. + */ +#define arcnet_inb(addr, offset) \ + inb((addr) + (offset)) +#define arcnet_outb(value, addr, offset) \ + outb(value, (addr) + (offset)) + +#define arcnet_insb(addr, offset, buffer, count) \ + insb((addr) + (offset), buffer, count) +#define arcnet_outsb(addr, offset, buffer, count) \ + outsb((addr) + (offset), buffer, count) + +#define arcnet_inw(addr, offset) \ + inw((addr) + (offset)) +#define arcnet_outw(value, addr, offset) \ + outw(value, (addr) + (offset)) + +#define arcnet_insw(addr, offset, buffer, count) \ + insw((addr) + (offset), buffer, count) +#define arcnet_outsw(addr, offset, buffer, count) \ + outsw((addr) + (offset), buffer, count) + #endif /* __KERNEL__ */ #endif /* _LINUX_ARCDEVICE_H */ |