HP-UX driver attach routine not called, ioscan does not help

marnol01_at_mail.win.org
Date: 09/12/05


Date: 12 Sep 2005 08:51:40 -0700

An HP-UX 11.0 DLKM PCI interface device driver I have written does not
have its attach() routine called when it is loaded, not even when
ioscan is run. If I statically link the driver into the kernel, the
attach() is still not called. Below are stripped down versions of
the load() and attach() routines that I am using to track down the
problem (the stripped down versions don't work either). Although the
driver is intended to interact with PCI cards (MOD_WSIO_PCI is
specified in mod_wsio_attach_list_add()), these stripped down
versions will let me code MOD_WSIO_CORE at will, which I did as an
experiment. With MOD_WSIO_CORE, attach() IS called (but only when
ioscan is run), but when MOD_WSIO_PCI is coded, attach() is never
called. When I reboot the machine, enter the interactive boot-up
menu, and have it display various system info, the PCI card (an OHCI
USB host controller) shows up in the list of PCI cards. The box is a
32-bit B132L workstation. This is my first interface driver. My
only other driver (under HP-UX) has been a (successful) dynamically
loadable pseudo driver.

The msg_printf() output when MOD_WSIO_PCI is specified:
> Sep 10 21:47:32 devbox vmunix: mydriver_load: routine entered...
> Sep 10 21:47:32 devbox vmunix: mydriver_load: wsio_install_driver rc==1.
> Sep 10 21:47:32 devbox vmunix: mydriver_load: mod_wsio_attach_list_add rc == 0.
> Sep 10 21:48:01 devbox vmunix: mydriver_unload: entered...
> Sep 10 21:48:01 devbox vmunix: mydriver_unload: mod_wsio_attach_list_remove rc == 0.

The msg_printf() output when MOD_WSIO_CORE is specified:
> Sep 10 21:08:40 devbox vmunix: mydriver_load: routine entered...
> Sep 10 21:08:40 devbox vmunix: mydriver_load: wsio_install_driver rc==1.
> Sep 10 21:08:40 devbox vmunix: mydriver_load: mod_wsio_attach_list_add rc == 0.
> Sep 10 21:08:45 devbox vmunix: mydriver_attach: routine entered; id == 0x84.
> Sep 10 21:08:45 devbox vmunix: mydriver_unload: entered...
> Sep 10 21:08:45 devbox vmunix: mydriver_unload: mod_wsio_attach_list_remove rc == 0.

The load() and attach() routines:
/*---------------------------------------------------------------------*/
#define MOD_WSIO_CORE 0x1
#define MOD_WSIO_EISA 0x2
#define MOD_WSIO_PCI 0x4
int mydriver_load(arg)
void *arg;
{
int rc;

msg_printf("mydriver_load: routine entered...\n");
if (arg == NULL)
   {
   msg_printf("mydriver_load: ERROR --- arg is NULL.\n");
   return(EINVAL);
   }

mydriver_wsio_drv_info.drv_info = (drv_info_t *)arg;
rc = wsio_install_driver(&mydriver_wsio_drv_info);
msg_printf("mydriver_load: wsio_install_driver rc==%d.\n", rc);
if (rc == 0)
   {
   /* note that 0 means failure and 1 means success! */
   return(ENXIO);
   }

rc = mod_wsio_attach_list_add(MOD_WSIO_PCI, mydriver_attach);
msg_printf("mydriver_load: mod_wsio_attach_list_add rc == %d.\n",rc);

return(0);
}
/*---------------------------------------------------------------------*/
/* This stripped down version doesn't try to claim any
   devices, it merely indicates if attach() was called. */
int mydriver_attach(id, isc)
unsigned int id;
struct isc_table_type *isc;
{
msg_printf("mydriver_attach: routine entered; id == 0x%x.\n", id);
return(0);
}
/*---------------------------------------------------------------------*/

Thanks for any information anyone can provide.

Mike



Relevant Pages

  • Re: Enumerable I2C busses
    ... :> that will translate the OF provided properties into FreeBSD driver ... additional glue to allow the ofw_iicbus driver to attach. ... The third option is to do what we do for pci, ... If ofw_iicbus is simply an OF-aware version of iicbus (i.e. same ...
    (freebsd-arch)
  • [PATCH 2.6.10-rc1 0/4] driver-model: manual device attach
    ... These are the manual device attach patches I was talking about in the ... dev.autoattach is read/write integer sysctl node which controls ... driver-model's behavior regarding device - driver association. ...
    (Linux-Kernel)
  • Re: MOUHID attaching problem
    ... driver passes AttachDevice function in CDevice.cpp. ... UHCD driver DLL attach ... InitializeUHCI ++ ... CHub(Root tier 0)::AllocateDeviceArray - attempting to allocate 1 devices ...
    (microsoft.public.windowsce.platbuilder)
  • Problems installing X25 9.1 on Solaris 8
    ... Driver successfully added to system but failed to attach ... Warning: Driver successfully added to system but failed to attach ... Installation of was successful. ...
    (SunManagers)
  • Re: driver not attached
    ... > file which tells the kernel to attach the bcme driver to any PCI ...
    (comp.unix.solaris)