diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-09-17 14:06:03 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2016-09-17 14:06:03 +0200 |
commit | 382abccf277ff1323b0f2d2aecdad9a74175ad09 (patch) | |
tree | c8bd3869869864ac30b03807cc98f2386d9ccb4a /sys/src/cmd | |
parent | ce07c1d6e70948f731ea02c6c523ea4c1e0ae977 (diff) |
nusb/ether: multicast and promisc support for rtl8150 (url)
Diffstat (limited to 'sys/src/cmd')
-rw-r--r-- | sys/src/cmd/nusb/ether/url.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/src/cmd/nusb/ether/url.c b/sys/src/cmd/nusb/ether/url.c index a411c6d4d..42c2d6ea2 100644 --- a/sys/src/cmd/nusb/ether/url.c +++ b/sys/src/cmd/nusb/ether/url.c @@ -300,6 +300,37 @@ urltransmit(Dev *ep, Block *b) freeb(b); } +static int +urlpromiscuous(Dev *d, int on) +{ + int r; + + r = csr16r(d, Rcr); + if(on) + r |= Aam|Aap; + else { + r &= ~Aap; + if(nmulti == 0) + r &= ~Aam; + } + return csr16w(d, Rcr, r); +} + +static int +urlmulticast(Dev *d, uchar*, int) +{ + int r; + + r = csr16r(d, Rcr); + if(nmulti) + r |= Aam; + else { + if(nprom == 0) + r &= ~Aam; + } + return csr16w(d, Rcr, r); +} + int urlinit(Dev *d) { @@ -325,5 +356,8 @@ urlinit(Dev *d) epreceive = urlreceive; eptransmit = urltransmit; + eppromiscuous = urlpromiscuous; + epmulticast = urlmulticast; + return 0; } |