usbxhci: simplify xecp()
This commit is contained in:
parent
c74538a67e
commit
cd108e2f0b
1 changed files with 12 additions and 14 deletions
|
@ -317,22 +317,20 @@ xecp(Ctlr *ctlr, uchar id, u32int *p)
|
||||||
{
|
{
|
||||||
u32int x;
|
u32int x;
|
||||||
|
|
||||||
if(p != nil) {
|
if(p == nil){
|
||||||
x = *p;
|
p = ctlr->mmio;
|
||||||
goto Next;
|
|
||||||
}
|
|
||||||
x = ctlr->hccparams>>16;
|
x = ctlr->hccparams>>16;
|
||||||
if(x == 0)
|
} else
|
||||||
return nil;
|
x = (*p>>8) & 255;
|
||||||
p = ctlr->mmio + x;
|
while(x != 0){
|
||||||
while(((x = *p) & 255) != id){
|
|
||||||
Next:
|
|
||||||
x >>= 8, x &= 255;
|
|
||||||
if(x == 0)
|
|
||||||
return nil;
|
|
||||||
p += x;
|
p += x;
|
||||||
}
|
x = *p;
|
||||||
|
if((x & 255) == id)
|
||||||
return p;
|
return p;
|
||||||
|
x >>= 8;
|
||||||
|
x &= 255;
|
||||||
|
}
|
||||||
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue