switch (bdc->gadget.speed) { case USB_SPEED_SUPER: if (usb_endpoint_xfer_int(desc) ||
usb_endpoint_xfer_isoc(desc)) {
param2 |= si; if (usb_endpoint_xfer_isoc(desc) && comp_desc)
mul = comp_desc->bmAttributes;
}
param2 |= mul << EPM_SHIFT; if (comp_desc)
mbs = comp_desc->bMaxBurst;
param2 |= mbs << MB_SHIFT; break;
case USB_SPEED_HIGH: if (usb_endpoint_xfer_isoc(desc) ||
usb_endpoint_xfer_int(desc)) {
param2 |= si;
case USB_SPEED_FULL: case USB_SPEED_LOW: /* the hardware accepts SI in 125usec range */ if (usb_endpoint_xfer_isoc(desc))
si += 3;
/* * FS Int endpoints can have si of 1-255ms but the controller * accepts 2^bInterval*125usec, so convert ms to nearest power * of 2
*/ if (usb_endpoint_xfer_int(desc))
si = fls(desc->bInterval * 8) - 1;
/* * Change the HW deq pointer, if this command is successful, HW will start * fetching the next bd from address dma_addr.
*/ int bdc_ep_bla(struct bdc *bdc, struct bdc_ep *ep, dma_addr_t dma_addr)
{
u32 param0, param1;
u32 cmd_sc = 0;
/* Send a Function Wake notification packet using FH command */ int bdc_function_wake_fh(struct bdc *bdc, u8 intf)
{
u32 param0, param1;
u32 cmd_sc = 0;
/* resets the endpoint, called when host sends CLEAR_FEATURE(HALT) */ int bdc_ep_clear_stall(struct bdc *bdc, int epnum)
{ struct bdc_ep *ep;
u32 cmd_sc = 0; int ret;
dev_dbg(bdc->dev, "%s: epnum=%d\n", __func__, epnum);
ep = bdc->bdc_ep_array[epnum]; /* * If we are not in stalled then stall Endpoint and issue clear stall, * his will reset the seq number for non EP0.
*/ if (epnum != 1) { /* if the endpoint it not stalled */ if (!(ep->flags & BDC_EP_STALL)) {
ret = bdc_ep_set_stall(bdc, epnum); if (ret) return ret;
}
} /* Preserve the seq number for ep0 only */ if (epnum != 1)
cmd_sc |= BDC_CMD_EPO_RST_SN;
ret = bdc_submit_cmd(bdc, cmd_sc, 0, 0, 0); if (ret) {
dev_err(bdc->dev, "command failed:%x\n", ret); return ret;
}
bdc_notify_xfr(bdc, epnum);
return ret;
}
/* Stop the endpoint, called when software wants to dequeue some request */ int bdc_stop_ep(struct bdc *bdc, int epnum)
{ struct bdc_ep *ep;
u32 cmd_sc = 0; int ret;
ep = bdc->bdc_ep_array[epnum];
dev_dbg(bdc->dev, "%s: ep:%s ep->flags:%08x\n", __func__,
ep->name, ep->flags); /* Endpoint has to be in running state to execute stop ep command */ if (!(ep->flags & BDC_EP_ENABLED)) {
dev_err(bdc->dev, "stop endpoint called for disabled ep\n"); return -EINVAL;
} if ((ep->flags & BDC_EP_STALL) || (ep->flags & BDC_EP_STOP)) return 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.