Skip to content

Commit f409ebb

Browse files
uefi: Convert use of DiscoverInfo to PxeBaseCodeDiscoverInfo in pxe::BaseCode
This is an intermediate step towards using the uefi-raw definition of the protocol.
1 parent cffde40 commit f409ebb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

uefi/src/proto/network/pxe.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use core::mem::MaybeUninit;
1515
use core::ptr::{self, null, null_mut};
1616
use ptr_meta::Pointee;
1717
use uefi_raw::protocol::network::pxe::{
18-
PxeBaseCodeMtftpInfo, PxeBaseCodePacket, PxeBaseCodeTftpOpcode,
18+
PxeBaseCodeDiscoverInfo, PxeBaseCodeMtftpInfo, PxeBaseCodePacket, PxeBaseCodeTftpOpcode,
1919
};
2020
use uefi_raw::{Boolean, Char8};
2121

@@ -39,7 +39,7 @@ pub struct BaseCode {
3939
ty: BootstrapType,
4040
layer: &mut u16,
4141
use_bis: Boolean,
42-
info: *const FfiDiscoverInfo,
42+
info: *const PxeBaseCodeDiscoverInfo,
4343
) -> Status,
4444
mtftp: unsafe extern "efiapi" fn(
4545
this: &Self,
@@ -141,11 +141,8 @@ impl BaseCode {
141141
use_bis: bool,
142142
info: Option<&DiscoverInfo>,
143143
) -> Result {
144-
let info: *const FfiDiscoverInfo = info
145-
.map(|info| {
146-
let info_ptr: *const DiscoverInfo = info;
147-
info_ptr.cast()
148-
})
144+
let info: *const PxeBaseCodeDiscoverInfo = info
145+
.map(|info| ptr::from_ref(info).cast())
149146
.unwrap_or(null());
150147

151148
unsafe { (self.discover)(self, ty, layer, use_bis.into(), info) }.to_result()

0 commit comments

Comments
 (0)