From: Richard B. <rb...@us...> - 2002-05-31 03:51:01
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net In directory usw-pr-cvs1:/tmp/cvs-serv19042/drivers/net Modified Files: vaxsgec.c vaxsgec.h Log Message: First working version of SGEC driver. Sends and receives packets properly. Index: vaxsgec.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/vaxsgec.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- vaxsgec.c 31 May 2002 01:26:01 -0000 1.12 +++ vaxsgec.c 31 May 2002 03:50:57 -0000 1.13 @@ -29,9 +29,9 @@ #include <asm/mv.h> /* use #undef to turn these off */ -#define VAX_SGEC_DEBUG -#define VAX_SGEC_DEBUG_LVL2 -#define VAX_SGEC_DEBUG_BUFFERS +#undef VAX_SGEC_DEBUG +#undef VAX_SGEC_DEBUG_LVL2 +#undef VAX_SGEC_DEBUG_BUFFERS #define VAX_SGEC_AUTOPROBE_IRQ @@ -139,8 +139,10 @@ if ((regs->sg_nicsr5 & SG_NICSR5_TS) != SG_NICSR5_TS_RUN) { #ifdef VAX_SGEC_DEBUG + printk("writing to csr3: lp->rx_new = %d\n",lp->rx_new); printk("writing to csr4: lp->tx_old = %d\n",lp->tx_old); #endif + writereg(®s->sg_nicsr3,virt_to_phys(& lp->rx_ring [lp->rx_new])); writereg(®s->sg_nicsr4,virt_to_phys(& lp->tx_ring [lp->tx_old])); writereg(®s->sg_nicsr1,SG_NICSR1_TXPD); #ifdef VAX_SGEC_DEBUG @@ -380,6 +382,12 @@ #ifdef VAX_SGEC_DEBUG printk("sgec_rx\n"); + printk("%d (rx_flags0=0x%04x, framelen=0x%04x, flags1=0x%04x)\n", + lp->rx_new, + lp->rx_ring [lp->rx_new].flags0, + lp->rx_ring [lp->rx_new].framelen, + lp->rx_ring [lp->rx_new].flags1); + #endif #ifdef VAX_SGEC_DEBUG_BUFFERS @@ -501,7 +509,7 @@ while (! (lp->tx_ring [lp->tx_old].tx_err & SG_TDR_OWN)) { - if (lp->tx_old == lp->tx_new) + if (lp->tx_old == lp->tx_new) { #ifdef VAX_SGEC_DEBUG printk (" old == new\n"); @@ -580,7 +588,7 @@ #endif return; } - writereg(&sg_regs->sg_nicsr5, csr5); /* clear interrupt */ + writereg(&sg_regs->sg_nicsr5, csr5); /* clear interrupts */ #ifdef VAX_SGEC_DEBUG printk("for us!\n"); Index: vaxsgec.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/vaxsgec.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- vaxsgec.h 28 May 2002 18:41:37 -0000 1.4 +++ vaxsgec.h 31 May 2002 03:50:57 -0000 1.5 @@ -105,6 +105,7 @@ /* NICSR14: diagnostic breakpoint (v) */ /* NICSR15: monitor command */ +#define SG_NICSR15_INT 0x00010000 /* sets internal level 14 interrupt */ /* Receive descriptor bits */ #define SG_FR_OWN 0x8000 /* We own the descriptor */ @@ -167,7 +168,7 @@ #define VSBUS_NISA_ROM 0x27800000 /* 3100/90 (?) */ #define VXT_NISA_ROM 0x200c4000 /* VXT2000 */ /* The interrupt vector. */ -#define SGECVEC 0x41 /* 3100/85 */ +#define SGECVEC 0x41 /* was 0x41 3100/85 */ #define OTHER_SGECVEC 0x108 /* 4000/60 (?) */ /* register offsets */ |