diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2006-10-23 08:53:17 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-02 00:12:01 -0500 |
commit | b2e68aa337f950e4a8c893a82b95b1755309bc56 (patch) | |
tree | 4f7696e09d08cb173306e68bfdc4dc98aa97ef0b /drivers/net/defxx.h | |
parent | c3a9392e4f3b9d97803b067871d66bc143369dbf (diff) |
[PATCH] defxx: Big-endian hosts support
The PDQ DMA engine requires a different byte-swapping mode for big-endian
hosts; also the MAC address which is read from a register through PIO has
to be byte-swapped. These changes have been verified with DEFPA-DC (PCI)
boards and a Broadcom BCM91250A (MIPS CPU based) host.
Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/defxx.h')
-rw-r--r-- | drivers/net/defxx.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/net/defxx.h b/drivers/net/defxx.h index 8b1e9a11ca21..2ce8f97253eb 100644 --- a/drivers/net/defxx.h +++ b/drivers/net/defxx.h | |||
@@ -25,6 +25,7 @@ | |||
25 | * macros to DEFXX.C. | 25 | * macros to DEFXX.C. |
26 | * 12-Sep-96 LVS Removed packet request header pointers. | 26 | * 12-Sep-96 LVS Removed packet request header pointers. |
27 | * 04 Aug 2003 macro Converted to the DMA API. | 27 | * 04 Aug 2003 macro Converted to the DMA API. |
28 | * 23 Oct 2006 macro Big-endian host support. | ||
28 | */ | 29 | */ |
29 | 30 | ||
30 | #ifndef _DEFXX_H_ | 31 | #ifndef _DEFXX_H_ |
@@ -1344,7 +1345,7 @@ typedef struct | |||
1344 | 1345 | ||
1345 | /* Register definition structures are defined for both big and little endian systems */ | 1346 | /* Register definition structures are defined for both big and little endian systems */ |
1346 | 1347 | ||
1347 | #ifndef BIG_ENDIAN | 1348 | #ifndef __BIG_ENDIAN |
1348 | 1349 | ||
1349 | /* Little endian format of Type 1 Producer register */ | 1350 | /* Little endian format of Type 1 Producer register */ |
1350 | 1351 | ||
@@ -1402,7 +1403,11 @@ typedef union | |||
1402 | } index; | 1403 | } index; |
1403 | } PI_TYPE_2_CONSUMER; | 1404 | } PI_TYPE_2_CONSUMER; |
1404 | 1405 | ||
1405 | #else | 1406 | /* Define swapping required by DMA transfers. */ |
1407 | #define PI_PDATA_A_INIT_M_BSWAP_INIT \ | ||
1408 | (PI_PDATA_A_INIT_M_BSWAP_DATA) | ||
1409 | |||
1410 | #else /* __BIG_ENDIAN */ | ||
1406 | 1411 | ||
1407 | /* Big endian format of Type 1 Producer register */ | 1412 | /* Big endian format of Type 1 Producer register */ |
1408 | 1413 | ||
@@ -1460,7 +1465,11 @@ typedef union | |||
1460 | } index; | 1465 | } index; |
1461 | } PI_TYPE_2_CONSUMER; | 1466 | } PI_TYPE_2_CONSUMER; |
1462 | 1467 | ||
1463 | #endif /* #ifndef BIG_ENDIAN */ | 1468 | /* Define swapping required by DMA transfers. */ |
1469 | #define PI_PDATA_A_INIT_M_BSWAP_INIT \ | ||
1470 | (PI_PDATA_A_INIT_M_BSWAP_DATA | PI_PDATA_A_INIT_M_BSWAP_LITERAL) | ||
1471 | |||
1472 | #endif /* __BIG_ENDIAN */ | ||
1464 | 1473 | ||
1465 | /* Define EISA controller register offsets */ | 1474 | /* Define EISA controller register offsets */ |
1466 | 1475 | ||