aboutsummaryrefslogtreecommitdiff
path: root/rust/qemu-api-macros/src
diff options
context:
space:
mode:
authorAndrew Yuan <andrew.yuan@jaguarmicro.com>2025-02-07 16:09:20 +0000
committerPeter Maydell <peter.maydell@linaro.org>2025-02-07 16:09:20 +0000
commit76723b8ed7b8274a4e30cdf0a9f3e7c47ebe251a (patch)
treed5d36f30b89bdf564f253d2527bc011bcd97f7fe /rust/qemu-api-macros/src
parent3272ddee8caf65f31c131dfca2cf1c133edd745c (diff)
downloadqemu-76723b8ed7b8274a4e30cdf0a9f3e7c47ebe251a.zip
qemu-76723b8ed7b8274a4e30cdf0a9f3e7c47ebe251a.tar.gz
qemu-76723b8ed7b8274a4e30cdf0a9f3e7c47ebe251a.tar.bz2
hw/net/cadence_gem: Fix the mask/compare/disable-mask logic
Our current handling of the mask/compare logic in the Cadence GEM ethernet device is wrong: (1) we load the same byte twice from rx_buf when creating the compare value (2) we ignore the DISABLE_MASK flag The "Cadence IP for Gigabit Ethernet MAC Part Number: IP7014 IP Rev: R1p12 - Doc Rev: 1.3 User Guide" states that if the DISABLE_MASK bit in type2_compare_x_word_1 is set, the mask_value field in type2_compare_x_word_0 is used as an additional 2 byte Compare Value. Correct these bugs: * in the !disable_mask codepath, use lduw_le_p() so we correctly load a 16-bit value for comparison * in the disable_mask codepath, we load a full 4-byte value from rx_buf for the comparison, set the compare value to the whole of the cr0 register (i.e. the concatenation of the mask and compare fields), and set mask to 0xffffffff to force a 32-bit comparison Signed-off-by: Andrew Yuan <andrew.yuan@jaguarmicro.com> Message-id: 20241219061658.805-1-andrew.yuan@jaguarmicro.com Suggested-by: Philippe Mathieu-Daudé <philmd@linaro.org> [PMM: Expand commit message and comment] Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'rust/qemu-api-macros/src')
0 files changed, 0 insertions, 0 deletions