> Reading the sysevent.c in hald, it looks like it is only registering for 
> EC_DEV_ADD, EC_DEV_REMOVE, and branch removal.
> 
> There are two questions (at least) here:
> 
> 1) It looks like it really should be listing for branch addition, as 
> well.  Is there any reason not to listen to branch addition and add a 
> whole branch at a time?

There is usually a whole branch associated with a device.
EC_DEV_ADD is for a leaf of the branch (e.g. an sd instance hanging off 
a USB HBA instance hanging off a USB interface instance) - when we 
receive this event, the entire branch is already there, so we can walk 
up the devinfo tree and create a corresponding branch in the HAL tree.

EC_DEV_REMOVE means only the leaf is removed. We need the branch removal 
event to remove the entire branch.

We have no use for the branch add event.

> 2) It looks like in response to EC_DEVFS_DEVI_ADD (which is sent after 
> the node as done attach(9e), add_minor_pathname() in devfsadm is called, 
> which ultimately I'd have expected to cause an event for the minor node 
> creations to be called for each of the nodes established by sd(7d).  

HAL needs _logical_ devices (/dev) to be present at the time of event, 
we're not really interested in physical devices (/devices). EV_DEVFS 
events are emitted too early for us; devfsadm emits EV_DEV events after 
it creates logical devices.

 > These don't seem to get to be seen by hald, so either they aren't
 > getting sent at all, or I'm misunderstanding hald somewhat.

You can write a very simple program that subscribes to EV_DEV_ADD/REMOVE 
sysevents (or use mine /home/artem/ws/tamarack/misc/ev.c). If these 
events are emitted correctly for your device, we can do further analysis 
inside HAL; if not, the problem is elsewhere.

-Artem
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to