-/* $OpenBSD: ucc.c,v 1.30 2022/02/16 06:23:42 anton Exp $ */
+/* $OpenBSD: ucc.c,v 1.31 2022/03/08 12:47:33 anton Exp $ */
/*
* Copyright (c) 2021 Anton Lindqvist <anton@openbsd.org>
#include <dev/wscons/wsksymdef.h>
#include <dev/wscons/wsksymvar.h>
+#define DEVNAME(sc) ((sc)->sc_hdev.sc_dev.dv_xname)
+
/* #define UCC_DEBUG */
#ifdef UCC_DEBUG
#define DPRINTF(x...) do { if (ucc_debug) printf(x); } while (0)
ucc_dump(__func__, data, len);
if (len > sc->sc_input.i_bufsiz) {
- DPRINTF("%s: too much data: len %d, bufsiz %d\n", __func__,
+ DPRINTF("%s: too much data: len %d, bufsiz %d\n", DEVNAME(sc),
len, sc->sc_input.i_bufsiz);
return;
}
error = ucc_intr_slice(sc, data, buf, &len);
if (error) {
- DPRINTF("%s: slice failure: error %d\n", __func__, error);
+ DPRINTF("%s: slice failure: error %d\n", DEVNAME(sc), error);
return;
}
return;
unknown:
- DPRINTF("%s: unknown key: bit %d\n", __func__, bit);
+ DPRINTF("%s: unknown key: bit %d\n", DEVNAME(sc), bit);
}
void
}
hid_end_parse(hd);
- DPRINTF("%s: input: off %d, len %d\n", __func__,
+ DPRINTF("%s: input: off %d, len %d\n", DEVNAME(sc),
sc->sc_input.i_off, sc->sc_input.i_len);
return error;
sc->sc_raw[bit] = us;
}
- DPRINTF("%s: bit %d, usage \"%s\"\n", __func__,
+ DPRINTF("%s: bit %d, usage \"%s\"\n", DEVNAME(sc),
bit, us->us_name);
return 0;
}
sc->sc_volume.v_len = len;
DPRINTF("%s: inc %d, dec %d, off %d, len %d, min %d, max %d\n",
- __func__, sc->sc_volume.v_inc, sc->sc_volume.v_dec,
+ DEVNAME(sc), sc->sc_volume.v_inc, sc->sc_volume.v_dec,
sc->sc_volume.v_off, sc->sc_volume.v_len,
hi->logical_minimum, hi->logical_maximum);