diff -upr mumudvb.orig/configure.ac dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/configure.ac
--- mumudvb.orig/configure.ac	2009-02-08 18:07:31.000000000 +0200
+++ dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/configure.ac	2009-02-08 20:07:15.000000000 +0200
@@ -26,13 +26,13 @@ AC_C_INLINE
 dnl ############## Header Checks
 
 AC_HEADER_STDC
-AC_CHECK_HEADER([linux/dvb/frontend.h])
+AC_CHECK_HEADER([ost/frontend.h])
 AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
 
 
 dnl ############## Final Output
 
-CFLAGS="$CFLAGS -g -Wall"
+CFLAGS="$CFLAGS -g -Wall -Wextra -O2 -ggdb"
 
 AC_OUTPUT([Makefile src/Makefile])
 
diff -upr mumudvb.orig/src/cam.c dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/cam.c
--- mumudvb.orig/src/cam.c	2009-02-08 17:57:18.000000000 +0200
+++ dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/cam.c	2009-02-08 21:21:51.000000000 +0200
@@ -52,9 +52,8 @@
 #include <sys/poll.h>
 
 /* DVB Card Drivers */
-#include <linux/dvb/version.h>
-#include <linux/dvb/dmx.h>
-#include <linux/dvb/frontend.h>
+#include <ost/dmx.h>
+#include <ost/frontend.h>
 
 #include "errors.h"
 #include "cam.h"
@@ -205,7 +204,7 @@ int CAMOpen( access_sys_t * p_sys , int 
 {
     char ca[128];
     int i_adapter, i_device;
-    ca_caps_t caps;
+    ca_cap_t caps;
 
     i_adapter = card;
     i_device = device;
@@ -215,10 +214,10 @@ int CAMOpen( access_sys_t * p_sys , int 
         log_message( MSG_INFO,"CAM : snprintf() truncated string for CA" );
         ca[sizeof(ca) - 1] = '\0';
     }
-    memset( &caps, 0, sizeof( ca_caps_t ));
+    memset( &caps, 0, sizeof( ca_cap_t ));
 
     log_message( MSG_INFO,"CAM : Opening device %s\n", ca );
-    if( (p_sys->i_ca_handle = open(ca, O_RDWR | O_NONBLOCK)) < 0 )
+    if( (p_sys->i_ca_handle = open(ca, O_RDWR)) < 0 )
     {
         log_message( MSG_WARN, "CAMInit: opening CAM device failed (%s)\n",
                   strerror(errno) );
@@ -243,8 +242,6 @@ int CAMOpen( access_sys_t * p_sys , int 
         log_message( MSG_INFO, "CAMInit: CI link layer level interface type\n" );
     if ( caps.slot_type & CA_CI_PHYS )
         log_message( MSG_INFO, "CAMInit: CI physical layer level interface type (not supported) \n" );
-    if ( caps.slot_type & CA_DESCR )
-        log_message( MSG_INFO, "CAMInit: built-in descrambler detected\n" );
     if ( caps.slot_type & CA_SC )
         log_message( MSG_INFO, "CAMInit: simple smart card interface\n" );
 
diff -upr mumudvb.orig/src/cam_en50221.c dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/cam_en50221.c
--- mumudvb.orig/src/cam_en50221.c	2009-02-08 17:57:18.000000000 +0200
+++ dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/cam_en50221.c	2009-02-08 20:29:38.000000000 +0200
@@ -50,10 +50,9 @@
 #include <stdint.h>
 
 /* DVB Card Drivers */
-#include <linux/dvb/version.h>
-#include <linux/dvb/dmx.h>
-#include <linux/dvb/frontend.h>
-#include <linux/dvb/ca.h>
+#include <ost/dmx.h>
+#include <ost/frontend.h>
+#include <ost/ca.h>
 
 
 #undef DEBUG_TPDU
@@ -1651,7 +1650,7 @@ int en50221_Init( access_sys_t * p_sys )
     }
     else
     {
-        struct ca_slot_info info;
+        struct ca_slot_info_s info;
         info.num = 0;
 
         /* We don't reset the CAM in that case because it's done by the
diff -upr mumudvb.orig/src/cam.h dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/cam.h
--- mumudvb.orig/src/cam.h	2009-02-08 17:57:18.000000000 +0200
+++ dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/cam.h	2009-02-08 20:24:36.000000000 +0200
@@ -42,7 +42,7 @@
 #include <sys/types.h>
 #include <errno.h>
 #include <sys/ioctl.h>
-#include <linux/dvb/ca.h>
+#include <ost/ca.h>
 #include <stdlib.h>
 #include <netinet/in.h>
 #include <sys/time.h>
@@ -70,7 +70,7 @@ int convert_pmt(struct ca_info *cai, mum
  * VLC PART (another mumudvb part below)
  *****************************************************************************/
 
-#define CA_DEV       "/dev/dvb/adapter%d/ca%d"
+#define CA_DEV       "/dev/dvb/card%d/ca%d"
 
 typedef int64_t mtime_t;
 
diff -upr mumudvb.orig/src/dvb.c dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/dvb.c
--- mumudvb.orig/src/dvb.c	2009-02-08 17:57:18.000000000 +0200
+++ dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/dvb.c	2009-02-08 21:28:46.000000000 +0200
@@ -30,33 +30,51 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#define FRONTEND_DEV_PATH "/dev/dvb/adapter%d/frontend0"
-#define DEMUX_DEV_PATH    "/dev/dvb/adapter%d/demux0"
-#define DVR_DEV_PATH      "/dev/dvb/adapter%d/dvr0"
+#define FRONTEND_DEV_PATH "/dev/dvb/card%d/frontend0"
+#define SEC_DEV_PATH	  "/dev/dvb/card%d/sec0"
+#define DEMUX_DEV_PATH    "/dev/dvb/card%d/demux0"
+#define DVR_DEV_PATH      "/dev/dvb/card%d/dvr0"
 
 /**
  * Open the frontend associated with card
  * Return 1 in case of succes, -1 otherwise
  * 
+ * @param fd_sec the file descriptor for the sec 
  * @param fd_frontend the file descriptor for the frontend 
  * @param card the card number 
 */
 int
-open_fe (int *fd_frontend, int card)
+open_fe (int *fd_sec, int *fd_frontend, int card)
 {
 
   char *frontend_name=NULL;
-  int asprintf_ret;
-  asprintf_ret=asprintf(&frontend_name,FRONTEND_DEV_PATH,card);
-  if(asprintf_ret==-1)
+  char *sec_name=NULL;
+  int asprintf_ret0, asprintf_ret1;
+  asprintf_ret0=asprintf(&frontend_name,FRONTEND_DEV_PATH,card);
+  asprintf_ret1=asprintf(&sec_name,SEC_DEV_PATH,card);
+  if(asprintf_ret0==-1)
     return -1;
+  if(asprintf_ret1==-1)
+    return -1;
+    
+  log_message( MSG_DEBUG, "Device: fe=%s, sec=%s\n", frontend_name, sec_name);
   if ((*fd_frontend = open (frontend_name, O_RDWR | O_NONBLOCK)) < 0)
     {
       perror ("FRONTEND DEVICE: ");
       free(frontend_name);
+      free(sec_name);
+      return -1;
+    }
+
+  if ((*fd_sec = open (sec_name, O_RDWR)) < 0)
+    {
+      perror ("SEC DEVICE: ");
+      free(frontend_name);
+      free(sec_name);
       return -1;
     }
   free(frontend_name);
+  free(sec_name);
   return 1;
 }
 
@@ -70,13 +88,13 @@ open_fe (int *fd_frontend, int card)
 void
 set_ts_filt (int fd, uint16_t pid)
 {
-  struct dmx_pes_filter_params pesFilterParams;
+  struct dmxPesFilterParams pesFilterParams;
 
   log_message( MSG_DEBUG, "Setting filter for PID %d\n", pid);
   pesFilterParams.pid = pid;
   pesFilterParams.input = DMX_IN_FRONTEND;
   pesFilterParams.output = DMX_OUT_TS_TAP;
-  pesFilterParams.pes_type = DMX_PES_OTHER;
+  pesFilterParams.pesType = DMX_PES_OTHER;
   pesFilterParams.flags = DMX_IMMEDIATE_START;
 
   if (ioctl (fd, DMX_SET_PES_FILTER, &pesFilterParams) < 0)
@@ -144,7 +162,7 @@ create_card_fd(int card, uint8_t *asked_
   if(asprintf_ret==-1)
     return -1;
   if (fds->fd_dvr==0)  //this function can be called more than one time, we check if we opened it before
-    if ((fds->fd_dvr = open (dvrdev_name, O_RDONLY | O_NONBLOCK)) < 0)
+    if ((fds->fd_dvr = open (dvrdev_name, O_RDONLY)) < 0)
       {
 	perror ("DVR DEVICE: ");
 	free(dvrdev_name);
@@ -196,6 +214,7 @@ close_card_fd(fds_t fds)
     }
 
   close (fds.fd_dvr);
+  close (fds.fd_sec);
   close (fds.fd_frontend);
 
 }
diff -upr mumudvb.orig/src/dvb_defaults.h dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/dvb_defaults.h
--- mumudvb.orig/src/dvb_defaults.h	2009-02-08 17:57:18.000000000 +0200
+++ dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/dvb_defaults.h	2009-02-08 19:32:11.000000000 +0200
@@ -41,9 +41,9 @@
 #define DVB_T_LOCATION		    "Automatic"
 #define BANDWIDTH_DEFAULT           BANDWIDTH_8_MHZ
 #define HP_CODERATE_DEFAULT         FEC_AUTO
-#define CONSTELLATION_DEFAULT       QAM_AUTO
-#define TRANSMISSION_MODE_DEFAULT   TRANSMISSION_MODE_AUTO
-#define GUARD_INTERVAL_DEFAULT      GUARD_INTERVAL_AUTO
+#define CONSTELLATION_DEFAULT       QAM_64
+#define TRANSMISSION_MODE_DEFAULT   TRANSMISSION_MODE_8K
+#define GUARD_INTERVAL_DEFAULT      GUARD_INTERVAL_1_4
 #define HIERARCHY_DEFAULT           HIERARCHY_NONE
 
 #if HIERARCHY_DEFAULT == HIERARCHY_NONE && !defined (LP_CODERATE_DEFAULT)
diff -upr mumudvb.orig/src/dvb.h dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/dvb.h
--- mumudvb.orig/src/dvb.h	2009-02-08 17:57:18.000000000 +0200
+++ dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/dvb.h	2009-02-08 20:19:32.000000000 +0200
@@ -41,14 +41,16 @@
 #define PID_FILTERED 2
 
 // DVB includes:
-#include <linux/dvb/dmx.h>
-#include <linux/dvb/frontend.h>
+#include <ost/dmx.h>
+#include <ost/sec.h>
+#include <ost/frontend.h>
 
 #include "mumudvb.h"
 
 //file descriptors
 typedef struct {
   int fd_dvr;
+  int fd_sec;
   int fd_frontend;
   /** demuxer file descriptors */
   int fd_demuxer[8192];
@@ -57,7 +59,7 @@ typedef struct {
 }fds_t;
 
 
-int open_fe (int *fd_frontend, int card);
+int open_fe (int *fd_sec, int *fd_frontend, int card);
 void set_ts_filt (int fd,uint16_t pid);
 void show_power (fds_t fds);
 int create_card_fd(int card, uint8_t *asked_pid, fds_t *fds);
diff -upr mumudvb.orig/src/mumudvb.c dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/mumudvb.c
--- mumudvb.orig/src/mumudvb.c	2009-02-08 17:57:18.000000000 +0200
+++ dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/mumudvb.c	2009-02-08 20:14:21.000000000 +0200
@@ -172,17 +172,17 @@ main (int argc, char **argv)
   unsigned long freq = 0;
   unsigned long srate = 0;
   char pol = 0;
-  fe_spectral_inversion_t specInv = INVERSION_AUTO;
+  SpectralInversion specInv = INVERSION_AUTO;
   int tone = -1;
   //DVB-T parameters
-  fe_modulation_t modulation = CONSTELLATION_DEFAULT;
-  fe_transmit_mode_t TransmissionMode = TRANSMISSION_MODE_DEFAULT;
-  fe_bandwidth_t bandWidth = BANDWIDTH_DEFAULT;
-  fe_guard_interval_t guardInterval = GUARD_INTERVAL_DEFAULT;
-  fe_code_rate_t HP_CodeRate = HP_CODERATE_DEFAULT, LP_CodeRate =
+  Modulation modulation = CONSTELLATION_DEFAULT;
+  TransmitMode TransmissionMode = TRANSMISSION_MODE_DEFAULT;
+  BandWidth bandWidth = BANDWIDTH_DEFAULT;
+  GuardInterval guardInterval = GUARD_INTERVAL_DEFAULT;
+  CodeRate HP_CodeRate = HP_CODERATE_DEFAULT, LP_CodeRate =
     LP_CODERATE_DEFAULT;
   //TODO : check frontend capabilities
-  fe_hierarchy_t hier = HIERARCHY_DEFAULT;
+  Hierarchy hier = HIERARCHY_DEFAULT;
   uint8_t diseqc = 0; //satellite number 
 
 
@@ -668,8 +668,6 @@ main (int argc, char **argv)
 	    modulation=QAM_128;
 	  else if (!strcmp (substring, "256"))
 	    modulation=QAM_256;
-	  else if (!strcmp (substring, "auto"))
-	    modulation=QAM_AUTO;
 	  else
 	    {
 		log_message( MSG_ERROR,
@@ -686,8 +684,6 @@ main (int argc, char **argv)
 	    TransmissionMode=TRANSMISSION_MODE_2K;
 	  else if (!strcmp (substring, "8k"))
 	    TransmissionMode=TRANSMISSION_MODE_8K;
-	  else if (!strcmp (substring, "auto"))
-	    TransmissionMode=TRANSMISSION_MODE_AUTO;
 	  else
 	    {
 		log_message( MSG_ERROR,
@@ -706,8 +702,6 @@ main (int argc, char **argv)
 	    bandWidth=BANDWIDTH_7_MHZ;
 	  else if (!strcmp (substring, "6MHz"))
 	    bandWidth=BANDWIDTH_6_MHZ;
-	  else if (!strcmp (substring, "auto"))
-	    bandWidth=BANDWIDTH_AUTO;
 	  else
 	    {
 		log_message( MSG_ERROR,
@@ -728,8 +722,6 @@ main (int argc, char **argv)
 	    guardInterval=GUARD_INTERVAL_1_8;
 	  else if (!strcmp (substring, "1/4"))
 	    guardInterval=GUARD_INTERVAL_1_4;
-	  else if (!strcmp (substring, "auto"))
-	    guardInterval=GUARD_INTERVAL_AUTO;
 	  else
 	    {
 		log_message( MSG_ERROR,
@@ -750,16 +742,10 @@ main (int argc, char **argv)
 	    HP_CodeRate=FEC_2_3;
 	  else if (!strcmp (substring, "3/4"))
 	    HP_CodeRate=FEC_3_4;
-	  else if (!strcmp (substring, "4/5"))
-	    HP_CodeRate=FEC_4_5;
 	  else if (!strcmp (substring, "5/6"))
 	    HP_CodeRate=FEC_5_6;
-	  else if (!strcmp (substring, "6/7"))
-	    HP_CodeRate=FEC_6_7;
 	  else if (!strcmp (substring, "7/8"))
 	    HP_CodeRate=FEC_7_8;
-	  else if (!strcmp (substring, "8/9"))
-	    HP_CodeRate=FEC_8_9;
 	  else if (!strcmp (substring, "auto"))
 	    HP_CodeRate=FEC_AUTO;
 	  else
@@ -840,20 +826,20 @@ main (int argc, char **argv)
       
       if ((freq > 100000000))
       {
-        if (open_fe (&fds.fd_frontend, card))
+        if (open_fe (&fds.fd_sec, &fds.fd_frontend, card))
           {
             tune_retval =
-              tune_it (fds.fd_frontend, freq, srate, 0, tone, specInv, diseqc,
+              tune_it (fds.fd_sec, fds.fd_frontend, freq, srate, 0, tone, specInv, diseqc,
                       modulation, HP_CodeRate, TransmissionMode, guardInterval,
                       bandWidth, LP_CodeRate, hier, display_signal_strenght);
           }
       }
     else if ((freq != 0) && (pol != 0) && (srate != 0))
       {
-        if (open_fe (&fds.fd_frontend, card))
+        if (open_fe (&fds.fd_sec, &fds.fd_frontend, card))
           {
             tune_retval =
-              tune_it (fds.fd_frontend, freq, srate, pol, tone, specInv, diseqc,
+              tune_it (fds.fd_sec, fds.fd_frontend, freq, srate, pol, tone, specInv, diseqc,
                       modulation, HP_CodeRate, TransmissionMode, guardInterval,
                       bandWidth, LP_CodeRate, hier, display_signal_strenght);
           }
diff -upr mumudvb.orig/src/tune.c dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/tune.c
--- mumudvb.orig/src/tune.c	2009-02-08 17:57:18.000000000 +0200
+++ dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/tune.c	2009-02-08 21:31:40.000000000 +0200
@@ -34,16 +34,17 @@
 #include <error.h>
 #include <errno.h>
 
-#include <linux/dvb/dmx.h>
-#include <linux/dvb/frontend.h>
+#include <ost/dmx.h>
+#include <ost/sec.h>
+#include <ost/frontend.h>
 
 #include "tune.h"
 #include "mumudvb.h"
 
-void print_status(fe_status_t festatus) {
+void print_status(FrontendStatus festatus) {
   log_message( MSG_INFO, "FE_STATUS:");
   if (festatus & FE_HAS_SIGNAL) log_message( MSG_INFO, " FE_HAS_SIGNAL");
-  if (festatus & FE_TIMEDOUT) log_message( MSG_INFO, " FE_TIMEDOUT");
+  if (festatus & FE_HAS_POWER) log_message( MSG_INFO, " FE_HAS_POWER");
   if (festatus & FE_HAS_LOCK) log_message( MSG_INFO, " FE_HAS_LOCK");
   if (festatus & FE_HAS_CARRIER) log_message( MSG_INFO, " FE_HAS_CARRIER");
   if (festatus & FE_HAS_VITERBI) log_message( MSG_INFO, " FE_HAS_VITERBI");
@@ -51,77 +52,52 @@ void print_status(fe_status_t festatus) 
   log_message( MSG_INFO, "\n");
 }
 
-
-struct diseqc_cmd {
-   struct dvb_diseqc_master_cmd cmd;
-   uint32_t wait;
-};
-
-static int diseqc_send_msg(int fd, fe_sec_voltage_t v, struct diseqc_cmd *cmd,
-		     fe_sec_tone_mode_t t, unsigned char sat_no)
-{
-   if(ioctl(fd, FE_SET_TONE, SEC_TONE_OFF) < 0)
-   	return -1;
-   if(ioctl(fd, FE_SET_VOLTAGE, v) < 0)
-   	return -1;
-   usleep(15 * 1000);
-   if(sat_no >= 1 && sat_no <= 4)	//1.x compatible equipment
-   {
-     if(ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &cmd->cmd) < 0)
-       return -1;
-     usleep(15 * 1000);
-    if(ioctl(fd, FE_DISEQC_SEND_MASTER_CMD, &cmd->cmd) < 0)
-   	return -1;
-    usleep(cmd->wait * 1000);
-    usleep(15 * 1000);
-   }
-   else	//A or B simple diseqc
-   {
-    log_message( MSG_INFO, "SETTING SIMPLE %c BURST\n", sat_no);
-    if(ioctl(fd, FE_DISEQC_SEND_BURST, (sat_no == 'B' ? SEC_MINI_B : SEC_MINI_A)) < 0)
-   	return -1;
-    usleep(15 * 1000);
-   }
-   if(ioctl(fd, FE_SET_TONE, t) < 0)
-   	return -1;
-
-   return 0;
-}
-
 /* digital satellite equipment control,
  * specification is available from http://www.eutelsat.com/ 
  */
 
 static int do_diseqc(int fd, unsigned char sat_no, int polv, int hi_lo)
 {
-    struct diseqc_cmd cmd =  { {{0xe0, 0x10, 0x38, 0xf0, 0x00, 0x00}, 4}, 0 };
+
+struct secCommand sSCmd;
+struct secCmdSequence sSCmdSeq;
 
     if(sat_no != 0)
     {
-	unsigned char d = sat_no;
-
-	/* param: high nibble: reset bits, low nibble set bits,
-	* bits are: option, position, polarizaion, band
-	*/
-	sat_no--;
-	cmd.cmd.msg[3] =
-    	    0xf0 | (((sat_no * 4) & 0x0f) | (polv ? 0 : 2) | (hi_lo ? 1 : 0));
-
-	return diseqc_send_msg(fd, 
-		    polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18,
-		    &cmd, 
-		    hi_lo ? SEC_TONE_ON : SEC_TONE_OFF, 
-		    d);
+	sSCmdSeq.continuousTone = (hi_lo) ? SEC_TONE_OFF : SEC_TONE_ON;
+	sSCmdSeq.voltage = (polv) ? SEC_VOLTAGE_18 : SEC_VOLTAGE_13;
+	
+	sSCmd.type = 0;
+	sSCmd.u.diseqc.addr = 0x10;
+	sSCmd.u.diseqc.cmd = 0x38;
+	sSCmd.u.diseqc.numParams = 1;
+	sSCmd.u.diseqc.params[0] =   0xF0
+                    | ((sat_no * 4) & 0x0F)
+                    | (sSCmdSeq.continuousTone == SEC_TONE_ON ? 1 : 0)
+                    | (sSCmdSeq.voltage == SEC_VOLTAGE_18 ? 2 : 0);
+	sSCmdSeq.miniCommand = SEC_MINI_NONE;
+	sSCmdSeq.numCommands = 1;
+	sSCmdSeq.commands = &sSCmd;
+	
+	if(ioctl(fd, FE_SEC_COMMAND, &sSCmdSeq) < 0) {
+	    log_message( MSG_INFO, "Error Setting diseqc\n");
+	    return -1;
+	}
+	return 0;
     }
     else 	//only tone and voltage
     {
-	log_message( MSG_INFO, "Setting only tone %s and voltage %dV\n", (hi_lo ? "ON" : "OFF"), (polv ? 13 : 18));
+	log_message( MSG_INFO, "Setting only tone %s and voltage %dV, fd=%d\n", (hi_lo ? "ON" : "OFF"), (polv ? 13 : 18), fd);
 	
-	if(ioctl(fd, FE_SET_VOLTAGE, (polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18)) < 0)
+	if(ioctl(fd, SEC_SET_VOLTAGE, (polv ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18)) < 0) {
+	    perror ("DISEQC ERROR1: ");
    	    return -1;
-	    
-	if(ioctl(fd, FE_SET_TONE, (hi_lo ? SEC_TONE_ON : SEC_TONE_OFF)) < 0)
+	}
+	
+	if(ioctl(fd, SEC_SET_TONE, (hi_lo ? SEC_TONE_ON : SEC_TONE_OFF)) < 0) {
+	    perror ("DISEQC ERROR2: ");
    	    return -1;
+	}
 	
 	usleep(15 * 1000);
 	
@@ -129,10 +105,10 @@ static int do_diseqc(int fd, unsigned ch
     }
 }
 
-int check_status(int fd_frontend,int type, struct dvb_frontend_parameters* feparams,int hi_lo, int display_strength) {
+int check_status(int fd_frontend, int type, FrontendParameters *feparams, int hi_lo, int display_strength) {
   int32_t strength;
-  fe_status_t festatus;
-  struct dvb_frontend_event event;
+  FrontendStatus festatus;
+  FrontendEvent event;
   struct pollfd pfd[1];
   int status;
 
@@ -149,14 +125,14 @@ int check_status(int fd_frontend,int typ
   pfd[0].fd = fd_frontend;
   pfd[0].events = POLLPRI;
 
-  event.status=0;
-  while (((event.status & FE_TIMEDOUT)==0) && ((event.status & FE_HAS_LOCK)==0)) {
+  event.type=0;
+  while ((event.type & FE_COMPLETION_EV)==0) {
     log_message( MSG_DETAIL, "polling....\n");
     if (poll(pfd,1,10000) > 0){
       if (pfd[0].revents & POLLPRI){
         log_message( MSG_DETAIL, "Getting frontend event\n");
         if ((status = ioctl(fd_frontend, FE_GET_EVENT, &event)) < 0){
-	  if (errno != EOVERFLOW) {
+	  if (errno != EBUFFEROVERFLOW) {
 	    perror("FE_GET_EVENT");
 	    log_message( MSG_ERROR, "status = %d\n", status);
 	    log_message( MSG_ERROR, "errno = %d\n", errno);
@@ -176,25 +152,25 @@ int check_status(int fd_frontend,int typ
 	    log_message( MSG_INFO, "SNR: %10d\n",strength);
 	}
 
-      print_status(event.status);
+      print_status(event.u.failureEvent);
     }
   }
 
-  if (event.status & FE_HAS_LOCK) {
+  if (event.type & FE_COMPLETION_EV) {
       switch(type) {
          case FE_OFDM:
-           log_message( MSG_INFO, "Event:  Frequency: %d\n",event.parameters.frequency);
+           log_message( MSG_INFO, "Event:  Frequency: %d\n",event.u.completionEvent.Frequency);
            break;
          case FE_QPSK:
-           log_message( MSG_INFO, "Event:  Frequency: %d\n",(unsigned int)((event.parameters.frequency)+(hi_lo ? LOF2 : LOF1)));
-           log_message( MSG_INFO, "        SymbolRate: %d\n",event.parameters.u.qpsk.symbol_rate);
-           log_message( MSG_INFO, "        FEC_inner:  %d\n",event.parameters.u.qpsk.fec_inner);
+           log_message( MSG_INFO, "Event:  Frequency: %d\n",(unsigned int)((event.u.completionEvent.Frequency)+(hi_lo ? LOF2 : LOF1)));
+           log_message( MSG_INFO, "        SymbolRate: %d\n",event.u.completionEvent.u.qpsk.SymbolRate);
+           log_message( MSG_INFO, "        FEC_inner:  %d\n",event.u.completionEvent.u.qpsk.FEC_inner);
            log_message( MSG_INFO, "\n");
            break;
          case FE_QAM:
-           log_message( MSG_INFO, "Event:  Frequency: %d\n",event.parameters.frequency);
-           log_message( MSG_INFO, "        SymbolRate: %d\n",event.parameters.u.qpsk.symbol_rate);
-           log_message( MSG_INFO, "        FEC_inner:  %d\n",event.parameters.u.qpsk.fec_inner);
+           log_message( MSG_INFO, "Event:  Frequency: %d\n",event.u.completionEvent.Frequency);
+           log_message( MSG_INFO, "        SymbolRate: %d\n",event.u.completionEvent.u.qpsk.SymbolRate);
+           log_message( MSG_INFO, "        FEC_inner:  %d\n",event.u.completionEvent.u.qpsk.FEC_inner);
            break;
          default:
            break;
@@ -222,10 +198,15 @@ int check_status(int fd_frontend,int typ
   return 0;
 }
 
-int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned char diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth, fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, int display_strength) {
-  int res, hi_lo, dfd;
-  struct dvb_frontend_parameters feparams;
-  struct dvb_frontend_info fe_info;
+int tune_it(int fd_sec, int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, 
+    SpectralInversion specInv, unsigned char diseqc, Modulation modulation, CodeRate HP_CodeRate,
+    TransmitMode TransmissionMode, GuardInterval guardInterval, BandWidth bandwidth, CodeRate LP_CodeRate,
+    Hierarchy hier, int display_strenght) {
+
+
+  int res, hi_lo;
+  FrontendParameters feparams;
+  FrontendInfo fe_info;
 
   //no warning
   hi_lo = 0;
@@ -234,54 +215,52 @@ int tune_it(int fd_frontend, unsigned in
      perror("FE_GET_INFO: ");
      return -1;
   }
-  
-  log_message( MSG_INFO, "Using DVB card \"%s\"\n",fe_info.name);
+  log_message( MSG_INFO, "DVB card: hwType=0x%04x hwVersion=0x%04x\n", fe_info.hwType, fe_info.hwVersion);
 
   switch(fe_info.type) {
     case FE_OFDM:
       if (freq < 1000000) freq*=1000UL;
-      feparams.frequency=freq;
-      feparams.inversion=INVERSION_AUTO;
-      feparams.u.ofdm.bandwidth=bandwidth;
-      feparams.u.ofdm.code_rate_HP=HP_CodeRate;
-      feparams.u.ofdm.code_rate_LP=LP_CodeRate;
-      feparams.u.ofdm.constellation=modulation;
-      feparams.u.ofdm.transmission_mode=TransmissionMode;
-      feparams.u.ofdm.guard_interval=guardInterval;
-      feparams.u.ofdm.hierarchy_information=hier;
+      feparams.Frequency=freq;
+      feparams.Inversion=INVERSION_AUTO;
+      feparams.u.ofdm.bandWidth=bandwidth;
+      feparams.u.ofdm.HP_CodeRate=HP_CodeRate;
+      feparams.u.ofdm.LP_CodeRate=LP_CodeRate;
+      feparams.u.ofdm.Constellation=modulation;
+      feparams.u.ofdm.TransmissionMode=TransmissionMode;
+      feparams.u.ofdm.guardInterval=guardInterval;
+      feparams.u.ofdm.HierarchyInformation=hier;
       log_message( MSG_INFO, "tuning DVB-T (%s) to %d Hz, Bandwidth: %d\n",DVB_T_LOCATION,freq, 
 	bandwidth==BANDWIDTH_8_MHZ ? 8 : (bandwidth==BANDWIDTH_7_MHZ ? 7 : 6));
       break;
     case FE_QPSK:
     	pol = toupper(pol);
         if (freq < SLOF) {
-          feparams.frequency=(freq-LOF1);
+          feparams.Frequency=(freq-LOF1);
 	  hi_lo = 0;
         } else {
-          feparams.frequency=(freq-LOF2);
+          feparams.Frequency=(freq-LOF2);
 	  hi_lo = 1;
       }
 
-	log_message( MSG_INFO, "tuning DVB-S to Freq: %u, Pol:%c Srate=%d, 22kHz tone=%s, LNB: %d\n",feparams.frequency,pol,srate,tone == SEC_TONE_ON ? "on" : "off", diseqc);
-      feparams.inversion=specInv;
-      feparams.u.qpsk.symbol_rate=srate;
-      feparams.u.qpsk.fec_inner=FEC_AUTO;
-      dfd = fd_frontend;
+      log_message( MSG_INFO, "tuning DVB-S to Freq: %u, Pol:%c Srate=%d, 22kHz tone=%s, LNB: %d\n",feparams.Frequency,pol,srate,tone == SEC_TONE_ON ? "on" : "off", diseqc);
+      feparams.Inversion=specInv;
+      feparams.u.qpsk.SymbolRate=srate;
+      feparams.u.qpsk.FEC_inner=FEC_AUTO;
 
-   if(do_diseqc(dfd, diseqc, (pol == 'V' ? 1 : 0), hi_lo) == 0)
+   if(do_diseqc(fd_sec, diseqc, (pol == 'V' ? 1 : 0), hi_lo) == 0)
 	log_message( MSG_INFO, "DISEQC SETTING SUCCEDED\n");
    else  {
-	log_message( MSG_INFO, "DISEQC SETTING FAILED\n");
+	log_message( MSG_INFO, "DISEQC SETTING FAILED, fd=%d\n", fd_sec);
           return -1;
         }
       break;
     case FE_QAM:
       log_message( MSG_INFO, "tuning DVB-C to %d, srate=%d\n",freq,srate);
-      feparams.frequency=freq;
-      feparams.inversion=INVERSION_OFF;
-      feparams.u.qam.symbol_rate = srate;
-      feparams.u.qam.fec_inner = FEC_AUTO;
-      feparams.u.qam.modulation = modulation;
+      feparams.Frequency=freq;
+      feparams.Inversion=INVERSION_OFF;
+      feparams.u.qam.SymbolRate = srate;
+      feparams.u.qam.FEC_inner = FEC_AUTO;
+      feparams.u.qam.QAM = modulation;
       break;
     default:
       log_message( MSG_ERROR, "Unknown FE type. Aborting\n");
@@ -289,5 +268,5 @@ int tune_it(int fd_frontend, unsigned in
   }
   usleep(100000);
 
-  return(check_status(fd_frontend,fe_info.type,&feparams,hi_lo,display_strength));
+  return(check_status(fd_frontend, fe_info.type, &feparams, hi_lo, display_strenght));
 }
diff -upr mumudvb.orig/src/tune.h dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/tune.h
--- mumudvb.orig/src/tune.h	2009-02-08 17:57:18.000000000 +0200
+++ dreambox-dm500/tuxbox-dvbshout/cdk/mumudvb/src/tune.h	2009-02-08 20:11:26.000000000 +0200
@@ -27,10 +27,14 @@
 #ifndef _TUNE_H
 #define _TUNE_H
 
-#include <linux/dvb/frontend.h>
+#include <ost/frontend.h>
 
 #include "dvb_defaults.h"
 
-int tune_it(int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, fe_spectral_inversion_t specInv, unsigned char diseqc,fe_modulation_t modulation,fe_code_rate_t HP_CodeRate,fe_transmit_mode_t TransmissionMode,fe_guard_interval_t guardInterval, fe_bandwidth_t bandwidth, fe_code_rate_t LP_CodeRate, fe_hierarchy_t hier, int display_strenght);
+int tune_it(int fd_sec, int fd_frontend, unsigned int freq, unsigned int srate, char pol, int tone, 
+    SpectralInversion specInv, unsigned char diseqc, Modulation modulation, CodeRate HP_CodeRate,
+    TransmitMode TransmissionMode, GuardInterval guardInterval, BandWidth bandwidth, CodeRate LP_CodeRate,
+    Hierarchy hier, int display_strenght);
+
 
 #endif

