diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/gsp/commands.rs index e81a865050e0..ac9cef312b10 100644 --- a/drivers/gpu/nova-core/gsp/commands.rs +++ b/drivers/gpu/nova-core/gsp/commands.rs @@ -1,4 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. use core::{ array, @@ -26,7 +27,7 @@ NoReply, // }, fw::{ - commands::*, + self, MsgFunction, // }, }, @@ -47,12 +48,12 @@ pub(crate) fn new(pdev: &'a pci::Device) -> Self { impl<'a> CommandToGsp for SetSystemInfo<'a> { const FUNCTION: MsgFunction = MsgFunction::GspSetSystemInfo; - type Command = GspSetSystemInfo; + type Command = fw::commands::GspSetSystemInfo; type Reply = NoReply; type InitError = Error; fn init(&self) -> impl Init { - GspSetSystemInfo::init(self.pdev) + Self::Command::init(self.pdev) } } @@ -99,12 +100,12 @@ pub(crate) fn new() -> Self { impl CommandToGsp for SetRegistry { const FUNCTION: MsgFunction = MsgFunction::SetRegistry; - type Command = PackedRegistryTable; + type Command = fw::commands::PackedRegistryTable; type Reply = NoReply; type InitError = Infallible; fn init(&self) -> impl Init { - PackedRegistryTable::init(Self::NUM_ENTRIES as u32, self.variable_payload_len() as u32) + Self::Command::init(Self::NUM_ENTRIES as u32, self.variable_payload_len() as u32) } fn variable_payload_len(&self) -> usize { @@ -112,22 +113,22 @@ fn variable_payload_len(&self) -> usize { for i in 0..Self::NUM_ENTRIES { key_size += self.entries[i].key.len() + 1; // +1 for NULL terminator } - Self::NUM_ENTRIES * size_of::() + key_size + Self::NUM_ENTRIES * size_of::() + key_size } fn init_variable_payload( &self, dst: &mut SBufferIter>, ) -> Result { - let string_data_start_offset = - size_of::() + Self::NUM_ENTRIES * size_of::(); + let string_data_start_offset = size_of::() + + Self::NUM_ENTRIES * size_of::(); // Array for string data. let mut string_data = KVec::new(); for entry in self.entries.iter().take(Self::NUM_ENTRIES) { dst.write_all( - PackedRegistryEntry::new( + fw::commands::PackedRegistryEntry::new( (string_data_start_offset + string_data.len()) as u32, entry.value, ) @@ -179,12 +180,12 @@ pub(crate) fn wait_gsp_init_done(cmdq: &Cmdq) -> Result { impl CommandToGsp for GetGspStaticInfo { const FUNCTION: MsgFunction = MsgFunction::GetGspStaticInfo; - type Command = GspStaticConfigInfo; + type Command = fw::commands::GspStaticConfigInfo; type Reply = GetGspStaticInfoReply; type InitError = Infallible; fn init(&self) -> impl Init { - GspStaticConfigInfo::init_zeroed() + Self::Command::init_zeroed() } } @@ -195,7 +196,7 @@ pub(crate) struct GetGspStaticInfoReply { impl MessageFromGsp for GetGspStaticInfoReply { const FUNCTION: MsgFunction = MsgFunction::GetGspStaticInfo; - type Message = GspStaticConfigInfo; + type Message = fw::commands::GspStaticConfigInfo; type InitError = Infallible; fn read(