Re: [PATCH] Re: [PATCH] Multi protocol support (stage #1)

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

 



On Sun, May 21, 2006, Trent Piepho wrote:
> On Sun, 21 May 2006, Johannes Stezenbach wrote:
> >
> > For binary compatibility it isn't sufficient to just add new
> > fields to struct dvbs2_params. There must also be an indicator
> > which the kernel can use to see if struct dvb_frontend_params
> > was prepared by old or new userspace, i.e. if the new fields
> > are valid or contain uninitialized data.
> 
> Would this work:
> 
> Userspace programs must memset the entire dvbfe_params struct to zero.  This
> in effect sets every field to XXXX_IGNORE.

You can't rely on that, and for some fields 0 is a valid value.

> Then userspace programs set the fields they know about to their (non-zero)
> values.
> 
> If the kernel gets DVBFE_SET_PARAMS and a field is zero, that means the
> userspace program was using an old api before that field existed.  The
> driver should do whatever it would do before the field was there.

Some people may like to write code like this:

int dvbs2_tune(int f, int sr, enum dvbfe_modulation mod, enum dvbfe_fec fec)
{
	struct dvbfe_params foo = {
		.frequency = f,
		{
			.dvbs2 = {
				.symbol_rate = sr,
				.modulation = mod,
				.fec = fec
			}

		}
	};
	return ioctl(fefd, DVBFE_SET_PARAMS, &foo) == 0;
}


Johannes

_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux