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%x\n",

                        p->pid, p->devep, p->len);

    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%x\n",

                        p->pid, p->devep, p->len);

    return ret;

}

                        "pid 0x%x ep 0x%x len 0x%x\n",                         p->pid, p->devep, p->len);
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%x\n",

                        VAR_1->pid, VAR_1->devep, VAR_1->len);

    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%x\n",
VAR_1->pid, VAR_1->devep, VAR_1->len); return VAR_2; }