diff options
author | David Daney <david.daney@cavium.com> | 2013-06-20 04:40:20 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-20 09:12:48 +0400 |
commit | 3ac19c900cf4a46748d789c49d84a58c37b93841 (patch) | |
tree | b3cb53f1afc2b4175aa43d85d203277875e80340 /drivers/net/ethernet/octeon | |
parent | 906996d6eb8fbd5ee4241a0e8e0fb013423c934d (diff) | |
download | linux-3ac19c900cf4a46748d789c49d84a58c37b93841.tar.xz |
netdev: octeon_mgmt: Fix structure layout for little-endian.
The C ABI reverses the bitfield fill order when compiled as
little-endian.
Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/octeon')
-rw-r--r-- | drivers/net/ethernet/octeon/octeon_mgmt.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c index a603faf64a9f..91a8a5d28037 100644 --- a/drivers/net/ethernet/octeon/octeon_mgmt.c +++ b/drivers/net/ethernet/octeon/octeon_mgmt.c @@ -46,17 +46,25 @@ union mgmt_port_ring_entry { u64 d64; struct { - u64 reserved_62_63:2; +#define RING_ENTRY_CODE_DONE 0xf +#define RING_ENTRY_CODE_MORE 0x10 +#ifdef __BIG_ENDIAN_BITFIELD + u64 reserved_62_63:2; /* Length of the buffer/packet in bytes */ - u64 len:14; + u64 len:14; /* For TX, signals that the packet should be timestamped */ - u64 tstamp:1; + u64 tstamp:1; /* The RX error code */ - u64 code:7; -#define RING_ENTRY_CODE_DONE 0xf -#define RING_ENTRY_CODE_MORE 0x10 + u64 code:7; /* Physical address of the buffer */ - u64 addr:40; + u64 addr:40; +#else + u64 addr:40; + u64 code:7; + u64 tstamp:1; + u64 len:14; + u64 reserved_62_63:2; +#endif } s; }; |