]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/net/ether_if_module.c
xnu-4570.51.1.tar.gz
[apple/xnu.git] / bsd / net / ether_if_module.c
index 3a86d2674f4bab1f6c4cf43a741c06a3c83dfb67..3335bb6c452aba00087fb3fa51a2c689dd2be787 100644 (file)
 #if IF_BRIDGE
 #include <net/if_bridgevar.h>
 #endif /* IF_BRIDGE */
+#if IF_FAKE
+#include <net/if_fake_var.h>
+#endif /* IF_FAKE */
 
 #include <net/dlil.h>
 
-#define memcpy(x,y,z)  bcopy(y, x, z)
-
 SYSCTL_DECL(_net_link);
 SYSCTL_NODE(_net_link, IFT_ETHER, ether, CTLFLAG_RW|CTLFLAG_LOCKED, 0,
     "Ethernet");
@@ -118,7 +119,11 @@ struct en_desc {
 };
 
 /* descriptors are allocated in blocks of ETHER_DESC_BLK_SIZE */
+#if CONFIG_EMBEDDED
+#define ETHER_DESC_BLK_SIZE (2) /* IP, ARP */
+#else
 #define ETHER_DESC_BLK_SIZE (10)
+#endif
 
 /*
  * Header for the demux list, hangs off of IFP at if_family_cookie
@@ -550,7 +555,7 @@ ether_frameout_extended(struct ifnet *ifp, struct mbuf **m,
         * Add local net header.  If no space in first mbuf,
         * allocate another.
         */
-       M_PREPEND(*m, sizeof (struct ether_header), M_DONTWAIT);
+       M_PREPEND(*m, sizeof (struct ether_header), M_DONTWAIT, 0);
        if (*m == NULL)
                return (EJUSTRETURN);
 
@@ -636,6 +641,10 @@ ether_family_init(void)
 #if IF_BRIDGE
        bridgeattach(0);
 #endif /* IF_BRIDGE */
+#if IF_FAKE
+       if_fake_init();
+#endif /* IF_FAKE */
+
 done:
 
        return (error);