Subject: Re: kern/22466: sip driver doesn't configure DP83815 chip to accept long frames
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Valtteri Vuorikoski <vuori@puuhamaa.magenta.net>
List: netbsd-bugs
Date: 08/13/2003 23:27:16
Manuel Bouyer <bouyer@antioche.eu.org> writes:

> You should do it conditionally, only when the ETHERCAP_VLAN_MTU
> flag is set in ec->ec_capenable. See for example sys/dev/ic/tulip.c.
> Can you try to update your patch ?

Appended is a new patch that will only enable ALP when VLANs are
present. The setup is also moved to a more consistent location.

The DP83820 has the same flag available, but it apparently should
do handling of VLANs in hardware and might output a packet up to
65k if this is enabled.

This has not been tested in an environment with actual VLAN trunks,
but debugging shows that the flag is enabled and disabled when
expected.

 -v

--- if_sip.c.orig       Tue Aug 12 22:27:13 2003
+++ if_sip.c    Wed Aug 13 20:07:10 2003
@@ -2294,6 +2294,14 @@
         * Initialize the prototype RXCFG register.
         */
        sc->sc_rxcfg |= (sc->sc_rx_drain_thresh << RXCFG_DRTH_SHIFT);
+#ifndef DP83820
+       /*
+        * Accept packets >1518 bytes (including FCS) so we can handle
+        * 802.1q-tagged frames properly.
+        */
+       if (sc->sc_ethercom.ec_capenable & ETHERCAP_VLAN_MTU)
+               sc->sc_rxcfg |= RXCFG_ALP;
+#endif
        bus_space_write_4(st, sh, SIP_RXCFG, sc->sc_rxcfg);
 
 #ifdef DP83820
--- if_sipreg.h.orig    Wed Aug 13 08:50:42 2003
+++ if_sipreg.h Wed Aug 13 08:54:05 2003
@@ -450,7 +450,7 @@
 #define        RXCFG_STRIPCRC  0x20000000      /* strip CRC */
 #endif /* DP83820 */
 #define        RXCFG_ATX       0x10000000      /* accept transmit packets */
-#define        RXCFG_AJAB      0x08000000      /* accept jabber packets */
+#define        RXCFG_ALP       0x08000000      /* accept long packets */
 #ifdef DP83820
 #define        RXCFG_AIRL      0x04000000      /* accept in-range length err packets */
 #define        RXCFG_MXDMA      0x00700000     /* max DMA burst size */