oct612x: Implement the SerializationObject callbacks.
When originally implemented, the octasic calls where protected by the big kernel lock. This change now allows the octasic library to control it's synchronization as originally intended. It would still be worthwhile to completely make the oct612x library kernel-compliant. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
This commit is contained in:
parent
b4941f35ad
commit
d1afa1b101
@ -129,7 +129,7 @@ $Octasic_Revision: 16 $
|
|||||||
/***************************** TYPES ***************************************/
|
/***************************** TYPES ***************************************/
|
||||||
|
|
||||||
/*Change this type if your platform uses 64bits semaphores/locks */
|
/*Change this type if your platform uses 64bits semaphores/locks */
|
||||||
typedef UINT32 tOCT6100_USER_SERIAL_OBJECT;
|
typedef void* tOCT6100_USER_SERIAL_OBJECT;
|
||||||
|
|
||||||
typedef struct _OCT6100_GET_TIME_
|
typedef struct _OCT6100_GET_TIME_
|
||||||
{
|
{
|
||||||
|
@ -59,29 +59,38 @@ UINT32 Oct6100UserMemCopy(PVOID f_pDestination, const void *f_pSource,
|
|||||||
UINT32 Oct6100UserCreateSerializeObject(
|
UINT32 Oct6100UserCreateSerializeObject(
|
||||||
tPOCT6100_CREATE_SERIALIZE_OBJECT f_pCreate)
|
tPOCT6100_CREATE_SERIALIZE_OBJECT f_pCreate)
|
||||||
{
|
{
|
||||||
|
struct oct612x_context *context = f_pCreate->pProcessContext;
|
||||||
|
struct mutex *lock = kzalloc(sizeof(*lock), GFP_KERNEL);
|
||||||
|
if (!lock) {
|
||||||
|
dev_err(context->dev, "Out of memory in %s.\n", __func__);
|
||||||
|
return cOCT6100_ERR_BASE;
|
||||||
|
}
|
||||||
|
mutex_init(lock);
|
||||||
|
f_pCreate->ulSerialObjHndl = lock;
|
||||||
return cOCT6100_ERR_OK;
|
return cOCT6100_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 Oct6100UserDestroySerializeObject(
|
UINT32 Oct6100UserDestroySerializeObject(
|
||||||
tPOCT6100_DESTROY_SERIALIZE_OBJECT f_pDestroy)
|
tPOCT6100_DESTROY_SERIALIZE_OBJECT f_pDestroy)
|
||||||
{
|
{
|
||||||
#ifdef OCTASIC_DEBUG
|
struct mutex *lock = f_pDestroy->ulSerialObjHndl;
|
||||||
pr_debug("I should never be called! (destroy serialize object)\n");
|
kfree(lock);
|
||||||
#endif
|
|
||||||
return cOCT6100_ERR_OK;
|
return cOCT6100_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 Oct6100UserSeizeSerializeObject(
|
UINT32 Oct6100UserSeizeSerializeObject(
|
||||||
tPOCT6100_SEIZE_SERIALIZE_OBJECT f_pSeize)
|
tPOCT6100_SEIZE_SERIALIZE_OBJECT f_pSeize)
|
||||||
{
|
{
|
||||||
/* Not needed */
|
struct mutex *lock = f_pSeize->ulSerialObjHndl;
|
||||||
|
mutex_lock(lock);
|
||||||
return cOCT6100_ERR_OK;
|
return cOCT6100_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT32 Oct6100UserReleaseSerializeObject(
|
UINT32 Oct6100UserReleaseSerializeObject(
|
||||||
tPOCT6100_RELEASE_SERIALIZE_OBJECT f_pRelease)
|
tPOCT6100_RELEASE_SERIALIZE_OBJECT f_pRelease)
|
||||||
{
|
{
|
||||||
/* Not needed */
|
struct mutex *lock = f_pRelease->ulSerialObjHndl;
|
||||||
|
mutex_unlock(lock);
|
||||||
return cOCT6100_ERR_OK;
|
return cOCT6100_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user