六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 41|回复: 0

Solaris Source Insight: PCI bus driver moduls

[复制链接]

升级  53.65%

673

主题

673

主题

673

主题

探花

Rank: 6Rank: 6

积分
2073
 楼主| 发表于 2013-1-26 14:09:58 | 显示全部楼层 |阅读模式
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.

[i86pc/io/pci/pci_common.c]
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.

[i86pc/io/pci/pci_common.c]
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 …
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表