Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 157670 Details for
Bug 236736
No paper-out notification for USB devices
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch "X4" - may be ready now
linux-2.6.22-rc3-usblp-X4.diff (text/plain), 4.29 KB, created by
Pete Zaitcev
on 2007-06-23 00:22:55 UTC
(
hide
)
Description:
Patch "X4" - may be ready now
Filename:
MIME Type:
Creator:
Pete Zaitcev
Created:
2007-06-23 00:22:55 UTC
Size:
4.29 KB
patch
obsolete
>diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c >index 7b1edfe..b0c4d1e 100644 >--- a/drivers/usb/class/usblp.c >+++ b/drivers/usb/class/usblp.c >@@ -69,7 +69,6 @@ > #define USBLP_DEVICE_ID_SIZE 1024 > > /* ioctls: */ >-#define LPGETSTATUS 0x060b /* same as in drivers/char/lp.c */ > #define IOCNR_GET_DEVICE_ID 1 > #define IOCNR_GET_PROTOCOLS 2 > #define IOCNR_SET_PROTOCOL 3 >@@ -150,10 +149,12 @@ struct usblp { > int wcomplete; /* writing is completed */ > int rcomplete; /* reading is completed */ > unsigned int quirks; /* quirks flags */ >+ unsigned int flags; /* mode flags */ > unsigned char used; /* True if open */ > unsigned char present; /* True if not disconnected */ > unsigned char bidir; /* interface is bidirectional */ > unsigned char sleeping; /* interface is suspended */ >+ unsigned char no_paper; /* Paper Out happened */ > unsigned char *device_id_string; /* IEEE 1284 DEVICE ID string (ptr) */ > /* first 2 bytes are (big-endian) length */ > }; >@@ -303,6 +304,7 @@ static void usblp_bulk_write(struct urb *urb) > if (unlikely(urb->status)) > warn("usblp%d: nonzero read/write bulk status received: %d", > usblp->minor, urb->status); >+ usblp->no_paper = 0; > usblp->wcomplete = 1; > unplug: > wake_up_interruptible(&usblp->wait); >@@ -347,10 +349,8 @@ static int handle_bidir (struct usblp *usblp) > if (usblp->bidir && usblp->used && !usblp->sleeping) { > usblp->readcount = 0; > usblp->readurb->dev = usblp->dev; >- if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0) { >- usblp->used = 0; >+ if (usb_submit_urb(usblp->readurb, GFP_KERNEL) < 0) > return -EIO; >- } > } > > return 0; >@@ -386,18 +386,10 @@ static int usblp_open(struct inode *inode, struct file *file) > goto out; > > /* >- * TODO: need to implement LP_ABORTOPEN + O_NONBLOCK as in drivers/char/lp.c ??? >- * This is #if 0-ed because we *don't* want to fail an open >- * just because the printer is off-line. >+ * We do not implement LP_ABORTOPEN/LPABORTOPEN for two reasons: >+ * - We do not want persistent state which close(2) does not clear >+ * - It is not used anyway, according to CUPS people > */ >-#if 0 >- if ((retval = usblp_check_status(usblp, 0))) { >- retval = retval > 1 ? -EIO : -ENOSPC; >- goto out; >- } >-#else >- retval = 0; >-#endif > > retval = usb_autopm_get_interface(intf); > if (retval < 0) >@@ -412,6 +404,7 @@ static int usblp_open(struct inode *inode, struct file *file) > usblp->readurb->status = 0; > > if (handle_bidir(usblp) < 0) { >+ usblp->used = 0; > file->private_data = NULL; > retval = -EIO; > } >@@ -442,6 +435,8 @@ static int usblp_release(struct inode *inode, struct file *file) > { > struct usblp *usblp = file->private_data; > >+ usblp->flags &= ~LP_ABORT; >+ > mutex_lock (&usblp_mutex); > usblp->used = 0; > if (usblp->present) { >@@ -459,7 +454,7 @@ static unsigned int usblp_poll(struct file *file, struct poll_table_struct *wait > struct usblp *usblp = file->private_data; > poll_wait(file, &usblp->wait, wait); > return ((!usblp->bidir || !usblp->rcomplete) ? 0 : POLLIN | POLLRDNORM) >- | (!usblp->wcomplete ? 0 : POLLOUT | POLLWRNORM); >+ | ((usblp->no_paper || usblp->wcomplete) ? POLLOUT | POLLWRNORM : 0); > } > > static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) >@@ -645,6 +640,13 @@ static long usblp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) > retval = -EFAULT; > break; > >+ case LPABORT: >+ if (arg) >+ usblp->flags |= LP_ABORT; >+ else >+ usblp->flags &= ~LP_ABORT; >+ break; >+ > default: > retval = -ENOTTY; > } >@@ -697,6 +699,13 @@ static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t > err = usblp_check_status(usblp, err); > mutex_unlock (&usblp->mut); > >+ if ((usblp->flags & LP_ABORT) != 0 && >+ !usblp->wcomplete && err == 1) { /* Paper out */ >+ usblp->no_paper = 1; >+ writecount += transfer_length; >+ return writecount ? writecount : -ENOSPC; >+ } >+ > /* if the fault was due to disconnect, let khubd's > * call to usblp_disconnect() grab usblp->mut ... > */ >@@ -730,6 +739,7 @@ static ssize_t usblp_write(struct file *file, const char __user *buffer, size_t > usblp->wcomplete = 0; > err = usb_submit_urb(usblp->writeurb, GFP_KERNEL); > if (err) { >+ usblp->no_paper = 0; > usblp->wcomplete = 1; > if (err != -ENOMEM) > count = -EIO;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 236736
:
153022
|
155659
|
156865
| 157670 |
157906