···629629int usb_drv_init_endpoint(int endpoint, int type, int max_packet_size)
630630{
631631 (void)max_packet_size; /* FIXME: support max packet size override */
632632+ (void)type;
633633+ (void)endpoint;
632634 return 0;
633635}
634636635637int usb_drv_deinit_endpoint(int endpoint)
636638{
639639+ (void)endpoint;
637640 return 0;
638641}
639642
+96-97
firmware/drivers/m66591.c
···4747#define HISPEED
48484949/* Right now sending blocks till the full transfer has completed. The driver
5050- * will work without USB_TRAN_BLOCK set, but it is more than 50% slower.
5050+ * will work without USB_TRAN_BLOCK set, but it is more than 50% slower.
5151 * The driver is more "Proper" without USB_TRAN_BLOCK defined so if you start
5252 * having freezeups or trouble using USB undefine this option.
5353 */
···7272static void control_received(void);
7373static void transfer_complete(int endpoint);
7474static int mxx_transmit_receive(int endpoint);
7575-static int mxx_queue(int endpoint, void * ptr, int length, bool send,
7575+static int mxx_queue(int endpoint, void * ptr, int length, bool send,
7676 bool wait);
77777878struct M66591_epstat {
···9797static void pipe_init(int pipe) {
9898 volatile unsigned short *pipe_cfg;
9999 pipe_cfg = pipe_ctrl_addr(pipe);
100100-100100+101101 *pipe_cfg |= 1<<9; /* ACLR */
102102 *pipe_cfg &= ~(1<<9); /* Force de-assertion */
103103 *pipe_cfg |= 1<<8; /* SQCLR */
···106106/* This function sets the pipe/endpoint handshake */
107107static void pipe_handshake(int pipe, int handshake) {
108108 handshake&=0x03;
109109-109109+110110 if(handshake == PIPE_SHAKE_STALL) {
111111 if( *(pipe_ctrl_addr(pipe)) & 0x03 ) {
112112 *(pipe_ctrl_addr(pipe)) = 0x03;
···122122 * warites/reads are valid */
123123static void pipe_c_select (int pipe, bool dir) {
124124 M66591_CPORT_CTRL0 = pipe | (1<<10) | (dir<<5);
125125-125125+126126 // Wait for the Pipe to be valid;
127127- udelay(2);
127127+ udelay(2);
128128}
129129130130#if !defined(USB_TRAN_BLOCK)
···199199static void control_received(void) {
200200 /* copy setup data from packet */
201201 static struct usb_ctrlrequest temp;
202202-202202+203203 memcpy(&temp, (unsigned char*)&M66591_USB_REQ0, 8);
204204-204204+205205 logf("mxx: bReqType=0x%02x bReq=0x%02x wVal=0x%04x"
206206- " wIdx=0x%04x wLen=0x%04x",
206206+ " wIdx=0x%04x wLen=0x%04x",
207207 temp.bRequestType, temp.bRequest, temp.wValue,
208208 temp.wIndex, temp.wLength);
209209···220220 M66591_INTCFG_EMP &= ~(1 << endpoint);
221221 logf("mxx: ep %d transfer complete", endpoint);
222222 int temp=M66591_eps[endpoint].dir ? USB_DIR_IN : USB_DIR_OUT;
223223- usb_core_transfer_complete(endpoint, temp, 0,
223223+ usb_core_transfer_complete(endpoint, temp, 0,
224224 M66591_eps[endpoint].count);
225225}
226226···229229 */
230230static int mxx_transmit_receive(int endpoint) {
231231 logf("mxx: do start");
232232-232232+233233 /* Only the lower 15 bits of the endpoint correlate to the pipe number.
234234 * For example pipe 2 will corelate to endpoint 0x82, so the upper bits
235235 * need to be masked out.
···238238239239 int i; /* Used as a loop counter */
240240 int length; /* Used in transfers to determine the amount to send/receive */
241241-241241+242242 bool send=M66591_eps[endpoint].dir;
243243-243243+244244 /* This is used as the internal buffer pointer */
245245 unsigned short *ptrs;
246246···265265 length = M66591_eps[endpoint].length;
266266#else
267267 int bufsize=pipe_buffer_size(endpoint);
268268- length=MIN(M66591_eps[endpoint].length - M66591_eps[endpoint].count,
268268+ length=MIN(M66591_eps[endpoint].length - M66591_eps[endpoint].count,
269269 bufsize);
270270#endif
271271···274274 */
275275 ptrs = (unsigned short *)(M66591_eps[endpoint].buf
276276 + M66591_eps[endpoint].count);
277277-277277+278278 /* Check if the buffer is alligned */
279279 if( LIKELY(((int)ptrs) & 0x01) == 0 )
280280 {
281281 /* Start sending data in 16-bit words (fast) */
282282- for (i = 0; i < (length>>1); i++) {
282282+ for (i = 0; i < (length>>1); i++) {
283283#if defined(USB_TRAN_BLOCK)
284284- /* This wait is dangerous in the event that something happens
285285- * to the PHY pipe where it never becomes ready again, should
284284+ /* This wait is dangerous in the event that something happens
285285+ * to the PHY pipe where it never becomes ready again, should
286286 * probably add a timeout, and ideally completely remove.
287287 */
288288 while(!(M66591_CPORT_CTRL1&(1<<13))){};
···291291 M66591_CPORT = *ptrs++;
292292 M66591_eps[endpoint].count+=2;
293293 }
294294-295295- /* If the length is odd, send the last byte after setting the byte
294294+295295+ /* If the length is odd, send the last byte after setting the byte
296296 * width of the FIFO.
297297 */
298298 if(length & 0x01) {
···304304 }
305305 else
306306 {
307307- /* The buffer is mis-aligned - data needs to be organized first.
307307+ /* The buffer is mis-aligned - data needs to be organized first.
308308 * This is slower than the above method.
309309 */
310310 unsigned short sbuf;
311311 unsigned char *ptrc = (unsigned char*)ptrs;
312312-312312+313313 /* Start sending data in 16-bit words */
314314- for (i = 0; i < (length>>1); i++) {
314314+ for (i = 0; i < (length>>1); i++) {
315315#if defined(USB_TRAN_BLOCK)
316316- /* This wait is dangerous in the event that something happens
317317- * to the PHY pipe where it never becomes ready again, should
316316+ /* This wait is dangerous in the event that something happens
317317+ * to the PHY pipe where it never becomes ready again, should
318318 * probably add a timeout, and ideally completely remove.
319319 */
320320 while(!(M66591_CPORT_CTRL1&(1<<13))){};
···329329 M66591_CPORT = sbuf;
330330 M66591_eps[endpoint].count+=2;
331331 }
332332-333333- /* If the length is odd, send the last byte after setting the byte
332332+333333+ /* If the length is odd, send the last byte after setting the byte
334334 * width of the FIFO.
335335 */
336336 if(length & 0x01) {
···340340 M66591_eps[endpoint].count++;
341341 }
342342 }
343343-343343+344344 /* If the transfer is complete set up interrupts to notify when FIFO is
345345 * EMPTY, disable READY and let the handler know that there is nothing
346346 * left to transfer on this pipe.
···356356 /* There is still data to transfer, make sure READY is enabled */
357357 M66591_INTCFG_RDY |= 1 << endpoint;
358358 }
359359-359359+360360 /* Set BVAL if length is not a multiple of the maximum packet size */
361361 if( (length == 0) || (length % maxpack != 0) ) {
362362 logf("mxx: do set BVAL");
···364364 }
365365 } else {
366366 /* Read data from FIFO */
367367-367367+368368 /* Read the number of bytes that the PHY received */
369369 int receive_length=M66591_CPORT_CTRL1 & 0x03FF;
370370-370370+371371 /* The number of bytes to actually read is either what's left of the
372372 * amount requested, or the amount that the PHY received. Choose the
373373 * smaller of the two.
374374 */
375375- length = MIN(M66591_eps[endpoint].length - M66591_eps[endpoint].count,
375375+ length = MIN(M66591_eps[endpoint].length - M66591_eps[endpoint].count,
376376 receive_length);
377377378378 /* If the length is zero, just clear the buffer as specified in the
379379 * datasheet. Otherwise read in the data (in 16-bit pieces */
380380 if(length==0) {
381381 /* Set the BCLR bit */
382382- M66591_CPORT_CTRL1 |= 1<<14;
382382+ M66591_CPORT_CTRL1 |= 1<<14;
383383 } else {
384384 /* Set the position in the buffer */
385385- ptrs = (unsigned short *)(M66591_eps[endpoint].buf
385385+ ptrs = (unsigned short *)(M66591_eps[endpoint].buf
386386 + M66591_eps[endpoint].count);
387387-387387+388388 /* Read in the data (buffer size should be even). The PHY cannot
389389 * switch from 16-bit mode to 8-bit mode on an OUT buffer.
390390 */
···393393 M66591_eps[endpoint].count+=2;
394394 }
395395 }
396396-396396+397397 /* If the length was odd subtract 1 from the count */
398398 M66591_eps[endpoint].count -= (length&0x01);
399399-399399+400400 /* If the requested size of data was received, or the data received was
401401 * less than the maximum packet size end the transfer.
402402 */
403403- if( (M66591_eps[endpoint].count == M66591_eps[endpoint].length)
403403+ if( (M66591_eps[endpoint].count == M66591_eps[endpoint].length)
404404 || (length % pipe_maxpack_size(endpoint)) ) {
405405-405405+406406 /* If the host tries to send anything else the FIFO is not ready/
407407 * enabled yet (NAK).
408408 */
···411411 M66591_eps[endpoint].waiting=false;
412412 /* Disable ready */
413413 M66591_INTCFG_RDY &= ~(1 << endpoint);
414414-414414+415415 /* Let the stack know that the transfer is complete */
416416 if(endpoint!=0)
417417 transfer_complete(endpoint);
418418 }
419419 }
420420-421421- logf("mxx: do done ep %d %s len: %d cnt: %d", endpoint,
420420+421421+ logf("mxx: do done ep %d %s len: %d cnt: %d", endpoint,
422422 send ? "out" : "in", length, M66591_eps[endpoint].count);
423423424424 return 0;
425425}
426426427427-/* This function is used to start transfers. It is a helper function for the
427427+/* This function is used to start transfers. It is a helper function for the
428428 * usb_drv_send_nonblocking, usb_drv_send, and usb_drv_receive functions.
429429 *
430430- * The functionality for wait needs to be added. Currently the driver is
430430+ * The functionality for wait needs to be added. Currently the driver is
431431 * always used in a blocking mode(USB_TRAN_BLOCK) so it is not required.
432432 */
433433-static int mxx_queue(int endpoint, void * ptr, int length, bool send,
434434- bool wait)
433433+static int mxx_queue(int endpoint, void * ptr, int length, bool send,
434434+ bool wait)
435435{
436436#if defined(USB_TRAN_BLOCK) && !defined(LOGF_ENABLE)
437437 (void) wait;
···445445 * need to be masked out.
446446 */
447447 endpoint &= 0x7F;
448448-448448+449449 /* Initialize the enpoint status registers used for the transfer */
450450 M66591_eps[endpoint].buf=ptr;
451451 M66591_eps[endpoint].length=length;
···453453 M66591_eps[endpoint].dir=send;
454454 M66591_eps[endpoint].waiting=true;
455455456456- logf("mxx: queue ep %d %s, len: %d, wait: %d",
456456+ logf("mxx: queue ep %d %s, len: %d, wait: %d",
457457 endpoint, send ? "out" : "in", length, wait);
458458-458458+459459 /* Pick the pipe that communications are happening on */
460460 pipe_c_select(endpoint, send);
461461462462 /* All transfers start with a BUF handshake */
463463 pipe_handshake(endpoint, PIPE_SHAKE_BUF);
464464-464464+465465 /* This USB PHY takes care of control completion packets by setting the
466466 * CCPL bit in EP0 (endpoint 0, or DCP). If the control state is "write no
467467- * data tranfer" then we just need to set the CCPL bit (hopefully)
467467+ * data tranfer" then we just need to set the CCPL bit (hopefully)
468468 * regardless of what the stack said to send.
469469 */
470470 int control_state = (M66591_INTSTAT_MAIN & 0x07);
471471 if(endpoint==0 && control_state==CTRL_WTND) {
472472 logf("mxx: queue ep 0 ctls: 5, set ccpl");
473473-473473+474474 /* Set CCPL */
475475- M66591_DCPCTRL |= 1<<2;
475475+ M66591_DCPCTRL |= 1<<2;
476476 } else {
477477 /* This is the standard case for transmitting data */
478478 if(send) {
479479- /* If the pipe is not ready don't try and send right away; instead
479479+ /* If the pipe is not ready don't try and send right away; instead
480480 * just set the READY interrupt so that the handler can initiate
481481 * the transfer.
482482 */
···485485 } else {
486486 M66591_INTCFG_RDY |= 1 << endpoint;
487487 }
488488-488488+489489 if(length==0) {
490490 transfer_complete(endpoint);
491491 }
···510510void USB_DEVICE(void) {
511511 int pipe_restore=M66591_CPORT_CTRL0;
512512 logf("\nmxx: INT BEGIN tick: %d", (int) current_tick);
513513-514514- logf("mxx: sMAIN0: 0x%04x, sRDY: 0x%04x",
513513+514514+ logf("mxx: sMAIN0: 0x%04x, sRDY: 0x%04x",
515515 M66591_INTSTAT_MAIN, M66591_INTSTAT_RDY);
516516- logf("mxx: sNRDY: 0x%04x, sEMP: 0x%04x",
516516+ logf("mxx: sNRDY: 0x%04x, sEMP: 0x%04x",
517517 M66591_INTSTAT_NRDY, M66591_INTSTAT_EMP);
518518519519 /* VBUS (connected) interrupt */
···537537 /* Device state transition interrupt: Not used, but useful for debugging */
538538 if(M66591_INTSTAT_MAIN & (1<<12)) {
539539 M66591_INTSTAT_MAIN &= ~(1<<12);
540540- logf("mxx: DEV state CHANGE=%d",
540540+ logf("mxx: DEV state CHANGE=%d",
541541 ((M66591_INTSTAT_MAIN & (0x07<<4)) >> 4) );
542542 }
543543···545545 if(M66591_INTSTAT_MAIN & (1<<11)) {
546546 M66591_INTSTAT_MAIN &= ~(1<<11);
547547 int control_state = (M66591_INTSTAT_MAIN & 0x07);
548548-548548+549549 logf("mxx: CTRT with CTSQ=%d", control_state);
550550-550550+551551 switch ( control_state ) {
552552 case CTRL_IDLE:
553553 transfer_complete(0);
554554 break;
555555- case CTRL_RTDS:
555555+ case CTRL_RTDS:
556556 case CTRL_WTDS:
557557 case CTRL_WTND:
558558 /* If data is not valid stop */
···572572 break;
573573 }
574574 }
575575-575575+576576 /* FIFO EMPTY interrupt: when this happens the transfer should be complete.
577577 * When the interrupt occurs notify the stack.
578578 */
579579 if(M66591_INTSTAT_MAIN & (1<<10)) {
580580 int i;
581581 logf("mxx: INT EMPTY: 0x%04x", M66591_INTSTAT_EMP);
582582-582582+583583 for(i=0; i<USB_NUM_ENDPOINTS; i++) {
584584 if(M66591_INTSTAT_EMP&(1<<i)) {
585585 /* Clear the empty flag */
···589589 }
590590 }
591591 }
592592-592592+593593 /* FIFO NOT READY interrupt: This is not used, but included incase the
594594 * interrupt is endabled.
595595 */
···602602 if(M66591_INTSTAT_MAIN & (1<<8)) {
603603 int i;
604604 logf("mxx: INT READY: 0x%04x", M66591_INTSTAT_RDY);
605605-605605+606606 for(i=0; i<USB_NUM_ENDPOINTS; i++) {
607607 /* Was this endpoint ready and waiting */
608608 if(M66591_INTSTAT_RDY&(1<<i) && M66591_eps[i].waiting) {
···613613 }
614614 }
615615 }
616616-616616+617617 /* Make sure that the INTStatus register is completely cleared. */
618618 M66591_INTSTAT_MAIN = 0;
619619-619619+620620 /* Restore the pipe state before the interrupt occured */
621621 M66591_CPORT_CTRL0=pipe_restore;
622622 logf("mxx: INT END\n");
···643643int usb_drv_init_endpoint(int endpoint, int type, int max_packet_size) {
644644 (void)max_packet_size; /* FIXME: support max packet size override */
645645646646- int pipecfg;
646646+ int pipecfg = 0;
647647648648 if(type == USB_ENDPOINT_XFER_BULK) {
649649 /* Enable double buffer mode (only used for ep 1 and 2) */
650650- pipecfg |= 1<<9 | 1<<8;
650650+ pipecfg |= 1<<9 | 1<<8;
651651 } else if(type == USB_ENDPOINT_XFER_BULK) {
652652 pipecfg |= 1<<13;
653653 } else {
···662662 }
663663664664 M66591_eps[num].dir = dir;
665665-665665+666666 M66591_PIPE_CFGSEL=num;
667667668668 /* Enable pipe (15) */
669669- pipecfg |= 1<<15;
670670-669669+ pipecfg |= 1<<15;
670670+671671 pipe_handshake(num, PIPE_SHAKE_NAK);
672672673673 /* Setup the flags */
674674 M66591_PIPE_CFGWND=pipecfg;
675675-675675+676676 pipe_init(num);
677677-677677+678678 logf("mxx: ep req ep#: %d config: 0x%04x", num, M66591_PIPE_CFGWND);
679679680680 return 0;
···689689 }
690690691691 int flags = disable_irq_save();
692692-692692+693693 logf("mxx: ep %d release", num);
694694695695 M66591_eps[num].dir = -1;
···719719/* This is where the driver stuff starts */
720720void usb_drv_init(void) {
721721 logf("mxx: Device Init");
722722-722722+723723 M66591_PIN_CFG1 = 0x8000; /* Drive Current: 3.3V setting */
724724 M66591_PIN_CFG2 = 0x0000;
725725-725725+726726 M66591_TRN_CTRL = 0x8000; /* External 48 MHz clock */
727727 M66591_TRN_CTRL |=0x0001;
728728···744744/* fully enable driver */
745745void usb_attach(void) {
746746 int i;
747747-747747+748748 /* Reset Endpoint states */
749749 for(i=0; i<USB_NUM_ENDPOINTS; i++) {
750750 M66591_eps[i].dir = -1;
···757757 /* Issue a h/w reset */
758758 usb_init_device();
759759 usb_core_init();
760760-761761- /* USB Attach Process: This follows the flow diagram in the M66591GP
760760+761761+ /* USB Attach Process: This follows the flow diagram in the M66591GP
762762 * Reference Manual Rev 1.00, p. 77 */
763763764764#if defined(HISPEED)
···784784785785 /* Disable PIPE ready interrupts */
786786 M66591_INTCFG_RDY = 0;
787787-787787+788788 /* Disable PIPE not-ready interrupts */
789789 M66591_INTCFG_NRDY = 0;
790790-790790+791791 /* Disable PIPE empyt/size error interrupts */
792792 M66591_INTCFG_EMP = 0;
793793···795795 M66591_INTCFG_MAIN = 0x1DFF;
796796797797 pipe_c_select(0, false);
798798-798798+799799 /* Enable continuous transfer mode on the DCP */
800800 M66591_DCP_CNTMD |= (1<<8);
801801-801801+802802 /* Set the threshold that the PHY will automatically transmit from EP0 */
803803 M66591_DCP_CTRLEN = 256;
804804-804804+805805 pipe_handshake(0, PIPE_SHAKE_NAK);
806806-806806+807807 /* Set the Max packet size to 64 */
808808 M66591_DCP_MXPKSZ = 64;
809809···814814}
815815816816void usb_drv_exit(void) {
817817- /* USB Detach Process: This follows the flow diagram in the M66591GP
817817+ /* USB Detach Process: This follows the flow diagram in the M66591GP
818818 * Reference Manual Rev 1.00, p. 78.
819819 */
820820···868868 return mxx_queue(endpoint, ptr, length, false, false);
869869}
870870871871-/* This function checks the reset handshake speed status
871871+/* This function checks the reset handshake speed status
872872 * (Fullspeed or Highspeed)
873873 */
874874int usb_drv_port_speed(void)
875875{
876876 int handshake = (M66591_HSFS & 0xFF);
877877-877877+878878 if( handshake == 0x02) {
879879 return 0; /* Handshook at Full-Speed */
880880 } else if( handshake == 0x03) {
···890890bool usb_drv_stalled(int endpoint,bool in)
891891{
892892 (void) in;
893893-893893+894894 bool stalled = (*(pipe_ctrl_addr(endpoint)) & (0x02)) ? true : false;
895895-895895+896896 logf("mxx: stall?: %s ep: %d", stalled ? "true" : "false", endpoint);
897897-897897+898898 if(stalled) {
899899 return true;
900900 } else {
···909909void usb_drv_stall(int endpoint, bool stall,bool in)
910910{
911911 (void) in;
912912-912912+913913 logf("mxx: stall - ep: %d", endpoint);
914914-914914+915915 if(stall) {
916916 /* Stall the pipe (host needs to intervene/error) */
917917 pipe_handshake(endpoint, PIPE_SHAKE_STALL);
···935935 M66591_eps[endpoint].buf = NULL;
936936 }
937937 }
938938-938938+939939 restore_irq(flags);
940940}
941941-
+4-4
firmware/target/arm/as3525/usb-drv-as3525.c
···38383939/* OUT EP 2 is an alias for OUT EP 0 on this HW! */
4040struct usb_drv_ep_spec usb_drv_ep_specs[USB_NUM_EPS] = {
4141- [0] = {USB_ENDPOINT_XFER_CONTROL, USB_ENDPOINT_XFER_CONTROL},
4242- [1] = {USB_ENDPOINT_TYPE_ANY, USB_ENDPOINT_TYPE_ANY},
4343- [2] = {USB_ENDPOINT_TYPE_NONE, USB_ENDPOINT_TYPE_ANY},
4444- [3] = {USB_ENDPOINT_TYPE_ANY, USB_ENDPOINT_TYPE_ANY},
4141+ {.type = {USB_ENDPOINT_XFER_CONTROL, USB_ENDPOINT_XFER_CONTROL}},
4242+ {.type = {USB_ENDPOINT_TYPE_ANY, USB_ENDPOINT_TYPE_ANY}},
4343+ {.type = {USB_ENDPOINT_TYPE_NONE, USB_ENDPOINT_TYPE_ANY}},
4444+ {.type = {USB_ENDPOINT_TYPE_ANY, USB_ENDPOINT_TYPE_ANY}},
4545};
4646uint8_t usb_drv_ep_specs_flags = 0;
4747
+7-5
firmware/target/arm/rk27xx/usb-drv-rk27xx.c
···5656 volatile void *buf; /* tx/rx buffer address */
5757 volatile int len; /* size of the transfer (bytes) */
5858 volatile int cnt; /* number of bytes transfered/received */
5959- volatile bool block; /* flag indicating that transfer is blocking */
5959+ volatile bool block; /* flag indicating that transfer is blocking */
6060 struct semaphore complete; /* semaphore for blocking transfers */
6161};
6262···7373#define DMAINLMADDR(endp) *(4 + (endp)->stat)
74747575#define ENDPOINT(num, type, dir, reg) \
7676- {num, USB_ENDPOINT_XFER_##type, USB_DIR_##dir, reg, false, NULL, 0, 0, true, {{0, 0}, 0, 0}}
7676+ {num, USB_ENDPOINT_XFER_##type, USB_DIR_##dir, reg, NULL, 0, 0, true, {{0, 0}, 0, 0}}
77777878static struct endpoint_t ctrlep[2] =
7979{
···284284 (void)max_packet_size; /* FIXME: support max packet size override */
285285286286 int num = EP_NUM(endpoint);
287287- int dir = EP_DIR(endpoint);
287287+// int dir = EP_DIR(endpoint);
288288+ (void)type;
288289289290 struct endpoint_t *endp = &endpoints[num];
290291···299300300301int usb_drv_deinit_endpoint(int endpoint) {
301302 int num = EP_NUM(endpoint);
302302- struct endpoint_t *endp = &endpoints[num];
303303+// struct endpoint_t *endp = &endpoints[num];
303304304305 /* disable interrupt from this endpoint */
305306 EN_INT &= ~(1 << (num + 7));
307307+ return 0;
306308}
307309308310/* Set the address (usually it's in a register).
···376378}
377379378380/* Kill all transfers. Usually you need to set a bit for each endpoint
379379- * and flush fifos. You should also call the completion handler with
381381+ * and flush fifos. You should also call the completion handler with
380382 * error status for everything
381383 */
382384void usb_drv_cancel_all_transfers(void)
+1
firmware/target/mips/ingenic_jz47xx/usb-jz4760.c
···1194119411951195int usb_drv_init_endpoint(int endpoint, int type, int max_packet_size) {
11961196 (void)max_packet_size; /* FIXME: support max packet size override */
11971197+ (void)type;
1197119811981199 int num = EP_NUM(endpoint);
11991200 int dir = EP_DIR(endpoint);