tree: git://git.ragnatech.se/linux media-tree head: 8382e556b1a2f30c4bf866f021b33577a64f9ebf commit: d73dcf0cdb95a47f7e4e991ab63dd30f6eb67b4e [2742/2771] media: dvb_frontend: cleanup ioctl handling logic config: i386-randconfig-h1-10130413 (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: git checkout d73dcf0cdb95a47f7e4e991ab63dd30f6eb67b4e # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:constant_test_bit Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:variable_test_bit Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u32 Cyclomatic Complexity 3 include/linux/log2.h:is_power_of_2 Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:atomic_read Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:atomic_set Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:atomic_inc Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:atomic_dec_and_test Cyclomatic Complexity 1 arch/x86/include/asm/current.h:get_current Cyclomatic Complexity 1 include/asm-generic/getorder.h:__get_order Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR Cyclomatic Complexity 1 include/linux/err.h:IS_ERR Cyclomatic Complexity 2 include/linux/thread_info.h:test_ti_thread_flag Cyclomatic Complexity 2 include/linux/thread_info.h:check_object_size Cyclomatic Complexity 2 include/linux/thread_info.h:copy_overflow Cyclomatic Complexity 4 include/linux/thread_info.h:check_copy_size Cyclomatic Complexity 70 include/linux/ktime.h:ktime_divns Cyclomatic Complexity 1 include/linux/ktime.h:ktime_to_us Cyclomatic Complexity 1 include/linux/ktime.h:ktime_us_delta Cyclomatic Complexity 1 include/linux/ktime.h:ktime_add_us Cyclomatic Complexity 1 include/linux/timekeeping.h:ktime_get_boottime Cyclomatic Complexity 1 include/linux/refcount.h:refcount_set Cyclomatic Complexity 1 include/linux/refcount.h:refcount_inc Cyclomatic Complexity 1 include/linux/refcount.h:refcount_dec_and_test Cyclomatic Complexity 1 include/linux/sched.h:task_thread_info Cyclomatic Complexity 1 include/linux/sched.h:test_tsk_thread_flag Cyclomatic Complexity 1 include/linux/sched/signal.h:signal_pending Cyclomatic Complexity 1 include/linux/kasan.h:kasan_kmalloc Cyclomatic Complexity 28 include/linux/slab.h:kmalloc_index Cyclomatic Complexity 1 include/linux/slab.h:kmem_cache_alloc_trace Cyclomatic Complexity 1 include/linux/slab.h:kmalloc_order_trace Cyclomatic Complexity 67 include/linux/slab.h:kmalloc_large Cyclomatic Complexity 5 include/linux/slab.h:kmalloc Cyclomatic Complexity 1 include/linux/slab.h:kzalloc Cyclomatic Complexity 1 include/linux/semaphore.h:sema_init Cyclomatic Complexity 2 include/linux/uaccess.h:copy_to_user Cyclomatic Complexity 4 include/linux/poll.h:poll_wait Cyclomatic Complexity 1 include/linux/kref.h:kref_init Cyclomatic Complexity 1 include/linux/kref.h:kref_get Cyclomatic Complexity 2 include/linux/kref.h:kref_put Cyclomatic Complexity 2 include/linux/freezer.h:freezing Cyclomatic Complexity 2 include/linux/freezer.h:try_to_freeze_unsafe Cyclomatic Complexity 2 include/linux/freezer.h:try_to_freeze Cyclomatic Complexity 1 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_put Cyclomatic Complexity 1 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_get Cyclomatic Complexity 1 drivers/media//dvb-core/dvb_frontend.c:has_get_frontend Cyclomatic Complexity 5 drivers/media//dvb-core/dvb_frontend.c:dvbv3_type Cyclomatic Complexity 5 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_init Cyclomatic Complexity 2 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_swzigzag_update_delay Cyclomatic Complexity 20 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_swzigzag_autotune Cyclomatic Complexity 6 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_is_exiting Cyclomatic Complexity 2 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_should_wakeup Cyclomatic Complexity 3 drivers/media//dvb-core/dvb_frontend.c:is_dvbv3_delsys Cyclomatic Complexity 4 drivers/media//dvb-core/dvb_frontend.c:emulate_delivery_system Cyclomatic Complexity 10 drivers/media//dvb-core/dvb_frontend.c:dvbv5_set_delivery_system Cyclomatic Complexity 7 drivers/media//dvb-core/dvb_frontend.c:dvbv3_set_delivery_system Cyclomatic Complexity 2 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_poll Cyclomatic Complexity 4 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_suspend Cyclomatic Complexity 2 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_invoke_release Cyclomatic Complexity 1 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_detach Cyclomatic Complexity 1 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_wakeup Cyclomatic Complexity 1 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_reinitialise Cyclomatic Complexity 8 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_resume Cyclomatic Complexity 5 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_sleep_until Cyclomatic Complexity 15 drivers/media//dvb-core/dvb_frontend.c:dtv_property_cache_sync Cyclomatic Complexity 12 drivers/media//dvb-core/dvb_frontend.c:dtv_property_legacy_params_sync Cyclomatic Complexity 4 drivers/media//dvb-core/dvb_frontend.c:dtv_get_frontend Cyclomatic Complexity 5 drivers/media//dvb-core/dvb_frontend.c:dtv_property_dump Cyclomatic Complexity 65 drivers/media//dvb-core/dvb_frontend.c:dtv_property_process_get Cyclomatic Complexity 5 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_get_frequency_limits Cyclomatic Complexity 10 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_check_parameters Cyclomatic Complexity 5 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_clear_cache Cyclomatic Complexity 3 drivers/media//dvb-core/dvb_frontend.c:dvb_register_frontend Cyclomatic Complexity 1 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_clear_events Cyclomatic Complexity 4 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_add_event Cyclomatic Complexity 18 drivers/media//dvb-core/dvb_frontend.c:dtv_set_frontend Cyclomatic Complexity 25 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_swzigzag Cyclomatic Complexity 9 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_get_event Cyclomatic Complexity 67 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_handle_ioctl Cyclomatic Complexity 6 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_ioctl Cyclomatic Complexity 44 drivers/media//dvb-core/dvb_frontend.c:dtv_property_process_set Cyclomatic Complexity 5 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_release Cyclomatic Complexity 2 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_free Cyclomatic Complexity 44 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_thread Cyclomatic Complexity 4 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_stop Cyclomatic Complexity 7 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_start Cyclomatic Complexity 23 drivers/media//dvb-core/dvb_frontend.c:dvb_frontend_open Cyclomatic Complexity 1 drivers/media//dvb-core/dvb_frontend.c:dvb_unregister_frontend drivers/media//dvb-core/dvb_frontend.c: In function 'dvb_frontend_handle_ioctl': >> drivers/media//dvb-core/dvb_frontend.c:2447:1: warning: the frame size of 1048 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ vim +2447 drivers/media//dvb-core/dvb_frontend.c 9682cea27 drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2078 9682cea27 drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2079 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2080 static int dvb_frontend_handle_ioctl(struct file *file, 13c97bf56 drivers/media/dvb/dvb-core/dvb_frontend.c Steven Toth 2008-09-04 2081 unsigned int cmd, void *parg) 13c97bf56 drivers/media/dvb/dvb-core/dvb_frontend.c Steven Toth 2008-09-04 2082 { 13c97bf56 drivers/media/dvb/dvb-core/dvb_frontend.c Steven Toth 2008-09-04 2083 struct dvb_device *dvbdev = file->private_data; 13c97bf56 drivers/media/dvb/dvb-core/dvb_frontend.c Steven Toth 2008-09-04 2084 struct dvb_frontend *fe = dvbdev->priv; 13c97bf56 drivers/media/dvb/dvb-core/dvb_frontend.c Steven Toth 2008-09-04 2085 struct dvb_frontend_private *fepriv = fe->frontend_priv; 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2086 struct dtv_frontend_properties *c = &fe->dtv_property_cache; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2087 int i, err; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2088 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2089 dev_dbg(fe->dvb->device, "%s:\n", __func__); 13c97bf56 drivers/media/dvb/dvb-core/dvb_frontend.c Steven Toth 2008-09-04 2090 ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2091 switch(cmd) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2092 case FE_SET_PROPERTY: { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2093 struct dtv_properties *tvps = parg; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2094 struct dtv_property *tvp = NULL; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2095 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2096 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n", d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2097 __func__, tvps->num); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2098 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n", d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2099 __func__, tvps->props); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2100 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2101 /* d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2102 * Put an arbitrary limit on the number of messages that can d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2103 * be sent at once d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2104 */ d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2105 if (!tvps->num || (tvps->num > DTV_IOCTL_MAX_MSGS)) d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2106 return -EINVAL; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2107 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2108 tvp = memdup_user(tvps->props, tvps->num * sizeof(*tvp)); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2109 if (IS_ERR(tvp)) d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2110 return PTR_ERR(tvp); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2111 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2112 for (i = 0; i < tvps->num; i++) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2113 err = dtv_property_process_set(fe, tvp + i, file); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2114 if (err < 0) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2115 kfree(tvp); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2116 return err; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2117 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2118 (tvp + i)->result = err; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2119 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2120 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2121 if (c->state == DTV_TUNE) d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2122 dev_dbg(fe->dvb->device, "%s: Property cache is full, tuning\n", __func__); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2123 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2124 kfree(tvp); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2125 break; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2126 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2127 case FE_GET_PROPERTY: { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2128 struct dtv_properties *tvps = parg; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2129 struct dtv_property *tvp = NULL; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2130 struct dtv_frontend_properties getp = fe->dtv_property_cache; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2131 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2132 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n", d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2133 __func__, tvps->num); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2134 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n", d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2135 __func__, tvps->props); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2136 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2137 /* d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2138 * Put an arbitrary limit on the number of messages that can d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2139 * be sent at once d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2140 */ d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2141 if (!tvps->num || (tvps->num > DTV_IOCTL_MAX_MSGS)) d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2142 return -EINVAL; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2143 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2144 tvp = memdup_user(tvps->props, tvps->num * sizeof(*tvp)); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2145 if (IS_ERR(tvp)) d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2146 return PTR_ERR(tvp); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2147 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2148 /* d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2149 * Let's use our own copy of property cache, in order to d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2150 * avoid mangling with DTV zigzag logic, as drivers might d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2151 * return crap, if they don't check if the data is available d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2152 * before updating the properties cache. d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2153 */ d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2154 if (fepriv->state != FESTATE_IDLE) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2155 err = dtv_get_frontend(fe, &getp, NULL); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2156 if (err < 0) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2157 kfree(tvp); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2158 return err; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2159 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2160 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2161 for (i = 0; i < tvps->num; i++) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2162 err = dtv_property_process_get(fe, &getp, tvp + i, file); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2163 if (err < 0) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2164 kfree(tvp); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2165 return err; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2166 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2167 (tvp + i)->result = err; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2168 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2169 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2170 if (copy_to_user((void __user *)tvps->props, tvp, d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2171 tvps->num * sizeof(struct dtv_property))) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2172 kfree(tvp); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2173 return -EFAULT; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2174 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2175 kfree(tvp); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2176 break; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2177 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2178 ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2179 case FE_GET_INFO: { 0c53c70f6 drivers/media/dvb/dvb-core/dvb_frontend.c Johannes Stezenbach 2005-05-16 2180 struct dvb_frontend_info* info = parg; 9474c5e63 drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-05 2181 dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2182 memcpy(info, &fe->ops.info, sizeof(struct dvb_frontend_info)); 2030c0325 drivers/media/dvb/dvb-core/dvb_frontend.c Guillaume Audirac 2010-05-06 2183 dvb_frontend_get_frequency_limits(fe, &info->frequency_min, &info->frequency_max); ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2184 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2185 /* 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2186 * Associate the 4 delivery systems supported by DVBv3 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2187 * API with their DVBv5 counterpart. For the other standards, 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2188 * use the closest type, assuming that it would hopefully 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2189 * work with a DVBv3 application. 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2190 * It should be noticed that, on multi-frontend devices with 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2191 * different types (terrestrial and cable, for example), 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2192 * a pure DVBv3 application won't be able to use all delivery 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2193 * systems. Yet, changing the DVBv5 cache to the other delivery 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2194 * system should be enough for making it work. 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2195 */ 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2196 switch (dvbv3_type(c->delivery_system)) { 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2197 case DVBV3_QPSK: 9474c5e63 drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-05 2198 info->type = FE_QPSK; 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2199 break; 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2200 case DVBV3_ATSC: 9474c5e63 drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-05 2201 info->type = FE_ATSC; 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2202 break; 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2203 case DVBV3_QAM: 9474c5e63 drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-05 2204 info->type = FE_QAM; 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2205 break; 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2206 case DVBV3_OFDM: 9474c5e63 drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-05 2207 info->type = FE_OFDM; 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2208 break; 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2209 default: 36bdbc3ff drivers/media/dvb-core/dvb_frontend.c Antti Palosaari 2012-08-15 2210 dev_err(fe->dvb->device, 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2211 "%s: doesn't know how to handle a DVBv3 call to delivery system %i\n", 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2212 __func__, c->delivery_system); 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2213 fe->ops.info.type = FE_OFDM; 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2214 } 36bdbc3ff drivers/media/dvb-core/dvb_frontend.c Antti Palosaari 2012-08-15 2215 dev_dbg(fe->dvb->device, "%s: current delivery system on cache: %d, V3 type: %d\n", 36bdbc3ff drivers/media/dvb-core/dvb_frontend.c Antti Palosaari 2012-08-15 2216 __func__, c->delivery_system, fe->ops.info.type); 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2217 c9d57de61 drivers/media/dvb-core/dvb_frontend.c Malcolm Priestley 2015-08-31 2218 /* Set CAN_INVERSION_AUTO bit on in other than oneshot mode */ c9d57de61 drivers/media/dvb-core/dvb_frontend.c Malcolm Priestley 2015-08-31 2219 if (!(fepriv->tune_mode_flags & FE_TUNE_MODE_ONESHOT)) ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2220 info->caps |= FE_CAN_INVERSION_AUTO; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2221 err = 0; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2222 break; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2223 } ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2224 6757ccc57 drivers/media/dvb/dvb-core/dvb_frontend.c Peter Beutner 2005-07-07 2225 case FE_READ_STATUS: { 0df289a20 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2015-06-07 2226 enum fe_status *status = parg; 6757ccc57 drivers/media/dvb/dvb-core/dvb_frontend.c Peter Beutner 2005-07-07 2227 25985edce drivers/media/dvb/dvb-core/dvb_frontend.c Lucas De Marchi 2011-03-30 2228 /* if retune was requested but hasn't occurred yet, prevent 6757ccc57 drivers/media/dvb/dvb-core/dvb_frontend.c Peter Beutner 2005-07-07 2229 * that user get signal state from previous tuning */ 01886255d drivers/media/dvb/dvb-core/dvb_frontend.c Janne Grunau 2009-09-01 2230 if (fepriv->state == FESTATE_RETUNE || 01886255d drivers/media/dvb/dvb-core/dvb_frontend.c Janne Grunau 2009-09-01 2231 fepriv->state == FESTATE_ERROR) { 6757ccc57 drivers/media/dvb/dvb-core/dvb_frontend.c Peter Beutner 2005-07-07 2232 err=0; 6757ccc57 drivers/media/dvb/dvb-core/dvb_frontend.c Peter Beutner 2005-07-07 2233 *status = 0; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2234 break; 6757ccc57 drivers/media/dvb/dvb-core/dvb_frontend.c Peter Beutner 2005-07-07 2235 } ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2236 dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2237 if (fe->ops.read_status) dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2238 err = fe->ops.read_status(fe, status); 6757ccc57 drivers/media/dvb/dvb-core/dvb_frontend.c Peter Beutner 2005-07-07 2239 break; 6757ccc57 drivers/media/dvb/dvb-core/dvb_frontend.c Peter Beutner 2005-07-07 2240 } 48caa6f12 drivers/media/dvb-core/dvb_frontend.c Antti Palosaari 2012-08-09 2241 ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2242 case FE_DISEQC_RESET_OVERLOAD: dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2243 if (fe->ops.diseqc_reset_overload) { dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2244 err = fe->ops.diseqc_reset_overload(fe); ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2245 fepriv->state = FESTATE_DISEQC; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2246 fepriv->status = 0; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2247 } ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2248 break; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2249 ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2250 case FE_DISEQC_SEND_MASTER_CMD: dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2251 if (fe->ops.diseqc_send_master_cmd) { 8d7e50635 drivers/media/dvb-core/dvb_frontend.c Dan Carpenter 2015-06-06 2252 struct dvb_diseqc_master_cmd *cmd = parg; 8d7e50635 drivers/media/dvb-core/dvb_frontend.c Dan Carpenter 2015-06-06 2253 8d7e50635 drivers/media/dvb-core/dvb_frontend.c Dan Carpenter 2015-06-06 2254 if (cmd->msg_len > sizeof(cmd->msg)) { 8d7e50635 drivers/media/dvb-core/dvb_frontend.c Dan Carpenter 2015-06-06 2255 err = -EINVAL; 8d7e50635 drivers/media/dvb-core/dvb_frontend.c Dan Carpenter 2015-06-06 2256 break; 8d7e50635 drivers/media/dvb-core/dvb_frontend.c Dan Carpenter 2015-06-06 2257 } 8d7e50635 drivers/media/dvb-core/dvb_frontend.c Dan Carpenter 2015-06-06 2258 err = fe->ops.diseqc_send_master_cmd(fe, cmd); ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2259 fepriv->state = FESTATE_DISEQC; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2260 fepriv->status = 0; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2261 } ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2262 break; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2263 ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2264 case FE_DISEQC_SEND_BURST: dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2265 if (fe->ops.diseqc_send_burst) { 0df289a20 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2015-06-07 2266 err = fe->ops.diseqc_send_burst(fe, 0df289a20 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2015-06-07 2267 (enum fe_sec_mini_cmd)parg); ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2268 fepriv->state = FESTATE_DISEQC; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2269 fepriv->status = 0; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2270 } ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2271 break; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2272 ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2273 case FE_SET_TONE: dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2274 if (fe->ops.set_tone) { 0df289a20 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2015-06-07 2275 err = fe->ops.set_tone(fe, 0df289a20 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2015-06-07 2276 (enum fe_sec_tone_mode)parg); 0df289a20 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2015-06-07 2277 fepriv->tone = (enum fe_sec_tone_mode)parg; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2278 fepriv->state = FESTATE_DISEQC; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2279 fepriv->status = 0; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2280 } ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2281 break; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2282 ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2283 case FE_SET_VOLTAGE: dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2284 if (fe->ops.set_voltage) { 0df289a20 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2015-06-07 2285 err = fe->ops.set_voltage(fe, 0df289a20 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2015-06-07 2286 (enum fe_sec_voltage)parg); 0df289a20 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2015-06-07 2287 fepriv->voltage = (enum fe_sec_voltage)parg; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2288 fepriv->state = FESTATE_DISEQC; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2289 fepriv->status = 0; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2290 } ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2291 break; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2292 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2293 case FE_DISEQC_RECV_SLAVE_REPLY: d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2294 if (fe->ops.diseqc_recv_slave_reply) d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2295 err = fe->ops.diseqc_recv_slave_reply(fe, (struct dvb_diseqc_slave_reply*) parg); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2296 break; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2297 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2298 case FE_ENABLE_HIGH_LNB_VOLTAGE: d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2299 if (fe->ops.enable_high_lnb_voltage) d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2300 err = fe->ops.enable_high_lnb_voltage(fe, (long) parg); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2301 break; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2302 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2303 case FE_SET_FRONTEND_TUNE_MODE: d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2304 fepriv->tune_mode_flags = (unsigned long) parg; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2305 err = 0; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2306 break; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2307 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2308 /* DEPRECATED dish control ioctls */ d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2309 ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2310 case FE_DISHNETWORK_SEND_LEGACY_CMD: dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2311 if (fe->ops.dishnetwork_send_legacy_command) { 0df289a20 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2015-06-07 2312 err = fe->ops.dishnetwork_send_legacy_command(fe, 0df289a20 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2015-06-07 2313 (unsigned long)parg); ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2314 fepriv->state = FESTATE_DISEQC; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2315 fepriv->status = 0; dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2316 } else if (fe->ops.set_voltage) { 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2317 /* 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2318 * NOTE: This is a fallback condition. Some frontends 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2319 * (stv0299 for instance) take longer than 8msec to 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2320 * respond to a set_voltage command. Those switches 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2321 * need custom routines to switch properly. For all 2030c0325 drivers/media/dvb/dvb-core/dvb_frontend.c Guillaume Audirac 2010-05-06 2322 * other frontends, the following should work ok. 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2323 * Dish network legacy switches (as used by Dish500) 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2324 * are controlled by sending 9-bit command words 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2325 * spaced 8msec apart. 25985edce drivers/media/dvb/dvb-core/dvb_frontend.c Lucas De Marchi 2011-03-30 2326 * the actual command word is switch/port dependent 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2327 * so it is up to the userspace application to send 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2328 * the right command. 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2329 * The command must always start with a '0' after 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2330 * initialization, so parg is 8 bits and does not 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2331 * include the initialization or start bit 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2332 */ c6eb8eafd drivers/media/dvb/dvb-core/dvb_frontend.c Hans Verkuil 2008-09-03 2333 unsigned long swcmd = ((unsigned long) parg) << 1; 9056a23ba drivers/media/dvb-core/dvb_frontend.c Tina Ruchandani 2015-05-31 2334 ktime_t nexttime; 9056a23ba drivers/media/dvb-core/dvb_frontend.c Tina Ruchandani 2015-05-31 2335 ktime_t tv[10]; 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2336 int i; 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2337 u8 last = 1; 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2338 if (dvb_frontend_debug) b3ad24d2e drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-10-13 2339 dprintk("%s switch command: 0x%04lx\n", b3ad24d2e drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-10-13 2340 __func__, swcmd); 6b3f99989 drivers/media/dvb-core/dvb_frontend.c Abhilash Jindal 2016-01-31 2341 nexttime = ktime_get_boottime(); 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2342 if (dvb_frontend_debug) b9b1b3a8f drivers/media/dvb-core/dvb_frontend.c Ezequiel Garcia 2012-10-23 2343 tv[0] = nexttime; 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2344 /* before sending a command, initialize by sending 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2345 * a 32ms 18V to the switch 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2346 */ dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2347 fe->ops.set_voltage(fe, SEC_VOLTAGE_18); 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2348 dvb_frontend_sleep_until(&nexttime, 32000); 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2349 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2350 for (i = 0; i < 9; i++) { 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2351 if (dvb_frontend_debug) 6b3f99989 drivers/media/dvb-core/dvb_frontend.c Abhilash Jindal 2016-01-31 2352 tv[i+1] = ktime_get_boottime(); c6eb8eafd drivers/media/dvb/dvb-core/dvb_frontend.c Hans Verkuil 2008-09-03 2353 if ((swcmd & 0x01) != last) { 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2354 /* set voltage to (last ? 13V : 18V) */ dea74869f drivers/media/dvb/dvb-core/dvb_frontend.c Patrick Boettcher 2006-05-14 2355 fe->ops.set_voltage(fe, (last) ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18); 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2356 last = (last) ? 0 : 1; 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2357 } c6eb8eafd drivers/media/dvb/dvb-core/dvb_frontend.c Hans Verkuil 2008-09-03 2358 swcmd = swcmd >> 1; 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2359 if (i != 8) 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2360 dvb_frontend_sleep_until(&nexttime, 8000); 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2361 } 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2362 if (dvb_frontend_debug) { b3ad24d2e drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-10-13 2363 dprintk("%s(%d): switch delay (should be 32k followed by all 8k)\n", 46b4f7c17 drivers/media/dvb/dvb-core/dvb_frontend.c Harvey Harrison 2008-04-08 2364 __func__, fe->dvb->num); 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2365 for (i = 1; i < 10; i++) b3ad24d2e drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-10-13 2366 pr_info("%d: %d\n", i, 9056a23ba drivers/media/dvb-core/dvb_frontend.c Tina Ruchandani 2015-05-31 2367 (int) ktime_us_delta(tv[i], tv[i-1])); 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2368 } 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2369 err = 0; 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2370 fepriv->state = FESTATE_DISEQC; 83b75b049 drivers/media/dvb/dvb-core/dvb_frontend.c NooneImportant 2005-11-08 2371 fepriv->status = 0; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2372 } ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2373 break; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2374 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2375 /* DEPRECATED statistics ioctls */ d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2376 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2377 case FE_READ_BER: d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2378 if (fe->ops.read_ber) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2379 if (fepriv->thread) d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2380 err = fe->ops.read_ber(fe, (__u32 *) parg); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2381 else d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2382 err = -EAGAIN; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2383 } ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2384 break; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2385 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2386 case FE_READ_SIGNAL_STRENGTH: d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2387 if (fe->ops.read_signal_strength) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2388 if (fepriv->thread) d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2389 err = fe->ops.read_signal_strength(fe, (__u16 *) parg); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2390 else d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2391 err = -EAGAIN; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2392 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2393 break; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2394 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2395 case FE_READ_SNR: d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2396 if (fe->ops.read_snr) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2397 if (fepriv->thread) d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2398 err = fe->ops.read_snr(fe, (__u16 *) parg); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2399 else d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2400 err = -EAGAIN; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2401 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2402 break; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2403 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2404 case FE_READ_UNCORRECTED_BLOCKS: d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2405 if (fe->ops.read_ucblocks) { d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2406 if (fepriv->thread) d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2407 err = fe->ops.read_ucblocks(fe, (__u32 *) parg); d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2408 else d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2409 err = -EAGAIN; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2410 } ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2411 break; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2412 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2413 /* DEPRECATED DVBv3 ioctls */ d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2414 9682cea27 drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2415 case FE_SET_FRONTEND: be431b16c drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2013-03-18 2416 err = dvbv3_set_delivery_system(fe); 04be0f76a drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2417 if (err) 04be0f76a drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2418 break; 04be0f76a drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2419 e399ce77e drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2420 err = dtv_property_cache_sync(fe, c, parg); 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2421 if (err) 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2422 break; 5bfaaddef drivers/media/dvb/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2012-01-01 2423 err = dtv_set_frontend(fe); ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2424 break; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2425 case FE_GET_EVENT: ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2426 err = dvb_frontend_get_event (fe, parg, file->f_flags); ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2427 break; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2428 bb31d2381 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-02-04 2429 case FE_GET_FRONTEND: { bb31d2381 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-02-04 2430 struct dtv_frontend_properties getp = fe->dtv_property_cache; 36cb557a2 drivers/media/dvb/dvb-core/dvb_frontend.c Andrew de Quincey 2006-01-09 2431 bb31d2381 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-02-04 2432 /* bb31d2381 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-02-04 2433 * Let's use our own copy of property cache, in order to bb31d2381 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-02-04 2434 * avoid mangling with DTV zigzag logic, as drivers might bb31d2381 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-02-04 2435 * return crap, if they don't check if the data is available bb31d2381 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-02-04 2436 * before updating the properties cache. bb31d2381 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-02-04 2437 */ bb31d2381 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-02-04 2438 err = dtv_get_frontend(fe, &getp, parg); bb31d2381 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-02-04 2439 break; bb31d2381 drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2016-02-04 2440 } d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2441 d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2442 default: d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2443 return -ENOTSUPP; d73dcf0cd drivers/media/dvb-core/dvb_frontend.c Mauro Carvalho Chehab 2017-09-18 2444 } /* switch */ ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2445 ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2446 return err; ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 @2447 } ^1da177e4 drivers/media/dvb/dvb-core/dvb_frontend.c Linus Torvalds 2005-04-16 2448 :::::: The code at line 2447 was first introduced by commit :::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2 :::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx> :::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip