@@ -27,6 +27,8 @@ use virtio_drivers::transport::{
2727
2828#[ cfg( any( target_arch = "x86_64" ) ) ]
2929use devices:: ALL_DEVICES ;
30+ #[ cfg( any( target_arch = "x86_64" ) ) ]
31+ use virtio_drivers:: transport:: pci:: bus:: MmioCam ;
3032
3133#[ cfg( any( target_arch = "x86_64" ) ) ]
3234use virtio_drivers:: transport:: pci:: {
@@ -79,7 +81,7 @@ fn virtio_device(transport: MmioTransport, node: &Node) -> Arc<dyn Driver> {
7981fn enumerate_pci ( mmconfig_base : * mut u8 ) {
8082 info ! ( "mmconfig_base = {:#x}" , mmconfig_base as usize ) ;
8183
82- let mut pci_root = unsafe { PciRoot :: new ( mmconfig_base, Cam :: Ecam ) } ;
84+ let mut pci_root = unsafe { PciRoot :: < MmioCam > :: new ( MmioCam :: new ( mmconfig_base, Cam :: Ecam ) ) } ;
8385 for ( device_function, info) in pci_root. enumerate_bus ( 0 ) {
8486 let ( status, command) = pci_root. get_status_command ( device_function) ;
8587 info ! (
@@ -97,7 +99,7 @@ fn enumerate_pci(mmconfig_base: *mut u8) {
9799 dump_bar_contents ( & mut pci_root, device_function, 4 ) ;
98100
99101 let mut transport =
100- PciTransport :: new :: < HalImpl > ( & mut pci_root, device_function) . unwrap ( ) ;
102+ PciTransport :: new :: < HalImpl , MmioCam > ( & mut pci_root, device_function) . unwrap ( ) ;
101103 info ! (
102104 "Detected virtio PCI device with device type {:?}, features {:#018x}" ,
103105 transport. device_type( ) ,
@@ -127,7 +129,7 @@ fn virtio_device_probe(transport: impl Transport + 'static) {
127129}
128130
129131#[ cfg( any( target_arch = "x86_64" ) ) ]
130- fn dump_bar_contents ( root : & mut PciRoot , device_function : DeviceFunction , bar_index : u8 ) {
132+ fn dump_bar_contents ( root : & mut PciRoot < MmioCam > , device_function : DeviceFunction , bar_index : u8 ) {
131133 let bar_info = root. bar_info ( device_function, bar_index) . unwrap ( ) ;
132134 trace ! ( "Dumping bar {}: {:#x?}" , bar_index, bar_info) ;
133135 if let BarInfo :: Memory { address, size, .. } = bar_info {
0 commit comments