Bug 176339 - Printer identification fails -- no compatibility ioctl magic for LPIOC_GET_DEVICE_ID
Printer identification fails -- no compatibility ioctl magic for LPIOC_GET_DE...
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Pete Zaitcev
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-12-21 10:52 EST by David Woodhouse
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-08 17:18:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
fix (807 bytes, patch)
2005-12-21 18:55 EST, David Woodhouse
no flags Details | Diff
fix (828 bytes, patch)
2005-12-21 19:43 EST, Pete Zaitcev
no flags Details | Diff

  None (edit)
Description David Woodhouse 2005-12-21 10:52:48 EST
system-config-printer is unable to tell me what kind of printer is attached.

ioctl32(hald-probe-prin:28850): Unknown cmd fd(4) cmd(44005001){04}
arg(ffb66568) on /dev/usb/lp0
Comment 1 Pete Zaitcev 2005-12-21 16:12:47 EST
The ioctl by itself needs no translation, because it returns a strings.
But adding COMPAT_IOCTL won't work, because this thing accepts a variable
length with _IOC_SIZE(cmd). Joy.
Comment 2 David Woodhouse 2005-12-21 18:55:34 EST
Created attachment 122508 [details]
fix

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

Actually, this patch works -- almost. It fixes the kernel side, but the usblp.c
code still rejects what system-config-printer does, because
system-config-printer actually uses ioctl cmd=0x84005001 (P nr=1 len=1024
dir=4) instead of the expected cmd=0x4xxx5001 (P nr=1 len=xxx dir=2) -- i.e. it
looks like it's using _IOW('P',1,size} instead of _IOR('P',1,size) for its
definition of the ioctl.
Comment 3 David Woodhouse 2005-12-21 19:06:08 EST
OMFG it's not defined using _IOx() at all. It's this...

        magic_perl = "perl -e 'ioctl(STDIN,0x84005001,$result);"
        magic_perl += "print $result' 2>/dev/null <"
        foo = os.popen (magic_perl + dev)
Comment 4 David Woodhouse 2005-12-21 19:14:51 EST
The system-config-printer gem above is filed as bug #176381, and I'm tempted to
submit it to thedailywtf.com too.
Comment 5 Pete Zaitcev 2005-12-21 19:43:37 EST
Created attachment 122509 [details]
fix

I think this is what David meant (tested to build).
Comment 6 Dave Jones 2006-02-03 02:00:00 EST
This is a mass-update to all currently open kernel bugs.

A new kernel update has been released (Version: 2.6.15-1.1830_FC4)
based upon a new upstream kernel release.

Please retest against this new kernel, as a large number of patches
go into each upstream release, possibly including changes that
may address this problem.

This bug has been placed in NEEDINFO_REPORTER state.
Due to the large volume of inactive bugs in bugzilla, if this bug is
still in this state in two weeks time, it will be closed.

Should this bug still be relevant after this period, the reporter
can reopen the bug at any time. Any other users on the Cc: list
of this bug can request that the bug be reopened by adding a
comment to the bug.

If this bug is a problem preventing you from installing the
release this version is filed against, please see bug 169613.

Thank you.
Comment 7 Pete Zaitcev 2006-02-13 16:02:51 EST
The fix is upstream in 2.6.16-rc2, but we won't be seing this in FC-4
unless we rebase. Dunno, maybe we should carry the patch until then?
Comment 8 David Woodhouse 2006-02-14 11:51:23 EST
Not a lot of point in it unless the userspace side is also going to be updated
for FC-4.
Comment 9 Pete Zaitcev 2006-07-08 17:18:26 EDT
I presume this is fixed in FC-5.

Note You need to log in before you can comment on or make changes to this bug.