[PATCH 1/2] Add defines for ext_csd field MAX_ENH_SIZE_MULT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Oliver Metz <oliver@xxxxxxxxxx>
---
 mmc.h      | 3 +++
 mmc_cmds.c | 6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/mmc.h b/mmc.h
index a345c1d..ac82446 100644
--- a/mmc.h
+++ b/mmc.h
@@ -52,6 +52,9 @@
 #define EXT_CSD_BKOPS_EN		163	/* R/W */
 #define EXT_CSD_RST_N_FUNCTION		162	/* R/W */
 #define EXT_CSD_PARTITIONING_SUPPORT	160	/* RO */
+#define EXT_CSD_MAX_ENH_SIZE_MULT_2	159
+#define EXT_CSD_MAX_ENH_SIZE_MULT_1	158
+#define EXT_CSD_MAX_ENH_SIZE_MULT_0	157
 #define EXT_CSD_PARTITIONS_ATTRIBUTE	156	/* R/W */
 #define EXT_CSD_PARTITION_SETTING_COMPLETED	155	/* R/W */
 #define EXT_CSD_ENH_SIZE_MULT_2		142
diff --git a/mmc_cmds.c b/mmc_cmds.c
index 867a88d..f3f6c03 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -1005,8 +1005,10 @@ int do_read_extcsd(int nargs, char **argv)
 		else
 			printf(" Device cannot have enhanced tech.\n");
 
-		reg = (ext_csd[159] << 16) | (ext_csd[158] << 8) |
-			ext_csd[157];
+		reg = (ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT_2] << 16) |
+			(ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT_1] << 8) |
+			ext_csd[EXT_CSD_MAX_ENH_SIZE_MULT_0];
+
 		printf("Max Enhanced Area Size [MAX_ENH_SIZE_MULT]: 0x%06x\n",
 			   reg);
 		unsigned int wp_sz = get_hc_wp_grp_size(ext_csd);
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux