ref: cb9a5a19b0a992d222dcb07c6a368c710a44bb28
parent: 382abccf277ff1323b0f2d2aecdad9a74175ad09
author: cinap_lenrek <[email protected]>
date: Sat Sep 17 10:18:40 EDT 2016
nusb/ether: promisc and multicast support for admtek pegasus (aue)
--- a/sys/src/cmd/nusb/ether/aue.c
+++ b/sys/src/cmd/nusb/ether/aue.c
@@ -202,6 +202,32 @@
freeb(b);
}
+static int
+auepromiscuous(Dev *d, int on)
+{
+ int r;
+
+ r = csr8r(d, Ctl2);
+ if(on)
+ r |= C2prom;
+ else
+ r &= ~C2prom;
+ return csr8w(d, Ctl2, r);
+}
+
+static int
+auemulticast(Dev *d, uchar*, int)
+{
+ int r;
+
+ r = csr8r(d, Ctl0);
+ if(nmulti)
+ r |= C0allmulti;
+ else
+ r &= ~C0allmulti;
+ return csr8w(d, Ctl0, r);
+}
+
int
aueinit(Dev *d)
{
@@ -219,7 +245,11 @@
csr8w(d, Ctl0, C0rxstatappend|C0rxen);
csr8w(d, Ctl0, csr8r(d, Ctl0)|C0txen);
csr8w(d, Ctl2, csr8r(d, Ctl2)|C2ep3clr);
+
epreceive = auereceive;
eptransmit = auetransmit;
+ eppromiscuous = auepromiscuous;
+ epmulticast = auemulticast;
+
return 0;
}