[linux-dvb] S2API: Problem with 64/32bit compatibility

Ralph Heidelberg RHeidelberg at pctvsystems.com
Fri May 25 10:13:34 CEST 2012


	Hi guys.
	
	I would like to revoke this issue.
	http://linuxtv.org/pipermail/linux-dvb/2009-January/031436.html
	
	Are there any plans to fix this?
	A possible solution would be:
	
	
	struct dtv_property2 {
		__u32 cmd;
		__u32 reserved[3];
		union {
			__u32 data;
			struct {
				__u8 data[32];
				__u32 len;
				__u32 reserved1[3];
				__u32 reserved2;
			} buffer;
		} u;
		__s32 result;
	}
	
	struct dtv_properties2 {
	        __u32 num;
	        struct dtv_property2 props[64];
	};
	
	#define FE_SET_PROPERTY2   _IOW('o', 92, struct dtv_properties2)
	#define FE_GET_PROPERTY2   _IOR('o', 93, struct dtv_properties2)
	 
	What do you think?
	
	Best regards,
	Ralph Heidelberg
	Senior Software Engineer
	PCTV Systems S.a.r.l.
	(a division of Hauppauge)
	
	
________________________________

	Original message:
	
	Hi!
	  I would like to report a problem with S2API. It looks that it doesn't
	maintain 64/32bit compatibility.
	  It began with my attempt to run the SVN version of kaffeine on linux-2.6.28.
	  My system is a 64bit GNU/Linux, but, for historical reasons, I'm still using
	32bit KDE 3.5.10, so kaffeine has been compiled as a 32bit binary.
	  I've found that I cannot play DVB on this combination. It's because the
	FE_SET_PROPERTY ioctl is not properly handled in the kernel.
	  After a lot of analysis of both kaffeine and kernel source code, I've found
	that the core of the problem is in /usr/src/linux/include/linux/dvb/frontend.h,
	where the ioctl is declared. There, a struct dtv_properties is declared:
	
	struct dtv_properties {
	        __u32 num;
	        struct dtv_property *props;
	};
	
	  This struct is then used as a data entry in the FE_SET_PROPERTY ioctl.
	  The problem is, that the pointer has different sizes on 32 and 64bit
	architectures, so the whole struct differs in size too. And because the size
	is passed as a part of the ioctl command code, the FE_SET_PROPERTY (and
	FE_GET_PROPERTY too) command codes differ for 32/64 bit compilation of the
	same include file! For example, for FE_SET_PROPERTY, its 0x40106f52 on 64bit,
	but 0x40086f52 on 32bit. So, the kernel (having the 64bit code inside) cannot
	recognize the 32bit code of the cmd and fails to handle it correctly.
	  The second part is that these ioctls are not yet added to the 
	/usr/src/linux/fs/compat_ioctl.c file, maybe just because of the problem above.
	
	  Are there plans to fix this problem ? I think that 64/32bit compatibility
	should be fully maintained, I think that my case is not so rare yet.
	
	  With regards, Pavel Troller   
	


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.linuxtv.org/pipermail/linux-dvb/attachments/20120525/2a86869b/attachment.html>


More information about the linux-dvb mailing list