diff options
Diffstat (limited to 'src/gsm/rsl.c')
-rw-r--r-- | src/gsm/rsl.c | 85 |
1 files changed, 46 insertions, 39 deletions
diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c index 2ab49c23..fbba982a 100644 --- a/src/gsm/rsl.c +++ b/src/gsm/rsl.c @@ -17,10 +17,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * */ #include <stdint.h> @@ -127,6 +123,10 @@ const struct tlv_definition rsl_att_tlvdef = { [RSL_IE_LLP_APDU] = { TLV_TYPE_TLV }, [RSL_IE_SIEMENS_MRPCI] = { TLV_TYPE_TV }, [RSL_IE_OSMO_REP_ACCH_CAP] = { TLV_TYPE_TLV }, + [RSL_IE_OSMO_TRAINING_SEQUENCE] = { TLV_TYPE_TLV }, + [RSL_IE_OSMO_TEMP_OVP_ACCH_CAP] = { TLV_TYPE_TLV }, + [RSL_IE_OSMO_OSMUX_CID] = { TLV_TYPE_TLV }, + [RSL_IE_IPAC_SRTP_CONFIG] = { TLV_TYPE_TLV }, [RSL_IE_IPAC_PROXY_UDP] = { TLV_TYPE_FIXED, 2 }, [RSL_IE_IPAC_BSCMPL_TOUT] = { TLV_TYPE_TV }, [RSL_IE_IPAC_REMOTE_IP] = { TLV_TYPE_FIXED, 4 }, @@ -135,6 +135,8 @@ const struct tlv_definition rsl_att_tlvdef = { [RSL_IE_IPAC_LOCAL_PORT] = { TLV_TYPE_FIXED, 2 }, [RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV }, [RSL_IE_IPAC_LOCAL_IP] = { TLV_TYPE_FIXED, 4 }, + [RSL_IE_IPAC_CONN_STAT] = { TLV_TYPE_TLV, 28 }, + [RSL_IE_IPAC_HO_C_PARMS] = { TLV_TYPE_TLV }, [RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 }, [RSL_IE_IPAC_RTP_CSD_FMT] = { TLV_TYPE_TV }, [RSL_IE_IPAC_RTP_JIT_BUF] = { TLV_TYPE_FIXED, 2 }, @@ -158,6 +160,7 @@ uint8_t rsl_enc_chan_nr(uint8_t type, uint8_t subch, uint8_t timeslot) switch (type) { case RSL_CHAN_Lm_ACCHs: + case RSL_CHAN_OSMO_VAMOS_Lm_ACCHs: subch &= 0x01; break; case RSL_CHAN_SDCCH4_ACCH: @@ -186,38 +189,34 @@ int rsl_dec_chan_nr(uint8_t chan_nr, uint8_t *type, uint8_t *subch, uint8_t *tim { *timeslot = chan_nr & 0x7; - if ((chan_nr & 0xf8) == RSL_CHAN_Bm_ACCHs) { - *type = RSL_CHAN_Bm_ACCHs; - *subch = 0; - } else if ((chan_nr & 0xf0) == RSL_CHAN_Lm_ACCHs) { - *type = RSL_CHAN_Lm_ACCHs; - *subch = (chan_nr >> 3) & 0x1; - } else if ((chan_nr & 0xe0) == RSL_CHAN_SDCCH4_ACCH) { - *type = RSL_CHAN_SDCCH4_ACCH; - *subch = (chan_nr >> 3) & 0x3; - } else if ((chan_nr & 0xc0) == RSL_CHAN_SDCCH8_ACCH) { - *type = RSL_CHAN_SDCCH8_ACCH; - *subch = (chan_nr >> 3) & 0x7; - } else if ((chan_nr & 0xf8) == RSL_CHAN_BCCH) { - *type = RSL_CHAN_BCCH; - *subch = 0; - } else if ((chan_nr & 0xf8) == RSL_CHAN_RACH) { - *type = RSL_CHAN_RACH; - *subch = 0; - } else if ((chan_nr & 0xf8) == RSL_CHAN_PCH_AGCH) { - *type = RSL_CHAN_PCH_AGCH; - *subch = 0; - } else if ((chan_nr & 0xf8) == RSL_CHAN_OSMO_PDCH) { - *type = RSL_CHAN_OSMO_PDCH; + switch (chan_nr & RSL_CHAN_NR_MASK) { + case RSL_CHAN_Bm_ACCHs: + case RSL_CHAN_BCCH: + case RSL_CHAN_RACH: + case RSL_CHAN_PCH_AGCH: + case RSL_CHAN_OSMO_PDCH: + case RSL_CHAN_OSMO_CBCH4: + case RSL_CHAN_OSMO_CBCH8: + case RSL_CHAN_OSMO_VAMOS_Bm_ACCHs: + *type = chan_nr & RSL_CHAN_NR_MASK; *subch = 0; - } else if ((chan_nr & 0xf8) == RSL_CHAN_OSMO_CBCH4) { - *type = RSL_CHAN_OSMO_CBCH4; - *subch = 0; - } else if ((chan_nr & 0xf8) == RSL_CHAN_OSMO_CBCH8) { - *type = RSL_CHAN_OSMO_CBCH8; - *subch = 0; - } else - return -EINVAL; + break; + default: + if ((chan_nr & 0xf0) == RSL_CHAN_Lm_ACCHs) { + *type = RSL_CHAN_Lm_ACCHs; + *subch = (chan_nr >> 3) & 0x1; + } else if ((chan_nr & 0xe0) == RSL_CHAN_SDCCH4_ACCH) { + *type = RSL_CHAN_SDCCH4_ACCH; + *subch = (chan_nr >> 3) & 0x3; + } else if ((chan_nr & 0xc0) == RSL_CHAN_SDCCH8_ACCH) { + *type = RSL_CHAN_SDCCH8_ACCH; + *subch = (chan_nr >> 3) & 0x7; + } else if ((chan_nr & 0xf0) == RSL_CHAN_OSMO_VAMOS_Lm_ACCHs) { + *type = RSL_CHAN_OSMO_VAMOS_Lm_ACCHs; + *subch = (chan_nr >> 3) & 0x1; + } else + return -EINVAL; + } return 0; } @@ -253,6 +252,10 @@ char *rsl_chan_nr_str_buf(char *buf, size_t buf_len, uint8_t chan_nr) snprintf(buf, buf_len, "CBCH(SDCCH/4) on TS%d", ts); else if (cbits == ABIS_RSL_CHAN_NR_CBITS_OSMO_CBCH8) snprintf(buf, buf_len, "CBCH(SDCCH/8) on TS%d", ts); + else if (cbits == ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Bm_ACCHs) + snprintf(buf, buf_len, "VAMOS TCH/F on TS%d", ts); + else if ((cbits & 0x1e) == ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Lm_ACCHs(0)) + snprintf(buf, buf_len, "VAMOS TCH/H(%u) on TS%d", cbits & 0x01, ts); else snprintf(buf, buf_len, "UNKNOWN on TS%d", ts); @@ -265,7 +268,7 @@ char *rsl_chan_nr_str_buf(char *buf, size_t buf_len, uint8_t chan_nr) */ const char *rsl_chan_nr_str(uint8_t chan_nr) { - static __thread char str[20]; + static __thread char str[32]; return rsl_chan_nr_str_buf(str, sizeof(str), chan_nr); } @@ -276,10 +279,10 @@ const char *rsl_chan_nr_str(uint8_t chan_nr) */ char *rsl_chan_nr_str_c(const void *ctx, uint8_t chan_nr) { - char *str = talloc_size(ctx, 20); + char *str = talloc_size(ctx, 32); if (!str) return NULL; - return rsl_chan_nr_str_buf(str, 20, chan_nr); + return rsl_chan_nr_str_buf(str, 32, chan_nr); } static const struct value_string rsl_err_vals[] = { @@ -550,7 +553,7 @@ void rsl_rll_push_l3(struct msgb *msg, uint8_t msg_type, uint8_t chan_nr, /* construct a RSLms RLL message (DATA INDICATION, UNIT DATA * INDICATION) and send it off via RSLms */ - /* Push the L3 IE tag and lengh */ + /* Push the L3 IE tag and length */ msgb_tv16_push(msg, RSL_IE_L3_INFO, l3_len); /* Then push the RSL header */ @@ -618,6 +621,10 @@ const struct tlv_definition rsl_ipac_eie_tlvdef = { [RSL_IPAC_EIE_3G_NCELL_LIST] = { TLV_TYPE_TLV }, [RSL_IPAC_EIE_SDCCH_CTL_PARAM] = { TLV_TYPE_TV }, [RSL_IPAC_EIE_AMR_CONV_THRESH] = { TLV_TYPE_FIXED, 9 }, + /* Osmocom extensions: */ + [RSL_IPAC_EIE_OSMO_MEAS_AVG_CFG]= { TLV_TYPE_TLV }, + [RSL_IPAC_EIE_OSMO_MS_PWR_CTL] = { TLV_TYPE_TLV }, + [RSL_IPAC_EIE_OSMO_PC_THRESH_COMP]= { TLV_TYPE_TLV }, }, }; |