File tree 1 file changed +13
-1
lines changed
uefi-test-runner/src/proto/network
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
// SPDX-License-Identifier: MIT OR Apache-2.0
2
2
3
3
use core:: ops:: DerefMut ;
4
+ use uefi:: proto:: device_path:: text:: { AllowShortcuts , DisplayOnly } ;
5
+ use uefi:: proto:: device_path:: DevicePath ;
4
6
use uefi:: proto:: network:: snp:: { InterruptStatus , NetworkState , ReceiveFlags , SimpleNetwork } ;
5
7
use uefi:: proto:: network:: MacAddress ;
6
8
use uefi:: { boot, Status } ;
@@ -47,11 +49,21 @@ pub fn test() {
47
49
info ! ( "Testing the simple network protocol" ) ;
48
50
49
51
let handles = boot:: find_handles :: < SimpleNetwork > ( ) . unwrap_or_default ( ) ;
50
-
51
52
for handle in handles {
52
53
let Ok ( mut simple_network) = boot:: open_protocol_exclusive :: < SimpleNetwork > ( handle) else {
53
54
continue ;
54
55
} ;
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
+ }
55
67
56
68
assert_eq ! (
57
69
simple_network. mode( ) . state,
You can’t perform that action at this time.
0 commit comments