From owner-freebsd-current@FreeBSD.ORG Sat Dec 22 23:43:36 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 8D69016A418 for ; Sat, 22 Dec 2007 23:43:36 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mx1.freebsd.org (Postfix) with ESMTP id 3176B13C459 for ; Sat, 22 Dec 2007 23:43:35 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so533451fgg.35 for ; Sat, 22 Dec 2007 15:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=L71oSxkNdUixC8kIT15DZ2hjUzsBpc5CfJacqJbSPA0=; b=PtPYOtpl+EB+hwiifYXqadffjN8ayRD1iekeTt/MeUWZHHVhMqHjXaqWSVZE26az7GYWN8Iezxii+r8H6MRkxp59GFVSFzCYzNVhasgCy7VI9vJOessAKpwb/whwWey/IwASxXJm3XsiPmBb2iSUR7SK56oigbP+E+1DCsCjHt0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Kemxh9jpCy2VlBOx/yqqnMWEIudGmVfoGxYZMkmb0Hk8zKt5oiMF9m5xYClFYukveKivdl6R+iT7WNfL7g23zwZlTsIgZ2Sxg7GV/StYeOlc586zgCNrIZyhYxb0SYfJpngXTmybFS33b+E68m9jkqVZiLXf4cQBky8Q4uc3NOA= Received: by 10.86.26.11 with SMTP id 11mr2722447fgz.37.1198365539500; Sat, 22 Dec 2007 15:18:59 -0800 (PST) Received: by 10.86.49.5 with HTTP; Sat, 22 Dec 2007 15:18:59 -0800 (PST) Message-ID: Date: Sat, 22 Dec 2007 15:18:59 -0800 From: "Maksim Yevmenkin" To: "Wojciech A. Koszek" , freebsd-current@freebsd.org, emax@freebsd.org In-Reply-To: <20071222040156.GA87017@FreeBSD.czest.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071222040156.GA87017@FreeBSD.czest.pl> Cc: Subject: Re: [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 23:43:36 -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. looks fine to me. it also would be nice to clean up and unify (where possible) read_char method for all the keyboards. thanks, max