review: patch to restore VLAN kernel API in RELENG_6
Gleb Smirnoff
glebius at FreeBSD.org
Fri Jan 13 09:06:00 PST 2006
--
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE
-------------- next part --------------
? sys/dev/bge/if_bge.cbak
? sys/dev/em/if_em.cbak
? sys/dev/ixgb/if_ixgb.cbak
? sys/dev/nge/if_nge.cbak
? sys/dev/re/if_re.cbak
? sys/dev/txp/if_txp.cbak
? sys/dev/vge/if_vge.cbak
? sys/net80211/ieee80211_input.cbak
Index: sys/dev/bge/if_bge.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/bge/if_bge.c,v
retrieving revision 1.91.2.7
diff -u -r1.91.2.7 if_bge.c
--- sys/dev/bge/if_bge.c 13 Jan 2006 11:51:08 -0000 1.91.2.7
+++ sys/dev/bge/if_bge.c 13 Jan 2006 17:04:31 -0000
@@ -2862,7 +2862,7 @@
* attach that information to the packet.
*/
if (have_tag) {
- VLAN_INPUT_TAG(ifp, m, vlan_tag);
+ VLAN_INPUT_TAG_NEW(ifp, m, vlan_tag);
if (m == NULL)
continue;
}
Index: sys/dev/em/if_em.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/em/if_em.c,v
retrieving revision 1.65.2.11
diff -u -r1.65.2.11 if_em.c
--- sys/dev/em/if_em.c 13 Jan 2006 11:51:09 -0000 1.65.2.11
+++ sys/dev/em/if_em.c 13 Jan 2006 17:04:32 -0000
@@ -3015,7 +3015,7 @@
em_receive_checksum(adapter, current_desc,
adapter->fmp);
if (current_desc->status & E1000_RXD_STAT_VP)
- VLAN_INPUT_TAG(ifp, adapter->fmp,
+ VLAN_INPUT_TAG_NEW(ifp, adapter->fmp,
(le16toh(current_desc->special) &
E1000_RXD_SPC_VLAN_MASK));
m = adapter->fmp;
Index: sys/dev/ixgb/if_ixgb.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ixgb/if_ixgb.c,v
retrieving revision 1.10.2.5
diff -u -r1.10.2.5 if_ixgb.c
--- sys/dev/ixgb/if_ixgb.c 13 Jan 2006 11:51:09 -0000 1.10.2.5
+++ sys/dev/ixgb/if_ixgb.c 13 Jan 2006 17:04:32 -0000
@@ -2143,7 +2143,7 @@
adapter->fmp);
if (current_desc->status & IXGB_RX_DESC_STATUS_VP)
- VLAN_INPUT_TAG(eh, adapter->fmp,
+ VLAN_INPUT_TAG_NEW(eh, adapter->fmp,
current_desc->special);
else
ether_input(ifp, eh, adapter->fmp);
@@ -2151,7 +2151,7 @@
ixgb_receive_checksum(adapter, current_desc,
adapter->fmp);
if (current_desc->status & IXGB_RX_DESC_STATUS_VP)
- VLAN_INPUT_TAG(ifp, adapter->fmp,
+ VLAN_INPUT_TAG_NEW(ifp, adapter->fmp,
current_desc->special);
if (adapter->fmp != NULL) {
Index: sys/dev/nge/if_nge.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/nge/if_nge.c,v
retrieving revision 1.75.2.5
diff -u -r1.75.2.5 if_nge.c
--- sys/dev/nge/if_nge.c 13 Jan 2006 11:51:10 -0000 1.75.2.5
+++ sys/dev/nge/if_nge.c 13 Jan 2006 17:04:32 -0000
@@ -1228,7 +1228,7 @@
* to vlan_input() instead of ether_input().
*/
if (extsts & NGE_RXEXTSTS_VLANPKT) {
- VLAN_INPUT_TAG(ifp, m,
+ VLAN_INPUT_TAG_NEW(ifp, m,
ntohs(extsts & NGE_RXEXTSTS_VTCI));
if (m == NULL)
continue;
Index: sys/dev/re/if_re.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/re/if_re.c,v
retrieving revision 1.46.2.11
diff -u -r1.46.2.11 if_re.c
--- sys/dev/re/if_re.c 13 Jan 2006 11:51:10 -0000 1.46.2.11
+++ sys/dev/re/if_re.c 13 Jan 2006 17:04:33 -0000
@@ -1671,7 +1671,7 @@
}
if (rxvlan & RL_RDESC_VLANCTL_TAG) {
- VLAN_INPUT_TAG(ifp, m,
+ VLAN_INPUT_TAG_NEW(ifp, m,
ntohs((rxvlan & RL_RDESC_VLANCTL_DATA)));
if (m == NULL)
continue;
Index: sys/dev/txp/if_txp.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/txp/if_txp.c,v
retrieving revision 1.31.2.4
diff -u -r1.31.2.4 if_txp.c
--- sys/dev/txp/if_txp.c 13 Jan 2006 11:51:10 -0000 1.31.2.4
+++ sys/dev/txp/if_txp.c 13 Jan 2006 17:04:33 -0000
@@ -766,7 +766,7 @@
}
if (rxd->rx_stat & RX_STAT_VLAN) {
- VLAN_INPUT_TAG(ifp, m, htons(rxd->rx_vlan >> 16));
+ VLAN_INPUT_TAG_NEW(ifp, m, htons(rxd->rx_vlan >> 16));
if (m == NULL)
goto next;
}
Index: sys/dev/vge/if_vge.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/vge/if_vge.c,v
retrieving revision 1.14.2.5
diff -u -r1.14.2.5 if_vge.c
--- sys/dev/vge/if_vge.c 13 Jan 2006 11:51:10 -0000 1.14.2.5
+++ sys/dev/vge/if_vge.c 13 Jan 2006 17:04:33 -0000
@@ -1491,7 +1491,7 @@
}
if (rxstat & VGE_RDSTS_VTAG) {
- VLAN_INPUT_TAG(ifp, m,
+ VLAN_INPUT_TAG_NEW(ifp, m,
ntohs((rxctl & VGE_RDCTL_VLANID)));
if (m == NULL)
continue;
Index: sys/net/if_vlan_var.h
===================================================================
RCS file: /home/ncvs/src/sys/net/if_vlan_var.h,v
retrieving revision 1.21.2.1
diff -u -r1.21.2.1 if_vlan_var.h
--- sys/net/if_vlan_var.h 13 Jan 2006 11:51:11 -0000 1.21.2.1
+++ sys/net/if_vlan_var.h 13 Jan 2006 17:04:33 -0000
@@ -102,7 +102,28 @@
*/
#define VLAN_TAG_VALUE(_mt) (*(u_int *)((_mt) + 1))
-#define VLAN_INPUT_TAG(_ifp, _m, _t) do { \
+/*
+ * This macro is kept for API compatibility.
+ */
+#define VLAN_INPUT_TAG(_ifp, _m, _t, _errcase) do { \
+ struct m_tag *mtag; \
+ mtag = m_tag_alloc(MTAG_VLAN, MTAG_VLAN_TAG, \
+ sizeof (u_int), M_NOWAIT); \
+ if (mtag != NULL) { \
+ VLAN_TAG_VALUE(mtag) = (_t); \
+ m_tag_prepend((_m), mtag); \
+ (_m)->m_flags |= M_VLANTAG; \
+ } else { \
+ (_ifp)->if_ierrors++; \
+ m_freem(_m); \
+ _errcase; \
+ } \
+} while (0)
+
+/*
+ * This macro is equal to VLAN_INPUT_TAG() in HEAD.
+ */
+#define VLAN_INPUT_TAG_NEW(_ifp, _m, _t) do { \
struct m_tag *mtag; \
mtag = m_tag_alloc(MTAG_VLAN, MTAG_VLAN_TAG, \
sizeof (u_int), M_NOWAIT); \
Index: sys/net80211/ieee80211_input.c
===================================================================
RCS file: /home/ncvs/src/sys/net80211/ieee80211_input.c,v
retrieving revision 1.62.2.6
diff -u -r1.62.2.6 ieee80211_input.c
--- sys/net80211/ieee80211_input.c 13 Jan 2006 11:51:11 -0000 1.62.2.6
+++ sys/net80211/ieee80211_input.c 13 Jan 2006 17:04:34 -0000
@@ -710,7 +710,7 @@
if (m != NULL) {
if (ni->ni_vlan != 0) {
/* attach vlan tag */
- VLAN_INPUT_TAG(ifp, m, ni->ni_vlan);
+ VLAN_INPUT_TAG_NEW(ifp, m, ni->ni_vlan);
if (m == NULL)
goto out; /* XXX goto err? */
}
More information about the freebsd-arch
mailing list