From c769a88d4475f648595c6a270d9d0b0f3f7f3740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 14 Aug 2020 11:23:40 +0200 Subject: hw/sd: Rename read/write_data() as read/write_byte() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The read/write_data() methods write do a single byte access on the data line of a SD card. Rename them as read/write_byte(). Add some documentation (not in "hw/sd/sdcard_legacy.h" which we are going to remove soon). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200814092346.21825-2-f4bug@amsat.org> --- hw/sd/sd.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'hw/sd/sd.c') diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 5c6f5c94f3..7c9d956f11 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -1809,7 +1809,7 @@ static void sd_blk_write(SDState *sd, uint64_t addr, uint32_t len) #define APP_READ_BLOCK(a, len) memset(sd->data, 0xec, len) #define APP_WRITE_BLOCK(a, len) -void sd_write_data(SDState *sd, uint8_t value) +void sd_write_byte(SDState *sd, uint8_t value) { int i; @@ -1818,7 +1818,7 @@ void sd_write_data(SDState *sd, uint8_t value) if (sd->state != sd_receivingdata_state) { qemu_log_mask(LOG_GUEST_ERROR, - "sd_write_data: not in Receiving-Data state\n"); + "%s: not in Receiving-Data state\n", __func__); return; } @@ -1940,7 +1940,7 @@ void sd_write_data(SDState *sd, uint8_t value) break; default: - qemu_log_mask(LOG_GUEST_ERROR, "sd_write_data: unknown command\n"); + qemu_log_mask(LOG_GUEST_ERROR, "%s: unknown command\n", __func__); break; } } @@ -1959,7 +1959,7 @@ static const uint8_t sd_tuning_block_pattern[SD_TUNING_BLOCK_SIZE] = { 0xbb, 0xff, 0xf7, 0xff, 0xf7, 0x7f, 0x7b, 0xde, }; -uint8_t sd_read_data(SDState *sd) +uint8_t sd_read_byte(SDState *sd) { /* TODO: Append CRCs */ uint8_t ret; @@ -1970,7 +1970,7 @@ uint8_t sd_read_data(SDState *sd) if (sd->state != sd_sendingdata_state) { qemu_log_mask(LOG_GUEST_ERROR, - "sd_read_data: not in Sending-Data state\n"); + "%s: not in Sending-Data state\n", __func__); return 0x00; } @@ -2076,7 +2076,7 @@ uint8_t sd_read_data(SDState *sd) break; default: - qemu_log_mask(LOG_GUEST_ERROR, "sd_read_data: unknown command\n"); + qemu_log_mask(LOG_GUEST_ERROR, "%s: unknown command\n", __func__); return 0x00; } @@ -2192,8 +2192,8 @@ static void sd_class_init(ObjectClass *klass, void *data) sc->get_dat_lines = sd_get_dat_lines; sc->get_cmd_line = sd_get_cmd_line; sc->do_command = sd_do_command; - sc->write_data = sd_write_data; - sc->read_data = sd_read_data; + sc->write_byte = sd_write_byte; + sc->read_byte = sd_read_byte; sc->data_ready = sd_data_ready; sc->enable = sd_enable; sc->get_inserted = sd_get_inserted; -- cgit v1.2.3