aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/octeon/octeon_mgmt.c
diff options
context:
space:
mode:
authorDavid Daney <david.daney@cavium.com>2013-06-19 20:40:20 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-20 01:12:48 -0400
commit3ac19c900cf4a46748d789c49d84a58c37b93841 (patch)
treeb3cb53f1afc2b4175aa43d85d203277875e80340 /drivers/net/ethernet/octeon/octeon_mgmt.c
parent906996d6eb8fbd5ee4241a0e8e0fb013423c934d (diff)
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/octeon_mgmt.c')
-rw-r--r--drivers/net/ethernet/octeon/octeon_mgmt.c22
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 @@
46union mgmt_port_ring_entry { 46union mgmt_port_ring_entry {
47 u64 d64; 47 u64 d64;
48 struct { 48 struct {
49 u64 reserved_62_63:2; 49#define RING_ENTRY_CODE_DONE 0xf
50#define RING_ENTRY_CODE_MORE 0x10
51#ifdef __BIG_ENDIAN_BITFIELD
52 u64 reserved_62_63:2;
50 /* Length of the buffer/packet in bytes */ 53 /* Length of the buffer/packet in bytes */
51 u64 len:14; 54 u64 len:14;
52 /* For TX, signals that the packet should be timestamped */ 55 /* For TX, signals that the packet should be timestamped */
53 u64 tstamp:1; 56 u64 tstamp:1;
54 /* The RX error code */ 57 /* The RX error code */
55 u64 code:7; 58 u64 code:7;
56#define RING_ENTRY_CODE_DONE 0xf
57#define RING_ENTRY_CODE_MORE 0x10
58 /* Physical address of the buffer */ 59 /* Physical address of the buffer */
59 u64 addr:40; 60 u64 addr:40;
61#else
62 u64 addr:40;
63 u64 code:7;
64 u64 tstamp:1;
65 u64 len:14;
66 u64 reserved_62_63:2;
67#endif
60 } s; 68 } s;
61}; 69};
62 70