File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
uefi-test-runner/src/proto/network Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: MIT OR Apache-2.0
22
33use core:: ops:: DerefMut ;
4+ use uefi:: proto:: device_path:: text:: { AllowShortcuts , DisplayOnly } ;
5+ use uefi:: proto:: device_path:: DevicePath ;
46use uefi:: proto:: network:: snp:: { InterruptStatus , NetworkState , ReceiveFlags , SimpleNetwork } ;
57use uefi:: proto:: network:: MacAddress ;
68use uefi:: { boot, Status } ;
@@ -47,11 +49,21 @@ pub fn test() {
4749 info ! ( "Testing the simple network protocol" ) ;
4850
4951 let handles = boot:: find_handles :: < SimpleNetwork > ( ) . unwrap_or_default ( ) ;
50-
5152 for handle in handles {
5253 let Ok ( mut simple_network) = boot:: open_protocol_exclusive :: < SimpleNetwork > ( handle) else {
5354 continue ;
5455 } ;
56+ // Print device path
57+ {
58+ let simple_network_dvp = boot:: open_protocol_exclusive :: < DevicePath > ( handle)
59+ . expect ( "Should have device path" ) ;
60+ log:: info!(
61+ "Network interface: {}" ,
62+ simple_network_dvp
63+ . to_string( DisplayOnly ( true ) , AllowShortcuts ( true ) )
64+ . unwrap( )
65+ ) ;
66+ }
5567
5668 assert_eq ! (
5769 simple_network. mode( ) . state,
You can’t perform that action at this time.
0 commit comments