Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
usbusx2y.h
Go to the documentation of this file.
1 #ifndef USBUSX2Y_H
2 #define USBUSX2Y_H
3 #include "../usbaudio.h"
4 #include "../midi.h"
5 #include "usbus428ctldefs.h"
6 
7 #define NRURBS 2
8 
9 
10 #define URBS_AsyncSeq 10
11 #define URB_DataLen_AsyncSeq 32
13  struct urb *urb[URBS_AsyncSeq];
14  char *buffer;
15 };
16 
18  int submitted;
19  int len;
20  struct urb *urb[0];
21 };
22 
23 #include "usx2yhwdeppcm.h"
24 
25 struct usX2Ydev {
26  struct usb_device *dev;
28  int stride;
29  struct urb *In04urb;
30  void *In04Buf;
31  char In04Last[24];
32  unsigned In04IntCalls;
36  unsigned int rate,
37  format;
45  struct snd_usX2Y_substream * volatile prepare_subs;
49  int pcm_devs;
50 };
51 
52 
54  struct usX2Ydev *usX2Y;
56 
57  int endpoint;
58  unsigned int maxpacksize; /* max packet size in bytes */
59 
61 #define state_STOPPED 0
62 #define state_STARTING1 1
63 #define state_STARTING2 2
64 #define state_STARTING3 3
65 #define state_PREPARED 4
66 #define state_PRERUNNING 6
67 #define state_RUNNING 8
68 
69  int hwptr; /* free frame position in the buffer (only for playback) */
70  int hwptr_done; /* processed frame position in the buffer */
71  int transfer_done; /* processed frames since last period update */
72 
73  struct urb *urb[NRURBS]; /* data urb table */
74  struct urb *completed_urb;
75  char *tmpbuf; /* temporary buffer for playback */
76 };
77 
78 
79 #define usX2Y(c) ((struct usX2Ydev *)(c)->private_data)
80 
81 int usX2Y_audio_create(struct snd_card *card);
82 
84 int usX2Y_In04_init(struct usX2Ydev *usX2Y);
85 
86 #define NAME_ALLCAPS "US-X2Y"
87 
88 #endif