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:: DevicePath ;
5+ use uefi:: proto:: device_path:: text:: { AllowShortcuts , DisplayOnly } ;
46use uefi:: proto:: network:: MacAddress ;
57use uefi:: proto:: network:: snp:: { InterruptStatus , NetworkState , ReceiveFlags , SimpleNetwork } ;
68use uefi:: { Status , boot} ;
@@ -39,11 +41,21 @@ pub fn test() {
3941 info ! ( "Testing the simple network protocol" ) ;
4042
4143 let handles = boot:: find_handles :: < SimpleNetwork > ( ) . unwrap_or_default ( ) ;
42-
4344 for handle in handles {
4445 let Ok ( mut simple_network) = boot:: open_protocol_exclusive :: < SimpleNetwork > ( handle) else {
4546 continue ;
4647 } ;
48+ // Print device path
49+ {
50+ let simple_network_dvp = boot:: open_protocol_exclusive :: < DevicePath > ( handle)
51+ . expect ( "Should have device path" ) ;
52+ log:: info!(
53+ "Network interface: {}" ,
54+ simple_network_dvp
55+ . to_string( DisplayOnly ( true ) , AllowShortcuts ( true ) )
56+ . unwrap( )
57+ ) ;
58+ }
4759
4860 assert_eq ! (
4961 simple_network. mode( ) . state,
You can’t perform that action at this time.
0 commit comments