ref: 3d0f4da104a2d9a73e017e121f1f25f5964e494e
parent: d6e0e9c402e215dc5659ad525e3e652501f76810
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Feb 11 14:51:23 EST 2018
ethersink: provide promisc and multicast functions for v6, set out queue limit to 0 on attach, add to pc64 config
--- a/sys/src/9/pc64/pc64
+++ b/sys/src/9/pc64/pc64
@@ -68,7 +68,7 @@
# ethervgbe pci ethermii
# ethervt6102 pci ethermii
# ethervt6105m pci ethermii
-# ethersink
+ ethersink
# ethersmc devi82365 cis
etheryuk pci
# etherwavelan wavelan devi82365 cis pci
--- a/sys/src/9/port/ethersink.c
+++ b/sys/src/9/port/ethersink.c
@@ -33,22 +33,35 @@
}
static void
-nop(Ether*)
+attach(Ether *ether)
{
+ /* silently discard output */
+ qnoblock(ether->oq, 1);
+ qsetlimit(ether->oq, 0);
}
+static void
+multicast(void *, uchar*, int)
+{
+}
+
+static void
+promiscuous(void *, int)
+{
+}
+
static int
reset(Ether* ether)
{
+ static uchar zeros[Eaddrlen];
+
if(ether->type==nil)
return -1;
ether->mbps = 1000;
- ether->attach = nop;
- ether->transmit = nop;
- ether->ifstat = nil;
+ ether->attach = attach;
+ ether->multicast = multicast;
+ ether->promiscuous = promiscuous;
ether->ctl = ctl;
- ether->promiscuous = nil;
- ether->multicast = nil;
ether->arg = ether;
return 0;
}