Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: SysFS Support



Helmut Auer wrote:
> 
> Klaus Schmidinger wrote:
> 
> >Helmut Auer wrote:
> >
> >
> >>Hello,
> >>After upgrading to kernel 2.6.2 I have to patch dvbdevice.c because
> >>/proc/video is no longer used.
> >>Its now in /sys and the contents of the file is also different . Are you
> >>aware of that, Klaus ?
> >>
> >>
> >
> >No, I don't use kernel 2.6.
> >Can you provide a patch that automatically handles this, depending on which
> >kernel VDR is compiled on?
> >
> >Klaus
> >
> >
> >
> >
> Hello,
> I've only made a quick and dirty patch ( its checking for av7110 ).
> 
> Hope it helps anyway
> 
> --
> Helmut Auer, helmut@helmutauer.de
> 
> --- dvbdevice.c.org     2004-02-13 14:01:58.000000000 +0100
> +++ dvbdevice.c 2004-02-13 14:07:26.000000000 +0100
> @@ -637,7 +637,36 @@
>        }
>        fclose(f);
>      }
> -    fclose(f);
> +    if( f == (FILE *)NULL ) // if not found check for sysfs structure
> +    {
> +       ofs = -1;
> +       while (1) {
> +         snprintf(buffer, sizeof buffer, "/sys/class/video4linux/video%d/name", ++ofs);
> +         if ((f = fopen(buffer, "r")) == (FILE *)NULL) { // does not exist?
> +           ofs = 0;
> +           break;
> +         }
> +         if (fgets(buffer, sizeof buffer, f)) {
> +           if (strstr(buffer, "av7110")) // found the _first_ DVB card - works only for AV7110 cause I don't know it better
> +           {
> +              break;
> +           }
> +         }
> +         else {
> +           ofs = 0;
> +           break;
> +         }
> +         fclose(f);
> +       }
> +       if( f != (FILE *)NULL ) // if not found check for sysfs structure
> +       {
> +          fclose(f);
> +       }
> +    }
> +    else
> +    {
> +       fclose(f);
> +    }
>    }
>    snprintf(buffer, sizeof(buffer), "%s%d", DEV_VIDEO, CardIndex() + ofs);  int videoDev = open(buffer, O_RDWR);
>    if (videoDev < 0)

Can you please make this against VDR version 1.3.4?

Klaus


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index