[driver-discuss] How to make sure a driver is attached instead of only loaded ?

Freeman.Liu at Sun.COM Freeman.Liu at Sun.COM
Mon Feb 12 21:44:57 PST 2007


>>It's an issue of how to make one driver, say A,  depend on the other
>>driver, say B.
>>
>>B create minor node on demand of A instead of in its attach routine,
>>so the ldi is not applicable here.
>>
>>    
>>
>
>why is the ldi not applicable here?  if driver B makes minor nodes
>for driver on demand, then there must be a was for driver A to
>requests these nodes.  the best way to do this is probably via some
>kind of admin node on driver B.  driver A could open the admin node
>via ldi_open_by_name(), which would result in driver B being loaded,
>attached, and held.
>
>  
>
If I create such an admin node, then its only purpose is for other 
driver to make sure it is attached, which means
the only thing need to do is to assign a special minor number and 
execute different code in open/close routine.
I think that will work but it seems to me too much to achieve this 
purpose. But if there is no other way out,
I will take it.

If there is some interface like ddi_attach_driver(), 
ddi_detach_driver(), then things will be quite straight and
we dont need to add different code for open/close.

Thank you
  --Freeman



More information about the driver-discuss mailing list