Solaris Source Insight: PCI bus driver moduls - misc/pcicfg module

<!-- @page { margin: 0.79in } P { margin-bottom: 0.08in } -->

Implementation of misc/pcicfg

 

This module provids below two interfaces to configure/unconfigure pci devices (include the children).

 

540 /*

541 * This entry point is called to configure a device (and

542 * all its children) on the given bus. It is called when

543 * a new device is added to the PCI domain. This routine

544 * will create the device tree and program the devices

545 * registers.

546 */

547 int

548 pcicfg_configure(dev_info_t *devi, uint_t device, uint_t function,

549 pcicfg_flags_t flags)

 

In pcicfg_configure(), the following procedures followed:

  1. probe the device (include children), create devinfo node for each PCI device, and bind it to driver if below configuration is successful.

  2. Allocate and program the resourses for both bridges and leaf devices.

  3. Update standard and specific properties.

 

1422 /*

1423 * This will turn resources allocated by pcicfg_configure()

1424 * and remove the device tree from the Hotplug Connection (CN)

1425 * and below. The routine assumes the devices have their

1426 * drivers detached.

1427 */

1428 int

1429 pcicfg_unconfigure(dev_info_t *devi, uint_t device, uint_t function,

1430 pcicfg_flags_t flags)

 

In pcicfg_unconfigure(), the following procedures followed:

  1. Offline the devinfo nodes, that means detaching the device driver and preventing it from reattaching.

  2. Free up resources the devices consumed, disable the device and tear down the devinfo node (include children).

 

By the way, this should be a bug in code.

code review comments:

 

585 |_______|_______if ((function != PCICFG_ALL_FUNC) && (function != func))

586 |_______|_______|_______goto next;

...

657 next:

658 |_______|_______/*

659 |_______|_______ * Determine if ARI Forwarding should be enabled.

660 |_______|_______ */

661 |_______|_______if (func == 0) {

662 |_______|_______|_______if ((pcie_ari_supported(devi)

663 |_______|_______|_______ == PCIE_ARI_FORW_SUPPORTED) &&

664 |_______|_______|_______ (pcie_ari_device(new_device) == PCIE_ARI_DEVICE)) {

 

new_device could be used here before initialized.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值