[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/20] sdcard: Expose sd_prepare_frame48() for QTest
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 13/20] sdcard: Expose sd_prepare_frame48() for QTest use |
Date: |
Fri, 4 May 2018 12:59:11 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
include/hw/sd/sd.h | 16 ++++++++++++++++
hw/sd/sdmmc-internal.c | 4 ++--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h
index b1f865fe20..13de1b30c3 100644
--- a/include/hw/sd/sd.h
+++ b/include/hw/sd/sd.h
@@ -168,6 +168,22 @@ void sd_prepare_request(SDRequest *req, uint8_t cmd,
uint32_t arg,
void sd_prepare_request_with_crc(SDRequest *req, uint8_t cmd, uint32_t arg,
uint8_t crc);
+/**
+ * sd_prepare_response48: Initialize a SD response buffer
+ *
+ * If @gen_crc the frame checksum will be calculated
+ * and filled in the request buffer.
+ *
+ * @req: the #SDRequest to be filled
+ * @cmd: the SD command
+ * @arg: the SD command argument
+ * @is_response: whether the frame is a command request or response
+ * @gen_crc: generates the frame CRC7 if true, else fill with zeroes
+ */
+
+void sd_prepare_frame48(SDFrame48 *frame, uint8_t cmd, uint32_t arg,
+ bool is_response, bool gen_crc);
+
/**
* sd_update_frame48_checksum:
* @frame: the #SDFrame48 to verify
diff --git a/hw/sd/sdmmc-internal.c b/hw/sd/sdmmc-internal.c
index 04da81e665..c990cc9e8e 100644
--- a/hw/sd/sdmmc-internal.c
+++ b/hw/sd/sdmmc-internal.c
@@ -129,8 +129,8 @@ void sd_update_frame48_checksum(SDFrame48 *frame, bool
is_response)
frame->crc = sd_calc_frame48_crc7(frame->cmd, frame->arg, is_response);
}
-static void sd_prepare_frame48(SDFrame48 *frame, uint8_t cmd, uint32_t arg,
- bool is_response, bool gen_crc)
+void sd_prepare_frame48(SDFrame48 *frame, uint8_t cmd, uint32_t arg,
+ bool is_response, bool gen_crc)
{
frame->cmd = cmd;
frame->arg = arg;
--
2.17.0
- Re: [Qemu-devel] [PATCH 06/20] sdcard: Add a "validate-crc" property, (continued)
- [Qemu-devel] [PATCH 05/20] sdcard: Use the sd_prepare_request*() functions, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 07/20] sdcard: Constify sd_crc*()'s message argument, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 08/20] sdcard: Fix sd_crc*() style, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 09/20] sdcard: Expose sd_crc*() functions for QTest use, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 10/20] sdcard: Expose sd_prepare_request*() functions for QTest use, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 11/20] sdcard: Add test_sd_request_frame_crc7() qtest (request command CRC7), Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 12/20] sdcard: Let sd_frame48_crc7_calc() work on response frames, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 14/20] sdcard: Add test_sd_response_frame48_crc7 qtest (command response CRC7), Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 13/20] sdcard: Expose sd_prepare_frame48() for QTest use,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 15/20] sdcard: Add SDFrame136 struct and 136-bit SD response frames functions, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 16/20] sdcard: Add test_sd_response_frame136_crc7() qtest, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 19/20] sdcard: Add test_sd_data_frame_crc16() qtest, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 17/20] sdcard: Add SDFrameData struct and data frame checksum functions, Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 18/20] sdcard: Fix sd_crc16(), Philippe Mathieu-Daudé, 2018/05/04
- [Qemu-devel] [PATCH 20/20] sdcard: Add test_sd_verify_cksum_frame48() qtest, Philippe Mathieu-Daudé, 2018/05/04
- Re: [Qemu-devel] [PATCH 00/20] sdcard: proper implementation of CRC, Philippe Mathieu-Daudé, 2018/05/07