iscsi_inquiry_cb(struct iscsi_context *iscsi, int status, void *command_data,

                 void *opaque)

{

    struct IscsiTask *itask = opaque;

    struct scsi_task *task = command_data;

    struct scsi_inquiry_standard *inq;



    if (status != 0) {

        itask->status   = 1;

        itask->complete = 1;

        scsi_free_scsi_task(task);

        return;

    }



    inq = scsi_datain_unmarshall(task);

    if (inq == NULL) {

        error_report("iSCSI: Failed to unmarshall inquiry data.");

        itask->status   = 1;

        itask->complete = 1;

        scsi_free_scsi_task(task);

        return;

    }



    itask->iscsilun->type = inq->periperal_device_type;



    scsi_free_scsi_task(task);



    switch (itask->iscsilun->type) {

    case TYPE_DISK:

        task = iscsi_readcapacity16_task(iscsi, itask->iscsilun->lun,

                                   iscsi_readcapacity16_cb, opaque);

        if (task == NULL) {

            error_report("iSCSI: failed to send readcapacity16 command.");

            itask->status   = 1;

            itask->complete = 1;

            return;

        }

        break;

    case TYPE_ROM:

        task = iscsi_readcapacity10_task(iscsi, itask->iscsilun->lun,

                                   0, 0,

                                   iscsi_readcapacity10_cb, opaque);

        if (task == NULL) {

            error_report("iSCSI: failed to send readcapacity16 command.");

            itask->status   = 1;

            itask->complete = 1;

            return;

        }

        break;

    default:

        itask->status   = 0;

        itask->complete = 1;

    }

}

iscsi_inquiry_cb(struct iscsi_context *iscsi, int status, void *command_data,

                 void *opaque)

{

    struct IscsiTask *itask = opaque;

    struct scsi_task *task = command_data;

    struct scsi_inquiry_standard *inq;



    if (status != 0) {

        itask->status   = 1;

        itask->complete = 1;

        scsi_free_scsi_task(task);

        return;

    }



    inq = scsi_datain_unmarshall(task);

    if (inq == NULL) {

        error_report("iSCSI: Failed to unmarshall inquiry data.");

        itask->status   = 1;

        itask->complete = 1;

        scsi_free_scsi_task(task);

        return;

    }



    itask->iscsilun->type = inq->periperal_device_type;



    scsi_free_scsi_task(task);



    switch (itask->iscsilun->type) {

    case TYPE_DISK:

        task = iscsi_readcapacity16_task(iscsi, itask->iscsilun->lun,

                                   iscsi_readcapacity16_cb, opaque);

        if (task == NULL) {

            error_report("iSCSI: failed to send readcapacity16 command.");

            itask->status   = 1;

            itask->complete = 1;

            return;

        }

        break;

    case TYPE_ROM:

        task = iscsi_readcapacity10_task(iscsi, itask->iscsilun->lun,

                                   0, 0,

                                   iscsi_readcapacity10_cb, opaque);

        if (task == NULL) {

            error_report("iSCSI: failed to send readcapacity16 command.");

            itask->status   = 1;

            itask->complete = 1;

            return;

        }

        break;

    default:

        itask->status   = 0;

        itask->complete = 1;

    }

}

    struct IscsiTask *itask = opaque;     struct scsi_task *task = command_data;     if (status != 0) {         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);     scsi_free_scsi_task(task);     struct IscsiTask *itask = opaque;     struct scsi_task *task = command_data;     if (status != 0) {         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);     scsi_free_scsi_task(task); iscsi_inquiry_cb(struct iscsi_context *iscsi, int status, void *command_data,                  void *opaque)     struct IscsiTask *itask = opaque;     struct scsi_task *task = command_data;     struct scsi_inquiry_standard *inq;     if (status != 0) {         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);     inq = scsi_datain_unmarshall(task);     if (inq == NULL) {         error_report("iSCSI: Failed to unmarshall inquiry data.");         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);     itask->iscsilun->type = inq->periperal_device_type;     scsi_free_scsi_task(task);     switch (itask->iscsilun->type) {     case TYPE_DISK:         task = iscsi_readcapacity16_task(iscsi, itask->iscsilun->lun,                                    iscsi_readcapacity16_cb, opaque);         if (task == NULL) {             error_report("iSCSI: failed to send readcapacity16 command.");             itask->status   = 1;             itask->complete = 1;         break;     case TYPE_ROM:         task = iscsi_readcapacity10_task(iscsi, itask->iscsilun->lun,                                    0, 0,                                    iscsi_readcapacity10_cb, opaque);         if (task == NULL) {             error_report("iSCSI: failed to send readcapacity16 command.");             itask->status   = 1;             itask->complete = 1;         break;     default:         itask->status   = 0;         itask->complete = 1;                  void *opaque)     struct IscsiTask *itask = opaque;     if (status != 0) {         itask->status   = 1;         itask->complete = 1;         itask->status   = 1;         itask->complete = 1;
FUNC_0(struct iscsi_context *VAR_0, int VAR_1, void *VAR_2,

                 void *VAR_3)

{

    struct IscsiTask *VAR_4 = VAR_3;

    struct scsi_task *VAR_5 = VAR_2;

    struct scsi_inquiry_standard *VAR_6;



    if (VAR_1 != 0) {

        VAR_4->VAR_1   = 1;

        VAR_4->complete = 1;

        scsi_free_scsi_task(VAR_5);

        return;

    }



    VAR_6 = scsi_datain_unmarshall(VAR_5);

    if (VAR_6 == NULL) {

        error_report("iSCSI: Failed to unmarshall inquiry data.");

        VAR_4->VAR_1   = 1;

        VAR_4->complete = 1;

        scsi_free_scsi_task(VAR_5);

        return;

    }



    VAR_4->iscsilun->type = VAR_6->periperal_device_type;



    scsi_free_scsi_task(VAR_5);



    switch (VAR_4->iscsilun->type) {

    case TYPE_DISK:

        VAR_5 = iscsi_readcapacity16_task(VAR_0, VAR_4->iscsilun->lun,

                                   iscsi_readcapacity16_cb, VAR_3);

        if (VAR_5 == NULL) {

            error_report("iSCSI: failed to send readcapacity16 command.");

            VAR_4->VAR_1   = 1;

            VAR_4->complete = 1;

            return;

        }

        break;

    case TYPE_ROM:

        VAR_5 = iscsi_readcapacity10_task(VAR_0, VAR_4->iscsilun->lun,

                                   0, 0,

                                   iscsi_readcapacity10_cb, VAR_3);

        if (VAR_5 == NULL) {

            error_report("iSCSI: failed to send readcapacity16 command.");

            VAR_4->VAR_1   = 1;

            VAR_4->complete = 1;

            return;

        }

        break;

    default:

        VAR_4->VAR_1   = 0;

        VAR_4->complete = 1;

    }

}

FUNC_0(struct iscsi_context *VAR_0, int VAR_1, void *VAR_2,
void *VAR_3)
{ struct IscsiTask *VAR_4 = VAR_3; struct scsi_task *VAR_5 = VAR_2; struct scsi_inquiry_standard *VAR_6; if (VAR_1 != 0) { VAR_4->VAR_1   = 1; VAR_4->complete = 1; scsi_free_scsi_task(VAR_5); return; } VAR_6 = scsi_datain_unmarshall(VAR_5); if (VAR_6 == NULL) { error_report("iSCSI: Failed to unmarshall inquiry data."); VAR_4->VAR_1   = 1; VAR_4->complete = 1; scsi_free_scsi_task(VAR_5); return; } VAR_4->iscsilun->type = VAR_6->periperal_device_type; scsi_free_scsi_task(VAR_5); switch (VAR_4->iscsilun->type) { case TYPE_DISK:
VAR_5 = iscsi_readcapacity16_task(VAR_0, VAR_4->iscsilun->lun,
iscsi_readcapacity16_cb, VAR_3); if (VAR_5 == NULL) { error_report("iSCSI: failed to send readcapacity16 command."); VAR_4->VAR_1   = 1; VAR_4->complete = 1; return; } break; case TYPE_ROM:
VAR_5 = iscsi_readcapacity10_task(VAR_0, VAR_4->iscsilun->lun,
0, 0,
iscsi_readcapacity10_cb, VAR_3); if (VAR_5 == NULL) { error_report("iSCSI: failed to send readcapacity16 command."); VAR_4->VAR_1   = 1; VAR_4->complete = 1; return; } break; default:
VAR_4->VAR_1   = 0; VAR_4->complete = 1; } }