* Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
*/
+#define LOG_CATEGORY UCLASS_VIRTIO
+
#include <common.h>
#include <blk.h>
#include <dm.h>
sgs[num_out + num_in++] = &data_sg;
sgs[num_out + num_in++] = &status_sg;
+ log_debug("dev=%s, active=%d, priv=%p, priv->vq=%p\n", dev->name,
+ device_active(dev), priv, priv->vq);
ret = virtqueue_add(priv->vq, sgs, num_out, num_in);
if (ret)
virtqueue_kick(priv->vq);
+ log_debug("wait...");
while (!virtqueue_get_buf(priv->vq, NULL))
;
+ log_debug("done\n");
return status == VIRTIO_BLK_S_OK ? blkcnt : -EIO;
}
static ulong virtio_blk_read(struct udevice *dev, lbaint_t start,
lbaint_t blkcnt, void *buffer)
{
+ log_debug("read %s\n", dev->name);
return virtio_blk_do_req(dev, start, blkcnt, buffer,
VIRTIO_BLK_T_IN);
}