From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 10 06:18:35 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E79916A41C for ; Fri, 10 Jun 2005 06:18:35 +0000 (GMT) (envelope-from NKoch@demig.de) Received: from server.absolute-media.de (server.absolute-media.de [213.239.231.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id F19D943D49 for ; Fri, 10 Jun 2005 06:18:34 +0000 (GMT) (envelope-from NKoch@demig.de) Received: from localhost (unknown [127.0.0.1]) by server.absolute-media.de (Postfix) with ESMTP id 26B4184510; Fri, 10 Jun 2005 08:18:34 +0200 (CEST) Received: from server.absolute-media.de ([127.0.0.1]) by localhost (server [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 18577-08; Fri, 10 Jun 2005 08:18:29 +0200 (CEST) Received: from firewall.demig (p50839768.dip0.t-ipconnect.de [80.131.151.104]) by server.absolute-media.de (Postfix) with ESMTP id 78DC7847A4; Fri, 10 Jun 2005 08:18:27 +0200 (CEST) Received: from ws-ew-3 (ws-ew-3.w2kdemig [192.168.1.72]) by firewall.demig (8.13.4/8.13.1) with SMTP id j5A6EPXo091548; Fri, 10 Jun 2005 08:14:32 +0200 (CEST) (envelope-from NKoch@demig.de) From: "Norbert Koch" To: , Date: Fri, 10 Jun 2005 08:14:32 +0200 Message-ID: <001701c56d83$aada3e20$4801a8c0@ws-ew-3.W2KDEMIG> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 In-Reply-To: <200506092224.50203.hselasky@c2i.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2120.0 Importance: Normal X-Virus-Scanned: by amavisd-new X-Virus-Scanned: by amavisd-new at absolute-media.de Cc: Subject: RE: usbd.conf: detach ukbd X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2005 06:18:35 -0000 > I'm not sure if detach is supported like that, because the "ukbd" > device name > will not be passed to "usbd" during detach. Then one needs to > match against > the class/subclass of the USB-keyboard: > > device "USB keyboard" > class 3 > subclass 1 > detach "xxxx ukbd0" > But from what I see, when running usbd, the class and subclass keys of the cherry keyboard, I am testing with, are both zero at attach and detach. So, one idea would be to rewrite usbd.conf in the attach script. Usbd - as it is now - does only setenv ("DEVNAME"), but it would be trivial to add e.g. setenv ("VENDOR") and setenv ("PRODUCTID"). > Else if devd is not available on 4.11 you will have to change > some code and > compile a new kernel, from what I can see. > > To the file /sys/dev/usb/ukbd.c add this: > > static void > usbd_add_device_detach_event(device_t self) > { > struct usb_event ue; > > bzero(&ue, sizeof(ue)); > > strlcpy(ue.u.ue_device.udi_devnames[0], > device_get_nameunit(self), USB_MAX_DEVNAMELEN) ; > > usb_add_event(USB_EVENT_DEVICE_DETACH, &ue); > return; > } > > ukbd_detach() > { > ... > usbd_add_device_detach_event(self); > return (0); > } > > This will make the suggestion from Maksim work. > > A generic solution would be to call > "usbd_add_device_detach_event()" from the > "bus_child_detached" method of uhub, which must be added. > > Also one can change "usb_disconnect_port()" to generate the event > before the > sub-devices are detached, but that might not work in all cases. > > --HPS > Hmm, may be I'll try this. Thank you very much. Norbert