FreeBSD kernel sound device code
uaudio.c File Reference
#include <sys/cdefs.h>
#include <sys/stdint.h>
#include <sys/stddef.h>
#include <sys/param.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bus.h>
#include <sys/module.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
#include <sys/sysctl.h>
#include <sys/sx.h>
#include <sys/unistd.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/priv.h>
#include <dev/hid/hid.h>
#include "usbdevs.h"
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
#include <dev/usb/usbhid.h>
#include <dev/usb/usb_request.h>
#include <dev/usb/usb_process.h>
#include <dev/usb/usb_debug.h>
#include <dev/usb/quirk/usb_quirk.h>
#include <sys/reboot.h>
#include <dev/sound/pcm/sound.h>
#include <dev/sound/usb/uaudioreg.h>
#include <dev/sound/usb/uaudio.h>
#include <dev/sound/chip.h>
#include "feeder_if.h"
Include dependency graph for uaudio.c:

Go to the source code of this file.

Data Structures

union  uaudio_asid
 
union  uaudio_asf1d
 
union  uaudio_sed
 
struct  uaudio_mixer_node
 
struct  uaudio_configure_msg
 
struct  uaudio_chan_alt
 
struct  uaudio_chan
 
struct  umidi_sub_chan
 
struct  umidi_chan
 
struct  uaudio_search_result
 
struct  uaudio_hid
 
struct  uaudio_softc_child
 
struct  uaudio_softc
 
struct  uaudio_terminal_node
 
struct  uaudio_format
 
struct  uaudio_tt_to_feature
 

Macros

#define USB_DEBUG_VAR   uaudio_debug
 
#define uaudio_debug   0
 
#define UAUDIO_NFRAMES   64 /* must be factor of 8 due HS-USB */
 
#define UAUDIO_NCHANBUFS   2 /* number of outstanding request */
 
#define UAUDIO_RECURSE_LIMIT   255 /* rounds */
 
#define UAUDIO_CHANNELS_MAX   MIN(64, AFMT_CHANNEL_MAX)
 
#define UAUDIO_MATRIX_MAX   8 /* channels */
 
#define MAKE_WORD(h, l)   (((h) << 8) | (l))
 
#define BIT_TEST(bm, bno)   (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1)
 
#define UAUDIO_MAX_CHAN(x)   (x)
 
#define MIX(sc)   ((sc)->sc_mixer_node)
 
#define MIX_MAX_CHAN   16
 
#define MIX_ON_OFF   1
 
#define MIX_SIGNED_16   2
 
#define MIX_UNSIGNED_16   3
 
#define MIX_SIGNED_8   4
 
#define MIX_SELECTOR   5
 
#define MIX_UNKNOWN   6
 
#define MIX_SIZE(n)
 
#define MIX_UNSIGNED(n)   ((n) == MIX_UNSIGNED_16)
 
#define MAX_SELECTOR_INPUT_PIN   256
 
#define CHAN_MAX_ALT   24
 
#define CHAN_OP_NONE   0
 
#define CHAN_OP_START   1
 
#define CHAN_OP_STOP   2
 
#define CHAN_OP_DRAIN   3
 
#define UMIDI_EMB_JACK_MAX   16 /* units */
 
#define UMIDI_TX_FRAMES   256 /* units */
 
#define UMIDI_TX_BUFFER   (UMIDI_TX_FRAMES * 4) /* bytes */
 
#define UMIDI_ST_UNKNOWN   0 /* scan for command */
 
#define UMIDI_ST_1PARAM   1
 
#define UMIDI_ST_2PARAM_1   2
 
#define UMIDI_ST_2PARAM_2   3
 
#define UMIDI_ST_SYSEX_0   4
 
#define UMIDI_ST_SYSEX_1   5
 
#define UMIDI_ST_SYSEX_2   6
 
#define UAUDIO_HID_VALID   0x0001
 
#define UAUDIO_HID_HAS_ID   0x0002
 
#define UAUDIO_HID_HAS_VOLUME_UP   0x0004
 
#define UAUDIO_HID_HAS_VOLUME_DOWN   0x0008
 
#define UAUDIO_HID_HAS_MUTE   0x0010
 
#define UAUDIO_SPDIF_OUT   0x01 /* Enable S/PDIF output */
 
#define UAUDIO_SPDIF_OUT_48K   0x02 /* Out sample rate = 48K */
 
#define UAUDIO_SPDIF_OUT_96K   0x04 /* Out sample rate = 96K */
 
#define UAUDIO_SPDIF_IN_MIX   0x10 /* Input mix enable */
 
#define UAUDIO_MAX_CHILD   2
 
#define UAUDIO20_MAX_RATES   32 /* we support at maximum 32 rates */
 

Enumerations

enum  { UMIDI_TX_TRANSFER , UMIDI_RX_TRANSFER , UMIDI_N_TRANSFER }
 
enum  { UAUDIO_HID_RX_TRANSFER , UAUDIO_HID_N_TRANSFER }
 

Functions

 __FBSDID ("$FreeBSD$")
 
static SYSCTL_NODE (_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "USB uaudio")
 
 SYSCTL_BOOL (_hw_usb_uaudio, OID_AUTO, handle_hid, CTLFLAG_RWTUN, &uaudio_handle_hid, 0, "uaudio handles any HID volume/mute keys, if set")
 
 SYSCTL_INT (_hw_usb_uaudio, OID_AUTO, default_rate, CTLFLAG_RWTUN, &uaudio_default_rate, 0, "uaudio default sample rate")
 
 SYSCTL_INT (_hw_usb_uaudio, OID_AUTO, default_bits, CTLFLAG_RWTUN, &uaudio_default_bits, 0, "uaudio default sample bits")
 
 SYSCTL_INT (_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RWTUN, &uaudio_default_channels, 0, "uaudio default sample channels")
 
static int uaudio_buffer_ms_sysctl (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_hw_usb_uaudio, OID_AUTO, buffer_ms, CTLTYPE_INT|CTLFLAG_RWTUN|CTLFLAG_MPSAFE, 0, sizeof(int), uaudio_buffer_ms_sysctl, "I", "uaudio buffering delay from 2ms to 8ms")
 
static int uaudio_mixer_sysctl_handler (SYSCTL_HANDLER_ARGS)
 
static void uaudio_mixer_ctl_free (struct uaudio_softc *)
 
static void uaudio_mixer_register_sysctl (struct uaudio_softc *, device_t, unsigned)
 
static void uaudio_mixer_reload_all (struct uaudio_softc *)
 
static void uaudio_mixer_controls_create_ftu (struct uaudio_softc *)
 
static void uaudio_mixer_add_mixer (struct uaudio_softc *, const struct uaudio_terminal_node *, int)
 
static void uaudio_mixer_add_selector (struct uaudio_softc *, const struct uaudio_terminal_node *, int)
 
static uint32_t uaudio_mixer_feature_get_bmaControls (const struct usb_audio_feature_unit *, uint8_t)
 
static void uaudio_mixer_add_feature (struct uaudio_softc *, const struct uaudio_terminal_node *, int)
 
static void uaudio_mixer_add_processing_updown (struct uaudio_softc *, const struct uaudio_terminal_node *, int)
 
static void uaudio_mixer_add_processing (struct uaudio_softc *, const struct uaudio_terminal_node *, int)
 
static void uaudio_mixer_add_extension (struct uaudio_softc *, const struct uaudio_terminal_node *, int)
 
static struct usb_audio_cluster uaudio_mixer_get_cluster (uint8_t, const struct uaudio_terminal_node *)
 
static uint16_t uaudio_mixer_determine_class (const struct uaudio_terminal_node *)
 
static void uaudio_mixer_find_inputs_sub (struct uaudio_terminal_node *, const uint8_t *, uint8_t, struct uaudio_search_result *)
 
static const void * uaudio_mixer_verify_desc (const void *, uint32_t)
 
static usb_error_t uaudio_set_speed (struct usb_device *, uint8_t, uint32_t)
 
static int uaudio_mixer_get (struct usb_device *, uint16_t, uint8_t, struct uaudio_mixer_node *)
 
static void uaudio20_mixer_add_mixer (struct uaudio_softc *, const struct uaudio_terminal_node *, int)
 
static void uaudio20_mixer_add_selector (struct uaudio_softc *, const struct uaudio_terminal_node *, int)
 
static void uaudio20_mixer_add_feature (struct uaudio_softc *, const struct uaudio_terminal_node *, int)
 
static struct usb_audio20_cluster uaudio20_mixer_get_cluster (uint8_t, const struct uaudio_terminal_node *)
 
static uint16_t uaudio20_mixer_determine_class (const struct uaudio_terminal_node *)
 
static void uaudio20_mixer_find_inputs_sub (struct uaudio_terminal_node *, const uint8_t *, uint8_t, struct uaudio_search_result *)
 
static const void * uaudio20_mixer_verify_desc (const void *, uint32_t)
 
static usb_error_t uaudio20_set_speed (struct usb_device *, uint8_t, uint8_t, uint32_t)
 
static void uaudio_chan_fill_info_sub (struct uaudio_softc *, struct usb_device *, uint32_t, uint8_t, uint8_t)
 
static void uaudio_chan_fill_info (struct uaudio_softc *, struct usb_device *)
 
static void uaudio_mixer_add_ctl_sub (struct uaudio_softc *, struct uaudio_mixer_node *)
 
static void uaudio_mixer_add_ctl (struct uaudio_softc *, struct uaudio_mixer_node *)
 
static void uaudio_mixer_fill_info (struct uaudio_softc *, struct usb_device *, void *)
 
static int uaudio_mixer_signext (uint8_t, int)
 
static void uaudio_mixer_init (struct uaudio_softc *, unsigned)
 
static uint8_t umidi_convert_to_usb (struct umidi_sub_chan *, uint8_t, uint8_t)
 
static struct umidi_sub_chanumidi_sub_by_fifo (struct usb_fifo *)
 
static void umidi_start_read (struct usb_fifo *)
 
static void umidi_stop_read (struct usb_fifo *)
 
static void umidi_start_write (struct usb_fifo *)
 
static void umidi_stop_write (struct usb_fifo *)
 
static int umidi_open (struct usb_fifo *, int)
 
static int umidi_ioctl (struct usb_fifo *, u_long cmd, void *, int)
 
static void umidi_close (struct usb_fifo *, int)
 
static void umidi_init (device_t dev)
 
static int umidi_probe (device_t dev)
 
static int umidi_detach (device_t dev)
 
static int uaudio_hid_probe (struct uaudio_softc *sc, struct usb_attach_arg *uaa)
 
static void uaudio_hid_detach (struct uaudio_softc *sc)
 
static unsigned uaudio_get_child_index_by_dev (struct uaudio_softc *sc, device_t dev)
 
static unsigned uaudio_get_child_index_by_chan (struct uaudio_softc *sc, struct uaudio_chan *ch)
 
static int uaudio_probe (device_t dev)
 
static int uaudio_set_spdif_cm6206 (struct uaudio_softc *sc, int flags)
 
static int uaudio_set_spdif_dummy (struct uaudio_softc *sc, int flags)
 
static usb_error_t uaudio_force_power_save (struct uaudio_softc *sc, uint8_t iface_index)
 
static int uaudio_attach (device_t dev)
 
static void uaudio_pcm_setflags (device_t dev, uint32_t flags)
 
int uaudio_attach_sub (device_t dev, kobj_class_t mixer_class, kobj_class_t chan_class)
 
int uaudio_detach_sub (device_t dev)
 
static int uaudio_detach (device_t dev)
 
static uint32_t uaudio_get_buffer_size (struct uaudio_chan *ch, uint8_t alt)
 
static void uaudio_configure_msg_sub (struct uaudio_softc *sc, struct uaudio_chan *chan, int dir)
 
static void uaudio_configure_msg (struct usb_proc_msg *pm)
 
static void uaudio_record_fix_fs (usb_endpoint_descriptor_audio_t *ep, uint32_t xps, uint32_t add)
 
static usb_error_t uaudio20_check_rate (struct usb_device *udev, uint8_t iface_no, uint8_t clockid, uint32_t rate)
 
static struct uaudio_chanuaudio_get_chan (struct uaudio_softc *sc, struct uaudio_chan *chan, uint8_t iface_index)
 
static void uaudio_chan_play_sync_callback (struct usb_xfer *xfer, usb_error_t error)
 
static int uaudio_chan_is_async (struct uaudio_chan *ch, uint8_t alt)
 
static void uaudio_chan_play_callback (struct usb_xfer *xfer, usb_error_t error)
 
static void uaudio_chan_record_sync_callback (struct usb_xfer *xfer, usb_error_t error)
 
static void uaudio_chan_record_callback (struct usb_xfer *xfer, usb_error_t error)
 
void * uaudio_chan_init (struct uaudio_chan *ch, struct snd_dbuf *b, struct pcm_channel *c, int dir)
 
int uaudio_chan_free (struct uaudio_chan *ch)
 
int uaudio_chan_set_param_blocksize (struct uaudio_chan *ch, uint32_t blocksize)
 
int uaudio_chan_set_param_fragments (struct uaudio_chan *ch, uint32_t blocksize, uint32_t blockcount)
 
int uaudio_chan_set_param_speed (struct uaudio_chan *ch, uint32_t speed)
 
int uaudio_chan_getptr (struct uaudio_chan *ch)
 
struct pcmchan_capsuaudio_chan_getcaps (struct uaudio_chan *ch)
 
struct pcmchan_matrixuaudio_chan_getmatrix (struct uaudio_chan *ch, uint32_t format)
 
int uaudio_chan_set_param_format (struct uaudio_chan *ch, uint32_t format)
 
static void uaudio_chan_reconfigure (struct uaudio_chan *ch, uint8_t operation)
 
static int uaudio_chan_need_both (struct uaudio_chan *pchan, struct uaudio_chan *rchan)
 
static int uaudio_chan_need_none (struct uaudio_chan *pchan, struct uaudio_chan *rchan)
 
void uaudio_chan_start (struct uaudio_chan *ch)
 
void uaudio_chan_stop (struct uaudio_chan *ch)
 
static void uaudio_mixer_check_selectors (struct uaudio_softc *sc)
 
static bool uaudio_mixer_foreach_input (const struct uaudio_terminal_node *iot, uint8_t *pindex)
 
static bool uaudio_mixer_foreach_output (const struct uaudio_terminal_node *iot, uint8_t *pindex)
 
static uint16_t uaudio_mixer_get_feature_by_tt (uint16_t terminal_type, uint16_t default_type)
 
static void uaudio_mixer_merge_outputs (struct uaudio_search_result *dst, const struct uaudio_search_result *src)
 
static void uaudio20_mixer_find_clocks_sub (struct uaudio_terminal_node *root, const uint8_t *p_id, uint8_t n_id, struct uaudio_search_result *info)
 
static void uaudio_mixer_write_cfg_callback (struct usb_xfer *xfer, usb_error_t error)
 
static int uaudio_mixer_bsd2value (struct uaudio_mixer_node *mc, int val)
 
static void uaudio_mixer_ctl_set (struct uaudio_softc *sc, struct uaudio_mixer_node *mc, uint8_t chan, int val)
 
int uaudio_mixer_init_sub (struct uaudio_softc *sc, struct snd_mixer *m)
 
int uaudio_mixer_uninit_sub (struct uaudio_softc *sc, struct snd_mixer *m)
 
void uaudio_mixer_set (struct uaudio_softc *sc, struct snd_mixer *m, unsigned type, unsigned left, unsigned right)
 
uint32_t uaudio_mixer_setrecsrc (struct uaudio_softc *sc, struct snd_mixer *m, uint32_t src)
 
static void umidi_bulk_read_callback (struct usb_xfer *xfer, usb_error_t error)
 
static void umidi_bulk_write_callback (struct usb_xfer *xfer, usb_error_t error)
 
static void uaudio_hid_rx_callback (struct usb_xfer *xfer, usb_error_t error)
 
 DRIVER_MODULE_ORDERED (uaudio, uhub, uaudio_driver, uaudio_devclass, NULL, 0, SI_ORDER_ANY)
 
 MODULE_DEPEND (uaudio, usb, 1, 1, 1)
 
 MODULE_DEPEND (uaudio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER)
 
 MODULE_DEPEND (uaudio, hid, 1, 1, 1)
 
 MODULE_VERSION (uaudio, 1)
 
 USB_PNP_HOST_INFO (uaudio_devs)
 
 USB_PNP_HOST_INFO (uaudio_vendor_midi)
 

Variables

static int uaudio_default_rate = 0
 
static int uaudio_default_bits = 32
 
static int uaudio_default_channels = 0
 
static int uaudio_buffer_ms = 2
 
static bool uaudio_handle_hid = true
 
static const struct uaudio_format uaudio10_formats []
 
static const struct uaudio_format uaudio20_formats []
 
static device_probe_t uaudio_probe
 
static device_attach_t uaudio_attach
 
static device_detach_t uaudio_detach
 
static usb_callback_t uaudio_chan_play_callback
 
static usb_callback_t uaudio_chan_play_sync_callback
 
static usb_callback_t uaudio_chan_record_callback
 
static usb_callback_t uaudio_chan_record_sync_callback
 
static usb_callback_t uaudio_mixer_write_cfg_callback
 
static usb_callback_t umidi_bulk_read_callback
 
static usb_callback_t umidi_bulk_write_callback
 
static usb_callback_t uaudio_hid_rx_callback
 
static usb_proc_callback_t uaudio_configure_msg
 
static const struct usb_config uaudio_cfg_record [UAUDIO_NCHANBUFS+1]
 
static const struct usb_config uaudio_cfg_play [UAUDIO_NCHANBUFS+1]
 
static const struct usb_config uaudio_mixer_config [1]
 
static const uint8_t umidi_cmd_to_len [16]
 
static const struct usb_config umidi_config [UMIDI_N_TRANSFER]
 
static const struct usb_config uaudio_hid_config [UAUDIO_HID_N_TRANSFER]
 
static devclass_t uaudio_devclass
 
static device_method_t uaudio_methods []
 
static driver_t uaudio_driver
 
static const STRUCT_USB_HOST_ID uaudio_vendor_midi []
 
static const STRUCT_USB_HOST_ID __used uaudio_devs []
 
static const uint32_t uaudio_rate_list [CHAN_MAX_ALT]
 
static struct pcmchan_matrix uaudio_chan_matrix_swap_2_0
 
static const struct uaudio_tt_to_feature uaudio_tt_to_feature []
 
static struct usb_fifo_methods umidi_fifo_methods
 

Macro Definition Documentation

◆ BIT_TEST

#define BIT_TEST (   bm,
  bno 
)    (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1)

Definition at line 157 of file uaudio.c.

◆ CHAN_MAX_ALT

#define CHAN_MAX_ALT   24

Definition at line 216 of file uaudio.c.

◆ CHAN_OP_DRAIN

#define CHAN_OP_DRAIN   3

Definition at line 269 of file uaudio.c.

◆ CHAN_OP_NONE

#define CHAN_OP_NONE   0

Definition at line 266 of file uaudio.c.

◆ CHAN_OP_START

#define CHAN_OP_START   1

Definition at line 267 of file uaudio.c.

◆ CHAN_OP_STOP

#define CHAN_OP_STOP   2

Definition at line 268 of file uaudio.c.

◆ MAKE_WORD

#define MAKE_WORD (   h,
 
)    (((h) << 8) | (l))

Definition at line 156 of file uaudio.c.

◆ MAX_SELECTOR_INPUT_PIN

#define MAX_SELECTOR_INPUT_PIN   256

Definition at line 202 of file uaudio.c.

◆ MIX

#define MIX (   sc)    ((sc)->sc_mixer_node)

Definition at line 159 of file uaudio.c.

◆ MIX_MAX_CHAN

#define MIX_MAX_CHAN   16

Definition at line 181 of file uaudio.c.

◆ MIX_ON_OFF

#define MIX_ON_OFF   1

Definition at line 192 of file uaudio.c.

◆ MIX_SELECTOR

#define MIX_SELECTOR   5

Definition at line 196 of file uaudio.c.

◆ MIX_SIGNED_16

#define MIX_SIGNED_16   2

Definition at line 193 of file uaudio.c.

◆ MIX_SIGNED_8

#define MIX_SIGNED_8   4

Definition at line 195 of file uaudio.c.

◆ MIX_SIZE

#define MIX_SIZE (   n)
Value:
((((n) == MIX_SIGNED_16) || \
((n) == MIX_UNSIGNED_16)) ? 2 : 1)
uint8_t n
#define MIX_SIGNED_16
Definition: uaudio.c:193
#define MIX_UNSIGNED_16
Definition: uaudio.c:194

Definition at line 198 of file uaudio.c.

◆ MIX_UNKNOWN

#define MIX_UNKNOWN   6

Definition at line 197 of file uaudio.c.

◆ MIX_UNSIGNED

#define MIX_UNSIGNED (   n)    ((n) == MIX_UNSIGNED_16)

Definition at line 200 of file uaudio.c.

◆ MIX_UNSIGNED_16

#define MIX_UNSIGNED_16   3

Definition at line 194 of file uaudio.c.

◆ UAUDIO20_MAX_RATES

#define UAUDIO20_MAX_RATES   32 /* we support at maximum 32 rates */

◆ UAUDIO_CHANNELS_MAX

#define UAUDIO_CHANNELS_MAX   MIN(64, AFMT_CHANNEL_MAX)

Definition at line 153 of file uaudio.c.

◆ uaudio_debug

#define uaudio_debug   0

Definition at line 147 of file uaudio.c.

◆ UAUDIO_HID_HAS_ID

#define UAUDIO_HID_HAS_ID   0x0002

Definition at line 341 of file uaudio.c.

◆ UAUDIO_HID_HAS_MUTE

#define UAUDIO_HID_HAS_MUTE   0x0010

Definition at line 344 of file uaudio.c.

◆ UAUDIO_HID_HAS_VOLUME_DOWN

#define UAUDIO_HID_HAS_VOLUME_DOWN   0x0008

Definition at line 343 of file uaudio.c.

◆ UAUDIO_HID_HAS_VOLUME_UP

#define UAUDIO_HID_HAS_VOLUME_UP   0x0004

Definition at line 342 of file uaudio.c.

◆ UAUDIO_HID_VALID

#define UAUDIO_HID_VALID   0x0001

Definition at line 340 of file uaudio.c.

◆ UAUDIO_MATRIX_MAX

#define UAUDIO_MATRIX_MAX   8 /* channels */

Definition at line 154 of file uaudio.c.

◆ UAUDIO_MAX_CHAN

#define UAUDIO_MAX_CHAN (   x)    (x)

Definition at line 158 of file uaudio.c.

◆ UAUDIO_MAX_CHILD

#define UAUDIO_MAX_CHILD   2

Definition at line 356 of file uaudio.c.

◆ UAUDIO_NCHANBUFS

#define UAUDIO_NCHANBUFS   2 /* number of outstanding request */

Definition at line 151 of file uaudio.c.

◆ UAUDIO_NFRAMES

#define UAUDIO_NFRAMES   64 /* must be factor of 8 due HS-USB */

Definition at line 150 of file uaudio.c.

◆ UAUDIO_RECURSE_LIMIT

#define UAUDIO_RECURSE_LIMIT   255 /* rounds */

Definition at line 152 of file uaudio.c.

◆ UAUDIO_SPDIF_IN_MIX

#define UAUDIO_SPDIF_IN_MIX   0x10 /* Input mix enable */

Definition at line 354 of file uaudio.c.

◆ UAUDIO_SPDIF_OUT

#define UAUDIO_SPDIF_OUT   0x01 /* Enable S/PDIF output */

Definition at line 351 of file uaudio.c.

◆ UAUDIO_SPDIF_OUT_48K

#define UAUDIO_SPDIF_OUT_48K   0x02 /* Out sample rate = 48K */

Definition at line 352 of file uaudio.c.

◆ UAUDIO_SPDIF_OUT_96K

#define UAUDIO_SPDIF_OUT_96K   0x04 /* Out sample rate = 96K */

Definition at line 353 of file uaudio.c.

◆ UMIDI_EMB_JACK_MAX

#define UMIDI_EMB_JACK_MAX   16 /* units */

Definition at line 274 of file uaudio.c.

◆ UMIDI_ST_1PARAM

#define UMIDI_ST_1PARAM   1

Definition at line 291 of file uaudio.c.

◆ UMIDI_ST_2PARAM_1

#define UMIDI_ST_2PARAM_1   2

Definition at line 292 of file uaudio.c.

◆ UMIDI_ST_2PARAM_2

#define UMIDI_ST_2PARAM_2   3

Definition at line 293 of file uaudio.c.

◆ UMIDI_ST_SYSEX_0

#define UMIDI_ST_SYSEX_0   4

Definition at line 294 of file uaudio.c.

◆ UMIDI_ST_SYSEX_1

#define UMIDI_ST_SYSEX_1   5

Definition at line 295 of file uaudio.c.

◆ UMIDI_ST_SYSEX_2

#define UMIDI_ST_SYSEX_2   6

Definition at line 296 of file uaudio.c.

◆ UMIDI_ST_UNKNOWN

#define UMIDI_ST_UNKNOWN   0 /* scan for command */

Definition at line 290 of file uaudio.c.

◆ UMIDI_TX_BUFFER

#define UMIDI_TX_BUFFER   (UMIDI_TX_FRAMES * 4) /* bytes */

Definition at line 276 of file uaudio.c.

◆ UMIDI_TX_FRAMES

#define UMIDI_TX_FRAMES   256 /* units */

Definition at line 275 of file uaudio.c.

◆ USB_DEBUG_VAR

#define USB_DEBUG_VAR   uaudio_debug

Definition at line 82 of file uaudio.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
UMIDI_TX_TRANSFER 
UMIDI_RX_TRANSFER 
UMIDI_N_TRANSFER 

Definition at line 278 of file uaudio.c.

◆ anonymous enum

anonymous enum
Enumerator
UAUDIO_HID_RX_TRANSFER 
UAUDIO_HID_N_TRANSFER 

Definition at line 329 of file uaudio.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DRIVER_MODULE_ORDERED()

DRIVER_MODULE_ORDERED ( uaudio  ,
uhub  ,
uaudio_driver  ,
uaudio_devclass  ,
NULL  ,
,
SI_ORDER_ANY   
)

◆ MODULE_DEPEND() [1/3]

MODULE_DEPEND ( uaudio  ,
hid  ,
,
,
 
)

◆ MODULE_DEPEND() [2/3]

MODULE_DEPEND ( uaudio  ,
sound  ,
SOUND_MINVER  ,
SOUND_PREFVER  ,
SOUND_MAXVER   
)

◆ MODULE_DEPEND() [3/3]

MODULE_DEPEND ( uaudio  ,
usb  ,
,
,
 
)

◆ MODULE_VERSION()

MODULE_VERSION ( uaudio  ,
 
)

◆ SYSCTL_BOOL()

SYSCTL_BOOL ( _hw_usb_uaudio  ,
OID_AUTO  ,
handle_hid  ,
CTLFLAG_RWTUN  ,
uaudio_handle_hid,
,
"uaudio handles any HID volume/mute  keys,
if set  
)

◆ SYSCTL_INT() [1/3]

SYSCTL_INT ( _hw_usb_uaudio  ,
OID_AUTO  ,
default_bits  ,
CTLFLAG_RWTUN  ,
uaudio_default_bits,
,
"uaudio default sample bits"   
)

◆ SYSCTL_INT() [2/3]

SYSCTL_INT ( _hw_usb_uaudio  ,
OID_AUTO  ,
default_channels  ,
CTLFLAG_RWTUN  ,
uaudio_default_channels,
,
"uaudio default sample channels"   
)

◆ SYSCTL_INT() [3/3]

SYSCTL_INT ( _hw_usb_uaudio  ,
OID_AUTO  ,
default_rate  ,
CTLFLAG_RWTUN  ,
uaudio_default_rate,
,
"uaudio default sample rate  
)

◆ SYSCTL_NODE()

static SYSCTL_NODE ( _hw_usb  ,
OID_AUTO  ,
uaudio  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"USB uaudio"   
)
static

◆ SYSCTL_PROC()

SYSCTL_PROC ( _hw_usb_uaudio  ,
OID_AUTO  ,
buffer_ms  ,
CTLTYPE_INT|CTLFLAG_RWTUN|  CTLFLAG_MPSAFE,
,
sizeof(int)  ,
uaudio_buffer_ms_sysctl  ,
"I"  ,
"uaudio buffering delay from 2ms to 8ms"   
)

◆ uaudio20_check_rate()

static usb_error_t uaudio20_check_rate ( struct usb_device udev,
uint8_t  iface_no,
uint8_t  clockid,
uint32_t  rate 
)
static

Definition at line 1586 of file uaudio.c.

References data, DPRINTF, error, max, rate, rates, req, UA20_CS_RANGE, UA20_CS_SAM_FREQ_CONTROL, UAUDIO20_MAX_RATES, UGETDW, UGETW, USB_DEFAULT_TIMEOUT, USB_ERR_INVAL, USB_SHORT_XFER_OK, usbd_do_request_flags(), USETW, USETW2, and UT_READ_CLASS_INTERFACE.

Referenced by uaudio_chan_fill_info_sub().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio20_mixer_add_feature()

◆ uaudio20_mixer_add_mixer()

◆ uaudio20_mixer_add_selector()

◆ uaudio20_mixer_determine_class()

◆ uaudio20_mixer_find_clocks_sub()

◆ uaudio20_mixer_find_inputs_sub()

static void uaudio20_mixer_find_inputs_sub ( struct uaudio_terminal_node root,
const uint8_t *  p_id,
uint8_t  n_id,
struct uaudio_search_result info 
)
static

◆ uaudio20_mixer_get_cluster()

static struct usb_audio20_cluster uaudio20_mixer_get_cluster ( uint8_t  id,
const struct uaudio_terminal_node iot 
)
static

◆ uaudio20_mixer_verify_desc()

◆ uaudio20_set_speed()

static usb_error_t uaudio20_set_speed ( struct usb_device udev,
uint8_t  iface_no,
uint8_t  clockid,
uint32_t  speed 
)
static

Definition at line 5302 of file uaudio.c.

References data, req, speed, UA20_CS_CUR, UA20_CS_SAM_FREQ_CONTROL, usbd_do_request, USETW, USETW2, and UT_WRITE_CLASS_INTERFACE.

Referenced by uaudio_configure_msg_sub().

Here is the caller graph for this function:

◆ uaudio_attach()

static int uaudio_attach ( device_t  dev)
static

Definition at line 970 of file uaudio.c.

References usbd_lookup_info::bIfaceIndex, usbd_lookup_info::bIfaceNum, uaudio_chan_alt::channels, uaudio_format::description, dev, usb_attach_arg::device, device_set_usb_desc(), DPRINTF, usb_attach_arg::driver_info, sndcard_func::func, uaudio_configure_msg::hdr, id, usbd_lookup_info::idProduct, usbd_lookup_info::idVendor, usb_attach_arg::iface, umidi_chan::iface_alt_index, uaudio_chan_alt::iface_index, umidi_chan::iface_index, usb_attach_arg::info, uaudio_softc_child::mix_info, uaudio_chan::num_alt, uaudio_chan_alt::p_fmt, uaudio_softc_child::pcm_device, usb_proc_msg::pm_callback, uaudio_chan_alt::sample_rate, uaudio_configure_msg::sc, uaudio_softc::sc_audio_rev, uaudio_softc::sc_child, uaudio_softc::sc_config_msg, uaudio_softc::sc_midi_chan, uaudio_softc::sc_mixer_count, uaudio_softc::sc_mixer_iface_index, uaudio_softc::sc_mixer_iface_no, uaudio_softc::sc_play_chan, uaudio_softc::sc_rec_chan, uaudio_softc::sc_set_spdif_fn, uaudio_softc::sc_sndcard_func, uaudio_softc::sc_udev, uaudio_softc::sc_uq_au_inp_async, uaudio_softc::sc_uq_au_no_xu, uaudio_softc::sc_uq_au_vendor_class, uaudio_softc::sc_uq_audio_swap_lr, uaudio_softc::sc_uq_bad_adc, SCF_PCM, uaudio_buffer_ms, uaudio_chan_fill_info(), uaudio_configure_msg, uaudio_detach, uaudio_force_power_save(), uaudio_handle_hid, uaudio_hid_probe(), UAUDIO_MAX_CHILD, uaudio_mixer_controls_create_ftu(), uaudio_mixer_fill_info(), uaudio_mixer_reload_all(), uaudio_set_spdif_cm6206(), uaudio_set_spdif_dummy(), UAUDIO_SPDIF_OUT, UAUDIO_SPDIF_OUT_48K, uaudio_vendor_midi, umidi_init(), umidi_probe(), UQ_AU_INP_ASYNC, UQ_AU_NO_XU, UQ_AU_SET_SPDIF_CM6206, UQ_AU_VENDOR_CLASS, UQ_AUDIO_SWAP_LR, UQ_BAD_ADC, uaudio_chan::usb_alt, usb_test_quirk(), usbd_errstr(), usbd_get_interface_descriptor(), usbd_lookup_id_by_uaa(), and umidi_chan::valid.

Here is the call graph for this function:

◆ uaudio_attach_sub()

◆ uaudio_buffer_ms_sysctl()

static int uaudio_buffer_ms_sysctl ( SYSCTL_HANDLER_ARGS  )
static

Definition at line 117 of file uaudio.c.

References req, uaudio_buffer_ms, and val.

◆ uaudio_chan_fill_info()

static void uaudio_chan_fill_info ( struct uaudio_softc sc,
struct usb_device udev 
)
static

◆ uaudio_chan_fill_info_sub()

static void uaudio_chan_fill_info_sub ( struct uaudio_softc sc,
struct usb_device udev,
uint32_t  rate,
uint8_t  channels,
uint8_t  bit_resolution 
)
static

Definition at line 1701 of file uaudio.c.

References AS_GENERAL, usb_audio_control_descriptor::bcdADC, usb_midi_streaming_endpoint_descriptor::bDescriptorSubtype, usb_midi_streaming_endpoint_descriptor::bDescriptorType, usb_audio_streaming_type1_descriptor::bFormatType, uaudio_search_result::bit_input, uaudio_search_result::bit_output, usb_midi_streaming_endpoint_descriptor::bLength, usb_audio20_streaming_interface_descriptor::bmFormats, usb_audio_streaming_type1_descriptor::bNrChannels, usb_audio20_streaming_interface_descriptor::bNrChannels, usb_midi_streaming_endpoint_descriptor::bNumEmbMIDIJack, uaudio_format::bPrecision, usb_audio_streaming_type1_descriptor::bSamFreqType, usb_audio_streaming_type1_descriptor::bSubFrameSize, usb_audio20_streaming_type1_descriptor::bSubslotSize, chan, CHAN_MAX_ALT, uaudio_chan_alt::channels, desc, uaudio_format::description, DPRINTF, feeder_matrix_default_format(), uaudio_hid::flags, format, FORMAT_TYPE, FORMAT_TYPE_I, uaudio_format::freebsd_fmt, id, uaudio_chan_alt::iface_alt_index, umidi_chan::iface_alt_index, uaudio_chan_alt::iface_index, umidi_chan::iface_index, uaudio_hid::iface_index, umidi_chan::max_emb_jack, MS_GENERAL, uaudio_chan_alt::p_asf1d, uaudio_chan_alt::p_ed1, uaudio_chan_alt::p_fmt, uaudio_chan_alt::p_sed, rate, uaudio_chan_alt::sample_rate, uaudio_chan_alt::sample_size, uaudio_softc::sc_hid, uaudio_softc::sc_midi_chan, uaudio_softc::sc_mixer_clocks, uaudio_softc::sc_mixer_iface_index, uaudio_softc::sc_mixer_iface_no, uaudio_softc::sc_pcm_bitperfect, uaudio_softc::sc_play_chan, uaudio_softc::sc_rec_chan, uaudio_softc::sc_sndstat, uaudio_softc::sc_sndstat_valid, uaudio_softc::sc_udev, uaudio_softc::sc_uq_au_vendor_class, SND_FORMAT, UA_GETSAMP, UA_SAMP_HI, UA_SAMP_LO, uaudio10_formats, uaudio20_check_rate(), uaudio20_formats, uaudio_cfg_play, uaudio_cfg_record, uaudio_get_chan(), UAUDIO_HID_VALID, UAUDIO_MATRIX_MAX, UAUDIO_MAX_CHAN, UAUDIO_MAX_CHILD, uaudio_record_fix_fs(), UAUDIO_VERSION_20, UAUDIO_VERSION_30, UDESC_CS_ENDPOINT, UDESC_CS_INTERFACE, UDESC_ENDPOINT, UDESC_INTERFACE, UDESCSUB_AC_HEADER, UE_DIR_IN, UE_DIR_OUT, UE_GET_DIR, UE_GET_XFERTYPE, UE_ISOCHRONOUS, UEP_MINSIZE, UGETDW, UGETW, UICLASS_AUDIO, UICLASS_HID, UICLASS_VENDOR, UISUBCLASS_AUDIOSTREAM, UISUBCLASS_MIDISTREAM, uaudio_chan_alt::usb_cfg, usb_desc_foreach(), USB_SPEED_FULL, usbd_get_config_descriptor(), usbd_get_iface(), usbd_get_speed(), usbd_set_parent_iface(), uaudio_asid::v1, uaudio_asf1d::v1, uaudio_sed::v1, uaudio_asid::v2, uaudio_asf1d::v2, uaudio_sed::v2, umidi_chan::valid, uaudio_format::wFormat, and usb_audio_streaming_interface_descriptor::wFormatTag.

Referenced by uaudio_chan_fill_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_chan_free()

int uaudio_chan_free ( struct uaudio_chan ch)

Definition at line 2663 of file uaudio.c.

References uaudio_chan::buf, free, uaudio_chan::num_alt, UAUDIO_NCHANBUFS, usbd_transfer_unsetup(), and uaudio_chan::xfer.

Referenced by ua_chan_free(), and uaudio_chan_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_chan_getcaps()

struct pcmchan_caps * uaudio_chan_getcaps ( struct uaudio_chan ch)

Definition at line 2725 of file uaudio.c.

References uaudio_chan::pcm_cap.

Referenced by ua_chan_getcaps().

Here is the caller graph for this function:

◆ uaudio_chan_getmatrix()

struct pcmchan_matrix * uaudio_chan_getmatrix ( struct uaudio_chan ch,
uint32_t  format 
)

Definition at line 2762 of file uaudio.c.

References AFMT_CHANNEL, feeder_matrix_format_map(), format, uaudio_chan::priv_sc, uaudio_softc::sc_uq_audio_swap_lr, and uaudio_chan_matrix_swap_2_0.

Referenced by ua_chan_getmatrix().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_chan_getptr()

int uaudio_chan_getptr ( struct uaudio_chan ch)

Definition at line 2719 of file uaudio.c.

References uaudio_chan::cur, and uaudio_chan::start.

Referenced by ua_chan_getptr().

Here is the caller graph for this function:

◆ uaudio_chan_init()

void * uaudio_chan_init ( struct uaudio_chan ch,
struct snd_dbuf b,
struct pcm_channel c,
int  dir 
)

◆ uaudio_chan_is_async()

static int uaudio_chan_is_async ( struct uaudio_chan ch,
uint8_t  alt 
)
static

Definition at line 2309 of file uaudio.c.

References uaudio_chan_alt::p_ed1, UE_GET_ISO_TYPE, UE_ISO_ASYNC, and uaudio_chan::usb_alt.

Referenced by uaudio_chan_need_both(), and uaudio_chan_play_callback().

Here is the caller graph for this function:

◆ uaudio_chan_need_both()

static int uaudio_chan_need_both ( struct uaudio_chan pchan,
struct uaudio_chan rchan 
)
static

Definition at line 2804 of file uaudio.c.

References uaudio_chan::num_alt, uaudio_chan::running, uaudio_chan::set_alt, and uaudio_chan_is_async().

Referenced by uaudio_chan_start(), and uaudio_chan_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_chan_need_none()

static int uaudio_chan_need_none ( struct uaudio_chan pchan,
struct uaudio_chan rchan 
)
static

Definition at line 2814 of file uaudio.c.

References uaudio_chan::num_alt, and uaudio_chan::running.

Referenced by uaudio_chan_stop().

Here is the caller graph for this function:

◆ uaudio_chan_play_callback()

◆ uaudio_chan_play_sync_callback()

◆ uaudio_chan_reconfigure()

static void uaudio_chan_reconfigure ( struct uaudio_chan ch,
uint8_t  operation 
)
static

Definition at line 2783 of file uaudio.c.

References CHAN_OP_DRAIN, uaudio_chan::operation, uaudio_chan::priv_sc, uaudio_softc::sc_config_msg, uaudio_softc::sc_udev, and usb_proc_explore_msignal().

Referenced by uaudio_chan_start(), and uaudio_chan_stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_chan_record_callback()

◆ uaudio_chan_record_sync_callback()

static void uaudio_chan_record_sync_callback ( struct usb_xfer xfer,
usb_error_t  error 
)
static

Definition at line 2494 of file uaudio.c.

◆ uaudio_chan_set_param_blocksize()

int uaudio_chan_set_param_blocksize ( struct uaudio_chan ch,
uint32_t  blocksize 
)

Definition at line 2677 of file uaudio.c.

References uaudio_chan::buf, uaudio_chan::pcm_buf, uaudio_chan::set_alt, sndbuf_setup(), and uaudio_get_buffer_size().

Referenced by ua_chan_setblocksize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_chan_set_param_format()

int uaudio_chan_set_param_format ( struct uaudio_chan ch,
uint32_t  format 
)

Definition at line 2776 of file uaudio.c.

References DPRINTF, and format.

Referenced by ua_chan_setformat().

Here is the caller graph for this function:

◆ uaudio_chan_set_param_fragments()

int uaudio_chan_set_param_fragments ( struct uaudio_chan ch,
uint32_t  blocksize,
uint32_t  blockcount 
)

Definition at line 2685 of file uaudio.c.

Referenced by ua_chan_setfragments().

Here is the caller graph for this function:

◆ uaudio_chan_set_param_speed()

int uaudio_chan_set_param_speed ( struct uaudio_chan ch,
uint32_t  speed 
)

Definition at line 2692 of file uaudio.c.

References DPRINTF, uaudio_chan::num_alt, uaudio_chan::priv_sc, uaudio_chan_alt::sample_rate, uaudio_softc::sc_udev, uaudio_chan::set_alt, speed, uaudio_chan::usb_alt, usb_proc_explore_lock(), and usb_proc_explore_unlock().

Referenced by ua_chan_setspeed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_chan_start()

◆ uaudio_chan_stop()

void uaudio_chan_stop ( struct uaudio_chan ch)

◆ uaudio_configure_msg()

◆ uaudio_configure_msg_sub()

◆ uaudio_detach()

◆ uaudio_detach_sub()

int uaudio_detach_sub ( device_t  dev)

Definition at line 1246 of file uaudio.c.

References dev, error, uaudio_softc_child::mixer_init, mixer_uninit(), uaudio_softc_child::pcm_registered, pcm_unregister(), uaudio_softc::sc_child, uaudio_get_child_index_by_dev(), and usb_pause_mtx().

Referenced by ua_detach(), and uaudio_attach_sub().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_force_power_save()

static usb_error_t uaudio_force_power_save ( struct uaudio_softc sc,
uint8_t  iface_index 
)
static

Definition at line 949 of file uaudio.c.

References usb_interface::alt_index, usb_interface_descriptor::bAlternateSetting, usb_interface::idesc, uaudio_softc::sc_udev, USB_ERR_INVAL, usbd_get_iface(), usbd_req_set_alt_interface_no(), and usbd_set_alt_interface_index().

Referenced by uaudio_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_get_buffer_size()

static uint32_t uaudio_get_buffer_size ( struct uaudio_chan ch,
uint8_t  alt 
)
static

Definition at line 1314 of file uaudio.c.

References uaudio_chan_alt::sample_rate, uaudio_chan_alt::sample_size, UAUDIO_NFRAMES, and uaudio_chan::usb_alt.

Referenced by uaudio_chan_init(), uaudio_chan_set_param_blocksize(), and uaudio_chan_start().

Here is the caller graph for this function:

◆ uaudio_get_chan()

static struct uaudio_chan * uaudio_get_chan ( struct uaudio_softc sc,
struct uaudio_chan chan,
uint8_t  iface_index 
)
static

Definition at line 1685 of file uaudio.c.

References chan, uaudio_chan::iface_index, and UAUDIO_MAX_CHILD.

Referenced by uaudio_chan_fill_info_sub().

Here is the caller graph for this function:

◆ uaudio_get_child_index_by_chan()

static unsigned uaudio_get_child_index_by_chan ( struct uaudio_softc sc,
struct uaudio_chan ch 
)
static

Definition at line 854 of file uaudio.c.

References uaudio_softc::sc_play_chan, uaudio_softc::sc_rec_chan, and UAUDIO_MAX_CHILD.

Referenced by uaudio_chan_play_callback(), uaudio_chan_play_sync_callback(), uaudio_chan_start(), and uaudio_chan_stop().

Here is the caller graph for this function:

◆ uaudio_get_child_index_by_dev()

static unsigned uaudio_get_child_index_by_dev ( struct uaudio_softc sc,
device_t  dev 
)
static

◆ uaudio_hid_detach()

static void uaudio_hid_detach ( struct uaudio_softc sc)
static

Definition at line 6227 of file uaudio.c.

References uaudio_softc::sc_hid, UAUDIO_HID_N_TRANSFER, usbd_transfer_unsetup(), and uaudio_hid::xfer.

Referenced by uaudio_detach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_hid_probe()

◆ uaudio_hid_rx_callback()

◆ uaudio_mixer_add_ctl()

◆ uaudio_mixer_add_ctl_sub()

static void uaudio_mixer_add_ctl_sub ( struct uaudio_softc sc,
struct uaudio_mixer_node mc 
)
static

◆ uaudio_mixer_add_extension()

◆ uaudio_mixer_add_feature()

◆ uaudio_mixer_add_mixer()

◆ uaudio_mixer_add_processing()

◆ uaudio_mixer_add_processing_updown()

◆ uaudio_mixer_add_selector()

◆ uaudio_mixer_bsd2value()

static int uaudio_mixer_bsd2value ( struct uaudio_mixer_node mc,
int  val 
)
static

Definition at line 5338 of file uaudio.c.

References uaudio_mixer_node::maxval, uaudio_mixer_node::minval, MIX_ON_OFF, MIX_SELECTOR, uaudio_mixer_node::mul, uaudio_mixer_node::type, and val.

Referenced by uaudio_mixer_ctl_set().

Here is the caller graph for this function:

◆ uaudio_mixer_check_selectors()

static void uaudio_mixer_check_selectors ( struct uaudio_softc sc)
static

Definition at line 3449 of file uaudio.c.

References DPRINTF, k, and MIX.

Referenced by uaudio20_mixer_add_selector(), and uaudio_mixer_add_selector().

Here is the caller graph for this function:

◆ uaudio_mixer_controls_create_ftu()

static void uaudio_mixer_controls_create_ftu ( struct uaudio_softc sc)
static

Definition at line 3038 of file uaudio.c.

References desc, MAKE_WORD, MIX, MIX_SIGNED_16, MIX_SIGNED_8, MIX_UNSIGNED_16, uaudio_softc::sc_mixer_iface_no, uaudio_mixer_add_ctl(), and uaudio_mixer_add_ctl_sub().

Referenced by uaudio_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_mixer_ctl_free()

static void uaudio_mixer_ctl_free ( struct uaudio_softc sc)
static

Definition at line 2960 of file uaudio.c.

References free, uaudio_mixer_node::next, and uaudio_softc::sc_mixer_root.

Referenced by uaudio_detach().

Here is the caller graph for this function:

◆ uaudio_mixer_ctl_set()

static void uaudio_mixer_ctl_set ( struct uaudio_softc sc,
struct uaudio_mixer_node mc,
uint8_t  chan,
int  val 
)
static

Definition at line 5361 of file uaudio.c.

References chan, uaudio_softc::sc_mixer_xfer, uaudio_mixer_bsd2value(), uaudio_mixer_node::update, usbd_transfer_start(), val, and uaudio_mixer_node::wData.

Referenced by uaudio_mixer_set(), and uaudio_mixer_setrecsrc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_mixer_determine_class()

◆ uaudio_mixer_feature_get_bmaControls()

static uint32_t uaudio_mixer_feature_get_bmaControls ( const struct usb_audio_feature_unit d,
uint8_t  i 
)
static

Definition at line 3595 of file uaudio.c.

References usb_audio_feature_unit::bControlSize, usb_audio_feature_unit::bmaControls, and offset.

Referenced by uaudio_mixer_add_feature().

Here is the caller graph for this function:

◆ uaudio_mixer_fill_info()

static void uaudio_mixer_fill_info ( struct uaudio_softc sc,
struct usb_device udev,
void *  desc 
)
static

Definition at line 4929 of file uaudio.c.

References usb_audio_control_descriptor::bcdADC, usb_audio_control_descriptor::bDescriptorSubtype, usb_descriptor::bDescriptorSubtype, usb_audio_control_descriptor::bDescriptorType, usb_audio_control_descriptor::bLength, usb_descriptor::bLength, usb_audio_unit::bUnitId, desc, uaudio_terminal_node::desc, DPRINTF, free, uaudio_search_result::id_max, uaudio_search_result::is_input, uaudio_search_result::recurse_level, uaudio_softc::sc_audio_rev, uaudio_softc::sc_mixer_clocks, uaudio_terminal_node::u, uaudio20_mixer_add_feature(), uaudio20_mixer_add_mixer(), uaudio20_mixer_add_selector(), uaudio20_mixer_find_clocks_sub(), uaudio20_mixer_find_inputs_sub(), uaudio20_mixer_verify_desc(), uaudio_mixer_add_extension(), uaudio_mixer_add_feature(), uaudio_mixer_add_mixer(), uaudio_mixer_add_processing(), uaudio_mixer_add_selector(), uaudio_mixer_find_inputs_sub(), uaudio_mixer_verify_desc(), UAUDIO_VERSION_20, UAUDIO_VERSION_30, UDESC_CS_INTERFACE, UDESCSUB_AC_CLOCK_MUL, UDESCSUB_AC_CLOCK_SEL, UDESCSUB_AC_CLOCK_SRC, UDESCSUB_AC_EFFECT, UDESCSUB_AC_EXTENSION, UDESCSUB_AC_EXTENSION_V2, UDESCSUB_AC_FEATURE, UDESCSUB_AC_HEADER, UDESCSUB_AC_INPUT, UDESCSUB_AC_MIXER, UDESCSUB_AC_OUTPUT, UDESCSUB_AC_PROCESSING, UDESCSUB_AC_PROCESSING_V2, UDESCSUB_AC_SAMPLE_RT, UDESCSUB_AC_SELECTOR, UGETW, usb_desc_foreach(), usbd_get_config_descriptor(), uaudio_terminal_node::usr, and usb_audio_control_descriptor::wTotalLength.

Referenced by uaudio_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_mixer_find_inputs_sub()

◆ uaudio_mixer_foreach_input()

static bool uaudio_mixer_foreach_input ( const struct uaudio_terminal_node iot,
uint8_t *  pindex 
)
static

Definition at line 4427 of file uaudio.c.

References uaudio_search_result::bit_input, uaudio_search_result::id_max, n, and uaudio_terminal_node::usr.

Referenced by uaudio20_mixer_determine_class(), and uaudio_mixer_determine_class().

Here is the caller graph for this function:

◆ uaudio_mixer_foreach_output()

static bool uaudio_mixer_foreach_output ( const struct uaudio_terminal_node iot,
uint8_t *  pindex 
)
static

Definition at line 4446 of file uaudio.c.

References uaudio_search_result::bit_output, uaudio_search_result::id_max, n, and uaudio_terminal_node::usr.

Referenced by uaudio20_mixer_determine_class(), and uaudio_mixer_determine_class().

Here is the caller graph for this function:

◆ uaudio_mixer_get()

static int uaudio_mixer_get ( struct usb_device udev,
uint16_t  audio_rev,
uint8_t  what,
struct uaudio_mixer_node mc 
)
static

◆ uaudio_mixer_get_cluster()

static struct usb_audio_cluster uaudio_mixer_get_cluster ( uint8_t  id,
const struct uaudio_terminal_node iot 
)
static

◆ uaudio_mixer_get_feature_by_tt()

static uint16_t uaudio_mixer_get_feature_by_tt ( uint16_t  terminal_type,
uint16_t  default_type 
)
static

◆ uaudio_mixer_init()

◆ uaudio_mixer_init_sub()

◆ uaudio_mixer_merge_outputs()

static void uaudio_mixer_merge_outputs ( struct uaudio_search_result dst,
const struct uaudio_search_result src 
)
static

Definition at line 4655 of file uaudio.c.

References uaudio_search_result::bit_output, max, and src.

Referenced by uaudio20_mixer_find_inputs_sub(), and uaudio_mixer_find_inputs_sub().

Here is the caller graph for this function:

◆ uaudio_mixer_register_sysctl()

static void uaudio_mixer_register_sysctl ( struct uaudio_softc sc,
device_t  dev,
unsigned  index 
)
static

◆ uaudio_mixer_reload_all()

static void uaudio_mixer_reload_all ( struct uaudio_softc sc)
static

◆ uaudio_mixer_set()

void uaudio_mixer_set ( struct uaudio_softc sc,
struct snd_mixer m,
unsigned  type,
unsigned  left,
unsigned  right 
)

Definition at line 5445 of file uaudio.c.

References chan, uaudio_mixer_node::ctl, index, left, m, mix_get_dev(), uaudio_mixer_node::nchan, uaudio_mixer_node::next, right, uaudio_softc::sc_mixer_root, type, uaudio_get_child_index_by_dev(), and uaudio_mixer_ctl_set().

Referenced by ua_mixer_set().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_mixer_setrecsrc()

uint32_t uaudio_mixer_setrecsrc ( struct uaudio_softc sc,
struct snd_mixer m,
uint32_t  src 
)

◆ uaudio_mixer_signext()

static int uaudio_mixer_signext ( uint8_t  type,
int  val 
)
static

Definition at line 5325 of file uaudio.c.

References MIX_SIZE, MIX_UNSIGNED, type, and val.

Referenced by uaudio_mixer_get().

Here is the caller graph for this function:

◆ uaudio_mixer_sysctl_handler()

static int uaudio_mixer_sysctl_handler ( SYSCTL_HANDLER_ARGS  )
static

◆ uaudio_mixer_uninit_sub()

int uaudio_mixer_uninit_sub ( struct uaudio_softc sc,
struct snd_mixer m 
)

Definition at line 5430 of file uaudio.c.

References DPRINTF, index, m, mix_get_dev(), uaudio_softc_child::mixer_lock, uaudio_softc::sc_child, uaudio_softc::sc_mixer_xfer, uaudio_get_child_index_by_dev(), and usbd_transfer_unsetup().

Referenced by ua_mixer_uninit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_mixer_verify_desc()

static const void * uaudio_mixer_verify_desc ( const void *  arg,
uint32_t  len 
)
static

◆ uaudio_mixer_write_cfg_callback()

◆ uaudio_pcm_setflags()

static void uaudio_pcm_setflags ( device_t  dev,
uint32_t  flags 
)
static

Definition at line 1169 of file uaudio.c.

References dev, pcm_getflags(), and pcm_setflags().

Referenced by uaudio_attach_sub().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_probe()

◆ uaudio_record_fix_fs()

static void uaudio_record_fix_fs ( usb_endpoint_descriptor_audio_t *  ep,
uint32_t  xps,
uint32_t  add 
)
static

Definition at line 1555 of file uaudio.c.

References DPRINTF, UGETW, and USETW.

Referenced by uaudio_chan_fill_info_sub().

Here is the caller graph for this function:

◆ uaudio_set_spdif_cm6206()

static int uaudio_set_spdif_cm6206 ( struct uaudio_softc sc,
int  flags 
)
static

Definition at line 913 of file uaudio.c.

References uaudio_softc::sc_mixer_iface_index, uaudio_softc::sc_udev, UAUDIO_SPDIF_IN_MIX, UAUDIO_SPDIF_OUT, UAUDIO_SPDIF_OUT_96K, UHID_OUTPUT_REPORT, and usbd_req_set_report().

Referenced by uaudio_attach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uaudio_set_spdif_dummy()

static int uaudio_set_spdif_dummy ( struct uaudio_softc sc,
int  flags 
)
static

Definition at line 943 of file uaudio.c.

Referenced by uaudio_attach().

Here is the caller graph for this function:

◆ uaudio_set_speed()

static usb_error_t uaudio_set_speed ( struct usb_device udev,
uint8_t  endpt,
uint32_t  speed 
)
static

Definition at line 5282 of file uaudio.c.

References data, req, SAMPLING_FREQ_CONTROL, SET_CUR, speed, usbd_do_request, USETW, USETW2, and UT_WRITE_CLASS_ENDPOINT.

Referenced by uaudio_configure_msg_sub().

Here is the caller graph for this function:

◆ umidi_bulk_read_callback()

◆ umidi_bulk_write_callback()

◆ umidi_close()

static void umidi_close ( struct usb_fifo fifo,
int  fflags 
)
static

Definition at line 5920 of file uaudio.c.

References umidi_sub_chan::fifo, and usb_fifo_free_buffer().

Here is the call graph for this function:

◆ umidi_convert_to_usb()

static uint8_t umidi_convert_to_usb ( struct umidi_sub_chan sub,
uint8_t  cn,
uint8_t  b 
)
static

◆ umidi_detach()

static int umidi_detach ( device_t  dev)
static

Definition at line 6049 of file uaudio.c.

References chan, dev, n, uaudio_softc::sc_midi_chan, UMIDI_EMB_JACK_MAX, UMIDI_N_TRANSFER, UMIDI_RX_TRANSFER, usb_fifo_detach(), usbd_transfer_stop(), and usbd_transfer_unsetup().

Referenced by uaudio_detach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ umidi_init()

static void umidi_init ( device_t  dev)
static

Definition at line 5938 of file uaudio.c.

References chan, dev, and uaudio_softc::sc_midi_chan.

Referenced by uaudio_attach().

Here is the caller graph for this function:

◆ umidi_ioctl()

static int umidi_ioctl ( struct usb_fifo fifo,
u_long  cmd,
void *  data,
int  fflags 
)
static

Definition at line 5931 of file uaudio.c.

◆ umidi_open()

static int umidi_open ( struct usb_fifo fifo,
int  fflags 
)
static

◆ umidi_probe()

◆ umidi_start_read()

static void umidi_start_read ( struct usb_fifo fifo)
static

Definition at line 5829 of file uaudio.c.

References chan, UMIDI_RX_TRANSFER, usb_fifo_softc(), and usbd_transfer_start().

Here is the call graph for this function:

◆ umidi_start_write()

static void umidi_start_write ( struct usb_fifo fifo)
static

Definition at line 5856 of file uaudio.c.

References buf, chan, UMIDI_TX_TRANSFER, usb_fifo_get_data_linear(), usb_fifo_softc(), and usbd_transfer_start().

Here is the call graph for this function:

◆ umidi_stop_read()

static void umidi_stop_read ( struct usb_fifo fifo)
static

Definition at line 5837 of file uaudio.c.

References chan, DPRINTF, umidi_sub_chan::fifo, umidi_sub_chan::read_open, umidi_sub_by_fifo(), and usb_fifo_softc().

Here is the call graph for this function:

◆ umidi_stop_write()

static void umidi_stop_write ( struct usb_fifo fifo)
static

Definition at line 5873 of file uaudio.c.

References chan, DPRINTF, umidi_sub_chan::fifo, umidi_sub_by_fifo(), UMIDI_TX_TRANSFER, usb_fifo_softc(), usbd_transfer_stop(), and umidi_sub_chan::write_open.

Here is the call graph for this function:

◆ umidi_sub_by_fifo()

static struct umidi_sub_chan * umidi_sub_by_fifo ( struct usb_fifo fifo)
static

Definition at line 5808 of file uaudio.c.

References chan, umidi_sub_chan::fifo, usb_fifo_sc::fp, n, UMIDI_EMB_JACK_MAX, USB_FIFO_RX, usb_fifo_softc(), and USB_FIFO_TX.

Referenced by umidi_open(), umidi_stop_read(), and umidi_stop_write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ USB_PNP_HOST_INFO() [1/2]

USB_PNP_HOST_INFO ( uaudio_devs  )

◆ USB_PNP_HOST_INFO() [2/2]

USB_PNP_HOST_INFO ( uaudio_vendor_midi  )

Variable Documentation

◆ uaudio10_formats

const struct uaudio_format uaudio10_formats[]
static
Initial value:
= {
{UA_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"},
{UA_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"},
{UA_FMT_PCM8, 24, AFMT_U24_LE, "24-bit U-LE PCM"},
{UA_FMT_PCM8, 32, AFMT_U32_LE, "32-bit U-LE PCM"},
{UA_FMT_PCM, 8, AFMT_S8, "8-bit S-LE PCM"},
{UA_FMT_PCM, 16, AFMT_S16_LE, "16-bit S-LE PCM"},
{UA_FMT_PCM, 24, AFMT_S24_LE, "24-bit S-LE PCM"},
{UA_FMT_PCM, 32, AFMT_S32_LE, "32-bit S-LE PCM"},
{UA_FMT_ALAW, 8, AFMT_A_LAW, "8-bit A-Law"},
{UA_FMT_MULAW, 8, AFMT_MU_LAW, "8-bit mu-Law"},
{0, 0, 0, NULL}
}
#define UA_FMT_MULAW
Definition: uaudioreg.h:401
#define UA_FMT_ALAW
Definition: uaudioreg.h:400
#define UA_FMT_PCM
Definition: uaudioreg.h:397
#define UA_FMT_PCM8
Definition: uaudioreg.h:398

Definition at line 437 of file uaudio.c.

Referenced by uaudio_chan_fill_info_sub().

◆ uaudio20_formats

const struct uaudio_format uaudio20_formats[]
static
Initial value:
= {
{UA20_FMT_PCM, 8, AFMT_S8, "8-bit S-LE PCM"},
{UA20_FMT_PCM, 16, AFMT_S16_LE, "16-bit S-LE PCM"},
{UA20_FMT_PCM, 24, AFMT_S24_LE, "24-bit S-LE PCM"},
{UA20_FMT_PCM, 32, AFMT_S32_LE, "32-bit S-LE PCM"},
{UA20_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"},
{UA20_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"},
{UA20_FMT_PCM8, 24, AFMT_U24_LE, "24-bit U-LE PCM"},
{UA20_FMT_PCM8, 32, AFMT_U32_LE, "32-bit U-LE PCM"},
{UA20_FMT_ALAW, 8, AFMT_A_LAW, "8-bit A-Law"},
{UA20_FMT_MULAW, 8, AFMT_MU_LAW, "8-bit mu-Law"},
{0, 0, 0, NULL}
}
#define UA20_FMT_MULAW
Definition: uaudioreg.h:805
#define UA20_FMT_ALAW
Definition: uaudioreg.h:804
#define UA20_FMT_PCM8
Definition: uaudioreg.h:802
#define UA20_FMT_PCM
Definition: uaudioreg.h:801

Definition at line 453 of file uaudio.c.

Referenced by uaudio_chan_fill_info_sub().

◆ uaudio_attach

device_attach_t uaudio_attach
static

Definition at line 472 of file uaudio.c.

◆ uaudio_buffer_ms

int uaudio_buffer_ms = 2
static

Definition at line 102 of file uaudio.c.

Referenced by uaudio_attach(), uaudio_buffer_ms_sysctl(), and uaudio_configure_msg_sub().

◆ uaudio_cfg_play

const struct usb_config uaudio_cfg_play[UAUDIO_NCHANBUFS+1]
static

Definition at line 606 of file uaudio.c.

Referenced by uaudio_chan_fill_info_sub().

◆ uaudio_cfg_record

const struct usb_config uaudio_cfg_record[UAUDIO_NCHANBUFS+1]
static

Definition at line 573 of file uaudio.c.

Referenced by uaudio_chan_fill_info_sub().

◆ uaudio_chan_matrix_swap_2_0

struct pcmchan_matrix uaudio_chan_matrix_swap_2_0
static
Initial value:
= {
.channels = 2,
.ext = 0,
.map = {
[0] = {
.type = SND_CHN_T_FR,
.members =
},
[1] = {
.type = SND_CHN_T_FL,
.members =
},
[2] = {
.type = SND_CHN_T_MAX,
.members = 0
}
},
.offset = { 1, 0, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1 }
}
#define SND_CHN_T_MASK_BC
Definition: matrix.h:90
#define SND_CHN_T_MASK_FL
Definition: matrix.h:82
#define SND_CHN_T_MASK_BL
Definition: matrix.h:86
#define SND_CHN_T_FL
Definition: matrix.h:42
#define SND_CHN_T_MASK_LF
Definition: matrix.h:85
#define SND_CHN_T_MAX
Definition: matrix.h:60
#define SND_CHN_T_FR
Definition: matrix.h:43
#define SND_CHN_T_MASK_BR
Definition: matrix.h:87
#define SND_CHN_T_MASK_FR
Definition: matrix.h:83
#define SND_CHN_T_MASK_SL
Definition: matrix.h:91
#define SND_CHN_T_MASK_FC
Definition: matrix.h:84
#define SND_CHN_T_MASK_SR
Definition: matrix.h:92
#define SND_CHN_MATRIX_DRV
Definition: matrix.h:169

Definition at line 2730 of file uaudio.c.

Referenced by uaudio_chan_getmatrix().

◆ uaudio_chan_play_callback

usb_callback_t uaudio_chan_play_callback
static

Definition at line 475 of file uaudio.c.

◆ uaudio_chan_play_sync_callback

usb_callback_t uaudio_chan_play_sync_callback
static

Definition at line 476 of file uaudio.c.

◆ uaudio_chan_record_callback

usb_callback_t uaudio_chan_record_callback
static

Definition at line 477 of file uaudio.c.

◆ uaudio_chan_record_sync_callback

usb_callback_t uaudio_chan_record_sync_callback
static

Definition at line 478 of file uaudio.c.

◆ uaudio_configure_msg

Definition at line 484 of file uaudio.c.

Referenced by uaudio_attach().

◆ uaudio_default_bits

int uaudio_default_bits = 32
static

Definition at line 100 of file uaudio.c.

Referenced by uaudio_chan_fill_info().

◆ uaudio_default_channels

int uaudio_default_channels = 0
static

Definition at line 101 of file uaudio.c.

Referenced by uaudio_chan_fill_info().

◆ uaudio_default_rate

int uaudio_default_rate = 0
static

Definition at line 99 of file uaudio.c.

Referenced by uaudio_chan_fill_info().

◆ uaudio_detach

device_detach_t uaudio_detach
static

Definition at line 473 of file uaudio.c.

Referenced by uaudio_attach().

◆ uaudio_devclass

devclass_t uaudio_devclass
static

Definition at line 703 of file uaudio.c.

◆ uaudio_devs

const STRUCT_USB_HOST_ID __used uaudio_devs[]
static
Initial value:
= {
{USB_IFACE_CLASS(UICLASS_AUDIO),
USB_IFACE_SUBCLASS(UISUBCLASS_AUDIOCONTROL),},
{USB_IFACE_CLASS(UICLASS_AUDIO),
USB_IFACE_SUBCLASS(UISUBCLASS_MIDISTREAM),},
}
#define USB_IFACE_SUBCLASS(isc)
#define USB_IFACE_CLASS(ic)

Definition at line 831 of file uaudio.c.

◆ uaudio_driver

driver_t uaudio_driver
static
Initial value:
= {
.name = "uaudio",
.methods = uaudio_methods,
.size = sizeof(struct uaudio_softc),
}
static device_method_t uaudio_methods[]
Definition: uaudio.c:705

Definition at line 716 of file uaudio.c.

◆ uaudio_handle_hid

bool uaudio_handle_hid = true
static

Definition at line 103 of file uaudio.c.

Referenced by uaudio_attach().

◆ uaudio_hid_config

const struct usb_config uaudio_hid_config[UAUDIO_HID_N_TRANSFER]
static
Initial value:
= {
.type = UE_INTERRUPT,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
.bufsize = 0,
.flags = {.short_xfer_ok = 1,},
.callback = &uaudio_hid_rx_callback,
},
}
@ UAUDIO_HID_RX_TRANSFER
Definition: uaudio.c:330
static usb_callback_t uaudio_hid_rx_callback
Definition: uaudio.c:482
#define UE_INTERRUPT
#define UE_ADDR_ANY
#define UE_DIR_IN

Definition at line 692 of file uaudio.c.

Referenced by uaudio_hid_probe().

◆ uaudio_hid_rx_callback

usb_callback_t uaudio_hid_rx_callback
static

Definition at line 482 of file uaudio.c.

◆ uaudio_methods

device_method_t uaudio_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, uaudio_probe),
DEVMETHOD(device_attach, uaudio_attach),
DEVMETHOD(device_detach, uaudio_detach),
DEVMETHOD(device_suspend, bus_generic_suspend),
DEVMETHOD(device_resume, bus_generic_resume),
DEVMETHOD(device_shutdown, bus_generic_shutdown),
DEVMETHOD_END
}
static device_detach_t uaudio_detach
Definition: uaudio.c:473
static device_probe_t uaudio_probe
Definition: uaudio.c:471
static device_attach_t uaudio_attach
Definition: uaudio.c:472

Definition at line 705 of file uaudio.c.

◆ uaudio_mixer_config

const struct usb_config uaudio_mixer_config[1]
static
Initial value:
= {
[0] = {
.type = UE_CONTROL,
.endpoint = 0x00,
.direction = UE_DIR_ANY,
.bufsize = (sizeof(struct usb_device_request) + 4),
.timeout = 1000,
},
}
METHOD void callback
Definition: mpu_if.m:54
static usb_callback_t uaudio_mixer_write_cfg_callback
Definition: uaudio.c:479
#define UE_DIR_ANY
#define UE_CONTROL

Definition at line 639 of file uaudio.c.

Referenced by uaudio_mixer_init_sub().

◆ uaudio_mixer_write_cfg_callback

usb_callback_t uaudio_mixer_write_cfg_callback
static

Definition at line 479 of file uaudio.c.

◆ uaudio_probe

device_probe_t uaudio_probe
static

Definition at line 471 of file uaudio.c.

◆ uaudio_rate_list

const uint32_t uaudio_rate_list[CHAN_MAX_ALT]
static
Initial value:
= {
384000,
352800,
192000,
176400,
96000,
88200,
88000,
80000,
72000,
64000,
56000,
48000,
44100,
40000,
32000,
24000,
22050,
16000,
11025,
8000,
0
}

Definition at line 2124 of file uaudio.c.

Referenced by uaudio_chan_fill_info().

◆ uaudio_tt_to_feature

Initial value:
= {
{UATI_MICROPHONE, SOUND_MIXER_MIC},
{UATI_DESKMICROPHONE, SOUND_MIXER_MIC},
{UATI_PERSONALMICROPHONE, SOUND_MIXER_MIC},
{UATI_OMNIMICROPHONE, SOUND_MIXER_MIC},
{UATI_MICROPHONEARRAY, SOUND_MIXER_MIC},
{UATI_PROCMICROPHONEARR, SOUND_MIXER_MIC},
{UATE_ANALOGCONN, SOUND_MIXER_LINE},
{UATE_LINECONN, SOUND_MIXER_LINE},
{UATE_LEGACYCONN, SOUND_MIXER_LINE},
{UATE_DIGITALAUIFC, SOUND_MIXER_ALTPCM},
{UATE_SPDIF, SOUND_MIXER_ALTPCM},
{UATE_1394DA, SOUND_MIXER_ALTPCM},
{UATE_1394DV, SOUND_MIXER_ALTPCM},
{UATF_CDPLAYER, SOUND_MIXER_CD},
{UATF_SYNTHESIZER, SOUND_MIXER_SYNTH},
{UATF_VIDEODISCAUDIO, SOUND_MIXER_VIDEO},
{UATF_DVDAUDIO, SOUND_MIXER_VIDEO},
{UATF_TVTUNERAUDIO, SOUND_MIXER_VIDEO},
{UATF_RADIORECV, SOUND_MIXER_RADIO},
{UATF_RADIOXMIT, SOUND_MIXER_RADIO},
{}
}
#define UATE_SPDIF
Definition: uaudioreg.h:330
#define UATF_SYNTHESIZER
Definition: uaudioreg.h:353
#define UATI_PERSONALMICROPHONE
Definition: uaudioreg.h:299
#define UATF_RADIOXMIT
Definition: uaudioreg.h:351
#define UATE_LEGACYCONN
Definition: uaudioreg.h:329
#define UATI_PROCMICROPHONEARR
Definition: uaudioreg.h:302
#define UATE_1394DA
Definition: uaudioreg.h:331
#define UATE_ANALOGCONN
Definition: uaudioreg.h:326
#define UATF_DVDAUDIO
Definition: uaudioreg.h:345
#define UATI_MICROPHONE
Definition: uaudioreg.h:297
#define UATE_DIGITALAUIFC
Definition: uaudioreg.h:327
#define UATI_DESKMICROPHONE
Definition: uaudioreg.h:298
#define UATF_CDPLAYER
Definition: uaudioreg.h:337
#define UATF_TVTUNERAUDIO
Definition: uaudioreg.h:346
#define UATE_1394DV
Definition: uaudioreg.h:332
#define UATF_VIDEODISCAUDIO
Definition: uaudioreg.h:344
#define UATE_LINECONN
Definition: uaudioreg.h:328
#define UATI_MICROPHONEARRAY
Definition: uaudioreg.h:301
#define UATI_OMNIMICROPHONE
Definition: uaudioreg.h:300
#define UATF_RADIORECV
Definition: uaudioreg.h:350

Definition at line 4469 of file uaudio.c.

Referenced by uaudio_mixer_get_feature_by_tt().

◆ uaudio_vendor_midi

const STRUCT_USB_HOST_ID uaudio_vendor_midi[]
static

Definition at line 723 of file uaudio.c.

Referenced by uaudio_attach(), and uaudio_probe().

◆ umidi_bulk_read_callback

usb_callback_t umidi_bulk_read_callback
static

Definition at line 480 of file uaudio.c.

◆ umidi_bulk_write_callback

usb_callback_t umidi_bulk_write_callback
static

Definition at line 481 of file uaudio.c.

◆ umidi_cmd_to_len

const uint8_t umidi_cmd_to_len[16]
static
Initial value:
= {
[0x0] = 0,
[0x1] = 0,
[0x2] = 2,
[0x3] = 3,
[0x4] = 3,
[0x5] = 1,
[0x6] = 2,
[0x7] = 3,
[0x8] = 3,
[0x9] = 3,
[0xA] = 3,
[0xB] = 3,
[0xC] = 2,
[0xD] = 2,
[0xE] = 3,
[0xF] = 1,
}

Definition at line 651 of file uaudio.c.

Referenced by umidi_bulk_read_callback().

◆ umidi_config

const struct usb_config umidi_config[UMIDI_N_TRANSFER]
static
Initial value:
= {
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_OUT,
.bufsize = UMIDI_TX_BUFFER,
.flags = {.no_pipe_ok = 1},
},
.type = UE_BULK,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
.bufsize = 4,
.flags = {.short_xfer_ok = 1,.proxy_buffer = 1,.no_pipe_ok = 1},
},
}
static usb_callback_t umidi_bulk_read_callback
Definition: uaudio.c:480
#define UMIDI_TX_BUFFER
Definition: uaudio.c:276
static usb_callback_t umidi_bulk_write_callback
Definition: uaudio.c:481
@ UMIDI_RX_TRANSFER
Definition: uaudio.c:280
@ UMIDI_TX_TRANSFER
Definition: uaudio.c:279
#define UE_BULK
#define UE_DIR_OUT

Definition at line 671 of file uaudio.c.

Referenced by umidi_probe().

◆ umidi_fifo_methods

struct usb_fifo_methods umidi_fifo_methods
static
Initial value:
= {
.f_start_read = &umidi_start_read,
.f_start_write = &umidi_start_write,
.f_stop_read = &umidi_stop_read,
.f_stop_write = &umidi_stop_write,
.f_open = &umidi_open,
.f_close = &umidi_close,
.f_ioctl = &umidi_ioctl,
.basename[0] = "umidi",
}
static void umidi_start_write(struct usb_fifo *)
Definition: uaudio.c:5856
static void umidi_start_read(struct usb_fifo *)
Definition: uaudio.c:5829
static int umidi_ioctl(struct usb_fifo *, u_long cmd, void *, int)
Definition: uaudio.c:5931
static void umidi_stop_read(struct usb_fifo *)
Definition: uaudio.c:5837
static int umidi_open(struct usb_fifo *, int)
Definition: uaudio.c:5889
static void umidi_close(struct usb_fifo *, int)
Definition: uaudio.c:5920
static void umidi_stop_write(struct usb_fifo *)
Definition: uaudio.c:5873

Definition at line 5946 of file uaudio.c.

Referenced by umidi_probe().