1#![forbid(unsafe_code)]
7
8pub mod its;
9pub(crate) mod port;
10pub use port::PciePortSettings;
11pub use port::PortBarDefinition;
12pub use port::PortBarSubregionDefinition;
13pub use port::PortBarSubregionKind;
14pub mod root;
15pub mod switch;
16
17#[cfg(any(test, feature = "fuzz"))]
18#[expect(missing_docs)]
19pub mod test_helpers;
20
21const PAGE_SIZE: usize = 4096;
22const PAGE_SIZE64: u64 = 4096;
23const PAGE_OFFSET_MASK: u64 = PAGE_SIZE64 - 1;
24const PAGE_SHIFT: u32 = PAGE_SIZE.trailing_zeros();
25
26const VENDOR_ID: u16 = 0x1414;
27
28const ROOT_PORT_DEVICE_ID: u16 = 0xC030;
30const UPSTREAM_SWITCH_PORT_DEVICE_ID: u16 = 0xC031;
31const DOWNSTREAM_SWITCH_PORT_DEVICE_ID: u16 = 0xC032;
32
33const MAX_FUNCTIONS_PER_BUS: usize = 256;
34
35const BDF_BUS_SHIFT: u16 = 8;
36const BDF_DEVICE_SHIFT: u16 = 3;
37const BDF_DEVICE_FUNCTION_MASK: u16 = 0x00FF;