Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jun 2005 10:32:12 +0200
From:      "Norbert Koch" <NKoch@demig.de>
To:        <freebsd-hackers@freebsd.org>
Subject:   RE: usbd.conf: detach ukbd
Message-ID:  <000001c56ff2$65b5a8e0$4801a8c0@ws-ew-3.W2KDEMIG>
In-Reply-To: <001701c56d83$aada3e20$4801a8c0@ws-ew-3.W2KDEMIG>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
This is a multi-part message in MIME format.

------=_NextPart_000_0001_01C57003.293E78E0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

> > 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.

Ok, that seems to work with a minor change [no strlcpy]
and two additional patches in usb.h & usb.c.

Usbd gets a detach event "ukbd0" and another event from its fallthrough
device.
Thank you once again.

If someone is interested in the patch files against 4.11 see the attachment.

Norbert

------=_NextPart_000_0001_01C57003.293E78E0
Content-Type: application/octet-stream;
	name="ukbd.c.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="ukbd.c.patch"

LS0tIC91c3IvbG9jYWwvamFpbC91c3Ivc3JjL3N5cy9kZXYvdXNiL3VrYmQuYwlNb24gTWFyICAx
IDIxOjU2OjAyIDIwMDQKKysrIHVrYmQuYwlGcmkgSnVuIDEwIDE0OjM0OjA1IDIwMDUKQEAgLTE5
NSw2ICsxOTUsMjIgQEAKIAlVU0JfQVRUQUNIX1NVQ0NFU1NfUkVUVVJOOwogfQogCisKK3N0YXRp
YyB2b2lkCit1c2JkX2FkZF9kZXZpY2VfZGV0YWNoX2V2ZW50KGRldmljZV90IHNlbGYpCit7Cisg
ICAgICAgIHN0cnVjdCB1c2JfZXZlbnQgdWU7CisKKyAgICAgICAgYnplcm8oJnVlLCBzaXplb2Yo
dWUpKTsKKworICAgICAgICBzdHJuY3B5KHVlLnUudWVfZGV2aWNlLnVkaV9kZXZuYW1lc1swXSwK
KyAgICAgICAgICAgICAgICBkZXZpY2VfZ2V0X25hbWV1bml0KHNlbGYpLCBVU0JfTUFYX0RFVk5B
TUVMRU4pOworICAgICAgICB1ZS51LnVlX2RldmljZS51ZGlfZGV2bmFtZXNbMF1bVVNCX01BWF9E
RVZOQU1FTEVOIC0gMV0gPSAnXDAnOworCisgICAgICAgIHVzYl9hZGRfZXZlbnQoVVNCX0VWRU5U
X0RFVklDRV9ERVRBQ0gsICZ1ZSk7Cit9CisKKwogaW50CiB1a2JkX2RldGFjaChkZXZpY2VfdCBz
ZWxmKQogewpAQCAtMjE5LDYgKzIzNSw4IEBACiAJCXJldHVybiBlcnJvcjsKIAogCURQUklOVEYo
KCIlczogZGlzY29ubmVjdGVkXG4iLCBVU0JERVZOQU1FKHNlbGYpKSk7CisgICAgICAgIAorICAg
ICAgICB1c2JkX2FkZF9kZXZpY2VfZGV0YWNoX2V2ZW50KHNlbGYpOwogCiAJcmV0dXJuICgwKTsK
IH0K

------=_NextPart_000_0001_01C57003.293E78E0
Content-Type: application/octet-stream;
	name="usb.c.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="usb.c.patch"

LS0tIC91c3IvbG9jYWwvamFpbC91c3Ivc3JjL3N5cy9kZXYvdXNiL3VzYi5jCU1vbiBNYXkgMTYg
MTE6Mzk6MjUgMjAwNQorKysgdXNiLmMJRnJpIEp1biAxMCAxNDo1MzoyMSAyMDA1CkBAIC0xOTMs
OCArMTkzLDYgQEAKIFN0YXRpYyBzdHJ1Y3Qgc2VsaW5mbyB1c2Jfc2VsZXZlbnQ7CiBTdGF0aWMg
c3RydWN0IHByb2MgKnVzYl9hc3luY19wcm9jOyAgLyogcHJvY2VzcyB0aGF0IHdhbnRzIFVTQiBT
SUdJTyAqLwogU3RhdGljIGludCB1c2JfZGV2X29wZW4gPSAwOwotU3RhdGljIHZvaWQgdXNiX2Fk
ZF9ldmVudChpbnQsIHN0cnVjdCB1c2JfZXZlbnQgKik7Ci0KIFN0YXRpYyBpbnQgdXNiX2dldF9u
ZXh0X2V2ZW50KHN0cnVjdCB1c2JfZXZlbnQgKik7CiAKIFN0YXRpYyBjb25zdCBjaGFyICp1c2Jy
ZXZfc3RyW10gPSBVU0JSRVZfU1RSOwo=

------=_NextPart_000_0001_01C57003.293E78E0
Content-Type: application/octet-stream;
	name="usb.h.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="usb.h.patch"

LS0tIC91c3IvbG9jYWwvamFpbC91c3Ivc3JjL3N5cy9kZXYvdXNiL3VzYi5oCU1vbiBNYXIgIDEg
MDE6MDc6MjIgMjAwNAorKysgdXNiLmgJRnJpIEp1biAxMCAxNDo1NDo0MSAyMDA1CkBAIC02NTUs
NiArNjU1LDEwIEBACiAJfSB1OwogfTsKIAorI2lmIGRlZmluZWQoX0tFUk5FTCkKK3ZvaWQgdXNi
X2FkZF9ldmVudChpbnQsIHN0cnVjdCB1c2JfZXZlbnQgKik7CisjZW5kaWYgLyogX0tFUk5FTCAq
LworCiAvKiBVU0IgY29udHJvbGxlciAqLwogI2RlZmluZSBVU0JfUkVRVUVTVAkJX0lPV1IoJ1Un
LCAxLCBzdHJ1Y3QgdXNiX2N0bF9yZXF1ZXN0KQogI2RlZmluZSBVU0JfU0VUREVCVUcJCV9JT1cg
KCdVJywgMiwgaW50KQo=

------=_NextPart_000_0001_01C57003.293E78E0--




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?000001c56ff2$65b5a8e0$4801a8c0>