Added
Link Here
|
1 |
https://svnweb.freebsd.org/changeset/base/353844 |
2 |
|
3 |
--- if_em.c.orig 2020-04-08 15:13:17 UTC |
4 |
+++ if_em.c |
5 |
@@ -2275,7 +2275,11 @@ em_disable_promisc(struct adapter *adapter) |
6 |
if (if_getflags(ifp) & IFF_ALLMULTI) |
7 |
mcnt = MAX_NUM_MULTICAST_ADDRESSES; |
8 |
else |
9 |
+#if __FreeBSD_version > 1300053 |
10 |
+ mcnt = if_llmaddr_count(ifp); |
11 |
+#else |
12 |
mcnt = if_multiaddr_count(ifp, MAX_NUM_MULTICAST_ADDRESSES); |
13 |
+#endif |
14 |
/* Don't disable if in MAX groups */ |
15 |
if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) |
16 |
reg_rctl &= (~E1000_RCTL_MPE); |
17 |
@@ -2283,7 +2287,21 @@ em_disable_promisc(struct adapter *adapter) |
18 |
E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); |
19 |
} |
20 |
|
21 |
+#if __FreeBSD_version > 1300053 |
22 |
+static u_int |
23 |
+em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) |
24 |
+{ |
25 |
+ u8 *mta = arg; |
26 |
|
27 |
+ if (cnt == MAX_NUM_MULTICAST_ADDRESSES) |
28 |
+ return (1); |
29 |
+ |
30 |
+ bcopy(LLADDR(sdl), &mta[cnt * ETHER_ADDR_LEN], ETHER_ADDR_LEN); |
31 |
+ |
32 |
+ return (1); |
33 |
+} |
34 |
+#endif |
35 |
+ |
36 |
/********************************************************************* |
37 |
* Multicast Update |
38 |
* |
39 |
@@ -2314,7 +2332,11 @@ em_set_multi(struct adapter *adapter) |
40 |
msec_delay(5); |
41 |
} |
42 |
|
43 |
+#if __FreeBSD_version > 1300053 |
44 |
+ mcnt = if_foreach_llmaddr(ifp, em_copy_maddr, mta); |
45 |
+#else |
46 |
if_multiaddr_array(ifp, mta, &mcnt, MAX_NUM_MULTICAST_ADDRESSES); |
47 |
+#endif |
48 |
|
49 |
if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES) { |
50 |
reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); |
51 |
--- if_lem.c.orig 2020-04-08 15:13:17 UTC |
52 |
+++ if_lem.c |
53 |
@@ -2019,7 +2019,11 @@ lem_disable_promisc(struct adapter *adapter) |
54 |
if (if_getflags(ifp) & IFF_ALLMULTI) |
55 |
mcnt = MAX_NUM_MULTICAST_ADDRESSES; |
56 |
else |
57 |
+#if __FreeBSD_version > 1300053 |
58 |
+ mcnt = if_llmaddr_count(ifp); |
59 |
+#else |
60 |
mcnt = if_multiaddr_count(ifp, MAX_NUM_MULTICAST_ADDRESSES); |
61 |
+#endif |
62 |
|
63 |
/* Don't disable if in MAX groups */ |
64 |
if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) |
65 |
@@ -2028,7 +2032,21 @@ lem_disable_promisc(struct adapter *adapter) |
66 |
E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); |
67 |
} |
68 |
|
69 |
+#if __FreeBSD_version > 1300053 |
70 |
+static u_int |
71 |
+em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) |
72 |
+{ |
73 |
+ u8 *mta = arg; |
74 |
|
75 |
+ if (cnt == MAX_NUM_MULTICAST_ADDRESSES) |
76 |
+ return (1); |
77 |
+ |
78 |
+ bcopy(LLADDR(sdl), &mta[cnt * ETHER_ADDR_LEN], ETHER_ADDR_LEN); |
79 |
+ |
80 |
+ return (1); |
81 |
+} |
82 |
+#endif |
83 |
+ |
84 |
/********************************************************************* |
85 |
* Multicast Update |
86 |
* |
87 |
@@ -2059,7 +2077,11 @@ lem_set_multi(struct adapter *adapter) |
88 |
msec_delay(5); |
89 |
} |
90 |
|
91 |
+#if __FreeBSD_version > 1300053 |
92 |
+ mcnt = if_foreach_llmaddr(ifp, em_copy_maddr, mta); |
93 |
+#else |
94 |
if_multiaddr_array(ifp, mta, &mcnt, MAX_NUM_MULTICAST_ADDRESSES); |
95 |
+#endif |
96 |
|
97 |
if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES) { |
98 |
reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); |