aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/bsc
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-04-29 19:58:52 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2021-05-27 17:06:21 +0200
commitd508143dd37cb604d9000cf073de0ac9a8fe883a (patch)
tree948779d31dc296b7cc0c5997d3ca25ddab0e45df /include/osmocom/bsc
parent025d27a31945e935a90065735a48d84938df714a (diff)
AMR config cleanup step 3: generate AMR LV on msg composition
Firstly, do not store the encoded AMR length-value bits in gsm_lchan->* before an activation/modify has actually succeeded. And secondly, do not store the AMR LV structure in struct gsm_lchan at all, but only generate the TLV exactly when a message is being composed. In gsm48_multirate_config(), generate the LV directly to a msgb instead of a static buffer first. gsm0408_test.c expected output verifies that the generated LV bytes remain unchanged. In lchan_mr_config(), introduce a target mr_conf argument, so that Chan Act and Mode Modify may generate the filtered AMR config to different locations (lchan->{activate,modify}.mr_conf_filtered). Only after receiving an ACK for Activate/Modify, set lchan->current_mr_conf from lchan->{activate,modify}.mr_conf_filtered. Use the properly scoped lchan->activate.mr_conf_filtered for Chan Act, lchan->modify.mr_conf_filtered for Mode Modify and new_lchan->current_mr_conf for Handover Command as appropriate. Related: SYS#5315 OS#4940 OS#3787 OS#3833 Change-Id: Ie57f9d0e3912632903d9740291225bfd1634ed47
Diffstat (limited to 'include/osmocom/bsc')
-rw-r--r--include/osmocom/bsc/gsm_04_08_rr.h3
-rw-r--r--include/osmocom/bsc/gsm_data.h7
2 files changed, 5 insertions, 5 deletions
diff --git a/include/osmocom/bsc/gsm_04_08_rr.h b/include/osmocom/bsc/gsm_04_08_rr.h
index 91dcbe35a..5ddee7fc3 100644
--- a/include/osmocom/bsc/gsm_04_08_rr.h
+++ b/include/osmocom/bsc/gsm_04_08_rr.h
@@ -21,7 +21,8 @@ int send_siemens_mrpci(struct gsm_lchan *lchan,
uint8_t *classmark2_lv);
int gsm48_send_rr_classmark_enquiry(struct gsm_lchan *lchan);
int gsm48_send_rr_ciph_mode(struct gsm_lchan *lchan, int want_imeisv);
-int gsm48_multirate_config(uint8_t *lv, const struct gsm48_multi_rate_conf *mr_conf,
+int gsm48_multirate_config(struct msgb *msg,
+ const struct gsm48_multi_rate_conf *mr_conf,
const struct amr_mode *modes, unsigned int num_modes);
struct msgb *gsm48_make_ho_cmd(struct gsm_lchan *new_lchan, uint8_t power_command, uint8_t ho_ref);
int gsm48_send_ho_cmd(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan,
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 04d5e52b2..3ed624f26 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -634,6 +634,7 @@ struct gsm_lchan {
struct {
struct lchan_activate_info info;
+ struct gsm48_multi_rate_conf mr_conf_filtered;
bool activ_ack; /*< true as soon as RSL Chan Activ Ack is received */
bool immediate_assignment_sent;
/*! This flag ensures that when an lchan activation has succeeded, and we have already
@@ -645,6 +646,7 @@ struct gsm_lchan {
struct {
struct lchan_modify_info info;
+ struct gsm48_multi_rate_conf mr_conf_filtered;
bool concluded;
} modify;
@@ -675,10 +677,6 @@ struct gsm_lchan {
/* Encryption information */
struct gsm_encr encr;
- /* AMR bits */
- uint8_t mr_ms_lv[7];
- uint8_t mr_bts_lv[7];
-
/* Established data link layer services */
uint8_t sapis[8];
@@ -722,6 +720,7 @@ struct gsm_lchan {
/* After the Channel Activation ACK or RSL Mode Modify ACK is received, this reflects the actually used
* channel_mode_and_rate. */
struct channel_mode_and_rate current_ch_mode_rate;
+ struct gsm48_multi_rate_conf current_mr_conf;
};
/* One Timeslot in a TRX */