firewire.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _SOUND_FIREWIRE_H_INCLUDED
  3. #define _SOUND_FIREWIRE_H_INCLUDED
  4. #include <linux/ioctl.h>
  5. #include <linux/types.h>
  6. /* events can be read() from the hwdep device */
  7. #define SNDRV_FIREWIRE_EVENT_LOCK_STATUS 0x000010cc
  8. #define SNDRV_FIREWIRE_EVENT_DICE_NOTIFICATION 0xd1ce004e
  9. #define SNDRV_FIREWIRE_EVENT_EFW_RESPONSE 0x4e617475
  10. #define SNDRV_FIREWIRE_EVENT_DIGI00X_MESSAGE 0x746e736c
  11. #define SNDRV_FIREWIRE_EVENT_MOTU_NOTIFICATION 0x64776479
  12. #define SNDRV_FIREWIRE_EVENT_TASCAM_CONTROL 0x7473636d
  13. struct snd_firewire_event_common {
  14. unsigned int type; /* SNDRV_FIREWIRE_EVENT_xxx */
  15. };
  16. struct snd_firewire_event_lock_status {
  17. unsigned int type;
  18. unsigned int status; /* 0/1 = unlocked/locked */
  19. };
  20. struct snd_firewire_event_dice_notification {
  21. unsigned int type;
  22. unsigned int notification; /* DICE-specific bits */
  23. };
  24. #define SND_EFW_TRANSACTION_USER_SEQNUM_MAX ((__u32)((__u16)~0) - 1)
  25. /* each field should be in big endian */
  26. struct snd_efw_transaction {
  27. __be32 length;
  28. __be32 version;
  29. __be32 seqnum;
  30. __be32 category;
  31. __be32 command;
  32. __be32 status;
  33. __be32 params[0];
  34. };
  35. struct snd_firewire_event_efw_response {
  36. unsigned int type;
  37. __be32 response[0]; /* some responses */
  38. };
  39. struct snd_firewire_event_digi00x_message {
  40. unsigned int type;
  41. __u32 message; /* Digi00x-specific message */
  42. };
  43. struct snd_firewire_event_motu_notification {
  44. unsigned int type;
  45. __u32 message; /* MOTU-specific bits. */
  46. };
  47. struct snd_firewire_tascam_change {
  48. unsigned int index;
  49. __be32 before;
  50. __be32 after;
  51. };
  52. struct snd_firewire_event_tascam_control {
  53. unsigned int type;
  54. struct snd_firewire_tascam_change changes[0];
  55. };
  56. union snd_firewire_event {
  57. struct snd_firewire_event_common common;
  58. struct snd_firewire_event_lock_status lock_status;
  59. struct snd_firewire_event_dice_notification dice_notification;
  60. struct snd_firewire_event_efw_response efw_response;
  61. struct snd_firewire_event_digi00x_message digi00x_message;
  62. struct snd_firewire_event_tascam_control tascam_control;
  63. struct snd_firewire_event_motu_notification motu_notification;
  64. };
  65. #define SNDRV_FIREWIRE_IOCTL_GET_INFO _IOR('H', 0xf8, struct snd_firewire_get_info)
  66. #define SNDRV_FIREWIRE_IOCTL_LOCK _IO('H', 0xf9)
  67. #define SNDRV_FIREWIRE_IOCTL_UNLOCK _IO('H', 0xfa)
  68. #define SNDRV_FIREWIRE_IOCTL_TASCAM_STATE _IOR('H', 0xfb, struct snd_firewire_tascam_state)
  69. #define SNDRV_FIREWIRE_TYPE_DICE 1
  70. #define SNDRV_FIREWIRE_TYPE_FIREWORKS 2
  71. #define SNDRV_FIREWIRE_TYPE_BEBOB 3
  72. #define SNDRV_FIREWIRE_TYPE_OXFW 4
  73. #define SNDRV_FIREWIRE_TYPE_DIGI00X 5
  74. #define SNDRV_FIREWIRE_TYPE_TASCAM 6
  75. #define SNDRV_FIREWIRE_TYPE_MOTU 7
  76. #define SNDRV_FIREWIRE_TYPE_FIREFACE 8
  77. struct snd_firewire_get_info {
  78. unsigned int type; /* SNDRV_FIREWIRE_TYPE_xxx */
  79. unsigned int card; /* same as fw_cdev_get_info.card */
  80. unsigned char guid[8];
  81. char device_name[16]; /* device node in /dev */
  82. };
  83. /*
  84. * SNDRV_FIREWIRE_IOCTL_LOCK prevents the driver from streaming.
  85. * Returns -EBUSY if the driver is already streaming.
  86. */
  87. #define SNDRV_FIREWIRE_TASCAM_STATE_COUNT 64
  88. struct snd_firewire_tascam_state {
  89. __be32 data[SNDRV_FIREWIRE_TASCAM_STATE_COUNT];
  90. };
  91. #endif /* _SOUND_FIREWIRE_H_INCLUDED */