if_de.c (129878) | if_de.c (130270) |
---|---|
1/* $NetBSD: if_de.c,v 1.86 1999/06/01 19:17:59 thorpej Exp $ */ 2/*- 3 * Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com) 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 22 unchanged lines hidden (view full) --- 31 * Written by Matt Thomas 32 * BPF support code stolen directly from if_ec.c 33 * 34 * This driver supports the DEC DE435 or any other PCI 35 * board which support 21040, 21041, or 21140 (mostly). 36 */ 37 38#include <sys/cdefs.h> | 1/* $NetBSD: if_de.c,v 1.86 1999/06/01 19:17:59 thorpej Exp $ */ 2/*- 3 * Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com) 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 22 unchanged lines hidden (view full) --- 31 * Written by Matt Thomas 32 * BPF support code stolen directly from if_ec.c 33 * 34 * This driver supports the DEC DE435 or any other PCI 35 * board which support 21040, 21041, or 21140 (mostly). 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/sys/dev/de/if_de.c 129878 2004-05-30 20:00:41Z phk $"); | 39__FBSDID("$FreeBSD: head/sys/dev/de/if_de.c 130270 2004-06-09 14:34:04Z naddy $"); |
40 41#define TULIP_HDR_DATA 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/endian.h> 46#include <sys/mbuf.h> 47#include <sys/socket.h> --- 1939 unchanged lines hidden (view full) --- 1987 tulip_mii_turnaround(sc, MII_WRCMD); 1988 tulip_mii_writebits(sc, data, 16); 1989#if defined(TULIP_DEBUG) 1990 sc->tulip_dbg.dbg_phyregs[regno][2] = data; 1991 sc->tulip_dbg.dbg_phyregs[regno][3]++; 1992#endif 1993} 1994 | 40 41#define TULIP_HDR_DATA 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/endian.h> 46#include <sys/mbuf.h> 47#include <sys/socket.h> --- 1939 unchanged lines hidden (view full) --- 1987 tulip_mii_turnaround(sc, MII_WRCMD); 1988 tulip_mii_writebits(sc, data, 16); 1989#if defined(TULIP_DEBUG) 1990 sc->tulip_dbg.dbg_phyregs[regno][2] = data; 1991 sc->tulip_dbg.dbg_phyregs[regno][3]++; 1992#endif 1993} 1994 |
1995#define tulip_mchash(mca) (tulip_crc32(mca, 6) & 0x1FF) | 1995#define tulip_mchash(mca) (ether_crc32_le(mca, 6) & 0x1FF) |
1996#define tulip_srom_crcok(databuf) ( \ | 1996#define tulip_srom_crcok(databuf) ( \ |
1997 ((tulip_crc32(databuf, 126) & 0xFFFFU) ^ 0xFFFFU) == \ | 1997 ((ether_crc32_le(databuf, 126) & 0xFFFFU) ^ 0xFFFFU) == \ |
1998 ((databuf)[126] | ((databuf)[127] << 8))) | 1998 ((databuf)[126] | ((databuf)[127] << 8))) |
1999 2000static unsigned 2001tulip_crc32( 2002 const unsigned char *databuf, 2003 size_t datalen) 2004{ 2005 u_int idx, crc = 0xFFFFFFFFUL; 2006 static const u_int crctab[] = { 2007 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 2008 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c, 2009 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c, 2010 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c 2011 }; 2012 2013 for (idx = 0; idx < datalen; idx++) { 2014 crc ^= *databuf++; 2015 crc = (crc >> 4) ^ crctab[crc & 0xf]; 2016 crc = (crc >> 4) ^ crctab[crc & 0xf]; 2017 } 2018 return crc; 2019} | |
2020 2021static void 2022tulip_identify_dec_nic( 2023 tulip_softc_t * const sc) 2024{ 2025 strcpy(sc->tulip_boardid, "DEC "); 2026#define D0 4 2027 if (sc->tulip_chipid <= TULIP_21040) --- 3237 unchanged lines hidden --- | 1999 2000static void 2001tulip_identify_dec_nic( 2002 tulip_softc_t * const sc) 2003{ 2004 strcpy(sc->tulip_boardid, "DEC "); 2005#define D0 4 2006 if (sc->tulip_chipid <= TULIP_21040) --- 3237 unchanged lines hidden --- |