1 #include <aros/debug.h>
2 #include <devices/usbhardware.h>
3 #include <exec/memory.h>
4 #include <proto/exec.h>
8 APTR
usbGetBuffer(APTR data
, ULONG len
, UWORD dir
)
12 if (len
&& (((IPTR
)data
+ len
- 1) >> 32) != 0)
14 ret
= AllocVec(len
, MEMF_31BIT
|MEMF_PUBLIC
);
16 if (ret
&& (dir
== UHDIR_OUT
))
17 CopyMem(data
, ret
, len
);
23 void usbReleaseBuffer(APTR buffer
, APTR data
, ULONG len
, UWORD dir
)
25 if (buffer
&& (buffer
!= data
))
27 if (len
&& (dir
== UHDIR_IN
))
28 CopyMem(buffer
, data
, len
);