Subject: Console polling programming interface change (proposal)
To: None <tech-kern@netbsd.org>
From: Jaromír <jdolecek@netbsd.org>
List: tech-kern
Date: 07/19/2001 11:35:55
Hi,
to properly address quirks necessary for some weird hw, I'd like
to be able to pass to/from cnpollc() a cookie value. It's necessary
to change driver interface in order to support this.

I propose these interface changes:
* individual drivers' entry points would change to
  int (*cnpollc)(dev_t dev, int on, int cookie)
  i.e. handler would be function returning int, and taking one extra 'int'
  argument
  The handler is supposed to return cookie value for 'on' call (the 'cookie'
  arg would be ingnored in that case), and accept cookie value as the 3rd arg
  for 'off' call (return value would be always zero in this case)
* current cnpollc() functionality would be split to two functions -
	  int cnpollc(void)
	  void cnunpollc(int cookie) 
  cnpollc() would switch to polling mode and return cookie returned by
  driver, cnunpollc() would switch back to interrupt driven mode; the argument
  is supposed to be the cookie previously returned by cnpollc().

Opinions? I'd like to keep single driver console switch entry points
for both 'on' and 'off'.

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
NetBSD - just plain best OS! -=*=- Got spare MCA cards or docs? Hand me them!