On Fri, 9 Sep 2005, Savita H wrote: > Hi All, > > 1.According to USB 2.0 specification, section 5.8.3, Bulk transfer > transaction ends when Packet data length is .. > 1. Zero > 2. less than wMaxPacketSize > 3. Exactly equals to wMaxPacketSize
You misread the spec. A transfer ends when a packet length is less than wMaxPacketSize or when the expected amount of data has been transferred. > My doubt is what if last packet data length is exactly equals to > wMaxPacketSize? How will u distinguesh that between start of next transfer? > After sending last packet of length wMaxPacketSize will it send one more > packet of Zero length? The host can distinguish the end of a transfer because it knows how much data to expect. When it receives that much data, the transfer is over. The device will not send an extra zero-length packet. (To be honest, _most_ devices will not. A few devices disobey the spec and do send an extra packet.) > 2. Can i allocate memory using kmalloc in call back function? > i am getting following masseges on doing that.. > > ******************** in command_callback ********************** > Urb->status = 0x0 > Urb->actual_length = 0xc > before allocating memory > Debug: sleeping function called from invalid context at mm/slab.c:2126 > in_atomic():1, irqs_disabled():0 You can allocate memory using kmalloc provided you specify GFP_ATOMIC. Alan Stern ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
