Skip to content

Commit

Permalink
Bump gateway-messages
Browse files Browse the repository at this point in the history
This is a dependency for some upcoming work
  • Loading branch information
labbott committed May 1, 2024
1 parent d901636 commit 3ab4c7a
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 44 deletions.
72 changes: 36 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ foreign-types = "0.3.2"
fs-err = "2.11.0"
futures = "0.3.30"
gateway-client = { path = "clients/gateway-client" }
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "2739c18e80697aa6bc235c935176d14b4d757ee9", default-features = false, features = ["std"] }
gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "2739c18e80697aa6bc235c935176d14b4d757ee9" }
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "c85a4ca043aaa389df12aac5348d8a3feda28762", default-features = false, features = ["std"] }
gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "c85a4ca043aaa389df12aac5348d8a3feda28762" }
gateway-test-utils = { path = "gateway-test-utils" }
gethostname = "0.4.3"
glob = "0.3.1"
Expand Down
7 changes: 5 additions & 2 deletions gateway/src/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ pub struct SpState {
pub hubris_archive_id: String,
pub base_mac_address: [u8; 6],
pub power_state: PowerState,
pub rot: RotState,
// SpStateV3 of gateway-messages decoupled RoT state
pub rot: Option<RotState>,
}

#[derive(
Expand Down Expand Up @@ -1044,7 +1045,9 @@ async fn sp_component_reset(
let component = component_from_str(&component)?;

sp.reset_component_prepare(component)
.and_then(|()| sp.reset_component_trigger(component))
// We always want to run with the watchdog when resetting as
// disabling the watchdog should be considered a debug only feature
.and_then(|()| sp.reset_component_trigger(component, false))
.await
.map_err(|err| SpCommsError::SpCommunicationFailed {
sp: sp_id,
Expand Down
19 changes: 17 additions & 2 deletions gateway/src/http_entrypoints/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl From<gateway_messages::SpStateV1> for SpState {
hubris_archive_id: hex::encode(state.hubris_archive_id),
base_mac_address: state.base_mac_address,
power_state: PowerState::from(state.power_state),
rot: RotState::from(state.rot),
rot: Some(RotState::from(state.rot)),
}
}
}
Expand All @@ -166,7 +166,21 @@ impl From<gateway_messages::SpStateV2> for SpState {
hubris_archive_id: hex::encode(state.hubris_archive_id),
base_mac_address: state.base_mac_address,
power_state: PowerState::from(state.power_state),
rot: RotState::from(state.rot),
rot: Some(RotState::from(state.rot)),
}
}
}

impl From<gateway_messages::SpStateV3> for SpState {
fn from(state: gateway_messages::SpStateV3) -> Self {
Self {
serial_number: stringify_byte_string(&state.serial_number),
model: stringify_byte_string(&state.model),
revision: state.revision,
hubris_archive_id: hex::encode(state.hubris_archive_id),
base_mac_address: state.base_mac_address,
power_state: PowerState::from(state.power_state),
rot: None,
}
}
}
Expand All @@ -176,6 +190,7 @@ impl From<gateway_sp_comms::VersionedSpState> for SpState {
match value {
gateway_sp_comms::VersionedSpState::V1(s) => Self::from(s),
gateway_sp_comms::VersionedSpState::V2(s) => Self::from(s),
gateway_sp_comms::VersionedSpState::V3(s) => Self::from(s),
}
}
}
Expand Down
38 changes: 38 additions & 0 deletions sp-sim/src/gimlet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use gateway_messages::sp_impl::{BoundsChecked, DeviceDescription};
use gateway_messages::CfpaPage;
use gateway_messages::ComponentAction;
use gateway_messages::Header;
use gateway_messages::RotBootInfo;
use gateway_messages::RotRequest;
use gateway_messages::RotResponse;
use gateway_messages::RotSlotId;
Expand Down Expand Up @@ -1445,6 +1446,43 @@ impl SpHandler for Handler {
buf[dummy_page.len()..].fill(0);
Ok(RotResponse::Ok)
}

fn vpd_lock_status_all(
&mut self,
_buf: &mut [u8],
) -> Result<usize, SpError> {
Err(SpError::RequestUnsupportedForSp)
}

fn reset_component_trigger_with_watchdog(
&mut self,
_component: SpComponent,
_time_ms: u32,
) -> Result<(), SpError> {
Err(SpError::RequestUnsupportedForSp)
}

fn disable_component_watchdog(
&mut self,
_component: SpComponent,
) -> Result<(), SpError> {
Err(SpError::RequestUnsupportedForSp)
}
fn component_watchdog_supported(
&mut self,
_component: SpComponent,
) -> Result<(), SpError> {
Err(SpError::RequestUnsupportedForSp)
}

fn versioned_rot_boot_info(
&mut self,
_sender: SocketAddrV6,
_port: SpPort,
_version: u8,
) -> Result<RotBootInfo, SpError> {
Err(SpError::RequestUnsupportedForSp)
}
}

impl SimSpHandler for Handler {
Expand Down

0 comments on commit 3ab4c7a

Please sign in to comment.