fixed interrupt problem with BCM driver on multicore machines

This commit is contained in:
aiju 2011-04-24 17:23:17 +02:00
parent abf197c323
commit b267359b69

View file

@ -22,7 +22,7 @@
typedef struct Ctlr Ctlr; typedef struct Ctlr Ctlr;
struct Ctlr { struct Ctlr {
Lock txlock; Lock txlock, imlock;
Ctlr *link; Ctlr *link;
Pcidev *pdev; Pcidev *pdev;
ulong *nic, *status; ulong *nic, *status;
@ -404,6 +404,7 @@ bcminterrupt(Ureg*, void *arg)
edev = arg; edev = arg;
ctlr = edev->ctlr; ctlr = edev->ctlr;
ilock(&ctlr->imlock);
dummyread(csr32(ctlr, InterruptMailbox)); dummyread(csr32(ctlr, InterruptMailbox));
csr32(ctlr, InterruptMailbox) = 1; csr32(ctlr, InterruptMailbox) = 1;
status = ctlr->status[0]; status = ctlr->status[0];
@ -416,6 +417,7 @@ bcminterrupt(Ureg*, void *arg)
bcmtransclean(edev); bcmtransclean(edev);
bcmtransmit(edev); bcmtransmit(edev);
csr32(ctlr, InterruptMailbox) = tag << 24; csr32(ctlr, InterruptMailbox) = tag << 24;
iunlock(&ctlr->imlock);
} }
static void static void
@ -664,5 +666,5 @@ bcmpnp(Ether* edev)
void void
etherbcmlink(void) etherbcmlink(void)
{ {
addethercard("BCM57xx", bcmpnp); addethercard("BCM5755", bcmpnp);
} }