现在的位置: 首页 > 综合 > 正文

Solaris Source Insight: PCI bus driver moduls – npe Part 4

2013年05月04日 ⁄ 综合 ⁄ 共 2184字 ⁄ 字号 评论关闭

Thu Nov 12 17:11:35 CST
2009

  • bus_ctl()

DDI_CTLOPS_REPORTDEV – report the device

DDI_CTLOPS_INITCHILD – bus specific intialization for
a child attached to this npe instance. PCIe bus private data is
allocated and initialized here. PCIe Bus Private Data contains
commonly used PCI/PCIe information and offsets
to key registers.
Since npe bus_bdf in bus private data hasn't been initialized during
npe attach, the root port number of a device in the private data is
not valid. Generic pci-express interrupts and error handling are also
enabled here.

DDI_CTLOPS_UNINITCHILD – bus specific operations when
removing/detaching a PCI device node.

DDI_CTLOPS_REGSIZE/DDI_CTLOPS_NREGS – return the
register number and register size of a specific register set. All
register sets are store in “reg” properties.

DDI_CTLOPS_PEEK:/DDI_CTLOPS_POKE – PCI configure space
peek/poke.

DDI_CTLOPS_ATTACH/DDI_CTLOPS_DETACH – operations to
support suspending and resuming.

All those control commands can't be handled in this
function will be passed to the bus control function of parent,
rootnex.

  • intr_ops()

Interrupt
related operations.


  • DDI_INTROP_SUPPORTED_TYPES

Returns the hardware interrupt types
that are supported by both the device and the host.

 

[i86pc/io/pci/pci_common.c]

216 |_______|_______/*

217 |_______|_______ * First we
determine the interrupt types supported by the

218 |_______|_______ * device itself,
then we filter them through what the OS

219 |_______|_______ * and system
supports. We determine system-level

220 |_______|_______ * interrupt type
support for anything other than fixed intrs

221 |_______|_______ * through the
psm_intr_ops vector

222 |_______|_______ */

 

The fixed type of interrupt is support
by default. The MSI and MSI-X interrupt capabilities are reported
throught the PCI capability regiesters. The interrupt types supported
by the device should be filterred through the host support.

 

[i86pc/io/pci/pci_common.c]

257 |_______|_______/*

258 |_______|_______ * Filter
device-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 |_______|_______|_______goto
SUPPORTED_TYPES_OUT;

 

When MSI/MSI-X are supported, the
MSI/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 …

 

抱歉!评论已关闭.