--- /mnt/MediaLibrary/Programs/drivers/dvb-kernel/linux/drivers/media/dvb/ttusb-dec/ttusbdecfe.c 2005-06-23 02:11:38.000000000 +0307 +++ ./ttusbdecfe.c 2005-12-02 09:41:57.000000000 +0307 @@ -22,7 +22,7 @@ #include "dvb_frontend.h" #include "ttusbdecfe.h" - +#define LOF_SWITCH 11700000 #define LOF_HI 10600000 #define LOF_LO 9750000 @@ -42,6 +42,10 @@ struct ttusbdecfe_state { static int ttusbdecfe_read_status(struct dvb_frontend* fe, fe_status_t* status) { + //struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv; + //u8 b[] = {0x00}; + //state->conig->send_command(fe, 0x57, sizeof(b), b, NULL, NULL); + *status = FE_HAS_SIGNAL | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK; @@ -76,23 +80,29 @@ static int ttusbdecfe_dvbs_set_frontend( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00 }; u32 freq; u32 sym_rate; u32 band; u32 lnb_voltage; - - freq = htonl(p->frequency + - (state->hi_band ? LOF_HI : LOF_LO)); + + if(state->hi_band == 1)//(p->frequency > (LOF_SWITCH-LOF_HI)) + { + freq = htonl(p->frequency+ LOF_HI); + band = htonl(LOF_HI); + } + else + { + freq = htonl(p->frequency+ LOF_LO); + band = htonl(LOF_LO); + } memcpy(&b[4], &freq, sizeof(u32)); sym_rate = htonl(p->u.qam.symbol_rate); memcpy(&b[12], &sym_rate, sizeof(u32)); - band = htonl(state->hi_band ? LOF_HI : LOF_LO); memcpy(&b[24], &band, sizeof(u32)); lnb_voltage = htonl(state->voltage); memcpy(&b[28], &lnb_voltage, sizeof(u32)); - state->config->send_command(fe, 0x71, sizeof(b), b, NULL, NULL); return 0; @@ -106,7 +116,7 @@ static int ttusbdecfe_dvbs_diseqc_send_m 0x00, 0x00 }; memcpy(&b[4], cmd->msg, cmd->msg_len); - + state->hi_band = (cmd->msg[9] & 0x01); state->config->send_command(fe, 0x72, sizeof(b) - (6 - cmd->msg_len), b, NULL, NULL); @@ -118,9 +128,11 @@ static int ttusbdecfe_dvbs_diseqc_send_m static int ttusbdecfe_dvbs_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) { struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv; - - state->hi_band = (SEC_TONE_ON == tone); - + if(SEC_TONE_ON == tone) + state->hi_band = 1;//(SEC_TONE_ON == tone); + else + state->hi_band = 0; + return 0; } @@ -222,6 +234,8 @@ static struct dvb_frontend_ops ttusbdecf .type = FE_QPSK, .frequency_min = 950000, .frequency_max = 2150000, + .symbol_rate_min = 1000000, + .symbol_rate_max = 45000000, .frequency_stepsize = 125, .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |