Sun Java Solaris Communities My SDN Account Join SDN
 
Documentation

Solaris (Intel Platform Edition) - Device Driver Writer's Orientation

 

Page 21 of 66


Device Instances, Properties, and Configuration Files (cont)

Attach Ordering:
  • A driver should not make any assumptions about:
    • Order of calls to attach(9E) for different instances
    • Order of calls to probe(9E) and attach(9E) for different instances
    • Number of times probe(9E) may be called for an instance
    • Number of times attach/detach pairs may be called for an instance
detach(9E):
  • Driver's detach(9E) routine is called to undo a previous attach(9E)
  • detach(9E) routine must deallocate all resources allocated in attach(9E)
    e.g. interrupts, mutex and condition variables, device mappings, soft state structure, minor device nodes
  • Driver may not retain any state for device instance after detach(9E) returns
  • detach(9E) may not return while driver has callback functions pending
  • Pending callbacks must be cancelled, or waited for
  • Otherwise callback could occur after the driver is unloaded!

FIRST   PREVIOUS   NEXT   LAST  CONTENTS

Return to White Papers