From ed8ccb00a8669cb21729113aabb52bda08e93455 Mon Sep 17 00:00:00 2001 From: anton Date: Sat, 26 Nov 2022 06:26:51 +0000 Subject: [PATCH] Stop printing the device serial number during attach, it's not that useful after all. --- sys/dev/usb/uhidpp.c | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/sys/dev/usb/uhidpp.c b/sys/dev/usb/uhidpp.c index 252fe20b859..2b4e46431b6 100644 --- a/sys/dev/usb/uhidpp.c +++ b/sys/dev/usb/uhidpp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidpp.c,v 1.28 2022/11/26 06:26:14 anton Exp $ */ +/* $OpenBSD: uhidpp.c,v 1.29 2022/11/26 06:26:51 anton Exp $ */ /* * Copyright (c) 2021 Anton Lindqvist @@ -256,7 +256,6 @@ int hidpp_get_protocol_version(struct uhidpp_softc *, uint8_t, uint8_t *, uint8_t *); int hidpp10_get_name(struct uhidpp_softc *, uint8_t, char *, size_t); -int hidpp10_get_serial(struct uhidpp_softc *, uint8_t, uint8_t *, size_t); int hidpp10_get_type(struct uhidpp_softc *, uint8_t, const char **); int hidpp10_enable_notifications(struct uhidpp_softc *, uint8_t); @@ -379,15 +378,13 @@ uhidpp_attach(struct device *parent, struct device *self, void *aux) /* Probe paired devices. */ for (i = 0; i < UHIDPP_NDEVICES; i++) { char name[16]; - uint8_t serial[4]; struct uhidpp_device *dev = &sc->sc_devices[i]; const char *type; uint8_t device_id = i + 1; dev->d_id = device_id; - if (hidpp10_get_serial(sc, device_id, serial, sizeof(serial)) || - hidpp10_get_type(sc, device_id, &type) || + if (hidpp10_get_type(sc, device_id, &type) || hidpp10_get_name(sc, device_id, name, sizeof(name))) continue; @@ -396,8 +393,6 @@ uhidpp_attach(struct device *parent, struct device *self, void *aux) printf(" device %d", device_id); printf(" %s", type); printf(" \"%s\"", name); - printf(" serial %02x-%02x-%02x-%02x", - serial[0], serial[1], serial[2], serial[3]); npaired++; } if (npaired == 0) @@ -910,31 +905,6 @@ hidpp10_get_name(struct uhidpp_softc *sc, uint8_t device_id, return 0; } -int -hidpp10_get_serial(struct uhidpp_softc *sc, uint8_t device_id, - uint8_t *buf, size_t bufsiz) -{ - struct uhidpp_report resp; - int error; - uint8_t params[1] = { 0x30 + (device_id - 1) }; - uint8_t len; - - error = hidpp_send_rap_report(sc, - HIDPP_REPORT_ID_SHORT, - HIDPP_DEVICE_ID_RECEIVER, - HIDPP_GET_LONG_REGISTER, - HIDPP_REG_PAIRING_INFORMATION, - params, sizeof(params), &resp); - if (error) - return error; - - len = 4; - if (bufsiz < len) - len = bufsiz; - memcpy(buf, &resp.rap.params[1], len); - return 0; -} - int hidpp10_get_type(struct uhidpp_softc *sc, uint8_t device_id, const char **buf) { -- 2.20.1