/************************************************************************ * conn_create * ************************************************************************ DESCRIPTION: Connection module creation function, called by the config mgr in creation phase performs the following: - Allocate the connection handle - Create the connection timer - Create the connection state machine INPUT: hOs - Handle to OS OUTPUT: RETURN: Handle to the connection module on success, NULL otherwise ************************************************************************/ TI_HANDLE conn_create(TI_HANDLE hOs) { conn_t *pConn; fsm_stateMachine_t *pFsm; TI_STATUS status; pConn = os_memoryAlloc(hOs, sizeof(conn_t)); if (pConn == NULL) { return NULL; } os_memoryZero (pConn->hOs, pConn, sizeof(conn_t)); /* Creating connection Ibss SM */ status = fsm_Create(hOs, &pFsm, CONN_IBSS_NUM_STATES, CONN_IBSS_NUM_EVENTS); if (status != TI_OK) { release_module(pConn); return NULL; } pConn->ibss_pFsm = pFsm; /* Creating connection Infra SM */ status = fsm_Create(hOs, &pFsm, CONN_INFRA_NUM_STATES, CONN_INFRA_NUM_EVENTS); if (status != TI_OK) { release_module(pConn); return NULL; } pConn->infra_pFsm = pFsm; pConn->hOs = hOs; return(pConn); }
void cleanup_module(void) { int r[4]; /* results */ r[0]=release_module("slave", 1 /* wait */); r[1]=release_module("slaveH", 1 /* wait */); r[2]=delayed_release_module("slaveD"); r[3]=release_module("unexists", 1 /* wait */); printk("master: unloading results are %i, %i, %i, %i\n", r[0],r[1],r[2],r[3]); }
TI_STATUS conn_SetDefaults (TI_HANDLE hConn, connInitParams_t *pConnInitParams) { conn_t *pConn = (conn_t *)hConn; pConn->timeout = pConnInitParams->connSelfTimeout; pConn->connType = CONN_TYPE_FIRST_CONN; pConn->ibssDisconnectCount = 0; /* allocate OS timer memory */ pConn->hConnTimer = tmr_CreateTimer (pConn->hTimer); if (pConn->hConnTimer == NULL) { TRACE0(pConn->hReport, REPORT_SEVERITY_ERROR, "conn_SetDefaults(): Failed to create hConnTimer!\n"); release_module (pConn); return TI_NOK; } TWD_RegisterEvent (pConn->hTWD, TWD_OWN_EVENT_JOIN_CMPLT, (void *)connInfra_JoinCmpltNotification, pConn); TWD_EnableEvent (pConn->hTWD, TWD_OWN_EVENT_JOIN_CMPLT); /* Register for 'TWD_OWN_EVENT_DISCONNECT_COMPLETE' event */ TWD_RegisterEvent (pConn->hTWD, TWD_OWN_EVENT_DISCONNECT_COMPLETE, (void *)conn_DisconnectComplete, pConn); TWD_EnableEvent (pConn->hTWD, TWD_OWN_EVENT_DISCONNECT_COMPLETE); return TI_OK; }
/** * * \b Description: * * This procedure is called by the config manager when the driver is created. * It creates the SwitchChannel object. * * \b ARGS: * * I - hOs - OS context \n * * \b RETURNS: * * Handle to the SwitchChannel object. * * \sa */ TI_HANDLE switchChannel_create(TI_HANDLE hOs) { switchChannel_t *pSwitchChannel = NULL; TI_UINT32 initVec = 0; TI_STATUS status; /* allocating the SwitchChannel object */ pSwitchChannel = os_memoryAlloc(hOs,sizeof(switchChannel_t)); if (pSwitchChannel == NULL) return NULL; initVec |= (1 << SC_INIT_BIT); os_memoryZero(hOs, pSwitchChannel, sizeof(switchChannel_t)); pSwitchChannel->hOs = hOs; status = fsm_Create(hOs, &pSwitchChannel->pSwitchChannelSm, SC_NUM_STATES, SC_NUM_EVENTS); if (status != TI_OK) { release_module(pSwitchChannel, initVec); WLAN_OS_REPORT(("FATAL ERROR: switchChannel_create(): Error Creating pSwitchChannelSm - Aborting\n")); return NULL; } initVec |= (1 << SC_SM_INIT_BIT); return(pSwitchChannel); }
/************************************************************************ * RequestHandler_destroy * ************************************************************************ DESCRIPTION: RequestHandler module destroy function, called by the config mgr in the destroy phase performs the following: - Free all memory aloocated by the module INPUT: hRequestHandler - RequestHandler handle. OUTPUT: RETURN: TI_OK on success, TI_NOK otherwise ************************************************************************/ TI_STATUS requestHandler_destroy(TI_HANDLE hRequestHandler) { requestHandler_t * pRequestHandler = (requestHandler_t *)hRequestHandler; TI_UINT32 initVec; if (pRequestHandler == NULL) return TI_OK; initVec = 0xFFFF; release_module(pRequestHandler, initVec); return TI_OK; }
/************************************************************************ * conn_unLoad * ************************************************************************ DESCRIPTION: Connection module unload function, called by the config mgr in the unlod phase performs the following: - Free all memory aloocated by the module INPUT: hConn - Connection handle. OUTPUT: RETURN: TI_OK on success, TI_NOK otherwise ************************************************************************/ TI_STATUS conn_unLoad(TI_HANDLE hConn) { conn_t *pConn = (conn_t *)hConn; if (!pConn) { return TI_OK; } release_module(pConn); return TI_OK; }
/** * * \b Description: * * This procedure is called by the config manager when the driver is unloaded. * It frees any memory allocated and timers. * * \b ARGS: * * I - hSwitchChannel - SwitchChannel context \n * * \b RETURNS: * * TI_OK on success, TI_NOK otherwise * * \sa */ TI_STATUS switchChannel_unload(TI_HANDLE hSwitchChannel) { TI_UINT32 initVec; switchChannel_t *pSwitchChannel = (switchChannel_t *)hSwitchChannel; if (pSwitchChannel == NULL) return TI_OK; initVec = 0xff; release_module(pSwitchChannel, initVec); return TI_OK; }
static WORD32 StratDeinstall(RP __far* rp) #pragma on (unreferenced) { release_module("tda9875"); release_module("tda7432"); release_module("msp3400"); release_module("tuner"); release_module("tvaudio"); release_module("bttv"); return RPDONE; }
//------------------------------- StratShutdown -------------------------------- static WORD32 StratShutdown(RP __far* _rp) { RPShutdown __far *rp=(RPShutdown __far *)_rp; if(rp->Function==0) { release_module("tda9875"); release_module("tda7432"); release_module("msp3400"); release_module("tuner"); release_module("tvaudio"); release_module("bttv"); } return RPDONE; }