From nobody Mon Jun 27 15:26:55 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A8AA786A5D3 for ; Mon, 27 Jun 2022 15:27:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4LWs665Hxtz4XrJ; Mon, 27 Jun 2022 15:27:10 +0000 (UTC) (envelope-from hps@selasky.org) Received: from [10.36.2.165] (unknown [178.232.223.95]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 9BB6C260102; Mon, 27 Jun 2022 17:27:02 +0200 (CEST) Message-ID: <420b1f58-09c4-6876-b1ad-91751c60e83c@selasky.org> Date: Mon, 27 Jun 2022 17:26:55 +0200 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: iichid/hms keyboard/mouse wrongly reattached to uhid/ums Content-Language: en-US To: Ivan Quitschal , "freebsd-current@freebsd.org" , "wulf@freebsd.org" References: From: Hans Petter Selasky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4LWs665Hxtz4XrJ X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of hps@selasky.org designates 88.99.82.50 as permitted sender) smtp.mailfrom=hps@selasky.org X-Spamd-Result: default: False [-1.89 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:mail.turbocat.net]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[selasky.org]; ARC_NA(0.00)[]; NEURAL_SPAM_SHORT(0.24)[0.243]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.84)[-0.836]; MLMMJ_DEST(0.00)[freebsd-current]; FREEMAIL_TO(0.00)[hotmail.com,freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:88.99.0.0/16, country:DE]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[178.232.223.95:received] X-ThisMailContainsUnwantedMimeParts: N On 6/27/22 17:19, Ivan Quitschal wrote: > Hi all > > Not sure if I found a problem here but here we go. > > Since I have a KVM usb switch here for keyboard/mouse sometimes I toggle it between my windows and freebsd. > I am using iichid here to have my multimedia keys working on keyboard and all > > hw.usb.usbhid.enable="1" > > Im also using Wulf's moused > https://github.com/wulf7/moused > so far so good. Problem is: > > when I switch to windows , everything is detached correctly (hms, hkbd etc), but when I switch back, sometimes > the keyboard and mouse are wrongly attached to "ums" device , not hms. (sometimes it goes to the correct one). > Shouldn't ums/uhid modules be deactivated once hw.usb.usbhid.enable is set to 1 ? > > The workaround I did here was to manually kldunload both uhid.ko and ums.ko within rc.local during boot. > This way I can detache attach the kbd/mouse back as much as I want and it always end up in hms/hkbd devices > > Is this how its supposed to function? Randomly choosing between ums or hms? > Hi, Can you dump "kldstat" at the different times? I guess it may be just be that the wrong module is loaded first, so it grabs the device, because there are no other drivers loaded, even though ums is a generic driver. Try loading all relevant drivers in /boot/loader.conf . Then the attach order shouldn't matter. --HPS