static int usb_net_handle_data(USBDevice *dev, USBPacket *p)

{

    USBNetState *s = (USBNetState *) dev;

    int ret = 0;



    switch(p->pid) {

    case USB_TOKEN_IN:

        switch (p->devep) {

        case 1:

            ret = usb_net_handle_statusin(s, p);

            break;



        case 2:

            ret = usb_net_handle_datain(s, p);

            break;



        default:

            goto fail;

        }

        break;



    case USB_TOKEN_OUT:

        switch (p->devep) {

        case 2:

            ret = usb_net_handle_dataout(s, p);

            break;



        default:

            goto fail;

        }

        break;



    default:

    fail:

        ret = USB_RET_STALL;

        break;

    }

    if (ret == USB_RET_STALL)

        fprintf(stderr, "usbnet: failed data transaction: "

                        "pid 0x%x ep 0x%x len 0x%zx\n",

                        p->pid, p->devep, p->iov.size);

    return ret;

}

static int usb_net_handle_data(USBDevice *dev, USBPacket *p)

{

    USBNetState *s = (USBNetState *) dev;

    int ret = 0;



    switch(p->pid) {

    case USB_TOKEN_IN:

        switch (p->devep) {

        case 1:

            ret = usb_net_handle_statusin(s, p);

            break;



        case 2:

            ret = usb_net_handle_datain(s, p);

            break;



        default:

            goto fail;

        }

        break;



    case USB_TOKEN_OUT:

        switch (p->devep) {

        case 2:

            ret = usb_net_handle_dataout(s, p);

            break;



        default:

            goto fail;

        }

        break;



    default:

    fail:

        ret = USB_RET_STALL;

        break;

    }

    if (ret == USB_RET_STALL)

        fprintf(stderr, "usbnet: failed data transaction: "

                        "pid 0x%x ep 0x%x len 0x%zx\n",

                        p->pid, p->devep, p->iov.size);

    return ret;

}

static int FUNC_0(USBDevice *VAR_0, USBPacket *VAR_1)

{

    USBNetState *s = (USBNetState *) VAR_0;

    int VAR_2 = 0;



    switch(VAR_1->pid) {

    case USB_TOKEN_IN:

        switch (VAR_1->devep) {

        case 1:

            VAR_2 = usb_net_handle_statusin(s, VAR_1);

            break;



        case 2:

            VAR_2 = usb_net_handle_datain(s, VAR_1);

            break;



        default:

            goto fail;

        }

        break;



    case USB_TOKEN_OUT:

        switch (VAR_1->devep) {

        case 2:

            VAR_2 = usb_net_handle_dataout(s, VAR_1);

            break;



        default:

            goto fail;

        }

        break;



    default:

    fail:

        VAR_2 = USB_RET_STALL;

        break;

    }

    if (VAR_2 == USB_RET_STALL)

        fprintf(stderr, "usbnet: failed data transaction: "

                        "pid 0x%x ep 0x%x len 0x%zx\n",

                        VAR_1->pid, VAR_1->devep, VAR_1->iov.size);

    return VAR_2;

}

static int FUNC_0(USBDevice *VAR_0, USBPacket *VAR_1)
{ USBNetState *s = (USBNetState *) VAR_0; int VAR_2 = 0; switch(VAR_1->pid) { case USB_TOKEN_IN:
switch (VAR_1->devep) { case 1:
VAR_2 = usb_net_handle_statusin(s, VAR_1); break; case 2:
VAR_2 = usb_net_handle_datain(s, VAR_1); break; default:
goto fail; } break; case USB_TOKEN_OUT:
switch (VAR_1->devep) { case 2:
VAR_2 = usb_net_handle_dataout(s, VAR_1); break; default:
goto fail; } break; default:
fail:
VAR_2 = USB_RET_STALL; break; } if (VAR_2 == USB_RET_STALL)
fprintf(stderr, "usbnet: failed data transaction: "
"pid 0x%x ep 0x%x len 0x%zx\n",
VAR_1->pid, VAR_1->devep, VAR_1->iov.size); return VAR_2; }