Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# lsi-flash

[![CI](https://github.com/MattJackson/lsi-flash/actions/workflows/ci.yml/badge.svg)](https://github.com/MattJackson/lsi-flash/actions/workflows/ci.yml)
[![Release](https://img.shields.io/github/v/release/MattJackson/lsi-flash?display_name=tag&sort=semver)](https://github.com/MattJackson/lsi-flash/releases)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
[![Rust: 1.74+](https://img.shields.io/badge/rust-1.74%2B-orange.svg)](https://www.rust-lang.org)
[![MSRV](https://img.shields.io/badge/MSRV-1.74-blue.svg)](https://www.rust-lang.org)
[![Status: pre-release](https://img.shields.io/badge/status-pre--release-yellow.svg)](#status)

> One Linux-native static binary for cross-flashing LSI SAS2008-based HBAs between IT, IR, and OEM identities. Replaces a fragile pile of DOS tools, Python scripts, and abandonware.
Expand Down Expand Up @@ -212,6 +213,10 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). Hardware-compatibility reports (good or

If you find a bug that could brick a card, please report it privately first — see [SECURITY.md](SECURITY.md).

## Changelog

See [CHANGELOG.md](CHANGELOG.md). This project follows [Keep a Changelog](https://keepachangelog.com/) and [Semantic Versioning](https://semver.org/).

## License

[MIT](LICENSE). Firmware files in the companion `lsi-flash-firmware` repo retain their original Broadcom proprietary license; that repo's `LICENSE.md` explains the fair-use preservation rationale.
Expand Down
32 changes: 14 additions & 18 deletions src/mpi/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,24 +168,20 @@ impl<B: IocBackend> Session<B> {
payload_buffer: &mut upload_data,
};

match self.backend.send_fw_upload(&mut upload_req_concrete) {
Ok(reply) => {
if reply.ioc_status.is_flash_hard_stop() {
return Err(MpiError::IocStatus(reply.ioc_status));
}

// Verify byte-for-byte match
if upload_data != data {
let mismatch = data
.iter()
.zip(upload_data.iter())
.position(|(a, b)| a != b);
return Err(MpiError::VerifyMismatch {
offset: mismatch.unwrap_or(0),
});
}
}
Err(e) => return Err(e),
let reply = self.backend.send_fw_upload(&mut upload_req_concrete)?;
if reply.ioc_status.is_flash_hard_stop() {
return Err(MpiError::IocStatus(reply.ioc_status));
}

// Verify byte-for-byte match
if upload_data != data {
let mismatch = data
.iter()
.zip(upload_data.iter())
.position(|(a, b)| a != b);
return Err(MpiError::VerifyMismatch {
offset: mismatch.unwrap_or(0),
});
}

Ok(())
Expand Down
Loading