pv: Reuse RequestVersion and RequestMagic

Use the typedefs to make the intention and compatibility of the fields
more clear.

Signed-off-by: Marc Hartmayer <marc@linux.ibm.com>
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2026-07-07 17:34:49 +02:00
committed by Steffen Eiden
parent fb33935c9b
commit 784cff18c3

View File

@@ -3,6 +3,8 @@
// Copyright IBM Corp.
//! Request header structure for UV requests.
use pv_core::request::{RequestMagic, RequestVersion};
use zerocopy::{BigEndian, FromBytes, Immutable, IntoBytes, U32};
use crate::assert_size;
@@ -25,13 +27,13 @@ pub struct RequestHdr {
assert_size!(RequestHdr, 48);
impl RequestHdr {
pub(crate) fn new(
rqvn: u32,
pub(super) fn new(
rqvn: RequestVersion,
rql: u32,
iv: [u8; 12],
nks: u8,
sea: u32,
magic: Option<[u8; 8]>,
magic: Option<RequestMagic>,
) -> Self {
Self {
magic: magic.unwrap_or_default(),