[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-usb-devel
Subject:    Re: [linux-usb-devel] usblp : Seiko/Epson Printer M129C
From:       Richard Clark <richardc () bifco ! com>
Date:       2007-12-23 22:31:47
Message-ID: 1198449107.7247.27.camel () gullinux ! yxx ! cybrick ! ca
[Download RAW message or body]

> > 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?
> 

I have looked through the USB Device Class Def for Printing Devices, and
through the USB 1.1 spec but I can't find anything that answers it.  

>From reading the Linux Device Drivers manual, things like
usb_bulk_message having a timeout parm makes me think that in general,
if there is not data, the bulk endpoint will not return without data.

This printer already deviates from the device class spec in other
regards.

> > 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 ?  
> > 
> Can you send this in diff format so we can see exactly what was changed?

Yes, sorry, my bad.

--- drivers/usb/class/usblp.c.orig   2007-07-08 16:32:17.000000000 -0700
+++ drivers/usb/class/usblp.c     2007-12-19 17:30:41.000000000 -0800
@@ -277,27 +277,32 @@
 
 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);
-       usblp->rcomplete = 1;
+       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);
 }



-------------------------------------------------------------------------
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@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic