Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Line6 Linux USB driver - 0.8.0 |
| 3 | * |
| 4 | * Copyright (C) 2004-2009 Markus Grabner (grabner@icg.tugraz.at) |
| 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 DUMPREQUEST_H |
| 13 | #define DUMPREQUEST_H |
| 14 | |
| 15 | |
| 16 | #include <linux/usb.h> |
| 17 | #include <linux/wait.h> |
| 18 | |
| 19 | #include <sound/core.h> |
| 20 | |
| 21 | |
| 22 | enum { |
| 23 | LINE6_DUMP_NONE, |
| 24 | LINE6_DUMP_CURRENT |
| 25 | }; |
| 26 | |
| 27 | |
| 28 | struct line6_dump_reqbuf { |
| 29 | /** |
| 30 | Buffer for dump requests. |
| 31 | */ |
| 32 | unsigned char *buffer; |
| 33 | |
| 34 | /** |
| 35 | Size of dump request. |
| 36 | */ |
| 37 | size_t length; |
| 38 | }; |
| 39 | |
| 40 | /** |
| 41 | Provides the functionality to request channel/model/... dump data from a |
| 42 | Line6 device. |
| 43 | */ |
| 44 | struct line6_dump_request { |
| 45 | /** |
| 46 | Wait queue for access to program dump data. |
| 47 | */ |
| 48 | wait_queue_head_t wait; |
| 49 | |
| 50 | /** |
| 51 | Indicates an unfinished program dump request. |
| 52 | 0: no dump |
| 53 | 1: dump current settings |
| 54 | Other device-specific values are also allowed. |
| 55 | */ |
| 56 | int in_progress; |
| 57 | |
| 58 | /** |
| 59 | Timer for delayed dump request. |
| 60 | */ |
| 61 | struct timer_list timer; |
| 62 | |
| 63 | /** |
| 64 | Flag if initial dump request has been successful. |
| 65 | */ |
| 66 | char ok; |
| 67 | |
| 68 | /** |
| 69 | Dump request buffers |
| 70 | */ |
| 71 | struct line6_dump_reqbuf reqbufs[1]; |
| 72 | }; |
| 73 | |
| 74 | extern void line6_dump_finished(struct line6_dump_request *l6dr); |
Greg Kroah-Hartman | a49e483 | 2009-02-27 21:09:55 -0800 | [diff] [blame] | 75 | extern int line6_dump_request_async(struct line6_dump_request *l6dr, |
| 76 | struct usb_line6 *line6, int num); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 77 | extern void line6_dump_started(struct line6_dump_request *l6dr, int dest); |
| 78 | extern void line6_dumpreq_destruct(struct line6_dump_request *l6dr); |
| 79 | extern void line6_dumpreq_destructbuf(struct line6_dump_request *l6dr, int num); |
Greg Kroah-Hartman | a49e483 | 2009-02-27 21:09:55 -0800 | [diff] [blame] | 80 | extern int line6_dumpreq_init(struct line6_dump_request *l6dr, const void *buf, |
| 81 | size_t len); |
| 82 | extern int line6_dumpreq_initbuf(struct line6_dump_request *l6dr, |
| 83 | const void *buf, size_t len, int num); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 84 | extern void line6_invalidate_current(struct line6_dump_request *l6dr); |
| 85 | extern void line6_startup_delayed(struct line6_dump_request *l6dr, int seconds, |
Greg Kroah-Hartman | a49e483 | 2009-02-27 21:09:55 -0800 | [diff] [blame] | 86 | void (*function)(unsigned long), void *data); |
Markus Grabner | 705ecec | 2009-02-27 19:43:04 -0800 | [diff] [blame] | 87 | extern int line6_wait_dump(struct line6_dump_request *l6dr, int nonblock); |
| 88 | |
| 89 | |
| 90 | #endif |