Lines Matching refs:st
66 struct mod_state_hapn48 *st = (struct mod_state_hapn48 *)(&sm->m); in modulator_hapn4800_10_u8() local
69 if (!st->tx_seq++) { in modulator_hapn4800_10_u8()
70 if (st->shreg <= 1) in modulator_hapn4800_10_u8()
71 st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; in modulator_hapn4800_10_u8()
72 st->tx_bit = ((st->tx_bit << 1) | in modulator_hapn4800_10_u8()
73 (st->tx_bit & 1)); in modulator_hapn4800_10_u8()
74 st->tx_bit ^= (!(st->shreg & 1)); in modulator_hapn4800_10_u8()
75 st->shreg >>= 1; in modulator_hapn4800_10_u8()
76 st->tbl = hapn48_txfilt_10 + (st->tx_bit & 0xf); in modulator_hapn4800_10_u8()
78 if (st->tx_seq >= 10) in modulator_hapn4800_10_u8()
79 st->tx_seq = 0; in modulator_hapn4800_10_u8()
80 *buf = *st->tbl; in modulator_hapn4800_10_u8()
81 st->tbl += 0x10; in modulator_hapn4800_10_u8()
89 struct mod_state_hapn48 *st = (struct mod_state_hapn48 *)(&sm->m); in modulator_hapn4800_10_s16() local
92 if (!st->tx_seq++) { in modulator_hapn4800_10_s16()
93 if (st->shreg <= 1) in modulator_hapn4800_10_s16()
94 st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; in modulator_hapn4800_10_s16()
95 st->tx_bit = ((st->tx_bit << 1) | in modulator_hapn4800_10_s16()
96 (st->tx_bit & 1)); in modulator_hapn4800_10_s16()
97 st->tx_bit ^= (!(st->shreg & 1)); in modulator_hapn4800_10_s16()
98 st->shreg >>= 1; in modulator_hapn4800_10_s16()
99 st->tbl = hapn48_txfilt_10 + (st->tx_bit & 0xf); in modulator_hapn4800_10_s16()
101 if (st->tx_seq >= 10) in modulator_hapn4800_10_s16()
102 st->tx_seq = 0; in modulator_hapn4800_10_s16()
103 *buf = ((*st->tbl)-0x80)<<8; in modulator_hapn4800_10_s16()
104 st->tbl += 0x10; in modulator_hapn4800_10_s16()
112 struct mod_state_hapn48 *st = (struct mod_state_hapn48 *)(&sm->m); in modulator_hapn4800_8_u8() local
115 if (!st->tx_seq++) { in modulator_hapn4800_8_u8()
116 if (st->shreg <= 1) in modulator_hapn4800_8_u8()
117 st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; in modulator_hapn4800_8_u8()
118 st->tx_bit = (st->tx_bit << 1) | (st->tx_bit & 1); in modulator_hapn4800_8_u8()
119 st->tx_bit ^= !(st->shreg & 1); in modulator_hapn4800_8_u8()
120 st->shreg >>= 1; in modulator_hapn4800_8_u8()
121 st->tbl = hapn48_txfilt_8 + (st->tx_bit & 0xf); in modulator_hapn4800_8_u8()
123 if (st->tx_seq >= 8) in modulator_hapn4800_8_u8()
124 st->tx_seq = 0; in modulator_hapn4800_8_u8()
125 *buf = *st->tbl; in modulator_hapn4800_8_u8()
126 st->tbl += 0x10; in modulator_hapn4800_8_u8()
134 struct mod_state_hapn48 *st = (struct mod_state_hapn48 *)(&sm->m); in modulator_hapn4800_8_s16() local
137 if (!st->tx_seq++) { in modulator_hapn4800_8_s16()
138 if (st->shreg <= 1) in modulator_hapn4800_8_s16()
139 st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; in modulator_hapn4800_8_s16()
140 st->tx_bit = (st->tx_bit << 1) | (st->tx_bit & 1); in modulator_hapn4800_8_s16()
141 st->tx_bit ^= !(st->shreg & 1); in modulator_hapn4800_8_s16()
142 st->shreg >>= 1; in modulator_hapn4800_8_s16()
143 st->tbl = hapn48_txfilt_8 + (st->tx_bit & 0xf); in modulator_hapn4800_8_s16()
145 if (st->tx_seq >= 8) in modulator_hapn4800_8_s16()
146 st->tx_seq = 0; in modulator_hapn4800_8_s16()
147 *buf = ((*st->tbl)-0x80)<<8; in modulator_hapn4800_8_s16()
148 st->tbl += 0x10; in modulator_hapn4800_8_s16()
156 struct mod_state_hapn48 *st = (struct mod_state_hapn48 *)(&sm->m); in modulator_hapn4800_pm10_u8() local
159 if (!st->tx_seq++) { in modulator_hapn4800_pm10_u8()
160 if (st->shreg <= 1) in modulator_hapn4800_pm10_u8()
161 st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; in modulator_hapn4800_pm10_u8()
162 st->tx_bit = ((st->tx_bit << 1) | in modulator_hapn4800_pm10_u8()
163 (st->tx_bit & 1)); in modulator_hapn4800_pm10_u8()
164 st->tx_bit ^= (!(st->shreg & 1)); in modulator_hapn4800_pm10_u8()
165 st->shreg >>= 1; in modulator_hapn4800_pm10_u8()
166 st->tbl = hapn48_txfilt_pm10 + (st->tx_bit & 0xf); in modulator_hapn4800_pm10_u8()
168 if (st->tx_seq >= 10) in modulator_hapn4800_pm10_u8()
169 st->tx_seq = 0; in modulator_hapn4800_pm10_u8()
170 *buf = *st->tbl; in modulator_hapn4800_pm10_u8()
171 st->tbl += 0x10; in modulator_hapn4800_pm10_u8()
179 struct mod_state_hapn48 *st = (struct mod_state_hapn48 *)(&sm->m); in modulator_hapn4800_pm10_s16() local
182 if (!st->tx_seq++) { in modulator_hapn4800_pm10_s16()
183 if (st->shreg <= 1) in modulator_hapn4800_pm10_s16()
184 st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; in modulator_hapn4800_pm10_s16()
185 st->tx_bit = ((st->tx_bit << 1) | in modulator_hapn4800_pm10_s16()
186 (st->tx_bit & 1)); in modulator_hapn4800_pm10_s16()
187 st->tx_bit ^= (!(st->shreg & 1)); in modulator_hapn4800_pm10_s16()
188 st->shreg >>= 1; in modulator_hapn4800_pm10_s16()
189 st->tbl = hapn48_txfilt_pm10 + (st->tx_bit & 0xf); in modulator_hapn4800_pm10_s16()
191 if (st->tx_seq >= 10) in modulator_hapn4800_pm10_s16()
192 st->tx_seq = 0; in modulator_hapn4800_pm10_s16()
193 *buf = ((*st->tbl)-0x80)<<8; in modulator_hapn4800_pm10_s16()
194 st->tbl += 0x10; in modulator_hapn4800_pm10_s16()
202 struct mod_state_hapn48 *st = (struct mod_state_hapn48 *)(&sm->m); in modulator_hapn4800_pm8_u8() local
205 if (!st->tx_seq++) { in modulator_hapn4800_pm8_u8()
206 if (st->shreg <= 1) in modulator_hapn4800_pm8_u8()
207 st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; in modulator_hapn4800_pm8_u8()
208 st->tx_bit = (st->tx_bit << 1) | (st->tx_bit & 1); in modulator_hapn4800_pm8_u8()
209 st->tx_bit ^= !(st->shreg & 1); in modulator_hapn4800_pm8_u8()
210 st->shreg >>= 1; in modulator_hapn4800_pm8_u8()
211 st->tbl = hapn48_txfilt_pm8 + (st->tx_bit & 0xf); in modulator_hapn4800_pm8_u8()
213 if (st->tx_seq >= 8) in modulator_hapn4800_pm8_u8()
214 st->tx_seq = 0; in modulator_hapn4800_pm8_u8()
215 *buf = *st->tbl; in modulator_hapn4800_pm8_u8()
216 st->tbl += 0x10; in modulator_hapn4800_pm8_u8()
224 struct mod_state_hapn48 *st = (struct mod_state_hapn48 *)(&sm->m); in modulator_hapn4800_pm8_s16() local
227 if (!st->tx_seq++) { in modulator_hapn4800_pm8_s16()
228 if (st->shreg <= 1) in modulator_hapn4800_pm8_s16()
229 st->shreg = hdlcdrv_getbits(&sm->hdrv) | 0x10000; in modulator_hapn4800_pm8_s16()
230 st->tx_bit = (st->tx_bit << 1) | (st->tx_bit & 1); in modulator_hapn4800_pm8_s16()
231 st->tx_bit ^= !(st->shreg & 1); in modulator_hapn4800_pm8_s16()
232 st->shreg >>= 1; in modulator_hapn4800_pm8_s16()
233 st->tbl = hapn48_txfilt_pm8 + (st->tx_bit & 0xf); in modulator_hapn4800_pm8_s16()
235 if (st->tx_seq >= 8) in modulator_hapn4800_pm8_s16()
236 st->tx_seq = 0; in modulator_hapn4800_pm8_s16()
237 *buf = ((*st->tbl)-0x80)<<8; in modulator_hapn4800_pm8_s16()
238 st->tbl += 0x10; in modulator_hapn4800_pm8_s16()
246 struct demod_state_hapn48 *st = (struct demod_state_hapn48 *)(&sm->d); in demodulator_hapn4800_10_u8() local
253 st->lvlhi = (st->lvlhi * 65309) >> 16; /* decay */ in demodulator_hapn4800_10_u8()
254 st->lvllo = (st->lvllo * 65309) >> 16; /* decay */ in demodulator_hapn4800_10_u8()
255 if (inv > st->lvlhi) in demodulator_hapn4800_10_u8()
256 st->lvlhi = inv; in demodulator_hapn4800_10_u8()
257 if (inv < st->lvllo) in demodulator_hapn4800_10_u8()
258 st->lvllo = inv; in demodulator_hapn4800_10_u8()
260 st->dcd_shreg <<= 1; in demodulator_hapn4800_10_u8()
261 st->bit_pll += 0x199a; in demodulator_hapn4800_10_u8()
263 if (inv > st->lvlhi >> 1) { in demodulator_hapn4800_10_u8()
267 } else if (inv < st->lvllo >> 1) { in demodulator_hapn4800_10_u8()
273 st->dcd_shreg |= cursync; in demodulator_hapn4800_10_u8()
274 st->bit_pll += pll_corr[((st->bit_pll - 0x8000u) & 0xffffu) < 0x8ccdu]; in demodulator_hapn4800_10_u8()
275 st->dcd_sum0 += 16 * hweight32(st->dcd_shreg & 0x18c6318c) - in demodulator_hapn4800_10_u8()
276 hweight32(st->dcd_shreg & 0xe739ce70); in demodulator_hapn4800_10_u8()
279 if ((--st->dcd_time) <= 0) { in demodulator_hapn4800_10_u8()
280 hdlcdrv_setdcd(&sm->hdrv, (st->dcd_sum0 + in demodulator_hapn4800_10_u8()
281 st->dcd_sum1 + in demodulator_hapn4800_10_u8()
282 st->dcd_sum2) < 0); in demodulator_hapn4800_10_u8()
283 st->dcd_sum2 = st->dcd_sum1; in demodulator_hapn4800_10_u8()
284 st->dcd_sum1 = st->dcd_sum0; in demodulator_hapn4800_10_u8()
285 st->dcd_sum0 = 2; /* slight bias */ in demodulator_hapn4800_10_u8()
286 st->dcd_time = 240; in demodulator_hapn4800_10_u8()
288 if (st->bit_pll >= 0x10000) { in demodulator_hapn4800_10_u8()
289 st->bit_pll &= 0xffff; in demodulator_hapn4800_10_u8()
290 st->last_bit2 = st->last_bit; in demodulator_hapn4800_10_u8()
292 st->last_bit = 0; in demodulator_hapn4800_10_u8()
294 st->last_bit = 1; in demodulator_hapn4800_10_u8()
295 st->shreg >>= 1; in demodulator_hapn4800_10_u8()
296 st->shreg |= ((st->last_bit ^ st->last_bit2 ^ 1) & 1) << 16; in demodulator_hapn4800_10_u8()
297 if (st->shreg & 1) { in demodulator_hapn4800_10_u8()
298 hdlcdrv_putbits(&sm->hdrv, st->shreg >> 1); in demodulator_hapn4800_10_u8()
299 st->shreg = 0x10000; in demodulator_hapn4800_10_u8()
311 struct demod_state_hapn48 *st = (struct demod_state_hapn48 *)(&sm->d); in demodulator_hapn4800_10_s16() local
318 st->lvlhi = (st->lvlhi * 65309) >> 16; /* decay */ in demodulator_hapn4800_10_s16()
319 st->lvllo = (st->lvllo * 65309) >> 16; /* decay */ in demodulator_hapn4800_10_s16()
320 if (inv > st->lvlhi) in demodulator_hapn4800_10_s16()
321 st->lvlhi = inv; in demodulator_hapn4800_10_s16()
322 if (inv < st->lvllo) in demodulator_hapn4800_10_s16()
323 st->lvllo = inv; in demodulator_hapn4800_10_s16()
325 st->dcd_shreg <<= 1; in demodulator_hapn4800_10_s16()
326 st->bit_pll += 0x199a; in demodulator_hapn4800_10_s16()
328 if (inv > st->lvlhi >> 1) { in demodulator_hapn4800_10_s16()
332 } else if (inv < st->lvllo >> 1) { in demodulator_hapn4800_10_s16()
338 st->dcd_shreg |= cursync; in demodulator_hapn4800_10_s16()
339 st->bit_pll += pll_corr[((st->bit_pll - 0x8000u) & 0xffffu) < 0x8ccdu]; in demodulator_hapn4800_10_s16()
340 st->dcd_sum0 += 16 * hweight32(st->dcd_shreg & 0x18c6318c) - in demodulator_hapn4800_10_s16()
341 hweight32(st->dcd_shreg & 0xe739ce70); in demodulator_hapn4800_10_s16()
344 if ((--st->dcd_time) <= 0) { in demodulator_hapn4800_10_s16()
345 hdlcdrv_setdcd(&sm->hdrv, (st->dcd_sum0 + in demodulator_hapn4800_10_s16()
346 st->dcd_sum1 + in demodulator_hapn4800_10_s16()
347 st->dcd_sum2) < 0); in demodulator_hapn4800_10_s16()
348 st->dcd_sum2 = st->dcd_sum1; in demodulator_hapn4800_10_s16()
349 st->dcd_sum1 = st->dcd_sum0; in demodulator_hapn4800_10_s16()
350 st->dcd_sum0 = 2; /* slight bias */ in demodulator_hapn4800_10_s16()
351 st->dcd_time = 240; in demodulator_hapn4800_10_s16()
353 if (st->bit_pll >= 0x10000) { in demodulator_hapn4800_10_s16()
354 st->bit_pll &= 0xffff; in demodulator_hapn4800_10_s16()
355 st->last_bit2 = st->last_bit; in demodulator_hapn4800_10_s16()
357 st->last_bit = 0; in demodulator_hapn4800_10_s16()
359 st->last_bit = 1; in demodulator_hapn4800_10_s16()
360 st->shreg >>= 1; in demodulator_hapn4800_10_s16()
361 st->shreg |= ((st->last_bit ^ st->last_bit2 ^ 1) & 1) << 16; in demodulator_hapn4800_10_s16()
362 if (st->shreg & 1) { in demodulator_hapn4800_10_s16()
363 hdlcdrv_putbits(&sm->hdrv, st->shreg >> 1); in demodulator_hapn4800_10_s16()
364 st->shreg = 0x10000; in demodulator_hapn4800_10_s16()
376 struct demod_state_hapn48 *st = (struct demod_state_hapn48 *)(&sm->d); in demodulator_hapn4800_8_u8() local
383 st->lvlhi = (st->lvlhi * 65309) >> 16; /* decay */ in demodulator_hapn4800_8_u8()
384 st->lvllo = (st->lvllo * 65309) >> 16; /* decay */ in demodulator_hapn4800_8_u8()
385 if (inv > st->lvlhi) in demodulator_hapn4800_8_u8()
386 st->lvlhi = inv; in demodulator_hapn4800_8_u8()
387 if (inv < st->lvllo) in demodulator_hapn4800_8_u8()
388 st->lvllo = inv; in demodulator_hapn4800_8_u8()
390 st->dcd_shreg <<= 1; in demodulator_hapn4800_8_u8()
391 st->bit_pll += 0x2000; in demodulator_hapn4800_8_u8()
393 if (inv > st->lvlhi >> 1) { in demodulator_hapn4800_8_u8()
397 } else if (inv < st->lvllo >> 1) { in demodulator_hapn4800_8_u8()
403 st->dcd_shreg |= cursync; in demodulator_hapn4800_8_u8()
404 st->bit_pll += pll_corr[((st->bit_pll - 0x8000u) & 0xffffu) < 0x9000u]; in demodulator_hapn4800_8_u8()
405 st->dcd_sum0 += 16 * hweight32(st->dcd_shreg & 0x44444444) - in demodulator_hapn4800_8_u8()
406 hweight32(st->dcd_shreg & 0xbbbbbbbb); in demodulator_hapn4800_8_u8()
409 if ((--st->dcd_time) <= 0) { in demodulator_hapn4800_8_u8()
410 hdlcdrv_setdcd(&sm->hdrv, (st->dcd_sum0 + in demodulator_hapn4800_8_u8()
411 st->dcd_sum1 + in demodulator_hapn4800_8_u8()
412 st->dcd_sum2) < 0); in demodulator_hapn4800_8_u8()
413 st->dcd_sum2 = st->dcd_sum1; in demodulator_hapn4800_8_u8()
414 st->dcd_sum1 = st->dcd_sum0; in demodulator_hapn4800_8_u8()
415 st->dcd_sum0 = 2; /* slight bias */ in demodulator_hapn4800_8_u8()
416 st->dcd_time = 240; in demodulator_hapn4800_8_u8()
418 if (st->bit_pll >= 0x10000) { in demodulator_hapn4800_8_u8()
419 st->bit_pll &= 0xffff; in demodulator_hapn4800_8_u8()
420 st->last_bit2 = st->last_bit; in demodulator_hapn4800_8_u8()
422 st->last_bit = 0; in demodulator_hapn4800_8_u8()
424 st->last_bit = 1; in demodulator_hapn4800_8_u8()
425 st->shreg >>= 1; in demodulator_hapn4800_8_u8()
426 st->shreg |= ((st->last_bit ^ st->last_bit2 ^ 1) & 1) << 16; in demodulator_hapn4800_8_u8()
427 if (st->shreg & 1) { in demodulator_hapn4800_8_u8()
428 hdlcdrv_putbits(&sm->hdrv, st->shreg >> 1); in demodulator_hapn4800_8_u8()
429 st->shreg = 0x10000; in demodulator_hapn4800_8_u8()
441 struct demod_state_hapn48 *st = (struct demod_state_hapn48 *)(&sm->d); in demodulator_hapn4800_8_s16() local
448 st->lvlhi = (st->lvlhi * 65309) >> 16; /* decay */ in demodulator_hapn4800_8_s16()
449 st->lvllo = (st->lvllo * 65309) >> 16; /* decay */ in demodulator_hapn4800_8_s16()
450 if (inv > st->lvlhi) in demodulator_hapn4800_8_s16()
451 st->lvlhi = inv; in demodulator_hapn4800_8_s16()
452 if (inv < st->lvllo) in demodulator_hapn4800_8_s16()
453 st->lvllo = inv; in demodulator_hapn4800_8_s16()
455 st->dcd_shreg <<= 1; in demodulator_hapn4800_8_s16()
456 st->bit_pll += 0x2000; in demodulator_hapn4800_8_s16()
458 if (inv > st->lvlhi >> 1) { in demodulator_hapn4800_8_s16()
462 } else if (inv < st->lvllo >> 1) { in demodulator_hapn4800_8_s16()
468 st->dcd_shreg |= cursync; in demodulator_hapn4800_8_s16()
469 st->bit_pll += pll_corr[((st->bit_pll - 0x8000u) & 0xffffu) < 0x9000u]; in demodulator_hapn4800_8_s16()
470 st->dcd_sum0 += 16 * hweight32(st->dcd_shreg & 0x44444444) - in demodulator_hapn4800_8_s16()
471 hweight32(st->dcd_shreg & 0xbbbbbbbb); in demodulator_hapn4800_8_s16()
474 if ((--st->dcd_time) <= 0) { in demodulator_hapn4800_8_s16()
475 hdlcdrv_setdcd(&sm->hdrv, (st->dcd_sum0 + in demodulator_hapn4800_8_s16()
476 st->dcd_sum1 + in demodulator_hapn4800_8_s16()
477 st->dcd_sum2) < 0); in demodulator_hapn4800_8_s16()
478 st->dcd_sum2 = st->dcd_sum1; in demodulator_hapn4800_8_s16()
479 st->dcd_sum1 = st->dcd_sum0; in demodulator_hapn4800_8_s16()
480 st->dcd_sum0 = 2; /* slight bias */ in demodulator_hapn4800_8_s16()
481 st->dcd_time = 240; in demodulator_hapn4800_8_s16()
483 if (st->bit_pll >= 0x10000) { in demodulator_hapn4800_8_s16()
484 st->bit_pll &= 0xffff; in demodulator_hapn4800_8_s16()
485 st->last_bit2 = st->last_bit; in demodulator_hapn4800_8_s16()
487 st->last_bit = 0; in demodulator_hapn4800_8_s16()
489 st->last_bit = 1; in demodulator_hapn4800_8_s16()
490 st->shreg >>= 1; in demodulator_hapn4800_8_s16()
491 st->shreg |= ((st->last_bit ^ st->last_bit2 ^ 1) & 1) << 16; in demodulator_hapn4800_8_s16()
492 if (st->shreg & 1) { in demodulator_hapn4800_8_s16()
493 hdlcdrv_putbits(&sm->hdrv, st->shreg >> 1); in demodulator_hapn4800_8_s16()
494 st->shreg = 0x10000; in demodulator_hapn4800_8_s16()
506 struct demod_state_hapn48 *st = (struct demod_state_hapn48 *)(&sm->d); in demod_init_hapn4800() local
508 st->dcd_time = 120; in demod_init_hapn4800()
509 st->dcd_sum0 = 2; in demod_init_hapn4800()