/*******************************************************************************
**
**  onuPonTxPowerTimerStateSet
**  ____________________________________________________________________________
**
**  DESCRIPTION: The function enable / disable TX power off timer
**
**  PARAMETERS:  MV_BOOL mode - MV_TRUE  - start timer
**                              MV_FALSE - stop timer
**  OUTPUTS:     None
**
**  RETURNS:     MV_OK or error
**
*******************************************************************************/
MV_STATUS onuPonTxPowerTimerStateSet(MV_BOOL mode)
{
  MV_STATUS rcode = MV_OK;

  if (mode == MV_TRUE)
  {
    onuPonTimerEnable(&(onuPonResourceTbl_s.onuPonTxPwrTimerId));
  }
  else
  {
    onuPonTimerDisable(&(onuPonResourceTbl_s.onuPonTxPwrTimerId));
  }

  return (rcode);
}
Exemplo n.º 2
0
/*******************************************************************************
**
**  onuGponTimerFifoAuditHndl
**  ____________________________________________________________________________
** 
**  DESCRIPTION: The function is called by the GPON PM timer and trigger the
**               GPON handler to execute SW FIFO Audit
**               
**  PARAMETERS:  unsigned long data
**
**  OUTPUTS:     None
**
**  RETURNS:     None 
**
*******************************************************************************/
void onuGponTimerFifoAuditHndl(unsigned long data)
{
  unsigned long flags;
  /* Lock GPON interrupt */
  spin_lock_irqsave(&onuPonIrqLock, flags);

  onuPonResourceTbl_s.onuPonSwFIFOTimerId.onuPonTimerActive = ONU_PON_TIMER_NOT_ACTIVE;

  /* Call PM handler */
  mvOnuGponFifoAuditTimerExpireHndl();

  if ((onuPonResourceTbl_s.onuPonSwFIFOTimerId.onuPonTimerPeriodic) != 0) 
    onuPonTimerEnable(&(onuPonResourceTbl_s.onuPonSwFIFOTimerId));

  /* Unlock GPON interrupt */
  spin_unlock_irqrestore(&onuPonIrqLock, flags);
}
Exemplo n.º 3
0
/*******************************************************************************
**
**  onuEponOperate
**  ____________________________________________________________________________
** 
**  DESCRIPTION: The function execute onu operate init sequence
**               
**  PARAMETERS:  None
**
**  OUTPUTS:     None
**
**  RETURNS:     MV_OK or error
**           
*******************************************************************************/
MV_STATUS onuEponOperate(void)
{
  MV_STATUS status;
  MV_U32    interruptMask;

  /* enable onu pon interrupt mask */
  interruptMask = (ONU_EPON_INTERRUPTS);
  interruptMask &= ~(ONU_EPON_TIMESTAMP_VALUE_MATCH_MASK);
  status = mvOnuEponMacPonInterruptMaskSet(interruptMask);
  if (status != MV_OK)
  {
    mvPonPrint(PON_PRINT_ERROR, PON_INIT_MODULE,
               "ERROR: (%s:%d) Enable PON interrupt mask\n\r", __FILE_DESC__, __LINE__);
    return(status);
  }


  /* Enable MAC */
  status = mvOnuEponMacOnuRxEnableSet(ONU_RX_EN);
  if (status != MV_OK)
  {
    mvPonPrint(PON_PRINT_ERROR, PON_INIT_MODULE,
               "ERROR: (%s:%d) mvOnuEponMacOnuRxEnableSet\n\r", __FILE_DESC__, __LINE__);
    return(MV_ERROR);
  }
 
  status = mvOnuEponMacOnuTxEnableSet(ONU_TX_EN, 0);
  if (status != MV_OK)
  {
    mvPonPrint(PON_PRINT_ERROR, PON_INIT_MODULE,
               "ERROR: (%s:%d) mvOnuEponMacOnuTxEnableSet\n\r", __FILE_DESC__, __LINE__);
    return(MV_ERROR);
  }

  status  = asicOntMiscRegWrite(mvAsicReg_PON_SERDES_PHY_CTRL_1_BEN_IO_EN, ONU_PHY_OUTPUT, 0); 
  if (status != MV_OK)
  {
	mvPonPrint(PON_PRINT_ERROR, PON_INIT_MODULE,
	  		 "ERROR: (%s:%d) mvOnuEponMacOnuIOEnable\n\r", __FILE_DESC__, __LINE__);
	return(MV_ERROR);
  }

  /* start onu pon pon pm timer */
  onuPonTimerEnable(&(onuPonResourceTbl_s.onuPonPmTimerId));

  /* start onu pon pon mpc timer */
  onuPonTimerEnable(&(onuPonResourceTbl_s.onuPonMpcpTimerId));

  if (onuEponDbOnuSwRprtTimerTypeGet() == ONU_EPON_HW_DBA_RPRT_TIMER)
  {
    /* start onu pon pon tx module timer */
    onuPonTimerEnable(&(onuPonResourceTbl_s.onuPonHwRprtTxModTimerId));

    /* Enable DBA Report message handling */
	onuEponIsrTimerHwReportStateSet(MV_TRUE, /* Enable */
									dbaRprtT0StateVal,
									dbaRprtT0StateInterval,
									dbaRprtT1StateVal,
									dbaRprtT1StateInterval);

  }

  return(MV_OK);
}