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

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 …

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值