Solaris Source Insight: PCI bus driver moduls
Thu Nov 12 17:11:35 CST2009[*]bus_ctl()
DDI_CTLOPS_REPORTDEV – report the device
DDI_CTLOPS_INITCHILD – bus specific intialization fora child attached to this npe instance. PCIe bus private data isallocated and initialized here. PCIe Bus Private Data containscommonly used PCI/PCIe information and offsets to key registers.Since npe bus_bdf in bus private data hasn't been initialized duringnpe attach, the root port number of a device in the private data isnot valid. Generic pci-express interrupts and error handling are alsoenabled here.
DDI_CTLOPS_UNINITCHILD – bus specific operations whenremoving/detaching a PCI device node.
DDI_CTLOPS_REGSIZE/DDI_CTLOPS_NREGS – return theregister number and register size of a specific register set. Allregister sets are store in “reg” properties.
DDI_CTLOPS_PEEK:/DDI_CTLOPS_POKE – PCI configure spacepeek/poke.
DDI_CTLOPS_ATTACH/DDI_CTLOPS_DETACH – operations tosupport suspending and resuming.
All those control commands can't be handled in thisfunction will be passed to the bus control function of parent,rootnex.
[*]intr_ops()
Interruptrelated operations.
[*]DDI_INTROP_SUPPORTED_TYPES
Returns the hardware interrupt typesthat are supported by both the device and the host.
216 |_______|_______/*
217 |_______|_______ * First wedetermine the interrupt types supported by the
218 |_______|_______ * device itself,then we filter them through what the OS
219 |_______|_______ * and systemsupports.We determine system-level
220 |_______|_______ * interrupt typesupport for anything other than fixed intrs
221 |_______|_______ * through thepsm_intr_ops vector
222 |_______|_______ */
The fixed type of interrupt is supportby default. The MSI and MSI-X interrupt capabilities are reportedthrought the PCI capability regiesters. The interrupt types supportedby the device should be filterred through the host support.
257 |_______|_______/*
258 |_______|_______ * Filterdevice-level types through system-level support
259 |_______|_______ */
260 |_______|_______tmp_hdl.ih_type =types;
261 |_______|_______if((*psm_intr_ops)(rdip, &tmp_hdl, PSM_INTR_OP_CHECK_MSI,
262 |_______|_______ &types)!= PSM_SUCCESS)
263 |_______|_______|_______gotoSUPPORTED_TYPES_OUT;
When MSI/MSI-X are supported, theMSI/MSI-X cap locations are exported via properties“pci-msi-capid-pointer” and “pci-msix-capid-pointer”.
ddi_intr_get_supported_types(9F)relies on this intr operation.
To be continued …
页:
[1]