From 3d0f4da104a2d9a73e017e121f1f25f5964e494e Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 11 Feb 2018 19:51:23 +0100 Subject: [PATCH] ethersink: provide promisc and multicast functions for v6, set out queue limit to 0 on attach, add to pc64 config --- sys/src/9/pc64/pc64 | 2 +- sys/src/9/port/ethersink.c | 25 +++++++++++++++++++------ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/sys/src/9/pc64/pc64 b/sys/src/9/pc64/pc64 index 73dfc4c33..07cd66172 100644 --- a/sys/src/9/pc64/pc64 +++ b/sys/src/9/pc64/pc64 @@ -68,7 +68,7 @@ link # ethervgbe pci ethermii # ethervt6102 pci ethermii # ethervt6105m pci ethermii -# ethersink + ethersink # ethersmc devi82365 cis etheryuk pci # etherwavelan wavelan devi82365 cis pci diff --git a/sys/src/9/port/ethersink.c b/sys/src/9/port/ethersink.c index a005af3a8..aa62d3719 100644 --- a/sys/src/9/port/ethersink.c +++ b/sys/src/9/port/ethersink.c @@ -33,22 +33,35 @@ ctl(Ether *ether, void *buf, long n) } 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; }