aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c13
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.h21
-rw-r--r--drivers/media/dvb/dvb-usb-v2/dvb_usb.h3
-rw-r--r--drivers/media/dvb/dvb-usb-v2/dvb_usb_core.c2
-rw-r--r--drivers/media/dvb/dvb-usb-v2/mxl111sf.c30
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-dvb.c1
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb.h2
-rw-r--r--drivers/media/video/cx23885/cx23885-dvb.c3
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c2
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c2
-rw-r--r--drivers/media/video/videobuf-dvb.c11
-rw-r--r--include/media/videobuf-dvb.h4
12 files changed, 9 insertions, 85 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 3a0f24547196..12e5eb1fff76 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -2060,18 +2060,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
2060 struct dvb_frontend *fe = dvbdev->priv; 2060 struct dvb_frontend *fe = dvbdev->priv;
2061 struct dvb_frontend_private *fepriv = fe->frontend_priv; 2061 struct dvb_frontend_private *fepriv = fe->frontend_priv;
2062 struct dtv_frontend_properties *c = &fe->dtv_property_cache; 2062 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
2063 int cb_err, err = -EOPNOTSUPP; 2063 int err = -EOPNOTSUPP;
2064
2065 if (fe->dvb->fe_ioctl_override) {
2066 cb_err = fe->dvb->fe_ioctl_override(fe, cmd, parg,
2067 DVB_FE_IOCTL_PRE);
2068 if (cb_err < 0)
2069 return cb_err;
2070 if (cb_err > 0)
2071 return 0;
2072 /* fe_ioctl_override returning 0 allows
2073 * dvb-core to continue handling the ioctl */
2074 }
2075 2064
2076 switch (cmd) { 2065 switch (cmd) {
2077 case FE_GET_INFO: { 2066 case FE_GET_INFO: {
diff --git a/drivers/media/dvb/dvb-core/dvbdev.h b/drivers/media/dvb/dvb-core/dvbdev.h
index 3b2c137b182c..93a9470d3f0c 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/drivers/media/dvb/dvb-core/dvbdev.h
@@ -71,27 +71,6 @@ struct dvb_adapter {
71 int mfe_shared; /* indicates mutually exclusive frontends */ 71 int mfe_shared; /* indicates mutually exclusive frontends */
72 struct dvb_device *mfe_dvbdev; /* frontend device in use */ 72 struct dvb_device *mfe_dvbdev; /* frontend device in use */
73 struct mutex mfe_lock; /* access lock for thread creation */ 73 struct mutex mfe_lock; /* access lock for thread creation */
74
75 /* Allow the adapter/bridge driver to perform an action before and/or
76 * after the core handles an ioctl:
77 *
78 * DVB_FE_IOCTL_PRE indicates that the ioctl has not yet been handled.
79 *
80 * When DVB_FE_IOCTL_PRE is passed to the callback as the stage arg:
81 *
82 * return 0 to allow dvb-core to handle the ioctl.
83 * return a positive int to prevent dvb-core from handling the ioctl,
84 * and exit without error.
85 * return a negative int to prevent dvb-core from handling the ioctl,
86 * and return that value as an error.
87 *
88 * WARNING: Don't use it on newer drivers: this only affects DVBv3
89 * calls, and should be removed soon.
90 */
91#define DVB_FE_IOCTL_PRE 0
92 int (*fe_ioctl_override)(struct dvb_frontend *fe,
93 unsigned int cmd, void *parg,
94 unsigned int stage);
95}; 74};
96 75
97 76
diff --git a/drivers/media/dvb/dvb-usb-v2/dvb_usb.h b/drivers/media/dvb/dvb-usb-v2/dvb_usb.h
index 773817b5fe06..79b3b8b6750d 100644
--- a/drivers/media/dvb/dvb-usb-v2/dvb_usb.h
+++ b/drivers/media/dvb/dvb-usb-v2/dvb_usb.h
@@ -206,7 +206,6 @@ struct dvb_usb_adapter_properties {
206 * @tuner_attach: called to attach the possible tuners 206 * @tuner_attach: called to attach the possible tuners
207 * @frontend_ctrl: called to power on/off active frontend 207 * @frontend_ctrl: called to power on/off active frontend
208 * @streaming_ctrl: called to start/stop the usb streaming of adapter 208 * @streaming_ctrl: called to start/stop the usb streaming of adapter
209 * @fe_ioctl_override: frontend ioctl override. avoid using that is possible
210 * @init: called after adapters are created in order to finalize device 209 * @init: called after adapters are created in order to finalize device
211 * configuration 210 * configuration
212 * @exit: called when driver is unloaded 211 * @exit: called when driver is unloaded
@@ -247,8 +246,6 @@ struct dvb_usb_device_properties {
247 int (*tuner_attach) (struct dvb_usb_adapter *); 246 int (*tuner_attach) (struct dvb_usb_adapter *);
248 int (*frontend_ctrl) (struct dvb_frontend *, int); 247 int (*frontend_ctrl) (struct dvb_frontend *, int);
249 int (*streaming_ctrl) (struct dvb_frontend *, int); 248 int (*streaming_ctrl) (struct dvb_frontend *, int);
250 int (*fe_ioctl_override) (struct dvb_frontend *,
251 unsigned int, void *, unsigned int);
252 int (*init) (struct dvb_usb_device *); 249 int (*init) (struct dvb_usb_device *);
253 void (*exit) (struct dvb_usb_device *); 250 void (*exit) (struct dvb_usb_device *);
254 int (*get_rc_config) (struct dvb_usb_device *, struct dvb_usb_rc *); 251 int (*get_rc_config) (struct dvb_usb_device *, struct dvb_usb_rc *);
diff --git a/drivers/media/dvb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/dvb/dvb-usb-v2/dvb_usb_core.c
index 3224621e1f32..a72f9c7de682 100644
--- a/drivers/media/dvb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/dvb/dvb-usb-v2/dvb_usb_core.c
@@ -703,8 +703,6 @@ static int dvb_usbv2_adapter_init(struct dvb_usb_device *d)
703 /* use exclusive FE lock if there is multiple shared FEs */ 703 /* use exclusive FE lock if there is multiple shared FEs */
704 if (adap->fe[1]) 704 if (adap->fe[1])
705 adap->dvb_adap.mfe_shared = 1; 705 adap->dvb_adap.mfe_shared = 1;
706
707 adap->dvb_adap.fe_ioctl_override = d->props->fe_ioctl_override;
708 } 706 }
709 707
710 return 0; 708 return 0;
diff --git a/drivers/media/dvb/dvb-usb-v2/mxl111sf.c b/drivers/media/dvb/dvb-usb-v2/mxl111sf.c
index 861e0ae2abc5..efdcb15358f1 100644
--- a/drivers/media/dvb/dvb-usb-v2/mxl111sf.c
+++ b/drivers/media/dvb/dvb-usb-v2/mxl111sf.c
@@ -874,34 +874,12 @@ static int mxl111sf_attach_tuner(struct dvb_usb_adapter *adap)
874 if (dvb_attach(mxl111sf_tuner_attach, adap->fe[i], state, 874 if (dvb_attach(mxl111sf_tuner_attach, adap->fe[i], state,
875 &mxl_tuner_config) == NULL) 875 &mxl_tuner_config) == NULL)
876 return -EIO; 876 return -EIO;
877 adap->fe[i]->ops.read_signal_strength = adap->fe[i]->ops.tuner_ops.get_rf_strength;
877 } 878 }
878 879
879 return 0; 880 return 0;
880} 881}
881 882
882static int mxl111sf_fe_ioctl_override(struct dvb_frontend *fe,
883 unsigned int cmd, void *parg,
884 unsigned int stage)
885{
886 int err = 0;
887
888 switch (stage) {
889 case DVB_FE_IOCTL_PRE:
890
891 switch (cmd) {
892 case FE_READ_SIGNAL_STRENGTH:
893 err = fe->ops.tuner_ops.get_rf_strength(fe, parg);
894 /* If no error occurs, prevent dvb-core from handling
895 * this IOCTL, otherwise return the error */
896 if (0 == err)
897 err = 1;
898 break;
899 }
900 break;
901 }
902 return err;
903};
904
905static u32 mxl111sf_i2c_func(struct i2c_adapter *adapter) 883static u32 mxl111sf_i2c_func(struct i2c_adapter *adapter)
906{ 884{
907 return I2C_FUNC_I2C; 885 return I2C_FUNC_I2C;
@@ -1082,7 +1060,6 @@ static struct dvb_usb_device_properties mxl111sf_props_dvbt = {
1082 .init = mxl111sf_init, 1060 .init = mxl111sf_init,
1083 .streaming_ctrl = mxl111sf_ep4_streaming_ctrl, 1061 .streaming_ctrl = mxl111sf_ep4_streaming_ctrl,
1084 .get_stream_config = mxl111sf_get_stream_config_dvbt, 1062 .get_stream_config = mxl111sf_get_stream_config_dvbt,
1085 .fe_ioctl_override = mxl111sf_fe_ioctl_override,
1086 1063
1087 .num_adapters = 1, 1064 .num_adapters = 1,
1088 .adapter = { 1065 .adapter = {
@@ -1124,7 +1101,6 @@ static struct dvb_usb_device_properties mxl111sf_props_atsc = {
1124 .init = mxl111sf_init, 1101 .init = mxl111sf_init,
1125 .streaming_ctrl = mxl111sf_ep6_streaming_ctrl, 1102 .streaming_ctrl = mxl111sf_ep6_streaming_ctrl,
1126 .get_stream_config = mxl111sf_get_stream_config_atsc, 1103 .get_stream_config = mxl111sf_get_stream_config_atsc,
1127 .fe_ioctl_override = mxl111sf_fe_ioctl_override,
1128 1104
1129 .num_adapters = 1, 1105 .num_adapters = 1,
1130 .adapter = { 1106 .adapter = {
@@ -1166,7 +1142,6 @@ static struct dvb_usb_device_properties mxl111sf_props_mh = {
1166 .init = mxl111sf_init, 1142 .init = mxl111sf_init,
1167 .streaming_ctrl = mxl111sf_ep5_streaming_ctrl, 1143 .streaming_ctrl = mxl111sf_ep5_streaming_ctrl,
1168 .get_stream_config = mxl111sf_get_stream_config_mh, 1144 .get_stream_config = mxl111sf_get_stream_config_mh,
1169 .fe_ioctl_override = mxl111sf_fe_ioctl_override,
1170 1145
1171 .num_adapters = 1, 1146 .num_adapters = 1,
1172 .adapter = { 1147 .adapter = {
@@ -1235,7 +1210,6 @@ static struct dvb_usb_device_properties mxl111sf_props_atsc_mh = {
1235 .init = mxl111sf_init, 1210 .init = mxl111sf_init,
1236 .streaming_ctrl = mxl111sf_streaming_ctrl_atsc_mh, 1211 .streaming_ctrl = mxl111sf_streaming_ctrl_atsc_mh,
1237 .get_stream_config = mxl111sf_get_stream_config_atsc_mh, 1212 .get_stream_config = mxl111sf_get_stream_config_atsc_mh,
1238 .fe_ioctl_override = mxl111sf_fe_ioctl_override,
1239 1213
1240 .num_adapters = 1, 1214 .num_adapters = 1,
1241 .adapter = { 1215 .adapter = {
@@ -1314,7 +1288,6 @@ static struct dvb_usb_device_properties mxl111sf_props_mercury = {
1314 .init = mxl111sf_init, 1288 .init = mxl111sf_init,
1315 .streaming_ctrl = mxl111sf_streaming_ctrl_mercury, 1289 .streaming_ctrl = mxl111sf_streaming_ctrl_mercury,
1316 .get_stream_config = mxl111sf_get_stream_config_mercury, 1290 .get_stream_config = mxl111sf_get_stream_config_mercury,
1317 .fe_ioctl_override = mxl111sf_fe_ioctl_override,
1318 1291
1319 .num_adapters = 1, 1292 .num_adapters = 1,
1320 .adapter = { 1293 .adapter = {
@@ -1385,7 +1358,6 @@ static struct dvb_usb_device_properties mxl111sf_props_mercury_mh = {
1385 .init = mxl111sf_init, 1358 .init = mxl111sf_init,
1386 .streaming_ctrl = mxl111sf_streaming_ctrl_mercury_mh, 1359 .streaming_ctrl = mxl111sf_streaming_ctrl_mercury_mh,
1387 .get_stream_config = mxl111sf_get_stream_config_mercury_mh, 1360 .get_stream_config = mxl111sf_get_stream_config_mercury_mh,
1388 .fe_ioctl_override = mxl111sf_fe_ioctl_override,
1389 1361
1390 .num_adapters = 1, 1362 .num_adapters = 1,
1391 .adapter = { 1363 .adapter = {
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
index ddf282f355b3..719413b15f20 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
@@ -106,7 +106,6 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums)
106 goto err; 106 goto err;
107 } 107 }
108 adap->dvb_adap.priv = adap; 108 adap->dvb_adap.priv = adap;
109 adap->dvb_adap.fe_ioctl_override = adap->props.fe_ioctl_override;
110 109
111 if (adap->dev->props.read_mac_address) { 110 if (adap->dev->props.read_mac_address) {
112 if (adap->dev->props.read_mac_address(adap->dev,adap->dvb_adap.proposed_mac) == 0) 111 if (adap->dev->props.read_mac_address(adap->dev,adap->dvb_adap.proposed_mac) == 0)
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h
index 99f94409efa1..aab0f99bc892 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -162,8 +162,6 @@ struct dvb_usb_adapter_properties {
162 int size_of_priv; 162 int size_of_priv;
163 163
164 int (*frontend_ctrl) (struct dvb_frontend *, int); 164 int (*frontend_ctrl) (struct dvb_frontend *, int);
165 int (*fe_ioctl_override) (struct dvb_frontend *,
166 unsigned int, void *, unsigned int);
167 165
168 int num_frontends; 166 int num_frontends;
169 struct dvb_usb_adapter_fe_properties fe[MAX_NO_OF_FE_PER_ADAP]; 167 struct dvb_usb_adapter_fe_properties fe[MAX_NO_OF_FE_PER_ADAP];
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
index cd542684ba02..f3202a52d535 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -1218,8 +1218,7 @@ static int dvb_register(struct cx23885_tsport *port)
1218 1218
1219 /* register everything */ 1219 /* register everything */
1220 ret = videobuf_dvb_register_bus(&port->frontends, THIS_MODULE, port, 1220 ret = videobuf_dvb_register_bus(&port->frontends, THIS_MODULE, port,
1221 &dev->pci->dev, adapter_nr, mfe_shared, 1221 &dev->pci->dev, adapter_nr, mfe_shared);
1222 NULL);
1223 if (ret) 1222 if (ret)
1224 goto frontend_detach; 1223 goto frontend_detach;
1225 1224
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 003937cd72f5..d803bba09525 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -1578,7 +1578,7 @@ static int dvb_register(struct cx8802_dev *dev)
1578 1578
1579 /* register everything */ 1579 /* register everything */
1580 res = videobuf_dvb_register_bus(&dev->frontends, THIS_MODULE, dev, 1580 res = videobuf_dvb_register_bus(&dev->frontends, THIS_MODULE, dev,
1581 &dev->pci->dev, adapter_nr, mfe_shared, NULL); 1581 &dev->pci->dev, adapter_nr, mfe_shared);
1582 if (res) 1582 if (res)
1583 goto frontend_detach; 1583 goto frontend_detach;
1584 return res; 1584 return res;
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index cc7f3d6ee966..d0f53bb153e3 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -1849,7 +1849,7 @@ static int dvb_init(struct saa7134_dev *dev)
1849 1849
1850 /* register everything else */ 1850 /* register everything else */
1851 ret = videobuf_dvb_register_bus(&dev->frontends, THIS_MODULE, dev, 1851 ret = videobuf_dvb_register_bus(&dev->frontends, THIS_MODULE, dev,
1852 &dev->pci->dev, adapter_nr, 0, NULL); 1852 &dev->pci->dev, adapter_nr, 0);
1853 1853
1854 /* this sequence is necessary to make the tda1004x load its firmware 1854 /* this sequence is necessary to make the tda1004x load its firmware
1855 * and to enter analog mode of hybrid boards 1855 * and to enter analog mode of hybrid boards
diff --git a/drivers/media/video/videobuf-dvb.c b/drivers/media/video/videobuf-dvb.c
index 94d83a41381b..b7efa4516d36 100644
--- a/drivers/media/video/videobuf-dvb.c
+++ b/drivers/media/video/videobuf-dvb.c
@@ -139,9 +139,7 @@ static int videobuf_dvb_register_adapter(struct videobuf_dvb_frontends *fe,
139 struct device *device, 139 struct device *device,
140 char *adapter_name, 140 char *adapter_name,
141 short *adapter_nr, 141 short *adapter_nr,
142 int mfe_shared, 142 int mfe_shared)
143 int (*fe_ioctl_override)(struct dvb_frontend *,
144 unsigned int, void *, unsigned int))
145{ 143{
146 int result; 144 int result;
147 145
@@ -156,7 +154,6 @@ static int videobuf_dvb_register_adapter(struct videobuf_dvb_frontends *fe,
156 } 154 }
157 fe->adapter.priv = adapter_priv; 155 fe->adapter.priv = adapter_priv;
158 fe->adapter.mfe_shared = mfe_shared; 156 fe->adapter.mfe_shared = mfe_shared;
159 fe->adapter.fe_ioctl_override = fe_ioctl_override;
160 157
161 return result; 158 return result;
162} 159}
@@ -257,9 +254,7 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
257 void *adapter_priv, 254 void *adapter_priv,
258 struct device *device, 255 struct device *device,
259 short *adapter_nr, 256 short *adapter_nr,
260 int mfe_shared, 257 int mfe_shared)
261 int (*fe_ioctl_override)(struct dvb_frontend *,
262 unsigned int, void *, unsigned int))
263{ 258{
264 struct list_head *list, *q; 259 struct list_head *list, *q;
265 struct videobuf_dvb_frontend *fe; 260 struct videobuf_dvb_frontend *fe;
@@ -273,7 +268,7 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
273 268
274 /* Bring up the adapter */ 269 /* Bring up the adapter */
275 res = videobuf_dvb_register_adapter(f, module, adapter_priv, device, 270 res = videobuf_dvb_register_adapter(f, module, adapter_priv, device,
276 fe->dvb.name, adapter_nr, mfe_shared, fe_ioctl_override); 271 fe->dvb.name, adapter_nr, mfe_shared);
277 if (res < 0) { 272 if (res < 0) {
278 printk(KERN_WARNING "videobuf_dvb_register_adapter failed (errno = %d)\n", res); 273 printk(KERN_WARNING "videobuf_dvb_register_adapter failed (errno = %d)\n", res);
279 return res; 274 return res;
diff --git a/include/media/videobuf-dvb.h b/include/media/videobuf-dvb.h
index bf365721d6b0..d63965a1faaf 100644
--- a/include/media/videobuf-dvb.h
+++ b/include/media/videobuf-dvb.h
@@ -45,9 +45,7 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
45 void *adapter_priv, 45 void *adapter_priv,
46 struct device *device, 46 struct device *device,
47 short *adapter_nr, 47 short *adapter_nr,
48 int mfe_shared, 48 int mfe_shared);
49 int (*fe_ioctl_override)(struct dvb_frontend *,
50 unsigned int, void *, unsigned int));
51 49
52void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f); 50void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f);
53 51