diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-06-24 12:23:17 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-06-24 12:23:17 +0200 |
commit | 04190eabd327cc598a7409cdad56013d1c8b5820 (patch) | |
tree | d75181ddcef748a3e9d4beab2d9a5f3a6e9f2783 /src/host/layer23/include/osmocom/bb | |
parent | 68d03b86f4c28319967fdf2b6056e2884e8a8de3 (diff) |
lapdm: Introduce LAPDM_MODE_{BTS,MS} to run on both sides
We also introduce some related functions like
lapdm_{entity,channel}_set_mode()
lapdm_{entity,channel}_reset()
This is all in preparation for the Osmo-BTS Work.
Diffstat (limited to 'src/host/layer23/include/osmocom/bb')
-rw-r--r-- | src/host/layer23/include/osmocom/bb/common/lapdm.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/lapdm.h b/src/host/layer23/include/osmocom/bb/common/lapdm.h index 362b89e4..19eeeb7e 100644 --- a/src/host/layer23/include/osmocom/bb/common/lapdm.h +++ b/src/host/layer23/include/osmocom/bb/common/lapdm.h @@ -53,6 +53,11 @@ struct osmo_phsap_prim { } u; }; +enum lapdm_mode { + LAPDM_MODE_MS, + LAPDM_MODE_BTS, +}; + enum lapdm_state { LAPDm_STATE_NULL = 0, LAPDm_STATE_IDLE, @@ -108,11 +113,23 @@ enum lapdm_dl_sapi { typedef int (*lapdm_cb_t)(struct msgb *msg, struct lapdm_entity *le, void *ctx); +struct lapdm_cr_ent { + uint8_t cmd; + uint8_t resp; +}; + /* register message handler for messages that are sent from L2->L3 */ struct lapdm_entity { struct lapdm_datalink datalink[_NR_DL_SAPI]; int last_tx_dequeue; /* last entity that was dequeued */ int tx_pending; /* currently a pending frame not confirmed by L1 */ + enum lapdm_mode mode; /* are we in BTS mode or MS mode */ + + struct { + /* filled-in once we set the lapdm_mode above */ + struct lapdm_cr_ent loc2rem; + struct lapdm_cr_ent rem2loc; + } cr; void *l1_ctx; /* context for layer1 instance */ void *l3_ctx; /* context for layer3 instance */ @@ -135,8 +152,8 @@ const char *get_rsl_name(int value); extern const char *lapdm_state_names[]; /* initialize a LAPDm entity */ -void lapdm_entity_init(struct lapdm_entity *le); -void lapdm_channel_init(struct lapdm_channel *lc); +void lapdm_entity_init(struct lapdm_entity *le, enum lapdm_mode mode); +void lapdm_channel_init(struct lapdm_channel *lc, enum lapdm_mode mode); /* deinitialize a LAPDm entity */ void lapdm_entity_exit(struct lapdm_entity *le); @@ -151,4 +168,10 @@ int lapdm_rslms_recvmsg(struct msgb *msg, struct lapdm_channel *lc); void lapdm_channel_set_l3(struct lapdm_channel *lc, lapdm_cb_t cb, void *ctx); void lapdm_channel_set_l1(struct lapdm_channel *lc, osmo_prim_cb cb, void *ctx); +int lapdm_entity_set_mode(struct lapdm_entity *le, enum lapdm_mode mode); +int lapdm_channel_set_mode(struct lapdm_channel *lc, enum lapdm_mode mode); + +void lapdm_entity_reset(struct lapdm_entity *le); +void lapdm_channel_reset(struct lapdm_channel *lc); + #endif /* _OSMOCOM_LAPDM_H */ |