diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-04-06 21:49:41 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-04-06 21:51:26 +0200 |
commit | 9960d59fffa176ab022c9641c7358030d7f8065c (patch) | |
tree | 18573b4edf3eb496307d4b33d99ca031c98c3981 /openbsc/src/gsm_04_08_utils.c | |
parent | 161bd6d253abeef6b181dbe9fdd245bd7c9884af (diff) | |
parent | 3c71232b112a40bf09bd9687f1bc6aed12e863a3 (diff) |
Merge remote branch 'origin/master' into on-waves/bsc-master
* Move to the new log code and update binaries
* Catch up with lchan changes from master
Conflicts:
openbsc/include/openbsc/Makefile.am
openbsc/include/openbsc/gsm_data.h
openbsc/src/Makefile.am
openbsc/src/bsc_rll.c
openbsc/src/chan_alloc.c
openbsc/src/debug.c
openbsc/src/gsm_04_08.c
openbsc/src/gsm_04_11.c
openbsc/src/gsm_subscriber_base.c
openbsc/src/handover_logic.c
openbsc/src/silent_call.c
openbsc/src/transaction.c
openbsc/src/vty_interface.c
openbsc/src/vty_interface_cmds.c
Diffstat (limited to 'openbsc/src/gsm_04_08_utils.c')
-rw-r--r-- | openbsc/src/gsm_04_08_utils.c | 55 |
1 files changed, 5 insertions, 50 deletions
diff --git a/openbsc/src/gsm_04_08_utils.c b/openbsc/src/gsm_04_08_utils.c index 2d957cae3..dbbc7fbb2 100644 --- a/openbsc/src/gsm_04_08_utils.c +++ b/openbsc/src/gsm_04_08_utils.c @@ -57,7 +57,7 @@ int gsm48_sendmsg(struct msgb *msg, struct gsm_trans *trans) * work that the caller no longer has to do */ if (trans) { gh->proto_discr = trans->protocol | (trans->transaction_id << 4); - msg->lchan = trans->lchan; + msg->lchan = trans->conn->lchan; } if (msg->lchan) { @@ -269,50 +269,6 @@ int gsm48_send_rr_release(struct gsm_lchan *lchan) return rsl_deact_sacch(lchan); } -/* Convert Mobile Identity (10.5.1.4) to string */ -int gsm48_mi_to_string(char *string, const int str_len, const u_int8_t *mi, const int mi_len) -{ - int i; - u_int8_t mi_type; - char *str_cur = string; - u_int32_t tmsi; - - mi_type = mi[0] & GSM_MI_TYPE_MASK; - - switch (mi_type) { - case GSM_MI_TYPE_NONE: - break; - case GSM_MI_TYPE_TMSI: - /* Table 10.5.4.3, reverse generate_mid_from_tmsi */ - if (mi_len == GSM48_TMSI_LEN && mi[0] == (0xf0 | GSM_MI_TYPE_TMSI)) { - memcpy(&tmsi, &mi[1], 4); - tmsi = ntohl(tmsi); - return snprintf(string, str_len, "%u", tmsi); - } - break; - case GSM_MI_TYPE_IMSI: - case GSM_MI_TYPE_IMEI: - case GSM_MI_TYPE_IMEISV: - *str_cur++ = bcd2char(mi[0] >> 4); - - for (i = 1; i < mi_len; i++) { - if (str_cur + 2 >= string + str_len) - return str_cur - string; - *str_cur++ = bcd2char(mi[i] & 0xf); - /* skip last nibble in last input byte when GSM_EVEN */ - if( (i != mi_len-1) || (mi[0] & GSM_MI_ODD)) - *str_cur++ = bcd2char(mi[i] >> 4); - } - break; - default: - break; - } - *str_cur++ = '\0'; - - return str_cur - string; -} - - int send_siemens_mrpci(struct gsm_lchan *lchan, u_int8_t *classmark2_lv) { @@ -349,16 +305,16 @@ int gsm48_handle_paging_resp(struct msgb *msg, struct gsm_subscriber *subscr) if (is_siemens_bts(bts)) send_siemens_mrpci(msg->lchan, classmark2_lv); - if (!msg->lchan->subscr) { - msg->lchan->subscr = subscr; - } else if (msg->lchan->subscr != subscr) { + if (!msg->lchan->conn.subscr) { + msg->lchan->conn.subscr = subscr; + } else if (msg->lchan->conn.subscr != subscr) { LOGP(DRR, LOGL_ERROR, "<- Channel already owned by someone else?\n"); subscr_put(subscr); return -EINVAL; } else { DEBUGP(DRR, "<- Channel already owned by us\n"); subscr_put(subscr); - subscr = msg->lchan->subscr; + subscr = msg->lchan->conn.subscr; } sig_data.subscr = subscr; @@ -659,4 +615,3 @@ int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg) return 0; } - |