Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Small patch to disable zigzagging



A few weeks ago I had taken the time to write a small mod to the dvb
drivers that allows me to enable or disable zigzagging with a ioctl
call. I need it because I like to move my parabola to point to
different satellites, and the signal strength indication is
frustratingly useless as a help for correct alignment if tuning is
happily jumpimg up and down. 

I added two IOCTL's, called FE_ZIGZAG and FE_DONT_ZIGZAG. The patch is
very simple, and works fine here. I have made sure that, if these
ioctls are not used, there is no change in behaviour. 

I have now generated a patch file from plain linuxtv-dvb-1.0.0, that I
am including in this message. Is there some possibility to have this
applied to the main tree?

Thanks.

Carlo


-- 
  *         Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as             che bisogno ci sarebbe
  *               di parlare tanto di amore e di rettitudine? (Chuang-Tzu)
diff -urN linuxtv-dvb-1.0.0-orig/driver/dvb_frontend.c linuxtv-dvb-1.0.0/driver/dvb_frontend.c
--- linuxtv-dvb-1.0.0-orig/driver/dvb_frontend.c	2003-08-01 17:27:21.000000000 +0200
+++ linuxtv-dvb-1.0.0/driver/dvb_frontend.c	2003-08-05 07:31:34.000000000 +0200
@@ -71,6 +71,7 @@
 	int lost_sync_count;
 	int exit;
         fe_status_t status;
+        unsigned char dont_zigzag;
 };
 
 
@@ -400,27 +401,30 @@
 	/**
 	 *  let's start a zigzag scan to compensate LNB drift...
 	 */
-	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;
+	if(!fe->dont_zigzag)
+ 	{
+		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;
+	
+		if (j % 32 == 0) {
+			fe->lnb_drift = 0;
+		} else {
+			fe->lnb_drift = -fe->lnb_drift;
+			if (j % 2)
+				fe->lnb_drift += stepsize;
+		}
+	
+		dvb_frontend_set_parameters (fe, &fe->parameters, 0);
+		dvb_frontend_internal_ioctl (&fe->frontend, FE_RESET, NULL);
 
-	if (j % 32 == 0) {
-		fe->lnb_drift = 0;
-	} else {
-		fe->lnb_drift = -fe->lnb_drift;
-		if (j % 2)
-			fe->lnb_drift += stepsize;
 	}
-
-	dvb_frontend_set_parameters (fe, &fe->parameters, 0);
-	dvb_frontend_internal_ioctl (&fe->frontend, FE_RESET, NULL);
 }
 
 
-
 static
 int dvb_frontend_is_exiting (struct dvb_frontend_data *fe)
 {
@@ -567,6 +571,7 @@
 	if (down_interruptible (&fe->sem))
 		return -EINTR;
 
+	fe->dont_zigzag = 0;
 	fe->exit = 0;
 	fe->thread_pid = 0;
 	mb();
@@ -624,6 +629,12 @@
 	case FE_GET_EVENT:
 		err = dvb_frontend_get_event (fe, parg, file->f_flags);
 		break;
+	case FE_ZIGZAG:
+	        fe->dont_zigzag=0;
+		break;
+	case FE_DONT_ZIGZAG:
+	        fe->dont_zigzag=1;
+		break;
 	case FE_GET_FRONTEND:
 		memcpy (parg, &fe->parameters,
 			sizeof (struct dvb_frontend_parameters));
diff -urN linuxtv-dvb-1.0.0-orig/include/linux/dvb/frontend.h linuxtv-dvb-1.0.0/include/linux/dvb/frontend.h
--- linuxtv-dvb-1.0.0-orig/include/linux/dvb/frontend.h	2003-05-08 15:50:10.000000000 +0200
+++ linuxtv-dvb-1.0.0/include/linux/dvb/frontend.h	2003-08-04 20:22:43.000000000 +0200
@@ -258,6 +258,8 @@
 #define FE_GET_FRONTEND            _IOR('o', 77, struct dvb_frontend_parameters)
 #define FE_GET_EVENT               _IOR('o', 78, struct dvb_frontend_event)
 
+#define FE_ZIGZAG                  _IO('o', 79)
+#define FE_DONT_ZIGZAG             _IO('o', 80)
 
 #endif /*_DVBFRONTEND_H_*/
 

Home | Main Index | Thread Index