[xtensa-cvscommit] linux/drivers/net sonic.h,1.4,1.5
Brought to you by:
zankel
|
From: <ma...@us...> - 2003-02-10 21:56:13
|
Update of /cvsroot/xtensa/linux/drivers/net
In directory sc8-pr-cvs1:/tmp/cvs-serv6053
Modified Files:
sonic.h
Log Message:
Fix SONIC buffer size back to 1520 for 16-bit Sonic configurations,
as Joe G pointed out. Also make code slighly more robust against
structure padding by the compiler.
There really ought to be a proper macro defined by target-specific
Sonic drivers indicating whether 32-bit or 16-bit mode is used,
in addition to or rather than the SREGS_PAD() hack.
That involves modifying other driver files, so not done for now.
Index: sonic.h
===================================================================
RCS file: /cvsroot/xtensa/linux/drivers/net/sonic.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** sonic.h 6 Feb 2003 01:23:49 -0000 1.4
--- sonic.h 10 Feb 2003 21:56:10 -0000 1.5
***************
*** 441,449 ****
* And they indicate EOBC must be set to 1518 or 1520 for 16-bit
* and 32-bit modes respectively. To test which case, construct
! * a small structure whose size (2 or 4 bytes) depends on the mode:
*/
! struct _sonic_size_test { u16 dummy; SREGS_PAD(pad); };
! #define SONIC_MODESIZE sizeof(struct _sonic_size_test) /* 2 or 4 */
! #define SONIC_RBSIZE ((SONIC_MODESIZE > 2) ? 1524 : 1518) /* size of one resource buffer */
#define SONIC_RDS_MASK (SONIC_NUM_RDS-1)
--- 441,452 ----
* And they indicate EOBC must be set to 1518 or 1520 for 16-bit
* and 32-bit modes respectively. To test which case, construct
! * a small structure whose size depends on the mode (avoid using
! * sizeof structure directly, in case of padding).
*/
! struct _sonic_size_test1 { u16 dummy; };
! struct _sonic_size_test2 { u16 dummy; SREGS_PAD(pad); };
! #define SONIC_MODESIZE ((sizeof(struct _sonic_size_test2) \
! > sizeof(struct _sonic_size_test1)) ? 4 : 2) /* 2 or 4 */
! #define SONIC_RBSIZE ((SONIC_MODESIZE > 2) ? 1524 : 1520) /* size of one resource buffer */
#define SONIC_RDS_MASK (SONIC_NUM_RDS-1)
|