From patchwork Mon May 22 21:48:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enrico Jorns X-Patchwork-Id: 684819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C97FC77B73 for ; Mon, 22 May 2023 21:49:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231418AbjEVVtK (ORCPT ); Mon, 22 May 2023 17:49:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbjEVVtA (ORCPT ); Mon, 22 May 2023 17:49:00 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D745196 for ; Mon, 22 May 2023 14:49:00 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q1DOk-0001Es-Gq; Mon, 22 May 2023 23:48:58 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1q1DOj-0026AJ-At; Mon, 22 May 2023 23:48:57 +0200 Received: from ejo by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1q1DOi-008YGD-IY; Mon, 22 May 2023 23:48:56 +0200 From: Enrico Jorns To: linux-mmc@vger.kernel.org Cc: Avri Altman , Ulf Hansson , ejo@pengutronix.de Subject: [PATCH 1/3] mmc-utils: add SanDisk to manufacturer database Date: Mon, 22 May 2023 23:48:16 +0200 Message-Id: <20230522214818.2038252-1-ejo@pengutronix.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ejo@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mmc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Signed-off-by: Enrico Jorns Acked-by: Avri Altman --- lsmmc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lsmmc.c b/lsmmc.c index 55da3aa..da9d69e 100644 --- a/lsmmc.c +++ b/lsmmc.c @@ -239,6 +239,11 @@ struct ids_database database[] = { .id = 0x44, .manufacturer = "ATP", }, + { + .type = "mmc", + .id = 0x45, + .manufacturer = "SanDisk Corporation", + }, { .type = "mmc", .id = 0x2c, From patchwork Mon May 22 21:48:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enrico Jorns X-Patchwork-Id: 684818 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41092C77B75 for ; Mon, 22 May 2023 21:49:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230284AbjEVVtL (ORCPT ); Mon, 22 May 2023 17:49:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234521AbjEVVtC (ORCPT ); Mon, 22 May 2023 17:49:02 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D627192 for ; Mon, 22 May 2023 14:49:00 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q1DOk-0001Eu-Gq; Mon, 22 May 2023 23:48:58 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1q1DOj-0026AP-Ih; Mon, 22 May 2023 23:48:57 +0200 Received: from ejo by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1q1DOi-008YGG-J1; Mon, 22 May 2023 23:48:56 +0200 From: Enrico Jorns To: linux-mmc@vger.kernel.org Cc: Avri Altman , Ulf Hansson , ejo@pengutronix.de Subject: [PATCH 2/3] mmc-utils: fix printing OID for mmc in non-verbose mode Date: Mon, 22 May 2023 23:48:17 +0200 Message-Id: <20230522214818.2038252-2-ejo@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522214818.2038252-1-ejo@pengutronix.de> References: <20230522214818.2038252-1-ejo@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ejo@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mmc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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 format. Signed-off-by: Enrico Jorns Reviewed-by: Avri Altman --- lsmmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lsmmc.c b/lsmmc.c index da9d69e..cea43af 100644 --- a/lsmmc.c +++ b/lsmmc.c @@ -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); From patchwork Mon May 22 21:48:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enrico Jorns X-Patchwork-Id: 685225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB71AC7EE2A for ; Mon, 22 May 2023 21:49:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229835AbjEVVtL (ORCPT ); Mon, 22 May 2023 17:49:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234491AbjEVVtB (ORCPT ); Mon, 22 May 2023 17:49:01 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C277103 for ; Mon, 22 May 2023 14:49:00 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q1DOk-0001Et-Gs; Mon, 22 May 2023 23:48:58 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1q1DOj-0026AM-Ge; Mon, 22 May 2023 23:48:57 +0200 Received: from ejo by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1q1DOi-008YGK-JP; Mon, 22 May 2023 23:48:56 +0200 From: Enrico Jorns To: linux-mmc@vger.kernel.org Cc: Avri Altman , Ulf Hansson , ejo@pengutronix.de Subject: [PATCH 3/3] mmc-utils: do not hide CID manufacturer information Date: Mon, 22 May 2023 23:48:18 +0200 Message-Id: <20230522214818.2038252-3-ejo@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230522214818.2038252-1-ejo@pengutronix.de> References: <20230522214818.2038252-1-ejo@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ejo@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mmc@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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 Reviewed-by: Avri Altman --- lsmmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lsmmc.c b/lsmmc.c index cea43af..54c3167 100644 --- a/lsmmc.c +++ b/lsmmc.c @@ -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);