summaryrefslogtreecommitdiff
path: root/sys/src/9/mtx
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/mtx
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/mtx')
-rw-r--r--sys/src/9/mtx/devether.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/src/9/mtx/devether.c b/sys/src/9/mtx/devether.c
index 8a5457954..51c63857d 100644
--- a/sys/src/9/mtx/devether.c
+++ b/sys/src/9/mtx/devether.c
@@ -204,7 +204,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++;
@@ -221,18 +221,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 || memcmp(pkt->d, ether->bcast, sizeof(pkt->d)) == 0 || ether->prom)
+ if(etheriq(ether, bp, loopback) == 0)
+ return len;
- if(!loopback){
- qbwrite(ether->oq, bp);
+ qbwrite(ether->oq, bp);
+ if(ether->transmit != nil)
ether->transmit(ether);
- } else
- freeb(bp);
-
return len;
}