Code: Alles auswählen
Index: dvb/drivers/media/dvb/avia/avia_av_core.c
===================================================================
RCS file: /cvs/tuxbox/driver/dvb/drivers/media/dvb/avia/avia_av_core.c,v
retrieving revision 1.99
diff -r1.99 avia_av_core.c
1227a1228
>
1231a1233,1236
>
> if ((aviarev) && (play_state_audio != AVIA_AV_PLAY_STATE_PAUSED)) // oder nur if (aviarev)
> avia_av_cmd(Play, 0x00, (play_state_video == AVIA_AV_PLAY_STATE_PLAYING) ? pid_video : 0xFFFF, pid_audio);
>
1241a1247
>
1242a1249,1254
>
> if (aviarev) {
> avia_av_cmd(SelectStream, 0x03 - bypass_mode, 0xFFFF); // ???
> avia_av_cmd(Abort, 0x00);
> }
>
1244c1256,1258
< avia_av_cmd(NewChannel, 0x00, 0xFFFF, 0xFFFF);
---
>
> if (!aviarev)
> avia_av_cmd(NewChannel, 0x00, 0xFFFF, 0xFFFF);
1278a1293,1295
>
> // if (aviarev)
> // avia_av_cmd(Play, 0x00, pid_video, (play_state_audio == AVIA_AV_PLAY_STATE_PLAYING) ? pid_audio : 0xFFFF);
1289a1307,1312
>
> if (aviarev) {
> avia_av_cmd(SelectStream, 0x00, 0xFFFF); // ???
> avia_av_cmd(Abort, 0x00);
> }
>
1291c1314,1316
< avia_av_cmd(NewChannel, 0x00, 0xFFFF, 0xFFFF);
---
>
> if (!aviarev)
> avia_av_cmd(NewChannel, 0x00, 0xFFFF, 0xFFFF);
1560a1586
>
Index: dvb/drivers/media/dvb/avia/avia_gt_ucode.c
===================================================================
RCS file: /cvs/tuxbox/driver/dvb/drivers/media/dvb/avia/avia_gt_ucode.c,v
retrieving revision 1.14
diff -r1.14 avia_gt_ucode.c
941,943c941,942
< AVIA_GT_UCODE_CAP_TS |
< AVIA_GT_UCODE_CAP_MSGQ);
< ucode_info.prop_interface_flags=CAN_WAITPUSI;
---
> AVIA_GT_UCODE_CAP_TS);
> ucode_info.prop_interface_flags=0;
Index: dvb/drivers/media/dvb/dvb-core/dvb_compat.h
===================================================================
RCS file: /cvs/tuxbox/driver/dvb/drivers/media/dvb/dvb-core/dvb_compat.h,v
retrieving revision 1.5
diff -r1.5 dvb_compat.h
10a11,57
> #ifndef wait_event_interruptible_timeout
> #define __wait_event_interruptible_timeout(wq, condition, ret) \
> do { \
> wait_queue_t __wait; \
> init_waitqueue_entry(&__wait, current); \
> \
> add_wait_queue(&wq, &__wait); \
> for (;;) { \
> set_current_state(TASK_INTERRUPTIBLE); \
> if (condition) \
> break; \
> if (!signal_pending(current)) { \
> ret = schedule_timeout(ret); \
> if (!ret) \
> break; \
> continue; \
> } \
> ret = -ERESTARTSYS; \
> break; \
> } \
> current->state = TASK_RUNNING; \
> remove_wait_queue(&wq, &__wait); \
> } while (0)
>
> #define wait_event_interruptible_timeout(wq, condition, timeout) \
> ({ \
> long __ret = timeout; \
> if (!(condition)) \
> __wait_event_interruptible_timeout(wq, condition, __ret); \
> __ret; \
> })
> #endif
>
> #ifndef VIDEO_AUDIO_BALANCE
> #define VIDEO_AUDIO_BALANCE 32
> #endif
>
> #ifndef list_for_each_entry
> #define list_for_each_entry(pos, head, member) \
> for (pos = list_entry((head)->next, typeof(*pos), member), \
> prefetch(pos->member.next); \
> &pos->member != (head); \
> pos = list_entry(pos->member.next, typeof(*pos), member), \
> prefetch(pos->member.next))
> #endif
>
> #ifndef iminor
11a59
> #endif
12a61
> #ifndef irqreturn_t
15a65,71
> #endif
>
>
> #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,22))
> u32 crc32_le(u32 crc, unsigned char const *p, size_t len);
> #endif
>
16a73
>
Index: dvb/drivers/media/dvb/dvb-core/dvb_frontend.c
===================================================================
RCS file: /cvs/tuxbox/driver/dvb/drivers/media/dvb/dvb-core/dvb_frontend.c,v
retrieving revision 1.23
diff -r1.23 dvb_frontend.c
2c2,3
< * dvb-core.c: DVB core driver
---
> * dvb_frontend.c: DVB frontend tuning interface/thread
> *
5,7c6,10
< * Marcus Metzler
< * Holger Waechtler
< * for convergence integrated media GmbH
---
> * Marcus Metzler
> * Holger Waechtler
> * for convergence integrated media GmbH
> *
> * Copyright (C) 2004 Andrew de Quincey (tuning thread cleanup)
16c19
< * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
---
> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
39a43,69
> #define FESTATE_IDLE 1
> #define FESTATE_RETUNE 2
> #define FESTATE_TUNING_FAST 4
> #define FESTATE_TUNING_SLOW 8
> #define FESTATE_TUNED 16
> #define FESTATE_ZIGZAG_FAST 32
> #define FESTATE_ZIGZAG_SLOW 64
> #define FESTATE_DISEQC 128
> #define FESTATE_WAITFORLOCK (FESTATE_TUNING_FAST | FESTATE_TUNING_SLOW | FESTATE_ZIGZAG_FAST | FESTATE_ZIGZAG_SLOW | FESTATE_DISEQC)
> #define FESTATE_SEARCHING_FAST (FESTATE_TUNING_FAST | FESTATE_ZIGZAG_FAST)
> #define FESTATE_SEARCHING_SLOW (FESTATE_TUNING_SLOW | FESTATE_ZIGZAG_SLOW)
> #define FESTATE_LOSTLOCK (FESTATE_ZIGZAG_FAST | FESTATE_ZIGZAG_SLOW)
> /*
> * FESTATE_IDLE. No tuning parameters have been supplied and the loop is idling.
> * FESTATE_RETUNE. Parameters have been supplied, but we have not yet performed the first tune.
> * FESTATE_TUNING_FAST. Tuning parameters have been supplied and fast zigzag scan is in progress.
> * FESTATE_TUNING_SLOW. Tuning parameters have been supplied. Fast zigzag failed, so we're trying again, but slower.
> * FESTATE_TUNED. The frontend has successfully locked on.
> * FESTATE_ZIGZAG_FAST. The lock has been lost, and a fast zigzag has been initiated to try and regain it.
> * FESTATE_ZIGZAG_SLOW. The lock has been lost. Fast zigzag has been failed, so we're trying again, but slower.
> * FESTATE_DISEQC. A DISEQC command has just been issued.
> * FESTATE_WAITFORLOCK. When we're waiting for a lock.
> * FESTATE_SEARCHING_FAST. When we're searching for a signal using a fast zigzag scan.
> * FESTATE_SEARCHING_SLOW. When we're searching for a signal using a slow zigzag scan.
> * FESTATE_LOSTLOCK. When the lock has been lost, and we're searching it again.
> */
>
42a73,77
> static int dvb_override_frequency_bending = 0;
> static int dvb_force_auto_inversion = 0;
> static int dvb_override_tune_delay = 0;
>
> static int do_frequency_bending = 0;
50,54c85,89
< int eventw;
< int eventr;
< int overflow;
< wait_queue_head_t wait_queue;
< struct semaphore sem;
---
> int eventw;
> int eventr;
> int overflow;
> wait_queue_head_t wait_queue;
> struct semaphore sem;
69c104
< unsigned long lost_sync_jiffies;
---
> int state;
72,73c107,113
< int timeout_count;
< int lost_sync_count;
---
> int inversion;
> int auto_step;
> int auto_sub_step;
> int started_auto_step;
> int min_delay;
> int max_drift;
> int step_size;
75c115,116
< fe_status_t status;
---
> int wakeup;
> fe_status_t status;
172,173c213,214
< if (this_fe != fe && fe->lost_sync_count != -1 &&
< frequency > f - stepsize && frequency < f + stepsize)
---
> if (this_fe != fe && (fe->state != FESTATE_IDLE) &&
> frequency > f - stepsize && frequency < f + stepsize)
195,197d235
< if ((fe->status & FE_HAS_LOCK) && !(s & FE_HAS_LOCK))
< fe->lost_sync_jiffies = jiffies;
<
255c293
< struct dvb_fe_events *events = &fe->events;
---
> struct dvb_fe_events *events = &fe->events;
260,262c298,300
< events->overflow = 0;
< return -EOVERFLOW;
< }
---
> events->overflow = 0;
> return -EOVERFLOW;
> }
264c302
< if (events->eventw == events->eventr) {
---
> if (events->eventw == events->eventr) {
267,268c305,306
< if (flags & O_NONBLOCK)
< return -EWOULDBLOCK;
---
> if (flags & O_NONBLOCK)
> return -EWOULDBLOCK;
272,273c310,311
< ret = wait_event_interruptible (events->wait_queue,
< events->eventw != events->eventr);
---
> ret = wait_event_interruptible (events->wait_queue,
> events->eventw != events->eventr);
275c313
< if (down_interruptible (&fe->sem))
---
> if (down_interruptible (&fe->sem))
278,280c316,318
< if (ret < 0)
< return ret;
< }
---
> if (ret < 0)
> return ret;
> }
282c320
< if (down_interruptible (&events->sem))
---
> if (down_interruptible (&events->sem))
285c323
< memcpy (event, &events->events[events->eventr],
---
> memcpy (event, &events->events[events->eventr],
288,294c326
< events->eventr = (events->eventr + 1) % MAX_EVENT;
<
< up (&events->sem);
<
< return 0;
< }
<
---
> events->eventr = (events->eventr + 1) % MAX_EVENT;
296,323c328
< static int dvb_frontend_set_parameters (struct dvb_frontend_data *fe,
< struct dvb_frontend_parameters *param,
< int first_trial)
< {
< struct dvb_frontend *frontend = &fe->frontend;
< int err;
<
< if (first_trial) {
< fe->timeout_count = 0;
< fe->lost_sync_count = 0;
< fe->lost_sync_jiffies = jiffies;
< fe->lnb_drift = 0;
< if (fe->status & ~FE_TIMEDOUT)
< dvb_frontend_add_event (fe, 0);
< memcpy (&fe->parameters, param,
< sizeof (struct dvb_frontend_parameters));
< }
<
< dvb_bend_frequency (fe, 0);
<
< dprintk ("%s: f == %i, drift == %i\n",
< __FUNCTION__, (int) param->frequency, (int) fe->lnb_drift);
<
< param->frequency += fe->lnb_drift + fe->bending;
< err = dvb_frontend_internal_ioctl (frontend, FE_SET_FRONTEND, param);
< param->frequency -= fe->lnb_drift + fe->bending;
<
< wake_up_interruptible (&fe->wait_queue);
---
> up (&events->sem);
325c330
< return err;
---
> return 0;
339,340c344
<
< static void update_delay (int *quality, int *delay, int locked)
---
> static void update_delay (int *quality, int *delay, int min_delay, int locked)
342,354c346,358
< int q2;
<
< dprintk ("%s\n", __FUNCTION__);
<
< if (locked)
< (*quality) = (*quality * 220 + 36*256) / 256;
< else
< (*quality) = (*quality * 220 + 0) / 256;
<
< q2 = *quality - 128;
< q2 *= q2;
<
< *delay = HZ/20 + q2 * HZ / (128*128);
---
> int q2;
>
> dprintk ("%s\n", __FUNCTION__);
>
> if (locked)
> (*quality) = (*quality * 220 + 36*256) / 256;
> else
> (*quality) = (*quality * 220 + 0) / 256;
>
> q2 = *quality - 128;
> q2 *= q2;
>
> *delay = min_delay + q2 * HZ / (128*128);
357,360d360
<
< #define LNB_DRIFT 1024 /* max. tolerated LNB drift, XXX FIXME: adjust! */
< #define TIMEOUT 2*HZ
<
362,363c362,366
< * here we only come when we have lost the lock bit,
< * let's try to do something useful...
---
> * Performs automatic twiddling of frontend parameters.
> *
> * @param fe The frontend concerned.
> * @param check_wrapped Checks if an iteration has completed. DO NOT SET ON THE FIRST ATTEMPT
> * @returns Number of complete iterations that have been performed.
365c368
< static void dvb_frontend_recover (struct dvb_frontend_data *fe)
---
> static int dvb_frontend_autotune(struct dvb_frontend_data *fe, int check_wrapped)
367,381c370,388
< dprintk ("%s\n", __FUNCTION__);
<
< #if 0
< if (fe->timeout_count > 3) {
< printk ("%s: frontend seems dead, reinitializing...\n",
< __FUNCTION__);
< dvb_call_frontend_notifiers (fe, 0);
< dvb_frontend_internal_ioctl (&fe->frontend, FE_INIT, NULL);
< dvb_frontend_set_parameters (fe, &fe->parameters, 1);
< dvb_frontend_add_event (fe, FE_REINIT);
< fe->lost_sync_jiffies = jiffies;
< fe->timeout_count = 0;
< return;
< }
< #endif
---
> int autoinversion;
> int ready = 0;
> int original_inversion = fe->parameters.inversion;
> u32 original_frequency = fe->parameters.frequency;
>
> // are we using autoinversion?
> autoinversion = ((!(fe->info->caps & FE_CAN_INVERSION_AUTO)) && (fe->parameters.inversion == INVERSION_AUTO));
>
> // setup parameters correctly
> while(!ready) {
> // calculate the lnb_drift
> fe->lnb_drift = fe->auto_step * fe->step_size;
>
> // wrap the auto_step if we've exceeded the maximum drift
> if (fe->lnb_drift > fe->max_drift) {
> fe->auto_step = 0;
> fe->auto_sub_step = 0;
> fe->lnb_drift = 0;
> }
383,395c390,398
< /**
< * let's start a zigzag scan to compensate LNB drift...
< */
< {
< int j = fe->lost_sync_count;
< int stepsize;
<
< if (fe->info->type == FE_QPSK)
< stepsize = fe->parameters.u.qpsk.symbol_rate / 16000;
< else if (fe->info->type == FE_QAM)
< stepsize = 0;
< else
< stepsize = fe->info->frequency_stepsize * 2;
---
> // perform inversion and +/- zigzag
> switch(fe->auto_sub_step) {
> case 0:
> // try with the current inversion and current drift setting
> ready = 1;
> break;
>
> case 1:
> if (!autoinversion) break;
397,399c400,415
< if (j % 32 == 0) {
< fe->lnb_drift = 0;
< } else {
---
> fe->inversion = (fe->inversion == INVERSION_OFF) ? INVERSION_ON : INVERSION_OFF;
> ready = 1;
> break;
>
> case 2:
> if (fe->lnb_drift == 0) break;
>
> fe->lnb_drift = -fe->lnb_drift;
> ready = 1;
> break;
>
> case 3:
> if (fe->lnb_drift == 0) break;
> if (!autoinversion) break;
>
> fe->inversion = (fe->inversion == INVERSION_OFF) ? INVERSION_ON : INVERSION_OFF;
401,402c417,423
< if (j % 2)
< fe->lnb_drift += stepsize;
---
> ready = 1;
> break;
>
> default:
> fe->auto_step++;
> fe->auto_sub_step = -1; // it'll be incremented to 0 in a moment
> break;
403a425,427
>
> if (!ready) fe->auto_sub_step++;
> }
405c429,431
< dvb_frontend_set_parameters (fe, &fe->parameters, 0);
---
> // if this attempt would hit where we started, indicate a complete iteration has occurred
> if ((fe->auto_step == fe->started_auto_step) && (fe->auto_sub_step == 0) && check_wrapped) {
> return 1;
408c434,452
< dvb_frontend_internal_ioctl (&fe->frontend, FE_RESET, NULL);
---
> // perform frequency bending if necessary
> if ((dvb_override_frequency_bending != 1) && do_frequency_bending)
> dvb_bend_frequency(fe, 0);
>
> // instrumentation
> dprintk("%s: drift:%i bending:%i inversion:%i auto_step:%i auto_sub_step:%i started_auto_step:%i\n",
> __FUNCTION__, fe->lnb_drift, fe->bending, fe->inversion, fe->auto_step, fe->auto_sub_step,
> fe->started_auto_step);
>
> // set the frontend itself
> fe->parameters.frequency += fe->lnb_drift + fe->bending;
> if (autoinversion) fe->parameters.inversion = fe->inversion;
> dvb_frontend_internal_ioctl (&fe->frontend, FE_SET_FRONTEND, &fe->parameters);
> fe->parameters.frequency = original_frequency;
> fe->parameters.inversion = original_inversion;
>
> // normal return
> fe->auto_sub_step++;
> return 0;
424a469,481
> static int dvb_frontend_should_wakeup (struct dvb_frontend_data *fe)
> {
> if (fe->wakeup) {
> fe->wakeup = 0;
> return 1;
> }
> return dvb_frontend_is_exiting(fe);
> }
>
> static void dvb_frontend_wakeup (struct dvb_frontend_data *fe) {
> fe->wakeup = 1;
> wake_up_interruptible(&fe->wait_queue);
> }
428a486
> unsigned long timeout;
431a490
> int check_wrapped = 0;
440,441d498
< fe->lost_sync_count = -1;
<
443a501
> fe->wakeup = 0;
445,446c503,504
< while (!dvb_frontend_is_exiting (fe)) {
< up (&fe->sem); /* is locked when we enter the thread... */
---
> while (1) {
> up (&fe->sem); /* is locked when we enter the thread... */
448,449c506,508
< interruptible_sleep_on_timeout (&fe->wait_queue, delay);
< if (signal_pending(current))
---
> timeout = wait_event_interruptible_timeout(fe->wait_queue,0 != dvb_frontend_should_wakeup (fe), delay);
> if (-ERESTARTSYS == timeout || 0 != dvb_frontend_is_exiting (fe)) {
> /* got signal or quitting */
450a510
> }
455c515,518
< if (fe->lost_sync_count == -1)
---
> // if we've got no parameters, just keep idling
> if (fe->state & FESTATE_IDLE) {
> delay = 3*HZ;
> quality = 0;
456a520,541
> }
>
> // get the frontend status
> if (fe->state & FESTATE_RETUNE) {
> s = 0;
> } else {
> dvb_frontend_internal_ioctl (&fe->frontend, FE_READ_STATUS, &s);
> if (s != fe->status) {
> dvb_frontend_add_event (fe, s);
> }
> }
> // if we're not tuned, and we have a lock, move to the TUNED state
> if ((fe->state & FESTATE_WAITFORLOCK) && (s & FE_HAS_LOCK)) {
> update_delay(&quality, &delay, fe->min_delay, s & FE_HAS_LOCK);
> fe->state = FESTATE_TUNED;
>
> // if we're tuned, then we have determined the correct inversion
> if ((!(fe->info->caps & FE_CAN_INVERSION_AUTO)) && (fe->parameters.inversion == INVERSION_AUTO)) {
> fe->parameters.inversion = fe->inversion;
> }
> continue;
> }
458,461c543,557
< if (dvb_frontend_is_exiting (fe))
< break;
<
< dvb_frontend_internal_ioctl (&fe->frontend, FE_READ_STATUS, &s);
---
> // if we are tuned already, check we're still locked
> if (fe->state & FESTATE_TUNED) {
> update_delay(&quality, &delay, fe->min_delay, s & FE_HAS_LOCK);
>
> // we're tuned, and the lock is still good...
> if (s & FE_HAS_LOCK) {
> continue;
> } else {
> // if we _WERE_ tuned, but now don't have a lock, need to zigzag
> fe->state = FESTATE_ZIGZAG_FAST;
> fe->started_auto_step = fe->auto_step;
> check_wrapped = 0;
> // fallthrough
> }
> }
463c559,573
< update_delay (&quality, &delay, s & FE_HAS_LOCK);
---
> // don't actually do anything if we're in the LOSTLOCK state, the frontend is set to
> // FE_CAN_RECOVER, and the max_drift is 0
> if ((fe->state & FESTATE_LOSTLOCK) &&
> (fe->info->caps & FE_CAN_RECOVER) && (fe->max_drift == 0)) {
> update_delay(&quality, &delay, fe->min_delay, s & FE_HAS_LOCK);
> continue;
> }
>
> // don't do anything if we're in the DISEQC state, since this might be someone
> // with a motorized dish controlled by DISEQC. If its actually a re-tune, there will
> // be a SET_FRONTEND soon enough.
> if (fe->state & FESTATE_DISEQC) {
> update_delay(&quality, &delay, fe->min_delay, s & FE_HAS_LOCK);
> continue;
> }
465c575,584
< s &= ~FE_TIMEDOUT;
---
> // if we're in the RETUNE state, set everything up for a brand new scan,
> // keeping the current inversion setting, as the next tune is _very_ likely
> // to require the same
> if (fe->state & FESTATE_RETUNE) {
> fe->lnb_drift = 0;
> fe->auto_step = 0;
> fe->auto_sub_step = 0;
> fe->started_auto_step = 0;
> check_wrapped = 0;
> }
467,478c586,596
< if (s & FE_HAS_LOCK) {
< fe->timeout_count = 0;
< fe->lost_sync_count = 0;
< } else {
< fe->lost_sync_count++;
< if (!(fe->info->caps & FE_CAN_RECOVER)) {
< if (!(fe->info->caps & FE_CAN_CLEAN_SETUP)) {
< if (fe->lost_sync_count < 10)
< continue;
< }
< dvb_frontend_recover (fe);
< delay = HZ/5;
---
> // fast zigzag.
> if ((fe->state & FESTATE_SEARCHING_FAST) || (fe->state & FESTATE_RETUNE)) {
> delay = fe->min_delay;
>
> // peform a tune
> if (dvb_frontend_autotune(fe, check_wrapped)) {
> // OK, if we've run out of trials at the fast speed. Drop back to
> // slow for the _next_ attempt
> fe->state = FESTATE_SEARCHING_SLOW;
> fe->started_auto_step = fe->auto_step;
> continue;
480,483c598,605
< if (jiffies - fe->lost_sync_jiffies > TIMEOUT) {
< s |= FE_TIMEDOUT;
< if ((fe->status & FE_TIMEDOUT) == 0)
< fe->timeout_count++;
---
> check_wrapped = 1;
>
> // if we've just retuned, enter the ZIGZAG_FAST state. This ensures
> // we cannot return from an FE_SET_FRONTEND ioctl before the first frontend
> // tune occurs
> if (fe->state & FESTATE_RETUNE) {
> fe->state = FESTATE_TUNING_FAST;
> wake_up_interruptible(&fe->wait_queue);
487,488c609,616
< if (s != fe->status)
< dvb_frontend_add_event (fe, s);
---
> // slow zigzag
> if (fe->state & FESTATE_SEARCHING_SLOW) {
> update_delay(&quality, &delay, fe->min_delay, s & FE_HAS_LOCK);
>
> // Note: don't bother checking for wrapping; we stay in this state
> // until we get a lock
> dvb_frontend_autotune(fe, 0);
> }
494,495d621
< up (&fe->sem);
<
499c625
< wake_up_interruptible (&fe->wait_queue);
---
> dvb_frontend_wakeup(fe);
505a632,633
> unsigned long ret;
>
523,524c651,660
< wake_up_interruptible(&fe->wait_queue);
< interruptible_sleep_on(&fe->wait_queue);
---
> /* wake up the frontend thread, so it notices that fe->exit == 1 */
> dvb_frontend_wakeup(fe);
>
> /* wait until the frontend thread has exited */
> ret = wait_event_interruptible(fe->wait_queue,0 == fe->thread_pid);
> if (-ERESTARTSYS != ret) {
> fe->state = FESTATE_IDLE;
> return;
> }
> fe->state = FESTATE_IDLE;
526c662
< /* paranoia check */
---
> /* paranoia check in case a signal arrived */
550a687
> fe->state = FESTATE_IDLE;
587a725
> struct dvb_frontend_tune_settings fetunesettings;
601a740
> case FE_SET_VOLTAGE:
604a744
> fe->state = FESTATE_DISEQC;
605a746
>
607c748,801
< err = dvb_frontend_set_parameters (fe, parg, 1);
---
> fe->state = FESTATE_RETUNE;
>
> memcpy (&fe->parameters, parg,
> sizeof (struct dvb_frontend_parameters));
>
> memset(&fetunesettings, 0, sizeof(struct dvb_frontend_tune_settings));
> memcpy(&fetunesettings.parameters, parg,
> sizeof (struct dvb_frontend_parameters));
>
> // force auto frequency inversion if requested
> if (dvb_force_auto_inversion) {
> fe->parameters.inversion = INVERSION_AUTO;
> fetunesettings.parameters.inversion = INVERSION_AUTO;
> }
> if (fe->info->type == FE_OFDM) {
> /* without hierachical coding code_rate_LP is irrelevant,
> * so we tolerate the otherwise invalid FEC_NONE setting */
> if (fe->parameters.u.ofdm.hierarchy_information == HIERARCHY_NONE &&
> fe->parameters.u.ofdm.code_rate_LP == FEC_NONE)
> fe->parameters.u.ofdm.code_rate_LP = FEC_AUTO;
> }
>
> // get frontend-specific tuning settings
> if (dvb_frontend_internal_ioctl(&fe->frontend, FE_GET_TUNE_SETTINGS, &fetunesettings) == 0) {
> fe->min_delay = (fetunesettings.min_delay_ms * HZ) / 1000;
> fe->max_drift = fetunesettings.max_drift;
> fe->step_size = fetunesettings.step_size;
> } else {
> // default values
> switch(fe->info->type) {
> case FE_QPSK:
> fe->min_delay = HZ/20; // default mindelay of 50ms
> fe->step_size = fe->parameters.u.qpsk.symbol_rate / 16000;
> fe->max_drift = fe->parameters.u.qpsk.symbol_rate / 2000;
> break;
>
> case FE_QAM:
> fe->min_delay = HZ/20; // default mindelay of 50ms
> fe->step_size = 0;
> fe->max_drift = 0; // don't want any zigzagging under DVB-C frontends
> break;
>
> case FE_OFDM:
> fe->min_delay = HZ/20; // default mindelay of 50ms
> fe->step_size = fe->info->frequency_stepsize * 2;
> fe->max_drift = (fe->info->frequency_stepsize * 2) + 1;
> break;
> }
> }
> if (dvb_override_tune_delay > 0) {
> fe->min_delay = (dvb_override_tune_delay * HZ) / 1000;
> }
>
> dvb_frontend_add_event (fe, 0);
608a803
>
611a807
>
617c813
< dvb_frontend_internal_ioctl (&fe->frontend, cmd, parg);
---
> err = dvb_frontend_internal_ioctl (&fe->frontend, cmd, parg);
619c815
<
---
>
620a817,832
> if (err < 0)
> return err;
>
> // Force the CAN_INVERSION_AUTO bit on. If the frontend doesn't do it, it is done for it.
> if ((cmd == FE_GET_INFO) && (err == 0)) {
> struct dvb_frontend_info* tmp = (struct dvb_frontend_info*) parg;
> tmp->caps |= FE_CAN_INVERSION_AUTO;
> }
>
> // if the frontend has just been set, wait until the first tune has finished.
> // This ensures the app doesn't start reading data too quickly, perhaps from the
> // previous lock, which is REALLY CONFUSING TO DEBUG!
> if ((cmd == FE_SET_FRONTEND) && (err == 0)) {
> dvb_frontend_wakeup(fe);
> err = wait_event_interruptible(fe->wait_queue, fe->state & ~FESTATE_RETUNE);
> }
683,686c895,898
< int (*before_ioctl) (struct dvb_frontend *frontend,
< unsigned int cmd, void *arg),
< int (*after_ioctl) (struct dvb_frontend *frontend,
< unsigned int cmd, void *arg),
---
> int (*before_ioctl) (struct dvb_frontend *frontend,
> unsigned int cmd, void *arg),
> int (*after_ioctl) (struct dvb_frontend *frontend,
> unsigned int cmd, void *arg),
690c902
< struct list_head *entry;
---
> struct list_head *entry;
735,737c947,949
< unsigned int cmd, void *arg),
< int (*after_ioctl) (struct dvb_frontend *frontend,
< unsigned int cmd, void *arg))
---
> unsigned int cmd, void *arg),
> int (*after_ioctl) (struct dvb_frontend *frontend,
> unsigned int cmd, void *arg))
916a1129
> fe->inversion = INVERSION_OFF;
955a1169,1171
> if ((info->caps & FE_NEEDS_BENDING) || (dvb_override_frequency_bending == 2))
> do_frequency_bending = 1;
>
966c1182
< struct list_head *entry, *n;
---
> struct list_head *entry, *n;
992a1209,1212
> MODULE_PARM(dvb_override_frequency_bending,"i");
> MODULE_PARM(dvb_force_auto_inversion,"i");
> MODULE_PARM(dvb_override_tune_delay,"i");
>
994a1215,1217
> MODULE_PARM_DESC(dvb_override_frequency_bending, "0: normal (default), 1: never use frequency bending, 2: always use frequency bending");
> MODULE_PARM_DESC(dvb_force_auto_inversion, "0: normal (default), 1: INVERSION_AUTO forced always");
> MODULE_PARM_DESC(dvb_override_tune_delay, "0: normal (default), >0 => delay in milliseconds to wait for lock after a tune attempt");
Index: dvb/drivers/media/dvb/dvb-core/dvb_frontend.h
===================================================================
RCS file: /cvs/tuxbox/driver/dvb/drivers/media/dvb/dvb-core/dvb_frontend.h,v
retrieving revision 1.5
diff -r1.5 dvb_frontend.h
58a59,65
> struct dvb_frontend_tune_settings {
> int min_delay_ms;
> int step_size;
> int max_drift;
> struct dvb_frontend_parameters parameters;
> };
>
62a70,73
> *
> * FE_SLEEP. Ioctl used to put frontend into a low power mode.
> * FE_INIT. Ioctl used to initialise the frontend.
> * FE_GET_TUNE_SETTINGS. Get the frontend-specific tuning loop settings for the supplied set of parameters.
66c77,78
< #define FE_RESET _IO('v', 82)
---
> #define FE_GET_TUNE_SETTINGS _IOWR('v', 83, struct dvb_frontend_tune_settings)
> #define FE_RESET _IO('v', 82) //für den übergang
Index: dvb/drivers/media/dvb/frontends/at76c651.c
===================================================================
RCS file: /cvs/tuxbox/driver/dvb/drivers/media/dvb/frontends/at76c651.c,v
retrieving revision 1.58
diff -r1.58 at76c651.c
77c77
< FE_CAN_RECOVER | FE_CAN_CLEAN_SETUP | FE_CAN_MUTE_TS
---
> FE_CAN_RECOVER | FE_NEEDS_BENDING | FE_CAN_MUTE_TS
Index: dvb/drivers/media/dvb/frontends/tda80xx.c
===================================================================
RCS file: /cvs/tuxbox/driver/dvb/drivers/media/dvb/frontends/tda80xx.c,v
retrieving revision 1.3
diff -r1.3 tda80xx.c
99c99
< FE_CAN_MUTE_TS | FE_CAN_CLEAN_SETUP
---
> FE_CAN_MUTE_TS | FE_NEEDS_BENDING
Index: dvb/drivers/media/dvb/frontends/ves1820.c
===================================================================
RCS file: /cvs/tuxbox/driver/dvb/drivers/media/dvb/frontends/ves1820.c,v
retrieving revision 1.53
diff -r1.53 ves1820.c
115c115
< FE_CAN_CLEAN_SETUP
---
> FE_NEEDS_BENDING
Index: dvb/include/linux/dvb/frontend.h
===================================================================
RCS file: /cvs/tuxbox/driver/dvb/include/linux/dvb/frontend.h,v
retrieving revision 1.7
diff -r1.7 frontend.h
62,64c62,64
< FE_CAN_RECOVER = 0x20000000,
< FE_CAN_CLEAN_SETUP = 0x40000000,
< FE_CAN_MUTE_TS = 0x80000000
---
> FE_NEEDS_BENDING = 0x20000000, // frontend requires frequency bending
> FE_CAN_RECOVER = 0x40000000, // frontend can recover from a cable unplug automatically
> FE_CAN_MUTE_TS = 0x80000000 // frontend can stop spurious TS data output