TI_STATUS TWD_RegisterCb (TI_HANDLE hTWD, TI_UINT32 event, TTwdCB *fCb, void *pData) { TTwd *pTWD = (TTwd *)hTWD; TI_UINT32 uModuleId = event & TWD_CB_MODULE_OWNER_MASK; TI_UINT32 uCallbackId = event & TWD_CB_TYPE_MASK; /* First detect which module is the owner */ switch (uModuleId) { case TWD_OWNER_TX_HW_QUEUE: txHwQueue_RegisterCb (pTWD->hTxHwQueue, uCallbackId, fCb, pData); break; case TWD_OWNER_DRIVER_TX_XFER: txXfer_RegisterCb (pTWD->hTxXfer, uCallbackId, fCb, pData); break; case TWD_OWNER_TX_RESULT: txResult_RegisterCb (pTWD->hTxResult, uCallbackId, fCb, pData); break; case TWD_OWNER_RX_XFER: rxXfer_Register_CB(pTWD->hRxXfer, uCallbackId, fCb, pData); break; case TWD_OWNER_RX_QUEUE: RxQueue_Register_CB(pTWD->hRxQueue, uCallbackId, fCb, pData); break; case TWD_OWNER_SELF: TWD_RegisterOwnCb (hTWD, uCallbackId, fCb, pData); break; case TWD_OWNER_MAC_SERVICES: switch (uCallbackId) { case TWD_OWN_EVENT_SCAN_CMPLT: MacServices_scanSRV_registerScanCompleteCB (pTWD->hMacServices, (TScanSrvCompleteCb)fCb, pData); break; default: {} } break; case TWD_OWNER_SELF_CONFIG: pTWD->fConfigFwCb = (TTwdCallback)fCb; break; default: {} } return TI_OK; }
TI_STATUS TWD_RegisterScanCompleteCb (TI_HANDLE hTWD, TScanSrvCompleteCb fScanCompleteCb, TI_HANDLE hScanCompleteCb) { TTwd *pTWD = (TTwd *)hTWD; MacServices_scanSRV_registerScanCompleteCB (pTWD->hMacServices, fScanCompleteCb, hScanCompleteCb); return TI_OK; }
/* TNETW_Driver_Register_CB() **************************************************************************** * DESCRIPTION: Register the MAC Services and the HAL modules callbacks * * INPUTS: * * OUTPUT: * * RETURNS: ****************************************************************************/ void TnetwDrv_Register_CB (TI_HANDLE hTnetwDrv,tiUINT32 EventID,void *CBFunc, void *pData) { TnetwDrv_t * pTnetwDrv = (TnetwDrv_t *)hTnetwDrv; WLAN_REPORT_INFORMATION(pTnetwDrv->hReport, TNETW_DRV_MODULE_LOG, ("TnetwDrv_Register_CB (Value = 0x%x)\n", EventID)); /* First detect which module is the owner */ switch((tiUINT16)(EventID & TNETW_DRIVER_CB_MODULE_OWNER_MASK)) { case TNETW_DRIVER_TX_XFER_OWNER: EventID &= TNETW_DRIVER_CB_TYPE_MASK; WLAN_REPORT_INFORMATION(pTnetwDrv->hReport, TNETW_DRV_MODULE_LOG,("TnetwDrv_Register_CB: TNETW_DRIVER_TX_XFER_OWNER\n")); txXfer_RegisterCB(pTnetwDrv->hTxXfer, EventID, CBFunc, pData); break; case TNETW_DRIVER_TX_RESULT_OWNER: EventID &= TNETW_DRIVER_CB_TYPE_MASK; WLAN_REPORT_INFORMATION(pTnetwDrv->hReport, TNETW_DRV_MODULE_LOG,("TnetwDrv_Register_CB: TNETW_DRIVER_TX_RESULT_OWNER\n")); txResult_RegisterCB(pTnetwDrv->hTxResult, EventID, CBFunc, pData); break; case TNETW_DRIVER_RX_XFER_OWNER: EventID &= TNETW_DRIVER_CB_TYPE_MASK; WLAN_REPORT_INFORMATION(pTnetwDrv->hReport, TNETW_DRV_MODULE_LOG,("TnetwDrv_Register_CB: TNETW_DRIVER_RX_XFER_OWNER\n")); rxXfer_Register_CB(pTnetwDrv->hRxXfer, EventID,CBFunc,pData); break; case TNETW_DRIVER_HAL_CTRL_OWNER: EventID &= TNETW_DRIVER_CB_TYPE_MASK; whalCtrl_Register_CB(pTnetwDrv->hHalCtrl, EventID,CBFunc,pData); break; case TNETW_DRIVER_MAC_SERVICES_OWNER: switch (EventID & TNETW_DRIVER_CB_TYPE_MASK) { case HAL_EVENT_SCAN_CMPLT: MacServices_scanSRV_registerScanCompleteCB(pTnetwDrv->hMacServices, (scan_srvCompleteCB_t)CBFunc, pData); break; default: WLAN_REPORT_WARNING(pTnetwDrv->hReport, TNETW_DRV_MODULE_LOG,("TNETW_DRIVER_MAC_SERVICES_OWNER - Illegal value\n")); } break; case TNETW_DRIVER_TWD_OWNER: WLAN_REPORT_INFORMATION(pTnetwDrv->hReport, TNETW_DRV_MODULE_LOG,("TnetwDrv_Register_CB: TNETW_DRIVER_TWD_OWNER\n")); pTnetwDrv->fConfigureCmplteteCB = (TnetDrv_callback_t)CBFunc; pTnetwDrv->hConfigureCompleteOBj = (TI_HANDLE)pData; break; default: if (EventID == HAL_INTERNAL_EVENT_FAILURE) { /* register the Hal failure event callback including the RX in the Hal Cttl the errors are : MBOX_FAILURE, BUS_ERROR, DEVICE_ERROR, DISCONNECT_TIMEOUT,*/ EventID &= TNETW_DRIVER_CB_TYPE_MASK; whalCtrl_Register_CB(pTnetwDrv->hHalCtrl, EventID,CBFunc,pData); /* register the Elp controller failure event callback to the TNET interface HW_AWAKE_FAILURE*/ TNETWIF_RegisterFailureEventCB(pTnetwDrv->hTNETWIF,CBFunc,pData); /* register the Mac services failure events callbacks POWER_SAVE_FAILURE, MEASUREMENT_FAILURE, NO_SCAN_COMPLETE_FAILURE,*/ MacServices_registerFailureEventCB(pTnetwDrv->hMacServices, CBFunc, pData); /* register the TX failure call back in the Xfer TX_STUCK,*/ txXfer_RegisterFailureEventCB(pTnetwDrv->hTxXfer, CBFunc, pData); } else WLAN_REPORT_WARNING(pTnetwDrv->hReport, TNETW_DRV_MODULE_LOG,("TnetwDrv_Register_CB - Illegal value\n")); } return; }