Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Mar 2007 15:25:58 +1000
From:      Timothy Bourke <timbob@bigpond.com>
To:        hackers@freebsd.org
Subject:   Re: enable/disable in kbd drivers
Message-ID:  <20070331052558.GD755@triptrop.cse.unsw.EDU.AU>
In-Reply-To: <bb4a86c70703301202j34b2db88y90052bc7ec518388@mail.gmail.com>
References:  <20070325015717.GA797@triptrop> <bb4a86c70703291008n4a82e627l3f45b1ff8e5ac571@mail.gmail.com> <20070329224205.GA819@triptrop.cse.unsw.EDU.AU> <bb4a86c70703301202j34b2db88y90052bc7ec518388@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--NklN7DEeGtkPCoo3
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mar 30 at 12:02 -0700, Maksim Yevmenkin wrote:
> On 3/29/07, Timothy Bourke <timbob@bigpond.com> wrote:
> >It seems that, for the extant drivers:
> >    * enable only increments kb_active,
> >    * disable only decrements kb_active.
>=20
> well, yes, if all kbdmux did was call KBD_ACTIVATE/_DEACTIVATE
> directly, i would not have any problem with it. however, kbdmux calls
> enable() method and other drivers (such as the one you wrote) may do
> other things in enable/disable() methods. perhaps the right thing to
> do to is to have kbdmux check is keyboard is "enabled" and if not -
> call enable()?

Maybe there is a gap between the function names, enable() and
disable(), and their intended operation?

If we interpret enable/disable() as a form of reference counting (as
seems to be implemented) then consumers of a keyboard driver should
call enable() when they expected to receive data, and disable() when
finished with the driver (as done by syscons).

Drivers wanting to run regardless of such requests could call enable()
themselves when initialized (as they do already).

Other drivers could run activation code when enable() is called and
kb_active changes from 0 to 1, and deactivation code when disable() is
called and kb_active changes from 1 to 0.

Specifically my driver could acquire the ppbus and start a polling
thread when attached (enable() && 0->1). It could release the ppbus
and stop the polling thread when not required (disable() and 1->0).

Thank you,

Tim.


--NklN7DEeGtkPCoo3
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (FreeBSD)

iD8DBQFGDfDmtKVK1sFb0ecRAkZxAJ0Tx2CEINrTn0gTlBh2hlh8KT6NqgCcCkKN
oZunk8VGtrjWruIBagddJl0=
=xBVI
-----END PGP SIGNATURE-----

--NklN7DEeGtkPCoo3--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070331052558.GD755>