1 #include <devices/usbhardware.h>
2 #include <exec/memory.h>
3 #include <proto/exec.h>
7 APTR
usbGetBuffer(APTR data
, ULONG len
, UWORD dir
)
11 if (((IPTR
)data
+ len
- 1) >> 32)
13 ret
= AllocVec(len
, MEMF_31BIT
|MEMF_PUBLIC
);
15 if (ret
&& (dir
== UHDIR_OUT
))
16 CopyMem(data
, ret
, len
);
22 void usbReleaseBuffer(APTR buffer
, APTR data
, ULONG len
, UWORD dir
)
24 if (buffer
&& (buffer
!= data
))
26 if (len
&& (dir
== UHDIR_IN
))
27 CopyMem(buffer
, data
, len
);