variax.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Line6 Linux USB driver - 0.9.1beta
  3. *
  4. * Copyright (C) 2004-2010 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. #ifndef VARIAX_H
  12. #define VARIAX_H
  13. #include <linux/spinlock.h>
  14. #include <linux/usb.h>
  15. #include <linux/wait.h>
  16. #include <sound/core.h>
  17. #include "driver.h"
  18. #define VARIAX_STARTUP_DELAY1 1000
  19. #define VARIAX_STARTUP_DELAY3 100
  20. #define VARIAX_STARTUP_DELAY4 100
  21. /*
  22. Stages of Variax startup procedure
  23. */
  24. enum {
  25. VARIAX_STARTUP_INIT = 1,
  26. VARIAX_STARTUP_VERSIONREQ,
  27. VARIAX_STARTUP_WAIT,
  28. VARIAX_STARTUP_ACTIVATE,
  29. VARIAX_STARTUP_WORKQUEUE,
  30. VARIAX_STARTUP_SETUP,
  31. VARIAX_STARTUP_LAST = VARIAX_STARTUP_SETUP - 1
  32. };
  33. struct usb_line6_variax {
  34. /**
  35. Generic Line6 USB data.
  36. */
  37. struct usb_line6 line6;
  38. /**
  39. Buffer for activation code.
  40. */
  41. unsigned char *buffer_activate;
  42. /**
  43. Handler for device initializaton.
  44. */
  45. struct work_struct startup_work;
  46. /**
  47. Timers for device initializaton.
  48. */
  49. struct timer_list startup_timer1;
  50. struct timer_list startup_timer2;
  51. /**
  52. Current progress in startup procedure.
  53. */
  54. int startup_progress;
  55. };
  56. extern void line6_variax_disconnect(struct usb_interface *interface);
  57. extern int line6_variax_init(struct usb_interface *interface,
  58. struct usb_line6_variax *variax);
  59. extern void line6_variax_process_message(struct usb_line6_variax *variax);
  60. #endif