#include <linux/if_ppp.h>
#include <linux/ppp_channel.h>
#include <linux/spinlock.h>
+#include <linux/completion.h>
#include <linux/init.h>
#include <asm/uaccess.h>
-#include <asm/semaphore.h>
#define PPP_VERSION "2.4.2"
struct tasklet_struct tsk;
atomic_t refcnt;
- struct semaphore dead_sem;
+ struct completion dead_cmp;
struct ppp_channel chan; /* interface to generic ppp layer */
};
static void sp_put(struct syncppp *ap)
{
if (atomic_dec_and_test(&ap->refcnt))
- up(&ap->dead_sem);
+ complete(&ap->dead_cmp);
}
/*
tasklet_init(&ap->tsk, ppp_sync_process, (unsigned long) ap);
atomic_set(&ap->refcnt, 1);
- init_MUTEX_LOCKED(&ap->dead_sem);
+ init_completion(&ap->dead_cmp);
ap->chan.private = ap;
ap->chan.ops = &sync_ops;
* by the time it returns.
*/
if (!atomic_dec_and_test(&ap->refcnt))
- down(&ap->dead_sem);
+ wait_for_completion(&ap->dead_cmp);
tasklet_kill(&ap->tsk);
ppp_unregister_channel(&ap->chan);