[linux-dvb] Testers wanted for alternative version of Terratec Cinergy T2 driver

Thierry Merle thierry.merle at free.fr
Thu May 8 23:18:23 CEST 2008


Tomi Orava a écrit :
> 
> Hi,
> 
>>>> Well, I see some issues after taking a closer look at your driver:
>>>> 1- checkpatch.pl raises errors: 90 errors, 53 warnings, 995 lines
>>>> checked
>>>> 2- there is a compilation error (I applied the patch on the latest
>>>> v4l-dvb tree):
>>>> cinergyT2-core.c: In function 'cinergyt2_usb_probe':
>>>> cinergyT2-core.c:138: error: too few arguments to function
>>>> 'dvb_usb_device_init'
>>>> 3- you should replace the existing driver, not proposing a different
>>>> driver. I mean, patch directly
>>>> linux/drivers/media/dvb/cinergyT2/cinergyT2.c.
> 
> I did some cleanups pointed by the checkpach.pl script.
Good! No more error.

> However, I did not replace the original Cinergy T2 driver
> as I think that this new driver should be located in the
> very same directory as the rest of the usb-dvb drivers.
> 
Agreed, but you should remove the old cinergyT2 driver.

Furthermore there is another issue: when I plug the device, the device usage count is set to 0.
When I remove the device the device usage count goes to -1 (displayed as 4294967295).
This is a misbehavior of the dvb framework but perhaps something needs to be initialized somewhere in the driver. I will look at it...dvb-usb: TerraTec/qanu USB2.0 Highspeed DVB-T Receiver successfully initialized and connected.
I noticed this error when I plug the device (I load manually the driver before, so I suspect a thing in the probe function):
sysfs: duplicate filename 'cinergyT2' can not be created
WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()
Pid: 2922, comm: modprobe Not tainted 2.6.24.3 #13
 [<c017896a>] sysfs_add_one+0x54/0xb7
 [<c0178d8c>] create_dir+0x3c/0x6b
 [<c0178de8>] sysfs_create_dir+0x2d/0x40
 [<c01a8d07>] kobject_get+0xf/0x13
 [<c01a90fc>] kobject_add+0xd3/0x17a
 [<c01a91f7>] kobject_register+0x19/0x2d
 [<c02013b0>] bus_add_driver+0x50/0x197
 [<e00c7e07>] usb_register_driver+0x66/0xc8 [usbcore]
 [<c0142813>] __vunmap+0xbd/0xd1
 [<e023c018>] cinergyt2_init+0x18/0x5a [cinergyT2]
 [<c012421f>] blocking_notifier_call_chain+0x17/0x1a
 [<c012b688>] sys_init_module+0x11d4/0x12e9
 [<c0103bc2>] syscall_call+0x7/0xb
 [<c0280000>] __xfrm_lookup+0x1b/0x460
 =======================
kobject_add failed for cinergyT2 with -EEXIST, don't try to register things with the same name in the same directory.
Pid: 2922, comm: modprobe Not tainted 2.6.24.3 #13
 [<c01a9171>] kobject_add+0x148/0x17a
 [<c01a91f7>] kobject_register+0x19/0x2d
 [<c02013b0>] bus_add_driver+0x50/0x197
 [<e00c7e07>] usb_register_driver+0x66/0xc8 [usbcore]
 [<c0142813>] __vunmap+0xbd/0xd1
 [<e023c018>] cinergyt2_init+0x18/0x5a [cinergyT2]
 [<c012421f>] blocking_notifier_call_chain+0x17/0x1a
 [<c012b688>] sys_init_module+0x11d4/0x12e9
 [<c0103bc2>] syscall_call+0x7/0xb
 [<c0280000>] __xfrm_lookup+0x1b/0x460
 =======================
usbcore: error -17 registering interface 	driver cinergyT2

> The current patch is against the v4l-dvb tree.
> 
> Regards,
> Tomi Orava
> 
> diff -r 41b3f12d6ce4 linux/drivers/media/dvb/dvb-usb/Kconfig
> --- a/linux/drivers/media/dvb/dvb-usb/Kconfig	Tue May 06 11:09:01 2008 -0300
> +++ b/linux/drivers/media/dvb/dvb-usb/Kconfig	Wed May 07 22:34:53 2008 +0300
> @@ -241,3 +241,11 @@ config DVB_USB_AF9005_REMOTE
>  	  Say Y here to support the default remote control decoding for the
>  	  Afatech AF9005 based receiver.
>  
> +config 	DVB_USB_CINERGY_T2
> +	tristate "Alternative driver for Terratec CinergyT2/qanu USB2 DVB-T receiver"
Just remove the "Alternative" word.
[SNIP]
> diff -r 41b3f12d6ce4 linux/drivers/media/dvb/dvb-usb/cinergyT2-core.c
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/linux/drivers/media/dvb/dvb-usb/cinergyT2-core.c	Wed May 07 22:34:53 2008 +0300
> @@ -0,0 +1,235 @@
[SNIP]
> +
> +/* slightly modified version of dvb_usb_generic_rw -function */
> +
> +int cinergyt2_cmd(struct dvb_usb_device *d, char *wbuf, int wlen,
> +			char *rbuf, int rlen, int delay_ms)
> +{
I studied the differences between this function and the original dvb_usb_generic_rw function.
The only difference is that cinergyt2_cmd returns the number of bytes that usb_bulk_msg has read (actlen).
This value is only used in cinergyT2-remote that can be removed (see further) so this function should be removed and calls replaced by the original dvb_usb_generic_rw
[SNIP}
> diff -r 41b3f12d6ce4 linux/drivers/media/dvb/dvb-usb/cinergyT2-remote.c
> --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
> +++ b/linux/drivers/media/dvb/dvb-usb/cinergyT2-remote.c	Wed May 07 22:34:53 2008 +0300
> @@ -0,0 +1,336 @@
[SNIP]
> +struct cinergyt2_rc_key cinergyt2_rc_keys[] = {
> +	{ CINERGYT2_RC_EVENT_TYPE_NEC, 	0xfe01eb04, 	KEY_POWER },
In fact, the rc keycodes are nearly standard:
first byte=RC event type (CINERGYT2_RC_EVENT_TYPE_NONE, CINERGYT2_RC_EVENT_TYPE_NEC, CINERGYT2_RC_EVENT_TYPE_RC5)
then comes a couple of bytes: the custom code=0x04 and the custom code "checksum" =0xeb
then the last couple of bytes: the key code=0x01 and the key code checksum=0xfe
This processing is done in a same way in dvd-usb-remote.
I joined to this email a patch against your patch that uses this module. Obviously you can integrate in your patch .
I will look at the module count problem and the irrecord problem, we are close to propose this beautiful patch ;)
Cheers,
Thierry

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: remove_cinergyT2_remote.patch
Url: http://www.linuxtv.org/pipermail/linux-dvb/attachments/20080508/14331185/attachment-0001.txt 


More information about the linux-dvb mailing list