~ubuntu-branches/ubuntu/vivid/ndiswrapper/vivid

« back to all changes in this revision

Viewing changes to driver/usb.h

  • Committer: Package Import Robot
  • Author(s): Julian Andres Klode
  • Date: 2012-03-05 16:49:02 UTC
  • mfrom: (1.2.8)
  • Revision ID: package-import@ubuntu.com-20120305164902-rrir76um4yq4eimb
Tags: 1.57-1
* Imported Upstream version 1.57
  - Fixes build with kernel 3.2 (Closes: #655223, LP: #910597)
* Enable hardening build flags (Closes: #655249)
* patches/ndiswrapper-harden.patch: Use $(shell X) instead of `X`
* Update to Policy 3.9.3, copyright-format 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#define IOCTL_INTERNAL_USB_CYCLE_PORT                   0x0022001F
26
26
#define IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION     0x00220027
27
27
 
28
 
#define URB_FUNCTION_SELECT_CONFIGURATION            0x0000
29
 
#define URB_FUNCTION_SELECT_INTERFACE                0x0001
30
 
#define URB_FUNCTION_ABORT_PIPE                      0x0002
31
 
#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL       0x0003
32
 
#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL    0x0004
33
 
#define URB_FUNCTION_GET_FRAME_LENGTH                0x0005
34
 
#define URB_FUNCTION_SET_FRAME_LENGTH                0x0006
35
 
#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER        0x0007
36
 
#define URB_FUNCTION_CONTROL_TRANSFER                0x0008
37
 
#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER      0x0009
38
 
#define URB_FUNCTION_ISOCH_TRANSFER                  0x000A
39
 
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE      0x000B
40
 
#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE        0x000C
41
 
#define URB_FUNCTION_SET_FEATURE_TO_DEVICE           0x000D
42
 
#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE        0x000E
43
 
#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT         0x000F
44
 
#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE         0x0010
45
 
#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE      0x0011
46
 
#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT       0x0012
47
 
#define URB_FUNCTION_GET_STATUS_FROM_DEVICE          0x0013
48
 
#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE       0x0014
49
 
#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT        0x0015
50
 
#define URB_FUNCTION_RESERVED_0X0016                 0x0016
51
 
#define URB_FUNCTION_VENDOR_DEVICE                   0x0017
52
 
#define URB_FUNCTION_VENDOR_INTERFACE                0x0018
53
 
#define URB_FUNCTION_VENDOR_ENDPOINT                 0x0019
54
 
#define URB_FUNCTION_CLASS_DEVICE                    0x001A
55
 
#define URB_FUNCTION_CLASS_INTERFACE                 0x001B
56
 
#define URB_FUNCTION_CLASS_ENDPOINT                  0x001C
57
 
#define URB_FUNCTION_RESERVE_0X001D                  0x001D
58
 
#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL 0x001E
59
 
#define URB_FUNCTION_CLASS_OTHER                     0x001F
60
 
#define URB_FUNCTION_VENDOR_OTHER                    0x0020
61
 
#define URB_FUNCTION_GET_STATUS_FROM_OTHER           0x0021
62
 
#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER          0x0022
63
 
#define URB_FUNCTION_SET_FEATURE_TO_OTHER            0x0023
64
 
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT    0x0024
65
 
#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT      0x0025
66
 
#define URB_FUNCTION_GET_CONFIGURATION               0x0026
67
 
#define URB_FUNCTION_GET_INTERFACE                   0x0027
68
 
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE   0x0028
69
 
#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE     0x0029
70
 
#define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR       0x002A
71
 
#define URB_FUNCTION_RESERVE_0X002B                  0x002B
72
 
#define URB_FUNCTION_RESERVE_0X002C                  0x002C
73
 
#define URB_FUNCTION_RESERVE_0X002D                  0x002D
74
 
#define URB_FUNCTION_RESERVE_0X002E                  0x002E
75
 
#define URB_FUNCTION_RESERVE_0X002F                  0x002F
 
28
#define URB_FUNCTION_SELECT_CONFIGURATION               0x0000
 
29
#define URB_FUNCTION_SELECT_INTERFACE                   0x0001
 
30
#define URB_FUNCTION_ABORT_PIPE                         0x0002
 
31
#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL          0x0003
 
32
#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL       0x0004
 
33
#define URB_FUNCTION_GET_FRAME_LENGTH                   0x0005
 
34
#define URB_FUNCTION_SET_FRAME_LENGTH                   0x0006
 
35
#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER           0x0007
 
36
#define URB_FUNCTION_CONTROL_TRANSFER                   0x0008
 
37
#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER         0x0009
 
38
#define URB_FUNCTION_ISOCH_TRANSFER                     0x000A
 
39
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE         0x000B
 
40
#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE           0x000C
 
41
#define URB_FUNCTION_SET_FEATURE_TO_DEVICE              0x000D
 
42
#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE           0x000E
 
43
#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT            0x000F
 
44
#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE            0x0010
 
45
#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE         0x0011
 
46
#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT          0x0012
 
47
#define URB_FUNCTION_GET_STATUS_FROM_DEVICE             0x0013
 
48
#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE          0x0014
 
49
#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT           0x0015
 
50
#define URB_FUNCTION_RESERVED_0X0016                    0x0016
 
51
#define URB_FUNCTION_VENDOR_DEVICE                      0x0017
 
52
#define URB_FUNCTION_VENDOR_INTERFACE                   0x0018
 
53
#define URB_FUNCTION_VENDOR_ENDPOINT                    0x0019
 
54
#define URB_FUNCTION_CLASS_DEVICE                       0x001A
 
55
#define URB_FUNCTION_CLASS_INTERFACE                    0x001B
 
56
#define URB_FUNCTION_CLASS_ENDPOINT                     0x001C
 
57
#define URB_FUNCTION_RESERVE_0X001D                     0x001D
 
58
#define URB_FUNCTION_SYNC_RESET_PIPE_AND_CLEAR_STALL    0x001E
 
59
#define URB_FUNCTION_CLASS_OTHER                        0x001F
 
60
#define URB_FUNCTION_VENDOR_OTHER                       0x0020
 
61
#define URB_FUNCTION_GET_STATUS_FROM_OTHER              0x0021
 
62
#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER             0x0022
 
63
#define URB_FUNCTION_SET_FEATURE_TO_OTHER               0x0023
 
64
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT       0x0024
 
65
#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT         0x0025
 
66
#define URB_FUNCTION_GET_CONFIGURATION                  0x0026
 
67
#define URB_FUNCTION_GET_INTERFACE                      0x0027
 
68
#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE      0x0028
 
69
#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE        0x0029
 
70
#define URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR          0x002A
 
71
#define URB_FUNCTION_RESERVE_0X002B                     0x002B
 
72
#define URB_FUNCTION_RESERVE_0X002C                     0x002C
 
73
#define URB_FUNCTION_RESERVE_0X002D                     0x002D
 
74
#define URB_FUNCTION_RESERVE_0X002E                     0x002E
 
75
#define URB_FUNCTION_RESERVE_0X002F                     0x002F
76
76
// USB 2.0 calls start at 0x0030
77
 
#define URB_FUNCTION_SYNC_RESET_PIPE                 0x0030
78
 
#define URB_FUNCTION_SYNC_CLEAR_STALL                0x0031
79
 
#define URB_FUNCTION_CONTROL_TRANSFER_EX             0x0032
 
77
#define URB_FUNCTION_SYNC_RESET_PIPE                    0x0030
 
78
#define URB_FUNCTION_SYNC_CLEAR_STALL                   0x0031
 
79
#define URB_FUNCTION_CONTROL_TRANSFER_EX                0x0032
80
80
 
81
81
#define USBD_PF_CHANGE_MAX_PACKET               0x00000001
82
82
 
149
149
        void *reserved8[8];
150
150
};
151
151
 
152
 
typedef struct usb_endpoint_descriptor *usbd_pipe_handle;
153
 
typedef struct usb_descriptor_header usb_common_descriptor_t;
154
 
 
155
152
struct usbd_pipe_information {
156
153
        USHORT wMaxPacketSize;
157
154
        UCHAR bEndpointAddress;
158
155
        UCHAR bInterval;
159
156
        enum pipe_type type;
160
 
        usbd_pipe_handle handle;
 
157
        struct usb_endpoint_descriptor *handle;
161
158
        ULONG max_tx_size;
162
159
        ULONG flags;
163
160
};
219
216
 
220
217
struct usbd_bulk_or_intr_transfer {
221
218
        struct nt_urb_header header;
222
 
        usbd_pipe_handle pipe_handle;
 
219
        struct usb_endpoint_descriptor *pipe_handle;
223
220
        ULONG transfer_flags;
224
221
        ULONG transfer_buffer_length;
225
222
        void *transfer_buffer;
230
227
 
231
228
struct usbd_pipe_request {
232
229
        struct nt_urb_header header;
233
 
        usbd_pipe_handle pipe_handle;
 
230
        struct usb_endpoint_descriptor *pipe_handle;
234
231
};
235
232
 
236
233
struct usbd_vendor_or_class_request {
286
283
 
287
284
struct usbd_isochronous_transfer {
288
285
        struct nt_urb_header header;
289
 
        usbd_pipe_handle pipe_handle;
 
286
        struct usb_endpoint_descriptor *pipe_handle;
290
287
        ULONG transfer_flags;
291
288
        ULONG transfer_buffer_length;
292
289
        void *transfer_buffer;
357
354
NTSTATUS wrap_submit_irp(struct device_object *pdo, struct irp *irp);
358
355
void wrap_suspend_urbs(struct wrap_device *wd);
359
356
void wrap_resume_urbs(struct wrap_device *wd);
360
 
 
361
 
void USBD_InterfaceGetUSBDIVersion(void *context,
362
 
                                   struct usbd_version_info *version_info,
363
 
                                   ULONG *hcd_capa) wstdcall;
364
 
WIN_FUNC_DECL(USBD_InterfaceGetUSBDIVersion, 3);
365
 
BOOLEAN USBD_InterfaceIsDeviceHighSpeed(void *context) wstdcall;
366
 
WIN_FUNC_DECL(USBD_InterfaceIsDeviceHighSpeed, 1);
367
 
void USBD_InterfaceReference(void *context) wstdcall;
368
 
WIN_FUNC_DECL(USBD_InterfaceReference, 1);
369
 
void USBD_InterfaceDereference(void *context) wstdcall;
370
 
WIN_FUNC_DECL(USBD_InterfaceDereference, 1);
371
 
NTSTATUS USBD_InterfaceQueryBusTime(void *context, ULONG *frame) wstdcall;
372
 
WIN_FUNC_DECL(USBD_InterfaceQueryBusTime, 2);
373
 
NTSTATUS USBD_InterfaceSubmitIsoOutUrb(void *context,
374
 
                                       union nt_urb *nt_urb) wstdcall;
375
 
WIN_FUNC_DECL(USBD_InterfaceSubmitIsoOutUrb, 2);
376
 
NTSTATUS USBD_InterfaceQueryBusInformation(void *context, ULONG level, void *buf,
377
 
                                           ULONG *buf_length,
378
 
                                           ULONG *buf_actual_length) wstdcall;
379
 
WIN_FUNC_DECL(USBD_InterfaceQueryBusInformation, 5);
380
 
NTSTATUS USBD_InterfaceLogEntry(void *context, ULONG driver_tag, ULONG enum_tag,
381
 
                                ULONG p1, ULONG p2) wstdcall;
382
 
WIN_FUNC_DECL(USBD_InterfaceLogEntry, 5);
 
357
NTSTATUS usb_query_interface(struct wrap_device *wd,
 
358
                             struct io_stack_location *irp_sl);
383
359
 
384
360
#endif /* USB_H */