The patch number 9004 was added via Steven Toth <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Steven Toth  <[EMAIL PROTECTED]>
S2API: Implement GET/SET handing to the demods


The frontends will be notified (if they chose) of all _get and _set commands
so they can help determine result or action. Results are now returned
to userspace correctly.

Priority: normal

Signed-off-by: Steven Toth <[EMAIL PROTECTED]>


---

 linux/drivers/media/dvb/dvb-core/dvb_frontend.c |   21 ++++++++++++----
 linux/drivers/media/dvb/dvb-core/dvb_frontend.h |    1 
 linux/drivers/media/dvb/frontends/cx24116.c     |    8 +++---
 3 files changed, 21 insertions(+), 9 deletions(-)

diff -r 334f2de9221c -r 9e583c6fa374 
linux/drivers/media/dvb/dvb-core/dvb_frontend.c
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c   Fri Sep 12 00:34:28 
2008 -0400
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c   Fri Sep 12 00:37:37 
2008 -0400
@@ -1115,6 +1115,13 @@ int dtv_property_process_get(struct dvb_
 
        dtv_property_dump(tvp);
 
+       /* Allow the frontend to validate incoming properties */
+       if (fe->ops.get_property)
+               r = fe->ops.get_property(fe, tvp);
+
+       if (r < 0)
+               return r;
+
        switch(tvp->cmd) {
        case DTV_FREQUENCY:
                tvp->u.data = fe->dtv_property_cache.frequency;
@@ -1198,6 +1205,13 @@ int dtv_property_process_set(struct dvb_
        struct dvb_frontend_private *fepriv = fe->frontend_priv;
        printk("%s()\n", __FUNCTION__);
        dtv_property_dump(tvp);
+
+       /* Allow the frontend to validate incoming properties */
+       if (fe->ops.set_property)
+               r = fe->ops.set_property(fe, tvp);
+
+       if (r < 0)
+               return r;
 
        switch(tvp->cmd) {
        case DTV_CLEAR:
@@ -1342,12 +1356,12 @@ static int dvb_frontend_ioctl_properties
                }
 
                for (i = 0; i < tvps->num; i++)
-                       dtv_property_process_set(fe, tvp + i, inode, file);
+                       err |= dtv_property_process_set(fe, tvp + i, inode, 
file);
 
                if(fe->dtv_property_cache.state == DTV_TUNE) {
                        printk("%s() Property cache is full, tuning\n", 
__FUNCTION__);
                }
-               err = 0;
+
        } else
        if(cmd == FE_GET_PROPERTY) {
                printk("%s() FE_GET_PROPERTY\n", __FUNCTION__);
@@ -1375,14 +1389,13 @@ static int dvb_frontend_ioctl_properties
                }
 
                for (i = 0; i < tvps->num; i++)
-                       dtv_property_process_get(fe, tvp + i, inode, file);
+                       err |= dtv_property_process_get(fe, tvp + i, inode, 
file);
 
                if (copy_to_user(tvps->props, tvp, tvps->num * sizeof(struct 
dtv_property))) {
                        err = -EFAULT;
                        goto out;
                }
 
-               err = 0;
        } else
                err = -EOPNOTSUPP;
 
diff -r 334f2de9221c -r 9e583c6fa374 
linux/drivers/media/dvb/dvb-core/dvb_frontend.h
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.h   Fri Sep 12 00:34:28 
2008 -0400
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.h   Fri Sep 12 00:37:37 
2008 -0400
@@ -172,7 +172,6 @@ struct dvb_frontend_ops {
 
        int (*set_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
        int (*get_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
-       int (*set_params)(struct dvb_frontend* fe);
 };
 
 #define MAX_EVENT 8
diff -r 334f2de9221c -r 9e583c6fa374 linux/drivers/media/dvb/frontends/cx24116.c
--- a/linux/drivers/media/dvb/frontends/cx24116.c       Fri Sep 12 00:34:28 
2008 -0400
+++ b/linux/drivers/media/dvb/frontends/cx24116.c       Fri Sep 12 00:37:37 
2008 -0400
@@ -802,9 +802,9 @@ static int cx24116_set_property(struct d
        return 0;
 }
 
-static int cx24116_set_params(struct dvb_frontend *fe)
-{
-       dprintk("%s(..) We were notified that a tune request may occur\n", 
__func__);
+static int cx24116_get_property(struct dvb_frontend *fe, struct dtv_property* 
tvp)
+{
+       dprintk("%s(..)\n", __func__);
        return 0;
 }
 
@@ -964,7 +964,7 @@ static struct dvb_frontend_ops cx24116_o
        .diseqc_send_burst = cx24116_diseqc_send_burst,
 
        .set_property = cx24116_set_property,
-       .set_params = cx24116_set_params,
+       .get_property = cx24116_get_property,
        .set_frontend = cx24116_set_frontend,
 };
 


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/9e583c6fa37424e89d254643e7c78b6e714a21ff

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to