From owner-freebsd-drivers@FreeBSD.ORG Sun Feb 25 17:52:51 2007 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D20C216A402 for ; Sun, 25 Feb 2007 17:52:51 +0000 (UTC) (envelope-from tbourke@triptrop.cse.unsw.edu.au) Received: from fallbackmx03.syd.optusnet.com.au (fallbackmx03.syd.optusnet.com.au [211.29.133.136]) by mx1.freebsd.org (Postfix) with ESMTP id 651BB13C4A5 for ; Sun, 25 Feb 2007 17:52:51 +0000 (UTC) (envelope-from tbourke@triptrop.cse.unsw.edu.au) Received: from mail30.syd.optusnet.com.au (mail30.syd.optusnet.com.au [211.29.133.193]) by fallbackmx03.syd.optusnet.com.au (8.12.11.20060308/8.12.11) with ESMTP id l1P3kApC002995 for ; Sun, 25 Feb 2007 14:46:11 +1100 Received: from triptrop.cse.unsw.edu.au (blaax9-b219.dialup.optusnet.com.au [203.164.127.219]) by mail30.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id l1P3jvB1025841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 25 Feb 2007 14:46:07 +1100 Received: from triptrop.cse.unsw.edu.au (localhost [127.0.0.1]) by triptrop.cse.unsw.edu.au (8.13.8/8.13.6) with ESMTP id l1P3iUjV001347 for ; Sun, 25 Feb 2007 14:44:31 +1100 (EST) (envelope-from tbourke@triptrop.cse.unsw.edu.au) Received: (from tbourke@localhost) by triptrop.cse.unsw.edu.au (8.13.8/8.13.6/Submit) id l1P3iUwC001346 for freebsd-drivers@freebsd.org; Sun, 25 Feb 2007 14:44:30 +1100 (EST) (envelope-from tbourke) Date: Sun, 25 Feb 2007 14:44:29 +1100 From: Timothy Bourke To: freebsd-drivers@freebsd.org Message-ID: <20070225034429.GA1182@triptrop> Mail-Followup-To: freebsd-drivers@freebsd.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-PGP-Key: http://www.cse.unsw.edu.au/~tbourke/pubkey.txt Subject: vkbd driver and devfs X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Feb 2007 17:52:52 -0000 --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I am writing some code (a driver) that exploits the vkbd driver and I have some questions about the latter. The following notes apply to 6.2-RELEASE. The vkbd driver seems to interact strangely with devfs, specifically: 1. The /dev/vkbdctl device never appears in directory listings (although it is found dynamically). kldload vkbd ls /dev | grep vkbd # nothing=20 =20 Possible fix: add make_dev and destroy_dev calls to vkbd_modeevent(). 2. Opening /dev/vkbdctl for the first time correctly creates two devices (and redirects the open to the first): /dev/vkbdctl0=20 /dev/vkbd0 =20 Closing /dev/vkbdctl0 correctly removes the /dev/vkbd0 device but not the /dev/vkbdctl0 device itself. Should it also be removed? Possible fix: `unclone' (if possible) /dev/vkbdctl0 in vkbd_dev_close(). =20 Maybe a /dev/vkbdctl node should only be removed if no higher numbered nodes are in use? Then, presumably, all unopened lower numbered vkbdctl<= M> nodes should also be removed? =20 Currently /dev/vkbctl nodes are removed en masse via a call to clone_cleanup() when the driver is unloaded. 3. Each new open on /dev/vkbdctl creates and returns new /dev/vkbdctl devices with progressively higher values of N. Is this the proper behavi= our? =20 If not, possible fix: vkbd_dev_clone() should work upward from 0 looking for unopen /dev/vkbdctl0 nodes before calling clone_create(). =20 Pointers to the documentation or source are most welcome. Perhaps I have overlooked something obvious. If necessary I will try to write a patch. Tim. --n8g4imXOkfNTN/H1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (FreeBSD) iD8DBQFF4QYdtKVK1sFb0ecRAvHTAJ4kP1EblU2ur/WLNxhdhRMz9vz8VACdEM2j jQyyyZNcL4Ichmr97NBdONc= =MjIz -----END PGP SIGNATURE----- --n8g4imXOkfNTN/H1--