Am Montag, den 21.09.2009, 06:42 +0200 schrieb Markus Rechberger:
> On Mon, Sep 21, 2009 at 6:10 AM, hermann pitton <hermann-pit...@arcor.de> 
> wrote:
> >
> > Am Montag, den 21.09.2009, 06:09 +0200 schrieb Markus Rechberger:
> >> On Mon, Sep 21, 2009 at 5:46 AM, hermann pitton <hermann-pit...@arcor.de> 
> >> wrote:
> >> >
> >> > Am Montag, den 21.09.2009, 05:40 +0200 schrieb Markus Rechberger:
> >> >> while porting the S2api to userspace I came accross the S2-API 
> >> >> definition itself
> >> >>
> >> >> #define FE_SET_PROPERTY            _IOW('o', 82, struct dtv_properties)
> >> >> #define FE_GET_PROPERTY            _IOR('o', 83, struct dtv_properties)
> >> >>
> >> >> while looking at this, FE_GET_PROPERTY should very likely be _IOWR
> >> >>
> >> >> in dvb-frontend.c:
> >> >> ----
> >> >>         if(cmd == FE_GET_PROPERTY) {
> >> >>
> >> >>                 tvps = (struct dtv_properties __user *)parg;
> >> >>
> >> >>                 dprintk("%s() properties.num = %d\n", __func__, 
> >> >> tvps->num);
> >> >>                 dprintk("%s() properties.props = %p\n", __func__, 
> >> >> tvps->props);
> >> >>                 ...
> >> >>                 if (copy_from_user(tvp, tvps->props, tvps->num *
> >> >> sizeof(struct dtv_property)))
> >> >> ----
> >> >>
> >> >> Regards,
> >> >> Markus
> >> >
> >> > Seems to be a big issue.
> >> >
> >> > Why you ever want to write to a get property?
> >> >
> >>
> >> to read out the API version for example.
> >> tvps->num is also used in order to check the boundaries of the property 
> >> array.
> >>
> >> Markus
> >
> > Their are no writes allowed to manipulate get properties.
> >
> 
> the writes are needed in order to submit tvps->num, although _IOR will
> work _IOWR is the correct one in that case, aside of that you can just
> compare it with other calls (eg. v4l2), the ENUM calls are all _IOWR.
> They submit the index and retrieve the rest.
> 
> Markus

OK,

thought I'll have never to care for it again.

ENUM calls should never be W.

Hit me for all I missed.

Cheers,
Hermann


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to