Skip to content

Commit 2e7f99e

Browse files
committed
uefi: Add special broadcast nvme namespace
1 parent 593ec6b commit 2e7f99e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

uefi/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- Added `proto::shell::Shell::{var(), set_var(), vars()}`
66
- Added `proto::pci::root_bridge::PciRootBridgeIo::configuration()`.
77
- Added `proto::pci::root_bridge::PciRootBridgeIo::enumerate()`.
8+
- Added `proto::nvme::pass_thru::NvmePassThru::broadcast()`.
89

910
## Changed
1011
- Changed ordering of `proto::pci::PciIoAddress` to (bus -> dev -> fun -> reg -> ext_reg).

uefi/src/proto/nvme/pass_thru.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,26 @@ impl NvmePassThru {
101101
/// This can be used to send ADMIN commands.
102102
///
103103
/// # Returns
104-
/// A [`NvmeNamespaceIterator`] for iterating through the namespaces.
104+
/// A [`NvmeNamespace`] addressing the controller (nsid = 0).
105105
#[must_use]
106106
pub const fn controller(&self) -> NvmeNamespace<'_> {
107107
NvmeNamespace {
108108
proto: &self.0,
109109
namespace_id: 0,
110110
}
111111
}
112+
113+
/// Get the broadcast namespace (id = 0xffffffff).
114+
///
115+
/// # Returns
116+
/// A [`NvmeNamespace`] with nsid = 0xffffffff.
117+
#[must_use]
118+
pub const fn broadcast(&self) -> NvmeNamespace<'_> {
119+
NvmeNamespace {
120+
proto: &self.0,
121+
namespace_id: 0xffffffff,
122+
}
123+
}
112124
}
113125

114126
/// Represents one namespace on an NVMe controller.

0 commit comments

Comments
 (0)