@@ -46,7 +46,6 @@ pub use self::net::VirtIoNetDev;
4646pub use self :: v9p:: VirtIo9pDev ;
4747
4848pub use virtio_drivers:: transport:: pci:: bus as pci;
49- use virtio_drivers:: transport:: pci:: bus:: ConfigurationAccess ;
5049pub use virtio_drivers:: transport:: { mmio:: MmioTransport , pci:: PciTransport , Transport } ;
5150pub use virtio_drivers:: { BufferDirection , Hal as VirtIoHal , PhysAddr } ;
5251
@@ -60,13 +59,13 @@ use virtio_drivers::transport::DeviceType as VirtIoDevType;
6059/// for later operations. Otherwise, returns [`None`].
6160pub fn probe_mmio_device (
6261 reg_base : * mut u8 ,
63- reg_size : usize ,
64- ) -> Option < ( DeviceType , MmioTransport < ' static > ) > {
62+ _reg_size : usize ,
63+ ) -> Option < ( DeviceType , MmioTransport ) > {
6564 use core:: ptr:: NonNull ;
6665 use virtio_drivers:: transport:: mmio:: VirtIOHeader ;
6766
6867 let header = NonNull :: new ( reg_base as * mut VirtIOHeader ) . unwrap ( ) ;
69- let transport = unsafe { MmioTransport :: new ( header, reg_size ) } . ok ( ) ?;
68+ let transport = unsafe { MmioTransport :: new ( header) } . ok ( ) ?;
7069 let dev_type = as_dev_type ( transport. device_type ( ) ) ?;
7170 Some ( ( dev_type, transport) )
7271}
@@ -75,19 +74,15 @@ pub fn probe_mmio_device(
7574///
7675/// If the device is recognized, returns the device type and a transport object
7776/// for later operations. Otherwise, returns [`None`].
78- pub fn probe_pci_device < H , C > (
79- root : & mut PciRoot < C > ,
77+ pub fn probe_pci_device < H : VirtIoHal > (
78+ root : & mut PciRoot ,
8079 bdf : DeviceFunction ,
8180 dev_info : & DeviceFunctionInfo ,
82- ) -> Option < ( DeviceType , PciTransport ) >
83- where
84- H : VirtIoHal ,
85- C : ConfigurationAccess ,
86- {
81+ ) -> Option < ( DeviceType , PciTransport ) > {
8782 use virtio_drivers:: transport:: pci:: virtio_device_type;
8883
8984 let dev_type = virtio_device_type ( dev_info) . and_then ( as_dev_type) ?;
90- let transport = PciTransport :: new :: < H , C > ( root, bdf) . ok ( ) ?;
85+ let transport = PciTransport :: new :: < H > ( root, bdf) . ok ( ) ?;
9186 Some ( ( dev_type, transport) )
9287}
9388
0 commit comments