Re: bttv.h: #define VBIBUF_SIZE 65536

Edgar Toernig (froese@gmx.de)
Fri, 05 Feb 1999 04:54:20 +0100


Hi,

Alan Cox wrote:
> > IIRC, the correct value, according to the Teletext standards, would
> > be 19*2*2k.
> >
> > Please, either revert that part of the 2.2.1 changes or add the
> > BTTV_VERSION ioctl to vbi_ioctl (I've already sent an appropriate
> > patch long ago; only 4 or 5 lines) so that I may auto detect the
> > right buffer size. Even better would be a VBI_BUFSIZE or so ioctl.
>
> VBI still needs an API definition. Nathan was going to do one. Contributions
> are accepted

Would you then include the following patch, please.

--- linux-2.2.1/drivers/char/bttv.h.orig Fri Feb 5 03:57:57 1999
+++ linux-2.2.1/drivers/char/bttv.h Fri Feb 5 04:05:38 1999
@@ -21,7 +21,7 @@
#ifndef _BTTV_H_
#define _BTTV_H_

-#define BTTV_VERSION_CODE 0x000523
+#define BTTV_VERSION_CODE 0x000524 /* please incr on every released change. */

#include <linux/types.h>
#include <linux/wait.h>
@@ -191,6 +191,7 @@
#define BTTV_VERSION _IOR('v' , BASE_VIDIOCPRIVATE+6, int)
#define BTTV_PICNR _IOR('v' , BASE_VIDIOCPRIVATE+7, int)

+#define BTTV_VBISIZE _IOR('v' , BASE_VIDIOCPRIVATE+48, int[2])

#define BTTV_UNKNOWN 0x00
#define BTTV_MIRO 0x01
--- linux-2.2.1/drivers/char/bttv.c.orig Fri Feb 5 03:57:54 1999
+++ linux-2.2.1/drivers/char/bttv.c Fri Feb 5 04:09:56 1999
@@ -2317,6 +2317,23 @@

static int vbi_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
{
+ switch (cmd)
+ {
+ case BTTV_VERSION:
+ {
+ return BTTV_VERSION_CODE;
+ }
+ case BTTV_VBISIZE:
+ {
+ int s[2];
+
+ s[0] = VBIBUF_SIZE; // complete buffer size
+ s[1] = 2048; // size of a single line
+ if (copy_to_user(arg, s, sizeof(s)))
+ return -EFAULT;
+ return 0;
+ }
+ }
return -EINVAL;
}

Thanks, ET.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/