Christopher Ferris | e084501 | 2014-07-09 14:58:51 -0700 | [diff] [blame] | 1 | #ifndef _UAPI_SOUND_FIREWIRE_H_INCLUDED |
| 2 | #define _UAPI_SOUND_FIREWIRE_H_INCLUDED |
| 3 | |
| 4 | #include <linux/ioctl.h> |
Christopher Ferris | 3147524 | 2014-09-02 17:43:51 -0700 | [diff] [blame^] | 5 | #include <linux/types.h> |
Christopher Ferris | e084501 | 2014-07-09 14:58:51 -0700 | [diff] [blame] | 6 | |
| 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 |
Christopher Ferris | 3147524 | 2014-09-02 17:43:51 -0700 | [diff] [blame^] | 11 | #define SNDRV_FIREWIRE_EVENT_EFW_RESPONSE 0x4e617475 |
Christopher Ferris | e084501 | 2014-07-09 14:58:51 -0700 | [diff] [blame] | 12 | |
| 13 | struct snd_firewire_event_common { |
| 14 | unsigned int type; /* SNDRV_FIREWIRE_EVENT_xxx */ |
| 15 | }; |
| 16 | |
| 17 | struct snd_firewire_event_lock_status { |
| 18 | unsigned int type; |
| 19 | unsigned int status; /* 0/1 = unlocked/locked */ |
| 20 | }; |
| 21 | |
| 22 | struct snd_firewire_event_dice_notification { |
| 23 | unsigned int type; |
| 24 | unsigned int notification; /* DICE-specific bits */ |
| 25 | }; |
| 26 | |
Christopher Ferris | 3147524 | 2014-09-02 17:43:51 -0700 | [diff] [blame^] | 27 | #define SND_EFW_TRANSACTION_USER_SEQNUM_MAX ((__u32)((__u16)~0) - 1) |
| 28 | /* each field should be in big endian */ |
| 29 | struct snd_efw_transaction { |
| 30 | __be32 length; |
| 31 | __be32 version; |
| 32 | __be32 seqnum; |
| 33 | __be32 category; |
| 34 | __be32 command; |
| 35 | __be32 status; |
| 36 | __be32 params[0]; |
| 37 | }; |
| 38 | struct snd_firewire_event_efw_response { |
| 39 | unsigned int type; |
| 40 | __be32 response[0]; /* some responses */ |
| 41 | }; |
| 42 | |
Christopher Ferris | e084501 | 2014-07-09 14:58:51 -0700 | [diff] [blame] | 43 | union snd_firewire_event { |
| 44 | struct snd_firewire_event_common common; |
| 45 | struct snd_firewire_event_lock_status lock_status; |
| 46 | struct snd_firewire_event_dice_notification dice_notification; |
Christopher Ferris | 3147524 | 2014-09-02 17:43:51 -0700 | [diff] [blame^] | 47 | struct snd_firewire_event_efw_response efw_response; |
Christopher Ferris | e084501 | 2014-07-09 14:58:51 -0700 | [diff] [blame] | 48 | }; |
| 49 | |
| 50 | |
| 51 | #define SNDRV_FIREWIRE_IOCTL_GET_INFO _IOR('H', 0xf8, struct snd_firewire_get_info) |
| 52 | #define SNDRV_FIREWIRE_IOCTL_LOCK _IO('H', 0xf9) |
| 53 | #define SNDRV_FIREWIRE_IOCTL_UNLOCK _IO('H', 0xfa) |
| 54 | |
| 55 | #define SNDRV_FIREWIRE_TYPE_DICE 1 |
Christopher Ferris | 3147524 | 2014-09-02 17:43:51 -0700 | [diff] [blame^] | 56 | #define SNDRV_FIREWIRE_TYPE_FIREWORKS 2 |
| 57 | #define SNDRV_FIREWIRE_TYPE_BEBOB 3 |
| 58 | /* AV/C, RME, MOTU, ... */ |
Christopher Ferris | e084501 | 2014-07-09 14:58:51 -0700 | [diff] [blame] | 59 | |
| 60 | struct snd_firewire_get_info { |
| 61 | unsigned int type; /* SNDRV_FIREWIRE_TYPE_xxx */ |
| 62 | unsigned int card; /* same as fw_cdev_get_info.card */ |
| 63 | unsigned char guid[8]; |
| 64 | char device_name[16]; /* device node in /dev */ |
| 65 | }; |
| 66 | |
| 67 | /* |
| 68 | * SNDRV_FIREWIRE_IOCTL_LOCK prevents the driver from streaming. |
| 69 | * Returns -EBUSY if the driver is already streaming. |
| 70 | */ |
| 71 | |
| 72 | #endif /* _UAPI_SOUND_FIREWIRE_H_INCLUDED */ |