Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/net Pull up revisions 1.18-1.19, 1.21 (requested by...



details:   https://anonhg.NetBSD.org/src/rev/6c2eef70d8d0
branches:  netbsd-1-5
changeset: 490457:6c2eef70d8d0
user:      jhawk <jhawk%NetBSD.org@localhost>
date:      Sun Dec 31 20:14:25 2000 +0000

description:
Pull up revisions 1.18-1.19, 1.21 (requested by bouyer):
        Add support for 802.1Q virtual LANs.

diffstat:

 sys/net/if_ether.h |  32 +++++++++++++++++++++++++++++---
 1 files changed, 29 insertions(+), 3 deletions(-)

diffs (69 lines):

diff -r 2a6f8670a5a7 -r 6c2eef70d8d0 sys/net/if_ether.h
--- a/sys/net/if_ether.h        Sun Dec 31 20:14:21 2000 +0000
+++ b/sys/net/if_ether.h        Sun Dec 31 20:14:25 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ether.h,v 1.17 2000/06/17 20:57:20 matt Exp $       */
+/*     $NetBSD: if_ether.h,v 1.17.2.1 2000/12/31 20:14:25 jhawk Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -49,6 +49,11 @@
 #define        ETHER_MAX_LEN   1518    /* maximum frame length, including CRC */
 
 /*
+ * Some Ethernet extensions.
+ */
+#define        ETHER_VLAN_ENCAP_LEN 4  /* length of 802.1Q VLAN encapsulation */
+
+/*
  * Ethernet address - 6 octets
  * this is only used by the ethers(3) functions.
  */
@@ -73,6 +78,15 @@
 #define        ETHERMIN        (ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
 
 /*
+ * Compute the maximum frame size based on ethertype (i.e. possible
+ * encapsulation) and whether or not an FCS is present.
+ */
+#define        ETHER_MAX_FRAME(etype, hasfcs)                                  \
+       (ETHERMTU + ETHER_HDR_LEN +                                     \
+        ((hasfcs) ? ETHER_CRC_LEN : 0) +                               \
+        (((etype) == ETHERTYPE_VLAN) ? ETHER_VLAN_ENCAP_LEN : 0))
+
+/*
  * Ethernet CRC32 polynomials (big- and little-endian verions).
  */
 #define        ETHER_CRC_POLY_LE       0xedb88320
@@ -127,10 +141,21 @@
  */
 struct ethercom {
        struct   ifnet ec_if;                   /* network-visible interface */
-       LIST_HEAD(, ether_multi) ec_multiaddrs; /* list of ether multicast addrs */
-       int      ec_multicnt;                   /* length of ec_multiaddrs list */
+       LIST_HEAD(, ether_multi) ec_multiaddrs; /* list of ether multicast
+                                                  addrs */
+       int      ec_multicnt;                   /* length of ec_multiaddrs
+                                                  list */
+       int      ec_capabilities;               /* capabilities, provided by
+                                                  driver */
+       int      ec_capenable;                  /* tells hardware which
+                                                  capabilities to enable */
+
+       int      ec_nvlans;                     /* # VLANs on this interface */
 };
 
+#define        ETHERCAP_VLAN_MTU       0x00000001      /* VLAN-compatible MTU */
+#define        ETHERCAP_VLAN_HWTAGGING 0x00000002      /* hardware VLAN tag support */
+
 #ifdef _KERNEL
 extern u_int8_t etherbroadcastaddr[ETHER_ADDR_LEN];
 extern u_int8_t ether_ipmulticast_min[ETHER_ADDR_LEN];
@@ -139,6 +164,7 @@
 int    ether_addmulti (struct ifreq *, struct ethercom *);
 int    ether_delmulti (struct ifreq *, struct ethercom *);
 int    ether_changeaddr (struct ifreq *, struct ethercom *);
+int    ether_multiaddr(struct sockaddr *, u_int8_t[], u_int8_t[]);
 #endif /* _KERNEL */
 
 /*



Home | Main Index | Thread Index | Old Index