blob: db79a12fcc78db70d234b89d4b8bf6f573598224 [file] [log] [blame]
Chen Gang3b098eb42013-11-07 11:14:29 +08001#ifndef _UAPI_SOUND_FIREWIRE_H_INCLUDED
2#define _UAPI_SOUND_FIREWIRE_H_INCLUDED
Clemens Ladisch82fbb4f2011-09-04 22:04:49 +02003
4#include <linux/ioctl.h>
Takashi Sakamoto555e8a82014-04-25 22:45:13 +09005#include <linux/types.h>
Clemens Ladisch82fbb4f2011-09-04 22:04:49 +02006
7/* events can be read() from the hwdep device */
8
9#define SNDRV_FIREWIRE_EVENT_LOCK_STATUS 0x000010cc
10#define SNDRV_FIREWIRE_EVENT_DICE_NOTIFICATION 0xd1ce004e
Takashi Sakamoto555e8a82014-04-25 22:45:13 +090011#define SNDRV_FIREWIRE_EVENT_EFW_RESPONSE 0x4e617475
Takashi Sakamoto44b73082015-09-30 09:39:22 +090012#define SNDRV_FIREWIRE_EVENT_DIGI00X_MESSAGE 0x746e736c
Clemens Ladisch82fbb4f2011-09-04 22:04:49 +020013
14struct snd_firewire_event_common {
15 unsigned int type; /* SNDRV_FIREWIRE_EVENT_xxx */
16};
17
18struct snd_firewire_event_lock_status {
19 unsigned int type;
20 unsigned int status; /* 0/1 = unlocked/locked */
21};
22
23struct snd_firewire_event_dice_notification {
24 unsigned int type;
25 unsigned int notification; /* DICE-specific bits */
26};
27
Takashi Sakamoto555e8a82014-04-25 22:45:13 +090028#define SND_EFW_TRANSACTION_USER_SEQNUM_MAX ((__u32)((__u16)~0) - 1)
29/* each field should be in big endian */
30struct snd_efw_transaction {
31 __be32 length;
32 __be32 version;
33 __be32 seqnum;
34 __be32 category;
35 __be32 command;
36 __be32 status;
37 __be32 params[0];
38};
39struct snd_firewire_event_efw_response {
40 unsigned int type;
41 __be32 response[0]; /* some responses */
42};
43
Takashi Sakamoto44b73082015-09-30 09:39:22 +090044struct snd_firewire_event_digi00x_message {
45 unsigned int type;
46 __u32 message; /* Digi00x-specific message */
47};
48
Clemens Ladisch82fbb4f2011-09-04 22:04:49 +020049union snd_firewire_event {
50 struct snd_firewire_event_common common;
51 struct snd_firewire_event_lock_status lock_status;
52 struct snd_firewire_event_dice_notification dice_notification;
Takashi Sakamoto555e8a82014-04-25 22:45:13 +090053 struct snd_firewire_event_efw_response efw_response;
Takashi Sakamoto44b73082015-09-30 09:39:22 +090054 struct snd_firewire_event_digi00x_message digi00x_message;
Clemens Ladisch82fbb4f2011-09-04 22:04:49 +020055};
56
57
58#define SNDRV_FIREWIRE_IOCTL_GET_INFO _IOR('H', 0xf8, struct snd_firewire_get_info)
59#define SNDRV_FIREWIRE_IOCTL_LOCK _IO('H', 0xf9)
60#define SNDRV_FIREWIRE_IOCTL_UNLOCK _IO('H', 0xfa)
61
62#define SNDRV_FIREWIRE_TYPE_DICE 1
Takashi Sakamoto594ddce2014-04-25 22:45:12 +090063#define SNDRV_FIREWIRE_TYPE_FIREWORKS 2
Takashi Sakamoto618eabe2014-04-25 22:45:20 +090064#define SNDRV_FIREWIRE_TYPE_BEBOB 3
Takashi Sakamoto8985f4a2014-12-09 00:10:49 +090065#define SNDRV_FIREWIRE_TYPE_OXFW 4
Takashi Sakamoto660dd3d2015-09-30 09:39:21 +090066#define SNDRV_FIREWIRE_TYPE_DIGI00X 5
Takashi Sakamotoe5e0c3d2015-10-01 22:02:17 +090067#define SNDRV_FIREWIRE_TYPE_TASCAM 6
Takashi Sakamoto8985f4a2014-12-09 00:10:49 +090068/* RME, MOTU, ... */
Clemens Ladisch82fbb4f2011-09-04 22:04:49 +020069
70struct snd_firewire_get_info {
71 unsigned int type; /* SNDRV_FIREWIRE_TYPE_xxx */
72 unsigned int card; /* same as fw_cdev_get_info.card */
73 unsigned char guid[8];
74 char device_name[16]; /* device node in /dev */
75};
76
77/*
78 * SNDRV_FIREWIRE_IOCTL_LOCK prevents the driver from streaming.
79 * Returns -EBUSY if the driver is already streaming.
80 */
81
Chen Gang3b098eb42013-11-07 11:14:29 +080082#endif /* _UAPI_SOUND_FIREWIRE_H_INCLUDED */