linux/drivers/net/wireless/ath/dfs_pri_detector.c

/*
 * Copyright (c) 2012 Neratec Solutions AG
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include <linux/slab.h>
#include <linux/spinlock.h>

#include "ath.h"
#include "dfs_pattern_detector.h"
#include "dfs_pri_detector.h"

struct ath_dfs_pool_stats global_dfs_pool_stats =;

#define DFS_POOL_STAT_INC(c)
#define DFS_POOL_STAT_DEC(c)
#define GET_PRI_TO_USE(MIN, MAX, RUNTIME)

/*
 * struct pulse_elem - elements in pulse queue
 */
struct pulse_elem {};

/*
 * pde_get_multiple() - get number of multiples considering a given tolerance
 * Return value: factor if abs(val - factor*fraction) <= tolerance, 0 otherwise
 */
static u32 pde_get_multiple(u32 val, u32 fraction, u32 tolerance)
{}

/*
 * DOC: Singleton Pulse and Sequence Pools
 *
 * Instances of pri_sequence and pulse_elem are kept in singleton pools to
 * reduce the number of dynamic allocations. They are shared between all
 * instances and grow up to the peak number of simultaneously used objects.
 *
 * Memory is freed after all references to the pools are released.
 */
static u32 singleton_pool_references;
static LIST_HEAD(pulse_pool);
static LIST_HEAD(pseq_pool);
static DEFINE_SPINLOCK(pool_lock);

static void pool_register_ref(void)
{}

static void pool_deregister_ref(void)
{}

static void pool_put_pulse_elem(struct pulse_elem *pe)
{}

static void pool_put_pseq_elem(struct pri_sequence *pse)
{}

static struct pri_sequence *pool_get_pseq_elem(void)
{}

static struct pulse_elem *pool_get_pulse_elem(void)
{}

static struct pulse_elem *pulse_queue_get_tail(struct pri_detector *pde)
{}

static bool pulse_queue_dequeue(struct pri_detector *pde)
{}

/* remove pulses older than window */
static void pulse_queue_check_window(struct pri_detector *pde)
{}

static bool pulse_queue_enqueue(struct pri_detector *pde, u64 ts)
{}

static bool pseq_handler_create_sequences(struct pri_detector *pde,
					  u64 ts, u32 min_count)
{}

/* check new ts and add to all matching existing sequences */
static u32
pseq_handler_add_to_existing_seqs(struct pri_detector *pde, u64 ts)
{}

static struct pri_sequence *
pseq_handler_check_detection(struct pri_detector *pde)
{}


/* free pulse queue and sequences list and give objects back to pools */
static void pri_detector_reset(struct pri_detector *pde, u64 ts)
{}

static void pri_detector_exit(struct pri_detector *de)
{}

static struct pri_sequence *pri_detector_add_pulse(struct pri_detector *de,
						   struct pulse_event *event)
{}

struct pri_detector *pri_detector_init(const struct radar_detector_specs *rs)
{}