git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
USB - Slight host API change
[tpg/acess2.git]
/
KernelLand
/
Modules
/
USB
/
Core
/
usb_lowlevel.c
diff --git
a/KernelLand/Modules/USB/Core/usb_lowlevel.c
b/KernelLand/Modules/USB/Core/usb_lowlevel.c
index
d8e1485
..
3450bd8
100644
(file)
--- a/
KernelLand/Modules/USB/Core/usb_lowlevel.c
+++ b/
KernelLand/Modules/USB/Core/usb_lowlevel.c
@@
-25,13
+25,14
@@
void *USB_int_Request(tUSBHost *Host, int Addr, int EndPt, int Type, int Req, in
void *hdl;
// TODO: Sanity check (and check that Type is valid)
struct sDeviceRequest req;
void *hdl;
// TODO: Sanity check (and check that Type is valid)
struct sDeviceRequest req;
+ int dest = Addr * 16 + EndPt; // TODO: Validate
req.ReqType = Type;
req.Request = Req;
req.Value = LittleEndian16( Val );
req.Index = LittleEndian16( Indx );
req.Length = LittleEndian16( Len );
req.ReqType = Type;
req.Request = Req;
req.Value = LittleEndian16( Val );
req.Index = LittleEndian16( Indx );
req.Length = LittleEndian16( Len );
- hdl = Host->HostDef->SendSETUP(Host->Ptr,
Addr, EndP
t, 0, NULL, NULL, &req, sizeof(req));
+ hdl = Host->HostDef->SendSETUP(Host->Ptr,
des
t, 0, NULL, NULL, &req, sizeof(req));
// TODO: Data toggle?
// TODO: Multi-packet transfers
// TODO: Data toggle?
// TODO: Multi-packet transfers
@@
-39,9
+40,9
@@
void *USB_int_Request(tUSBHost *Host, int Addr, int EndPt, int Type, int Req, in
{
void *hdl2;
{
void *hdl2;
- hdl = Host->HostDef->SendIN(Host->Ptr,
Addr, EndP
t, 0, NULL, NULL, Data, Len);
+ hdl = Host->HostDef->SendIN(Host->Ptr,
des
t, 0, NULL, NULL, Data, Len);
- hdl2 = Host->HostDef->SendOUT(Host->Ptr,
Addr, EndP
t, 0, NULL, NULL, NULL, 0);
+ hdl2 = Host->HostDef->SendOUT(Host->Ptr,
des
t, 0, NULL, NULL, NULL, 0);
while( Host->HostDef->IsOpComplete(Host->Ptr, hdl2) == 0 )
Time_Delay(1);
}
while( Host->HostDef->IsOpComplete(Host->Ptr, hdl2) == 0 )
Time_Delay(1);
}
@@
-50,12
+51,12
@@
void *USB_int_Request(tUSBHost *Host, int Addr, int EndPt, int Type, int Req, in
void *hdl2;
if( Len > 0 )
void *hdl2;
if( Len > 0 )
- hdl = Host->HostDef->SendOUT(Host->Ptr,
Addr, EndP
t, 0, NULL, NULL, Data, Len);
+ hdl = Host->HostDef->SendOUT(Host->Ptr,
des
t, 0, NULL, NULL, Data, Len);
else
hdl = NULL;
// Status phase (DataToggle=1)
else
hdl = NULL;
// Status phase (DataToggle=1)
- hdl2 = Host->HostDef->SendIN(Host->Ptr,
Addr, EndP
t, 1, NULL, NULL, NULL, 0);
+ hdl2 = Host->HostDef->SendIN(Host->Ptr,
des
t, 1, NULL, NULL, NULL, 0);
while( Host->HostDef->IsOpComplete(Host->Ptr, hdl2) == 0 )
Time_Delay(1);
}
while( Host->HostDef->IsOpComplete(Host->Ptr, hdl2) == 0 )
Time_Delay(1);
}
@@
-74,6
+75,7
@@
int USB_int_ReadDescriptor(tUSBDevice *Dev, int Endpoint, int Type, int Index, i
struct sDeviceRequest req;
int bToggle = 0;
void *final;
struct sDeviceRequest req;
int bToggle = 0;
void *final;
+ int dest = Dev->Address*16 + Endpoint;
req.ReqType = 0x80;
switch( Type & 0xF00 )
req.ReqType = 0x80;
switch( Type & 0xF00 )
@@
-89,7
+91,7
@@
int USB_int_ReadDescriptor(tUSBDevice *Dev, int Endpoint, int Type, int Index, i
req.Length = LittleEndian16( Length );
Dev->Host->HostDef->SendSETUP(
req.Length = LittleEndian16( Length );
Dev->Host->HostDef->SendSETUP(
- Dev->Host->Ptr,
Dev->Address, Endpoin
t,
+ Dev->Host->Ptr,
des
t,
0, NULL, NULL,
&req, sizeof(req)
);
0, NULL, NULL,
&req, sizeof(req)
);
@@
-98,7
+100,7
@@
int USB_int_ReadDescriptor(tUSBDevice *Dev, int Endpoint, int Type, int Index, i
while( Length > ciMaxPacketSize )
{
Dev->Host->HostDef->SendIN(
while( Length > ciMaxPacketSize )
{
Dev->Host->HostDef->SendIN(
- Dev->Host->Ptr,
Dev->Address, Endpoin
t,
+ Dev->Host->Ptr,
des
t,
bToggle, NULL, NULL,
Dest, ciMaxPacketSize
);
bToggle, NULL, NULL,
Dest, ciMaxPacketSize
);
@@
-107,7
+109,7
@@
int USB_int_ReadDescriptor(tUSBDevice *Dev, int Endpoint, int Type, int Index, i
}
final = Dev->Host->HostDef->SendIN(
}
final = Dev->Host->HostDef->SendIN(
- Dev->Host->Ptr,
Dev->Address, Endpoin
t,
+ Dev->Host->Ptr,
des
t,
bToggle, INVLPTR, NULL,
Dest, Length
);
bToggle, INVLPTR, NULL,
Dest, Length
);
UCC
git Repository :: git.ucc.asn.au