Kernel/USB - Still broken, reworking host controller API to give driver more information
[tpg/acess2.git] / KernelLand / Modules / USB / Core / usb_io.c
index 25ff59d..745e8a6 100644 (file)
@@ -25,7 +25,7 @@ struct sAsyncOp
 // === PROTOTYPES ===
 void   USB_ReadDescriptor(tUSBInterface *Iface, int Type, int Index, int Length, void *Data);
 void   USB_Request(tUSBInterface *Iface, int Endpoint, int Type, int Req, int Value, int Index, int Len, void *Data);
-void   USB_AsyncCallback(void *Ptr, void *Buf, int Length);
+void   USB_AsyncCallback(void *Ptr, void *Buf, size_t Length);
 void   USB_AsyncThread(void *unused);
 
 // === GLOBALS ===
@@ -79,11 +79,12 @@ void USB_RecvDataA(tUSBInterface *Dev, int Endpoint, int Length, void *DataBuf,
        op->Data = DataBuf;
 
        // TODO: Handle transfers that are larger than one packet
+       // TODO: Data toggle
 
        host = Dev->Dev->Host;
        LOG("IN from %p %i:%i", host->Ptr, Dev->Dev->Address, op->Endpt->EndpointNum);
-       host->HostDef->SendIN(
-               host->Ptr, Dev->Dev->Address, op->Endpt->EndpointNum,
+       host->HostDef->BulkIN(
+               host->Ptr, Dev->Dev->Address*16 + op->Endpt->EndpointNum,
                0, USB_AsyncCallback, op,
                DataBuf, Length
                );
@@ -93,7 +94,7 @@ void USB_RecvDataA(tUSBInterface *Dev, int Endpoint, int Length, void *DataBuf,
 //     Log_Warning("USB", "TODO: Implement USB_RecvDataA");
 }
 
-void USB_AsyncCallback(void *Ptr, void *Buf, int Length)
+void USB_AsyncCallback(void *Ptr, void *Buf, size_t Length)
 {
        tAsyncOp *op = Ptr;
        op->Length = Length;

UCC git Repository :: git.ucc.asn.au