Skip to content

Commit 7938b87

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

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

uefi/src/proto/network/pxe.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ 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-
PxeBaseCodeDiscoverInfo, PxeBaseCodeMtftpInfo, PxeBaseCodePacket, PxeBaseCodeTftpOpcode,
18+
PxeBaseCodeDiscoverInfo, PxeBaseCodeIpFilter, PxeBaseCodeMtftpInfo, PxeBaseCodePacket,
19+
PxeBaseCodeTftpOpcode,
1920
};
2021
use uefi_raw::{Boolean, Char8};
2122

@@ -78,7 +79,8 @@ pub struct BaseCode {
7879
buffer_size: &mut usize,
7980
buffer_ptr: *mut c_void,
8081
) -> Status,
81-
set_ip_filter: unsafe extern "efiapi" fn(this: &Self, new_filter: &IpFilter) -> Status,
82+
set_ip_filter:
83+
unsafe extern "efiapi" fn(this: &Self, new_filter: *const PxeBaseCodeIpFilter) -> Status,
8284
arp: unsafe extern "efiapi" fn(
8385
this: &Self,
8486
ip_addr: *const uefi_raw::IpAddress,
@@ -534,6 +536,7 @@ impl BaseCode {
534536
/// Updates the IP receive filters of a network device and enables software
535537
/// filtering.
536538
pub fn set_ip_filter(&mut self, new_filter: &IpFilter) -> Result {
539+
let new_filter: *const PxeBaseCodeIpFilter = ptr::from_ref(new_filter).cast();
537540
unsafe { (self.set_ip_filter)(self, new_filter) }.to_result()
538541
}
539542

0 commit comments

Comments
 (0)