static int vscsi_send_adapter_info(VSCSIState *s, vscsi_req *req)

{

    struct viosrp_adapter_info *sinfo;

    struct mad_adapter_info_data info;

    int rc;



    sinfo = &req->iu.mad.adapter_info;



#if 0 /* What for ? */

    rc = spapr_tce_dma_read(&s->vdev, be64_to_cpu(sinfo->buffer),

                            &info, be16_to_cpu(sinfo->common.length));

    if (rc) {

        fprintf(stderr, "vscsi_send_adapter_info: DMA read failure !\n");

    }

#endif

    memset(&info, 0, sizeof(info));

    strcpy(info.srp_version, SRP_VERSION);

    strncpy(info.partition_name, "qemu", sizeof("qemu"));

    info.partition_number = cpu_to_be32(0);

    info.mad_version = cpu_to_be32(1);

    info.os_type = cpu_to_be32(2);

    info.port_max_txu[0] = cpu_to_be32(VSCSI_MAX_SECTORS << 9);



    rc = spapr_tce_dma_write(&s->vdev, be64_to_cpu(sinfo->buffer),

                             &info, be16_to_cpu(sinfo->common.length));

    if (rc)  {

        fprintf(stderr, "vscsi_send_adapter_info: DMA write failure !\n");

    }



    sinfo->common.status = rc ? cpu_to_be32(1) : 0;



    return vscsi_send_iu(s, req, sizeof(*sinfo), VIOSRP_MAD_FORMAT);

}

static int vscsi_send_adapter_info(VSCSIState *s, vscsi_req *req)

{

    struct viosrp_adapter_info *sinfo;

    struct mad_adapter_info_data info;

    int rc;



    sinfo = &req->iu.mad.adapter_info;



#if 0 

    rc = spapr_tce_dma_read(&s->vdev, be64_to_cpu(sinfo->buffer),

                            &info, be16_to_cpu(sinfo->common.length));

    if (rc) {

        fprintf(stderr, "vscsi_send_adapter_info: DMA read failure !\n");

    }

#endif

    memset(&info, 0, sizeof(info));

    strcpy(info.srp_version, SRP_VERSION);

    strncpy(info.partition_name, "qemu", sizeof("qemu"));

    info.partition_number = cpu_to_be32(0);

    info.mad_version = cpu_to_be32(1);

    info.os_type = cpu_to_be32(2);

    info.port_max_txu[0] = cpu_to_be32(VSCSI_MAX_SECTORS << 9);



    rc = spapr_tce_dma_write(&s->vdev, be64_to_cpu(sinfo->buffer),

                             &info, be16_to_cpu(sinfo->common.length));

    if (rc)  {

        fprintf(stderr, "vscsi_send_adapter_info: DMA write failure !\n");

    }



    sinfo->common.status = rc ? cpu_to_be32(1) : 0;



    return vscsi_send_iu(s, req, sizeof(*sinfo), VIOSRP_MAD_FORMAT);

}

#endif #endif #endif #endif #endif #endif #endif #endif #endif     rc = spapr_tce_dma_read(&s->vdev, be64_to_cpu(sinfo->buffer),     rc = spapr_tce_dma_write(&s->vdev, be64_to_cpu(sinfo->buffer),
static int FUNC_0(VSCSIState *VAR_0, vscsi_req *VAR_1)

{

    struct viosrp_adapter_info *VAR_2;

    struct mad_adapter_info_data VAR_3;

    int VAR_4;



    VAR_2 = &VAR_1->iu.mad.adapter_info;



#if 0 

    VAR_4 = spapr_tce_dma_read(&VAR_0->vdev, be64_to_cpu(VAR_2->buffer),

                            &VAR_3, be16_to_cpu(VAR_2->common.length));

    if (VAR_4) {

        fprintf(stderr, "FUNC_0: DMA read failure !\n");

    }

#endif

    memset(&VAR_3, 0, sizeof(VAR_3));

    strcpy(VAR_3.srp_version, SRP_VERSION);

    strncpy(VAR_3.partition_name, "qemu", sizeof("qemu"));

    VAR_3.partition_number = cpu_to_be32(0);

    VAR_3.mad_version = cpu_to_be32(1);

    VAR_3.os_type = cpu_to_be32(2);

    VAR_3.port_max_txu[0] = cpu_to_be32(VSCSI_MAX_SECTORS << 9);



    VAR_4 = spapr_tce_dma_write(&VAR_0->vdev, be64_to_cpu(VAR_2->buffer),

                             &VAR_3, be16_to_cpu(VAR_2->common.length));

    if (VAR_4)  {

        fprintf(stderr, "FUNC_0: DMA write failure !\n");

    }



    VAR_2->common.status = VAR_4 ? cpu_to_be32(1) : 0;



    return vscsi_send_iu(VAR_0, VAR_1, sizeof(*VAR_2), VIOSRP_MAD_FORMAT);

}

static int FUNC_0(VSCSIState *VAR_0, vscsi_req *VAR_1)
{ struct viosrp_adapter_info *VAR_2; struct mad_adapter_info_data VAR_3; int VAR_4; VAR_2 = &VAR_1->iu.mad.adapter_info; #if 0
VAR_4 = spapr_tce_dma_read(&VAR_0->vdev, be64_to_cpu(VAR_2->buffer),
&VAR_3, be16_to_cpu(VAR_2->common.length)); if (VAR_4) { fprintf(stderr, "FUNC_0: DMA read failure !\n"); } #endif
memset(&VAR_3, 0, sizeof(VAR_3)); strcpy(VAR_3.srp_version, SRP_VERSION); strncpy(VAR_3.partition_name, "qemu", sizeof("qemu")); VAR_3.partition_number = cpu_to_be32(0); VAR_3.mad_version = cpu_to_be32(1); VAR_3.os_type = cpu_to_be32(2); VAR_3.port_max_txu[0] = cpu_to_be32(VSCSI_MAX_SECTORS << 9); VAR_4 = spapr_tce_dma_write(&VAR_0->vdev, be64_to_cpu(VAR_2->buffer),
&VAR_3, be16_to_cpu(VAR_2->common.length)); if (VAR_4)  { fprintf(stderr, "FUNC_0: DMA write failure !\n"); } VAR_2->common.status = VAR_4 ? cpu_to_be32(1) : 0; return vscsi_send_iu(VAR_0, VAR_1, sizeof(*VAR_2), VIOSRP_MAD_FORMAT); }