special usb hub handling, IDE disks, and retries all over the place
[linux-2.4.git] / drivers / usb / microtek.h
1  /*
2  * Driver for Microtek Scanmaker X6 USB scanner and possibly others.
3  * 
4  * (C) Copyright 2000 John Fremlin <vii@penguinpowered.com>
5  * (C) Copyright 2000 Oliver Neukum <Oliver.Neukum@lrz.uni-muenchen.de>
6  *
7  * See microtek.c for history
8  *
9  */
10
11 typedef void (*mts_scsi_cmnd_callback)(Scsi_Cmnd *);
12 typedef void (*mts_usb_urb_callback) (struct urb *);
13
14
15 struct mts_transfer_context
16 {
17         struct mts_desc* instance;
18         mts_scsi_cmnd_callback final_callback;
19         Scsi_Cmnd *srb;
20         
21         void* data;
22         unsigned data_length;
23         int data_pipe;
24         int fragment;
25
26         u8 status; /* status returned from ep_response after command completion */
27 };
28
29
30 struct mts_desc {
31         struct mts_desc *next;
32         struct mts_desc *prev;
33
34         struct usb_device *usb_dev;
35
36         int interface;
37
38         /* Endpoint addresses */
39         u8 ep_out;
40         u8 ep_response;
41         u8 ep_image;
42
43         struct Scsi_Host * host;
44         Scsi_Host_Template ctempl;
45         int host_number;
46
47         struct semaphore lock;
48
49         struct urb urb;
50         struct mts_transfer_context context;
51 };
52
53
54 #define MTS_EP_OUT      0x1
55 #define MTS_EP_RESPONSE 0x2
56 #define MTS_EP_IMAGE    0x3
57 #define MTS_EP_TOTAL    0x3
58
59 #define MTS_SCSI_ERR_MASK ~0x3fu
60