From c2f86b643880b83936a1fd7ea49d1c19410aed9c Mon Sep 17 00:00:00 2001 From: rjkm Date: Sat, 12 Feb 2022 16:39:01 +0100 Subject: [PATCH] add MCI ioctl to be used through modX devices --- ddbridge/ddbridge-modulator.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ddbridge/ddbridge-modulator.c b/ddbridge/ddbridge-modulator.c index 12f57e4..35d1c7c 100644 --- a/ddbridge/ddbridge-modulator.c +++ b/ddbridge/ddbridge-modulator.c @@ -1848,6 +1848,27 @@ int ddbridge_mod_do_ioctl(struct file *file, unsigned int cmd, void *parg) mod->pcr_correction = cp->pcr_correction; break; } + case IOCTL_DDB_MCI_CMD: + { + struct ddb_mci_msg *msg = + (struct ddb_mci_msg __user *) parg; + struct ddb_link *link; + + if (dev->link[0].ids.revision != 1) + break; + + if (msg->link > 3) { + ret = -EFAULT; + break; + } + link = &dev->link[msg->link]; + if (!link->mci_ok) { + ret = -EFAULT; + break; + } + ret = ddb_mci_cmd_link(link, &msg->cmd, &msg->res); + break; + } default: ret = -EINVAL; break;