aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorSteven Toth <stoth@linuxtv.org>2008-09-12 00:34:28 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:37:05 -0400
commit363429a089590f3f4071ebc492b3712fdcba770b (patch)
tree10e1a3b0246a22d95441ad697a14ff24f2f8e87d /drivers/media/dvb
parent80a773c9bcc6f67944e186de3d2ab8b582889bc8 (diff)
V4L/DVB (9003): S2API: Remove the DTV_SET_ and DTV_GET_ prefixes
The API now assumes that ioctl calls for FE_SET_PROPERTY and all set commands, and FE_GET_PROPERTY are get commands. Simplification. Signed-off-by: Steven Toth <stoth@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.c431
1 files changed, 212 insertions, 219 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 205f60262c37..2ed748486e57 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -768,193 +768,128 @@ struct dtv_cmds_h dtv_cmds[] = {
768 }, 768 },
769 769
770 /* Set */ 770 /* Set */
771 [DTV_SET_FREQUENCY] = { 771 [DTV_FREQUENCY] = {
772 .name = "DTV_SET_FREQUENCY", 772 .name = "DTV_FREQUENCY",
773 .cmd = DTV_SET_FREQUENCY, 773 .cmd = DTV_FREQUENCY,
774 .set = 1, 774 .set = 1,
775 }, 775 },
776 [DTV_SET_BANDWIDTH] = { 776 [DTV_BANDWIDTH] = {
777 .name = "DTV_SET_BANDWIDTH", 777 .name = "DTV_BANDWIDTH",
778 .cmd = DTV_SET_BANDWIDTH, 778 .cmd = DTV_BANDWIDTH,
779 .set = 1, 779 .set = 1,
780 }, 780 },
781 [DTV_SET_MODULATION] = { 781 [DTV_MODULATION] = {
782 .name = "DTV_SET_MODULATION", 782 .name = "DTV_MODULATION",
783 .cmd = DTV_SET_MODULATION, 783 .cmd = DTV_MODULATION,
784 .set = 1, 784 .set = 1,
785 }, 785 },
786 [DTV_SET_INVERSION] = { 786 [DTV_INVERSION] = {
787 .name = "DTV_SET_INVERSION", 787 .name = "DTV_INVERSION",
788 .cmd = DTV_SET_INVERSION, 788 .cmd = DTV_INVERSION,
789 .set = 1, 789 .set = 1,
790 }, 790 },
791 [DTV_SET_DISEQC_MASTER] = { 791 [DTV_DISEQC_MASTER] = {
792 .name = "DTV_SET_DISEQC_MASTER", 792 .name = "DTV_DISEQC_MASTER",
793 .cmd = DTV_SET_DISEQC_MASTER, 793 .cmd = DTV_DISEQC_MASTER,
794 .set = 1, 794 .set = 1,
795 .buffer = 1, 795 .buffer = 1,
796 }, 796 },
797 [DTV_SET_SYMBOL_RATE] = { 797 [DTV_SYMBOL_RATE] = {
798 .name = "DTV_SET_SYMBOL_RATE", 798 .name = "DTV_SYMBOL_RATE",
799 .cmd = DTV_SET_SYMBOL_RATE, 799 .cmd = DTV_SYMBOL_RATE,
800 .set = 1, 800 .set = 1,
801 }, 801 },
802 [DTV_SET_INNER_FEC] = { 802 [DTV_INNER_FEC] = {
803 .name = "DTV_SET_INNER_FEC", 803 .name = "DTV_INNER_FEC",
804 .cmd = DTV_SET_INNER_FEC, 804 .cmd = DTV_INNER_FEC,
805 .set = 1, 805 .set = 1,
806 }, 806 },
807 [DTV_SET_VOLTAGE] = { 807 [DTV_VOLTAGE] = {
808 .name = "DTV_SET_VOLTAGE", 808 .name = "DTV_VOLTAGE",
809 .cmd = DTV_SET_VOLTAGE, 809 .cmd = DTV_VOLTAGE,
810 .set = 1, 810 .set = 1,
811 }, 811 },
812 [DTV_SET_TONE] = { 812 [DTV_TONE] = {
813 .name = "DTV_SET_TONE", 813 .name = "DTV_TONE",
814 .cmd = DTV_SET_TONE, 814 .cmd = DTV_TONE,
815 .set = 1, 815 .set = 1,
816 }, 816 },
817 [DTV_SET_PILOT] = { 817 [DTV_PILOT] = {
818 .name = "DTV_SET_PILOT", 818 .name = "DTV_PILOT",
819 .cmd = DTV_SET_PILOT, 819 .cmd = DTV_PILOT,
820 .set = 1, 820 .set = 1,
821 }, 821 },
822 [DTV_SET_ROLLOFF] = { 822 [DTV_ROLLOFF] = {
823 .name = "DTV_SET_ROLLOFF", 823 .name = "DTV_ROLLOFF",
824 .cmd = DTV_SET_ROLLOFF, 824 .cmd = DTV_ROLLOFF,
825 .set = 1, 825 .set = 1,
826 }, 826 },
827 [DTV_SET_DELIVERY_SYSTEM] = { 827 [DTV_DELIVERY_SYSTEM] = {
828 .name = "DTV_SET_DELIVERY_SYSTEM", 828 .name = "DTV_DELIVERY_SYSTEM",
829 .cmd = DTV_SET_DELIVERY_SYSTEM, 829 .cmd = DTV_DELIVERY_SYSTEM,
830 .set = 1, 830 .set = 1,
831 }, 831 },
832 [DTV_SET_ISDB_SEGMENT_IDX] = { 832 [DTV_ISDB_SEGMENT_IDX] = {
833 .name = "DTV_SET_ISDB_SEGMENT_IDX", 833 .name = "DTV_ISDB_SEGMENT_IDX",
834 .cmd = DTV_SET_ISDB_SEGMENT_IDX, 834 .cmd = DTV_ISDB_SEGMENT_IDX,
835 .set = 1, 835 .set = 1,
836 }, 836 },
837 [DTV_SET_ISDB_SEGMENT_WIDTH] = { 837 [DTV_ISDB_SEGMENT_WIDTH] = {
838 .name = "DTV_SET_ISDB_SEGMENT_WIDTH", 838 .name = "DTV_ISDB_SEGMENT_WIDTH",
839 .cmd = DTV_SET_ISDB_SEGMENT_WIDTH, 839 .cmd = DTV_ISDB_SEGMENT_WIDTH,
840 .set = 1, 840 .set = 1,
841 }, 841 },
842 842
843 /* Get */ 843 /* Get */
844 [DTV_GET_FREQUENCY] = { 844 [DTV_DISEQC_SLAVE_REPLY] = {
845 .name = "DTV_GET_FREQUENCY", 845 .name = "DTV_DISEQC_SLAVE_REPLY",
846 .cmd = DTV_GET_FREQUENCY, 846 .cmd = DTV_DISEQC_SLAVE_REPLY,
847 .set = 0,
848 },
849 [DTV_GET_BANDWIDTH] = {
850 .name = "DTV_GET_BANDWIDTH",
851 .cmd = DTV_GET_BANDWIDTH,
852 .set = 0,
853 },
854 [DTV_GET_MODULATION] = {
855 .name = "DTV_GET_MODULATION",
856 .cmd = DTV_GET_MODULATION,
857 .set = 0,
858 },
859 [DTV_GET_INVERSION] = {
860 .name = "DTV_GET_INVERSION",
861 .cmd = DTV_GET_INVERSION,
862 .set = 0,
863 },
864 [DTV_GET_DISEQC_SLAVE_REPLY] = {
865 .name = "DTV_GET_DISEQC_SLAVE_REPLY",
866 .cmd = DTV_GET_DISEQC_SLAVE_REPLY,
867 .set = 0, 847 .set = 0,
868 .buffer = 1, 848 .buffer = 1,
869 }, 849 },
870 [DTV_GET_SYMBOL_RATE] = { 850 [DTV_ISDB_LAYERA_FEC] = {
871 .name = "DTV_GET_SYMBOL_RATE", 851 .name = "DTV_ISDB_LAYERA_FEC",
872 .cmd = DTV_GET_SYMBOL_RATE, 852 .cmd = DTV_ISDB_LAYERA_FEC,
873 .set = 0,
874 },
875 [DTV_GET_INNER_FEC] = {
876 .name = "DTV_GET_INNER_FEC",
877 .cmd = DTV_GET_INNER_FEC,
878 .set = 0,
879 },
880 [DTV_GET_VOLTAGE] = {
881 .name = "DTV_GET_VOLTAGE",
882 .cmd = DTV_GET_VOLTAGE,
883 .set = 0,
884 },
885 [DTV_GET_TONE] = {
886 .name = "DTV_GET_TONE",
887 .cmd = DTV_GET_TONE,
888 .set = 0,
889 },
890 [DTV_GET_PILOT] = {
891 .name = "DTV_GET_PILOT",
892 .cmd = DTV_GET_PILOT,
893 .set = 0,
894 },
895 [DTV_GET_ROLLOFF] = {
896 .name = "DTV_GET_ROLLOFF",
897 .cmd = DTV_GET_ROLLOFF,
898 .set = 0,
899 },
900 [DTV_GET_DELIVERY_SYSTEM] = {
901 .name = "DTV_GET_DELIVERY_SYSTEM",
902 .cmd = DTV_GET_DELIVERY_SYSTEM,
903 .set = 0,
904 },
905 [DTV_GET_ISDB_SEGMENT_IDX] = {
906 .name = "DTV_GET_ISDB_SEGMENT_IDX",
907 .cmd = DTV_GET_ISDB_SEGMENT_IDX,
908 .set = 0,
909 },
910 [DTV_GET_ISDB_SEGMENT_WIDTH] = {
911 .name = "DTV_GET_ISDB_SEGMENT_WIDTH",
912 .cmd = DTV_GET_ISDB_SEGMENT_WIDTH,
913 .set = 0, 853 .set = 0,
914 }, 854 },
915 [DTV_GET_ISDB_LAYERA_FEC] = { 855 [DTV_ISDB_LAYERA_MODULATION] = {
916 .name = "DTV_GET_ISDB_LAYERA_FEC", 856 .name = "DTV_ISDB_LAYERA_MODULATION",
917 .cmd = DTV_GET_ISDB_LAYERA_FEC, 857 .cmd = DTV_ISDB_LAYERA_MODULATION,
918 .set = 0, 858 .set = 0,
919 }, 859 },
920 [DTV_GET_ISDB_LAYERA_MODULATION] = { 860 [DTV_ISDB_LAYERA_SEGMENT_WIDTH] = {
921 .name = "DTV_GET_ISDB_LAYERA_MODULATION", 861 .name = "DTV_ISDB_LAYERA_SEGMENT_WIDTH",
922 .cmd = DTV_GET_ISDB_LAYERA_MODULATION, 862 .cmd = DTV_ISDB_LAYERA_SEGMENT_WIDTH,
923 .set = 0, 863 .set = 0,
924 }, 864 },
925 [DTV_GET_ISDB_LAYERA_SEGMENT_WIDTH] = { 865 [DTV_ISDB_LAYERB_FEC] = {
926 .name = "DTV_GET_ISDB_LAYERA_SEGMENT_WIDTH", 866 .name = "DTV_ISDB_LAYERB_FEC",
927 .cmd = DTV_GET_ISDB_LAYERA_SEGMENT_WIDTH, 867 .cmd = DTV_ISDB_LAYERB_FEC,
928 .set = 0, 868 .set = 0,
929 }, 869 },
930 [DTV_GET_ISDB_LAYERB_FEC] = { 870 [DTV_ISDB_LAYERB_MODULATION] = {
931 .name = "DTV_GET_ISDB_LAYERB_FEC", 871 .name = "DTV_ISDB_LAYERB_MODULATION",
932 .cmd = DTV_GET_ISDB_LAYERB_FEC, 872 .cmd = DTV_ISDB_LAYERB_MODULATION,
933 .set = 0, 873 .set = 0,
934 }, 874 },
935 [DTV_GET_ISDB_LAYERB_MODULATION] = { 875 [DTV_ISDB_LAYERB_SEGMENT_WIDTH] = {
936 .name = "DTV_GET_ISDB_LAYERB_MODULATION", 876 .name = "DTV_ISDB_LAYERB_SEGMENT_WIDTH",
937 .cmd = DTV_GET_ISDB_LAYERB_MODULATION, 877 .cmd = DTV_ISDB_LAYERB_SEGMENT_WIDTH,
938 .set = 0, 878 .set = 0,
939 }, 879 },
940 [DTV_GET_ISDB_LAYERB_SEGMENT_WIDTH] = { 880 [DTV_ISDB_LAYERC_FEC] = {
941 .name = "DTV_GET_ISDB_LAYERB_SEGMENT_WIDTH", 881 .name = "DTV_ISDB_LAYERC_FEC",
942 .cmd = DTV_GET_ISDB_LAYERB_SEGMENT_WIDTH, 882 .cmd = DTV_ISDB_LAYERC_FEC,
943 .set = 0, 883 .set = 0,
944 }, 884 },
945 [DTV_GET_ISDB_LAYERC_FEC] = { 885 [DTV_ISDB_LAYERC_MODULATION] = {
946 .name = "DTV_GET_ISDB_LAYERC_FEC", 886 .name = "DTV_ISDB_LAYERC_MODULATION",
947 .cmd = DTV_GET_ISDB_LAYERC_FEC, 887 .cmd = DTV_ISDB_LAYERC_MODULATION,
948 .set = 0, 888 .set = 0,
949 }, 889 },
950 [DTV_GET_ISDB_LAYERC_MODULATION] = { 890 [DTV_ISDB_LAYERC_SEGMENT_WIDTH] = {
951 .name = "DTV_GET_ISDB_LAYERC_MODULATION", 891 .name = "DTV_ISDB_LAYERC_SEGMENT_WIDTH",
952 .cmd = DTV_GET_ISDB_LAYERC_MODULATION, 892 .cmd = DTV_ISDB_LAYERC_SEGMENT_WIDTH,
953 .set = 0,
954 },
955 [DTV_GET_ISDB_LAYERC_SEGMENT_WIDTH] = {
956 .name = "DTV_GET_ISDB_LAYERC_SEGMENT_WIDTH",
957 .cmd = DTV_GET_ISDB_LAYERC_SEGMENT_WIDTH,
958 .set = 0, 893 .set = 0,
959 }, 894 },
960}; 895};
@@ -1160,7 +1095,92 @@ static int dvb_frontend_ioctl_legacy(struct inode *inode, struct file *file,
1160static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file, 1095static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file,
1161 unsigned int cmd, void *parg); 1096 unsigned int cmd, void *parg);
1162 1097
1163int dtv_property_process(struct dvb_frontend *fe, struct dtv_property *tvp, 1098int dtv_property_process_get(struct dvb_frontend *fe, struct dtv_property *tvp,
1099 struct inode *inode, struct file *file)
1100{
1101 int r = 0;
1102
1103 printk("%s()\n", __FUNCTION__);
1104
1105 dtv_property_dump(tvp);
1106
1107 switch(tvp->cmd) {
1108 case DTV_FREQUENCY:
1109 tvp->u.data = fe->dtv_property_cache.frequency;
1110 break;
1111 case DTV_MODULATION:
1112 tvp->u.data = fe->dtv_property_cache.modulation;
1113 break;
1114 case DTV_BANDWIDTH:
1115 tvp->u.data = fe->dtv_property_cache.bandwidth;
1116 break;
1117 case DTV_INVERSION:
1118 tvp->u.data = fe->dtv_property_cache.inversion;
1119 break;
1120 case DTV_SYMBOL_RATE:
1121 tvp->u.data = fe->dtv_property_cache.symbol_rate;
1122 break;
1123 case DTV_INNER_FEC:
1124 tvp->u.data = fe->dtv_property_cache.fec_inner;
1125 break;
1126 case DTV_PILOT:
1127 tvp->u.data = fe->dtv_property_cache.pilot;
1128 break;
1129 case DTV_ROLLOFF:
1130 tvp->u.data = fe->dtv_property_cache.rolloff;
1131 break;
1132 case DTV_DELIVERY_SYSTEM:
1133 tvp->u.data = fe->dtv_property_cache.delivery_system;
1134 break;
1135
1136 /* ISDB-T Support here */
1137 case DTV_ISDB_SEGMENT_IDX:
1138 tvp->u.data = fe->dtv_property_cache.isdb_segment_idx;
1139 break;
1140 case DTV_ISDB_SEGMENT_WIDTH:
1141 tvp->u.data = fe->dtv_property_cache.isdb_segment_width;
1142 break;
1143 case DTV_ISDB_LAYERA_FEC:
1144 tvp->u.data = fe->dtv_property_cache.isdb_layera_fec;
1145 break;
1146 case DTV_ISDB_LAYERA_MODULATION:
1147 tvp->u.data = fe->dtv_property_cache.isdb_layera_modulation;
1148 break;
1149 case DTV_ISDB_LAYERA_SEGMENT_WIDTH:
1150 tvp->u.data = fe->dtv_property_cache.isdb_layera_segment_width;
1151 break;
1152 case DTV_ISDB_LAYERB_FEC:
1153 tvp->u.data = fe->dtv_property_cache.isdb_layerb_fec;
1154 break;
1155 case DTV_ISDB_LAYERB_MODULATION:
1156 tvp->u.data = fe->dtv_property_cache.isdb_layerb_modulation;
1157 break;
1158 case DTV_ISDB_LAYERB_SEGMENT_WIDTH:
1159 tvp->u.data = fe->dtv_property_cache.isdb_layerb_segment_width;
1160 break;
1161 case DTV_ISDB_LAYERC_FEC:
1162 tvp->u.data = fe->dtv_property_cache.isdb_layerc_fec;
1163 break;
1164 case DTV_ISDB_LAYERC_MODULATION:
1165 tvp->u.data = fe->dtv_property_cache.isdb_layerc_modulation;
1166 break;
1167 case DTV_ISDB_LAYERC_SEGMENT_WIDTH:
1168 tvp->u.data = fe->dtv_property_cache.isdb_layerc_segment_width;
1169 break;
1170 case DTV_VOLTAGE:
1171 tvp->u.data = fe->dtv_property_cache.voltage;
1172 break;
1173 case DTV_TONE:
1174 tvp->u.data = fe->dtv_property_cache.sectone;
1175 break;
1176 default:
1177 r = -1;
1178 }
1179
1180 return r;
1181}
1182
1183int dtv_property_process_set(struct dvb_frontend *fe, struct dtv_property *tvp,
1164 struct inode *inode, struct file *file) 1184 struct inode *inode, struct file *file)
1165{ 1185{
1166 int r = 0; 1186 int r = 0;
@@ -1190,117 +1210,53 @@ int dtv_property_process(struct dvb_frontend *fe, struct dtv_property *tvp,
1190 r |= dvb_frontend_ioctl_legacy(inode, file, FE_SET_FRONTEND, 1210 r |= dvb_frontend_ioctl_legacy(inode, file, FE_SET_FRONTEND,
1191 &fepriv->parameters); 1211 &fepriv->parameters);
1192 break; 1212 break;
1193 case DTV_SET_FREQUENCY: 1213 case DTV_FREQUENCY:
1194 fe->dtv_property_cache.frequency = tvp->u.data; 1214 fe->dtv_property_cache.frequency = tvp->u.data;
1195 break; 1215 break;
1196 case DTV_GET_FREQUENCY: 1216 case DTV_MODULATION:
1197 tvp->u.data = fe->dtv_property_cache.frequency;
1198 break;
1199 case DTV_SET_MODULATION:
1200 fe->dtv_property_cache.modulation = tvp->u.data; 1217 fe->dtv_property_cache.modulation = tvp->u.data;
1201 break; 1218 break;
1202 case DTV_GET_MODULATION: 1219 case DTV_BANDWIDTH:
1203 tvp->u.data = fe->dtv_property_cache.modulation;
1204 break;
1205 case DTV_SET_BANDWIDTH:
1206 fe->dtv_property_cache.bandwidth = tvp->u.data; 1220 fe->dtv_property_cache.bandwidth = tvp->u.data;
1207 break; 1221 break;
1208 case DTV_GET_BANDWIDTH: 1222 case DTV_INVERSION:
1209 tvp->u.data = fe->dtv_property_cache.bandwidth;
1210 break;
1211 case DTV_SET_INVERSION:
1212 fe->dtv_property_cache.inversion = tvp->u.data; 1223 fe->dtv_property_cache.inversion = tvp->u.data;
1213 break; 1224 break;
1214 case DTV_GET_INVERSION: 1225 case DTV_SYMBOL_RATE:
1215 tvp->u.data = fe->dtv_property_cache.inversion;
1216 break;
1217 case DTV_SET_SYMBOL_RATE:
1218 fe->dtv_property_cache.symbol_rate = tvp->u.data; 1226 fe->dtv_property_cache.symbol_rate = tvp->u.data;
1219 break; 1227 break;
1220 case DTV_GET_SYMBOL_RATE: 1228 case DTV_INNER_FEC:
1221 tvp->u.data = fe->dtv_property_cache.symbol_rate;
1222 break;
1223 case DTV_SET_INNER_FEC:
1224 fe->dtv_property_cache.fec_inner = tvp->u.data; 1229 fe->dtv_property_cache.fec_inner = tvp->u.data;
1225 break; 1230 break;
1226 case DTV_GET_INNER_FEC: 1231 case DTV_PILOT:
1227 tvp->u.data = fe->dtv_property_cache.fec_inner;
1228 break;
1229 case DTV_SET_PILOT:
1230 fe->dtv_property_cache.pilot = tvp->u.data; 1232 fe->dtv_property_cache.pilot = tvp->u.data;
1231 break; 1233 break;
1232 case DTV_GET_PILOT: 1234 case DTV_ROLLOFF:
1233 tvp->u.data = fe->dtv_property_cache.pilot;
1234 break;
1235 case DTV_SET_ROLLOFF:
1236 fe->dtv_property_cache.rolloff = tvp->u.data; 1235 fe->dtv_property_cache.rolloff = tvp->u.data;
1237 break; 1236 break;
1238 case DTV_GET_ROLLOFF: 1237 case DTV_DELIVERY_SYSTEM:
1239 tvp->u.data = fe->dtv_property_cache.rolloff;
1240 break;
1241 case DTV_SET_DELIVERY_SYSTEM:
1242 fe->dtv_property_cache.delivery_system = tvp->u.data; 1238 fe->dtv_property_cache.delivery_system = tvp->u.data;
1243 break; 1239 break;
1244 case DTV_GET_DELIVERY_SYSTEM:
1245 tvp->u.data = fe->dtv_property_cache.delivery_system;
1246 break;
1247 1240
1248 /* ISDB-T Support here */ 1241 /* ISDB-T Support here */
1249 case DTV_SET_ISDB_SEGMENT_IDX: 1242 case DTV_ISDB_SEGMENT_IDX:
1250 fe->dtv_property_cache.isdb_segment_idx = tvp->u.data; 1243 fe->dtv_property_cache.isdb_segment_idx = tvp->u.data;
1251 break; 1244 break;
1252 case DTV_GET_ISDB_SEGMENT_IDX: 1245 case DTV_ISDB_SEGMENT_WIDTH:
1253 tvp->u.data = fe->dtv_property_cache.isdb_segment_idx;
1254 break;
1255 case DTV_SET_ISDB_SEGMENT_WIDTH:
1256 fe->dtv_property_cache.isdb_segment_width = tvp->u.data; 1246 fe->dtv_property_cache.isdb_segment_width = tvp->u.data;
1257 break; 1247 break;
1258 case DTV_GET_ISDB_SEGMENT_WIDTH: 1248 case DTV_VOLTAGE:
1259 tvp->u.data = fe->dtv_property_cache.isdb_segment_width;
1260 break;
1261 case DTV_GET_ISDB_LAYERA_FEC:
1262 tvp->u.data = fe->dtv_property_cache.isdb_layera_fec;
1263 break;
1264 case DTV_GET_ISDB_LAYERA_MODULATION:
1265 tvp->u.data = fe->dtv_property_cache.isdb_layera_modulation;
1266 break;
1267 case DTV_GET_ISDB_LAYERA_SEGMENT_WIDTH:
1268 tvp->u.data = fe->dtv_property_cache.isdb_layera_segment_width;
1269 break;
1270 case DTV_GET_ISDB_LAYERB_FEC:
1271 tvp->u.data = fe->dtv_property_cache.isdb_layerb_fec;
1272 break;
1273 case DTV_GET_ISDB_LAYERB_MODULATION:
1274 tvp->u.data = fe->dtv_property_cache.isdb_layerb_modulation;
1275 break;
1276 case DTV_GET_ISDB_LAYERB_SEGMENT_WIDTH:
1277 tvp->u.data = fe->dtv_property_cache.isdb_layerb_segment_width;
1278 break;
1279 case DTV_GET_ISDB_LAYERC_FEC:
1280 tvp->u.data = fe->dtv_property_cache.isdb_layerc_fec;
1281 break;
1282 case DTV_GET_ISDB_LAYERC_MODULATION:
1283 tvp->u.data = fe->dtv_property_cache.isdb_layerc_modulation;
1284 break;
1285 case DTV_GET_ISDB_LAYERC_SEGMENT_WIDTH:
1286 tvp->u.data = fe->dtv_property_cache.isdb_layerc_segment_width;
1287 break;
1288 case DTV_SET_VOLTAGE:
1289 fe->dtv_property_cache.voltage = tvp->u.data; 1249 fe->dtv_property_cache.voltage = tvp->u.data;
1290 r = dvb_frontend_ioctl_legacy(inode, file, FE_SET_VOLTAGE, 1250 r = dvb_frontend_ioctl_legacy(inode, file, FE_SET_VOLTAGE,
1291 (void *)fe->dtv_property_cache.voltage); 1251 (void *)fe->dtv_property_cache.voltage);
1292 break; 1252 break;
1293 case DTV_GET_VOLTAGE: 1253 case DTV_TONE:
1294 tvp->u.data = fe->dtv_property_cache.voltage;
1295 break;
1296 case DTV_SET_TONE:
1297 fe->dtv_property_cache.sectone = tvp->u.data; 1254 fe->dtv_property_cache.sectone = tvp->u.data;
1298 r = dvb_frontend_ioctl_legacy(inode, file, FE_SET_TONE, 1255 r = dvb_frontend_ioctl_legacy(inode, file, FE_SET_TONE,
1299 (void *)fe->dtv_property_cache.sectone); 1256 (void *)fe->dtv_property_cache.sectone);
1300 break; 1257 break;
1301 case DTV_GET_TONE: 1258 default:
1302 tvp->u.data = fe->dtv_property_cache.sectone; 1259 r = -1;
1303 break;
1304 } 1260 }
1305 1261
1306 return r; 1262 return r;
@@ -1375,13 +1331,50 @@ static int dvb_frontend_ioctl_properties(struct inode *inode, struct file *file,
1375 } 1331 }
1376 1332
1377 for (i = 0; i < tvps->num; i++) 1333 for (i = 0; i < tvps->num; i++)
1378 dtv_property_process(fe, tvp + i, inode, file); 1334 dtv_property_process_set(fe, tvp + i, inode, file);
1379 1335
1380 if(fe->dtv_property_cache.state == DTV_TUNE) { 1336 if(fe->dtv_property_cache.state == DTV_TUNE) {
1381 printk("%s() Property cache is full, tuning\n", __FUNCTION__); 1337 printk("%s() Property cache is full, tuning\n", __FUNCTION__);
1382 } 1338 }
1383 err = 0; 1339 err = 0;
1384 } 1340 } else
1341 if(cmd == FE_GET_PROPERTY) {
1342 printk("%s() FE_GET_PROPERTY\n", __FUNCTION__);
1343
1344 tvps = (struct dtv_properties __user *)parg;
1345
1346 printk("%s() properties.num = %d\n", __FUNCTION__, tvps->num);
1347 printk("%s() properties.props = %p\n", __FUNCTION__, tvps->props);
1348
1349 /* Put an arbitrary limit on the number of messages that can
1350 * be sent at once */
1351 if (tvps->num > DTV_IOCTL_MAX_MSGS)
1352 return -EINVAL;
1353
1354 tvp = (struct dtv_property *) kmalloc(tvps->num *
1355 sizeof(struct dtv_property), GFP_KERNEL);
1356 if (!tvp) {
1357 err = -ENOMEM;
1358 goto out;
1359 }
1360
1361 if (copy_from_user(tvp, tvps->props, tvps->num * sizeof(struct dtv_property))) {
1362 err = -EFAULT;
1363 goto out;
1364 }
1365
1366 for (i = 0; i < tvps->num; i++)
1367 dtv_property_process_get(fe, tvp + i, inode, file);
1368
1369 if (copy_to_user(tvps->props, tvp, tvps->num * sizeof(struct dtv_property))) {
1370 err = -EFAULT;
1371 goto out;
1372 }
1373
1374 err = 0;
1375 } else
1376 err = -EOPNOTSUPP;
1377
1385out: 1378out:
1386 kfree(tvp); 1379 kfree(tvp);
1387 return err; 1380 return err;