/***************************************************************************** * * FwMainStateMachine - general ASF timer * * Description: * * Returns: * Always 0 */ void FwMainStateMachine( SK_AC *pAC, /* Pointer to adapter context */ SK_IOC IoC) /* IO context handle */ { SK_EVPARA EventParam; SK_DBG_MSG(pAC, SK_DBGMOD_ASF, SK_DBGCAT_INIT, ("%s: FwMainStateMachine() called!\n", SK_DRV_NAME)); if (pAC->FwApp.GlHciState == 0) { /* idle */ SK_MEMSET((char *)&EventParam, 0, sizeof(EventParam)); SkTimerStart(pAC, IoC, &pAC->FwApp.AsfTimer, 1000000, SKGE_ASF, SK_ASF_EVT_TIMER_EXPIRED, EventParam); } else { SK_MEMSET((char *)&EventParam, 0, sizeof(EventParam)); SkTimerStart(pAC, IoC, &pAC->FwApp.AsfTimer, 30000, SKGE_ASF, SK_ASF_EVT_TIMER_EXPIRED, EventParam); } return; } /* FwMainStateMachine */
void SkDimStartModerationTimer(SK_AC *pAC) { SK_EVPARA EventParam; /* Event struct for timer event */ SK_MEMSET((char *) &EventParam, 0, sizeof(EventParam)); EventParam.Para32[0] = SK_DRV_MODERATION_TIMER; SkTimerStart(pAC, pAC->IoBase, &pAC->DynIrqModInfo.ModTimer, SK_DRV_MODERATION_TIMER_LENGTH, SKGE_DRV, SK_DRV_TIMER, EventParam); }
/****************************************************************************** * * SkCsEvent - the CSUM event dispatcher * * Description: * This is the event handler for the CSUM module. * * Arguments: * pAc - Pointer to adapter context. * * Ioc - I/O context. * * Event - Event id. * * Param - Event dependent parameter. * * Returns: * 0 (Success) */ int SkCsEvent( SK_AC *pAc, /* Pointer to adapter context. */ SK_IOC Ioc, /* I/O context. */ SK_U32 Event, /* Event id. */ SK_EVPARA Param) /* Event dependent parameter. */ { int ProtoIndex; int NetNumber; switch (Event) { /* * Clear protocol statistics. * * Param - Protocol index, or -1 for all protocols. * - Net number. */ case SK_CSUM_EVENT_CLEAR_PROTO_STATS: ProtoIndex = (int)Param.Para32[1]; NetNumber = (int)Param.Para32[0]; if (ProtoIndex < 0) { /* Clear for all protocols. */ if (NetNumber >= 0) { SK_MEMSET(&pAc->Csum.ProtoStats[NetNumber][0], 0, sizeof(pAc->Csum.ProtoStats[NetNumber])); } } else { /* Clear for individual protocol. */ SK_MEMSET(&pAc->Csum.ProtoStats[NetNumber][ProtoIndex], 0, sizeof(pAc->Csum.ProtoStats[NetNumber][ProtoIndex])); } break; default: break; } return (0); /* Success. */ } /* SkCsEvent */
/***************************************************************************** * * @brief This function initializes the FW application * code at level 0. * * @param pAC Pointer to adapter context * @param IoC IO context handle * @return SK_TRUE or SK_FALSE */ int FwAppInit0(SK_AC *pAC, SK_IOC IoC) { int RetCode = SK_ASF_PNMI_ERR_OK; SK_DBG_MSG(pAC, SK_DBGMOD_ASF, SK_DBGCAT_INIT, ("%s: FwAppInit0 ==>\n", SK_DRV_NAME)); /* Set structure to zero */ SK_MEMSET((char *)&(pAC->FwApp), 0, sizeof(SK_FWAPP)); pAC->FwApp.ActivePort = 0; pAC->FwApp.DualMode = SK_GEASF_Y2_SINGLEPORT; pAC->FwApp.OpMode = SK_GEASF_MODE_UNKNOWN; pAC->FwApp.ChipMode = SK_GEASF_CHIP_UNKNOWN; pAC->FwApp.InitState = ASF_INIT_UNDEFINED; pAC->RamAddr = 0; pAC->RamSelect = 0; SK_DBG_MSG(pAC, SK_DBGMOD_ASF, SK_DBGCAT_INIT, ("%s: FwAppInit0 <==\n", SK_DRV_NAME)); return RetCode; } /* FwAppInit0 */