summaryrefslogtreecommitdiff
path: root/sys/src/9/kw
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2013-12-16 19:19:15 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2013-12-16 19:19:15 +0100
commitea6fea596b67dea542e7a1994b10473228118400 (patch)
tree27a31ccfd31084d6a61d3f1c3e53886b6b061c48 /sys/src/9/kw
parent6946118644bc1d18e99de13b4a93b2026e3560a4 (diff)
devether: remove qfull prints and fix loopback packet handling of etheroq()
dont spam the console with qfull warnings. this makes things worse. handle loopback packets as stated in the comment. we call etheriq() with fromwire=1 for loopback packets so etheriq() can pass the packet on (without copying) or free it. dont inhibit interrupts while calling etheriq(). etheriq() can safely be called from process and interrupt context. it is unclear what this was supposed to fix and testing didnt seem to have any odd effects.
Diffstat (limited to 'sys/src/9/kw')
-rw-r--r--sys/src/9/kw/devether.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/sys/src/9/kw/devether.c b/sys/src/9/kw/devether.c
index 63d06f62c..df59c22b1 100644
--- a/sys/src/9/kw/devether.c
+++ b/sys/src/9/kw/devether.c
@@ -213,7 +213,7 @@ etheriq(Ether* ether, Block* bp, int fromwire)
static int
etheroq(Ether* ether, Block* bp)
{
- int len, loopback, s;
+ int len, loopback;
Etherpkt *pkt;
ether->outpackets++;
@@ -230,19 +230,13 @@ etheroq(Ether* ether, Block* bp)
pkt = (Etherpkt*)bp->rp;
len = BLEN(bp);
loopback = memcmp(pkt->d, ether->ea, sizeof(pkt->d)) == 0;
- if(loopback || memcmp(pkt->d, ether->bcast, sizeof(pkt->d)) == 0 || ether->prom){
- s = splhi();
- etheriq(ether, bp, 0);
- splx(s);
- }
-
- if(!loopback){
- qbwrite(ether->oq, bp);
- if(ether->transmit != nil)
- ether->transmit(ether);
- } else
- freeb(bp);
+ if(loopback || memcmp(pkt->d, ether->bcast, sizeof(pkt->d)) == 0 || ether->prom)
+ if(etheriq(ether, bp, loopback) == 0)
+ return len;
+ qbwrite(ether->oq, bp);
+ if(ether->transmit != nil)
+ ether->transmit(ether);
return len;
}