-
-
Notifications
You must be signed in to change notification settings - Fork 25
jaguar1: restore port identity when disarming 8812 ACKs #411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -225,11 +225,11 @@ class IRtlDevice { | |
| * when unsupported or when arm/verification fails; false is not proof of | ||
| * passive state, so implementations log if rollback cannot be verified. | ||
| * Clear is a non-throwing best effort to return net_type to No Link — and, | ||
| * on a die whose engine does not consult net_type, to move the port identity | ||
| * off `mac` as well, which is the only thing that changes its behaviour | ||
| * there (see Rtl8733bDevice::disarm_ack_responder). Clear does not promise | ||
| * silence: a die that matches MACID alone answers for whatever address is | ||
| * left programmed, including the one MAC bring-up wrote. */ | ||
| * where clearing net_type does not end the measured response behavior, to | ||
| * move the port identity off `mac` as well (see the RTL8733B and | ||
| * Jaguar1/CHIP_8812 backends). Clear does not promise silence: a die that | ||
| * matches MACID alone answers for whatever address is left programmed, | ||
| * including the one MAC bring-up wrote. */ | ||
| virtual bool SetAckResponder(const devourer::MacAddr &mac) { | ||
| (void)mac; | ||
| return false; | ||
|
|
@@ -426,7 +426,9 @@ class IRtlDevice { | |
| * process does NOT silence it (bench-bitten: a killed probe's beacon kept | ||
| * airing and contaminated the next test's witness) — so any beaconing | ||
| * session that ends without a device power-cycle must call this. Idempotent; | ||
| * returns false when no beacon was active. */ | ||
| * returns false when no beacon was active or shutdown could not be verified. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This base-contract sentence now promises a verified stop, but only Jaguar1 verifies: |
||
| * A failed verified stop must be retried (or followed by hardware shutdown) | ||
| * before a shared port is reused. */ | ||
| virtual bool StopBeacon() { return false; } | ||
|
|
||
| /* Disable / restore the MAC carrier-sense gate that defers TX — both primary | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /* Jaguar1 port-0 beacon control helpers. | ||
| * | ||
| * The beacon engine is autonomous once armed. Its logical port ownership may | ||
| * therefore be released only after all three hardware stop controls read back | ||
| * inactive, irrespective of the transport write return values. */ | ||
| #ifndef DEVOURER_JAGUAR1_BEACON_PORT_H | ||
| #define DEVOURER_JAGUAR1_BEACON_PORT_H | ||
|
|
||
| #include <cstdint> | ||
|
|
||
| #include "RtlAdapter.h" | ||
|
|
||
| namespace devourer::jaguar1 { | ||
|
|
||
| struct BeaconStopResult { | ||
| bool transfers_ok = false; | ||
| bool function_off = false; | ||
| bool tx_stopped = false; | ||
| bool no_link = false; | ||
|
|
||
| bool verified() const noexcept { | ||
| return function_off && tx_stopped && no_link; | ||
| } | ||
| }; | ||
|
|
||
| inline BeaconStopResult stop_port0_beacon_verified(RtlAdapter &dev) noexcept { | ||
| auto write8 = [&dev](uint16_t reg, uint8_t value) noexcept { | ||
| try { | ||
| return dev.rtw_write8(reg, value); | ||
| } catch (...) { | ||
| return false; | ||
| } | ||
| }; | ||
| auto clear8 = [&dev](uint16_t reg, uint8_t mask) noexcept { | ||
| try { | ||
| const uint8_t value = dev.rtw_read8(reg); | ||
| return dev.rtw_write8(reg, static_cast<uint8_t>(value & ~mask)); | ||
| } catch (...) { | ||
| return false; | ||
| } | ||
| }; | ||
| auto bits_clear = [&dev](uint16_t reg, uint8_t mask) noexcept { | ||
| try { | ||
| return (dev.rtw_read8(reg) & mask) == 0; | ||
| } catch (...) { | ||
| return false; | ||
| } | ||
| }; | ||
|
|
||
| /* Keep the operations independent: a failure stopping one control must not | ||
| * suppress the attempts to stop the other two. */ | ||
| const bool function_transfer = write8(0x0550, 0x10); | ||
| const bool tx_transfer = clear8(0x0422, 0x40); | ||
| const bool link_transfer = clear8(0x0102, 0x03); | ||
|
|
||
| BeaconStopResult result; | ||
| result.transfers_ok = function_transfer && tx_transfer && link_transfer; | ||
| result.function_off = bits_clear(0x0550, 0x08); | ||
| result.tx_stopped = bits_clear(0x0422, 0x40); | ||
| result.no_link = bits_clear(0x0102, 0x03); | ||
| return result; | ||
| } | ||
|
|
||
| } // namespace devourer::jaguar1 | ||
|
|
||
| #endif // DEVOURER_JAGUAR1_BEACON_PORT_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Three different count sets now describe the same claim: this header says 0/1052 and 0/1033, the PR body says 0/997 and 0/1077, and
docs/scheduled-mac.mdpoints here as the owner of "the exact counts". They are different runs and all agree, but a caps header comment is turning into a measurement log. Keep one set here (or point at the doc that carries the table) so the next edit does not have to reconcile them.