From owner-freebsd-current@FreeBSD.ORG Sat Dec 22 03:12:38 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9916016A41B for ; Sat, 22 Dec 2007 03:12:38 +0000 (UTC) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by mx1.freebsd.org (Postfix) with ESMTP id 0899713C461 for ; Sat, 22 Dec 2007 03:12:37 +0000 (UTC) (envelope-from dunstan@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [80.48.250.4]) by freebsd.czest.pl (8.13.4/8.12.9) with ESMTP id lBM41vqX087065; Sat, 22 Dec 2007 04:01:57 GMT (envelope-from dunstan@freebsd.czest.pl) Received: (from dunstan@localhost) by freebsd.czest.pl (8.13.4/8.12.9/Submit) id lBM41uMS087064; Sat, 22 Dec 2007 04:01:56 GMT (envelope-from dunstan) Date: Sat, 22 Dec 2007 04:01:56 +0000 From: "Wojciech A. Koszek" To: freebsd-current@freebsd.org Message-ID: <20071222040156.GA87017@FreeBSD.czest.pl> Mail-Followup-To: "Wojciech A. Koszek" , freebsd-current@freebsd.org, emax@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-2.0.2 (freebsd.czest.pl [80.48.250.4]); Sat, 22 Dec 2007 04:01:57 +0000 (UTC) Cc: emax@freebsd.org Subject: [RFC, PATCH] Getting rid of direct calls to keyboard's methods via kbdsw[] array X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2007 03:12:38 -0000 Hello, In the FreeBSD kernel we have notion of keyboard represented by "keyboard_t" type. We operate on such structures throught another keyboard_switch structure. It lets us to use keyboard API without distinguishing exactly which hardware we're working with. My proposal is to unify a way in which we call such specialized methods, so that instead of direct array indexing used to call specific keyboard method: (*kbdsw[(kbd)->kb_index]->enable)((kbd)) We would use unified interface: kbdd_enable(kbd) Proposed patch is here: http://people.freebsd.org/~wkoszek/patches/tty/kbdcleanup.patch Suggestions are welcome. Thanks, -- Wojciech A. Koszek wkoszek@FreeBSD.org http://FreeBSD.czest.pl/dunstan/