summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/ether79c970.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-06-09 07:21:36 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2014-06-09 07:21:36 +0200
commit858d3e39ab7e792c1d6e853ed699aeb5faf7d47c (patch)
tree6ef217407c2d3ca6ae0bd0420b6b548501f97465 /sys/src/9/pc/ether79c970.c
parent01b5ac14024a26f4f1771bc7027e146e86f9c2c3 (diff)
ether79c970: fix mistake
fix bug introduced by amd64 support: forgot to update ring index i on receive. surprisingly this was working until there where more than one packet to process. sorry. ilock the controller while processing rings. this should be fixed and use kprocs instead.
Diffstat (limited to 'sys/src/9/pc/ether79c970.c')
-rw-r--r--sys/src/9/pc/ether79c970.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/src/9/pc/ether79c970.c b/sys/src/9/pc/ether79c970.c
index e77b1cd3b..bb1741201 100644
--- a/sys/src/9/pc/ether79c970.c
+++ b/sys/src/9/pc/ether79c970.c
@@ -404,6 +404,7 @@ intrloop:
* until a descriptor is encountered still owned by the chip.
*/
if(csr0 & Rint){
+ ilock(ctlr);
i = ctlr->rdrx;
dre = &ctlr->rdr[i];
while(!(dre->md1 & Own)){
@@ -435,16 +436,17 @@ intrloop:
dre->md2 = 0;
dre->md1 = Own|(-Rbsize & 0xFFFF);
- ctlr->rdrx = NEXT(ctlr->rdrx, Nrdre);
- dre = &ctlr->rdr[ctlr->rdrx];
+ i = ctlr->rdrx = NEXT(ctlr->rdrx, Nrdre);
+ dre = &ctlr->rdr[i];
}
+ iunlock(ctlr);
}
/*
* Transmitter interrupt: wakeup anyone waiting for a free descriptor.
*/
if(csr0 & Tint){
- lock(ctlr);
+ ilock(ctlr);
while(ctlr->ntq){
i = ctlr->tdri;
dre = &ctlr->tdr[i];
@@ -474,7 +476,7 @@ intrloop:
ctlr->tdri = NEXT(ctlr->tdri, Ntdre);
}
txstart(ether);
- unlock(ctlr);
+ iunlock(ctlr);
}
goto intrloop;
}