Bug 176339

Summary: Printer identification fails -- no compatibility ioctl magic for LPIOC_GET_DEVICE_ID
Product: [Fedora] Fedora Reporter: David Woodhouse <dwmw2>
Component: kernelAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED NEXTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: davej, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-08 21:18:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
fix
none
fix none

Description David Woodhouse 2005-12-21 15:52:48 UTC
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 21:12:47 UTC
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 23:55:34 UTC
Created attachment 122508 [details]
fix

Signed-off-by: David Woodhouse <dwmw2>

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-22 00:06:08 UTC
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-22 00:14:51 UTC
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-22 00:43:37 UTC
Created attachment 122509 [details]
fix

I think this is what David meant (tested to build).

Comment 6 Dave Jones 2006-02-03 07:00:00 UTC
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 21:02:51 UTC
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 16:51:23 UTC
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 21:18:26 UTC
I presume this is fixed in FC-5.