[openbeos] device driver trouble

  • From: Eike Dehling <e.e.dehling@xxxxxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Fri, 18 Oct 2002 01:07:04 +0200

I was looking through the code of some device drivers, more specific the rtl8139 driver and the fb_console drivers. They both register their device-nodes with 'devfs_publish_device' and both pass a struct with 'hooks' but in the 'open' hook the rtl8139 driver has TWO parameters:

static int rtl8139_open(dev_ident ident, dev_cookie *cookie)

whereas the fb_console driver has three ...

static int console_open(const char *name, uint32 flags, void **cookie)

in 'devfs.c' they all get three parameters!

does anyone know how that is supposed to work ?? don't drivers-hooks have to have all the same parameters ?? wouldn't they mess up their stack real fast when they don't ??

Eike.


Other related posts: