From: Adams (adams@pdv2.fmr.maschinenbau.th-darmstadt.de)
Date: 02/24/93


From: adams@pdv2.fmr.maschinenbau.th-darmstadt.de (Adams)
Subject: Re: FS corruption: SCSI+WD8013+TCP/IP *Help*
Date: Wed, 24 Feb 1993 20:20:38 GMT

In article <1m8m87$9s5@news.cs.tu-berlin.de> cally@cs.tu-berlin.de (Carsten Fischer) writes:

> Problem: FS (!!!) (SCSI) corruption when using WD8013 *with*
             TCPIP enabled.

> Configuration:

> *(1)* :

> 486dx-33, 20MB (16 enabled)
> AHA 1542B, (240 + 520) MB, (1.44 + 1.2) MB
> Serial Card, 2 ports RS232
> ET-4000 compatible
> WD8013 compatible

> SLS-0.99p2 (initial release, no updates)
> Kernel 99p2, 99p4, 99p5

   (2):

> 386sx-16, 5 MB
> ATBUS (125 + 43) MB, 1.44 MB
> non-ETxxxx compatible
> WD8013 compatible (-> 1st)

> SLS-0.99p2 (-> (1))
> Kernel 99p2

> The following occurs on (1), if :
> o The WD8013 is plugged in AND the kernel is compiled with TCP/IP
> enabled.
> Nothing goes wrong, if :
> o The WD8013 is /not/ plugged in (but TCP/IP enabled), or
> o The WD8013 /is/ plugged in but the kernel is /not/ compiled with
> TCP/IP enabled.

Lot of results of a damaged filesystem deleted ...

> It doesn't matter which type of FS I'm using, I reproduced this using
> standard MinixFS, extfs and ext2fs(99p5) with Linux 0.99p{2,4,5}.

> And, of course, it does /not/ matter which partition I use ....
> This already broke sda{2,3,7}.

> I edited net/tcp/Space.c to use IRQ 5 (networking ok !) and 7.
> I even moved the base i/o address ... (-> 0x220).
> BTW, since I'm using the AHA1542, nearly every time when booting, I get a funny
> orange as background, which disappears when resetting several times ...
> (When I used 0x220 as the WD's i/o base, i got a hot green ... :-) )
> Now I'll move memstart/memend, allthough I don't know how this should affect
> my problem.

Looks like a problem of addressing, both address generation and decoding.
Perahps addresses clash, or cards are too slow.

> The AHA1542 is using DC000 as BIOS address, I already tried CC000, with no
> result.

> Needless to say that nothing ever happend to the 2nd PC (ATBUS, TCPIP enabled).
> And this is my first problem concerning SCSI ...

> I already disabled every shadow, switched to low speed, plugged out my serial
   card and enabled the AHA's BIOS waitstates (just to be sure :-) ...).

> As a workaround I'm now using a kernel with TCP/IP disabled :-(

> So, please, please, please ... *Help*

> !!! *Any* help would be appreciated !!!

> Carsten

I hope, that this reached FAQ meanwhile. We successfully run
a SMC-Elite-16 (former WD8013) and an Adaptec 1542b.

Your problem looks as it would not be caused by problems
concerning bus mastering, e.g. by Adaptec 1542B.

1) Put your Ethernet card off the default places, some guys regard
        those areas to be free, sadly enough those often write BIOSes.

2) Get MSDOS and the diagnose floppy for SMC-Elite or WD8013, hook your
        system onto a running, properly terminated network !!!!!

3) Choose your parameters, setup via "diagnose", "ezsetup" had a bug,
        these and test your card. This is possible without
        running a particular OS.

        Make sure, you know I/O address map and memory map of your system!

4) You may need to lower AT-Busclock on your 33MHz. Sometimes those
        run with much more.....
        No question, but shadowing mst be disabled.

> BTW: net/tcp/Space.c: The NET-FAQ says that one would have to alter
> 'memory end' (WD8013: d4000).
> But what about "recv. memory end" ??

WD8013 has 16 kByte shared memory, yielding 64 256Byte pages.
As about 90% of the network traffic is read, incresing read buffer should
improve performance. I have to confess I did not see much difference.

Our working "Space.c":

/* Space.c */

/* Holds initial configuration information for devices. */
/* $Id: Space.c,v 0.8.4.7 1993/01/22 23:21:38 bir7 Exp $ */
/* $Log: Space.c,v $
 * Revision 0.8.4.7 1993/01/22 23:21:38 bir7
 * Merged with 99 pl4
 *
 * Revision 0.8.4.6 1993/01/22 22:58:08 bir7
 * *** empty log message ***
 *
 * Revision 0.8.4.5 1992/12/12 19:25:04 bir7
 * Cleaned up Log messages.
 *
 * Revision 0.8.4.4 1992/12/05 21:35:53 bir7
 * Updated dev->init type.
 *
 * Revision 0.8.4.3 1992/11/15 14:55:30 bir7
 * Removed ctrl-h so diff no longer thinks it's a binary file.
 *
 * Revision 0.8.4.2 1992/11/10 10:38:48 bir7
 * Change free_s to kfree_s and accidently changed free_skb to kfree_skb.
 *
 * Revision 0.8.4.1 1992/11/10 00:17:18 bir7
 * version change only.
 *
 * Revision 0.8.3.2 1992/11/10 00:14:47 bir7
 * Changed malloc to kmalloc and added Id and Log
 *
 */

#include "dev.h"
#include <linux/stddef.h>

extern int wd8003_init(struct device *);
extern int loopback_init(struct device *dev);

static struct device wd8003_dev =
{ /* major changes, had */
  "eth0",
  0xd8000, /* recv memory end. */
  0xda000, /* recv memory start. */
  0xdc000, /* memory end. */
  0xd8000, /* memory start. */
  0x300, /* base i/o address. */
  10, /* irq */
  0,0,0,0,0, /* flags */
  NULL, /* next device */
  wd8003_init,
  /* wd8003_init should set up the rest. */
  0, /* trans start. */
  {NULL}, /* buffs */
  NULL, /* backlog */
  NULL, /* open */
  NULL, /* stop */
  NULL, /* hard_start_xmit */
  NULL, /* hard_header */
  NULL, /* add arp */
  NULL, /* queue xmit */
  NULL, /* rebuild header */
  NULL, /* type_trans */
  NULL, /* send_packet */
  NULL, /* private */
  0, /* type. */
  0, /* hard_header_len */
  0, /* mtu */
  {0,}, /* broadcast address */
  {0,}, /* device address */
  0 /* addr len */
};

static struct device loopback_dev =
{
  "loopback",
  -1, /* recv memory end. */
  0x0, /* recv memory start. */
  -1, /* memory end. */
  0, /* memory start. */
  0, /* base i/o address. */
  0, /* irq */
  0,0,1,0,0, /* flags */
  &wd8003_dev, /* next device */
  loopback_init,
  /* loopback_init should set up the rest. */
  0, /* trans start. */
  {NULL}, /* buffs */
  NULL, /* backlog */
  NULL, /* open */
  NULL, /* stop */
  NULL, /* hard_start_xmit */
  NULL, /* hard_header */
  NULL, /* add arp */
  NULL, /* queue xmit */
  NULL, /* rebuild header */
  NULL, /* type_trans */
  NULL, /* send_packet */
  NULL, /* private */
  0, /* type. */
  0, /* hard_header_len */
  0, /* mtu */
  {0,}, /* broadcast address */
  {0,}, /* device address */
  0 /* addr len */
};

struct device *dev_base = &loopback_dev;