^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef SOUND_FIREWIRE_LIB_H_INCLUDED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define SOUND_FIREWIRE_LIB_H_INCLUDED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <linux/firewire-constants.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <sound/rawmidi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) struct fw_unit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define FW_GENERATION_MASK 0x00ff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define FW_FIXED_GENERATION 0x0100
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define FW_QUIET 0x0200
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) int snd_fw_transaction(struct fw_unit *unit, int tcode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) u64 offset, void *buffer, size_t length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) unsigned int flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /* returns true if retrying the transaction would not make sense */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) static inline bool rcode_is_permanent_error(int rcode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) return rcode == RCODE_TYPE_ERROR || rcode == RCODE_ADDRESS_ERROR;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) void snd_fw_schedule_registration(struct fw_unit *unit,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct delayed_work *dwork);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #endif