@@ -119,8 +119,17 @@ pub struct BootServices {
119
119
) -> Status ,
120
120
121
121
// Driver support services
122
- connect_controller : usize ,
123
- disconnect_controller : usize ,
122
+ connect_controller : unsafe extern "efiapi" fn (
123
+ controller : Handle ,
124
+ driver_image : Option < Handle > ,
125
+ remaining_device_path : * const DevicePath ,
126
+ recursive : bool ,
127
+ ) -> Status ,
128
+ disconnect_controller : unsafe extern "efiapi" fn (
129
+ controller : Handle ,
130
+ driver_image : Option < Handle > ,
131
+ child : Option < Handle > ,
132
+ ) -> Status ,
124
133
125
134
// Protocol open / close services
126
135
open_protocol : extern "efiapi" fn (
@@ -694,6 +703,44 @@ impl BootServices {
694
703
unsafe { ( self . set_watchdog_timer ) ( timeout, watchdog_code, data_len, data) } . into ( )
695
704
}
696
705
706
+ /// Connect one or more drivers to a controller.
707
+ ///
708
+ /// Usually one disconnects and then reconnects certain drivers
709
+ /// to make them rescan some state that changed, e.g. reconnecting
710
+ /// a `BlockIO` handle after your app changed the partitions somehow.
711
+ pub fn connect_controller (
712
+ & self ,
713
+ controller : Handle ,
714
+ driver_image : Option < Handle > ,
715
+ remaining_device_path : Option < & DevicePath > ,
716
+ recursive : bool ,
717
+ ) -> Result {
718
+ unsafe {
719
+ ( self . connect_controller ) (
720
+ controller,
721
+ driver_image,
722
+ remaining_device_path
723
+ . map ( |dp| dp as _ )
724
+ . unwrap_or ( ptr:: null ( ) ) ,
725
+ recursive,
726
+ )
727
+ }
728
+ . into_with_err ( |_| ( ) )
729
+ }
730
+
731
+ /// Disconnect one or more drivers from a controller.
732
+ ///
733
+ /// See [`connect_controller`][Self::connect_controller].
734
+ pub fn disconnect_controller (
735
+ & self ,
736
+ controller : Handle ,
737
+ driver_image : Option < Handle > ,
738
+ child : Option < Handle > ,
739
+ ) -> Result {
740
+ unsafe { ( self . disconnect_controller ) ( controller, driver_image, child) }
741
+ . into_with_err ( |_| ( ) )
742
+ }
743
+
697
744
/// Open a protocol interface for a handle.
698
745
///
699
746
/// This function attempts to get the protocol implementation of a
0 commit comments