summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/include
diff options
context:
space:
mode:
authorAndreas.Eversberg2011-07-28 20:54:42 +0200
committerSylvain Munaut2011-07-28 21:30:51 +0200
commit1a5461fb2beb96bfa004245a102cd4c1422baa2a (patch)
tree71b3dce4ea3765b61610015b58c79c2322127456 /src/host/layer23/include
parentfw/prim_tch: Add support for sending frame from l23 (TRAFFIC_REQ/CONF) (diff)
downloadosmocom-1a5461fb2beb96bfa004245a102cd4c1422baa2a.tar.gz
osmocom-1a5461fb2beb96bfa004245a102cd4c1422baa2a.tar.xz
osmocom-1a5461fb2beb96bfa004245a102cd4c1422baa2a.zip
layer23: Add mobile support for sending / receiving voice frame through MNCC
Support GSM FR codec only so far. Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'src/host/layer23/include')
-rw-r--r--src/host/layer23/include/osmocom/bb/common/l1ctl.h10
-rw-r--r--src/host/layer23/include/osmocom/bb/common/osmocom_data.h14
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/gsm48_cc.h1
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h5
-rw-r--r--src/host/layer23/include/osmocom/bb/mobile/voice.h7
5 files changed, 33 insertions, 4 deletions
diff --git a/src/host/layer23/include/osmocom/bb/common/l1ctl.h b/src/host/layer23/include/osmocom/bb/common/l1ctl.h
index faa12d5..5ebea96 100644
--- a/src/host/layer23/include/osmocom/bb/common/l1ctl.h
+++ b/src/host/layer23/include/osmocom/bb/common/l1ctl.h
@@ -25,10 +25,10 @@ int l1ctl_tx_rach_req(struct osmocom_ms *ms, uint8_t ra, uint16_t offset,
/* Transmit L1CTL_DM_EST_REQ */
int l1ctl_tx_dm_est_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
- uint8_t chan_nr, uint8_t tsc, uint8_t tch_mode);
+ uint8_t chan_nr, uint8_t tsc, uint8_t tch_mode, uint8_t audio_mode);
int l1ctl_tx_dm_est_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
uint16_t *ma, uint8_t ma_len, uint8_t chan_nr, uint8_t tsc,
- uint8_t tch_mode);
+ uint8_t tch_mode, uint8_t audio_mode);
/* Transmit L1CTL_DM_FREQ_REQ */
int l1ctl_tx_dm_freq_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
@@ -48,7 +48,8 @@ int l1ctl_tx_fbsb_req(struct osmocom_ms *ms, uint16_t arfcn,
int l1ctl_tx_ccch_mode_req(struct osmocom_ms *ms, uint8_t ccch_mode);
/* Transmit TCH_MODE_REQ */
-int l1ctl_tx_tch_mode_req(struct osmocom_ms *ms, uint8_t tch_mode);
+int l1ctl_tx_tch_mode_req(struct osmocom_ms *ms, uint8_t tch_mode,
+ uint8_t audio_mode);
/* Transmit ECHO_REQ */
int l1ctl_tx_echo_req(struct osmocom_ms *ms, unsigned int len);
@@ -62,6 +63,9 @@ int l1ctl_tx_pm_req_range(struct osmocom_ms *ms, uint16_t arfcn_from,
int l1ctl_tx_sim_req(struct osmocom_ms *ms, uint8_t *data, uint16_t length);
+/* Transmit L1CTL_VOICE_REQ */
+int l1ctl_tx_traffic_req(struct osmocom_ms *ms, struct msgb *msg,
+ uint8_t chan_nr, uint8_t link_id);
/* LAPDm wants to send a PH-* primitive to the physical layer (L1) */
int l1ctl_ph_prim_cb(struct osmo_prim_hdr *oph, void *ctx);
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 d387c91..6ad89cd 100644
--- a/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
+++ b/src/host/layer23/include/osmocom/bb/common/osmocom_data.h
@@ -19,11 +19,22 @@ struct osmocom_ms;
#include <osmocom/bb/mobile/gsm48_mm.h>
#include <osmocom/bb/mobile/gsm48_cc.h>
#include <osmocom/bb/common/sim.h>
+#include <osmocom/bb/common/l1ctl.h>
struct osmosap_entity {
osmosap_cb_t msg_handler;
};
+struct osmol1_entity {
+ int (*l1_traffic_ind)(struct osmocom_ms *ms, struct msgb *msg);
+};
+
+struct osmomncc_entity {
+ int (*mncc_recv)(struct osmocom_ms *ms, int msg_type, void *arg);
+ uint32_t ref;
+};
+
+
/* RX measurement statistics */
struct rx_meas_stat {
uint32_t last_fn;
@@ -45,6 +56,7 @@ struct osmocom_ms {
char name[32];
struct osmo_wqueue l2_wq, sap_wq;
uint16_t test_arfcn;
+ struct osmol1_entity l1_entity;
uint8_t deleting, shutdown, started;
struct gsm_support support;
@@ -59,6 +71,7 @@ struct osmocom_ms {
struct gsm322_cellsel cellsel;
struct gsm48_mmlayer mmlayer;
struct gsm48_cclayer cclayer;
+ struct osmomncc_entity mncc_entity;
struct llist_head trans_list;
};
@@ -104,6 +117,7 @@ struct osmobb_ccch_mode_conf {
struct osmobb_tch_mode_conf {
struct osmocom_ms *ms;
uint8_t tch_mode;
+ uint8_t audio_mode;
};
struct osmobb_neigh_pm_ind {
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_cc.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_cc.h
index d6ea575..8cdd1c4 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_cc.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_cc.h
@@ -5,7 +5,6 @@ struct gsm48_cclayer {
struct osmocom_ms *ms;
struct llist_head mncc_upqueue;
- int (*mncc_recv)(struct osmocom_ms *, int, void *);
};
int gsm48_cc_init(struct osmocom_ms *ms);
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
index cccf279..756d302 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
@@ -172,6 +172,9 @@ struct gsm48_rrlayer {
struct osmo_timer_list t_meas;
struct gsm48_rr_meas meas;
uint8_t monitor;
+
+ /* audio flow */
+ uint8_t audio_mode;
};
const char *get_rr_name(int value);
@@ -193,5 +196,7 @@ extern const char *gsm48_rr_state_names[];
int gsm48_rr_start_monitor(struct osmocom_ms *ms);
int gsm48_rr_stop_monitor(struct osmocom_ms *ms);
int gsm48_rr_alter_delay(struct osmocom_ms *ms);
+int gsm48_rr_tx_voice(struct osmocom_ms *ms, struct msgb *msg);
+int gsm48_rr_audio_mode(struct osmocom_ms *ms, uint8_t mode);
#endif /* _GSM48_RR_H */
diff --git a/src/host/layer23/include/osmocom/bb/mobile/voice.h b/src/host/layer23/include/osmocom/bb/mobile/voice.h
new file mode 100644
index 0000000..a052418
--- /dev/null
+++ b/src/host/layer23/include/osmocom/bb/mobile/voice.h
@@ -0,0 +1,7 @@
+#ifndef _voice_h
+#define _voice_h
+
+int gsm_voice_init(struct osmocom_ms *ms);
+int gsm_send_voice(struct osmocom_ms *ms, struct gsm_data_frame *data);
+
+#endif /* _voice_h */