[xtensa-cvscommit] linux/drivers/net jazzsonic.c,1.1.1.1,1.2 macsonic.c,1.1.1.1,1.2 sonic.c,1.2,1.3
Brought to you by:
zankel
|
From: <jgr...@us...> - 2003-02-12 20:18:03
|
Update of /cvsroot/xtensa/linux/drivers/net
In directory sc8-pr-cvs1:/tmp/cvs-serv22759
Modified Files:
jazzsonic.c macsonic.c sonic.c sonic.h xtsonic.c
Log Message:
Modify SONIC network drivers to use explicit 32-bit mode indication
for clarity.
Index: jazzsonic.c
===================================================================
RCS file: /cvsroot/xtensa/linux/drivers/net/jazzsonic.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** jazzsonic.c 28 Aug 2002 16:10:43 -0000 1.1.1.1
--- jazzsonic.c 12 Feb 2003 20:17:50 -0000 1.2
***************
*** 41,45 ****
#include <linux/skbuff.h>
! #define SREGS_PAD(n) u16 n;
#include "sonic.h"
--- 41,45 ----
#include <linux/skbuff.h>
! #define SONIC_MODE32
#include "sonic.h"
Index: macsonic.c
===================================================================
RCS file: /cvsroot/xtensa/linux/drivers/net/macsonic.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** macsonic.c 28 Aug 2002 16:10:44 -0000 1.1.1.1
--- macsonic.c 12 Feb 2003 20:17:50 -0000 1.2
***************
*** 56,60 ****
#include <linux/module.h>
! #define SREGS_PAD(n) u16 n;
#include "sonic.h"
--- 56,60 ----
#include <linux/module.h>
! #define SONIC_MODE32
#include "sonic.h"
Index: sonic.c
===================================================================
RCS file: /cvsroot/xtensa/linux/drivers/net/sonic.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sonic.c 6 Feb 2003 01:23:48 -0000 1.2
--- sonic.c 12 Feb 2003 20:17:51 -0000 1.3
***************
*** 502,506 ****
SONIC_WRITE(SONIC_RWP, rra_end);
SONIC_WRITE(SONIC_URRA, lp->rra_laddr >> 16);
! SONIC_WRITE(SONIC_EOBC, (SONIC_RBSIZE - SONIC_MODESIZE) >> 1);
lp->cur_rra =
--- 502,506 ----
SONIC_WRITE(SONIC_RWP, rra_end);
SONIC_WRITE(SONIC_URRA, lp->rra_laddr >> 16);
! SONIC_WRITE(SONIC_EOBC, SONIC_EOBCSIZE >> 1);
lp->cur_rra =
Index: sonic.h
===================================================================
RCS file: /cvsroot/xtensa/linux/drivers/net/sonic.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** sonic.h 10 Feb 2003 21:56:10 -0000 1.5
--- sonic.h 12 Feb 2003 20:17:51 -0000 1.6
***************
*** 217,220 ****
--- 217,236 ----
#define SONIC_END_OF_LINKS 0x0001
+ /*
+ * The SONIC DP83934C datasheets recommend setting EOBC 2 or 4 bytes less
+ * than the buffer size (for 16-bit and 32-bit modes respectively)
+ * when buffering a single packet per RBA, as this driver does.
+ * And they indicate EOBC must be set to 1518 or 1520 for 16-bit
+ * and 32-bit modes respectively.
+ */
+ #ifdef SONIC_MODE32
+ #define SONIC_RBSIZE 1524
+ #define SONIC_EOBCSIZE 1520
+ #define SREGS_PAD(n) u16 n;
+ #else
+ #define SONIC_RBSIZE 1520
+ #define SONIC_EOBCSIZE 1518
+ #define SREGS_PAD(n)
+ #endif
#if defined(CONFIG_MACSONIC) || defined(__XTENSA_EB__)
***************
*** 435,452 ****
#define SONIC_NUM_TDS 16 /* number of transmit descriptors */
#endif
- /*
- * The SONIC DP83934C datasheets recommend setting EOBC 2 or 4 bytes less
- * than the buffer size (for 16-bit and 32-bit modes respectively)
- * when buffering a single packet per RBA, as this driver does.
- * 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)
--- 451,454 ----
Index: xtsonic.c
===================================================================
RCS file: /cvsroot/xtensa/linux/drivers/net/xtsonic.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** xtsonic.c 6 Feb 2003 01:23:49 -0000 1.3
--- xtsonic.c 12 Feb 2003 20:17:51 -0000 1.4
***************
*** 37,41 ****
#include <xtensa/xtboard.h>
! #define SREGS_PAD(n) u16 n;
extern unsigned xtboard_nvram_valid(void);
--- 37,41 ----
#include <xtensa/xtboard.h>
! #define SONIC_MODE32
extern unsigned xtboard_nvram_valid(void);
|