void dc_start(struct channel *sc) { u32 val; if (!(sc->r.flags & SBE_2T3E3_FLAG_NETWORK_UP)) return; dc_init(sc); /* get actual LOS and OOF status */ switch (sc->p.frame_type) { case SBE_2T3E3_FRAME_TYPE_E3_G751: case SBE_2T3E3_FRAME_TYPE_E3_G832: val = exar7250_read(sc, SBE_2T3E3_FRAMER_REG_E3_RX_CONFIGURATION_STATUS_2); dev_dbg(&sc->pdev->dev, "Start Framer Rx Status = %02X\n", val); sc->s.OOF = val & SBE_2T3E3_FRAMER_VAL_E3_RX_OOF ? 1 : 0; break; case SBE_2T3E3_FRAME_TYPE_T3_CBIT: case SBE_2T3E3_FRAME_TYPE_T3_M13: val = exar7250_read(sc, SBE_2T3E3_FRAMER_REG_T3_RX_CONFIGURATION_STATUS); dev_dbg(&sc->pdev->dev, "Start Framer Rx Status = %02X\n", val); sc->s.OOF = val & SBE_2T3E3_FRAMER_VAL_T3_RX_OOF ? 1 : 0; break; default: break; } cpld_LOS_update(sc); /* start receive and transmit processes */ dc_transmitter_onoff(sc, SBE_2T3E3_ON); dc_receiver_onoff(sc, SBE_2T3E3_ON); /* start interrupts */ dc_start_intr(sc); }
void t3e3_port_set(struct channel *sc, t3e3_param_t *param) { if (param->frame_mode != 0xff) cpld_set_frame_mode(sc, param->frame_mode); if (param->fractional_mode != 0xff) cpld_set_fractional_mode(sc, param->fractional_mode, param->bandwidth_start, param->bandwidth_stop); if (param->pad_count != 0xff) cpld_set_pad_count(sc, param->pad_count); if (param->crc != 0xff) cpld_set_crc(sc, param->crc); if (param->receiver_on != 0xff) dc_receiver_onoff(sc, param->receiver_on); if (param->transmitter_on != 0xff) dc_transmitter_onoff(sc, param->transmitter_on); if (param->frame_type != 0xff) t3e3_set_frame_type(sc, param->frame_type); if (param->panel != 0xff) cpld_select_panel(sc, param->panel); if (param->line_build_out != 0xff) exar7300_line_build_out_onoff(sc, param->line_build_out); if (param->receive_equalization != 0xff) exar7300_receive_equalization_onoff(sc, param->receive_equalization); if (param->transmit_all_ones != 0xff) exar7300_transmit_all_ones_onoff(sc, param->transmit_all_ones); if (param->loopback != 0xff) t3e3_set_loopback(sc, param->loopback); if (param->clock_source != 0xff) cpld_set_clock(sc, param->clock_source); if (param->scrambler != 0xff) cpld_set_scrambler(sc, param->scrambler); }
void dc_stop(struct channel *sc) { int wcnt; /* stop receive and transmit processes */ dc_receiver_onoff(sc, SBE_2T3E3_OFF); dc_transmitter_onoff(sc, SBE_2T3E3_OFF); /* turn off ethernet interrupts */ dc_stop_intr(sc); /* wait to ensure the interrupts have been completed */ for (wcnt = 0; wcnt < MAX_INT_WAIT_CNT; wcnt++) { udelay(5); if (!sc->interrupt_active) break; } if (wcnt >= MAX_INT_WAIT_CNT) dev_warn(&sc->pdev->dev, "SBE 2T3E3: Interrupt active too long\n"); /* clear all receive/transmit data */ dc_drop_descriptor_list(sc); }
void t3e3_set_loopback(struct channel *sc, u32 mode) { u32 tx, rx; if (sc->p.loopback == mode) return; tx = sc->p.transmitter_on; rx = sc->p.receiver_on; if (tx == SBE_2T3E3_ON) dc_transmitter_onoff(sc, SBE_2T3E3_OFF); if (rx == SBE_2T3E3_ON) dc_receiver_onoff(sc, SBE_2T3E3_OFF); switch (sc->p.loopback) { case SBE_2T3E3_LOOPBACK_NONE: break; case SBE_2T3E3_LOOPBACK_ETHERNET: dc_set_loopback(sc, SBE_2T3E3_21143_VAL_LOOPBACK_OFF); break; case SBE_2T3E3_LOOPBACK_FRAMER: exar7250_set_loopback(sc, SBE_2T3E3_FRAMER_VAL_LOOPBACK_OFF); break; case SBE_2T3E3_LOOPBACK_LIU_DIGITAL: case SBE_2T3E3_LOOPBACK_LIU_ANALOG: case SBE_2T3E3_LOOPBACK_LIU_REMOTE: exar7300_set_loopback(sc, SBE_2T3E3_LIU_VAL_LOOPBACK_OFF); break; default: return; } switch (mode) { case SBE_2T3E3_LOOPBACK_NONE: break; case SBE_2T3E3_LOOPBACK_ETHERNET: dc_set_loopback(sc, SBE_2T3E3_21143_VAL_LOOPBACK_INTERNAL); break; case SBE_2T3E3_LOOPBACK_FRAMER: exar7250_set_loopback(sc, SBE_2T3E3_FRAMER_VAL_LOOPBACK_ON); break; case SBE_2T3E3_LOOPBACK_LIU_DIGITAL: exar7300_set_loopback(sc, SBE_2T3E3_LIU_VAL_LOOPBACK_DIGITAL); break; case SBE_2T3E3_LOOPBACK_LIU_ANALOG: exar7300_set_loopback(sc, SBE_2T3E3_LIU_VAL_LOOPBACK_ANALOG); break; case SBE_2T3E3_LOOPBACK_LIU_REMOTE: exar7300_set_loopback(sc, SBE_2T3E3_LIU_VAL_LOOPBACK_REMOTE); break; default: return; } sc->p.loopback = mode; if (tx == SBE_2T3E3_ON) dc_transmitter_onoff(sc, SBE_2T3E3_ON); if (rx == SBE_2T3E3_ON) dc_receiver_onoff(sc, SBE_2T3E3_ON); }