mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-25 15:10:28 +00:00
Fix KUSB.ZC pointer star formatting.
This commit is contained in:
parent
645f383a9f
commit
f23a32d331
1 changed files with 9 additions and 10 deletions
|
@ -19,7 +19,7 @@ class CUSB //Not implemented
|
|||
U8 num, //USB dev num
|
||||
bus, dev, fun;
|
||||
U16 ports, pad;
|
||||
U32 * frame_lst;
|
||||
U32 *frame_lst;
|
||||
};
|
||||
|
||||
//USB Pkt ID's
|
||||
|
@ -54,20 +54,19 @@ class CUSB //Not implemented
|
|||
|
||||
I64 sys_num_usb = 0;
|
||||
CUSB sys_usb_devs[USB_NUM];
|
||||
MemSet(sys_usb_devs, 0, USB_NUM* sizeof(CUSB));
|
||||
MemSet(sys_usb_devs, 0, USB_NUM * sizeof(CUSB));
|
||||
|
||||
U0 USBInitOne(I64 b, I64 d, I64 f)
|
||||
{
|
||||
CUSB * u;
|
||||
if (sys_num_usb < USB_NUM &&
|
||||
PCIReadU16(b, d, f, 0) == 0x8086)
|
||||
CUSB *u;
|
||||
if (sys_num_usb < USB_NUM && PCIReadU16(b, d, f, 0) == 0x8086)
|
||||
{
|
||||
u = &sys_usb_devs[sys_num_usb++];
|
||||
u->num = sys_num_usb;
|
||||
u->bus = b;
|
||||
u->dev = d;
|
||||
u->fun = f;
|
||||
u->ports = PCIReadU32(b, d, f, 0x20) &~0x1F;
|
||||
u->ports = PCIReadU32(b, d, f, 0x20) & ~0x1F;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +88,7 @@ U0 USBInitAll() //This is only valid for my ICH10 dev
|
|||
USBInitOne(0, 26, 2);
|
||||
}
|
||||
|
||||
CUSBTD* USBAllocTD()
|
||||
CUSBTD *USBAllocTD()
|
||||
{
|
||||
return MAllocAligned(sizeof(CUSBTD), 0x10, dev.uncached_heap);
|
||||
}
|
||||
|
@ -102,12 +101,12 @@ U0 USBFreeTD(CUSBTD *tmptd)
|
|||
U32* USBAllocFrameLst(I64 usb_num, I64 size)
|
||||
{
|
||||
//aligned to 0x1000
|
||||
CUSB * u;
|
||||
CUSB *u;
|
||||
if (0 <= usb_num < sys_num_usb)
|
||||
{
|
||||
u = &sys_usb_devs[usb_num];
|
||||
Free(u->frame_lst);
|
||||
u->frame_lst = MAllocAligned(size* sizeof(U32), 0x1000, dev.uncached_heap);
|
||||
u->frame_lst = MAllocAligned(size * sizeof(U32), 0x1000, dev.uncached_heap);
|
||||
OutU16(u->ports + USBP_CMD, 0); //Stop
|
||||
OutU16(u->ports + USBP_FRNUM, 0);
|
||||
OutU32(u->ports + USBP_FRBASEADD, u->frame_lst);
|
||||
|
@ -115,4 +114,4 @@ U32* USBAllocFrameLst(I64 usb_num, I64 size)
|
|||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue