diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-09-17 14:18:40 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-09-17 14:18:40 +0200 |
commit | cb9a5a19b0a992d222dcb07c6a368c710a44bb28 (patch) | |
tree | 1e52e4314c6a1d859823cabd02fbbb781666deb8 /sys/src | |
parent | 382abccf277ff1323b0f2d2aecdad9a74175ad09 (diff) |
nusb/ether: promisc and multicast support for admtek pegasus (aue)
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/cmd/nusb/ether/aue.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sys/src/cmd/nusb/ether/aue.c b/sys/src/cmd/nusb/ether/aue.c index cccfefeaa..ce36fc8c2 100644 --- a/sys/src/cmd/nusb/ether/aue.c +++ b/sys/src/cmd/nusb/ether/aue.c @@ -202,6 +202,32 @@ auetransmit(Dev *ep, Block *b) 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 @@ aueinit(Dev *d) 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; } |