static int scsi_write_data(SCSIDevice *d, uint32_t tag)

{

    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d);

    SCSIDiskReq *r;



    DPRINTF("Write data tag=0x%x\n", tag);

    r = scsi_find_request(s, tag);

    if (!r) {

        BADF("Bad write tag 0x%x\n", tag);

        scsi_command_complete(r, CHECK_CONDITION, HARDWARE_ERROR);

        return 1;

    }



    /* No data transfer may already be in progress */

    assert(r->req.aiocb == NULL);



    scsi_write_request(r);



    return 0;

}

static int scsi_write_data(SCSIDevice *d, uint32_t tag)

{

    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, d);

    SCSIDiskReq *r;



    DPRINTF("Write data tag=0x%x\n", tag);

    r = scsi_find_request(s, tag);

    if (!r) {

        BADF("Bad write tag 0x%x\n", tag);

        scsi_command_complete(r, CHECK_CONDITION, HARDWARE_ERROR);

        return 1;

    }



    

    assert(r->req.aiocb == NULL);



    scsi_write_request(r);



    return 0;

}

static int FUNC_0(SCSIDevice *VAR_0, uint32_t VAR_1)

{

    SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, VAR_0);

    SCSIDiskReq *r;



    DPRINTF("Write data VAR_1=0x%x\n", VAR_1);

    r = scsi_find_request(s, VAR_1);

    if (!r) {

        BADF("Bad write VAR_1 0x%x\n", VAR_1);

        scsi_command_complete(r, CHECK_CONDITION, HARDWARE_ERROR);

        return 1;

    }



    

    assert(r->req.aiocb == NULL);



    scsi_write_request(r);



    return 0;

}

static int FUNC_0(SCSIDevice *VAR_0, uint32_t VAR_1)
{ SCSIDiskState *s = DO_UPCAST(SCSIDiskState, qdev, VAR_0); SCSIDiskReq *r; DPRINTF("Write data VAR_1=0x%x\n", VAR_1); r = scsi_find_request(s, VAR_1); if (!r) { BADF("Bad write VAR_1 0x%x\n", VAR_1); scsi_command_complete(r, CHECK_CONDITION, HARDWARE_ERROR); return 1; } assert(r->req.aiocb == NULL); scsi_write_request(r); return 0; }