Skip to content

Conversation

@seijikun
Copy link
Contributor

When an AtaRequest fails, the drive sets status registers with information about what went wrong.
Currently, there was no way to access them. This now also returns the AtaResponse struct in the error case, so one can access response.status().

The other commit is something I would die for in hindsight.

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See the Rewriting History guide for help.
  • Update the changelog (if necessary)

@seijikun seijikun force-pushed the mr-atapassthru-lbamap branch from 9d6b65d to 9cd5238 Compare November 21, 2025 00:06
.to_result_with_val(|| AtaResponse { req })
.to_result()
};
match result {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit. I think that .map() and .map_err(). But I don't have a strong opinion on that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't work unfortunately, because both lambdas (map(..) and map_err(...)) would try to move/capture req. The match is ugly ... but it's the only way I found. :(

The AtaResponse contains status register values that help identifying what
went wrong.
@seijikun seijikun force-pushed the mr-atapassthru-lbamap branch from 9cd5238 to 3e8685f Compare November 21, 2025 13:12
@phip1611 phip1611 enabled auto-merge November 21, 2025 13:13
@phip1611 phip1611 added this pull request to the merge queue Nov 21, 2025
Merged via the queue into rust-osdev:main with commit 7a7d4ab Nov 21, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants