From b982941e5b01a8fd067ec5a8f084d4552d8a5943 Mon Sep 17 00:00:00 2001 From: Hiroki Tokunaga Date: Tue, 5 Dec 2023 09:48:16 +0900 Subject: [PATCH 1/2] Forgot to add a changelog for #167 (#168) --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c40ff98..47b5d73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog ## Unreleased - ReleaseDate +### Changed +- `registers::Capability` now has read-only accessors instead of read-write ones. ([#167]) +- `registers::doorbell::Register` is renamed to `registers::doorbell::Doorbell`. The former still exists, but is deprecated now. ([#167]) + +### Deprecated +- `registers::doorbell::Register` in favor of `registers::doorbell::Doorbell`. ([#167]) ## 0.9.2 - 2023-07-19 ### Added @@ -194,3 +200,5 @@ ## 0.1.0 - 2021-01-22 ### Added - Initial version. + +[#167]: https://github.com/rust-osdev/xhci/pull/167 \ No newline at end of file From ae72434dac454881ace4dd34a974a17566165d82 Mon Sep 17 00:00:00 2001 From: Taeseung Sohn Date: Sun, 10 Dec 2023 11:50:24 +0900 Subject: [PATCH 2/2] A little more `Doorbell` renaming (#170) --- src/registers/doorbell.rs | 14 +++++--------- src/registers/mod.rs | 3 ++- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/registers/doorbell.rs b/src/registers/doorbell.rs index 0406013..a162f06 100644 --- a/src/registers/doorbell.rs +++ b/src/registers/doorbell.rs @@ -3,7 +3,7 @@ use super::capability::Capability; use accessor::array; use accessor::Mapper; -use core::{convert::TryFrom, fmt}; +use core::convert::TryFrom; /// A type alias to [`Doorbell`] register for backward compability. #[deprecated = "Use `Doorbell` instead of `Register`."] @@ -48,11 +48,7 @@ impl Doorbell { rw_field!(0..=7, doorbell_target, "Doorbell Target", u8); rw_field!(16..=31, doorbell_stream_id, "Doorbell Stream ID", u16); } -impl fmt::Debug for Doorbell { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("doorbell::Register") - .field("doorbell_target", &self.doorbell_target()) - .field("doorbell_stream_id", &self.doorbell_stream_id()) - .finish() - } -} +impl_debug_from_methods!(Doorbell { + doorbell_target, + doorbell_stream_id, +}); diff --git a/src/registers/mod.rs b/src/registers/mod.rs index a34472c..b192dbd 100644 --- a/src/registers/mod.rs +++ b/src/registers/mod.rs @@ -4,6 +4,7 @@ use accessor::array; use accessor::Mapper; pub use capability::Capability; +pub use doorbell::Doorbell; pub use operational::{Operational, PortRegisterSet}; pub use runtime::InterrupterRegisterSet; pub use runtime::Runtime; @@ -22,7 +23,7 @@ where /// Host Controller Capability Register pub capability: Capability, /// Doorbell Array - pub doorbell: array::ReadWrite, + pub doorbell: array::ReadWrite, /// Host Controller Operational Register pub operational: Operational, /// Port Register Set Array