pci_detach

The docs for pci_detach() say “The pci_detach() function disconnects
from the PCI server. Any resources allocated with pci_attach_device()
are released.” Is this correct? Since pci_attach_device() doesn’t pass
the handle returned by pci_attach(), it seems less than obvious that the
PCI manager could cleanup after pci_attach_device(0 without some more
information.

The low-level pci_attach code opens a file descriptor against the
pci server. All low-level library calls to the pci server use this fd.
When the pci_detach() function is called, the low-level code does a
close on the file descriptor, which tells the pci server to cleanup
any allocations made by this fd.

Previously, John A. Murphy wrote in qdn.public.ddk.network:

The docs for pci_detach() say “The pci_detach() function disconnects
from the PCI server. Any resources allocated with pci_attach_device()
are released.” Is this correct? Since pci_attach_device() doesn’t pass
the handle returned by pci_attach(), it seems less than obvious that the
PCI manager could cleanup after pci_attach_device(0 without some more
information.

Great! I suspected something like that, but I wanted to make sure I wasn’t
relying on a type.

Murf

Hugh Brown wrote:

The low-level pci_attach code opens a file descriptor against the
pci server. All low-level library calls to the pci server use this fd.
When the pci_detach() function is called, the low-level code does a
close on the file descriptor, which tells the pci server to cleanup
any allocations made by this fd.

Previously, John A. Murphy wrote in qdn.public.ddk.network:
The docs for pci_detach() say “The pci_detach() function disconnects
from the PCI server. Any resources allocated with pci_attach_device()
are released.” Is this correct? Since pci_attach_device() doesn’t pass
the handle returned by pci_attach(), it seems less than obvious that the
PCI manager could cleanup after pci_attach_device(0 without some more
information.