static void scsi_read_complete(void * opaque, int ret)

{

    SCSIGenericReq *r = (SCSIGenericReq *)opaque;

    int len;



    if (ret) {

        DPRINTF("IO error ret %d\n", ret);

        scsi_command_complete(r, ret);

        return;

    }

    len = r->io_header.dxfer_len - r->io_header.resid;

    DPRINTF("Data ready tag=0x%x len=%d\n", r->req.tag, len);



    r->len = -1;

    r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, len);

    if (len == 0)

        scsi_command_complete(r, 0);

}

static void scsi_read_complete(void * opaque, int ret)

{

    SCSIGenericReq *r = (SCSIGenericReq *)opaque;

    int len;



    if (ret) {

        DPRINTF("IO error ret %d\n", ret);

        scsi_command_complete(r, ret);

        return;

    }

    len = r->io_header.dxfer_len - r->io_header.resid;

    DPRINTF("Data ready tag=0x%x len=%d\n", r->req.tag, len);



    r->len = -1;

    r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, len);

    if (len == 0)

        scsi_command_complete(r, 0);

}

    r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, len);     if (len == 0)
static void FUNC_0(void * VAR_0, int VAR_1)

{

    SCSIGenericReq *r = (SCSIGenericReq *)VAR_0;

    int VAR_2;



    if (VAR_1) {

        DPRINTF("IO error VAR_1 %d\n", VAR_1);

        scsi_command_complete(r, VAR_1);

        return;

    }

    VAR_2 = r->io_header.dxfer_len - r->io_header.resid;

    DPRINTF("Data ready tag=0x%x VAR_2=%d\n", r->req.tag, VAR_2);



    r->VAR_2 = -1;

    r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, VAR_2);

    if (VAR_2 == 0)

        scsi_command_complete(r, 0);

}

static void FUNC_0(void * VAR_0, int VAR_1)
{ SCSIGenericReq *r = (SCSIGenericReq *)VAR_0; int VAR_2; if (VAR_1) { DPRINTF("IO error VAR_1 %d\n", VAR_1); scsi_command_complete(r, VAR_1); return; } VAR_2 = r->io_header.dxfer_len - r->io_header.resid; DPRINTF("Data ready tag=0x%x VAR_2=%d\n", r->req.tag, VAR_2); r->VAR_2 = -1; r->req.bus->complete(r->req.bus, SCSI_REASON_DATA, r->req.tag, VAR_2); if (VAR_2 == 0)
scsi_command_complete(r, 0); }