`
javasee
  • 浏览: 977341 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

Solaris Source Insight: PCI bus driver moduls - pci_pci driver module

阅读更多

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

This time we will look into pci_pci driver module. It's PCI to PCI bus bridge nexus driver. As usual, we can find the source files which implement this module. I tried to type Chinese in OpenOffice, but the font looks so ugly.

[allen@blu-xvm-osol:uts]find . -name Makefile\* | xargs grep PCI_PCINEXUS_OBJS

./intel/Makefile.files:PCI_PCINEXUS_OBJS += pci_pci.o

./intel/pci_pci/Makefile:OBJECTS = $(PCI_PCINEXUS_OBJS:%=$(OBJS_DIR)/%)

./intel/pci_pci/Makefile:LINTS = $(PCI_PCINEXUS_OBJS:%.o=$(LINTS_DIR)/%.ln)

[allen@blu-xvm-osol:uts]find . -name pci_pci.c

./sun4u/io/pci/pci_pci.c

./intel/io/pci/pci_pci.c

As usual, if no further notification, all source code is from intel/io/pci/pci_pci.c. Module linkage information:

175 /*

176 * Module linkage information for the kernel.

177 */

178

179 static struct modldrv modldrv = {

180 |_______&mod_driverops, /* Type of module */

181 |_______"Standard PCI to PCI bridge nexus driver",

182 |_______&ppb_ops,|______/* driver ops */

183 };

184

185 static struct modlinkage modlinkage = {

186 |_______MODREV_1,

187 |_______(void *)&modldrv,

188 |_______NULL

189 };

Soft state structure is created in _init() and will be allocated attach(). The state structure is defined as below.

191 /*

192 * soft state pointer and structure template:

193 */

194 static void *ppb_state;

195

196 typedef struct {

197 |_______dev_info_t *dip;

198 |_______int ppb_fmcap;

199 |_______ddi_iblock_cookie_t ppb_fm_ibc;

200 |_______kmutex_t ppb_mutex;

201 |_______kmutex_t ppb_peek_poke_mutex;

202 |_______kmutex_t ppb_err_mutex;

203

204 |_______/*

205 |_______ * cpr support:

206 |_______ */

207 |_______uint_t config_state_index;

208 |_______struct {

209 |_______|_______dev_info_t *dip;

210 |_______|_______ushort_t command;

211 |_______|_______uchar_t cache_line_size;

212 |_______|_______uchar_t latency_timer;

213 |_______|_______uchar_t header_type;

214 |_______|_______uchar_t sec_latency_timer;

215 |_______|_______ushort_t bridge_control;

216 |_______} config_state[PCI_MAX_CHILDREN];

217

218 |_______uint16_t parent_bus;

219 } ppb_devstate_t;

attach() interface first and ignore the DDI_RESUME command.

  1. Set property of "device_type" to "pci".

  2. Allocate and get soft state structure.

  3. FM setup, don't enable ereports if immediate child of npe.

  4. Initialize the mutex locks in soft state structure.

  5. Check all the ancestor of the bridge, if there is a PCIe device, set parent_bus of soft state to PCIE_PCIECAP_DEV_TYPE_PCIE_DEV; otherwise, it is set to PCIE_PCIECAP_DEV_TYPE_PCI_PSEUDO.

  6. Initialize hotplug support on this bus. If itś a PCI-E Endpont Device, pcie_init() is called; otherwise, pcihp_init() is called.

  7. Report the bridge device.

Question: What is the differnce between “PCI-E to PCI bus bridge” and “PCI to PCI bus bridge”? Why bus_parent set to PCIE_PCIECAP_DEV_TYPE_PCIE_DEV when the ancestor of a PCI_PCI bridge is PCI-E device?

Answer: with bus_parent set to PCIE_PCIECAP_DEV_TYPE_PCIE_DEV, the platform is a PCI-E platform; otherwise, it is a lagecy PCI platform.

Picture 1 Tylersburg IOH block diagram

Dirver Operations:

  • ppb_open()

  • ppb_close()

  • ppb_ioctl()

  • ppb_prop_op()

Call pcie framework interface if it is a PCIe platform; otherwise, call interfaces in misc/pcihp. All hotplug, power management, fault management interfaces of a PCI-e device are exported via misc/pcie, which is called PCI Express framework. For a legacy PCI platform, hotplug is supported by misc/pcihp.

972 |_______/*

973 |_______ * Ioctls will be handled by PCI Express framework for all

974 |_______ * PCIe platforms

975 |_______ */

976 |_______if (ppb_p->parent_bus == PCIE_PCIECAP_DEV_TYPE_PCIE_DEV)

977 |_______|_______return (pcie_ioctl(ppb_p->dip, dev, cmd, arg, mode, credp,

978 |_______|_______ rvalp));

979

980 |_______return ((pcihp_get_cb_ops())->cb_ioctl(dev, cmd, arg, mode, credp,

981 |_______ rvalp));

Bus Operation:

  • ppb_bus_map()

Escalate this request to parent.

  • ppb_ctlops()

ppb_initchild()/ppb_removechild() are used to initialize a child node under this pci-pci bridge. It first merges the pseudo .conf node property. This kind of pseudo nodes are created in init_node() when DDI implementation tries to put the devinfo node at DS_INITIALIZED state. Initialize the PCI-e private data if this bridge is on a PCIE platform. PCIe Bus Private Data contains commonly used PCI/PCIe information and offsets to key registers. Create parent private data and the interrupt vectore data if the node contains “interrupt” property. The last step of initchild() is the support for the "command-preserve" property. ppb_removechild() will be called in init_node() if initchild() returns error.

Device suspend and resume support is implemented via DDI_CTLOPS_ATTACH/DDI_CTLOPS_DETACH bus ctl operations.

Device configure space peek/poke is supported via DDI_CTLOPS_PEEK/DDI_CTLOPS_POKE bus ctl operations.

  • ppb_fm_init()

  • ppb_intr_ops()

This function is defined to intercept certain interrupt services to handle special cases, such as check for hypertransport msi mapping capability.

分享到:
评论

相关推荐

    source insight 3.5 UTF-8中文乱码插件_sourceinsight3.5_utf-8_插件补丁_中文乱码_

    源洞察(Source Insight)是一款广泛使用的源代码阅读和分析工具,尤其受到程序员和软件开发者们的喜爱。它提供了强大的代码导航、查找、语法高亮等功能,帮助用户理解和探索复杂的代码库。然而,在处理UTF-8编码的...

    scipy-1.7.3-cp310-cp310-win_amd64.whl

    scipy-1.7.3-cp310-cp310-win_amd64.whl由于从下载文件较慢,所以在此提供下载,本文件对应python3.10版本为轮子文件,可通过pip安装

    PyOpenGL-3.1.7-cp310-cp310-win_amd64.whl

    PyOpenGL-3.1.7-cp310-cp310-win_amd64.whl

    pywin32-303-cp311-cp311-win_amd64.whl

    pywin32-303-cp311-cp311-win_amd64.whl

    Python库 | genie-22.2-cp310-cp310-manylinux1_x86_64.whl

    资源分类:Python库 所属语言:Python 使用前提:需要解压 资源全名:genie-22.2-cp310-cp310-manylinux1_x86_64.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    h5py-3.7.0-cp310-cp310-win_amd64.zip

    适用平台:windows x64文件格式:whl安装方式:切换到whl路径,执行pip install whl文件名

    SourceInsight 完美的配色方案 theme-Monokai 主题

    **SourceInsight是一款强大的源代码阅读和编辑工具,尤其在编程和软件开发领域中被广泛使用。它提供了丰富的功能,包括语法高亮、代码跳转、自动完成等,极大地提升了程序员的工作效率。Monokai主题是其中一种广受...

    sourceinsight-scan

    SourceInsight-Scan 配置与使用说明 SourceInsight-Scan 是一个强大的代码扫描工具,旨在帮助开发者快速扫描和检测代码中的错误和问题。下面将详细介绍 SourceInsight-Scan 的配置和使用方法。 安装 首先,需要...

    原版netifaces-0.11.0-cp311-cp311-win_arm64.whl-下载即用直接pip安装.zip

    安装前的准备 1、安装Python:确保你的计算机上已经安装了Python。你可以在命令行中输入python --version或python3 --version来检查是否已安装以及安装的版本。 个人建议:在anaconda中自建不同python版本的环境,...

    sourceinsight3.5_集成汉化、中文乱码、打开标签

    **源码分析利器:Source Insight 3.5 汉化与中文乱码解决方案** Source Insight 是一款广受程序员喜爱的源代码查看和编辑工具,它以其强大的代码高亮、跳转、查找等功能,极大地提高了程序员的工作效率。在这个集成...

    RedisInsight v2.0(RedisInsight-v2-linux-x86_64.AppImage)

    RedisInsight v2.0(RedisInsight-v2-linux-x86_64.AppImage)适用于Linux系统

    Source Insight 4.0仿Boxy的Solarized-Dark主题

    **Source Insight 4.0与Solarized-Dark主题详解** Source Insight是一款强大的源代码阅读、分析和编辑工具,尤其在编程领域中广受欢迎。它以其高效的语言智能、强大的搜索功能和自定义配置能力赢得了程序员的喜爱。...

    pc-lint用于sourceinsight上静态代码检测

    2. **配置Source Insight**: 打开Source Insight,进入“Tools”菜单,选择“External Tools...”。在这里,我们需要新建一个工具配置,指定PC-lint的可执行文件路径,以及需要传递给PC-lint的参数,如输入文件、...

    source insight 中集成pclint

    ### Source Insight 中集成 PC-Lint 的详细步骤及注意事项 #### 一、概述 在软件开发过程中,静态代码分析工具能够帮助开发者发现潜在的错误和不规范的编程习惯,从而提高代码质量。PC-Lint 是一款知名的静态代码...

    Submline-Config-for-si-4_source_sourceinsight4_SourceInsight4_su

    Source Insight 4 仿 Sublime text 主题配置。使用方法:0. 解压压缩包1. `Options`-&gt;`load configuration`2. 选择`Submline-Config-for-si-4.xml`

    sourceinsight-3.5-window7-64-汉化

    幸运的是,我们有了“sourceinsight-3.5-window7-64-汉化”这个资源,它为SourceInsight 3.5在Windows 7 64位系统上提供了汉化支持。 首先,我们需要了解SourceInsight 3.5的基本功能。它支持多种编程语言,包括C/...

    source insight UTF-8插件

    Source Insight是一款广受欢迎的源代码阅读和分析工具,尤其在软件开发领域中,它以其强大的代码导航、搜索和理解功能而备受赞誉。然而,对于处理包含非英文字符,特别是中文字符的UTF-8编码文件时,原生的Source ...

    tensorrt-llm-0.7.0-cp310-cp310-win-amd64.whl

    whl格式文件 TensorRT是由NVIDIA推出的一个高性能的深度学习推理(Inference)优化器和运行时引擎,它可以为深度学习应用提供低延迟、高吞吐率的部署推理。TensorRT是一个C++库,提供C++ API和Python API,主要用于...

    Install-Source-Insight-under-Linux.rar_insight_source insight

    **源码阅读神器Source Insight在Linux环境下的安装指南** Source Insight是一款广受欢迎的源代码查看和编辑工具,尤其适用于C/C++、Java等编程语言。它提供了强大的代码高亮、跳转、查找等功能,帮助开发者高效地...

    insightface-master_insight-master_deeplearning_facerecognition_论

    《深度学习人脸识别:A Discriminative Feature Learning Approach for Deep Face Recognition》是一篇深入研究人脸识别技术的论文,其代码实现存放在名为"insightface-master"的压缩包中。该压缩包包含了实现论文所...

Global site tag (gtag.js) - Google Analytics