qcacmn: Add a new qdf API for spin_trylock
This change adds a qdf wrapper api qdf_spin_trylock for spin_trylock. Change-Id: I3406ed96f7f40df24949bd4e21ceb144d919d58d
This commit is contained in:

committed by
nshrivas

parent
13699a1bd8
commit
205aeca91d
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -298,6 +298,24 @@ static inline int qdf_spin_trylock_bh(qdf_spinlock_t *lock, const char *func)
|
|||||||
|
|
||||||
int qdf_spin_trylock_bh_outline(qdf_spinlock_t *lock);
|
int qdf_spin_trylock_bh_outline(qdf_spinlock_t *lock);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* qdf_spin_trylock() - spin trylock
|
||||||
|
* @lock: spinlock object
|
||||||
|
* Return: int
|
||||||
|
*/
|
||||||
|
static inline int qdf_spin_trylock(qdf_spinlock_t *lock, const char *func)
|
||||||
|
{
|
||||||
|
int result = 0;
|
||||||
|
|
||||||
|
BEFORE_LOCK(lock, qdf_spin_is_locked(lock));
|
||||||
|
result = __qdf_spin_trylock(&lock->lock);
|
||||||
|
AFTER_LOCK(lock, func);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define qdf_spin_trylock(lock) qdf_spin_trylock(lock, __func__)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* qdf_spin_lock_bh() - locks the spinlock mutex in soft irq context
|
* qdf_spin_lock_bh() - locks the spinlock mutex in soft irq context
|
||||||
* @lock: spinlock object pointer
|
* @lock: spinlock object pointer
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
|
* Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, and/or distribute this software for
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
* any purpose with or without fee is hereby granted, provided that the
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
@@ -266,6 +266,17 @@ static inline int __qdf_spin_trylock_bh(__qdf_spinlock_t *lock)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* __qdf_spin_trylock() - spin trylock
|
||||||
|
* @lock: spinlock object
|
||||||
|
*
|
||||||
|
* Return: int
|
||||||
|
*/
|
||||||
|
static inline int __qdf_spin_trylock(__qdf_spinlock_t *lock)
|
||||||
|
{
|
||||||
|
return spin_trylock(&lock->spinlock);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* __qdf_spin_lock_bh() - Acquire the spinlock and disable bottom halves
|
* __qdf_spin_lock_bh() - Acquire the spinlock and disable bottom halves
|
||||||
* @lock: Lock object
|
* @lock: Lock object
|
||||||
|
Reference in New Issue
Block a user