summaryrefslogtreecommitdiffstats
path: root/sys/dev/de
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1996-10-10 19:44:10 +0000
committerwollman <wollman@FreeBSD.org>1996-10-10 19:44:10 +0000
commita21642397b448a404a159cc7696b67942cd4c432 (patch)
tree064816260ecbd5099455a7cc22ea828d96c46d54 /sys/dev/de
parentaedb306d8bb4bc67c171ce36c6ba12e38b2ff554 (diff)
downloadFreeBSD-src-a21642397b448a404a159cc7696b67942cd4c432.zip
FreeBSD-src-a21642397b448a404a159cc7696b67942cd4c432.tar.gz
Implement the 802.3 MIB in a way that uses the generic interface
defined in if_mib.h.
Diffstat (limited to 'sys/dev/de')
-rw-r--r--sys/dev/de/if_de.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c
index b1c22be..5b5cb25 100644
--- a/sys/dev/de/if_de.c
+++ b/sys/dev/de/if_de.c
@@ -21,7 +21,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_de.c,v 1.51 1996/09/18 14:44:31 davidg Exp $
+ * $Id: if_de.c,v 1.52 1996/09/20 04:35:15 davidg Exp $
*
*/
@@ -52,8 +52,9 @@
#endif
#include <net/if.h>
-#include <net/if_types.h>
#include <net/if_dl.h>
+#include <net/if_mib.h>
+#include <net/if_types.h>
#include <net/route.h>
#include <net/netisr.h>
@@ -519,7 +520,7 @@ struct _tulip_softc_t {
#endif
struct ifqueue tulip_txq;
struct ifqueue tulip_rxq;
- tulip_dot3_stats_t tulip_dot3stats;
+ struct ifmib_iso_8802_3 tulip_dot3stats;
tulip_ringinfo_t tulip_rxinfo;
tulip_ringinfo_t tulip_txinfo;
tulip_desc_t tulip_rxdescs[TULIP_RXDESCS];
@@ -539,6 +540,13 @@ static const char * const tulip_chipdescs[] = {
"DC21142 [10-100Mb/s]",
};
+#define chip(x) DOT3CHIPSET(dot3VendorDigital, dot3ChipSetDigital##x)
+static u_int32_t const tulip_chip2mib[] = {
+ chip(DC21040), chip(DC21040), chip(DC21041), chip(DC21140),
+ chip(DC21140A), chip(DC21142)
+};
+#undef chip
+
static const char * const tulip_mediums[] = {
"unknown", /* TULIP_MEDIA_UNKNOWN */
"10baseT", /* TULIP_MEDIA_10BASET */
@@ -3771,6 +3779,9 @@ tulip_attach(
TULIP_EADDR_ARGS(sc->tulip_hwaddr));
#endif
+ sc->tulip_dot3stats.dot3Compliance = DOT3COMPLIANCE_STATS;
+ sc->tulip_dot3stats.dot3StatsEtherChipSet =
+ tulip_chip2mib[sc->tulip_chipid];
if (sc->tulip_boardsw->bd_mii_probe != NULL)
(*sc->tulip_boardsw->bd_mii_probe)(sc);
@@ -3785,6 +3796,9 @@ tulip_attach(
tulip_reset(sc);
sc->tulip_flags &= ~TULIP_DEVICEPROBE;
+ ifp->if_linkmib = &sc->tulip_dot3stats;
+ ifp->if_linkmiblen = sizeof sc->tulip_dot3stats;
+
#if defined(__bsdi__) && _BSDI_VERSION >= 199510
sc->tulip_pf = printf;
ether_attach(ifp);
OpenPOWER on IntegriCloud