On Thursday 19 April 2007 2:53 am, Li Yang wrote: > +static void *fsl_alloc_buffer(struct usb_ep *_ep, unsigned bytes, > + dma_addr_t *dma, gfp_t gfp_flags) > +{ > + void *retval = NULL; > + > + if (!bytes) > + return 0; > + > + /* We alloc normal(cachable) kernel memory, as this buffer will > + * be sync'ed upon transmittion. */ > + > + retval = kmalloc(bytes, gfp_flags); > + if (retval) > + *dma = virt_to_phys(retval); > + return retval; > +}
You still need to fix this to use dma_alloc_coherent(), and its sibling function to use dma_free_coherent(). This particular code assumes !CONFIG_NOT_COHERENT_CACHE ... which ISTR you've said is not true on all the relevant PPC platforms, and is certainly not true on the versions found (already?) in Freescale ARM products. > + } else if ((setup->bRequestType & USB_RECIP_MASK) > + == USB_RECIP_DEVICE) { > + if (!udc->gadget.is_otg) > + break; > + else if (setup->bRequest == USB_DEVICE_B_HNP_ENABLE) > + udc->gadget.b_hnp_enable = 1; > + else if (setup->bRequest == USB_DEVICE_A_HNP_SUPPORT) > + udc->gadget.a_hnp_support = 1; > + else if (setup->bRequest == > + USB_DEVICE_A_ALT_HNP_SUPPORT) > + udc->gadget.a_alt_hnp_support = 1; > + rc = 0; > + } And I'm curious about that stuff too ... should have asked before. Is this a case where the hardware somehow snooping that request? Because if it isn't, you're missing logic to poke some OTG register when B_HNP_ENABLE is set ... nothing will happen when the device suspends, no role switch or anything. - Dave ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel