1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

change pls to official scrambling_sequence_index

This commit is contained in:
Ralph Metzler 2018-01-16 23:50:40 +01:00
parent bda6c538ae
commit 4f136e5659
8 changed files with 33 additions and 28 deletions

View File

@ -383,20 +383,23 @@ unlock:
mci_cmd(state, &cmd, NULL);
mci_config(state, ts_config);
}
if (p->stream_id != NO_STREAM_ID_FILTER && p->stream_id != 0x80000000)
flags |= 0x80;
printk("frontend %u: tuner=%u demod=%u\n", state->nr, state->tuner, state->demod);
cmd.command = MCI_CMD_SEARCH_DVBS;
cmd.dvbs2_search.flags = flags;
cmd.dvbs2_search.s2_modulation_mask = modmask & ((1 << (bits_per_symbol - 1)) - 1);
cmd.dvbs2_search.retry = 255; /* forever */
cmd.dvbs2_search.retry = 2;
cmd.dvbs2_search.frequency = p->frequency * 1000;
cmd.dvbs2_search.symbol_rate = p->symbol_rate;
cmd.dvbs2_search.scrambling_sequence_index =
(p->pls != NO_SCRAMBLING_CODE) ? p->pls : 0;
cmd.dvbs2_search.input_stream_id =
(p->stream_id != NO_STREAM_ID_FILTER) ? p->stream_id : 0;
p->scrambling_sequence_index;
cmd.dvbs2_search.input_stream_id = p->stream_id;
cmd.tuner = state->tuner;
cmd.demod = state->demod;
cmd.output = state->nr;
if (p->stream_id == 0x80000000)
cmd.output |= 0x80;
stat = mci_cmd(state, &cmd, NULL);
if (stat)
stop(fe);

View File

@ -972,7 +972,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
}
c->stream_id = NO_STREAM_ID_FILTER;
c->pls = NO_SCRAMBLING_CODE;
c->scrambling_sequence_index = 0;/* default sequence */
c->input = NO_INPUT;
switch (c->delivery_system) {
@ -1064,9 +1064,9 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {
_DTV_CMD(DTV_STREAM_ID, 1, 0),
_DTV_CMD(DTV_DVBT2_PLP_ID_LEGACY, 1, 0),
_DTV_CMD(DTV_SCRAMBLING_SEQUENCE_INDEX, 1, 0),
_DTV_CMD(DTV_LNA, 1, 0),
_DTV_CMD(DTV_INPUT, 1, 0),
_DTV_CMD(DTV_PLS, 1, 0),
/* Get */
_DTV_CMD(DTV_DISEQC_SLAVE_REPLY, 0, 1),
@ -1505,8 +1505,9 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
tvp->u.buffer.len = 4;
break;
case DTV_PLS:
tvp->u.data = c->pls;
/* Physical layer scrambling support */
case DTV_SCRAMBLING_SEQUENCE_INDEX:
tvp->u.data = c->scrambling_sequence_index;
break;
/* Fill quality measures */
@ -1946,8 +1947,9 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
r = fe->ops.set_input(fe, c->input);
break;
case DTV_PLS:
c->pls = tvp->u.data;
/* Physical layer scrambling support */
case DTV_SCRAMBLING_SEQUENCE_INDEX:
c->scrambling_sequence_index = tvp->u.data;
break;
default:

View File

@ -529,6 +529,8 @@ struct dvb_fe_events {
* @layer.interleaving: per layer interleaving.
* @stream_id: If different than zero, enable substream filtering, if
* hardware supports (DVB-S2 and DVB-T2).
* @scrambling_sequence_index: Carries the index of the DVB-S2 physical layer
* scrambling sequence.
* @atscmh_fic_ver: Version number of the FIC (Fast Information Channel)
* signaling data (only ATSC-M/H)
* @atscmh_parade_id: Parade identification number (only ATSC-M/H)
@ -607,6 +609,9 @@ struct dtv_frontend_properties {
/* Multistream specifics */
u32 stream_id;
/* Physical Layer Scrambling specifics */
u32 scrambling_sequence_index;
/* ATSC-MH specifics */
u8 atscmh_fic_ver;
u8 atscmh_parade_id;
@ -627,7 +632,6 @@ struct dtv_frontend_properties {
u32 lna;
s32 input;
u32 pls;
/* statistics data */
struct dtv_fe_stats strength;

View File

@ -448,10 +448,7 @@ static int cfg_scrambler(struct mxl *state, u32 gold)
0, 0, 0, 0, 1, 0, 0, 0,
};
if (gold != NO_SCRAMBLING_CODE)
root = gold2root(gold);
else
root = 1;
buf[25] = (root >> 24) & 0xff;
buf[24] = (root >> 16) & 0xff;
buf[23] = (root >> 8) & 0xff;
@ -530,7 +527,7 @@ static int set_parameters(struct dvb_frontend *fe)
demodChanCfg.rollOff = MXL_HYDRA_ROLLOFF_AUTO;
demodChanCfg.modulationScheme = MXL_HYDRA_MOD_AUTO;
demodChanCfg.pilots = MXL_HYDRA_PILOTS_AUTO;
cfg_scrambler(state, p->pls);
cfg_scrambler(state, p->scrambling_sequence_index);
break;
default:
return -EINVAL;

View File

@ -3537,8 +3537,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe, struct dvb_fron
if ((props->stream_id != NO_STREAM_ID_FILTER) &&
(props->stream_id & 0xffffff00))
pls = props->stream_id >> 8;
if (props->pls != NO_SCRAMBLING_CODE)
pls = props->pls | 0x40000; /* props->pls is always gold code */
/* props->scrambling_sequence_index is always gold code */
pls = props->scrambling_sequence_index | 0x40000;
stv090x_set_pls(state, (pls >> 18) & 3, pls & 0x3ffff);
stv090x_set_mis(state, props->stream_id);

View File

@ -893,9 +893,8 @@ static void set_stream_modes(struct stv *state, struct dtv_frontend_properties *
if ((p->stream_id != NO_STREAM_ID_FILTER) &&
(p->stream_id & 0xfffff00))
scrambling_code = 0xfffff & (p->stream_id >> 8);
/* p->pls is always gold code ! */
if (p->pls != NO_SCRAMBLING_CODE)
scrambling_code = p->pls | 0x40000;
/* p->scrambling_sequence_index is always gold code ! */
scrambling_code = p->scrambling_sequence_index | 0x40000;
set_pls(state, scrambling_code);
}
@ -1850,7 +1849,7 @@ struct dvb_frontend *stv0910_attach(struct i2c_adapter *i2c,
state->search_range = 16000000;
state->demod = 0x10; /* Inversion : Auto with reset to 0 */
state->receive_mode = RCVMODE_NONE;
state->cur_scrambling_code = NO_SCRAMBLING_CODE;
state->cur_scrambling_code = 0xffffffff;
state->single = cfg->single ? 1 : 0;
base = match_base(i2c, cfg->adr);

View File

@ -551,10 +551,11 @@ enum fe_interleaving {
#define DTV_STAT_ERROR_BLOCK_COUNT 68
#define DTV_STAT_TOTAL_BLOCK_COUNT 69
#define DTV_INPUT 70
#define DTV_PLS 71
/* Physical layer scrambling */
#define DTV_SCRAMBLING_SEQUENCE_INDEX 70
#define DTV_INPUT 71
#define DTV_MAX_COMMAND DTV_PLS
#define DTV_MAX_COMMAND DTV_INPUT
/**
* enum fe_pilot - Type of pilot tone
@ -739,7 +740,6 @@ enum atscmh_rs_code_mode {
};
#define NO_STREAM_ID_FILTER (~0U)
#define NO_SCRAMBLING_CODE (~0U)
#define LNA_AUTO (~0U)
#define NO_INPUT (~0U)

View File

@ -24,6 +24,6 @@
#define _DVBVERSION_H_
#define DVB_API_VERSION 5
#define DVB_API_VERSION_MINOR 10
#define DVB_API_VERSION_MINOR 11
#endif /*_DVBVERSION_H_*/