summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2024-10-31 21:50:09 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-10-31 21:51:42 -0400
commit0a11b06d93c7593350d07e944adc00ab0e1d0108 (patch)
tree189d4f9a1a5bcef22edef6236232b0394b90d087 /apps/debug_menu.c
parentd401501fdad9a3c0299e1b8bdfadcb8a41c2eba5 (diff)
downloadrockbox-0a11b06d93c7593350d07e944adc00ab0e1d0108.tar.gz
rockbox-0a11b06d93c7593350d07e944adc00ab0e1d0108.zip
ata: Correct parsing of the logical sector size in the IDENTIFY DEVICE
....It's specified in 16-bit words, not bytes. So multiply it by 2. (This hasn't been a problem in practice as everything uses 512B logical sectors so far..) Change-Id: I0b1abd0f6184330f0b7f5c000c5ad547038f7c95
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 6f30d00d49..62750a716a 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -1442,8 +1442,8 @@ static int disk_callback(int btn, struct gui_synclist *lists)
1442 uint32_t sector_size; 1442 uint32_t sector_size;
1443 1443
1444 /* Logical sector size > 512B ? */ 1444 /* Logical sector size > 512B ? */
1445 if ((identify_info[106] & 0xd000) == 0x5000) 1445 if ((identify_info[106] & 0xd000) == 0x5000) /* B14, B12 */
1446 sector_size = identify_info[117] | (identify_info[118] << 16); 1446 sector_size = (identify_info[117] | (identify_info[118] << 16)) * 2;
1447 else 1447 else
1448 sector_size = SECTOR_SIZE; 1448 sector_size = SECTOR_SIZE;
1449 1449
@@ -1456,7 +1456,7 @@ static int disk_callback(int btn, struct gui_synclist *lists)
1456 simplelist_addline("Sector multiplier: %u", disk_get_sector_multiplier()); 1456 simplelist_addline("Sector multiplier: %u", disk_get_sector_multiplier());
1457#endif 1457#endif
1458 1458
1459 if((identify_info[106] & 0xe000) == 0x6000) 1459 if((identify_info[106] & 0xe000) == 0x6000) /* B14, B13 */
1460 sector_size *= BIT_N(identify_info[106] & 0x000f); 1460 sector_size *= BIT_N(identify_info[106] & 0x000f);
1461 simplelist_addline( 1461 simplelist_addline(
1462 "Physical sector size: %lu B", sector_size); 1462 "Physical sector size: %lu B", sector_size);