Deleted Added
full compact
if_sis.c (72012) if_sis.c (72084)
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 *
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/pci/if_sis.c 72012 2001-02-04 16:08:18Z phk $
32 * $FreeBSD: head/sys/pci/if_sis.c 72084 2001-02-06 10:12:15Z phk $
33 */
34
35/*
36 * SiS 900/SiS 7016 fast ethernet PCI NIC driver. Datasheets are
37 * available from http://www.sis.com.tw.
38 *
39 * This driver also supports the NatSemi DP83815. Datasheets are
40 * available from http://www.national.com.

--- 53 unchanged lines hidden (view full) ---

94
95MODULE_DEPEND(sis, miibus, 1, 1, 1);
96
97/* "controller miibus0" required. See GENERIC if you get errors here. */
98#include "miibus_if.h"
99
100#ifndef lint
101static const char rcsid[] =
33 */
34
35/*
36 * SiS 900/SiS 7016 fast ethernet PCI NIC driver. Datasheets are
37 * available from http://www.sis.com.tw.
38 *
39 * This driver also supports the NatSemi DP83815. Datasheets are
40 * available from http://www.national.com.

--- 53 unchanged lines hidden (view full) ---

94
95MODULE_DEPEND(sis, miibus, 1, 1, 1);
96
97/* "controller miibus0" required. See GENERIC if you get errors here. */
98#include "miibus_if.h"
99
100#ifndef lint
101static const char rcsid[] =
102 "$FreeBSD: head/sys/pci/if_sis.c 72012 2001-02-04 16:08:18Z phk $";
102 "$FreeBSD: head/sys/pci/if_sis.c 72084 2001-02-06 10:12:15Z phk $";
103#endif
104
105/*
106 * Various supported device vendors/types and their names.
107 */
108static struct sis_type sis_devs[] = {
109 { SIS_VENDORID, SIS_DEVICEID_900, "SiS 900 10/100BaseTX" },
110 { SIS_VENDORID, SIS_DEVICEID_7016, "SiS 7016 10/100BaseTX" },

--- 405 unchanged lines hidden (view full) ---

516 filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL);
517
518 /* first, zot all the existing hash bits */
519 for (i = 0; i < 32; i++) {
520 CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + (i*2));
521 CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0);
522 }
523
103#endif
104
105/*
106 * Various supported device vendors/types and their names.
107 */
108static struct sis_type sis_devs[] = {
109 { SIS_VENDORID, SIS_DEVICEID_900, "SiS 900 10/100BaseTX" },
110 { SIS_VENDORID, SIS_DEVICEID_7016, "SiS 7016 10/100BaseTX" },

--- 405 unchanged lines hidden (view full) ---

516 filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL);
517
518 /* first, zot all the existing hash bits */
519 for (i = 0; i < 32; i++) {
520 CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + (i*2));
521 CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0);
522 }
523
524 LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
524 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
525 if (ifma->ifma_addr->sa_family != AF_LINK)
526 continue;
527 h = sis_crc(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
528 index = h >> 3;
529 bit = h & 0x1F;
530 CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + index);
531 if (bit > 0xF)
532 bit -= 0x10;

--- 25 unchanged lines hidden (view full) ---

558
559 /* first, zot all the existing hash bits */
560 for (i = 0; i < 8; i++) {
561 CSR_WRITE_4(sc, SIS_RXFILT_CTL, (4 + ((i * 16) >> 4)) << 16);
562 CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0);
563 }
564
565 /* now program new ones */
525 if (ifma->ifma_addr->sa_family != AF_LINK)
526 continue;
527 h = sis_crc(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
528 index = h >> 3;
529 bit = h & 0x1F;
530 CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + index);
531 if (bit > 0xF)
532 bit -= 0x10;

--- 25 unchanged lines hidden (view full) ---

558
559 /* first, zot all the existing hash bits */
560 for (i = 0; i < 8; i++) {
561 CSR_WRITE_4(sc, SIS_RXFILT_CTL, (4 + ((i * 16) >> 4)) << 16);
562 CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0);
563 }
564
565 /* now program new ones */
566 LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
566 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
567 if (ifma->ifma_addr->sa_family != AF_LINK)
568 continue;
569 h = sis_crc(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
570 CSR_WRITE_4(sc, SIS_RXFILT_CTL, (4 + (h >> 4)) << 16);
571 SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << (h & 0xF)));
572 }
573
574 CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave);

--- 1102 unchanged lines hidden ---
567 if (ifma->ifma_addr->sa_family != AF_LINK)
568 continue;
569 h = sis_crc(sc, LLADDR((struct sockaddr_dl *)ifma->ifma_addr));
570 CSR_WRITE_4(sc, SIS_RXFILT_CTL, (4 + (h >> 4)) << 16);
571 SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << (h & 0xF)));
572 }
573
574 CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave);

--- 1102 unchanged lines hidden ---