Deleted Added
full compact
if_nve.c (148412) if_nve.c (148654)
1/*
2 * Copyright (c) 2005 by David E. O'Brien <obrien@FreeBSD.org>.
3 * Copyright (c) 2003,2004 by Quinton Dolan <q@onthenet.com.au>.
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:

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

69 *
70 * Written by Quinton Dolan <q@onthenet.com.au>
71 * Portions based on existing FreeBSD network drivers.
72 * NVIDIA API usage derived from distributed NVIDIA NVNET driver source files.
73 *
74 */
75
76#include <sys/cdefs.h>
1/*
2 * Copyright (c) 2005 by David E. O'Brien <obrien@FreeBSD.org>.
3 * Copyright (c) 2003,2004 by Quinton Dolan <q@onthenet.com.au>.
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:

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

69 *
70 * Written by Quinton Dolan <q@onthenet.com.au>
71 * Portions based on existing FreeBSD network drivers.
72 * NVIDIA API usage derived from distributed NVIDIA NVNET driver source files.
73 *
74 */
75
76#include <sys/cdefs.h>
77__FBSDID("$FreeBSD: head/sys/dev/nve/if_nve.c 148412 2005-07-25 22:21:11Z mux $");
77__FBSDID("$FreeBSD: head/sys/dev/nve/if_nve.c 148654 2005-08-03 00:18:35Z rwatson $");
78
79#include <sys/param.h>
80#include <sys/systm.h>
81#include <sys/sockio.h>
82#include <sys/mbuf.h>
83#include <sys/malloc.h>
84#include <sys/kernel.h>
85#include <sys/socket.h>

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

1068 if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) {
1069 /* Accept all packets */
1070 hwfilter.ulFilterFlags |= ACCEPT_ALL_PACKETS;
1071 sc->hwapi->pfnSetPacketFilter(sc->hwapi->pADCX, &hwfilter);
1072 NVE_UNLOCK(sc);
1073 return;
1074 }
1075 /* Setup multicast filter */
78
79#include <sys/param.h>
80#include <sys/systm.h>
81#include <sys/sockio.h>
82#include <sys/mbuf.h>
83#include <sys/malloc.h>
84#include <sys/kernel.h>
85#include <sys/socket.h>

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

1068 if (ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) {
1069 /* Accept all packets */
1070 hwfilter.ulFilterFlags |= ACCEPT_ALL_PACKETS;
1071 sc->hwapi->pfnSetPacketFilter(sc->hwapi->pADCX, &hwfilter);
1072 NVE_UNLOCK(sc);
1073 return;
1074 }
1075 /* Setup multicast filter */
1076 IF_ADDR_LOCK(ifp);
1076 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
1077 u_char *addrp;
1078
1079 if (ifma->ifma_addr->sa_family != AF_LINK)
1080 continue;
1081
1082 addrp = LLADDR((struct sockaddr_dl *) ifma->ifma_addr);
1083 for (i = 0; i < 6; i++) {
1084 u_int8_t mcaddr = addrp[i];
1085 andaddr[i] &= mcaddr;
1086 oraddr[i] |= mcaddr;
1087 }
1088 }
1077 TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) {
1078 u_char *addrp;
1079
1080 if (ifma->ifma_addr->sa_family != AF_LINK)
1081 continue;
1082
1083 addrp = LLADDR((struct sockaddr_dl *) ifma->ifma_addr);
1084 for (i = 0; i < 6; i++) {
1085 u_int8_t mcaddr = addrp[i];
1086 andaddr[i] &= mcaddr;
1087 oraddr[i] |= mcaddr;
1088 }
1089 }
1090 IF_ADDR_UNLOCK(ifp);
1089 for (i = 0; i < 6; i++) {
1090 hwfilter.acMulticastAddress[i] = andaddr[i] & oraddr[i];
1091 hwfilter.acMulticastMask[i] = andaddr[i] | (~oraddr[i]);
1092 }
1093
1094 /* Send filter to NVIDIA API */
1095 sc->hwapi->pfnSetPacketFilter(sc->hwapi->pADCX, &hwfilter);
1096

--- 627 unchanged lines hidden ---
1091 for (i = 0; i < 6; i++) {
1092 hwfilter.acMulticastAddress[i] = andaddr[i] & oraddr[i];
1093 hwfilter.acMulticastMask[i] = andaddr[i] | (~oraddr[i]);
1094 }
1095
1096 /* Send filter to NVIDIA API */
1097 sc->hwapi->pfnSetPacketFilter(sc->hwapi->pADCX, &hwfilter);
1098

--- 627 unchanged lines hidden ---