*** src/dvb/diseqc.c.orig	2012-01-08 11:07:21.968031144 +0200
--- src/dvb/diseqc.c	2012-01-08 01:32:50.567220221 +0200
***************
*** 25,30 ****
--- 25,50 ----
  	{ { { 0xe0, 0x10, 0x38, 0xff, 0x00, 0x00 }, 4 }, 0 }
  };
  
+ //For some DiSEqC required to be repeated command with E1
+ struct diseqc_cmd switch_commited_cmds_repeat[] = {
+ 	{ { { 0xe1, 0x10, 0x38, 0xf0, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xf2, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xf1, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xf3, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xf4, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xf6, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xf5, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xf7, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xf8, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xfa, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xf9, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xfb, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xfc, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xfe, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xfd, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x38, 0xff, 0x00, 0x00 }, 4 }, 0 }
+ };
+ 
  struct diseqc_cmd switch_uncommited_cmds[] = {
  	{ { { 0xe0, 0x10, 0x39, 0xf0, 0x00, 0x00 }, 4 }, 0 },
  	{ { { 0xe0, 0x10, 0x39, 0xf1, 0x00, 0x00 }, 4 }, 0 },
***************
*** 44,49 ****
--- 64,88 ----
  	{ { { 0xe0, 0x10, 0x39, 0xff, 0x00, 0x00 }, 4 }, 0 }
  };
  
+ //For some DiSEqC required to be repeated command with E1
+ struct diseqc_cmd switch_uncommited_cmds_repeat[] = {
+ 	{ { { 0xe1, 0x10, 0x39, 0xf0, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xf1, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xf2, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xf3, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xf4, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xf5, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xf6, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xf7, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xf8, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xf9, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xfa, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xfb, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xfc, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xfd, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xfe, 0x00, 0x00 }, 4 }, 0 },
+ 	{ { { 0xe1, 0x10, 0x39, 0xff, 0x00, 0x00 }, 4 }, 0 }
+ };
  
  /*--------------------------------------------------------------------------*/
  
***************
*** 73,78 ****
--- 113,120 ----
  			return err;
  
  		msleep((*cmd)->wait);
+ 		msleep(15);
+ 
  		cmd++;
  	}
  
***************
*** 83,89 ****
  
  	msleep(15);
  
! 	return ioctl(fd, FE_SET_TONE, t);
  }
  
  
--- 125,134 ----
  
  	msleep(15);
  
! 	if ((err = ioctl(fd, FE_SET_TONE, t)))
! 		return err;
! 
! 	return err;
  }
  
  
***************
*** 91,107 ****
  diseqc_setup(int frontend_fd, int switch_pos, int voltage_18, int hiband,
  	     int diseqc_ver)
  {
! 	struct diseqc_cmd *cmd[2] = { NULL, NULL };
  	int i = 4 * switch_pos + 2 * hiband + (voltage_18 ? 1 : 0);
! 	
  	if (diseqc_ver == 1) {
  		if(switch_pos < 0 || switch_pos >= (int) (sizeof(switch_uncommited_cmds)/sizeof(struct diseqc_cmd)))
  			return -1;
  		cmd[0] = &switch_uncommited_cmds[switch_pos];
  	} else {
  		if(i < 0 || i >= (int) (sizeof(switch_commited_cmds)/sizeof(struct diseqc_cmd)))
  			return -1;
  		cmd[0] = &switch_commited_cmds[i];
  	}
  
  	return diseqc_send_msg (frontend_fd,
--- 136,154 ----
  diseqc_setup(int frontend_fd, int switch_pos, int voltage_18, int hiband,
  	     int diseqc_ver)
  {
! 	struct diseqc_cmd *cmd[3] = { NULL, NULL, NULL };
  	int i = 4 * switch_pos + 2 * hiband + (voltage_18 ? 1 : 0);
! 
  	if (diseqc_ver == 1) {
  		if(switch_pos < 0 || switch_pos >= (int) (sizeof(switch_uncommited_cmds)/sizeof(struct diseqc_cmd)))
  			return -1;
  		cmd[0] = &switch_uncommited_cmds[switch_pos];
+ 		cmd[1] = &switch_uncommited_cmds_repeat[switch_pos];
  	} else {
  		if(i < 0 || i >= (int) (sizeof(switch_commited_cmds)/sizeof(struct diseqc_cmd)))
  			return -1;
  		cmd[0] = &switch_commited_cmds[i];
+ 		cmd[1] = &switch_commited_cmds_repeat[i];
  	}
  
  	return diseqc_send_msg (frontend_fd,
