From nobody Thu Oct 30 15:35:21 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1525449711312991.7814156952053; Fri, 4 May 2018 09:01:51 -0700 (PDT) Received: from localhost ([::1]:35021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEd9Y-0003rT-Fo for importer@patchew.org; Fri, 04 May 2018 12:01:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54839) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fEd7R-0002SR-GF for qemu-devel@nongnu.org; Fri, 04 May 2018 11:59:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fEd7Q-0001RO-Qz for qemu-devel@nongnu.org; Fri, 04 May 2018 11:59:37 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:44337) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fEd7Q-0001Qx-Mn for qemu-devel@nongnu.org; Fri, 04 May 2018 11:59:36 -0400 Received: by mail-qt0-x243.google.com with SMTP id d3-v6so27912864qtp.11 for ; Fri, 04 May 2018 08:59:36 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id a83sm8587066qkb.22.2018.05.04.08.59.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 May 2018 08:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5aqbhsgHCCjJfifDH1qGloIHvlHvJDa3Lmhz/H9lDWM=; b=TvuFZ8nl03kdDM0Oo2/IghQGFD+WxnnILG4K5c+PN0s0Je/fF8tNrKn/nnxFzGcOAf 2v5X3KJ81YQCrbCpByk6tWqwC3rmrEFNIns7jOtuc2/rnH6xcKeNY1fqFpyDE7groz+2 SwriPI8KyUATJRsq4GJ4ceWrW/n30v8AMAC7FdpmerlEb5QvI6+vgEX5slOIKFecd6n9 UAbj72nyQztVHtFXmXY+TcY4Seo3NjmptcOEm7+1YDb6LYl3t2jabWqGrUSKkuQaWfhf qNZJewDj3++0cuhPbeju/P+vhIC4M/umWhO3ZPHy/LSMbEfrCtXFdvC4jFCfJt/yy4wa Pz3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5aqbhsgHCCjJfifDH1qGloIHvlHvJDa3Lmhz/H9lDWM=; b=QemH0iwjNiEB+XcuzIntHzaZulpoTez70jZdKMcikCEFcx43YCuJNb4anMlnprm1L8 irK6OH9PCFwfqSkPsrQdik9kKr8AwFzOq022JZRM25sgg6pOtlO23Hav6MoEJYNz4Pa1 TwqJi64LFxqcYRbmNHcEaJFncDofRNmwDHwIaA5pDl63axcz4147AaSFw+77dtYILkrs wQOVxlcdiZspm0lAcjJi6Z3C0ppUUJLHR0O1PKXUw0vHu2rXSFnc7l8Jqk7psX+pqAYo YoePJtKq7tuAL+zLA69P1IaIfK3jwprwcfyVooDwurEXdkzXVnRuf09Apt2yCGPgFF54 1G/A== X-Gm-Message-State: ALQs6tCH2BphWDmT2JINRSU9kEK0Ra68ahJBpTb8+5cHry9Pqq57JK+m EaDWQ2vJ5hS/Od5Wm+WcjCA= X-Google-Smtp-Source: AB8JxZo1uUdneBEHm75/Az3WCbNn4F25Jy5YBLU34+7Ul2S1i02CrSzPxenFG+v2Z9rawnTaUU1GSg== X-Received: by 2002:ac8:7259:: with SMTP id l25-v6mr24087218qtp.325.1525449576102; Fri, 04 May 2018 08:59:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , "Edgar E . Iglesias" Date: Fri, 4 May 2018 12:59:01 -0300 Message-Id: <20180504155918.21287-4-f4bug@amsat.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180504155918.21287-1-f4bug@amsat.org> References: <20180504155918.21287-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH 03/20] sdcard: Rename the SDRequest as SDFrame48 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 SD requests are 48-bit SD frames, while SD responses can be 48-bit or 136-bit frames. The 48-bit response frames share the same CRC logic than request frames. Unify the 48-bit framing to reuse the same CRC logic between requests and responses. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/sd/sd.h | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 9bdb3c9285..f0b41232f7 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -76,11 +76,22 @@ typedef enum { sd_adtc, /* addressed with data transfer */ } sd_cmd_type_t; =20 -typedef struct { +/** + * SDFrame48: 48 bits commands or responses + * + * @cmd: request: command + * response: mirrored command + * @arg: request: address information or parameter + * response: status information, OCR register, RCA + * @crc: 7-bit CRC checksum + */ +typedef struct SDFrame48 { uint8_t cmd; uint32_t arg; uint8_t crc; -} SDRequest; +} SDFrame48; + +typedef struct SDFrame48 SDRequest; =20 typedef struct SDState SDState; typedef struct SDBus SDBus; --=20 2.17.0