Commit | Line | Data |
---|---|---|
705ececd | 1 | /* |
e1a164d7 | 2 | * Line6 Linux USB driver - 0.9.1beta |
705ececd | 3 | * |
1027f476 | 4 | * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at) |
705ececd MG |
5 | * |
6 | * This program is free software; you can redistribute it and/or | |
7 | * modify it under the terms of the GNU General Public License as | |
8 | * published by the Free Software Foundation, version 2. | |
9 | * | |
10 | */ | |
11 | ||
12 | #ifndef VARIAX_H | |
13 | #define VARIAX_H | |
14 | ||
705ececd MG |
15 | #include <linux/spinlock.h> |
16 | #include <linux/usb.h> | |
17 | #include <linux/wait.h> | |
705ececd MG |
18 | #include <sound/core.h> |
19 | ||
1027f476 | 20 | #include "driver.h" |
705ececd MG |
21 | #include "dumprequest.h" |
22 | ||
1027f476 MG |
23 | #define VARIAX_STARTUP_DELAY1 1000 |
24 | #define VARIAX_STARTUP_DELAY3 100 | |
25 | #define VARIAX_STARTUP_DELAY4 100 | |
705ececd | 26 | |
e1a164d7 MG |
27 | /* |
28 | Stages of Variax startup procedure | |
29 | */ | |
30 | enum { | |
31 | VARIAX_STARTUP_INIT = 1, | |
32 | VARIAX_STARTUP_VERSIONREQ, | |
33 | VARIAX_STARTUP_WAIT, | |
34 | VARIAX_STARTUP_ACTIVATE, | |
35 | VARIAX_STARTUP_DUMPREQ, | |
36 | VARIAX_STARTUP_WORKQUEUE, | |
37 | VARIAX_STARTUP_SETUP, | |
38 | VARIAX_STARTUP_LAST = VARIAX_STARTUP_SETUP - 1 | |
39 | }; | |
705ececd MG |
40 | |
41 | enum { | |
42 | VARIAX_DUMP_PASS1 = LINE6_DUMP_CURRENT, | |
43 | VARIAX_DUMP_PASS2, | |
44 | VARIAX_DUMP_PASS3 | |
45 | }; | |
46 | ||
705ececd | 47 | /** |
1027f476 | 48 | Binary Variax model dump |
705ececd MG |
49 | */ |
50 | struct variax_model { | |
51 | /** | |
1027f476 | 52 | Header information (including program name). |
705ececd MG |
53 | */ |
54 | unsigned char name[18]; | |
55 | ||
56 | /** | |
1027f476 | 57 | Model parameters. |
705ececd MG |
58 | */ |
59 | unsigned char control[78 * 2]; | |
60 | }; | |
61 | ||
62 | struct usb_line6_variax { | |
63 | /** | |
1027f476 | 64 | Generic Line6 USB data. |
705ececd MG |
65 | */ |
66 | struct usb_line6 line6; | |
67 | ||
68 | /** | |
1027f476 MG |
69 | Dump request structure. |
70 | Append two extra buffers for 3-pass data query. | |
705ececd | 71 | */ |
e1a164d7 MG |
72 | struct line6_dump_request dumpreq; |
73 | struct line6_dump_reqbuf extrabuf[2]; | |
705ececd MG |
74 | |
75 | /** | |
1027f476 | 76 | Buffer for activation code. |
705ececd MG |
77 | */ |
78 | unsigned char *buffer_activate; | |
79 | ||
705ececd | 80 | /** |
1027f476 | 81 | Current model settings. |
705ececd MG |
82 | */ |
83 | struct variax_model model_data; | |
84 | ||
85 | /** | |
1027f476 MG |
86 | Name of connected guitar. |
87 | */ | |
88 | unsigned char guitar[18]; | |
89 | ||
90 | /** | |
91 | Name of current model bank. | |
705ececd MG |
92 | */ |
93 | unsigned char bank[18]; | |
94 | ||
705ececd | 95 | /** |
1027f476 MG |
96 | Handler for device initializaton. |
97 | */ | |
98 | struct work_struct startup_work; | |
99 | ||
100 | /** | |
e1a164d7 | 101 | Timers for device initializaton. |
1027f476 | 102 | */ |
e1a164d7 MG |
103 | struct timer_list startup_timer1; |
104 | struct timer_list startup_timer2; | |
1027f476 MG |
105 | |
106 | /** | |
107 | Current progress in startup procedure. | |
705ececd | 108 | */ |
1027f476 | 109 | int startup_progress; |
705ececd MG |
110 | }; |
111 | ||
1027f476 MG |
112 | extern void line6_variax_disconnect(struct usb_interface *interface); |
113 | extern int line6_variax_init(struct usb_interface *interface, | |
114 | struct usb_line6_variax *variax); | |
115 | extern void line6_variax_process_message(struct usb_line6_variax *variax); | |
705ececd | 116 | |
705ececd | 117 | #endif |