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

Function pci_ea_fixed_busnrs

components/drivers/pci/probe.c:432–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

430}
431
432static rt_bool_t pci_ea_fixed_busnrs(struct rt_pci_device *pdev,
433 rt_uint8_t *sec, rt_uint8_t *sub)
434{
435 int pos, offset;
436 rt_uint32_t dw;
437 rt_uint8_t ea_sec, ea_sub;
438
439 pos = rt_pci_find_capability(pdev, PCIY_EA);
440 if (!pos)
441 {
442 return RT_FALSE;
443 }
444
445 offset = pos + PCIR_EA_FIRST_ENT;
446 rt_pci_read_config_u32(pdev, offset, &dw);
447 ea_sec = PCIM_EA_SEC_NR(dw);
448 ea_sub = PCIM_EA_SUB_NR(dw);
449 if (ea_sec == 0 || ea_sub < ea_sec)
450 {
451 return RT_FALSE;
452 }
453
454 *sec = ea_sec;
455 *sub = ea_sub;
456
457 return RT_TRUE;
458}
459
460static void pcie_fixup_link(struct rt_pci_device *pdev)
461{

Callers 1

pci_scan_bridge_extendFunction · 0.85

Calls 2

rt_pci_find_capabilityFunction · 0.85
rt_pci_read_config_u32Function · 0.85

Tested by

no test coverage detected