This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / sound / usb / usx2y / usbusx2y.h
1 #ifndef USBUSX2Y_H
2 #define USBUSX2Y_H
3 #include "../usbaudio.h"
4 #include "usbus428ctldefs.h" 
5
6 #define NRURBS          2       /* */
7 #define NRPACKS         1       /* FIXME: Currently only 1 works.
8                                    usb-frames/ms per urb: 1 and 2 are supported.
9                                    setting to 2 will PERHAPS make it easier for slow machines.
10                                    Jitter will be higher though.
11                                    On my PIII 500Mhz Laptop setting to 1 is the only way to go 
12                                    for PLAYING synths. i.e. Jack & Aeolus sound quit nicely 
13                                    at 4 periods 64 frames. 
14                                 */
15
16 #define URBS_AsyncSeq 10
17 #define URB_DataLen_AsyncSeq 32
18 typedef struct {
19         struct urb*     urb[URBS_AsyncSeq];
20         char*   buffer;
21 } snd_usX2Y_AsyncSeq_t;
22
23 typedef struct {
24         int     submitted;
25         int     len;
26         struct urb*     urb[0];
27 } snd_usX2Y_urbSeq_t;
28
29 typedef struct snd_usX2Y_substream snd_usX2Y_substream_t;
30
31 typedef struct {
32         snd_usb_audio_t         chip;
33         int                     stride;
34         struct urb              *In04urb;
35         void                    *In04Buf;
36         char                    In04Last[24];
37         unsigned                In04IntCalls;
38         snd_usX2Y_urbSeq_t      *US04;
39         wait_queue_head_t       In04WaitQueue;
40         snd_usX2Y_AsyncSeq_t    AS04;
41         unsigned int            rate,
42                                 format;
43         int                     refframes;
44         int                     chip_status;
45         struct semaphore        open_mutex;
46         us428ctls_sharedmem_t   *us428ctls_sharedmem;
47         wait_queue_head_t       us428ctls_wait_queue_head;
48         snd_usX2Y_substream_t   *substream[4];
49 } usX2Ydev_t;
50
51
52 #define usX2Y(c) ((usX2Ydev_t*)(c)->private_data)
53
54 int usX2Y_audio_create(snd_card_t* card);
55
56 int usX2Y_AsyncSeq04_init(usX2Ydev_t* usX2Y);
57 int usX2Y_In04_init(usX2Ydev_t* usX2Y);
58
59 #define NAME_ALLCAPS "US-X2Y"
60
61 #endif