From 6dd3f5670beaf8e11299c640167ec3f78c0fc23b Mon Sep 17 00:00:00 2001 From: chertier Date: Thu, 27 Mar 2008 15:56:33 +0000 Subject: 1st try of full station integration with CP+DP and new interface/sniffer module - added new module "cco" git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1659 017c9cb6-072f-447c-8318-d5b54f68fe89 --- cp/cco/Module | 1 + cp/cco/cco.h | 123 ++++++++++++++++++++++ cp/cco/inc/context.h | 46 +++++++++ cp/cco/src/cco.c | 281 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 451 insertions(+) create mode 100644 cp/cco/Module create mode 100644 cp/cco/cco.h create mode 100644 cp/cco/inc/context.h create mode 100644 cp/cco/src/cco.c (limited to 'cp') diff --git a/cp/cco/Module b/cp/cco/Module new file mode 100644 index 0000000000..0ea6ec2506 --- /dev/null +++ b/cp/cco/Module @@ -0,0 +1 @@ +SOURCES := cco.c diff --git a/cp/cco/cco.h b/cp/cco/cco.h new file mode 100644 index 0000000000..81b5bf64e6 --- /dev/null +++ b/cp/cco/cco.h @@ -0,0 +1,123 @@ +#ifndef cp_cco_cco_h +#define cp_cco_cco_h +/* Cesar project {{{ + * + * Copyright (C) 2008 Spidcom + * + * <<>> + * + * }}} */ +/** + * \file cp/cco/cco.h + * \brief « brief description » + * \ingroup « module » + * + * « long description » + */ + +/** Forward declaration */ +typedef struct cp_cco_t cp_cco_t; + +cp_cco_t * +cp_cco_init (void); + +void +cp_cco_uninit (cp_cco_t *ctx); + +uint +cp_cco_get_dt_av(cp_cco_t *ctx); + +void +cp_coo_set_dt_av (cp_cco_t *ctx, uint dt_av); + +bool +cp_cco_get_access(cp_cco_t *ctx); + +void +cp_cco_set_access(cp_cco_t *ctx, bool access); + +bool +cp_cco_get_ncnr (cp_cco_t *ctx); + +void +cp_cco_set_ncnr (cp_cco_t *ctx, bool ncnr); + +bool +cp_cco_get_npsm (cp_cco_t *ctx); + +void +cp_cco_set_npsm (cp_cco_t *ctx, bool npsm); + +u8 +cp_cco_get_numslots (cp_cco_t *ctx); + +void +cp_cco_set_numslots (cp_cco_t *ctx, u8 num_slots); + +u8 +cp_cco_get_slotusage (cp_cco_t *ctx); + +void +cp_cco_set_slotusage (cp_cco_t *ctx, u8 slotusage); + +u8 +cp_cco_get_slot_id (cp_cco_t *ctx); + +void +cp_cco_set_slot_id (cp_cco_t *ctx, u8 slot_id); + +u8 +cp_cco_get_aclss (cp_cco_t *ctx); + +void +cp_cco_set_aclss (cp_cco_t *ctx, u8 aclss); + +u8 +cp_cco_get_nm (cp_cco_t *ctx); + +void +cp_cco_set_nm (cp_cco_t *ctx, u8 nm); + +u8 +cp_cco_get_cco_cap (cp_cco_t *ctx); + +void +cp_cco_set_cco_cap (cp_cco_t *ctx, u8 cco_cap); + +bool +cp_cco_get_proxy_cap (cp_cco_t *ctx); + +void +cp_cco_set_proxy_cap (cp_cco_t *ctx, bool proxy_cap); + +bool +cp_cco_get_backup_cap (cp_cco_t *ctx); + +void +cp_cco_set_backup_cap (cp_cco_t *ctx, bool backup_cap); + +bool +cp_cco_get_cco_status (cp_cco_t *ctx); + +void +cp_cco_set_cco_status (cp_cco_t *ctx, bool cco_status); + +bool +cp_cco_get_pco_status(cp_cco_t *ctx); + +void +cp_cco_set_pco_status(cp_cco_t *ctx, bool pco_status); + +bool +cp_cco_get_backup_cco_status(cp_cco_t *ctx); + +void +cp_cco_set_backup_cco_status(cp_cco_t *ctx, bool backup_cco_status); + +bool +cp_cco_get_user_appointed_cco_status(cp_cco_t *ctx); + +void +cp_cco_set_user_appointed_cco_status(cp_cco_t *ctx, bool ua_cco_status); + +#endif /* cp_cco_cco_h */ diff --git a/cp/cco/inc/context.h b/cp/cco/inc/context.h new file mode 100644 index 0000000000..c7f98d5589 --- /dev/null +++ b/cp/cco/inc/context.h @@ -0,0 +1,46 @@ +#ifndef cp_cco_inc_context_h +#define cp_cco_inc_context_h +/* Cesar project {{{ + * + * Copyright (C) 2008 Spidcom + * + * <<>> + * + * }}} */ +/** + * \file cp/cco/inc/context.h + * \brief « brief description » + * \ingroup « module » + * + * « long description » + */ + +struct cp_cco_t +{ + BITFIELDS_WORD + ( + uint dt_av:3;, + uint access:1;, + uint ncnr:1;, + uint npsm:1;, + uint num_slots:3;, + uint slot_usage:8;, + uint slotid:3;, + uint aclss:3;, + uint nm:2;, + uint cco_cap:2;, + uint proxy_cap:1;, + uint backup_cap:1;, + uint cco_status:1;, + uint pco_status:1;, + uint backup_cco:1; + ); + BITFIELDS_WORD + ( + uint nr:6;, + uint user_appointed_cco_status:1;, + uint rsvd:25; + ); +}; + +#endif /* cp_cco_inc_context_h */ diff --git a/cp/cco/src/cco.c b/cp/cco/src/cco.c new file mode 100644 index 0000000000..0ef74335eb --- /dev/null +++ b/cp/cco/src/cco.c @@ -0,0 +1,281 @@ +/* Cesar project {{{ + * + * Copyright (C) 2008 Spidcom + * + * <<>> + * + * }}} */ +/** + * \file cp/cco/src/cco.c + * \brief « brief description » + * \ingroup « module » + * + * « long description » + */ +#include "common/std.h" + +#include "cp/cco/cco.h" +#include "cp/cco/inc/context.h" + +static cp_cco_t cco; + +cp_cco_t * +cp_cco_init (void) +{ + cco.dt_av = 0x0; + cco.access = 0x0; + cco.ncnr = 0x0; + cco.npsm = 0x0; + cco.num_slots = 0x1; + cco.slot_usage = 0x1; + cco.slotid = 0x0; + cco.aclss = 0x1; + cco.nm = 0x2; + cco.cco_cap = 0x0; + cco.proxy_cap = 0; + cco.backup_cap = 0; + cco.cco_status = 0; + cco.pco_status = 0; + cco.backup_cco = 0; + cco.nr = 0; + cco.user_appointed_cco_status = 0; + cco.rsvd = 0; + + return &cco; +} + +void +cp_cco_uninit (cp_cco_t *ctx) +{ + dbg_assert (ctx); +} + +uint +cp_cco_get_dt_av(cp_cco_t *ctx) +{ + dbg_assert (ctx); + + return ctx->dt_av; +} + +void +cp_coo_set_dt_av (cp_cco_t *ctx, uint dt_av) +{ + dbg_assert (ctx); + ctx->dt_av = dt_av; +} + +bool +cp_cco_get_access(cp_cco_t *ctx) +{ + dbg_assert (ctx); + + return ctx->access; +} + +void +cp_cco_set_access(cp_cco_t *ctx, bool access) +{ + dbg_assert (ctx); + + ctx->access = access; +} + +bool +cp_cco_get_ncnr (cp_cco_t *ctx) +{ + dbg_assert (ctx); + return ctx->ncnr; +} + +void +cp_cco_set_ncnr (cp_cco_t *ctx, bool ncnr) +{ + dbg_assert (ctx); + ctx->ncnr = ncnr; +} + +bool +cp_cco_get_npsm (cp_cco_t *ctx) +{ + dbg_assert (ctx); + + return ctx->npsm; +} + +void +cp_cco_set_npsm (cp_cco_t *ctx, bool npsm) +{ + dbg_assert (ctx); + ctx->npsm = npsm; +} + +u8 +cp_cco_get_numslots (cp_cco_t *ctx) +{ + dbg_assert (ctx); + + return ctx->num_slots; +} + +void +cp_cco_set_numslots (cp_cco_t *ctx, u8 num_slots) +{ + dbg_assert (ctx); + ctx->num_slots = num_slots; +} + +u8 +cp_cco_get_slotusage (cp_cco_t *ctx) +{ + dbg_assert (ctx); + return ctx->slot_usage; +} + +void +cp_cco_set_slotusage (cp_cco_t *ctx, u8 slotusage) +{ + dbg_assert (ctx); + ctx->slot_usage = slotusage; +} + +u8 +cp_cco_get_slot_id (cp_cco_t *cco) +{ + dbg_assert (cco); + return cco->slotid; +} + +void +cp_cco_set_slot_id (cp_cco_t *ctx, u8 slot_id) +{ + dbg_assert (ctx); + ctx->slotid = slot_id; +} + +u8 +cp_cco_get_aclss (cp_cco_t *ctx) +{ + dbg_assert (ctx); + return ctx->aclss; +} + +void +cp_cco_set_aclss (cp_cco_t *ctx, u8 aclss) +{ + dbg_assert (ctx); + ctx->aclss = aclss; +} + +u8 +cp_cco_get_nm (cp_cco_t *ctx) +{ + dbg_assert (ctx); + return ctx->nm; +} + +void +cp_cco_set_nm (cp_cco_t *ctx, u8 nm) +{ + dbg_assert (ctx); + ctx->nm = nm; +} + +u8 +cp_cco_get_cco_cap (cp_cco_t *ctx) +{ + dbg_assert (ctx); + return ctx->cco_cap; +} + +void +cp_cco_set_cco_cap (cp_cco_t *ctx, u8 cco_cap) +{ + dbg_assert (ctx); + ctx->cco_cap = cco_cap; +} + +bool +cp_cco_get_proxy_cap (cp_cco_t *ctx) +{ + dbg_assert (ctx); + return ctx->proxy_cap; +} + +void +cp_cco_set_proxy_cap (cp_cco_t *ctx, bool proxy_cap) +{ + dbg_assert (ctx); + ctx->proxy_cap = proxy_cap; +} + +bool +cp_cco_get_backup_cap (cp_cco_t *ctx) +{ + dbg_assert (ctx); + return ctx->backup_cap; +} + +void +cp_cco_set_backup_cap (cp_cco_t *ctx, bool backup_cap) +{ + dbg_assert (ctx); + ctx->backup_cap = backup_cap; +} + +bool +cp_cco_get_cco_status (cp_cco_t *ctx) +{ + dbg_assert (ctx); + return ctx->cco_status; +} + +void +cp_cco_set_cco_status (cp_cco_t *ctx, bool cco_status) +{ + dbg_assert (ctx); + ctx->cco_status = cco_status; +} + +bool +cp_cco_get_pco_status(cp_cco_t *ctx) +{ + dbg_assert (ctx); + return ctx->pco_status; +} + +void +cp_cco_set_pco_status(cp_cco_t *ctx, bool pco_status) +{ + dbg_assert(ctx); + ctx->pco_status = pco_status; +} + +bool +cp_cco_get_backup_cco_status(cp_cco_t *ctx) +{ + dbg_assert (ctx); + return ctx->backup_cco; +} + +void +cp_cco_set_backup_cco_status(cp_cco_t *ctx, bool backup_cco_status) +{ + dbg_assert (ctx); + ctx->backup_cco = backup_cco_status; +} + +bool +cp_cco_get_user_appointed_cco_status(cp_cco_t *ctx) +{ + dbg_assert (ctx); + return ctx->user_appointed_cco_status; +} + +void +cp_cco_set_user_appointed_cco_status(cp_cco_t *ctx, bool ua_cco_status) +{ + dbg_assert (ctx); + ctx->user_appointed_cco_status = ua_cco_status; +} + -- cgit v1.2.3