Stop APPLE BLUETOOTH_HCI from attaching

[email protected] Tue, 23 Aug 2022 19:03:16 +0000 (UTC)
Newsgroups gmane.os.openbsd.ppc
Message-ID <bd364c364b28c2cc@pg4>
Hello. I was wondering if it still made sense to keep the APPLE
BLUETOOTH_HCI device from attaching as a mouse and keyboard combo,
since it is only meant to be used through bluetooth. It attaches
devices that won't and can't be used regardless. Here is a proposed
diff
Index: dev/usb/uhidev.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uhidev.c,v
retrieving revision 1.108
diff -u -p -u -p -r1.108 uhidev.c
--- dev/usb/uhidev.c	20 May 2022 05:03:45 -0000	1.108
+++ dev/usb/uhidev.c	23 Aug 2022 19:00:42 -0000
@@ -114,6 +114,9 @@ uhidev_match(struct device *parent, void
 {
 	struct usb_attach_arg *uaa = aux;
 	usb_interface_descriptor_t *id;
+	if (uaa->vendor == USB_VENDOR_APPLE &&
+	    uaa->product == USB_PRODUCT_APPLE_BLUETOOTH_HCI)
+		return (UMATCH_NONE);
 
 	if (uaa->iface == NULL)
 		return (UMATCH_NONE);
Index: dev/usb/ukbd.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/ukbd.c,v
retrieving revision 1.86
diff -u -p -u -p -r1.86 ukbd.c
--- dev/usb/ukbd.c	9 Jan 2022 05:43:00 -0000	1.86
+++ dev/usb/ukbd.c	23 Aug 2022 19:00:42 -0000
@@ -238,14 +238,6 @@ ukbd_attach(struct device *parent, struc
 	sc->sc_hdev.sc_osize = hid_report_size(desc, dlen, hid_output, repid);
 	sc->sc_hdev.sc_fsize = hid_report_size(desc, dlen, hid_feature, repid);
 
-	 /*
-	  * Since the HID-Proxy is always detected before any
-	  * real keyboard, do not let it grab the console.
-	  */
-	if (uha->uaa->vendor == USB_VENDOR_APPLE &&
-	    uha->uaa->product == USB_PRODUCT_APPLE_BLUETOOTH_HCI)
-		console = 0;
-
 	quirks = usbd_get_quirks(sc->sc_hdev.sc_udev)->uq_flags;
 	if (quirks & UQ_SPUR_BUT_UP)
 		qflags |= HIDKBD_SPUR_BUT_UP;