Skip to content

asus->mediatek rename#319

Merged
superg merged 2 commits intomainfrom
mediatek_rename
Dec 14, 2025
Merged

asus->mediatek rename#319
superg merged 2 commits intomainfrom
mediatek_rename

Conversation

@superg
Copy link
Owner

@superg superg commented Dec 14, 2025

Summary by CodeRabbit

  • Refactor

    • Drive type identifiers and compatibility detection renamed to MTK/Mediatek variants for consistency.
    • Cache handling and dump/print paths standardized to Mediatek naming across the app.
    • Leadout handling path switched to Mediatek-specific processing.
  • Chores

    • Command-line options renamed from --asus-* to --mediatek-* (help text updated).

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 14, 2025

Walkthrough

Renames and rebrands ASUS/LG-specific types, functions, constants, enums, command-line options, and debug outputs to MEDIATEK/MTK equivalents across multiple modules, preserving behavior while updating names and related dispatch paths.

Changes

Cohort / File(s) Summary
Leadout processing
cd/cd_dump_extra.ixx
Renamed asus_process_leadoutmediatek_process_leadout; ASUS_LEADOUT_DISCARD_COUNTMEDIATEK_LEADOUT_DISCARD_COUNT; updated dispatch to use mediatek leadout path.
Comment updates
cd/toc.ixx
Removed parenthetical "(LG/ASUS for instance)" from two comment blocks; no logic changes.
Debug output & cache dump
debug.ixx
Replaced ASUS references with MEDIATEK: asus_cache_readmediatek_cache_read, asus_cache_print_subqmediatek_cache_print_subq, asus_leadout_buffermediatek_leadout_buffer; output filenames changed from .asus.* to .mediatek.*.
Drive cache/config module
drive/mediatek.ixx
Renamed AsusConfigMediatekConfig, ASUS_CACHE_ENTRY_SIZEMEDIATEK_CACHE_ENTRY_SIZE, ASUS_CACHE_CONFIGMEDIATEK_CACHE_CONFIG; renamed public functions and predicates (asus_get_configmediatek_get_config, drive_is_asusdrive_is_mediatek, asus_cache_*mediatek_cache_*, asus_find_cache_sizemediatek_find_cache_size) and updated internal references.
Drive type enum & DB
drive.ixx
Replaced LG_ASU8A/B/C, LG_ASU3, LG_ASU2 enum members with MTK8A/B/C, MTK3, MTK2; updated string mapping and DRIVE_DATABASE entries to MTK variants.
Tests
drive/test.ixx
Updated test calls to mediatek_cache_read and mediatek_find_cache_size; renamed local flag to mt_cache_read and adjusted log usage.
Options / CLI
options.ixx
Removed asus_skip_leadout / asus_leadout_retries; added mediatek_skip_leadout / mediatek_leadout_retries; switched CLI flags from --asus-* to --mediatek-* and updated help text and initializers.
SCSI command layer
scsi/cmd.ixx
Renamed exported cmd_asus_read_cachecmd_mediatek_read_cache; CDB type switched to CDB10_MEDIATEK_ReadCache; added explicit return of SPTD::Status.
SCSI MMC definitions
scsi/mmc.ixx
Renamed enum member ASUS_READ_CACHEMEDIATEK_READ_CACHE (value 0xF1); CDB10_ASUS_ReadCacheCDB10_MEDIATEK_ReadCache (same layout).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

  • Areas to focus on:
    • scsi/cmd.ixx: confirm callers expect and handle the returned SPTD::Status.
    • options.ixx: check initialization and any serialization/deserialization of Options for removed/added fields.
    • drive/mediatek.ixx and drive.ixx: ensure enum/name changes are consistently referenced across modules.
    • debug and cd modules: verify file-name and buffer renames didn't miss any artifact or logging references.

Poem

🐰 I hopped through names and constants fine,
From ASUS lanes to MEDIATEK line,
I nudged the cache and changed the view,
A little rename, but functions true.
Thump-thump! — a rabbit's refactor rhyme.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'asus->mediatek rename' accurately describes the primary change: a systematic renaming of ASUS-related identifiers and functions to MEDIATEK equivalents throughout the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mediatek_rename

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 859bf0b and 90e4f65.

📒 Files selected for processing (4)
  • debug.ixx (1 hunks)
  • drive.ixx (3 hunks)
  • drive/mediatek.ixx (7 hunks)
  • options.ixx (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • options.ixx
  • debug.ixx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-06T17:20:03.237Z
Learnt from: superg
Repo: superg/redumper PR: 307
File: drive/flash_sd616.ixx:26-27
Timestamp: 2025-12-06T17:20:03.237Z
Learning: In drive/flash_sd616.ixx, the SD-616T model is intentionally excluded from the automatic support guard (only SD-616F is explicitly allowed) because SD-616T support is untested. Users must use --force-flash to flash SD-616T drives until testing confirms it works properly.

Applied to files:

  • drive.ixx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: build-windows (x86, Win32)
  • GitHub Check: build-linux (arm64, ubuntu-24.04-arm)
  • GitHub Check: build-macos (x64)
  • GitHub Check: build-windows (x64, x64)
  • GitHub Check: build-linux (x86, ubuntu-24.04)
  • GitHub Check: build-linux (x64, ubuntu-24.04)
  • GitHub Check: build-windows (arm64, ARM64)
  • GitHub Check: build-macos (arm64)
🔇 Additional comments (9)
drive/mediatek.ixx (6)

22-45: LGTM! Clean rename of configuration structures.

The rename from AsusConfig to MediatekConfig and ASUS_CACHE_* to MEDIATEK_CACHE_* is consistent and preserves all functionality. The enum value updates (e.g., LG_ASU8AMTK8A) align with the PR's rebranding objective.


48-57: LGTM! Function rename is correct.

The function mediatek_get_config correctly returns MediatekConfig and uses the renamed MEDIATEK_CACHE_CONFIG map. Internal variable naming is consistent.


60-63: LGTM! Function rename is consistent.

The rename from drive_is_asus to drive_is_mediatek is straightforward and correct.


87-209: LGTM! Cache extraction and printing functions renamed correctly.

Both mediatek_cache_extract and mediatek_cache_print_subq use the updated naming consistently (mediatek_get_config, MEDIATEK_CACHE_ENTRY_SIZE). The logic remains unchanged.


212-233: LGTM! Cache size finder renamed correctly.

The rename from asus_find_cache_size to mediatek_find_cache_size is clean and preserves functionality.


66-84: Function cmd_mediatek_read_cache is properly defined.

The function exists in scsi/cmd.ixx:437 and is correctly called at line 75. The rename from the old cmd_asus_read_cache has been completed successfully with no stale references remaining.

drive.ixx (3)

58-67: LGTM! Enum values renamed consistently.

The rename from LG_ASU* to MTK* is clean and aligns with the Mediatek rebranding. The new names are more concise and clear.


93-101: LGTM! String mappings updated correctly.

The TYPE_STRING map entries are updated to match the renamed enum values. All MTK* types have proper string representations.


146-171: All enum and function references have been successfully updated across the codebase.

Verification confirms the refactoring is complete:

  • No remaining references to old LG_ASU* enum values or asus_* functions
  • New MTK* enum values (MTK2, MTK3, MTK8A, MTK8B, MTK8C) properly defined in drive.ixx lines 62-66
  • MEDIATEK cache configuration map and all related functions (mediatek_get_config, mediatek_cache_read) implemented in drive/mediatek.ixx
  • All 25 DRIVE_DATABASE entries (lines 146-171) correctly use the new enum values
  • Implementation usage verified across multiple files: debug.ixx, drive/test.ixx, scsi/cmd.ixx, cd/cd_dump_extra.ixx
  • Documentation updated in options.ixx and README.md
  • Comment updated to "MEDIATEK" at line 146

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
drive/mediatek.ixx (1)

39-45: Consider renaming LG_ASU* type values for full consistency.

The Type enum values (LG_ASU8A, LG_ASU8B, LG_ASU8C, LG_ASU3, LG_ASU2) still contain "ASU" (ASUS) references. For complete rebranding consistency, these could be renamed to something like LG_MTK* or similar MediaTek-oriented naming.

If these are intentionally preserved for backward compatibility with configuration files or external APIs, this is acceptable.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b920528 and 859bf0b.

📒 Files selected for processing (8)
  • cd/cd_dump_extra.ixx (6 hunks)
  • cd/toc.ixx (2 hunks)
  • debug.ixx (1 hunks)
  • drive/mediatek.ixx (8 hunks)
  • drive/test.ixx (1 hunks)
  • options.ixx (4 hunks)
  • scsi/cmd.ixx (1 hunks)
  • scsi/mmc.ixx (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-09-07T20:29:35.084Z
Learnt from: superg
Repo: superg/redumper PR: 283
File: scsi/mmc.ixx:853-862
Timestamp: 2025-09-07T20:29:35.084Z
Learning: In scsi/mmc.ixx, the maintainer only adds pragma pack directives to structures when needed, not preemptively. They verify struct layouts work correctly through actual hardware testing rather than relying solely on static assertions.

Applied to files:

  • scsi/mmc.ixx
📚 Learning: 2025-09-07T19:05:32.220Z
Learnt from: superg
Repo: superg/redumper PR: 283
File: scsi/cmd.ixx:558-571
Timestamp: 2025-09-07T19:05:32.220Z
Learning: In the scsi/cmd.ixx file, there are multiple functions that use pointer-byte indexing for endianness conversion that could be prone to endianness issues. The maintainer prefers to address these systematically in a centralized manner rather than piecemeal fixes.

Applied to files:

  • scsi/mmc.ixx
  • scsi/cmd.ixx
📚 Learning: 2025-11-28T01:02:39.542Z
Learnt from: superg
Repo: superg/redumper PR: 302
File: dvd/dvd_dump.ixx:395-405
Timestamp: 2025-11-28T01:02:39.542Z
Learning: In dvd/dvd_dump.ixx, the sector count determination logic (around lines 641-647) is intentionally centralized to support multiple sources: READ_CAPACITY, physical structures, and future options like ISO/UDF filesystem size. For Xbox/Kreon XGD discs, the physical structure sector count is correct to use because xbox::initialize() updates the layer0_ld.layer0_end_sector with the true value from the security sector before sectors_count_physical is calculated.

Applied to files:

  • cd/toc.ixx
  • cd/cd_dump_extra.ixx
📚 Learning: 2025-12-06T17:38:03.925Z
Learnt from: superg
Repo: superg/redumper PR: 307
File: drive/flash_plextor.ixx:0-0
Timestamp: 2025-12-06T17:38:03.925Z
Learning: In drive/flash_plextor.ixx, the default block size of 0x1000 (from PLEXTOR_SUPPORTED_DRIVES.begin()->second) is intentionally used as a safe fallback when force_flash is enabled and the drive product_id is not found in the supported drives map. This default is considered safe enough for force-flash use with Plextor drives.

Applied to files:

  • options.ixx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: build-windows (arm64, ARM64)
  • GitHub Check: build-linux (x86, ubuntu-24.04)
  • GitHub Check: build-windows (x64, x64)
  • GitHub Check: build-windows (x86, Win32)
  • GitHub Check: build-linux (x64, ubuntu-24.04)
  • GitHub Check: build-linux (arm64, ubuntu-24.04-arm)
  • GitHub Check: build-macos (x64)
  • GitHub Check: build-macos (arm64)
🔇 Additional comments (21)
cd/toc.ixx (2)

160-165: LGTM!

Comment cleanup removing vendor-specific references aligns with the broader Mediatek terminology standardization in this PR.


223-227: LGTM!

Consistent comment cleanup matching the change at line 160.

drive/test.ixx (1)

348-367: LGTM!

The local variable rename from mediatek_cache_read to mt_cache_read correctly avoids shadowing the imported mediatek_cache_read function. Function calls and log messages consistently use Mediatek terminology.

scsi/mmc.ixx (2)

31-31: LGTM!

Enum member rename maintains the same value (0xF1), preserving compatibility.


645-652: LGTM!

Struct rename preserves the field layout and packing, ensuring binary compatibility.

options.ixx (4)

62-63: LGTM!

Struct fields properly renamed to mediatek_* variants.


106-107: LGTM!

Default values preserved (false and 32 respectively) matching the previous ASUS defaults.


259-262: Breaking CLI change: renamed options.

The --asus-skip-leadout and --asus-leadout-retries CLI options are being renamed to --mediatek-skip-leadout and --mediatek-leadout-retries. Existing scripts or documentation referencing the old option names will need to be updated.


405-406: LGTM!

Help text correctly documents the renamed options with preserved default value display.

cd/cd_dump_extra.ixx (5)

36-36: LGTM!

Constant renamed while preserving the value (2).


222-222: LGTM!

Function rename from asus_process_leadout to mediatek_process_leadout aligns with the broader terminology shift.


231-249: LGTM!

Option access updated to options.mediatek_leadout_retries, and all function calls (mediatek_cache_read, mediatek_get_config, mediatek_cache_extract) correctly use the new Mediatek-prefixed APIs. Log messages consistently reference MEDIATEK.


257-268: LGTM!

Cache extraction and log messages consistently use Mediatek terminology.


332-336: LGTM!

Drive type check using drive_is_mediatek and option access via options.mediatek_skip_leadout are consistent with the renamed function and options.

scsi/cmd.ixx (1)

437-446: LGTM! Clean rename from ASUS to MediaTek.

The function rename is consistent with the PR's rebranding objective. The CDB type and operation code are updated consistently. The function correctly propagates the sendCommand return value.

debug.ixx (1)

297-334: LGTM! Consistent MediaTek renaming in debug code.

All function calls, variable names, and output file suffixes are correctly updated to reflect the MediaTek rebranding. The logic remains unchanged.

drive/mediatek.ixx (5)

22-57: LGTM! Struct and config renames are consistent.

The MediatekConfig struct, MEDIATEK_CACHE_ENTRY_SIZE constant, and MEDIATEK_CACHE_CONFIG map are all properly renamed. The mediatek_get_config function correctly uses the new naming convention.


60-63: LGTM! drive_is_mediatek correctly replaces drive_is_asus.

The function rename is appropriate and the implementation correctly references the renamed config map.


66-84: LGTM! mediatek_cache_read function properly renamed.

The function correctly calls cmd_mediatek_read_cache and maintains the same logic.


87-191: LGTM! mediatek_cache_extract function properly renamed with consistent internal references.

All internal uses of MEDIATEK_CACHE_ENTRY_SIZE and mediatek_get_config are correct. The extraction logic is unchanged.


194-233: LGTM! mediatek_cache_print_subq and mediatek_find_cache_size functions properly renamed.

Both functions consistently use the new MediaTek naming conventions.

@superg superg merged commit c4d9c90 into main Dec 14, 2025
11 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jan 24, 2026
@superg superg deleted the mediatek_rename branch February 28, 2026 15:27
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.

1 participant