summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include
diff options
context:
space:
mode:
authorHarald Welte2011-05-22 20:10:34 +0200
committerHarald Welte2011-06-21 19:51:01 +0200
commit7ad100b94e49f29d2f5c4586504840ee7df577c9 (patch)
tree88aedd9da82ce76484cf08fb4e26bc5540c80fdb /src/host/layer23/include
parentremove osmocom_ms reference from lapdm_init() (diff)
downloadosmocom-7ad100b94e49f29d2f5c4586504840ee7df577c9.tar.gz
osmocom-7ad100b94e49f29d2f5c4586504840ee7df577c9.tar.xz
osmocom-7ad100b94e49f29d2f5c4586504840ee7df577c9.zip
layer23: make LAPDm code mostly independent of 'struct osmocom_ms'
This is one step in the direction of re-using the lapdm code in osmo-bts.
Diffstat (limited to 'src/host/layer23/include')
-rw-r--r--src/host/layer23/include/osmocom/bb/common/lapdm.h33
-rw-r--r--src/host/layer23/include/osmocom/bb/common/osmocom_data.h9
2 files changed, 23 insertions, 19 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/lapdm.h b/src/host/layer23/include/osmocom/bb/common/lapdm.h
index 1214f0f..b5b8187 100644
--- a/src/host/layer23/include/osmocom/bb/common/lapdm.h
+++ b/src/host/layer23/include/osmocom/bb/common/lapdm.h
@@ -18,7 +18,6 @@ enum lapdm_state {
};
struct lapdm_entity;
-struct osmocom_ms;
struct lapdm_msg_ctx {
struct lapdm_datalink *dl;
@@ -62,6 +61,9 @@ enum lapdm_dl_sapi {
_NR_DL_SAPI
};
+typedef int (*lapdm_cb_t)(struct msgb *msg, struct lapdm_entity *le, void *ctx);
+
+/* 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 */
@@ -69,16 +71,31 @@ struct lapdm_entity {
void *l1_ctx; /* context for layer1 instance */
void *l3_ctx; /* context for layer3 instance */
+
+ lapdm_cb_t l1_cb; /* callback for sending stuff to L1 */
+ lapdm_cb_t l3_cb; /* callback for sending stuff to L3 */
+
+ struct lapdm_channel *lapdm_ch;
+};
+
+/* the two lapdm_entities that form a GSM logical channel (ACCH + DCCH) */
+struct lapdm_channel {
+ struct llist_head list;
+ char *name;
+ struct lapdm_entity lapdm_acch;
+ struct lapdm_entity lapdm_dcch;
};
const char *get_rsl_name(int value);
extern const char *lapdm_state_names[];
/* initialize a LAPDm entity */
-void lapdm_init(struct lapdm_entity *le);
+void lapdm_entity_init(struct lapdm_entity *le);
+void lapdm_channel_init(struct lapdm_channel *lc);
/* deinitialize a LAPDm entity */
-void lapdm_exit(struct lapdm_entity *le);
+void lapdm_entity_exit(struct lapdm_entity *le);
+void lapdm_channel_exit(struct lapdm_channel *lc);
/* input into layer2 (from layer 1) */
int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, struct l1ctl_info_dl *l1i);
@@ -89,14 +106,8 @@ int l2_ph_chan_conf(struct msgb *msg, struct osmocom_ms *ms,
struct l1ctl_info_dl *dl);
/* input into layer2 (from layer 3) */
-int rslms_recvmsg(struct msgb *msg, struct osmocom_ms *ms);
-
-/* sending messages up from L2 to L3 */
-int rslms_sendmsg(struct msgb *msg, struct osmocom_ms *ms);
+int lapdm_rslms_recvmsg(struct msgb *msg, struct lapdm_channel *lc);
-typedef int (*osmol2_cb_t)(struct msgb *msg, struct osmocom_ms *ms);
-
-/* register message handler for messages that are sent from L2->L3 */
-int osmol2_register_handler(struct osmocom_ms *ms, osmol2_cb_t cb);
+int osmol2_register_handler(struct osmocom_ms *ms, lapdm_cb_t cb);
#endif /* _OSMOCOM_LAPDM_H */
diff --git a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
index 9ca4114..de25af5 100644
--- a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
+++ b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
@@ -20,13 +20,6 @@ struct osmocom_ms;
#include <osmocom/bb/mobile/gsm48_cc.h>
#include <osmocom/bb/common/sim.h>
-/* A layer2 entity */
-struct osmol2_entity {
- struct lapdm_entity lapdm_dcch;
- struct lapdm_entity lapdm_acch;
- osmol2_cb_t msg_handler;
-};
-
struct osmosap_entity {
osmosap_cb_t msg_handler;
};
@@ -58,7 +51,7 @@ struct osmocom_ms {
struct gsm_settings settings;
struct gsm_subscriber subscr;
struct gsm_sim sim;
- struct osmol2_entity l2_entity;
+ struct lapdm_channel lapdm_channel;
struct osmosap_entity sap_entity;
struct rx_meas_stat meas;
struct gsm48_rrlayer rrlayer;