Commit db03f1d2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: csr: remove oska submodule

Turns out nothing in this module was being used at all, so instead of
deleting it piece by piece, just remove the whole thing.  I don't know
why it was added in the first place.

Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bd2b57ab
obj-$(CONFIG_CSR_WIFI) += oska/
ccflags-y := -DCSR_SME_USERSPACE -DCSR_SUPPORT_SME -DREMOTE_SYS_SAP -DCSR_WIFI_SECURITY_WAPI_ENABLE -DENABLE_SHUTDOWN -DUNIFI_DEBUG
ccflags-y += -DSDIO_EXPORTS_STRUCT_DEVICE -DCSR_WIFI_SUPPORT_MMC_DRIVER -DCSR_WIFI_SINGLE_FUNCTION -DCSR_WIFI_SPLIT_PATCH
ccflags-y += -DCSR_SUPPORT_WEXT -DREMOTE_SYS_SAP -DREMOTE_MGT_SAP -DCSR_WIFI_SECURITY_WAPI_ENABLE -DCSR_WIFI_SECURITY_WAPI_QOSCTRL_MIC_WORKAROUND -DENABLE_SHUTDOWN -DCSR_WIFI_NME_ENABLE -DCSR_WIFI_AP_ENABLE -DCSR_SUPPORT_WEXT_AP -DCSR_WIFI_REQUEUE_PACKET_TO_HAL
......
obj-$(CONFIG_CSR_WIFI) := csr_oska.o
csr_oska-y := \
event.o \
oska_module.o \
thread.o
/*
* OSKA Linux implementation -- memory allocation
*
* Copyright (C) 2007 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#ifndef __OSKA_LINUX_ALLOC_H
#define __OSKA_LINUX_ALLOC_H
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
static inline void *os_alloc(size_t size)
{
return kzalloc(size, GFP_ATOMIC);
}
static inline void *os_alloc_nonzeroed(size_t size)
{
return kmalloc(size, GFP_KERNEL);
}
static inline void os_free(void *ptr)
{
kfree(ptr);
}
static inline void *os_alloc_big(size_t size)
{
return vmalloc(size);
}
static inline void os_free_big(void *ptr)
{
vfree(ptr);
}
#endif /* #ifndef __OSKA_LINUX_ALLOC_H */
/*
* Linux event functions.
*
* Copyright (C) 2009 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#include <linux/module.h>
#include <linux/sched.h>
#include "event.h"
void os_event_init(os_event_t *evt)
{
init_waitqueue_head(&evt->wq);
spin_lock_init(&evt->lock);
evt->events = 0;
}
EXPORT_SYMBOL(os_event_init);
uint16_t os_event_wait(os_event_t *evt)
{
uint16_t e;
unsigned long flags;
wait_event(evt->wq, evt->events != 0);
spin_lock_irqsave(&evt->lock, flags);
e = evt->events;
evt->events &= ~e;
spin_unlock_irqrestore(&evt->lock, flags);
return e;
}
EXPORT_SYMBOL(os_event_wait);
uint16_t os_event_wait_interruptible(os_event_t *evt)
{
uint16_t e;
unsigned long flags;
wait_event_interruptible(evt->wq, evt->events != 0);
spin_lock_irqsave(&evt->lock, flags);
e = evt->events;
evt->events &= ~e;
spin_unlock_irqrestore(&evt->lock, flags);
return e;
}
EXPORT_SYMBOL(os_event_wait_interruptible);
uint16_t os_event_wait_timed(os_event_t *evt, unsigned timeout_ms)
{
uint16_t e;
unsigned long flags;
wait_event_interruptible_timeout(evt->wq,
evt->events != 0,
msecs_to_jiffies(timeout_ms));
spin_lock_irqsave(&evt->lock, flags);
e = evt->events;
evt->events &= ~e;
spin_unlock_irqrestore(&evt->lock, flags);
return e;
}
EXPORT_SYMBOL(os_event_wait_timed);
void os_event_raise(os_event_t *evt, uint16_t events)
{
unsigned long flags;
spin_lock_irqsave(&evt->lock, flags);
evt->events |= events;
spin_unlock_irqrestore(&evt->lock, flags);
wake_up(&evt->wq);
}
EXPORT_SYMBOL(os_event_raise);
/*
* OSKA Linux implementation -- events
*
* Copyright (C) 2009 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#ifndef __OSKA_LINUX_EVENT_H
#define __OSKA_LINUX_EVENT_H
#include <linux/kernel.h>
#include <linux/wait.h>
#include <linux/spinlock.h>
typedef struct {
wait_queue_head_t wq;
spinlock_t lock;
uint16_t events;
} os_event_t;
void os_event_init(os_event_t *evt);
static inline void os_event_destroy(os_event_t *evt)
{
}
uint16_t os_event_wait(os_event_t *evt);
uint16_t os_event_wait_interruptible(os_event_t *evt);
uint16_t os_event_wait_timed(os_event_t *evt, unsigned timeout_ms);
void os_event_raise(os_event_t *evt, uint16_t events);
#endif /* #ifndef __OSKA_LINUX_EVENT_H */
/*
* OSKA Linux implementation -- mutexes
*
* Copyright (C) 2007 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#ifndef __OSKA_LINUX_MUTEX_H
#define __OSKA_LINUX_MUTEX_H
#include <linux/kernel.h>
#include <linux/mutex.h>
#include <linux/semaphore.h>
/* Real mutexes were only added to 2.6.16 so use semaphores
instead. */
typedef struct semaphore os_mutex_t;
static inline void os_mutex_init(os_mutex_t *mutex)
{
//init_MUTEX(mutex);
sema_init(mutex, 1);
}
static inline void os_mutex_destroy(os_mutex_t *mutex)
{
/* no op */
}
static inline void os_mutex_lock(os_mutex_t *mutex)
{
down(mutex);
}
static inline void os_mutex_unlock(os_mutex_t *mutex)
{
up(mutex);
}
#endif /* __OSKA_LINUX_MUTEX_H */
/*
* Linux kernel module support.
*
* Copyright (C) 2010 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#include <linux/module.h>
MODULE_DESCRIPTION("Operating System Kernel Abstraction");
MODULE_AUTHOR("Cambridge Silicon Radio Ltd.");
MODULE_LICENSE("GPL and additional rights");
/*
* OSKA Linux implementation -- semaphores
*
* Copyright (C) 2007 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#ifndef __OSKA_LINUX_SEMAPHORE_H
#define __OSKA_LINUX_SEMAPHORE_H
#include <linux/kernel.h>
#include <linux/kernel-compat.h>
typedef struct semaphore os_semaphore_t;
static inline void os_semaphore_init(os_semaphore_t *sem)
{
sema_init(sem, 0);
}
static inline void os_semaphore_destroy(os_semaphore_t *sem)
{
}
static inline void os_semaphore_wait(os_semaphore_t *sem)
{
down(sem);
}
/*
* down_timeout() was added in 2.6.26 with the generic semaphore
* implementation. For now, only support it on recent kernels as
* semaphores may be replaced by an event API that would be
* implemented with wait_event(), and wait_event_timeout().
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
static inline int os_semaphore_wait_timed(os_semaphore_t *sem,
int time_ms)
{
if (down_timeout(sem, msecs_to_jiffies(time_ms)) < 0) {
return -ETIMEDOUT;
}
return 0;
}
#else
static inline int os_semaphore_wait_timed(os_semaphore_t *sem, int time_ms)
{
unsigned long now = jiffies;
do{
if(!down_trylock(sem))
return 0;
msleep(1);
} while(time_before(jiffies, now + msecs_to_jiffies(time_ms)));
return -ETIMEDOUT;
}
#endif
static inline void os_semaphore_post(os_semaphore_t *sem)
{
up(sem);
}
#endif /* __OSKA_LINUX_SEMAPHORE_H */
/*
* OSKA Linux implementation -- spinlocks
*
* Copyright (C) 2007 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#ifndef __OSKA_LINUX_SPINLOCK_H
#define __OSKA_LINUX_SPINLOCK_H
#include <linux/kernel.h>
#include <linux/spinlock.h>
typedef spinlock_t os_spinlock_t;
typedef unsigned long os_int_status_t;
static inline void os_spinlock_init(os_spinlock_t *lock)
{
spinlock_t *l = (spinlock_t *)lock;
spin_lock_init(l);
}
static inline void os_spinlock_destroy(os_spinlock_t *lock)
{
/* no op */
}
static inline void os_spinlock_lock_intsave(os_spinlock_t *lock,
os_int_status_t *int_state)
{
spinlock_t *l = (spinlock_t *)lock;
spin_lock_irqsave(l, *int_state);
}
static inline void os_spinlock_unlock_intrestore(os_spinlock_t *lock,
os_int_status_t *int_state)
{
spinlock_t *l = (spinlock_t *)lock;
spin_unlock_irqrestore(l, *int_state);
}
#endif /* #ifndef __OSKA_LINUX_SPINLOCK_H */
/*
* Linux thread functions.
*
* Copyright (C) 2007 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#include <linux/module.h>
#include "thread.h"
static int thread_func(void *data)
{
os_thread_t *thread = data;
thread->func(thread->arg);
/*
* kthread_stop() cannot handle the thread exiting while
* kthread_should_stop() is false, so sleep until kthread_stop()
* wakes us up.
*/
set_current_state(TASK_INTERRUPTIBLE);
if (!kthread_should_stop())
schedule();
return 0;
}
int os_thread_create(os_thread_t *thread, const char *name, void (*func)(void *), void *arg)
{
thread->func = func;
thread->arg = arg;
thread->stop = 0;
thread->task = kthread_run(thread_func, thread, name);
if (IS_ERR(thread->task)) {
return PTR_ERR(thread->task);
}
return 0;
}
EXPORT_SYMBOL(os_thread_create);
void os_thread_stop(os_thread_t *thread, os_event_t *evt)
{
/*
* Stop flag must be set before the event is raised so
* kthread_should_stop() cannot be used.
*/
thread->stop = 1;
if (evt) {
os_event_raise(evt, ~0);
}
kthread_stop(thread->task);
}
EXPORT_SYMBOL(os_thread_stop);
int os_thread_should_stop(os_thread_t *thread)
{
return thread->stop;
}
EXPORT_SYMBOL(os_thread_should_stop);
/*
* OSKA Linux implementation -- threading
*
* Copyright (C) 2007 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#ifndef __OSKA_LINUX_THREAD_H
#define __OSKA_LINUX_THREAD_H
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19)
#include <linux/freezer.h>
#endif
#include "event.h"
struct os_thread_lx {
void (*func)(void *);
void *arg;
struct task_struct *task;
int stop;
};
typedef struct os_thread_lx os_thread_t;
int os_thread_create(os_thread_t *thread, const char *name,
void (*func)(void *), void *arg);
void os_thread_stop(os_thread_t *thread, os_event_t *evt);
int os_thread_should_stop(os_thread_t *thread);
static inline void os_try_suspend_thread(os_thread_t *thread)
{
try_to_freeze();
}
#endif /* __OSKA_LINUX_THREAD_H */
/*
* OSKA Linux implementation -- tracing messages.
*
* Copyright (C) 2009 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#ifndef __OSKA_LINUX_TRACE_H
#define __OSKA_LINUX_TRACE_H
#include <linux/kernel.h>
#ifndef OS_TRACE_PREFIX
# define OS_TRACE_PREFIX ""
#endif
#define os_trace_err(format, ...) printk(KERN_ERR OS_TRACE_PREFIX format "\n", ## __VA_ARGS__)
#define os_trace_warn(format, ...) printk(KERN_WARNING OS_TRACE_PREFIX format "\n", ## __VA_ARGS__)
#define os_trace_info(format, ...) printk(KERN_INFO OS_TRACE_PREFIX format "\n", ## __VA_ARGS__)
#define os_trace_dbg(format, ...) printk(KERN_DEBUG OS_TRACE_PREFIX format "\n", ## __VA_ARGS__)
#endif /* #ifndef __OSKA_LINUX_TRACE_H */
/*
* OSKA Linux implementation -- misc. utility functions
*
* Copyright (C) 2007 Cambridge Silicon Radio Ltd.
*
* Refer to LICENSE.txt included with this source code for details on
* the license terms.
*/
#ifndef __OSKA_LINUX_UTILS_H
#define __OSKA_LINUX_UTILS_H
#include <linux/kernel.h>
#include <linux/bug.h>
#include <asm/byteorder.h>
#define OS_ASSERT(expr) BUG_ON(!(expr))
static inline uint16_t os_le16_to_cpu(uint16_t x)
{
return le16_to_cpu(x);
}
static inline uint16_t os_cpu_to_le16(uint16_t x)
{
return cpu_to_le16(x);
}
static inline uint32_t os_le32_to_cpu(uint32_t x)
{
return le32_to_cpu(x);
}
static inline uint32_t os_cpu_to_le32(uint32_t x)
{
return cpu_to_le32(x);
}
static inline uint64_t os_le64_to_cpu(uint64_t x)
{
return le64_to_cpu(x);
}
static inline uint64_t os_cpu_to_le64(uint64_t x)
{
return cpu_to_le64(x);
}
#endif /* __OSKA_LINUX_UTILS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment