Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions uefi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
## Changed
- Changed ordering of `proto::pci::PciIoAddress` to (bus -> dev -> fun -> reg -> ext_reg).
- Return request with status as error data object for `proto::ata::pass_thru::AtaDevice`.
- **Breaking:** `proto::network::snp::SimpleNetwork::wait_for_packet` now
returns `Option<Event>` instead of `&Event`.

# uefi - v0.36.1 (2025-11-05)

Expand Down
4 changes: 2 additions & 2 deletions uefi/src/proto/network/snp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ impl SimpleNetwork {
/// On QEMU, this event seems to never fire; it is suggested to verify that your implementation
/// of UEFI properly implements this event before using it.
#[must_use]
pub const fn wait_for_packet(&self) -> &Event {
unsafe { &*(ptr::from_ref(&self.0.wait_for_packet).cast::<Event>()) }
pub fn wait_for_packet(&self) -> Option<Event> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you’ve streamlined this with other parts of the code, and that makes sense - thanks for that! However, I'm wondering whether this should instead return Result<Event, SomeError>. When I’m waiting for a packet, I wouldn’t expect this to return None under normal circumstances. Because of that, Id prefer using a Result`.

What do you think, @nicholasbishop ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is not waiting for a packet, it's returning an event that waits for a packet, if the underlying implementation does not support the event, the function might return None.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, got it- sorry - thanks!

unsafe { Event::from_ptr(self.0.wait_for_packet) }
}

/// Returns a reference to the Simple Network mode.
Expand Down