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

Function pci_cfg_space_size

components/drivers/pci/probe.c:255–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255static rt_uint16_t pci_cfg_space_size(struct rt_pci_device *pdev)
256{
257 int pos;
258 rt_uint32_t status;
259 rt_uint16_t class = pdev->class >> 8;
260
261 if (class == PCIS_BRIDGE_HOST)
262 {
263 return pci_cfg_space_size_ext(pdev);
264 }
265
266 if (rt_pci_is_pcie(pdev))
267 {
268 return pci_cfg_space_size_ext(pdev);
269 }
270
271 pos = rt_pci_find_capability(pdev, PCIY_PCIX);
272 if (!pos)
273 {
274 return PCI_REGMAX + 1;
275 }
276
277 rt_pci_read_config_u32(pdev, pos + PCIXR_STATUS, &status);
278 if (status & (PCIXM_STATUS_266CAP | PCIXM_STATUS_533CAP))
279 {
280 return pci_cfg_space_size_ext(pdev);
281 }
282
283 return PCI_REGMAX + 1;
284}
285
286static void pci_init_capabilities(struct rt_pci_device *pdev)
287{

Callers 1

pci_init_capabilitiesFunction · 0.85

Calls 4

pci_cfg_space_size_extFunction · 0.85
rt_pci_is_pcieFunction · 0.85
rt_pci_find_capabilityFunction · 0.85
rt_pci_read_config_u32Function · 0.85

Tested by

no test coverage detected