RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
pci.h 文件参考
#include <rtdef.h>
#include <bitmap.h>
#include <ioremap.h>
#include <drivers/ofw.h>
#include <drivers/pic.h>
#include <drivers/core/dm.h>
#include <drivers/core/driver.h>
#include "../../pci/pci_ids.h"
#include "../../pci/pci_regs.h"
+ pci.h 的引用(Include)关系图:
+ 此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

结构体

struct  rt_pci_bus_region
 
struct  rt_pci_bus_resource
 
struct  rt_pci_device_id
 
struct  rt_pci_device
 
struct  rt_pci_host_bridge
 
struct  rt_pci_ops
 
struct  rt_pci_bus
 
struct  rt_pci_driver
 
struct  rt_pci_msix_entry
 

宏定义

#define RT_PCI_INTX_PIN_MAX   4
 
#define RT_PCI_BAR_NR_MAX   6
 
#define RT_PCI_DEVICE_MAX   32
 
#define RT_PCI_FUNCTION_MAX   8
 
#define RT_PCI_FIND_CAP_TTL   48
 
#define RT_PCI_DEVID(bus, devfn)
 
#define RT_PCI_DEVFN(slot, func)
 
#define RT_PCI_SLOT(devfn)
 
#define RT_PCI_FUNC(devfn)
 
#define PCIE_LINK_STATE_L0S   RT_BIT(0)
 
#define PCIE_LINK_STATE_L1   RT_BIT(1)
 
#define PCIE_LINK_STATE_CLKPM   RT_BIT(2)
 
#define PCIE_LINK_STATE_L1_1   RT_BIT(3)
 
#define PCIE_LINK_STATE_L1_2   RT_BIT(4)
 
#define PCIE_LINK_STATE_L1_1_PCIPM   RT_BIT(5)
 
#define PCIE_LINK_STATE_L1_2_PCIPM   RT_BIT(6)
 
#define PCIE_LINK_STATE_ALL
 
#define PCI_BUS_REGION_F_NONE   0xffffffff /* PCI no memory */
 
#define PCI_BUS_REGION_F_MEM   0x00000000 /* PCI memory space */
 
#define PCI_BUS_REGION_F_IO   0x00000001 /* PCI IO space */
 
#define PCI_BUS_REGION_F_PREFETCH   0x00000008 /* Prefetchable PCI memory */
 
#define PCI_ANY_ID   (~0)
 
#define RT_PCI_DEVICE_ID(vend, dev)
 
#define RT_PCI_DEVICE_CLASS(dev_class, dev_class_mask)
 
#define rt_device_to_pci_host_bridge(dev)
 
#define rt_pci_foreach_bridge(pdev, bus)
 
#define RT_PCI_IRQ_F_LEGACY   RT_BIT(0) /* Allow legacy interrupts */
 
#define RT_PCI_IRQ_F_MSI   RT_BIT(1) /* Allow MSI interrupts */
 
#define RT_PCI_IRQ_F_MSIX   RT_BIT(2) /* Allow MSI-X interrupts */
 
#define RT_PCI_IRQ_F_AFFINITY   RT_BIT(3) /* Auto-assign affinity */
 
#define RT_PCI_IRQ_F_ALL_TYPES   (RT_PCI_IRQ_F_LEGACY | RT_PCI_IRQ_F_MSI | RT_PCI_IRQ_F_MSIX)
 
#define RT_PCI_DRIVER_EXPORT(driver)
 

枚举

enum  rt_pci_power {
  RT_PCI_D0 , RT_PCI_D1 , RT_PCI_D2 , RT_PCI_D3HOT ,
  RT_PCI_D3COLD , RT_PCI_PME_MAX
}
 

函数

void rt_pci_pme_init (struct rt_pci_device *pdev)
 
void rt_pci_pme_active (struct rt_pci_device *pdev, rt_bool_t enable)
 
rt_err_t rt_pci_enable_wake (struct rt_pci_device *pci_dev, enum rt_pci_power state, rt_bool_t enable)
 
rt_inline rt_bool_t rt_pci_pme_capable (struct rt_pci_device *pdev, enum rt_pci_power state)
 
void rt_pci_msi_init (struct rt_pci_device *pdev)
 
void rt_pci_msix_init (struct rt_pci_device *pdev)
 
void rt_pci_set_master (struct rt_pci_device *pdev)
 
void rt_pci_clear_master (struct rt_pci_device *pdev)
 
struct rt_pci_host_bridgert_pci_host_bridge_alloc (rt_size_t priv_size)
 
rt_err_t rt_pci_host_bridge_free (struct rt_pci_host_bridge *)
 
rt_err_t rt_pci_host_bridge_init (struct rt_pci_host_bridge *host_bridge)
 
rt_err_t rt_pci_host_bridge_probe (struct rt_pci_host_bridge *host_bridge)
 
struct rt_pci_devicert_pci_alloc_device (struct rt_pci_bus *bus)
 
struct rt_pci_devicert_pci_scan_single_device (struct rt_pci_bus *bus, rt_uint32_t devfn)
 
rt_err_t rt_pci_setup_device (struct rt_pci_device *pdev)
 
rt_size_t rt_pci_scan_slot (struct rt_pci_bus *bus, rt_uint32_t devfn)
 
rt_uint32_t rt_pci_scan_child_buses (struct rt_pci_bus *bus, rt_size_t buses)
 
rt_uint32_t rt_pci_scan_child_bus (struct rt_pci_bus *bus)
 
rt_err_t rt_pci_host_bridge_register (struct rt_pci_host_bridge *host_bridge)
 
rt_err_t rt_pci_scan_root_bus_bridge (struct rt_pci_host_bridge *host_bridge)
 
rt_err_t rt_pci_host_bridge_remove (struct rt_pci_host_bridge *host_bridge)
 
rt_err_t rt_pci_bus_remove (struct rt_pci_bus *bus)
 
rt_err_t rt_pci_device_remove (struct rt_pci_device *pdev)
 
rt_uint32_t rt_pci_domain (struct rt_pci_device *pdev)
 
rt_uint8_t rt_pci_bus_find_capability (struct rt_pci_bus *bus, rt_uint32_t devfn, int cap)
 
rt_uint8_t rt_pci_find_capability (struct rt_pci_device *pdev, int cap)
 
rt_uint8_t rt_pci_find_next_capability (struct rt_pci_device *pdev, rt_uint8_t pos, int cap)
 
rt_uint16_t rt_pci_find_ext_capability (struct rt_pci_device *pdev, int cap)
 
rt_uint16_t rt_pci_find_ext_next_capability (struct rt_pci_device *pdev, rt_uint16_t pos, int cap)
 
struct rt_pci_busrt_pci_find_root_bus (struct rt_pci_bus *bus)
 
struct rt_pci_host_bridgert_pci_find_host_bridge (struct rt_pci_bus *bus)
 
rt_inline rt_uint16_t rt_pci_dev_id (struct rt_pci_device *pdev)
 
rt_inline rt_bool_t rt_pci_is_root_bus (struct rt_pci_bus *bus)
 
rt_inline rt_bool_t rt_pci_is_bridge (struct rt_pci_device *pdev)
 
rt_inline rt_bool_t rt_pci_is_pcie (struct rt_pci_device *pdev)
 
rt_err_t rt_pci_bus_read_config_u8 (struct rt_pci_bus *bus, rt_uint32_t devfn, int pos, rt_uint8_t *value)
 
rt_err_t rt_pci_bus_read_config_u16 (struct rt_pci_bus *bus, rt_uint32_t devfn, int pos, rt_uint16_t *value)
 
rt_err_t rt_pci_bus_read_config_u32 (struct rt_pci_bus *bus, rt_uint32_t devfn, int pos, rt_uint32_t *value)
 
rt_err_t rt_pci_bus_write_config_u8 (struct rt_pci_bus *bus, rt_uint32_t devfn, int reg, rt_uint8_t value)
 
rt_err_t rt_pci_bus_write_config_u16 (struct rt_pci_bus *bus, rt_uint32_t devfn, int reg, rt_uint16_t value)
 
rt_err_t rt_pci_bus_write_config_u32 (struct rt_pci_bus *bus, rt_uint32_t devfn, int reg, rt_uint32_t value)
 
rt_err_t rt_pci_bus_read_config_uxx (struct rt_pci_bus *bus, rt_uint32_t devfn, int reg, int width, rt_uint32_t *value)
 
rt_err_t rt_pci_bus_write_config_uxx (struct rt_pci_bus *bus, rt_uint32_t devfn, int reg, int width, rt_uint32_t value)
 
rt_err_t rt_pci_bus_read_config_generic_u32 (struct rt_pci_bus *bus, rt_uint32_t devfn, int reg, int width, rt_uint32_t *value)
 
rt_err_t rt_pci_bus_write_config_generic_u32 (struct rt_pci_bus *bus, rt_uint32_t devfn, int reg, int width, rt_uint32_t value)
 
rt_inline rt_err_t rt_pci_read_config_u8 (const struct rt_pci_device *pdev, int reg, rt_uint8_t *value)
 
rt_inline rt_err_t rt_pci_read_config_u16 (const struct rt_pci_device *pdev, int reg, rt_uint16_t *value)
 
rt_inline rt_err_t rt_pci_read_config_u32 (const struct rt_pci_device *pdev, int reg, rt_uint32_t *value)
 
rt_inline rt_err_t rt_pci_write_config_u8 (const struct rt_pci_device *pdev, int reg, rt_uint8_t value)
 
rt_inline rt_err_t rt_pci_write_config_u16 (const struct rt_pci_device *pdev, int reg, rt_uint16_t value)
 
rt_inline rt_err_t rt_pci_write_config_u32 (const struct rt_pci_device *pdev, int reg, rt_uint32_t value)
 
rt_inline rt_err_t rt_pci_ofw_host_bridge_init (struct rt_ofw_node *dev_np, struct rt_pci_host_bridge *host_bridge)
 
rt_inline rt_err_t rt_pci_ofw_bus_init (struct rt_pci_bus *bus)
 
rt_inline rt_err_t rt_pci_ofw_bus_free (struct rt_pci_bus *bus)
 
rt_inline rt_err_t rt_pci_ofw_device_init (struct rt_pci_device *pdev)
 
rt_inline rt_err_t rt_pci_ofw_device_free (struct rt_pci_device *pdev)
 
rt_inline int rt_pci_ofw_irq_parse_and_map (struct rt_pci_device *pdev, rt_uint8_t slot, rt_uint8_t pin)
 
rt_inline rt_err_t rt_pci_ofw_parse_ranges (struct rt_ofw_node *dev_np, struct rt_pci_host_bridge *host_bridge)
 
rt_inline void * rt_pci_iomap (struct rt_pci_device *pdev, int bar_idx)
 
rt_uint8_t rt_pci_irq_intx (struct rt_pci_device *pdev, rt_uint8_t pin)
 
rt_uint8_t rt_pci_irq_slot (struct rt_pci_device *pdev, rt_uint8_t *pinp)
 
void rt_pci_assign_irq (struct rt_pci_device *pdev)
 
void rt_pci_intx (struct rt_pci_device *pdev, rt_bool_t enable)
 
rt_bool_t rt_pci_check_and_mask_intx (struct rt_pci_device *pdev)
 
rt_bool_t rt_pci_check_and_unmask_intx (struct rt_pci_device *pdev)
 
void rt_pci_irq_mask (struct rt_pci_device *pdev)
 
void rt_pci_irq_unmask (struct rt_pci_device *pdev)
 
rt_inline rt_ssize_t rt_pci_alloc_vector (struct rt_pci_device *pdev, int min, int max, rt_uint32_t flags, RT_IRQ_AFFINITY_DECLARE((*affinities)))
 
rt_inline void rt_pci_free_vector (struct rt_pci_device *pdev)
 
rt_inline rt_ssize_t rt_pci_msi_vector_count (struct rt_pci_device *pdev)
 
rt_inline rt_err_t rt_pci_msi_disable (struct rt_pci_device *pdev)
 
rt_inline rt_ssize_t rt_pci_msi_enable_range_affinity (struct rt_pci_device *pdev, int min, int max, RT_IRQ_AFFINITY_DECLARE((*affinities)))
 
rt_inline rt_ssize_t rt_pci_msix_vector_count (struct rt_pci_device *pdev)
 
rt_inline rt_err_t rt_pci_msix_disable (struct rt_pci_device *pdev)
 
rt_inline rt_ssize_t rt_pci_msix_enable_range_affinity (struct rt_pci_device *pdev, struct rt_pci_msix_entry *entries, int min, int max, RT_IRQ_AFFINITY_DECLARE((*affinities)))
 
rt_inline void rt_pci_msix_entry_index_linear (struct rt_pci_msix_entry *entries, rt_size_t nvectors)
 
rt_inline rt_ssize_t rt_pci_msi_enable_range (struct rt_pci_device *pdev, int min, int max)
 
rt_inline rt_err_t rt_pci_msi_enable (struct rt_pci_device *pdev)
 
rt_inline rt_ssize_t rt_pci_msix_enable_range (struct rt_pci_device *pdev, struct rt_pci_msix_entry *entries, int min, int max)
 
rt_inline rt_ssize_t rt_pci_msix_enable (struct rt_pci_device *pdev, struct rt_pci_msix_entry *entries, int count)
 
rt_err_t rt_pci_region_setup (struct rt_pci_host_bridge *host_bridge)
 
struct rt_pci_bus_regionrt_pci_region_alloc (struct rt_pci_host_bridge *host_bridge, void **out_addr, rt_size_t size, rt_ubase_t flags, rt_bool_t mem64)
 
rt_err_t rt_pci_device_alloc_resource (struct rt_pci_host_bridge *host_bridge, struct rt_pci_device *pdev)
 
void rt_pci_enum_device (struct rt_pci_bus *bus, rt_bool_t(callback(struct rt_pci_device *, void *)), void *data)
 
const struct rt_pci_device_idrt_pci_match_id (struct rt_pci_device *pdev, const struct rt_pci_device_id *id)
 
const struct rt_pci_device_idrt_pci_match_ids (struct rt_pci_device *pdev, const struct rt_pci_device_id *ids)
 
rt_err_t rt_pci_driver_register (struct rt_pci_driver *pdrv)
 
rt_err_t rt_pci_device_register (struct rt_pci_device *pdev)
 
struct rt_pci_bus_resourcert_pci_find_bar (struct rt_pci_device *pdev, rt_ubase_t flags, int index)
 

变量

struct rt_spinlock rt_pci_lock
 

宏定义说明

◆ RT_PCI_INTX_PIN_MAX

#define RT_PCI_INTX_PIN_MAX   4

在文件 pci.h25 行定义.

◆ RT_PCI_BAR_NR_MAX

#define RT_PCI_BAR_NR_MAX   6

在文件 pci.h26 行定义.

◆ RT_PCI_DEVICE_MAX

#define RT_PCI_DEVICE_MAX   32

在文件 pci.h27 行定义.

◆ RT_PCI_FUNCTION_MAX

#define RT_PCI_FUNCTION_MAX   8

在文件 pci.h28 行定义.

◆ RT_PCI_FIND_CAP_TTL

#define RT_PCI_FIND_CAP_TTL   48

在文件 pci.h30 行定义.

◆ RT_PCI_DEVID

#define RT_PCI_DEVID ( bus,
devfn )
值:
((((rt_uint16_t)(bus)) << 8) | (devfn))
unsigned short rt_uint16_t

在文件 pci.h40 行定义.

◆ RT_PCI_DEVFN

#define RT_PCI_DEVFN ( slot,
func )
值:
((((slot) & 0x1f) << 3) | ((func) & 0x07))

在文件 pci.h41 行定义.

◆ RT_PCI_SLOT

#define RT_PCI_SLOT ( devfn)
值:
(((devfn) >> 3) & 0x1f)

在文件 pci.h42 行定义.

◆ RT_PCI_FUNC

#define RT_PCI_FUNC ( devfn)
值:
((devfn) & 0x07)

在文件 pci.h43 行定义.

◆ PCIE_LINK_STATE_L0S

#define PCIE_LINK_STATE_L0S   RT_BIT(0)

在文件 pci.h45 行定义.

◆ PCIE_LINK_STATE_L1

#define PCIE_LINK_STATE_L1   RT_BIT(1)

在文件 pci.h46 行定义.

◆ PCIE_LINK_STATE_CLKPM

#define PCIE_LINK_STATE_CLKPM   RT_BIT(2)

在文件 pci.h47 行定义.

◆ PCIE_LINK_STATE_L1_1

#define PCIE_LINK_STATE_L1_1   RT_BIT(3)

在文件 pci.h48 行定义.

◆ PCIE_LINK_STATE_L1_2

#define PCIE_LINK_STATE_L1_2   RT_BIT(4)

在文件 pci.h49 行定义.

◆ PCIE_LINK_STATE_L1_1_PCIPM

#define PCIE_LINK_STATE_L1_1_PCIPM   RT_BIT(5)

在文件 pci.h50 行定义.

◆ PCIE_LINK_STATE_L1_2_PCIPM

#define PCIE_LINK_STATE_L1_2_PCIPM   RT_BIT(6)

在文件 pci.h51 行定义.

◆ PCIE_LINK_STATE_ALL

#define PCIE_LINK_STATE_ALL
值:
( \
)
#define PCIE_LINK_STATE_L1_2_PCIPM
定义 pci.h:51
#define PCIE_LINK_STATE_L1_1_PCIPM
定义 pci.h:50
#define PCIE_LINK_STATE_CLKPM
定义 pci.h:47
#define PCIE_LINK_STATE_L1_2
定义 pci.h:49
#define PCIE_LINK_STATE_L1_1
定义 pci.h:48
#define PCIE_LINK_STATE_L1
定义 pci.h:46
#define PCIE_LINK_STATE_L0S
定义 pci.h:45

在文件 pci.h52 行定义.

52#define PCIE_LINK_STATE_ALL \
53( \
54 PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 | \
55 PCIE_LINK_STATE_CLKPM | \
56 PCIE_LINK_STATE_L1_1 | PCIE_LINK_STATE_L1_2 | \
57 PCIE_LINK_STATE_L1_1_PCIPM | PCIE_LINK_STATE_L1_2_PCIPM \
58)

◆ PCI_BUS_REGION_F_NONE

#define PCI_BUS_REGION_F_NONE   0xffffffff /* PCI no memory */

在文件 pci.h68 行定义.

◆ PCI_BUS_REGION_F_MEM

#define PCI_BUS_REGION_F_MEM   0x00000000 /* PCI memory space */

在文件 pci.h69 行定义.

◆ PCI_BUS_REGION_F_IO

#define PCI_BUS_REGION_F_IO   0x00000001 /* PCI IO space */

在文件 pci.h70 行定义.

◆ PCI_BUS_REGION_F_PREFETCH

#define PCI_BUS_REGION_F_PREFETCH   0x00000008 /* Prefetchable PCI memory */

在文件 pci.h71 行定义.

◆ PCI_ANY_ID

#define PCI_ANY_ID   (~0)

在文件 pci.h107 行定义.

◆ RT_PCI_DEVICE_ID

#define RT_PCI_DEVICE_ID ( vend,
dev )
值:
.vendor = (vend), \
.device = (dev), \
.subsystem_vendor = PCI_ANY_ID, \
.subsystem_device = PCI_ANY_ID
#define PCI_ANY_ID
定义 pci.h:107

在文件 pci.h108 行定义.

108#define RT_PCI_DEVICE_ID(vend, dev) \
109 .vendor = (vend), \
110 .device = (dev), \
111 .subsystem_vendor = PCI_ANY_ID, \
112 .subsystem_device = PCI_ANY_ID

◆ RT_PCI_DEVICE_CLASS

#define RT_PCI_DEVICE_CLASS ( dev_class,
dev_class_mask )
值:
.vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \
.subsystem_vendor = PCI_ANY_ID, \
.subsystem_device = PCI_ANY_ID, \
.class = (dev_class), .class_mask = (dev_class_mask),

在文件 pci.h114 行定义.

114#define RT_PCI_DEVICE_CLASS(dev_class, dev_class_mask) \
115 .vendor = PCI_ANY_ID, .device = PCI_ANY_ID, \
116 .subsystem_vendor = PCI_ANY_ID, \
117 .subsystem_device = PCI_ANY_ID, \
118 .class = (dev_class), .class_mask = (dev_class_mask),

◆ rt_device_to_pci_host_bridge

#define rt_device_to_pci_host_bridge ( dev)
值:
rt_container_of(dev, struct rt_pci_host_bridge, parent)
#define rt_container_of(ptr, type, member)

在文件 pci.h207 行定义.

◆ rt_pci_foreach_bridge

#define rt_pci_foreach_bridge ( pdev,
bus )
值:
rt_list_for_each_entry(pdev, &bus->devices_nodes, list) \
if (rt_pci_is_bridge(pdev))
#define rt_list_for_each_entry(pos, head, member)
rt_inline rt_bool_t rt_pci_is_bridge(struct rt_pci_device *pdev)
定义 pci.h:337

在文件 pci.h348 行定义.

348#define rt_pci_foreach_bridge(pdev, bus) \
349 rt_list_for_each_entry(pdev, &bus->devices_nodes, list) \
350 if (rt_pci_is_bridge(pdev))

◆ RT_PCI_IRQ_F_LEGACY

#define RT_PCI_IRQ_F_LEGACY   RT_BIT(0) /* Allow legacy interrupts */

在文件 pci.h481 行定义.

◆ RT_PCI_IRQ_F_MSI

#define RT_PCI_IRQ_F_MSI   RT_BIT(1) /* Allow MSI interrupts */

在文件 pci.h482 行定义.

◆ RT_PCI_IRQ_F_MSIX

#define RT_PCI_IRQ_F_MSIX   RT_BIT(2) /* Allow MSI-X interrupts */

在文件 pci.h483 行定义.

◆ RT_PCI_IRQ_F_AFFINITY

#define RT_PCI_IRQ_F_AFFINITY   RT_BIT(3) /* Auto-assign affinity */

在文件 pci.h484 行定义.

◆ RT_PCI_IRQ_F_ALL_TYPES

#define RT_PCI_IRQ_F_ALL_TYPES   (RT_PCI_IRQ_F_LEGACY | RT_PCI_IRQ_F_MSI | RT_PCI_IRQ_F_MSIX)

在文件 pci.h485 行定义.

◆ RT_PCI_DRIVER_EXPORT

#define RT_PCI_DRIVER_EXPORT ( driver)
值:
RT_DRIVER_EXPORT(driver, pci, BUILIN)

在文件 pci.h600 行定义.

枚举类型说明

◆ rt_pci_power

枚举值
RT_PCI_D0 
RT_PCI_D1 
RT_PCI_D2 
RT_PCI_D3HOT 
RT_PCI_D3COLD 
RT_PCI_PME_MAX 

在文件 pci.h264 行定义.

265{
266 RT_PCI_D0,
267 RT_PCI_D1,
268 RT_PCI_D2,
271
273};
@ RT_PCI_D1
定义 pci.h:267
@ RT_PCI_D0
定义 pci.h:266
@ RT_PCI_D3HOT
定义 pci.h:269
@ RT_PCI_PME_MAX
定义 pci.h:272
@ RT_PCI_D3COLD
定义 pci.h:270
@ RT_PCI_D2
定义 pci.h:268

函数说明

◆ rt_pci_pme_init()

void rt_pci_pme_init ( struct rt_pci_device * pdev)

◆ rt_pci_pme_active()

void rt_pci_pme_active ( struct rt_pci_device * pdev,
rt_bool_t enable )

◆ rt_pci_enable_wake()

rt_err_t rt_pci_enable_wake ( struct rt_pci_device * pci_dev,
enum rt_pci_power state,
rt_bool_t enable )

◆ rt_pci_pme_capable()

rt_inline rt_bool_t rt_pci_pme_capable ( struct rt_pci_device * pdev,
enum rt_pci_power state )

在文件 pci.h279 行定义.

281{
282 if (!pdev->pme_cap)
283 {
284 return RT_FALSE;
285 }
286
287 return !!(pdev->pme_support & (1 << state));
288}
#define RT_FALSE
rt_uint8_t pme_support
定义 pci.h:175
rt_uint8_t pme_cap
定义 pci.h:162

引用了 rt_pci_device::pme_cap, rt_pci_device::pme_support , 以及 RT_FALSE.

◆ rt_pci_msi_init()

void rt_pci_msi_init ( struct rt_pci_device * pdev)

◆ rt_pci_msix_init()

void rt_pci_msix_init ( struct rt_pci_device * pdev)

◆ rt_pci_set_master()

void rt_pci_set_master ( struct rt_pci_device * pdev)

◆ rt_pci_clear_master()

void rt_pci_clear_master ( struct rt_pci_device * pdev)

◆ rt_pci_host_bridge_alloc()

struct rt_pci_host_bridge * rt_pci_host_bridge_alloc ( rt_size_t priv_size)

◆ rt_pci_host_bridge_free()

rt_err_t rt_pci_host_bridge_free ( struct rt_pci_host_bridge * )

◆ rt_pci_host_bridge_init()

rt_err_t rt_pci_host_bridge_init ( struct rt_pci_host_bridge * host_bridge)

◆ rt_pci_host_bridge_probe()

rt_err_t rt_pci_host_bridge_probe ( struct rt_pci_host_bridge * host_bridge)

◆ rt_pci_alloc_device()

struct rt_pci_device * rt_pci_alloc_device ( struct rt_pci_bus * bus)

◆ rt_pci_scan_single_device()

struct rt_pci_device * rt_pci_scan_single_device ( struct rt_pci_bus * bus,
rt_uint32_t devfn )

◆ rt_pci_setup_device()

rt_err_t rt_pci_setup_device ( struct rt_pci_device * pdev)

◆ rt_pci_scan_slot()

rt_size_t rt_pci_scan_slot ( struct rt_pci_bus * bus,
rt_uint32_t devfn )

◆ rt_pci_scan_child_buses()

rt_uint32_t rt_pci_scan_child_buses ( struct rt_pci_bus * bus,
rt_size_t buses )

◆ rt_pci_scan_child_bus()

rt_uint32_t rt_pci_scan_child_bus ( struct rt_pci_bus * bus)

◆ rt_pci_host_bridge_register()

rt_err_t rt_pci_host_bridge_register ( struct rt_pci_host_bridge * host_bridge)

◆ rt_pci_scan_root_bus_bridge()

rt_err_t rt_pci_scan_root_bus_bridge ( struct rt_pci_host_bridge * host_bridge)

◆ rt_pci_host_bridge_remove()

rt_err_t rt_pci_host_bridge_remove ( struct rt_pci_host_bridge * host_bridge)

◆ rt_pci_bus_remove()

rt_err_t rt_pci_bus_remove ( struct rt_pci_bus * bus)

◆ rt_pci_device_remove()

rt_err_t rt_pci_device_remove ( struct rt_pci_device * pdev)

◆ rt_pci_domain()

rt_uint32_t rt_pci_domain ( struct rt_pci_device * pdev)

◆ rt_pci_bus_find_capability()

rt_uint8_t rt_pci_bus_find_capability ( struct rt_pci_bus * bus,
rt_uint32_t devfn,
int cap )

◆ rt_pci_find_capability()

rt_uint8_t rt_pci_find_capability ( struct rt_pci_device * pdev,
int cap )

◆ rt_pci_find_next_capability()

rt_uint8_t rt_pci_find_next_capability ( struct rt_pci_device * pdev,
rt_uint8_t pos,
int cap )

◆ rt_pci_find_ext_capability()

rt_uint16_t rt_pci_find_ext_capability ( struct rt_pci_device * pdev,
int cap )

◆ rt_pci_find_ext_next_capability()

rt_uint16_t rt_pci_find_ext_next_capability ( struct rt_pci_device * pdev,
rt_uint16_t pos,
int cap )

◆ rt_pci_find_root_bus()

struct rt_pci_bus * rt_pci_find_root_bus ( struct rt_pci_bus * bus)

◆ rt_pci_find_host_bridge()

struct rt_pci_host_bridge * rt_pci_find_host_bridge ( struct rt_pci_bus * bus)

◆ rt_pci_dev_id()

rt_inline rt_uint16_t rt_pci_dev_id ( struct rt_pci_device * pdev)

在文件 pci.h327 行定义.

328{
329 return RT_PCI_DEVID(pdev->bus->number, pdev->devfn);
330}
#define RT_PCI_DEVID(bus, devfn)
定义 pci.h:40
char number
定义 pci.h:240
struct rt_pci_bus * bus
定义 pci.h:134
rt_uint32_t devfn
定义 pci.h:139

引用了 rt_pci_device::bus, rt_pci_device::devfn, rt_pci_bus::number , 以及 RT_PCI_DEVID.

◆ rt_pci_is_root_bus()

rt_inline rt_bool_t rt_pci_is_root_bus ( struct rt_pci_bus * bus)

在文件 pci.h332 行定义.

333{
334 return bus->parent ? RT_FALSE : RT_TRUE;
335}
#define RT_TRUE
struct rt_pci_bus * parent
定义 pci.h:227

引用了 rt_pci_bus::parent, RT_FALSE , 以及 RT_TRUE.

◆ rt_pci_is_bridge()

rt_inline rt_bool_t rt_pci_is_bridge ( struct rt_pci_device * pdev)

在文件 pci.h337 行定义.

338{
339 return pdev->hdr_type == PCIM_HDRTYPE_BRIDGE ||
340 pdev->hdr_type == PCIM_HDRTYPE_CARDBUS;
341}
rt_uint8_t hdr_type
定义 pci.h:146

引用了 rt_pci_device::hdr_type.

◆ rt_pci_is_pcie()

rt_inline rt_bool_t rt_pci_is_pcie ( struct rt_pci_device * pdev)

在文件 pci.h343 行定义.

344{
345 return !!pdev->pcie_cap;
346}
rt_uint8_t pcie_cap
定义 pci.h:165

引用了 rt_pci_device::pcie_cap.

◆ rt_pci_bus_read_config_u8()

rt_err_t rt_pci_bus_read_config_u8 ( struct rt_pci_bus * bus,
rt_uint32_t devfn,
int pos,
rt_uint8_t * value )
+ 这是这个函数的调用关系图:

◆ rt_pci_bus_read_config_u16()

rt_err_t rt_pci_bus_read_config_u16 ( struct rt_pci_bus * bus,
rt_uint32_t devfn,
int pos,
rt_uint16_t * value )
+ 这是这个函数的调用关系图:

◆ rt_pci_bus_read_config_u32()

rt_err_t rt_pci_bus_read_config_u32 ( struct rt_pci_bus * bus,
rt_uint32_t devfn,
int pos,
rt_uint32_t * value )
+ 这是这个函数的调用关系图:

◆ rt_pci_bus_write_config_u8()

rt_err_t rt_pci_bus_write_config_u8 ( struct rt_pci_bus * bus,
rt_uint32_t devfn,
int reg,
rt_uint8_t value )
+ 这是这个函数的调用关系图:

◆ rt_pci_bus_write_config_u16()

rt_err_t rt_pci_bus_write_config_u16 ( struct rt_pci_bus * bus,
rt_uint32_t devfn,
int reg,
rt_uint16_t value )
+ 这是这个函数的调用关系图:

◆ rt_pci_bus_write_config_u32()

rt_err_t rt_pci_bus_write_config_u32 ( struct rt_pci_bus * bus,
rt_uint32_t devfn,
int reg,
rt_uint32_t value )
+ 这是这个函数的调用关系图:

◆ rt_pci_bus_read_config_uxx()

rt_err_t rt_pci_bus_read_config_uxx ( struct rt_pci_bus * bus,
rt_uint32_t devfn,
int reg,
int width,
rt_uint32_t * value )

◆ rt_pci_bus_write_config_uxx()

rt_err_t rt_pci_bus_write_config_uxx ( struct rt_pci_bus * bus,
rt_uint32_t devfn,
int reg,
int width,
rt_uint32_t value )

◆ rt_pci_bus_read_config_generic_u32()

rt_err_t rt_pci_bus_read_config_generic_u32 ( struct rt_pci_bus * bus,
rt_uint32_t devfn,
int reg,
int width,
rt_uint32_t * value )

◆ rt_pci_bus_write_config_generic_u32()

rt_err_t rt_pci_bus_write_config_generic_u32 ( struct rt_pci_bus * bus,
rt_uint32_t devfn,
int reg,
int width,
rt_uint32_t value )

◆ rt_pci_read_config_u8()

rt_inline rt_err_t rt_pci_read_config_u8 ( const struct rt_pci_device * pdev,
int reg,
rt_uint8_t * value )

在文件 pci.h376 行定义.

378{
379 return rt_pci_bus_read_config_u8(pdev->bus, pdev->devfn, reg, value);
380}
rt_err_t rt_pci_bus_read_config_u8(struct rt_pci_bus *bus, rt_uint32_t devfn, int pos, rt_uint8_t *value)

引用了 rt_pci_device::bus, rt_pci_device::devfn , 以及 rt_pci_bus_read_config_u8().

+ 函数调用图:

◆ rt_pci_read_config_u16()

rt_inline rt_err_t rt_pci_read_config_u16 ( const struct rt_pci_device * pdev,
int reg,
rt_uint16_t * value )

在文件 pci.h382 行定义.

384{
385 return rt_pci_bus_read_config_u16(pdev->bus, pdev->devfn, reg, value);
386}
rt_err_t rt_pci_bus_read_config_u16(struct rt_pci_bus *bus, rt_uint32_t devfn, int pos, rt_uint16_t *value)

引用了 rt_pci_device::bus, rt_pci_device::devfn , 以及 rt_pci_bus_read_config_u16().

+ 函数调用图:

◆ rt_pci_read_config_u32()

rt_inline rt_err_t rt_pci_read_config_u32 ( const struct rt_pci_device * pdev,
int reg,
rt_uint32_t * value )

在文件 pci.h388 行定义.

390{
391 return rt_pci_bus_read_config_u32(pdev->bus, pdev->devfn, reg, value);
392}
rt_err_t rt_pci_bus_read_config_u32(struct rt_pci_bus *bus, rt_uint32_t devfn, int pos, rt_uint32_t *value)

引用了 rt_pci_device::bus, rt_pci_device::devfn , 以及 rt_pci_bus_read_config_u32().

+ 函数调用图:

◆ rt_pci_write_config_u8()

rt_inline rt_err_t rt_pci_write_config_u8 ( const struct rt_pci_device * pdev,
int reg,
rt_uint8_t value )

在文件 pci.h394 行定义.

396{
397 return rt_pci_bus_write_config_u8(pdev->bus, pdev->devfn, reg, value);
398}
rt_err_t rt_pci_bus_write_config_u8(struct rt_pci_bus *bus, rt_uint32_t devfn, int reg, rt_uint8_t value)

引用了 rt_pci_device::bus, rt_pci_device::devfn , 以及 rt_pci_bus_write_config_u8().

+ 函数调用图:

◆ rt_pci_write_config_u16()

rt_inline rt_err_t rt_pci_write_config_u16 ( const struct rt_pci_device * pdev,
int reg,
rt_uint16_t value )

在文件 pci.h400 行定义.

402{
403 return rt_pci_bus_write_config_u16(pdev->bus, pdev->devfn, reg, value);
404}
rt_err_t rt_pci_bus_write_config_u16(struct rt_pci_bus *bus, rt_uint32_t devfn, int reg, rt_uint16_t value)

引用了 rt_pci_device::bus, rt_pci_device::devfn , 以及 rt_pci_bus_write_config_u16().

+ 函数调用图:

◆ rt_pci_write_config_u32()

rt_inline rt_err_t rt_pci_write_config_u32 ( const struct rt_pci_device * pdev,
int reg,
rt_uint32_t value )

在文件 pci.h406 行定义.

408{
409 return rt_pci_bus_write_config_u32(pdev->bus, pdev->devfn, reg, value);
410}
rt_err_t rt_pci_bus_write_config_u32(struct rt_pci_bus *bus, rt_uint32_t devfn, int reg, rt_uint32_t value)

引用了 rt_pci_device::bus, rt_pci_device::devfn , 以及 rt_pci_bus_write_config_u32().

+ 函数调用图:

◆ rt_pci_ofw_host_bridge_init()

rt_inline rt_err_t rt_pci_ofw_host_bridge_init ( struct rt_ofw_node * dev_np,
struct rt_pci_host_bridge * host_bridge )

在文件 pci.h427 行定义.

429{
430 return RT_EOK;
431}

◆ rt_pci_ofw_bus_init()

rt_inline rt_err_t rt_pci_ofw_bus_init ( struct rt_pci_bus * bus)

在文件 pci.h432 行定义.

433{
434 return RT_EOK;
435}

◆ rt_pci_ofw_bus_free()

rt_inline rt_err_t rt_pci_ofw_bus_free ( struct rt_pci_bus * bus)

在文件 pci.h436 行定义.

437{
438 return RT_EOK;
439}

◆ rt_pci_ofw_device_init()

rt_inline rt_err_t rt_pci_ofw_device_init ( struct rt_pci_device * pdev)

在文件 pci.h440 行定义.

441{
442 return RT_EOK;
443}

◆ rt_pci_ofw_device_free()

rt_inline rt_err_t rt_pci_ofw_device_free ( struct rt_pci_device * pdev)

在文件 pci.h444 行定义.

445{
446 return RT_EOK;
447}

◆ rt_pci_ofw_irq_parse_and_map()

rt_inline int rt_pci_ofw_irq_parse_and_map ( struct rt_pci_device * pdev,
rt_uint8_t slot,
rt_uint8_t pin )

在文件 pci.h448 行定义.

450{
451 return -1;
452}

◆ rt_pci_ofw_parse_ranges()

rt_inline rt_err_t rt_pci_ofw_parse_ranges ( struct rt_ofw_node * dev_np,
struct rt_pci_host_bridge * host_bridge )

在文件 pci.h453 行定义.

455{
456 return -RT_ENOSYS;
457}

◆ rt_pci_iomap()

rt_inline void * rt_pci_iomap ( struct rt_pci_device * pdev,
int bar_idx )

在文件 pci.h460 行定义.

461{
462 struct rt_pci_bus_resource *res = &pdev->resource[bar_idx];
463
464 RT_ASSERT(bar_idx < RT_ARRAY_SIZE(pdev->resource));
465
466 return rt_ioremap((void *)res->base, res->size);
467}
#define RT_ASSERT(EX)
#define RT_ARRAY_SIZE(arr)
定义 misc.h:59
rt_ubase_t base
定义 pci.h:77
struct rt_pci_bus_resource resource[RT_PCI_BAR_NR_MAX]
定义 pci.h:160

引用了 rt_pci_bus_resource::base, rt_pci_device::resource, RT_ARRAY_SIZE, RT_ASSERT , 以及 rt_pci_bus_resource::size.

◆ rt_pci_irq_intx()

rt_uint8_t rt_pci_irq_intx ( struct rt_pci_device * pdev,
rt_uint8_t pin )

◆ rt_pci_irq_slot()

rt_uint8_t rt_pci_irq_slot ( struct rt_pci_device * pdev,
rt_uint8_t * pinp )

◆ rt_pci_assign_irq()

void rt_pci_assign_irq ( struct rt_pci_device * pdev)

◆ rt_pci_intx()

void rt_pci_intx ( struct rt_pci_device * pdev,
rt_bool_t enable )

◆ rt_pci_check_and_mask_intx()

rt_bool_t rt_pci_check_and_mask_intx ( struct rt_pci_device * pdev)

◆ rt_pci_check_and_unmask_intx()

rt_bool_t rt_pci_check_and_unmask_intx ( struct rt_pci_device * pdev)

◆ rt_pci_irq_mask()

void rt_pci_irq_mask ( struct rt_pci_device * pdev)

◆ rt_pci_irq_unmask()

void rt_pci_irq_unmask ( struct rt_pci_device * pdev)

◆ rt_pci_alloc_vector()

rt_inline rt_ssize_t rt_pci_alloc_vector ( struct rt_pci_device * pdev,
int min,
int max,
rt_uint32_t flags,
RT_IRQ_AFFINITY_DECLARE((*affinities))  )

在文件 pci.h503 行定义.

505{
506 return -RT_ENOSYS;
507}

◆ rt_pci_free_vector()

rt_inline void rt_pci_free_vector ( struct rt_pci_device * pdev)

在文件 pci.h509 行定义.

510{
511 return;
512}

◆ rt_pci_msi_vector_count()

rt_inline rt_ssize_t rt_pci_msi_vector_count ( struct rt_pci_device * pdev)

在文件 pci.h514 行定义.

515{
516 return 0;
517}

◆ rt_pci_msi_disable()

rt_inline rt_err_t rt_pci_msi_disable ( struct rt_pci_device * pdev)

在文件 pci.h519 行定义.

520{
521 return RT_EOK;
522}

◆ rt_pci_msi_enable_range_affinity()

rt_inline rt_ssize_t rt_pci_msi_enable_range_affinity ( struct rt_pci_device * pdev,
int min,
int max,
RT_IRQ_AFFINITY_DECLARE((*affinities))  )

在文件 pci.h524 行定义.

526{
527 return -RT_ENOSYS;
528}
+ 这是这个函数的调用关系图:

◆ rt_pci_msix_vector_count()

rt_inline rt_ssize_t rt_pci_msix_vector_count ( struct rt_pci_device * pdev)

在文件 pci.h530 行定义.

531{
532 return 0;
533}

◆ rt_pci_msix_disable()

rt_inline rt_err_t rt_pci_msix_disable ( struct rt_pci_device * pdev)

在文件 pci.h535 行定义.

536{
537 return RT_EOK;
538}

◆ rt_pci_msix_enable_range_affinity()

rt_inline rt_ssize_t rt_pci_msix_enable_range_affinity ( struct rt_pci_device * pdev,
struct rt_pci_msix_entry * entries,
int min,
int max,
RT_IRQ_AFFINITY_DECLARE((*affinities))  )

在文件 pci.h540 行定义.

543{
544 return -RT_ENOSYS;
545}
+ 这是这个函数的调用关系图:

◆ rt_pci_msix_entry_index_linear()

rt_inline void rt_pci_msix_entry_index_linear ( struct rt_pci_msix_entry * entries,
rt_size_t nvectors )

在文件 pci.h548 行定义.

550{
551 for (int i = 0; i < nvectors; ++i)
552 {
553 entries[i].index = i;
554 }
555}
int index
定义 pci.h:261

引用了 rt_pci_msix_entry::index.

◆ rt_pci_msi_enable_range()

rt_inline rt_ssize_t rt_pci_msi_enable_range ( struct rt_pci_device * pdev,
int min,
int max )

在文件 pci.h557 行定义.

559{
560 return rt_pci_msi_enable_range_affinity(pdev, min, max, RT_NULL);
561}
rt_inline rt_ssize_t rt_pci_msi_enable_range_affinity(struct rt_pci_device *pdev, int min, int max, RT_IRQ_AFFINITY_DECLARE((*affinities)))
定义 pci.h:524
#define RT_NULL

引用了 RT_NULL , 以及 rt_pci_msi_enable_range_affinity().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ rt_pci_msi_enable()

rt_inline rt_err_t rt_pci_msi_enable ( struct rt_pci_device * pdev)

在文件 pci.h563 行定义.

564{
565 rt_ssize_t res = rt_pci_msi_enable_range(pdev, 1, 1);
566 return res == 1 ? res : RT_EOK;
567}
rt_inline rt_ssize_t rt_pci_msi_enable_range(struct rt_pci_device *pdev, int min, int max)
定义 pci.h:557
rt_base_t rt_ssize_t

引用了 rt_pci_msi_enable_range().

+ 函数调用图:

◆ rt_pci_msix_enable_range()

rt_inline rt_ssize_t rt_pci_msix_enable_range ( struct rt_pci_device * pdev,
struct rt_pci_msix_entry * entries,
int min,
int max )

在文件 pci.h569 行定义.

571{
572 return rt_pci_msix_enable_range_affinity(pdev, entries, min, max, RT_NULL);
573}
rt_inline rt_ssize_t rt_pci_msix_enable_range_affinity(struct rt_pci_device *pdev, struct rt_pci_msix_entry *entries, int min, int max, RT_IRQ_AFFINITY_DECLARE((*affinities)))
定义 pci.h:540

引用了 RT_NULL , 以及 rt_pci_msix_enable_range_affinity().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ rt_pci_msix_enable()

rt_inline rt_ssize_t rt_pci_msix_enable ( struct rt_pci_device * pdev,
struct rt_pci_msix_entry * entries,
int count )

在文件 pci.h575 行定义.

577{
578 return rt_pci_msix_enable_range(pdev, entries, count, count);
579}
rt_inline rt_ssize_t rt_pci_msix_enable_range(struct rt_pci_device *pdev, struct rt_pci_msix_entry *entries, int min, int max)
定义 pci.h:569

引用了 rt_pci_msix_enable_range().

+ 函数调用图:

◆ rt_pci_region_setup()

rt_err_t rt_pci_region_setup ( struct rt_pci_host_bridge * host_bridge)

◆ rt_pci_region_alloc()

struct rt_pci_bus_region * rt_pci_region_alloc ( struct rt_pci_host_bridge * host_bridge,
void ** out_addr,
rt_size_t size,
rt_ubase_t flags,
rt_bool_t mem64 )

◆ rt_pci_device_alloc_resource()

rt_err_t rt_pci_device_alloc_resource ( struct rt_pci_host_bridge * host_bridge,
struct rt_pci_device * pdev )

◆ rt_pci_enum_device()

void rt_pci_enum_device ( struct rt_pci_bus * bus,
rt_bool_t(callback(struct rt_pci_device *, void *)) ,
void * data )

◆ rt_pci_match_id()

const struct rt_pci_device_id * rt_pci_match_id ( struct rt_pci_device * pdev,
const struct rt_pci_device_id * id )

◆ rt_pci_match_ids()

const struct rt_pci_device_id * rt_pci_match_ids ( struct rt_pci_device * pdev,
const struct rt_pci_device_id * ids )

◆ rt_pci_driver_register()

rt_err_t rt_pci_driver_register ( struct rt_pci_driver * pdrv)

◆ rt_pci_device_register()

rt_err_t rt_pci_device_register ( struct rt_pci_device * pdev)

◆ rt_pci_find_bar()

struct rt_pci_bus_resource * rt_pci_find_bar ( struct rt_pci_device * pdev,
rt_ubase_t flags,
int index )

变量说明

◆ rt_pci_lock

struct rt_spinlock rt_pci_lock
extern