4 * USBD and USB device driver definitions
6 * FIXME : Obsolete header.. Use usb.h instead.
8 * This file is part of the w32api package.
11 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
13 * THIS SOFTWARE IS NOT COPYRIGHTED
15 * This source code is offered for use in the public domain. You may
16 * use, modify or distribute it freely.
18 * This code is distributed in the hope that it will be useful but
19 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
20 * DISCLAIMED. This includes but is not limited to warranties of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 /* Helper macro to enable gcc's extension. */
28 #ifndef __GNU_EXTENSION
30 #define __GNU_EXTENSION __extension__
32 #define __GNU_EXTENSION
43 #define USBD_STATUS_CANCELLING ((USBD_STATUS)0x00020000L)
44 #define USBD_STATUS_CANCELING ((USBD_STATUS)0x00020000L)
45 #define USBD_STATUS_NO_MEMORY ((USBD_STATUS)0x80000100L)
46 #define USBD_STATUS_ERROR ((USBD_STATUS)0x80000000L)
47 #define USBD_STATUS_REQUEST_FAILED ((USBD_STATUS)0x80000500L)
48 #define USBD_STATUS_HALTED ((USBD_STATUS)0xC0000000L)
51 #define USBD_HALTED(Status) ((ULONG)(Status) >> 30 == 3)
52 #define USBD_STATUS(Status) ((ULONG)(Status) & 0x0FFFFFFFL)
54 #define URB_FUNCTION_RESERVED0 0x0016
55 #define URB_FUNCTION_RESERVED 0x001D
56 #define URB_FUNCTION_LAST 0x0029
58 #define USBD_PF_DOUBLE_BUFFER 0x00000002
60 #ifdef USBD_PF_VALID_MASK
61 #undef USBD_PF_VALID_MASK
64 #define USBD_PF_VALID_MASK (USBD_PF_CHANGE_MAX_PACKET | USBD_PF_DOUBLE_BUFFER | \
65 USBD_PF_ENABLE_RT_THREAD_ACCESS | USBD_PF_MAP_ADD_TRANSFERS)
67 #define USBD_TRANSFER_DIRECTION_BIT 0
68 #define USBD_SHORT_TRANSFER_OK_BIT 1
69 #define USBD_START_ISO_TRANSFER_ASAP_BIT 2
71 #ifdef USBD_TRANSFER_DIRECTION
72 #undef USBD_TRANSFER_DIRECTION
75 #define USBD_TRANSFER_DIRECTION(x) ((x) & USBD_TRANSFER_DIRECTION_IN)