MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_pci_msi_init

Function rt_pci_msi_init

components/drivers/pci/msi/device.c:13–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include <drivers/pci.h>
12
13void rt_pci_msi_init(struct rt_pci_device *pdev)
14{
15 if (pdev && (pdev->msi_cap = rt_pci_find_capability(pdev, PCIY_MSI)))
16 {
17 rt_uint16_t ctrl;
18
19 rt_pci_read_config_u16(pdev, pdev->msi_cap + PCIR_MSI_CTRL, &ctrl);
20
21 if (ctrl & PCIM_MSICTRL_MSI_ENABLE)
22 {
23 rt_pci_write_config_u16(pdev, pdev->msi_cap + PCIR_MSI_CTRL, ctrl & ~PCIM_MSICTRL_MSI_ENABLE);
24 }
25
26 if (!(ctrl & PCIM_MSICTRL_64BIT))
27 {
28 pdev->no_64bit_msi = RT_TRUE;
29 }
30 }
31}
32
33void rt_pci_msix_init(struct rt_pci_device *pdev)
34{

Callers 1

pci_init_capabilitiesFunction · 0.85

Calls 3

rt_pci_find_capabilityFunction · 0.85
rt_pci_read_config_u16Function · 0.85
rt_pci_write_config_u16Function · 0.85

Tested by

no test coverage detected