3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * CDDL HEADER START
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * The contents of this file are subject to the terms of the
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * Common Development and Distribution License (the "License").
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * You may not use this file except in compliance with the License.
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * or http://www.opensolaris.org/os/licensing.
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * See the License for the specific language governing permissions
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * and limitations under the License.
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * When distributing Covered Code, include this CDDL HEADER in each
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * If applicable, add the following below this CDDL HEADER, with the
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * fields enclosed by brackets "[]" replaced with your own identifying
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * information: Portions Copyright [yyyy] [name of copyright owner]
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * CDDL HEADER END
99bddabb317e8d8aa0ea11dcce9425dbf7f9258dGarrett D'Amore * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * Use is subject to license terms.
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore#define TEXT_DOMAIN "SYS_TEST" /* Use this only if it weren't */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore#define _(s) gettext(s)
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore#define AUDIO_CTRL_STEREO_LEFT(v) ((uint8_t)((v) & 0xff))
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore#define AUDIO_CTRL_STEREO_RIGHT(v) ((uint8_t)(((v) >> 8) & 0xff))
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore#define AUDIO_CTRL_STEREO_VAL(l, r) (((l) & 0xff) | (((r) & 0xff) << 8))
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * These are borrowed from sys/audio/audio_common.h, where the values
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * are protected by _KERNEL.
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore#define AUDIO_MN_TYPE_MASK ((1U << AUDIO_MN_TYPE_NBITS) - 1)
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * Column display information
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * All are related to the types enumerated in col_t and any change should be
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * reflected in the corresponding indices and offsets for all the variables
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * accordingly. Most tweaks to the display can be done by adjusting the
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * values here.
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/* types of columns displayed */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amoretypedef enum { COL_DV = 0, COL_NM, COL_VAL, COL_SEL} col_t;
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/* corresponding sizes of columns; does not include trailing null */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/* corresponding sizes of columns, indexed by col_t value */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore COL_DV_SZ, COL_NM_SZ, COL_VAL_SZ, COL_SEL_SZ
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/* used by callers of the printing function */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/* columns displayed in order with vopt = 0 */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amorestatic int col_dpy_len = sizeof (col_dpy) / sizeof (*col_dpy);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/* tells the printing function what members to use; follows col_dpy[] */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/* columns displayed in order with vopt = 1 */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amorestatic int col_dpy_vopt[] = { COL_DV, COL_NM, COL_VAL, COL_SEL};
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amorestatic int col_dpy_vopt_len = sizeof (col_dpy_vopt) / sizeof (*col_dpy_vopt);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/* tells the printing function what members to use; follows col_dpy_vopt[] */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/* columns displayed in order with tofile = 1 */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amorestatic int col_dpy_tofile[] = { COL_NM, COL_VAL};
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amorestatic int col_dpy_tofile_len = sizeof (col_dpy_tofile) /
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/* tells the printing function what members to use; follows col_dpy_tofile[] */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * mixer and control accounting
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/*PRINTFLIKE1*/
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore/*PRINTFLIKE1*/
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore for (i = 0; i < d->cmax; i++) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * adds to the end of global devices and returns a pointer to the new entry
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore for (p = devices; p->nextp != NULL; p = p->nextp) {}
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * cinfop->enump needs to be present
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * idx should be: >= 0 to < cinfop->ci.maxvalue
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore int sz = sizeof (*cinfop->ci.enum_present) * 8;
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if (cinfop->ci.enum_present[idx / sz] & (1 << (idx % sz)))
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore return (cinfop->enump->strings + cinfop->enump->strindex[idx]);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * caller fills in d->mixer.devnode; func fills in the rest
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if ((fd = open(d->mixer.devnode, O_RDWR)) < 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if (ioctl(fd, SNDCTL_MIX_NREXT, &d->cmax) < 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore d->controls = calloc(d->cmax, sizeof (*d->controls));
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore for (i = 0; i < d->cmax; i++) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if (ioctl(fd, SNDCTL_MIX_EXTINFO, &ci->ci) < 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if (ioctl(fd, SNDCTL_MIX_ENUMINFO, ci->enump) < 0) {
aef5f291eda20993128ff27fe48afa3097634eafGarrett D'Amore /* already loaded */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if ((fd = open("/dev/mixer", O_RDWR)) < 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore perror(_("Error getting system information"));
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if (ioctl(fd, SNDCTL_MIXERINFO, &d->mixer) != 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if ((ioctl(fd, SNDCTL_CARDINFO, &d->card) != 0) ||
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore warn(_("Device present: %s\n"), d->mixer.devnode);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore minor(sbuf.st_rdev) & ~(AUDIO_MN_TYPE_MASK));
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amoreprint_control_line(FILE *sfp, col_prt_t *colp, int vopt)
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore } else if (vopt) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore for (i = 0; i < col_cnt; i++) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore colstr = *(char **)(((size_t)colp) + col_prtp[i]);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) snprintf(cbuf, sizeof (cbuf), "%- *s",
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) strlcat(line, colsep, sizeof (line));
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) fprintf(sfp ? sfp : stdout, "%s\n", line);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amoreprint_control(FILE *sfp, device_t *d, cinfo_t *cinfop, int vopt)
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if (ioctl(mfd, SNDCTL_MIX_READ, &cval) < 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * convert the control value into a string
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) snprintf(valbuf, sizeof (valbuf), "%s",
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) snprintf(valbuf, sizeof (valbuf), "%d",
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) snprintf(valbuf, sizeof (valbuf), "%d:%d",
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore warn(_("Bad enum index %d for control '%s'\n"),
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) snprintf(valbuf, sizeof (valbuf), "%s", str);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * possible control values (range/selection)
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) snprintf(selbuf, sizeof (selbuf), _("on,off"));
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) snprintf(selbuf, sizeof (selbuf), "%d-%d",
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) snprintf(selbuf, sizeof (selbuf), "%d-%d:%d-%d",
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * display the first choice on the same line, then display
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * the rest on multiple lines
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) strlcat(selbuf, ",", sizeof (selbuf));
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) strlcat(selbuf, str, sizeof (selbuf));
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) snprintf(selbuf, sizeof (selbuf), "-");
99bddabb317e8d8aa0ea11dcce9425dbf7f9258dGarrett D'Amore /* non-verbose mode prints don't display the enum values */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore /* print leftover enum value selections */
99bddabb317e8d8aa0ea11dcce9425dbf7f9258dGarrett D'Amore while ((idx >= 0) && (idx < cinfop->ci.maxvalue)) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore for (i = idx; i < cinfop->ci.maxvalue; i++) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) strlcat(selbuf, ",", sizeof (selbuf));
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) strlcat(selbuf, str, sizeof (selbuf));
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amoreset_device_control(device_t *d, cinfo_t *cinfop, char *wstr, int vopt)
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore cval.value = (strncmp(_("on"), wstr, wlen) == 0) ? 1 : 0;
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore cval.value = AUDIO_CTRL_STEREO_VAL(lval, rval);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore warn(_("Unsupported control type: %d\n"), cinfop->ci.type);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore msg(_("%s: '%s' set to '%s'\n"), d->card.shortname,
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if (ioctl(mfd, SNDCTL_MIX_WRITE, &cval) < 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore"audioctl list-devices\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore" list all audio devices\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore"audioctl show-device [ -v ] [ -d <device> ]\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore" display information about an audio device\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore"audioctl show-control [ -v ] [ -d <device> ] [ <control> ... ]\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore" get the value of a specific control (all if not specified)\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore"audioctl set-control [ -v ] [ -d <device> ] <control> <value>\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore" set the value of a specific control\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore"audioctl save-controls [ -d <device> ] [ -f ] <file>\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore" save all control settings for the device to a file\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore"audioctl load-controls [ -d <device> ] <file>\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore" restore previously saved control settings to device\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore"audioctl help\n" \
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore" show this message.\n")
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore /* Not a device node! */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore minor(sbuf.st_rdev) & ~(AUDIO_MN_TYPE_MASK)));
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * User may have specified:
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * /dev/sound/<num>{,ctl,dsp,mixer}
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * /dev/sound/<driver>:<num>{,ctl,dsp,mixer}
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore * We can canonicalize these by looking at the dev_t though.
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore /* /dev/mixer node doesn't point to real hw */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore /* if we have a full path, convert to the devt */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore for (d = devices; d != NULL; d = d->nextp) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if ((name) && (strcmp(name, card->shortname) == 0)) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore while ((optc = getopt(argc, argv, "v")) != EOF) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore for (d = devices; d != NULL; d = d->nextp) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore while ((optc = getopt(argc, argv, "d:v")) != EOF) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore while ((optc = getopt(argc, argv, "d:v")) != EOF) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore /* do them all! */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore for (i = 0; i < d->cmax; i++) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore rv = print_control(NULL, d, cinfop, verbose);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore for (i = 0; i < argc; i++) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore for (j = 0; j < d->cmax; j++) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore rv = print_control(NULL, d, cinfop, verbose);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore /* Didn't find requested control */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if (j == d->cmax) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore while ((optc = getopt(argc, argv, "d:v")) != EOF) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore rv = set_device_control(d, cinfop, value, verbose);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore while ((optc = getopt(argc, argv, "d:f")) != EOF) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) fprintf(fp, "# Device: %s\n", d->mixer.devnode);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) fprintf(fp, "# Name = %s\n", d->card.shortname);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) fprintf(fp, "# Config = %s\n", d->card.longname);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore (void) fprintf(fp, "# HW Info = %s", d->card.hw_info);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore for (i = 0; i < d->cmax; i++) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore while ((optc = getopt(argc, argv, "d:")) != EOF) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore while (fgets(linebuf, sizeof (linebuf), fp) != NULL) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore warn(_("Warning: line too long at line %d\n"), lineno);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore /* read in the rest of the line and discard it */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore while (fgets(linebuf, sizeof (linebuf), fp) != NULL &&
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore /* we have a good line ... */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore /* skip comments and blank lines */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore warn(_("Warning: missing value at line %d\n"), lineno);
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore /* save and restore requires an exact match */
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore if (strcmp(cinfop->ci.extname, cname) != 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore rv = set_device_control(d, cinfop, value, 0);
aef5f291eda20993128ff27fe48afa3097634eafGarrett D'Amore (strncmp(link, "/dev/mixer", num_offset) != 0) ||
aef5f291eda20993128ff27fe48afa3097634eafGarrett D'Amore if (ioctl(fd, SNDCTL_SUN_SEND_NUMBER, &num) != 0) {
aef5f291eda20993128ff27fe48afa3097634eafGarrett D'Amore while ((optc = getopt(argc, argv, "v")) != EOF) {
aef5f291eda20993128ff27fe48afa3097634eafGarrett D'Amore perror(_("Unable to initialize devlink handle"));
aef5f291eda20993128ff27fe48afa3097634eafGarrett D'Amore if (di_devlink_walk(dlh, "^mixer", NULL, 0, &verbose,
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore while ((opt = getopt(argc, argv, "h")) != EOF) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore } else if (strcmp(argv[0], "list-devices") == 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore } else if (strcmp(argv[0], "show-device") == 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore } else if (strcmp(argv[0], "show-control") == 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore } else if (strcmp(argv[0], "set-control") == 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore } else if (strcmp(argv[0], "load-controls") == 0) {
3ccb19668faa3e1b7734ae03b4d31a4c00da3240Garrett D'Amore } else if (strcmp(argv[0], "save-controls") == 0) {
aef5f291eda20993128ff27fe48afa3097634eafGarrett D'Amore } else if (strcmp(argv[0], "init-devices") == 0) {