#include "prestera.h"
#include "prestera_hw.h"
#include "prestera_acl.h"
#include "prestera_counter.h"
#define COUNTER_POLL_TIME …
#define COUNTER_RESCHED_TIME …
#define COUNTER_BULK_SIZE …
struct prestera_counter { … };
struct prestera_counter_block { … };
enum { … };
static bool
prestera_counter_is_ready(struct prestera_counter_block *block, u32 id)
{ … }
static void prestera_counter_lock(struct prestera_counter *counter)
{ … }
static void prestera_counter_unlock(struct prestera_counter *counter)
{ … }
static void prestera_counter_block_lock(struct prestera_counter_block *block)
{ … }
static void prestera_counter_block_unlock(struct prestera_counter_block *block)
{ … }
static bool prestera_counter_block_incref(struct prestera_counter_block *block)
{ … }
static bool prestera_counter_block_decref(struct prestera_counter_block *block)
{ … }
static void prestera_counter_stats_clear(struct prestera_counter_block *block,
u32 counter_id)
{ … }
static struct prestera_counter_block *
prestera_counter_block_lookup_not_full(struct prestera_counter *counter,
u32 client)
{ … }
static int prestera_counter_block_list_add(struct prestera_counter *counter,
struct prestera_counter_block *block)
{ … }
static struct prestera_counter_block *
prestera_counter_block_get(struct prestera_counter *counter, u32 client)
{ … }
static void prestera_counter_block_put(struct prestera_counter *counter,
struct prestera_counter_block *block)
{ … }
static int prestera_counter_get_vacant(struct prestera_counter_block *block,
u32 *id)
{ … }
int prestera_counter_get(struct prestera_counter *counter, u32 client,
struct prestera_counter_block **bl, u32 *counter_id)
{ … }
void prestera_counter_put(struct prestera_counter *counter,
struct prestera_counter_block *block, u32 counter_id)
{ … }
static u32 prestera_counter_block_idx_next(struct prestera_counter *counter,
u32 curr_idx)
{ … }
static struct prestera_counter_block *
prestera_counter_block_get_by_idx(struct prestera_counter *counter, u32 idx)
{ … }
static void prestera_counter_stats_work(struct work_struct *work)
{ … }
int prestera_counter_stats_get(struct prestera_counter *counter,
struct prestera_counter_block *block,
u32 counter_id, u64 *packets, u64 *bytes)
{ … }
int prestera_counter_init(struct prestera_switch *sw)
{ … }
void prestera_counter_fini(struct prestera_switch *sw)
{ … }