[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sis 900
On Mon, Jun 09, 2003 at 08:53:04AM -0700, Richard wrote:
> Chances are you are using the newer SiS 962L chipset that uses a RealTek 8201
> PHY with the Sis900 MAC
>
> A while ago I ported the FreeBSD driver over into OpenBSD and got this thing
> working, but decided to use FreeBSD since I don't trust my own efforts for a
> production machine!
>
> Rich
>
> On Saturday 07 June 2003 21:45, Georgi Makedonski wrote:
> > Hello,
> >
> > I'm runnin OpenBSD 3.3 Box but have a lot of problem
> > first is network my big problem Sis 900 ... on slackware
> > and windows working fine but on OpenBSD have problem
> > see that :
> >
> > #ifocnfig -m sis0
> > sis0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
> > address: 00:40:ca:c2:31:d9
> > media: Ethernet none (none)
> > supported media:
> > media none
I have a patch for 3.2 that fixes a number of issues found in the
NetBSD and Linux drivers since the initial sis900 port to OpenBSD.
I submitted it but 3.3 was already in code freeze so the patch was
"obsolete." I haven't had time to port it to 3.3 yet.
The patch adds recognition and some "special" code to support the
SiS 635/735 chipset and the so-called 900B. I have tested the driver
on my K7S5A motherboard with 32-STABLE and it seems to be working
just fine. I have also fixed a bug in the handling of the multicast
hash table. I'm not sure whether the bug was benign, but the 635 and 900B
have larger hash tables. Not initializing the extra entries seemed like
a bad idea. :)
FWIW the patch is below. As always, YMMV...
Regards,
Jay
Index: src/sys/dev/pci/if_sisreg.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_sisreg.h,v
retrieving revision 1.10
diff -u -r1.10 if_sisreg.h
--- src/sys/dev/pci/if_sisreg.h 2 Jul 2002 16:44:25 -0000 1.10
+++ src/sys/dev/pci/if_sisreg.h 3 Apr 2003 05:00:52 -0000
@@ -372,6 +372,8 @@
#define SIS_REV_630S 0x0082
#define SIS_REV_630EA1 0x0083
#define SIS_REV_630ET 0x0084
+#define SIS_REV_635 0x0090
+#define SIS_REV_900B 0x0003
struct sis_type {
u_int16_t sis_vid;
@@ -403,6 +405,8 @@
caddr_t sc_listkva;
bus_dmamap_t sc_rx_sparemap;
bus_dmamap_t sc_tx_sparemap;
+ u_int8_t sis_rev;
+ u_int8_t hash_size;
};
/*
Index: src/sys/dev/pci/if_sis.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_sis.c,v
retrieving revision 1.27
diff -u -r1.27 if_sis.c
--- src/sys/dev/pci/if_sis.c 31 Jul 2002 16:58:20 -0000 1.27
+++ src/sys/dev/pci/if_sis.c 3 Apr 2003 05:01:03 -0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sis.c,v 1.27 2002/07/31 16:58:20 jason Exp $ */
+/* $OpenBSD: if_sis.c,v 1.27+ 2002/07/31 16:58:20 jason Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -58,6 +58,10 @@
* longword aligned.
*/
+/* Modified by jay@rootaction.net for 635A (rev 0x90), tested on K7S5A
+ * Also added support for 900B (rev 0x03), untested.
+ * The 635 and 900B actually have a 256-bit multicast hash table.
+ */
#include "bpfilter.h"
#include "vlan.h"
@@ -384,8 +388,9 @@
return(val);
}
- if (sc->sis_type == SIS_TYPE_900 && phy != 0)
- return(0);
+ if (sc->sis_type == SIS_TYPE_900 &&
+ sc->sis_rev < SIS_REV_635 && phy != 0)
+ return(0);
CSR_WRITE_4(sc, SIS_PHYCTL, (phy << 11) | (reg << 6) | SIS_PHYOP_READ);
SIS_SETBIT(sc, SIS_PHYCTL, SIS_PHYCTL_ACCESS);
@@ -481,6 +486,9 @@
if (sc->sis_type == SIS_TYPE_83815)
return((crc >> 23) & 0x1FF);
+ if ((sc->sis_rev == SIS_REV_635) || (sc->sis_rev == SIS_REV_900B))
+ return (crc >> 24);
+
return((crc >> 25) & 0x0000007F);
}
@@ -555,7 +563,7 @@
filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL);
/* first, zot all the existing hash bits */
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < sc->hash_size; i++) {
CSR_WRITE_4(sc, SIS_RXFILT_CTL, (4 + ((i * 16) >> 4)) << 16);
CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0);
}
@@ -750,6 +758,17 @@
}
printf(": %s", intrstr);
+ sc->sis_rev = PCI_REVISION(pa->pa_class);
+
+ /* revision 635 has 256 bit hash. others too, not implemented yet. */
+
+ if ((sc->sis_rev == SIS_REV_635) ||
+ (sc->sis_rev == SIS_REV_900B)) {
+ sc->hash_size = 16;
+ } else {
+ sc->hash_size = 8;
+ }
+
/* Reset the adapter. */
sis_reset(sc);
@@ -810,16 +829,15 @@
* requires some datasheets that I don't have access
* to at the moment.
*/
- command = pci_conf_read(pc, pa->pa_tag,
- PCI_CLASS_REG) & 0x000000ff;
- if (command == SIS_REV_630S ||
- command == SIS_REV_630E)
+ if (sc->sis_rev == SIS_REV_630S ||
+ sc->sis_rev == SIS_REV_630E ||
+ sc->sis_rev == SIS_REV_630EA1)
sis_read_cmos(sc, pa, (caddr_t)&sc->arpcom.ac_enaddr,
0x9, 6);
else
#endif
- if (command == SIS_REV_630EA1 ||
- command == SIS_REV_630ET)
+ if (sc->sis_rev == SIS_REV_635 ||
+ sc->sis_rev == SIS_REV_630ET)
sis_read_630ea1_enaddr(sc, pa);
else
sis_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr,
@@ -1371,7 +1389,7 @@
sc->sis_ldata->sis_tx_list[cur].sis_mbuf = m_head;
sc->sis_ldata->sis_tx_list[cur].sis_ctl &= ~SIS_CMDSTS_MORE;
sc->sis_ldata->sis_tx_list[*txidx].sis_ctl |= SIS_CMDSTS_OWN;
- sc->sis_cdata.sis_tx_cnt += i - 1;
+ sc->sis_cdata.sis_tx_cnt += i;
*txidx = frag;
bus_dmamap_sync(sc->sc_dmat, sc->sc_listmap,
Index: src/sys/dev/pci/if_sisreg.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_sisreg.h,v
retrieving revision 1.10
diff -u -r1.10 if_sisreg.h
--- src/sys/dev/pci/if_sisreg.h 2 Jul 2002 16:44:25 -0000 1.10
+++ src/sys/dev/pci/if_sisreg.h 3 Apr 2003 05:00:52 -0000
@@ -372,6 +372,8 @@
#define SIS_REV_630S 0x0082
#define SIS_REV_630EA1 0x0083
#define SIS_REV_630ET 0x0084
+#define SIS_REV_635 0x0090
+#define SIS_REV_900B 0x0003
struct sis_type {
u_int16_t sis_vid;
@@ -403,6 +405,8 @@
caddr_t sc_listkva;
bus_dmamap_t sc_rx_sparemap;
bus_dmamap_t sc_tx_sparemap;
+ u_int8_t sis_rev;
+ u_int8_t hash_size;
};
/*
Index: src/sys/dev/pci/if_sis.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_sis.c,v
retrieving revision 1.27
diff -u -r1.27 if_sis.c
--- src/sys/dev/pci/if_sis.c 31 Jul 2002 16:58:20 -0000 1.27
+++ src/sys/dev/pci/if_sis.c 3 Apr 2003 05:01:03 -0000
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sis.c,v 1.27 2002/07/31 16:58:20 jason Exp $ */
+/* $OpenBSD: if_sis.c,v 1.27+ 2002/07/31 16:58:20 jason Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -58,6 +58,10 @@
* longword aligned.
*/
+/* Modified by jay@rootaction.net for 635A (rev 0x90), tested on K7S5A
+ * Also added support for 900B (rev 0x03), untested.
+ * The 635 and 900B actually have a 256-bit multicast hash table.
+ */
#include "bpfilter.h"
#include "vlan.h"
@@ -384,8 +388,9 @@
return(val);
}
- if (sc->sis_type == SIS_TYPE_900 && phy != 0)
- return(0);
+ if (sc->sis_type == SIS_TYPE_900 &&
+ sc->sis_rev < SIS_REV_635 && phy != 0)
+ return(0);
CSR_WRITE_4(sc, SIS_PHYCTL, (phy << 11) | (reg << 6) | SIS_PHYOP_READ);
SIS_SETBIT(sc, SIS_PHYCTL, SIS_PHYCTL_ACCESS);
@@ -481,6 +486,9 @@
if (sc->sis_type == SIS_TYPE_83815)
return((crc >> 23) & 0x1FF);
+ if ((sc->sis_rev == SIS_REV_635) || (sc->sis_rev == SIS_REV_900B))
+ return (crc >> 24);
+
return((crc >> 25) & 0x0000007F);
}
@@ -555,7 +563,7 @@
filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL);
/* first, zot all the existing hash bits */
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < sc->hash_size; i++) {
CSR_WRITE_4(sc, SIS_RXFILT_CTL, (4 + ((i * 16) >> 4)) << 16);
CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0);
}
@@ -750,6 +758,17 @@
}
printf(": %s", intrstr);
+ sc->sis_rev = PCI_REVISION(pa->pa_class);
+
+ /* revision 635 has 256 bit hash. others too, not implemented yet. */
+
+ if ((sc->sis_rev == SIS_REV_635) ||
+ (sc->sis_rev == SIS_REV_900B)) {
+ sc->hash_size = 16;
+ } else {
+ sc->hash_size = 8;
+ }
+
/* Reset the adapter. */
sis_reset(sc);
@@ -810,16 +829,15 @@
* requires some datasheets that I don't have access
* to at the moment.
*/
- command = pci_conf_read(pc, pa->pa_tag,
- PCI_CLASS_REG) & 0x000000ff;
- if (command == SIS_REV_630S ||
- command == SIS_REV_630E)
+ if (sc->sis_rev == SIS_REV_630S ||
+ sc->sis_rev == SIS_REV_630E ||
+ sc->sis_rev == SIS_REV_630EA1)
sis_read_cmos(sc, pa, (caddr_t)&sc->arpcom.ac_enaddr,
0x9, 6);
else
#endif
- if (command == SIS_REV_630EA1 ||
- command == SIS_REV_630ET)
+ if (sc->sis_rev == SIS_REV_635 ||
+ sc->sis_rev == SIS_REV_630ET)
sis_read_630ea1_enaddr(sc, pa);
else
sis_read_eeprom(sc, (caddr_t)&sc->arpcom.ac_enaddr,
@@ -1371,7 +1389,7 @@
sc->sis_ldata->sis_tx_list[cur].sis_mbuf = m_head;
sc->sis_ldata->sis_tx_list[cur].sis_ctl &= ~SIS_CMDSTS_MORE;
sc->sis_ldata->sis_tx_list[*txidx].sis_ctl |= SIS_CMDSTS_OWN;
- sc->sis_cdata.sis_tx_cnt += i - 1;
+ sc->sis_cdata.sis_tx_cnt += i;
*txidx = frag;
bus_dmamap_sync(sc->sc_dmat, sc->sc_listmap,
- References:
- sis 900
- From: Georgi Makedonski <0x00@rambler.ru>
- Re: sis 900
- From: Richard <richard@praxistech.com>