diff options
author | cinap_lenrek <cinap_lenrek@flatbox.9hal> | 2012-03-07 23:50:58 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@flatbox.9hal> | 2012-03-07 23:50:58 +0100 |
commit | f0facb2ed88a2d9768340c9577aede526df3c09f (patch) | |
tree | bb2e5bc87996e29c140fb2f025e1c006c77ceba2 /sys/src/9/pc/usbehcipc.c | |
parent | c4535df0c431cfbfdd635d53570477d3199f1519 (diff) |
usbehci: import changes from sources (portreset, port handover handling), set interrupt threshold to 1 uframe
Diffstat (limited to 'sys/src/9/pc/usbehcipc.c')
-rw-r--r-- | sys/src/9/pc/usbehcipc.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/src/9/pc/usbehcipc.c b/sys/src/9/pc/usbehcipc.c index c67901bed..b1394c039 100644 --- a/sys/src/9/pc/usbehcipc.c +++ b/sys/src/9/pc/usbehcipc.c @@ -15,6 +15,7 @@ #include "usbehci.h" static Ctlr* ctlrs[Nhcis]; +static int maxehci = Nhcis; /* Isn't this cap list search in a helper function? */ static void @@ -89,9 +90,7 @@ ehcireset(Ctlr *ctlr) if(i == 100) print("ehci %#p controller reset timed out\n", ctlr->capio); } - - /* requesting more interrupts per µframe may miss interrupts */ - opio->cmd |= Citc8; /* 1 intr. per ms */ + opio->cmd |= Citc1; /* 1 intr. per µframe */ coherence(); switch(opio->cmd & Cflsmask){ case Cfls1024: @@ -202,11 +201,10 @@ scanpci(void) * currently, if we enable a second ehci controller, * we'll wedge solid after iunlock in init for the second one. */ - if (i > 0) { -// iprint("usbehci: ignoring controllers after the first, " -// "at %#p\n", io); -// ctlrs[i] = nil; - iprint("usbehci: multiple controllers present\n"); + if (i >= maxehci) { + iprint("usbehci: ignoring controllers after first %d, " + "at %#p\n", maxehci, io); + ctlrs[i] = nil; } } } @@ -215,12 +213,16 @@ static int reset(Hci *hp) { int i; + char *s; Ctlr *ctlr; Ecapio *capio; Pcidev *p; static Lock resetlck; - if(getconf("*nousbehci")) + s = getconf("*maxehci"); + if (s != nil && s[0] >= '0' && s[0] <= '9') + maxehci = atoi(s); + if(maxehci == 0 || getconf("*nousbehci")) return -1; ilock(&resetlck); scanpci(); |