On Wed, Dec 19, 2007 at 06:00:26PM -0800, Richard Clark wrote: > I am using an Epson BA-T500 controller board that identifies itself the > same as the Seiko/Epson Printer M129C that was recently added to the > kernel. > > In the past I had used my own driver created off of usb-skeleton.c, and > I did not bother with the bi-directional side. > > Now that it's in the usblp.c driver, along with it's quirks, I am > starting to make use of the inbound bulk endpoint for printer status. > > My problem is that even if there is no data present, the URB request > completes and usblp->rcomplete is flagged. This is causing my > poll/select call to always trigger even when there is no data. > > Question - 1 > Is this action normal for class based usb printers ? ie, the URB request > will complete and return even if there is no data. What does the usb printer spec say about this? > Question - 2 > I have solved my problem by changing the usblp_buld_read callback to > check for data before flaging usblp->rcomplete, and if not, resubmitting > the URB. Is there any problem with doing as I have below ? > > static void usblp_bulk_read(struct urb *urb) > { > struct usblp *usblp = urb->context; > > if (unlikely(!usblp || !usblp->dev || !usblp->used)) > return; > > if (unlikely(!usblp->present)) > goto unplug; > if (unlikely(urb->status)) > warn("usblp%d: nonzero read/write bulk status received: > %d", > usblp->minor, urb->status); > if (urb->actual_length) > usblp->rcomplete = 1; > else { > if (usb_submit_urb(usblp->readurb, GFP_ATOMIC) < 0) > err("usblp%d: Error resubmitting read urb", > usblp->minor); > } > unplug: > wake_up_interruptible(&usblp->wait); > } Can you send this in diff format so we can see exactly what was changed? thanks, greg k-h ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel