mmc-utils: add SanDisk to manufacturer database
PATCH 1/3 mmc-utils: add SanDisk to manufacturer database
--- lsmmc.c | 5 +++++ 1 file changed, 5 insertions(+)
lsmmc.c +5 -0
@@ -239,6 +239,11 @@ struct ids_database database[] = { .id = 0x44, .manufacturer = "ATP", }, + { + .type = "mmc", + .id = 0x45, + .manufacturer = "SanDisk Corporation", + }, { .type = "mmc", .id = 0x2c,
Signature · 1 line
2.39.2
PATCH 2/3 mmc-utils: fix printing OID for mmc in non-verbose mode
It is parsed as an integer and printed as a char which does not really make sense.
E.g. if OID is '0' (which does not seem to be uncommon), then this prints a '\0' character and makes output nearly unreadable/unparsable.
Also, do not print it like it would be a string, instead use 0x<digit> format.
--- lsmmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lsmmc.c +2 -2
@@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)printf ("\tCRC: 0x%02x\n" , crc); }else {if (config->mmc_ids[mid]) -printf ("manufacturer: '%s' '%c'\n" , +printf ("manufacturer: '%s' 0x%01x\n" , config->mmc_ids[mid], oid);else -printf ("manufacturer: 'Unlisted' '%c'\n" , oid); +printf ("manufacturer: 'Unlisted' 0x%01x\n" , oid);printf ("product: '%s' %u.%u\n" , pnm, prv_major, prv_minor);printf ("serial: 0x%08x\n" , psn);
Signature · 1 line
2.39.2
RE: [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode
Quoted 10 lines
It is parsed as an integer and printed as a char which does not really make sense.
E.g. if OID is '0' (which does not seem to be uncommon), then this prints a '\0' character and makes output nearly unreadable/unparsable.Also, do not print it like it would be a string, instead use 0x<digit> format.
Signed-off-by Enrico Jorns <[email protected]>
Quoted 23 lines
--- lsmmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lsmmc.c +2
-3@@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)printf ("\tCRC: 0x%02x\n" , crc); }else {if (config->mmc_ids[mid]) -printf ("manufacturer: '%s' '%c'\n" , +printf ("manufacturer: '%s' 0x%01x\n" , config->mmc_ids[mid], oid);else -printf ("manufacturer: 'Unlisted' '%c'\n" , oid); +printf ("manufacturer: 'Unlisted' 0x%01x\n" , oid);printf ("product: '%s' %u.%u\n" , pnm, prv_major, prv_minor);printf ("serial: 0x%08x\n" , psn); --2.39.2
Ulf Hansson
AppliedRe: [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode
In reply to Enrico JornsQuoted 10 lines · Enrico Jorns
It is parsed as an integer and printed as a char which does not really make sense.
E.g. if OID is '0' (which does not seem to be uncommon), then this prints a '\0' character and makes output nearly unreadable/unparsable.Also, do not print it like it would be a string, instead use 0x<digit> format.
Signed-off-by Enrico Jorns <[email protected]>
Applied to git.kernel.org/pub/scm/utils/mmc/mmc-utils.git master, thanks!
Kind regards
Uffe
Quoted 24 lines
--- lsmmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)lsmmc.c +2
-3@@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)printf ("\tCRC: 0x%02x\n" , crc); }else {if (config->mmc_ids[mid]) -printf ("manufacturer: '%s' '%c'\n" , +printf ("manufacturer: '%s' 0x%01x\n" , config->mmc_ids[mid], oid);else -printf ("manufacturer: 'Unlisted' '%c'\n" , oid); +printf ("manufacturer: 'Unlisted' 0x%01x\n" , oid);printf ("product: '%s' %u.%u\n" , pnm, prv_major, prv_minor);printf ("serial: 0x%08x\n" , psn); --2.39.2
PATCH 3/3 mmc-utils: do not hide CID manufacturer information
In reply to Enrico JornsReading the MID just to convert it to 'Unlisted' is quite unhelpful for an info command.
Due to the (constantly increasing) amount of valid MIDs it is quite unlikely to we have it in the database already anyway.
Thus simply always print the manufacturer ID as 0xNN and understand the manufacturer name as an additional information held in parenthesis.
--- lsmmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lsmmc.c +3 -3
@@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)printf ("\tCRC: 0x%02x\n" , crc); }else {if (config->mmc_ids[mid]) -printf ("manufacturer: '%s' 0x%01x\n" , - config->mmc_ids[mid], oid); +printf ("manufacturer: 0x%02x (%s) oid: 0x%01x\n" , + mid, config->mmc_ids[mid], oid);else -printf ("manufacturer: 'Unlisted' 0x%01x\n" , oid); +printf ("manufacturer: 0x%02x (Unlisted) oid: 0x%01x\n" , mid, oid);printf ("product: '%s' %u.%u\n" , pnm, prv_major, prv_minor);printf ("serial: 0x%08x\n" , psn);
Signature · 1 line
2.39.2
RE: [PATCH 3/3] mmc-utils: do not hide CID manufacturer information
Quoted 9 lines
Reading the MID just to convert it to 'Unlisted' is quite unhelpful for an info command.
Due to the (constantly increasing) amount of valid MIDs it is quite unlikely to we have it in the database already anyway.Thus simply always print the manufacturer ID as 0xNN and understand the manufacturer name as an additional information held in parenthesis.
Signed-off-by Enrico Jorns <[email protected]>
Quoted 25 lines
--- lsmmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)lsmmc.c +4
-4@@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)printf ("\tCRC: 0x%02x\n" , crc); }else {if (config->mmc_ids[mid]) -printf ("manufacturer: '%s' 0x%01x\n" , - config->mmc_ids[mid], oid); +printf ("manufacturer: 0x%02x (%s) oid: 0x%01x\n" , + mid, config->mmc_ids[mid], oid);else -printf ("manufacturer: 'Unlisted' 0x%01x\n" , oid); + printf("manufacturer: 0x%02x (Unlisted) oid: + 0x%01x\n", mid, oid); printf("product: '%s' %u.%u\n", pnm, prv_major, prv_minor); printf("serial: 0x%08x\n", psn); --2.39.2
Ulf Hansson
AppliedRe: [PATCH 3/3] mmc-utils: do not hide CID manufacturer information
In reply to Enrico JornsQuoted 10 lines · Enrico Jorns
Reading the MID just to convert it to 'Unlisted' is quite unhelpful for an info command.
Due to the (constantly increasing) amount of valid MIDs it is quite unlikely to we have it in the database already anyway.Thus simply always print the manufacturer ID as 0xNN and understand the manufacturer name as an additional information held in parenthesis.
Signed-off-by Enrico Jorns <[email protected]>
Applied to git.kernel.org/pub/scm/utils/mmc/mmc-utils.git master, thanks!
Kind regards
Uffe
Quoted 25 lines
--- lsmmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)lsmmc.c +3
-4@@ -636,10 +636,10 @@ void print_mmc_cid(struct config *config, char *cid)printf ("\tCRC: 0x%02x\n" , crc); }else {if (config->mmc_ids[mid]) -printf ("manufacturer: '%s' 0x%01x\n" , - config->mmc_ids[mid], oid); +printf ("manufacturer: 0x%02x (%s) oid: 0x%01x\n" , + mid, config->mmc_ids[mid], oid);else -printf ("manufacturer: 'Unlisted' 0x%01x\n" , oid); +printf ("manufacturer: 0x%02x (Unlisted) oid: 0x%01x\n" , mid, oid);printf ("product: '%s' %u.%u\n" , pnm, prv_major, prv_minor);printf ("serial: 0x%08x\n" , psn); --2.39.2
Quoted 2 lines
Signed-off-by Enrico Jorns <[email protected]>
Quoted 22 lines
--- lsmmc.c | 5 +++++ 1 file changed, 5 insertions(+)lsmmc.c +5
-1@@ -239,6 +239,11 @@ struct ids_database database[] = { .id = 0x44, .manufacturer = "ATP", }, + { + .type = "mmc", + .id = 0x45, + .manufacturer = "SanDisk Corporation", + }, { .type = "mmc", .id = 0x2c, --2.39.2
Ulf Hansson
AppliedQuoted 2 lines · Enrico Jorns
Signed-off-by Enrico Jorns <[email protected]>
Applied to git.kernel.org/pub/scm/utils/mmc/mmc-utils.git master, thanks!
Kind regards
Uffe
Quoted 23 lines
--- lsmmc.c | 5 +++++ 1 file changed, 5 insertions(+)lsmmc.c +5
-1@@ -239,6 +239,11 @@ struct ids_database database[] = { .id = 0x44, .manufacturer = "ATP", }, + { + .type = "mmc", + .id = 0x45, + .manufacturer = "SanDisk Corporation", + }, { .type = "mmc", .id = 0x2c, --2.39.2