Lines Matching refs:modem
133 } modem; member
209 outb(0x0e | (!!bc->modem.ser12.tx_bit), MCR(dev->base_addr)); in ser12_tx()
210 if (bc->modem.shreg <= 1) in ser12_tx()
211 bc->modem.shreg = 0x10000 | hdlcdrv_getbits(&bc->hdrv); in ser12_tx()
212 bc->modem.ser12.tx_bit = !(bc->modem.ser12.tx_bit ^ in ser12_tx()
213 (bc->modem.shreg & 1)); in ser12_tx()
214 bc->modem.shreg >>= 1; in ser12_tx()
227 bc->modem.ser12.dcd_shreg = (bc->modem.ser12.dcd_shreg << 1) | in ser12_rx()
228 (cur_s != bc->modem.ser12.last_sample); in ser12_rx()
229 bc->modem.ser12.last_sample = cur_s; in ser12_rx()
230 if(bc->modem.ser12.dcd_shreg & 1) { in ser12_rx()
235 dcdspos += ((bc->modem.ser12.dcd_shreg >> 1) & 1); in ser12_rx()
236 if (!(bc->modem.ser12.dcd_shreg & 0x7ffffffe)) in ser12_rx()
238 dcdsneg += ((bc->modem.ser12.dcd_shreg >> 2) & 1); in ser12_rx()
239 dcdsneg += ((bc->modem.ser12.dcd_shreg >> 3) & 1); in ser12_rx()
240 dcdsneg += ((bc->modem.ser12.dcd_shreg >> 4) & 1); in ser12_rx()
242 bc->modem.ser12.dcd_sum0 += 16*dcdspos - dcdsneg; in ser12_rx()
244 bc->modem.ser12.dcd_sum0--; in ser12_rx()
246 if(!bc->modem.ser12.dcd_time) { in ser12_rx()
247 hdlcdrv_setdcd(&bc->hdrv, (bc->modem.ser12.dcd_sum0 + in ser12_rx()
248 bc->modem.ser12.dcd_sum1 + in ser12_rx()
249 bc->modem.ser12.dcd_sum2) < 0); in ser12_rx()
250 bc->modem.ser12.dcd_sum2 = bc->modem.ser12.dcd_sum1; in ser12_rx()
251 bc->modem.ser12.dcd_sum1 = bc->modem.ser12.dcd_sum0; in ser12_rx()
253 bc->modem.ser12.dcd_sum0 = 2; in ser12_rx()
254 bc->modem.ser12.dcd_time = SER12_DCD_INTERVAL(bc); in ser12_rx()
256 bc->modem.ser12.dcd_time--; in ser12_rx()
261 if (bc->modem.ser12.interm_sample) { in ser12_rx()
270 switch (bc->modem.ser12.dcd_shreg & 7) { in ser12_rx()
287 bc->modem.shreg >>= 1; in ser12_rx()
288 if (bc->modem.ser12.last_sample == in ser12_rx()
289 bc->modem.ser12.last_rxbit) in ser12_rx()
290 bc->modem.shreg |= 0x10000; in ser12_rx()
291 bc->modem.ser12.last_rxbit = in ser12_rx()
292 bc->modem.ser12.last_sample; in ser12_rx()
294 if (++bc->modem.ser12.interm_sample >= 3) in ser12_rx()
295 bc->modem.ser12.interm_sample = 0; in ser12_rx()
299 if (bc->modem.ser12.dcd_shreg & 1) { in ser12_rx()
303 dcdspos += ((bc->modem.ser12.dcd_shreg >> 1) & 1); in ser12_rx()
304 dcdspos += (!(bc->modem.ser12.dcd_shreg & 0x7ffffffe)) in ser12_rx()
306 dcdsneg += ((bc->modem.ser12.dcd_shreg >> 2) & 1); in ser12_rx()
307 dcdsneg += ((bc->modem.ser12.dcd_shreg >> 3) & 1); in ser12_rx()
308 dcdsneg += ((bc->modem.ser12.dcd_shreg >> 4) & 1); in ser12_rx()
310 bc->modem.ser12.dcd_sum0 += 16*dcdspos - dcdsneg; in ser12_rx()
316 if (bc->modem.ser12.interm_sample) { in ser12_rx()
325 switch (bc->modem.ser12.dcd_shreg & 3) { in ser12_rx()
342 bc->modem.shreg >>= 1; in ser12_rx()
343 if (bc->modem.ser12.last_sample == in ser12_rx()
344 bc->modem.ser12.last_rxbit) in ser12_rx()
345 bc->modem.shreg |= 0x10000; in ser12_rx()
346 bc->modem.ser12.last_rxbit = in ser12_rx()
347 bc->modem.ser12.last_sample; in ser12_rx()
349 bc->modem.ser12.interm_sample = !bc->modem.ser12.interm_sample; in ser12_rx()
353 bc->modem.ser12.dcd_sum0 -= (bc->modem.ser12.dcd_shreg & 1); in ser12_rx()
356 if (bc->modem.shreg & 1) { in ser12_rx()
357 hdlcdrv_putbits(&bc->hdrv, bc->modem.shreg >> 1); in ser12_rx()
358 bc->modem.shreg = 0x10000; in ser12_rx()
360 if(!bc->modem.ser12.dcd_time) { in ser12_rx()
364 hdlcdrv_setdcd(&bc->hdrv, (bc->modem.ser12.dcd_sum0 + in ser12_rx()
365 bc->modem.ser12.dcd_sum1 + in ser12_rx()
366 bc->modem.ser12.dcd_sum2) < 0); in ser12_rx()
367 bc->modem.ser12.dcd_sum2 = bc->modem.ser12.dcd_sum1; in ser12_rx()
368 bc->modem.ser12.dcd_sum1 = bc->modem.ser12.dcd_sum0; in ser12_rx()
370 bc->modem.ser12.dcd_sum0 = 2; in ser12_rx()
371 bc->modem.ser12.dcd_time = SER12_DCD_INTERVAL(bc); in ser12_rx()
373 bc->modem.ser12.dcd_time--; in ser12_rx()
408 bc->modem.arb_divider--; in ser12_interrupt()
419 if (bc->modem.arb_divider <= 0) { in ser12_interrupt()
420 bc->modem.arb_divider = SER12_ARB_DIVIDER(bc); in ser12_interrupt()
484 memset(&bc->modem, 0, sizeof(bc->modem)); in ser12_open()