summaryrefslogtreecommitdiffstats
path: root/drivers/net/sunhme.h
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-12-16 23:30:08 +0000
committerDavid S. Miller <davem@davemloft.net>2008-01-28 15:07:09 -0800
commitf3ec33e587df02e25963755989cc473e3f07bf0d (patch)
tree5f176f664af9b9b8ad76ca5fdfd8fd68de6a1fe5 /drivers/net/sunhme.h
parentb710b43c306650261c01ad08100791afec78a7db (diff)
sunhme endianness annotations
This one is interesting - SBUS and PCI variants have opposite endianness in descriptors (SBUS is sparc-only, so there host-endian == big-endian). Solution: declare a bitwise type (hme32) and in accessor helpers do typechecking and force-casts (once we know that the type is right). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/sunhme.h')
-rw-r--r--drivers/net/sunhme.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/sunhme.h b/drivers/net/sunhme.h
index 90f446db9ba..4da5539fac7 100644
--- a/drivers/net/sunhme.h
+++ b/drivers/net/sunhme.h
@@ -302,9 +302,11 @@
* Always write the address first before setting the ownership
* bits to avoid races with the hardware scanning the ring.
*/
+typedef u32 __bitwise__ hme32;
+
struct happy_meal_rxd {
- u32 rx_flags;
- u32 rx_addr;
+ hme32 rx_flags;
+ hme32 rx_addr;
};
#define RXFLAG_OWN 0x80000000 /* 1 = hardware, 0 = software */
@@ -313,8 +315,8 @@ struct happy_meal_rxd {
#define RXFLAG_CSUM 0x0000ffff /* HW computed checksum */
struct happy_meal_txd {
- u32 tx_flags;
- u32 tx_addr;
+ hme32 tx_flags;
+ hme32 tx_addr;
};
#define TXFLAG_OWN 0x80000000 /* 1 = hardware, 0 = software */
@@ -400,7 +402,7 @@ struct happy_meal {
struct hmeal_init_block *happy_block; /* RX and TX descriptors (CPU addr) */
#if defined(CONFIG_SBUS) && defined(CONFIG_PCI)
- u32 (*read_desc32)(u32 *);
+ u32 (*read_desc32)(hme32 *);
void (*write_txd)(struct happy_meal_txd *, u32, u32);
void (*write_rxd)(struct happy_meal_rxd *, u32, u32);
u32 (*dma_map)(void *, void *, long, int);