diff options
author | Andreas Oberritter <obi@linuxtv.org> | 2011-05-08 19:03:39 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 18:52:32 -0400 |
commit | 507277193253cd4ea44d0a55ade37bdef20f3a44 (patch) | |
tree | 7242f6d7c863460c6db110494ffeff97f587c569 /drivers/media/dvb | |
parent | 68bdee041317116bccaf830a9ff8f46f9aa857bd (diff) |
[media] DVB: dvb_frontend: use shortcut to access fe->dtv_property_cache
Signed-off-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_frontend.c | 211 |
1 files changed, 108 insertions, 103 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index e24ebf51f076..4a05a2c61aba 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -858,34 +858,34 @@ static int dvb_frontend_check_parameters(struct dvb_frontend *fe, | |||
858 | 858 | ||
859 | static int dvb_frontend_clear_cache(struct dvb_frontend *fe) | 859 | static int dvb_frontend_clear_cache(struct dvb_frontend *fe) |
860 | { | 860 | { |
861 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
861 | int i; | 862 | int i; |
862 | 863 | ||
863 | memset(&(fe->dtv_property_cache), 0, | 864 | memset(c, 0, sizeof(struct dtv_frontend_properties)); |
864 | sizeof(struct dtv_frontend_properties)); | 865 | |
865 | 866 | c->state = DTV_CLEAR; | |
866 | fe->dtv_property_cache.state = DTV_CLEAR; | 867 | c->delivery_system = SYS_UNDEFINED; |
867 | fe->dtv_property_cache.delivery_system = SYS_UNDEFINED; | 868 | c->inversion = INVERSION_AUTO; |
868 | fe->dtv_property_cache.inversion = INVERSION_AUTO; | 869 | c->fec_inner = FEC_AUTO; |
869 | fe->dtv_property_cache.fec_inner = FEC_AUTO; | 870 | c->transmission_mode = TRANSMISSION_MODE_AUTO; |
870 | fe->dtv_property_cache.transmission_mode = TRANSMISSION_MODE_AUTO; | 871 | c->bandwidth_hz = BANDWIDTH_AUTO; |
871 | fe->dtv_property_cache.bandwidth_hz = BANDWIDTH_AUTO; | 872 | c->guard_interval = GUARD_INTERVAL_AUTO; |
872 | fe->dtv_property_cache.guard_interval = GUARD_INTERVAL_AUTO; | 873 | c->hierarchy = HIERARCHY_AUTO; |
873 | fe->dtv_property_cache.hierarchy = HIERARCHY_AUTO; | 874 | c->symbol_rate = QAM_AUTO; |
874 | fe->dtv_property_cache.symbol_rate = QAM_AUTO; | 875 | c->code_rate_HP = FEC_AUTO; |
875 | fe->dtv_property_cache.code_rate_HP = FEC_AUTO; | 876 | c->code_rate_LP = FEC_AUTO; |
876 | fe->dtv_property_cache.code_rate_LP = FEC_AUTO; | 877 | |
877 | 878 | c->isdbt_partial_reception = -1; | |
878 | fe->dtv_property_cache.isdbt_partial_reception = -1; | 879 | c->isdbt_sb_mode = -1; |
879 | fe->dtv_property_cache.isdbt_sb_mode = -1; | 880 | c->isdbt_sb_subchannel = -1; |
880 | fe->dtv_property_cache.isdbt_sb_subchannel = -1; | 881 | c->isdbt_sb_segment_idx = -1; |
881 | fe->dtv_property_cache.isdbt_sb_segment_idx = -1; | 882 | c->isdbt_sb_segment_count = -1; |
882 | fe->dtv_property_cache.isdbt_sb_segment_count = -1; | 883 | c->isdbt_layer_enabled = 0x7; |
883 | fe->dtv_property_cache.isdbt_layer_enabled = 0x7; | ||
884 | for (i = 0; i < 3; i++) { | 884 | for (i = 0; i < 3; i++) { |
885 | fe->dtv_property_cache.layer[i].fec = FEC_AUTO; | 885 | c->layer[i].fec = FEC_AUTO; |
886 | fe->dtv_property_cache.layer[i].modulation = QAM_AUTO; | 886 | c->layer[i].modulation = QAM_AUTO; |
887 | fe->dtv_property_cache.layer[i].interleaving = -1; | 887 | c->layer[i].interleaving = -1; |
888 | fe->dtv_property_cache.layer[i].segment_count = -1; | 888 | c->layer[i].segment_count = -1; |
889 | } | 889 | } |
890 | 890 | ||
891 | return 0; | 891 | return 0; |
@@ -1194,121 +1194,122 @@ static int dtv_property_process_get(struct dvb_frontend *fe, | |||
1194 | struct dtv_property *tvp, | 1194 | struct dtv_property *tvp, |
1195 | struct file *file) | 1195 | struct file *file) |
1196 | { | 1196 | { |
1197 | const struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
1197 | int r; | 1198 | int r; |
1198 | 1199 | ||
1199 | switch(tvp->cmd) { | 1200 | switch(tvp->cmd) { |
1200 | case DTV_FREQUENCY: | 1201 | case DTV_FREQUENCY: |
1201 | tvp->u.data = fe->dtv_property_cache.frequency; | 1202 | tvp->u.data = c->frequency; |
1202 | break; | 1203 | break; |
1203 | case DTV_MODULATION: | 1204 | case DTV_MODULATION: |
1204 | tvp->u.data = fe->dtv_property_cache.modulation; | 1205 | tvp->u.data = c->modulation; |
1205 | break; | 1206 | break; |
1206 | case DTV_BANDWIDTH_HZ: | 1207 | case DTV_BANDWIDTH_HZ: |
1207 | tvp->u.data = fe->dtv_property_cache.bandwidth_hz; | 1208 | tvp->u.data = c->bandwidth_hz; |
1208 | break; | 1209 | break; |
1209 | case DTV_INVERSION: | 1210 | case DTV_INVERSION: |
1210 | tvp->u.data = fe->dtv_property_cache.inversion; | 1211 | tvp->u.data = c->inversion; |
1211 | break; | 1212 | break; |
1212 | case DTV_SYMBOL_RATE: | 1213 | case DTV_SYMBOL_RATE: |
1213 | tvp->u.data = fe->dtv_property_cache.symbol_rate; | 1214 | tvp->u.data = c->symbol_rate; |
1214 | break; | 1215 | break; |
1215 | case DTV_INNER_FEC: | 1216 | case DTV_INNER_FEC: |
1216 | tvp->u.data = fe->dtv_property_cache.fec_inner; | 1217 | tvp->u.data = c->fec_inner; |
1217 | break; | 1218 | break; |
1218 | case DTV_PILOT: | 1219 | case DTV_PILOT: |
1219 | tvp->u.data = fe->dtv_property_cache.pilot; | 1220 | tvp->u.data = c->pilot; |
1220 | break; | 1221 | break; |
1221 | case DTV_ROLLOFF: | 1222 | case DTV_ROLLOFF: |
1222 | tvp->u.data = fe->dtv_property_cache.rolloff; | 1223 | tvp->u.data = c->rolloff; |
1223 | break; | 1224 | break; |
1224 | case DTV_DELIVERY_SYSTEM: | 1225 | case DTV_DELIVERY_SYSTEM: |
1225 | tvp->u.data = fe->dtv_property_cache.delivery_system; | 1226 | tvp->u.data = c->delivery_system; |
1226 | break; | 1227 | break; |
1227 | case DTV_VOLTAGE: | 1228 | case DTV_VOLTAGE: |
1228 | tvp->u.data = fe->dtv_property_cache.voltage; | 1229 | tvp->u.data = c->voltage; |
1229 | break; | 1230 | break; |
1230 | case DTV_TONE: | 1231 | case DTV_TONE: |
1231 | tvp->u.data = fe->dtv_property_cache.sectone; | 1232 | tvp->u.data = c->sectone; |
1232 | break; | 1233 | break; |
1233 | case DTV_API_VERSION: | 1234 | case DTV_API_VERSION: |
1234 | tvp->u.data = (DVB_API_VERSION << 8) | DVB_API_VERSION_MINOR; | 1235 | tvp->u.data = (DVB_API_VERSION << 8) | DVB_API_VERSION_MINOR; |
1235 | break; | 1236 | break; |
1236 | case DTV_CODE_RATE_HP: | 1237 | case DTV_CODE_RATE_HP: |
1237 | tvp->u.data = fe->dtv_property_cache.code_rate_HP; | 1238 | tvp->u.data = c->code_rate_HP; |
1238 | break; | 1239 | break; |
1239 | case DTV_CODE_RATE_LP: | 1240 | case DTV_CODE_RATE_LP: |
1240 | tvp->u.data = fe->dtv_property_cache.code_rate_LP; | 1241 | tvp->u.data = c->code_rate_LP; |
1241 | break; | 1242 | break; |
1242 | case DTV_GUARD_INTERVAL: | 1243 | case DTV_GUARD_INTERVAL: |
1243 | tvp->u.data = fe->dtv_property_cache.guard_interval; | 1244 | tvp->u.data = c->guard_interval; |
1244 | break; | 1245 | break; |
1245 | case DTV_TRANSMISSION_MODE: | 1246 | case DTV_TRANSMISSION_MODE: |
1246 | tvp->u.data = fe->dtv_property_cache.transmission_mode; | 1247 | tvp->u.data = c->transmission_mode; |
1247 | break; | 1248 | break; |
1248 | case DTV_HIERARCHY: | 1249 | case DTV_HIERARCHY: |
1249 | tvp->u.data = fe->dtv_property_cache.hierarchy; | 1250 | tvp->u.data = c->hierarchy; |
1250 | break; | 1251 | break; |
1251 | 1252 | ||
1252 | /* ISDB-T Support here */ | 1253 | /* ISDB-T Support here */ |
1253 | case DTV_ISDBT_PARTIAL_RECEPTION: | 1254 | case DTV_ISDBT_PARTIAL_RECEPTION: |
1254 | tvp->u.data = fe->dtv_property_cache.isdbt_partial_reception; | 1255 | tvp->u.data = c->isdbt_partial_reception; |
1255 | break; | 1256 | break; |
1256 | case DTV_ISDBT_SOUND_BROADCASTING: | 1257 | case DTV_ISDBT_SOUND_BROADCASTING: |
1257 | tvp->u.data = fe->dtv_property_cache.isdbt_sb_mode; | 1258 | tvp->u.data = c->isdbt_sb_mode; |
1258 | break; | 1259 | break; |
1259 | case DTV_ISDBT_SB_SUBCHANNEL_ID: | 1260 | case DTV_ISDBT_SB_SUBCHANNEL_ID: |
1260 | tvp->u.data = fe->dtv_property_cache.isdbt_sb_subchannel; | 1261 | tvp->u.data = c->isdbt_sb_subchannel; |
1261 | break; | 1262 | break; |
1262 | case DTV_ISDBT_SB_SEGMENT_IDX: | 1263 | case DTV_ISDBT_SB_SEGMENT_IDX: |
1263 | tvp->u.data = fe->dtv_property_cache.isdbt_sb_segment_idx; | 1264 | tvp->u.data = c->isdbt_sb_segment_idx; |
1264 | break; | 1265 | break; |
1265 | case DTV_ISDBT_SB_SEGMENT_COUNT: | 1266 | case DTV_ISDBT_SB_SEGMENT_COUNT: |
1266 | tvp->u.data = fe->dtv_property_cache.isdbt_sb_segment_count; | 1267 | tvp->u.data = c->isdbt_sb_segment_count; |
1267 | break; | 1268 | break; |
1268 | case DTV_ISDBT_LAYER_ENABLED: | 1269 | case DTV_ISDBT_LAYER_ENABLED: |
1269 | tvp->u.data = fe->dtv_property_cache.isdbt_layer_enabled; | 1270 | tvp->u.data = c->isdbt_layer_enabled; |
1270 | break; | 1271 | break; |
1271 | case DTV_ISDBT_LAYERA_FEC: | 1272 | case DTV_ISDBT_LAYERA_FEC: |
1272 | tvp->u.data = fe->dtv_property_cache.layer[0].fec; | 1273 | tvp->u.data = c->layer[0].fec; |
1273 | break; | 1274 | break; |
1274 | case DTV_ISDBT_LAYERA_MODULATION: | 1275 | case DTV_ISDBT_LAYERA_MODULATION: |
1275 | tvp->u.data = fe->dtv_property_cache.layer[0].modulation; | 1276 | tvp->u.data = c->layer[0].modulation; |
1276 | break; | 1277 | break; |
1277 | case DTV_ISDBT_LAYERA_SEGMENT_COUNT: | 1278 | case DTV_ISDBT_LAYERA_SEGMENT_COUNT: |
1278 | tvp->u.data = fe->dtv_property_cache.layer[0].segment_count; | 1279 | tvp->u.data = c->layer[0].segment_count; |
1279 | break; | 1280 | break; |
1280 | case DTV_ISDBT_LAYERA_TIME_INTERLEAVING: | 1281 | case DTV_ISDBT_LAYERA_TIME_INTERLEAVING: |
1281 | tvp->u.data = fe->dtv_property_cache.layer[0].interleaving; | 1282 | tvp->u.data = c->layer[0].interleaving; |
1282 | break; | 1283 | break; |
1283 | case DTV_ISDBT_LAYERB_FEC: | 1284 | case DTV_ISDBT_LAYERB_FEC: |
1284 | tvp->u.data = fe->dtv_property_cache.layer[1].fec; | 1285 | tvp->u.data = c->layer[1].fec; |
1285 | break; | 1286 | break; |
1286 | case DTV_ISDBT_LAYERB_MODULATION: | 1287 | case DTV_ISDBT_LAYERB_MODULATION: |
1287 | tvp->u.data = fe->dtv_property_cache.layer[1].modulation; | 1288 | tvp->u.data = c->layer[1].modulation; |
1288 | break; | 1289 | break; |
1289 | case DTV_ISDBT_LAYERB_SEGMENT_COUNT: | 1290 | case DTV_ISDBT_LAYERB_SEGMENT_COUNT: |
1290 | tvp->u.data = fe->dtv_property_cache.layer[1].segment_count; | 1291 | tvp->u.data = c->layer[1].segment_count; |
1291 | break; | 1292 | break; |
1292 | case DTV_ISDBT_LAYERB_TIME_INTERLEAVING: | 1293 | case DTV_ISDBT_LAYERB_TIME_INTERLEAVING: |
1293 | tvp->u.data = fe->dtv_property_cache.layer[1].interleaving; | 1294 | tvp->u.data = c->layer[1].interleaving; |
1294 | break; | 1295 | break; |
1295 | case DTV_ISDBT_LAYERC_FEC: | 1296 | case DTV_ISDBT_LAYERC_FEC: |
1296 | tvp->u.data = fe->dtv_property_cache.layer[2].fec; | 1297 | tvp->u.data = c->layer[2].fec; |
1297 | break; | 1298 | break; |
1298 | case DTV_ISDBT_LAYERC_MODULATION: | 1299 | case DTV_ISDBT_LAYERC_MODULATION: |
1299 | tvp->u.data = fe->dtv_property_cache.layer[2].modulation; | 1300 | tvp->u.data = c->layer[2].modulation; |
1300 | break; | 1301 | break; |
1301 | case DTV_ISDBT_LAYERC_SEGMENT_COUNT: | 1302 | case DTV_ISDBT_LAYERC_SEGMENT_COUNT: |
1302 | tvp->u.data = fe->dtv_property_cache.layer[2].segment_count; | 1303 | tvp->u.data = c->layer[2].segment_count; |
1303 | break; | 1304 | break; |
1304 | case DTV_ISDBT_LAYERC_TIME_INTERLEAVING: | 1305 | case DTV_ISDBT_LAYERC_TIME_INTERLEAVING: |
1305 | tvp->u.data = fe->dtv_property_cache.layer[2].interleaving; | 1306 | tvp->u.data = c->layer[2].interleaving; |
1306 | break; | 1307 | break; |
1307 | case DTV_ISDBS_TS_ID: | 1308 | case DTV_ISDBS_TS_ID: |
1308 | tvp->u.data = fe->dtv_property_cache.isdbs_ts_id; | 1309 | tvp->u.data = c->isdbs_ts_id; |
1309 | break; | 1310 | break; |
1310 | case DTV_DVBT2_PLP_ID: | 1311 | case DTV_DVBT2_PLP_ID: |
1311 | tvp->u.data = fe->dtv_property_cache.dvbt2_plp_id; | 1312 | tvp->u.data = c->dvbt2_plp_id; |
1312 | break; | 1313 | break; |
1313 | default: | 1314 | default: |
1314 | return -EINVAL; | 1315 | return -EINVAL; |
@@ -1331,6 +1332,7 @@ static int dtv_property_process_set(struct dvb_frontend *fe, | |||
1331 | struct file *file) | 1332 | struct file *file) |
1332 | { | 1333 | { |
1333 | int r = 0; | 1334 | int r = 0; |
1335 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
1334 | struct dvb_frontend_private *fepriv = fe->frontend_priv; | 1336 | struct dvb_frontend_private *fepriv = fe->frontend_priv; |
1335 | dtv_property_dump(tvp); | 1337 | dtv_property_dump(tvp); |
1336 | 1338 | ||
@@ -1354,7 +1356,7 @@ static int dtv_property_process_set(struct dvb_frontend *fe, | |||
1354 | * tunerequest so we can pass validation in the FE_SET_FRONTEND | 1356 | * tunerequest so we can pass validation in the FE_SET_FRONTEND |
1355 | * ioctl. | 1357 | * ioctl. |
1356 | */ | 1358 | */ |
1357 | fe->dtv_property_cache.state = tvp->cmd; | 1359 | c->state = tvp->cmd; |
1358 | dprintk("%s() Finalised property cache\n", __func__); | 1360 | dprintk("%s() Finalised property cache\n", __func__); |
1359 | dtv_property_cache_submit(fe); | 1361 | dtv_property_cache_submit(fe); |
1360 | 1362 | ||
@@ -1362,118 +1364,118 @@ static int dtv_property_process_set(struct dvb_frontend *fe, | |||
1362 | &fepriv->parameters_in); | 1364 | &fepriv->parameters_in); |
1363 | break; | 1365 | break; |
1364 | case DTV_FREQUENCY: | 1366 | case DTV_FREQUENCY: |
1365 | fe->dtv_property_cache.frequency = tvp->u.data; | 1367 | c->frequency = tvp->u.data; |
1366 | break; | 1368 | break; |
1367 | case DTV_MODULATION: | 1369 | case DTV_MODULATION: |
1368 | fe->dtv_property_cache.modulation = tvp->u.data; | 1370 | c->modulation = tvp->u.data; |
1369 | break; | 1371 | break; |
1370 | case DTV_BANDWIDTH_HZ: | 1372 | case DTV_BANDWIDTH_HZ: |
1371 | fe->dtv_property_cache.bandwidth_hz = tvp->u.data; | 1373 | c->bandwidth_hz = tvp->u.data; |
1372 | break; | 1374 | break; |
1373 | case DTV_INVERSION: | 1375 | case DTV_INVERSION: |
1374 | fe->dtv_property_cache.inversion = tvp->u.data; | 1376 | c->inversion = tvp->u.data; |
1375 | break; | 1377 | break; |
1376 | case DTV_SYMBOL_RATE: | 1378 | case DTV_SYMBOL_RATE: |
1377 | fe->dtv_property_cache.symbol_rate = tvp->u.data; | 1379 | c->symbol_rate = tvp->u.data; |
1378 | break; | 1380 | break; |
1379 | case DTV_INNER_FEC: | 1381 | case DTV_INNER_FEC: |
1380 | fe->dtv_property_cache.fec_inner = tvp->u.data; | 1382 | c->fec_inner = tvp->u.data; |
1381 | break; | 1383 | break; |
1382 | case DTV_PILOT: | 1384 | case DTV_PILOT: |
1383 | fe->dtv_property_cache.pilot = tvp->u.data; | 1385 | c->pilot = tvp->u.data; |
1384 | break; | 1386 | break; |
1385 | case DTV_ROLLOFF: | 1387 | case DTV_ROLLOFF: |
1386 | fe->dtv_property_cache.rolloff = tvp->u.data; | 1388 | c->rolloff = tvp->u.data; |
1387 | break; | 1389 | break; |
1388 | case DTV_DELIVERY_SYSTEM: | 1390 | case DTV_DELIVERY_SYSTEM: |
1389 | fe->dtv_property_cache.delivery_system = tvp->u.data; | 1391 | c->delivery_system = tvp->u.data; |
1390 | break; | 1392 | break; |
1391 | case DTV_VOLTAGE: | 1393 | case DTV_VOLTAGE: |
1392 | fe->dtv_property_cache.voltage = tvp->u.data; | 1394 | c->voltage = tvp->u.data; |
1393 | r = dvb_frontend_ioctl_legacy(file, FE_SET_VOLTAGE, | 1395 | r = dvb_frontend_ioctl_legacy(file, FE_SET_VOLTAGE, |
1394 | (void *)fe->dtv_property_cache.voltage); | 1396 | (void *)c->voltage); |
1395 | break; | 1397 | break; |
1396 | case DTV_TONE: | 1398 | case DTV_TONE: |
1397 | fe->dtv_property_cache.sectone = tvp->u.data; | 1399 | c->sectone = tvp->u.data; |
1398 | r = dvb_frontend_ioctl_legacy(file, FE_SET_TONE, | 1400 | r = dvb_frontend_ioctl_legacy(file, FE_SET_TONE, |
1399 | (void *)fe->dtv_property_cache.sectone); | 1401 | (void *)c->sectone); |
1400 | break; | 1402 | break; |
1401 | case DTV_CODE_RATE_HP: | 1403 | case DTV_CODE_RATE_HP: |
1402 | fe->dtv_property_cache.code_rate_HP = tvp->u.data; | 1404 | c->code_rate_HP = tvp->u.data; |
1403 | break; | 1405 | break; |
1404 | case DTV_CODE_RATE_LP: | 1406 | case DTV_CODE_RATE_LP: |
1405 | fe->dtv_property_cache.code_rate_LP = tvp->u.data; | 1407 | c->code_rate_LP = tvp->u.data; |
1406 | break; | 1408 | break; |
1407 | case DTV_GUARD_INTERVAL: | 1409 | case DTV_GUARD_INTERVAL: |
1408 | fe->dtv_property_cache.guard_interval = tvp->u.data; | 1410 | c->guard_interval = tvp->u.data; |
1409 | break; | 1411 | break; |
1410 | case DTV_TRANSMISSION_MODE: | 1412 | case DTV_TRANSMISSION_MODE: |
1411 | fe->dtv_property_cache.transmission_mode = tvp->u.data; | 1413 | c->transmission_mode = tvp->u.data; |
1412 | break; | 1414 | break; |
1413 | case DTV_HIERARCHY: | 1415 | case DTV_HIERARCHY: |
1414 | fe->dtv_property_cache.hierarchy = tvp->u.data; | 1416 | c->hierarchy = tvp->u.data; |
1415 | break; | 1417 | break; |
1416 | 1418 | ||
1417 | /* ISDB-T Support here */ | 1419 | /* ISDB-T Support here */ |
1418 | case DTV_ISDBT_PARTIAL_RECEPTION: | 1420 | case DTV_ISDBT_PARTIAL_RECEPTION: |
1419 | fe->dtv_property_cache.isdbt_partial_reception = tvp->u.data; | 1421 | c->isdbt_partial_reception = tvp->u.data; |
1420 | break; | 1422 | break; |
1421 | case DTV_ISDBT_SOUND_BROADCASTING: | 1423 | case DTV_ISDBT_SOUND_BROADCASTING: |
1422 | fe->dtv_property_cache.isdbt_sb_mode = tvp->u.data; | 1424 | c->isdbt_sb_mode = tvp->u.data; |
1423 | break; | 1425 | break; |
1424 | case DTV_ISDBT_SB_SUBCHANNEL_ID: | 1426 | case DTV_ISDBT_SB_SUBCHANNEL_ID: |
1425 | fe->dtv_property_cache.isdbt_sb_subchannel = tvp->u.data; | 1427 | c->isdbt_sb_subchannel = tvp->u.data; |
1426 | break; | 1428 | break; |
1427 | case DTV_ISDBT_SB_SEGMENT_IDX: | 1429 | case DTV_ISDBT_SB_SEGMENT_IDX: |
1428 | fe->dtv_property_cache.isdbt_sb_segment_idx = tvp->u.data; | 1430 | c->isdbt_sb_segment_idx = tvp->u.data; |
1429 | break; | 1431 | break; |
1430 | case DTV_ISDBT_SB_SEGMENT_COUNT: | 1432 | case DTV_ISDBT_SB_SEGMENT_COUNT: |
1431 | fe->dtv_property_cache.isdbt_sb_segment_count = tvp->u.data; | 1433 | c->isdbt_sb_segment_count = tvp->u.data; |
1432 | break; | 1434 | break; |
1433 | case DTV_ISDBT_LAYER_ENABLED: | 1435 | case DTV_ISDBT_LAYER_ENABLED: |
1434 | fe->dtv_property_cache.isdbt_layer_enabled = tvp->u.data; | 1436 | c->isdbt_layer_enabled = tvp->u.data; |
1435 | break; | 1437 | break; |
1436 | case DTV_ISDBT_LAYERA_FEC: | 1438 | case DTV_ISDBT_LAYERA_FEC: |
1437 | fe->dtv_property_cache.layer[0].fec = tvp->u.data; | 1439 | c->layer[0].fec = tvp->u.data; |
1438 | break; | 1440 | break; |
1439 | case DTV_ISDBT_LAYERA_MODULATION: | 1441 | case DTV_ISDBT_LAYERA_MODULATION: |
1440 | fe->dtv_property_cache.layer[0].modulation = tvp->u.data; | 1442 | c->layer[0].modulation = tvp->u.data; |
1441 | break; | 1443 | break; |
1442 | case DTV_ISDBT_LAYERA_SEGMENT_COUNT: | 1444 | case DTV_ISDBT_LAYERA_SEGMENT_COUNT: |
1443 | fe->dtv_property_cache.layer[0].segment_count = tvp->u.data; | 1445 | c->layer[0].segment_count = tvp->u.data; |
1444 | break; | 1446 | break; |
1445 | case DTV_ISDBT_LAYERA_TIME_INTERLEAVING: | 1447 | case DTV_ISDBT_LAYERA_TIME_INTERLEAVING: |
1446 | fe->dtv_property_cache.layer[0].interleaving = tvp->u.data; | 1448 | c->layer[0].interleaving = tvp->u.data; |
1447 | break; | 1449 | break; |
1448 | case DTV_ISDBT_LAYERB_FEC: | 1450 | case DTV_ISDBT_LAYERB_FEC: |
1449 | fe->dtv_property_cache.layer[1].fec = tvp->u.data; | 1451 | c->layer[1].fec = tvp->u.data; |
1450 | break; | 1452 | break; |
1451 | case DTV_ISDBT_LAYERB_MODULATION: | 1453 | case DTV_ISDBT_LAYERB_MODULATION: |
1452 | fe->dtv_property_cache.layer[1].modulation = tvp->u.data; | 1454 | c->layer[1].modulation = tvp->u.data; |
1453 | break; | 1455 | break; |
1454 | case DTV_ISDBT_LAYERB_SEGMENT_COUNT: | 1456 | case DTV_ISDBT_LAYERB_SEGMENT_COUNT: |
1455 | fe->dtv_property_cache.layer[1].segment_count = tvp->u.data; | 1457 | c->layer[1].segment_count = tvp->u.data; |
1456 | break; | 1458 | break; |
1457 | case DTV_ISDBT_LAYERB_TIME_INTERLEAVING: | 1459 | case DTV_ISDBT_LAYERB_TIME_INTERLEAVING: |
1458 | fe->dtv_property_cache.layer[1].interleaving = tvp->u.data; | 1460 | c->layer[1].interleaving = tvp->u.data; |
1459 | break; | 1461 | break; |
1460 | case DTV_ISDBT_LAYERC_FEC: | 1462 | case DTV_ISDBT_LAYERC_FEC: |
1461 | fe->dtv_property_cache.layer[2].fec = tvp->u.data; | 1463 | c->layer[2].fec = tvp->u.data; |
1462 | break; | 1464 | break; |
1463 | case DTV_ISDBT_LAYERC_MODULATION: | 1465 | case DTV_ISDBT_LAYERC_MODULATION: |
1464 | fe->dtv_property_cache.layer[2].modulation = tvp->u.data; | 1466 | c->layer[2].modulation = tvp->u.data; |
1465 | break; | 1467 | break; |
1466 | case DTV_ISDBT_LAYERC_SEGMENT_COUNT: | 1468 | case DTV_ISDBT_LAYERC_SEGMENT_COUNT: |
1467 | fe->dtv_property_cache.layer[2].segment_count = tvp->u.data; | 1469 | c->layer[2].segment_count = tvp->u.data; |
1468 | break; | 1470 | break; |
1469 | case DTV_ISDBT_LAYERC_TIME_INTERLEAVING: | 1471 | case DTV_ISDBT_LAYERC_TIME_INTERLEAVING: |
1470 | fe->dtv_property_cache.layer[2].interleaving = tvp->u.data; | 1472 | c->layer[2].interleaving = tvp->u.data; |
1471 | break; | 1473 | break; |
1472 | case DTV_ISDBS_TS_ID: | 1474 | case DTV_ISDBS_TS_ID: |
1473 | fe->dtv_property_cache.isdbs_ts_id = tvp->u.data; | 1475 | c->isdbs_ts_id = tvp->u.data; |
1474 | break; | 1476 | break; |
1475 | case DTV_DVBT2_PLP_ID: | 1477 | case DTV_DVBT2_PLP_ID: |
1476 | fe->dtv_property_cache.dvbt2_plp_id = tvp->u.data; | 1478 | c->dvbt2_plp_id = tvp->u.data; |
1477 | break; | 1479 | break; |
1478 | default: | 1480 | default: |
1479 | return -EINVAL; | 1481 | return -EINVAL; |
@@ -1487,6 +1489,7 @@ static int dvb_frontend_ioctl(struct file *file, | |||
1487 | { | 1489 | { |
1488 | struct dvb_device *dvbdev = file->private_data; | 1490 | struct dvb_device *dvbdev = file->private_data; |
1489 | struct dvb_frontend *fe = dvbdev->priv; | 1491 | struct dvb_frontend *fe = dvbdev->priv; |
1492 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
1490 | struct dvb_frontend_private *fepriv = fe->frontend_priv; | 1493 | struct dvb_frontend_private *fepriv = fe->frontend_priv; |
1491 | int err = -EOPNOTSUPP; | 1494 | int err = -EOPNOTSUPP; |
1492 | 1495 | ||
@@ -1506,7 +1509,7 @@ static int dvb_frontend_ioctl(struct file *file, | |||
1506 | if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY)) | 1509 | if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY)) |
1507 | err = dvb_frontend_ioctl_properties(file, cmd, parg); | 1510 | err = dvb_frontend_ioctl_properties(file, cmd, parg); |
1508 | else { | 1511 | else { |
1509 | fe->dtv_property_cache.state = DTV_UNDEFINED; | 1512 | c->state = DTV_UNDEFINED; |
1510 | err = dvb_frontend_ioctl_legacy(file, cmd, parg); | 1513 | err = dvb_frontend_ioctl_legacy(file, cmd, parg); |
1511 | } | 1514 | } |
1512 | 1515 | ||
@@ -1519,6 +1522,7 @@ static int dvb_frontend_ioctl_properties(struct file *file, | |||
1519 | { | 1522 | { |
1520 | struct dvb_device *dvbdev = file->private_data; | 1523 | struct dvb_device *dvbdev = file->private_data; |
1521 | struct dvb_frontend *fe = dvbdev->priv; | 1524 | struct dvb_frontend *fe = dvbdev->priv; |
1525 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
1522 | int err = 0; | 1526 | int err = 0; |
1523 | 1527 | ||
1524 | struct dtv_properties *tvps = NULL; | 1528 | struct dtv_properties *tvps = NULL; |
@@ -1556,7 +1560,7 @@ static int dvb_frontend_ioctl_properties(struct file *file, | |||
1556 | (tvp + i)->result = err; | 1560 | (tvp + i)->result = err; |
1557 | } | 1561 | } |
1558 | 1562 | ||
1559 | if(fe->dtv_property_cache.state == DTV_TUNE) | 1563 | if (c->state == DTV_TUNE) |
1560 | dprintk("%s() Property cache is full, tuning\n", __func__); | 1564 | dprintk("%s() Property cache is full, tuning\n", __func__); |
1561 | 1565 | ||
1562 | } else | 1566 | } else |
@@ -1787,9 +1791,10 @@ static int dvb_frontend_ioctl_legacy(struct file *file, | |||
1787 | break; | 1791 | break; |
1788 | 1792 | ||
1789 | case FE_SET_FRONTEND: { | 1793 | case FE_SET_FRONTEND: { |
1794 | struct dtv_frontend_properties *c = &fe->dtv_property_cache; | ||
1790 | struct dvb_frontend_tune_settings fetunesettings; | 1795 | struct dvb_frontend_tune_settings fetunesettings; |
1791 | 1796 | ||
1792 | if(fe->dtv_property_cache.state == DTV_TUNE) { | 1797 | if (c->state == DTV_TUNE) { |
1793 | if (dvb_frontend_check_parameters(fe, &fepriv->parameters_in) < 0) { | 1798 | if (dvb_frontend_check_parameters(fe, &fepriv->parameters_in) < 0) { |
1794 | err = -EINVAL; | 1799 | err = -EINVAL; |
1795 | break; | 1800 | break; |