summaryrefslogtreecommitdiffstats
path: root/src/af903x-fe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/af903x-fe.c')
-rw-r--r--src/af903x-fe.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/af903x-fe.c b/src/af903x-fe.c
index 1939671..f9b12c0 100644
--- a/src/af903x-fe.c
+++ b/src/af903x-fe.c
@@ -11,12 +11,12 @@ static int af903x_init(struct dvb_frontend *demod)
DWORD error = Error_NO_ERROR;
deb_data("- Enter %s Function - chip=%d\n",__FUNCTION__, demod->dvb->num);
-/* error = DL_ApCtrl(demod->dvb->num,1 );
+ error = DL_ApCtrl(demod->dvb->num,1 );
if(error){
- printk("af903x_init return error\n");
+ deb_data("af903x_init return error\n");
return error;
}
-*/
+
return 0;
}
@@ -27,12 +27,12 @@ static int af903x_sleep(struct dvb_frontend *demod)
DeviceReboot = false;
- /* error = DL_ApCtrl(demod->dvb->num, 0);
+ error = DL_ApCtrl(demod->dvb->num, 0);
if (error){
- printk("af903x_sleep return error\n");
+ deb_data("af903x_sleep return error\n");
return error;
}
-*/
+
return 0;
}
@@ -75,26 +75,29 @@ static int af903x_set_frontend(struct dvb_frontend* fe,
ch.RF_kHz = 950000;
error = DL_Tuner_SetFreqBw(fe->dvb->num,ch.RF_kHz,ch.Bw);
- if (error) printk("af903x_set_frontend return error\n");
+ if (error) deb_data("af903x_set_frontend return error\n");
return 0;
}
static int af903x_read_status(struct dvb_frontend *fe, fe_status_t *stat)
{
- //deb_data("- Enter %s Function -chip=%d\n",__FUNCTION__, fe->dvb->num);
- struct af903xm_state *state = fe->demodulator_priv;
+ //struct af903xm_state *state = fe->demodulator_priv;
DWORD error = Error_NO_ERROR;
Bool bLock;
+ deb_data("- Enter %s Function - chip=%d\n",__FUNCTION__, fe->dvb->num);
*stat = 0;
error = DL_isLocked(fe->dvb->num, &bLock);
+ deb_data("DEBUG1 - code=: %d\n",(int) error);
if(error) return 0;//return error;
-
+ deb_data("DEBUG2 - code=: %d\n",(int) error);
+
if (bLock)
{
+ deb_data("DEBUG3 - code=: %d\n",(int) error);
// It's seems ok that always return lock to AP
*stat |= FE_HAS_SIGNAL;
*stat |= FE_HAS_CARRIER;
@@ -102,13 +105,15 @@ static int af903x_read_status(struct dvb_frontend *fe, fe_status_t *stat)
*stat |= FE_HAS_VITERBI;
*stat |= FE_HAS_SYNC;
}
+ deb_data("DEBUG4 - code=: %d\n",(int) error);
+
return 0;
}
static int af903x_read_ber(struct dvb_frontend *fe, u32 *ber)
{
- struct af903xm_state *state = fe->demodulator_priv;
+ //struct af903xm_state *state = fe->demodulator_priv;
DWORD error = Error_NO_ERROR;
@@ -117,7 +122,7 @@ static int af903x_read_ber(struct dvb_frontend *fe, u32 *ber)
error = DL_getChannelStatistic(fe->dvb->num, &channelStatistic);
if(error) return error;
- deb_data("- af903x_read_ber postVitErrorCount : %d, postVitBitCount :%d -\n",channelStatistic.postVitErrorCount, channelStatistic.postVitBitCount);
+ deb_data("- af903x_read_ber postVitErrorCount : %d, postVitBitCount :%d -\n",( int ) channelStatistic.postVitErrorCount,(int) channelStatistic.postVitBitCount);
*ber = channelStatistic.postVitErrorCount * (0xFFFFFFFF / channelStatistic.postVitBitCount);
return 0;
@@ -125,9 +130,7 @@ static int af903x_read_ber(struct dvb_frontend *fe, u32 *ber)
static int af903x_read_snr(struct dvb_frontend* fe, u16 *snr)
{
-// (void) fe;
-// *snr = 0x0000;
- struct af903xm_state *state = fe->demodulator_priv;
+ *snr = 0;
DWORD error = Error_NO_ERROR;
Constellation constellation;
@@ -162,20 +165,19 @@ static int af903x_read_unc_blocks(struct dvb_frontend *fe, u32 *unc)
}
static int af903x_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
{
- struct af903xm_state *state = fe->demodulator_priv;
-
DWORD error = Error_NO_ERROR;
BYTE SignalStrength = 0;
- Long SignalStrengthdbm;
- deb_data("- Enter %s Function -\n",__FUNCTION__);
#ifdef QuantaMID
+ Long SignalStrengthdbm;
+ deb_data("- Enter %s Function -\n",__FUNCTION__);
error = DL_getSignalStrengthDbm(fe->dvb->num, &SignalStrengthdbm);
if(error) return error;
-
deb_data("- af903x_read_signal_strengthDbm is -%d -\n",-SignalStrengthdbm);
*strength = (u16)(-SignalStrengthdbm);
#else
+ deb_data("- Enter %s Function -\n",__FUNCTION__);
+
error = DL_getSignalStrength(fe->dvb->num, &SignalStrength);
if(error) return error;