8000 Transparent 'Raw TRB type' by paulsohn · Pull Request #169 · rust-osdev/xhci · GitHub
[go: up one dir, main page]

Skip to content

Transparent 'Raw TRB type' #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
rename doorbell::Register to Doorbell
  • Loading branch information
paulsohn committed Dec 4, 2023
commit f2e067e6877549285c9d22a8d4e31a93fb5b406f
11 changes: 8 additions & 3 deletions src/registers/doorbell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ use accessor::array;
use accessor::Mapper;
use core::{convert::TryFrom, fmt};

/// A type alias to [`Doorbell`] register for backward compability.
#[deprecated = "Use `Doorbell` instead of `Register`."]
pub type Register = Doorbell;

/// The element of the Doorbell Array.
#[repr(transparent)]
#[derive(Copy, Clone, Default)]
pub struct Register(u32);
impl Register {
pub struct Doorbell(u32);
impl Doorbell {
/// Creates a new accessor to the Doorbell Array.
///
/// # Safety
Expand Down Expand Up @@ -44,7 +48,8 @@ impl Register {
rw_field!(0..=7, doorbell_target, "Doorbell Target", u8);
rw_field!(16..=31, doorbell_stream_id, "Doorbell Stream ID", u16);
}
impl fmt::Debug for Register {

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())
Expand Down
4 changes: 2 additions & 2 deletions src/registers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ where
/// Host Controller Capability Register
pub capability: Capability<M>,
/// Doorbell Array
pub doorbell: array::ReadWrite<doorbell::Register, M>,
pub doorbell: array::ReadWrite<doorbell::Doorbell, M>,
/// Host Controller Operational Register
pub operational: Operational<M>,
/// Port Register Set Array
Expand Down Expand Up @@ -75,7 +75,7 @@ where
/// ```
pub unsafe fn new(mmio_base: usize, mapper: M) -> Self {
let capability = Capability::new(mmio_base, &mapper);
let doorbell = doorbell::Register::new(mmio_base, &capability, mapper.clone());
let doorbell = doorbell::Doorbell::new(mmio_base, &capability, mapper.clone());
let operational =
Operational::new(mmio_base, capability.caplength.read_volatile(), &mapper);
let port_register_set = PortRegisterSet::new(mmio_base, &capability, mapper.clone());
Expand Down
0