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.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/af903x-fe.c b/src/af903x-fe.c
index aee8948..d8876ab 100644
--- a/src/af903x-fe.c
+++ b/src/af903x-fe.c
@@ -3,7 +3,7 @@
struct af903xm_state {
struct dvb_frontend demod;
- fe_bandwidth_t current_bandwidth;
+ u32 current_bandwidth;
};
static int af903x_init(struct dvb_frontend *demod)
@@ -16,7 +16,7 @@ static int af903x_init(struct dvb_frontend *demod)
deb_data("af903x_init return error\n");
return error;
}
-
+
return 0;
}
@@ -42,32 +42,32 @@ static int af903x_identify(struct af903xm_state *state)
return 0;
}
-static int af903x_get_frontend(struct dvb_frontend* fe,
- struct dvb_frontend_parameters *fep)
+static int af903x_get_frontend(struct dvb_frontend* fe)
{
+ struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
struct af903xm_state *state = fe->demodulator_priv;
deb_data("- Enter %s Function - chip=%d\n",__FUNCTION__, fe->dvb->num);
fep->inversion = INVERSION_AUTO;
- fep->u.ofdm.bandwidth = state->current_bandwidth;
+ fep->bandwidth_hz = state->current_bandwidth;
return 0;
}
-static int af903x_set_frontend(struct dvb_frontend* fe,
- struct dvb_frontend_parameters *fep)
+static int af903x_set_frontend(struct dvb_frontend* fe)
{
+ struct dtv_frontend_properties *fep = &fe->dtv_property_cache;
struct af903xm_state *state = fe->demodulator_priv;
struct af903x_ofdm_channel ch;
DWORD error = Error_NO_ERROR;
-
- deb_data("- Enter %s Function - chip=%d\n",__FUNCTION__, fe->dvb->num);
- if (fep->u.ofdm.bandwidth == 0) fep->u.ofdm.bandwidth=8;
- if (fep->u.ofdm.bandwidth == 1) fep->u.ofdm.bandwidth=7;
- if (fep->u.ofdm.bandwidth == 2) fep->u.ofdm.bandwidth=6;
+ deb_data("- Enter %s Function - chip=%d delsys=%d BW=%d\n",__FUNCTION__, fe->dvb->num, fe->dtv_property_cache.delivery_system,fep->bandwidth_hz);
+ //fep->bandwidth_hz=8;
+ if (fep->bandwidth_hz == 0) fep->bandwidth_hz=8;
+ if (fep->bandwidth_hz == 1) fep->bandwidth_hz=7;
+ if (fep->bandwidth_hz == 2) fep->bandwidth_hz=6;
ch.RF_kHz = fep->frequency / 1000;
- ch.Bw = fep->u.ofdm.bandwidth;
+ ch.Bw = fep->bandwidth_hz;
- state->current_bandwidth = fep->u.ofdm.bandwidth;
+ state->current_bandwidth = fep->bandwidth_hz;
deb_data("- Enter %s Function - chip=%d RF=%d, BW=%d\n",__FUNCTION__, fe->dvb->num,ch.RF_kHz,ch.Bw);
@@ -130,12 +130,14 @@ 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;
+
DWORD error = Error_NO_ERROR;
Constellation constellation;
BYTE SignalSnr = 0;
- *snr = 0;
-
error = DL_getSNR(fe->dvb->num, &constellation, &SignalSnr);
if(error) return error;
@@ -165,6 +167,8 @@ 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;
@@ -200,7 +204,7 @@ struct dvb_frontend * af903x_attach(u8 tmp)
struct dvb_frontend *demod;
struct af903xm_state *st;
- deb_data("- Enter %s Function -\n",__FUNCTION__);
+ deb_data("- Enter %s Function -\n",__FUNCTION__);
st = kzalloc(sizeof(struct af903xm_state), GFP_KERNEL);
if (st == NULL)
return NULL;
@@ -208,7 +212,6 @@ struct dvb_frontend * af903x_attach(u8 tmp)
demod = &st->demod;
demod->demodulator_priv = st;
memcpy(&st->demod.ops, &af903x_ops, sizeof(struct dvb_frontend_ops));
-
af903x_identify(st);
return demod;
@@ -216,6 +219,7 @@ struct dvb_frontend * af903x_attach(u8 tmp)
EXPORT_SYMBOL(af903x_attach);
static struct dvb_frontend_ops af903x_ops = {
+ .delsys = { SYS_DVBT },
.info = {
.name = "AF903X USB DVB-T",
.type = FE_OFDM,