void usb_ep_reset(USBDevice *dev)

{

    int ep;



    dev->ep_ctl.nr = 0;

    dev->ep_ctl.type = USB_ENDPOINT_XFER_CONTROL;

    dev->ep_ctl.ifnum = 0;

    dev->ep_ctl.dev = dev;

    dev->ep_ctl.pipeline = false;

    for (ep = 0; ep < USB_MAX_ENDPOINTS; ep++) {

        dev->ep_in[ep].nr = ep + 1;

        dev->ep_out[ep].nr = ep + 1;

        dev->ep_in[ep].pid = USB_TOKEN_IN;

        dev->ep_out[ep].pid = USB_TOKEN_OUT;

        dev->ep_in[ep].type = USB_ENDPOINT_XFER_INVALID;

        dev->ep_out[ep].type = USB_ENDPOINT_XFER_INVALID;

        dev->ep_in[ep].ifnum = 0;

        dev->ep_out[ep].ifnum = 0;

        dev->ep_in[ep].dev = dev;

        dev->ep_out[ep].dev = dev;

        dev->ep_in[ep].pipeline = false;

        dev->ep_out[ep].pipeline = false;

    }

}

void usb_ep_reset(USBDevice *dev)

{

    int ep;



    dev->ep_ctl.nr = 0;

    dev->ep_ctl.type = USB_ENDPOINT_XFER_CONTROL;

    dev->ep_ctl.ifnum = 0;

    dev->ep_ctl.dev = dev;

    dev->ep_ctl.pipeline = false;

    for (ep = 0; ep < USB_MAX_ENDPOINTS; ep++) {

        dev->ep_in[ep].nr = ep + 1;

        dev->ep_out[ep].nr = ep + 1;

        dev->ep_in[ep].pid = USB_TOKEN_IN;

        dev->ep_out[ep].pid = USB_TOKEN_OUT;

        dev->ep_in[ep].type = USB_ENDPOINT_XFER_INVALID;

        dev->ep_out[ep].type = USB_ENDPOINT_XFER_INVALID;

        dev->ep_in[ep].ifnum = 0;

        dev->ep_out[ep].ifnum = 0;

        dev->ep_in[ep].dev = dev;

        dev->ep_out[ep].dev = dev;

        dev->ep_in[ep].pipeline = false;

        dev->ep_out[ep].pipeline = false;

    }

}

void FUNC_0(USBDevice *VAR_0)

{

    int VAR_1;



    VAR_0->ep_ctl.nr = 0;

    VAR_0->ep_ctl.type = USB_ENDPOINT_XFER_CONTROL;

    VAR_0->ep_ctl.ifnum = 0;

    VAR_0->ep_ctl.VAR_0 = VAR_0;

    VAR_0->ep_ctl.pipeline = false;

    for (VAR_1 = 0; VAR_1 < USB_MAX_ENDPOINTS; VAR_1++) {

        VAR_0->ep_in[VAR_1].nr = VAR_1 + 1;

        VAR_0->ep_out[VAR_1].nr = VAR_1 + 1;

        VAR_0->ep_in[VAR_1].pid = USB_TOKEN_IN;

        VAR_0->ep_out[VAR_1].pid = USB_TOKEN_OUT;

        VAR_0->ep_in[VAR_1].type = USB_ENDPOINT_XFER_INVALID;

        VAR_0->ep_out[VAR_1].type = USB_ENDPOINT_XFER_INVALID;

        VAR_0->ep_in[VAR_1].ifnum = 0;

        VAR_0->ep_out[VAR_1].ifnum = 0;

        VAR_0->ep_in[VAR_1].VAR_0 = VAR_0;

        VAR_0->ep_out[VAR_1].VAR_0 = VAR_0;

        VAR_0->ep_in[VAR_1].pipeline = false;

        VAR_0->ep_out[VAR_1].pipeline = false;

    }

}

void FUNC_0(USBDevice *VAR_0)
{ int VAR_1; VAR_0->ep_ctl.nr = 0; VAR_0->ep_ctl.type = USB_ENDPOINT_XFER_CONTROL; VAR_0->ep_ctl.ifnum = 0; VAR_0->ep_ctl.VAR_0 = VAR_0; VAR_0->ep_ctl.pipeline = false; for (VAR_1 = 0; VAR_1 < USB_MAX_ENDPOINTS; VAR_1++) { VAR_0->ep_in[VAR_1].nr = VAR_1 + 1; VAR_0->ep_out[VAR_1].nr = VAR_1 + 1; VAR_0->ep_in[VAR_1].pid = USB_TOKEN_IN; VAR_0->ep_out[VAR_1].pid = USB_TOKEN_OUT; VAR_0->ep_in[VAR_1].type = USB_ENDPOINT_XFER_INVALID; VAR_0->ep_out[VAR_1].type = USB_ENDPOINT_XFER_INVALID; VAR_0->ep_in[VAR_1].ifnum = 0; VAR_0->ep_out[VAR_1].ifnum = 0; VAR_0->ep_in[VAR_1].VAR_0 = VAR_0; VAR_0->ep_out[VAR_1].VAR_0 = VAR_0; VAR_0->ep_in[VAR_1].pipeline = false; VAR_0->ep_out[VAR_1].pipeline = false; } }