Linux 驱动PCIE编程接口

PCI Support Library

Prev

Chapter 9. Hardware Interfaces

 Next


PCI Support Library

pci_bus_max_busnr — returns maximum PCI bus number of given bus' children

pci_find_capability — query for devices' capabilities

pci_bus_find_capability — query for devices' capabilities

pci_find_next_ext_capability — Find an extended capability

pci_find_ext_capability — Find an extended capability

pci_find_next_ht_capability — query a device's Hypertransport capabilities

pci_find_ht_capability — query a device's Hypertransport capabilities

pci_find_parent_resource — return resource region of parent bus of given region

pci_find_resource — Return matching PCI device resource

pci_find_pcie_root_port — return PCIe Root Port

__pci_complete_power_transition — Complete power transition of a PCI device

pci_set_power_state — Set the power state of a PCI device

pci_choose_state — Choose the power state of a PCI device

pci_save_state — save the PCI configuration space of a device before suspending

pci_restore_state — Restore the saved state of a PCI device

pci_store_saved_state — Allocate and return an opaque struct containing the device saved state.

pci_load_saved_state — Reload the provided save state into struct pci_dev.

pci_load_and_free_saved_state — Reload the save state pointed to by state, and free the memory allocated for it.

pci_reenable_device — Resume abandoned device

pci_enable_device_io — Initialize a device for use with IO space

pci_enable_device_mem — Initialize a device for use with Memory space

pci_enable_device — Initialize device before it's used by a driver.

pcim_enable_device Managed pci_enable_device

pcim_pin_device — Pin managed PCI device

pci_disable_device — Disable PCI device after use

pci_set_pcie_reset_state — set reset state for device dev

pci_pme_capable — check the capability of PCI device to generate PME#

pci_pme_active — enable or disable PCI device's PME# function

__pci_enable_wake — enable PCI device as wakeup event source

pci_wake_from_d3 — enable/disable device to wake up from D3_hot or D3_cold

pci_prepare_to_sleep — prepare PCI device for system-wide transition into a sleep state

pci_back_from_sleep — turn PCI device on during system-wide transition into working state

pci_dev_run_wake — Check if device can generate run-time wake-up events.

pci_d3cold_enable — Enable D3cold for device

pci_d3cold_disable — Disable D3cold for device

pci_common_swizzle — swizzle INTx all the way to root bridge

pci_release_region — Release a PCI bar

pci_request_region — Reserve PCI I/O and memory resource

pci_request_region_exclusive — Reserved PCI I/O and memory resource

pci_release_selected_regions — Release selected PCI I/O and memory resources

pci_request_selected_regions — Reserve selected PCI I/O and memory resources

pci_release_regions — Release reserved PCI I/O and memory resources

pci_request_regions — Reserved PCI I/O and memory resources

pci_request_regions_exclusive — Reserved PCI I/O and memory resources

pci_set_master — enables bus-mastering for device dev

pci_clear_master — disables bus-mastering for device dev

pci_set_cacheline_size — ensure the CACHE_LINE_SIZE register is programmed

pci_set_mwi — enables memory-write-invalidate PCI transaction

pci_try_set_mwi — enables memory-write-invalidate PCI transaction

pci_clear_mwi — disables Memory-Write-Invalidate for device dev

pci_intx — enables/disables PCI INTx for device dev

pci_intx_mask_supported — probe for INTx masking support

pci_check_and_mask_intx — mask INTx on pending interrupt

pci_check_and_unmask_intx — unmask INTx if no interrupt is pending

pci_wait_for_pending_transaction — waits for pending transaction

pci_reset_bridge_secondary_bus — Reset the secondary bus on a PCI bridge.

__pci_reset_function — reset a PCI device function

__pci_reset_function_locked — reset a PCI device function while holding the dev mutex lock.

pci_reset_function — quiesce and reset a PCI device function

pci_try_reset_function — quiesce and reset a PCI device function

pci_probe_reset_slot — probe whether a PCI slot can be reset

pci_reset_slot — reset a PCI slot

pci_try_reset_slot — Try to reset a PCI slot

pci_probe_reset_bus — probe whether a PCI bus can be reset

pci_reset_bus — reset a PCI bus

pci_try_reset_bus — Try to reset a PCI bus

pcix_get_max_mmrbc — get PCI-X maximum designed memory read byte count

pcix_get_mmrbc — get PCI-X maximum memory read byte count

pcix_set_mmrbc — set PCI-X maximum memory read byte count

pcie_get_readrq — get PCI Express read request size

pcie_set_readrq — set PCI Express maximum memory read request

pcie_get_mps — get PCI Express maximum payload size

pcie_set_mps — set PCI Express maximum payload size

pcie_get_minimum_link — determine minimum link settings of a PCI device

pci_select_bars — Make BAR mask from the type of resource

pci_add_dynid — add a new PCI device ID to this driver and re-probe devices

pci_match_id — See if a pci device matches a given pci_id table

__pci_register_driver — register a new pci driver

pci_unregister_driver — unregister a pci driver

pci_dev_driver — get the pci_driver of a device

pci_dev_get — increments the reference count of the pci device structure

pci_dev_put — release a use of the pci device structure

pci_stop_and_remove_bus_device — remove a PCI device and any children

pci_find_bus — locate PCI bus from a given domain and bus number

pci_find_next_bus — begin or continue searching for a PCI bus

pci_get_slot — locate PCI device for a given PCI slot

pci_get_domain_bus_and_slot — locate PCI device for a given PCI domain (segment), bus, and slot

pci_get_subsys — begin or continue searching for a PCI device by vendor/subvendor/device/subdevice id

pci_get_device — begin or continue searching for a PCI device by vendor/device id

pci_get_class — begin or continue searching for a PCI device by class

pci_dev_present — Returns 1 if device matching the device list is present, 0 if not.

pci_msi_mask_irq — Generic irq chip callback to mask PCI/MSI interrupts

pci_msi_unmask_irq — Generic irq chip callback to unmask PCI/MSI interrupts

pci_msi_vec_count — Return the number of MSI vectors a device can send

pci_msix_vec_count — return the number of device's MSI-X table entries

pci_enable_msix — configure device's MSI-X capability structure

pci_msi_enabled — is MSI enabled?

pci_enable_msix_range — configure device's MSI-X capability structure

pci_alloc_irq_vectors_affinity — allocate multiple IRQs for a device

pci_free_irq_vectors — free previously allocated IRQs for a device

pci_irq_vector — return Linux IRQ number of a device vector

pci_irq_get_affinity — return the affinity of a particular msi vector

pci_irq_get_node — return the numa node of a particular msi vector

pci_msi_create_irq_domain — Create a MSI interrupt domain

pci_bus_alloc_resource — allocate a resource from a parent bus

pci_bus_add_device — start driver for a single device

pci_bus_add_devices — start driver for PCI devices

pci_bus_set_ops — Set raw operations of pci bus

pci_read_vpd — Read one entry from Vital Product Data

pci_write_vpd — Write entry to Vital Product Data

pci_set_vpd_size — Set size of Vital Product Data space

pci_cfg_access_lock — Lock PCI config reads/writes

pci_cfg_access_trylock — try to lock PCI config reads/writes

pci_cfg_access_unlock — Unlock PCI config reads/writes

pci_lost_interrupt — reports a lost PCI interrupt

__ht_create_irq — create an irq and attach it to a device.

ht_create_irq — create an irq and attach it to a device.

ht_destroy_irq — destroy an irq created with ht_create_irq

pci_scan_slot — scan a PCI slot on a bus for devices.

pci_rescan_bus — scan a PCI bus for devices.

pci_create_slot — create or increment refcount for physical PCI slot

pci_destroy_slot — decrement refcount for physical PCI slot

pci_hp_create_module_link — create symbolic link to the hotplug driver module.

pci_hp_remove_module_link — remove symbolic link to the hotplug driver module.

pci_enable_rom — enable ROM decoding for a PCI device

pci_disable_rom — disable ROM decoding for a PCI device

pci_map_rom — map a PCI ROM to kernel space

pci_unmap_rom — unmap the ROM from kernel space

pci_platform_rom — provides a pointer to any ROM image provided by the platform

pci_enable_sriov — enable the SR-IOV capability

pci_disable_sriov — disable the SR-IOV capability

pci_num_vf — return number of VFs associated with a PF device_release_driver

pci_vfs_assigned — returns number of VFs are assigned to a guest

pci_sriov_set_totalvfs — - reduce the TotalVFs available

pci_sriov_get_totalvfs — - get total VFs supported on this device

pci_read_legacy_io — read byte(s) from legacy I/O port space

pci_write_legacy_io — write byte(s) to legacy I/O port space

pci_mmap_legacy_mem — map legacy PCI memory into user memory space

pci_mmap_legacy_io — map legacy PCI IO into user memory space

pci_adjust_legacy_attr — adjustment of legacy file attributes

pci_create_legacy_files — create legacy I/O port and memory files

pci_mmap_resource — map a PCI resource into user memory space

pci_remove_resource_files — cleanup resource files

pci_create_resource_files — create resource files in sysfs for dev

pci_write_rom — used to enable access to the PCI ROM display

pci_read_rom — read a PCI ROM

pci_remove_sysfs_dev_files — cleanup PCI specific sysfs files

分数

  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
Linux PCIE驱动例程是一种针对PCI Express(PCIe)总线上设备的驱动程序示例。PCIe是一种高速串行总线标准,用于连接计算机的外部设备,如网络适配器、图形卡和硬盘控制器等。 在Linux内核中,PCIE驱动程序是通过内核模块的形式实现的。驱动程序负责管理与PCIe设备的通信和控制。它与PCI和PCI-X驱动程序有所不同,因为PCIe总线具有不同的架构和通信协议。 PCIE驱动程序的开发流程通常包括以下几个步骤: 1. 资源分配:驱动程序在初始化阶段需要分配所需的内存资源、中断号和I / O端口等。 2. 设备与驱动程序的匹配:驱动程序需要识别与其匹配的PCIe设备,并将其与相应的驱动程序关联起来。 3. 驱动程序注册:驱动程序需要注册自己的特定功能和回调函数,以便在需要时被内核调用。 4. 启动和关闭设备:驱动程序负责初始化和配置设备,并在不需要时关闭设备。 5. DMA(直接内存访问)管理:驱动程序可能需要管理与设备之间的数据传输,包括DMA缓冲区的分配和释放。 6. 中断处理:驱动程序需要处理与设备相关的中断请求,以便及时响应设备的状态变化和数据传输。 7. 错误处理:驱动程序应该能够检测和处理与设备通信和控制相关的错误,包括错误恢复和重试。 PCIE驱动程序的开发需要具备扎实的Linux内核编程知识和理解PCIe总线架构和通信协议的能力。通过编写高效的驱动程序,可以实现对PCIe设备的可靠和高性能的控制和通信,从而实现更好的系统性能和应用体验。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

李洛克07

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值