[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1442912534-10821-21-git-send-email-m.grzeschik@pengutronix.de>
Date: Tue, 22 Sep 2015 11:02:01 +0200
From: Michael Grzeschik <m.grzeschik@...gutronix.de>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, joe@...ches.com, kernel@...gutronix.de
Subject: [PATCH 20/33] arcnet: Add arcnet_<I/O> macros
From: Joe Perches <joe@...ches.com>
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@...ches.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@...gutronix.de>
---
drivers/net/arcnet/arcdevice.h | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/net/arcnet/arcdevice.h b/drivers/net/arcnet/arcdevice.h
index 9ca135d..95e7ed6 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 */
--
2.5.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists