/*! ****************************************************************************** @Function dmankm_fnProcessLostCb ******************************************************************************/ static IMG_VOID dmankm_fnProcessLostCb(IMG_VOID * pvParam) { DMANKM_sConnContext * psConnContext = pvParam; IMG_HANDLE hDevHandle; IMG_UINT32 ui32Result = IMG_SUCCESS; /* Get the device handle...*/ hDevHandle = DMANKM_GetDevHandleFromConn(psConnContext); /* Lock the device...*/ DMANKM_LockDeviceContext(hDevHandle); /* Call on to the kernel function...*/ ui32Result = DMANKM_CloseDevice(hDevHandle, psConnContext, DMAN_DCONN_ABORT); IMG_ASSERT(ui32Result == IMG_SUCCESS); // NOTE: We do not unlock the device as this will be done by // DMANKM_DevDisconnectComplete(). // /* Unlock the device...*/ // DMANKM_UnlockDeviceContext(hDevHandle); }
/*! ****************************************************************************** @Function PALLOC_AttachToConnection ******************************************************************************/ IMG_RESULT PALLOC_AttachToConnection( IMG_UINT32 ui32ConnId, IMG_UINT32 __user * pui32AttachId ) { IMG_HANDLE hDevHandle; IMG_UINT32 ui32Result; IMG_HANDLE hConnHandle; IMG_UINT32 ui32AttachId; LOG_EVENT(PALLOC, PALLOC_ATTACH, (LOG_FLAG_START), 0, 0); /* Get the connection handle from it's ID...*/ ui32Result = DMANKM_GetConnHandleFromId(ui32ConnId, &hConnHandle); IMG_ASSERT(ui32Result == IMG_SUCCESS); if (ui32Result != IMG_SUCCESS) { return ui32Result; } /* Get the device handle from the connection...*/ hDevHandle = DMANKM_GetDevHandleFromConn(hConnHandle); /* Lock the device...*/ DMANKM_LockDeviceContext(hDevHandle); /* Call on to the kernel function...*/ ui32Result = DMANKM_AttachComponent(hConnHandle, "PALLOCBRG", palloc_fnCompAttach, IMG_NULL, &ui32AttachId); IMG_ASSERT(ui32Result == IMG_SUCCESS); /* Unlock the device...*/ DMANKM_UnlockDeviceContext(hDevHandle); SYSOSKM_CopyToUser(pui32AttachId, &ui32AttachId, sizeof(ui32AttachId)); LOG_EVENT(PALLOC, PALLOC_ATTACH, (LOG_FLAG_END), 0, 0); /* Return ui32Result...*/ return ui32Result; }