aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-03-23 07:52:17 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-03-25 09:07:28 +0100
commit18b63f4b4136df2b0c8872c3323c4b19f5b4030f (patch)
tree2d4b1bc0a6688047a7185c0b7c509659b098fdd3
parentec32b5860ede4b8a4192a76911137efd8b924595 (diff)
Store the GSM BTS in the gsm subscriber connection
Remove further usage of lchan from the gsm 04.11 bits
-rw-r--r--openbsc/include/openbsc/gsm_data.h3
-rw-r--r--openbsc/src/chan_alloc.c1
-rw-r--r--openbsc/src/gsm_04_11.c13
3 files changed, 9 insertions, 8 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index de69ee36a..f352711a2 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -201,8 +201,9 @@ struct gsm_subscriber_connection {
/* Are we part of a special "silent" call */
int silent_call;
- /* back pointer to the gsm_lchan */
+ /* back pointers */
struct gsm_lchan *lchan;
+ struct gsm_bts *bts;
};
struct gsm_lchan {
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c
index f2683f6dd..c8e358dc8 100644
--- a/openbsc/src/chan_alloc.c
+++ b/openbsc/src/chan_alloc.c
@@ -264,6 +264,7 @@ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type)
/* Configure the time and start it so it will be closed */
lchan->conn.lchan = lchan;
+ lchan->conn.bts = lchan->ts->trx->bts;
lchan->conn.release_timer.cb = auto_release_channel;
lchan->conn.release_timer.data = lchan;
bsc_schedule_timer(&lchan->conn.release_timer, LCHAN_RELEASE_TIMEOUT);
diff --git a/openbsc/src/gsm_04_11.c b/openbsc/src/gsm_04_11.c
index b835679f6..66ab97966 100644
--- a/openbsc/src/gsm_04_11.c
+++ b/openbsc/src/gsm_04_11.c
@@ -504,9 +504,8 @@ static int gsm340_gen_tpdu(struct msgb *msg, struct gsm_sms *sms)
/* process an incoming TPDU (called from RP-DATA)
* return value > 0: RP CAUSE for ERROR; < 0: silent error; 0 = success */
-static int gsm340_rx_tpdu(struct msgb *msg)
+static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
- struct gsm_bts *bts = msg->lchan->ts->trx->bts;
u_int8_t *smsp = msgb_sms(msg);
struct gsm_sms *gsms;
u_int8_t sms_mti, sms_mms, sms_vpf, sms_alphabet, sms_rp;
@@ -515,7 +514,7 @@ static int gsm340_rx_tpdu(struct msgb *msg)
u_int8_t address_lv[12]; /* according to 03.40 / 9.1.2.5 */
int rc = 0;
- counter_inc(bts->network->stats.sms.submitted);
+ counter_inc(conn->bts->network->stats.sms.submitted);
gsms = sms_alloc();
if (!gsms)
@@ -603,10 +602,10 @@ static int gsm340_rx_tpdu(struct msgb *msg)
dispatch_signal(SS_SMS, 0, gsms);
/* determine gsms->receiver based on dialled number */
- gsms->receiver = subscr_get_by_extension(bts->network, gsms->dest_addr);
+ gsms->receiver = subscr_get_by_extension(conn->bts->network, gsms->dest_addr);
if (!gsms->receiver) {
rc = 1; /* cause 1: unknown subscriber */
- counter_inc(bts->network->stats.sms.no_receiver);
+ counter_inc(conn->bts->network->stats.sms.no_receiver);
goto out;
}
@@ -680,7 +679,7 @@ static int gsm411_rx_rp_ud(struct msgb *msg, struct gsm_trans *trans,
DEBUGP(DSMS, "DST(%u,%s)\n", dst_len, hexdump(dst, dst_len));
- rc = gsm340_rx_tpdu(msg);
+ rc = gsm340_rx_tpdu(trans->conn, msg);
if (rc == 0)
return gsm411_send_rp_ack(trans, rph->msg_ref);
else if (rc > 0)
@@ -766,7 +765,7 @@ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans,
static int gsm411_rx_rp_error(struct msgb *msg, struct gsm_trans *trans,
struct gsm411_rp_hdr *rph)
{
- struct gsm_network *net = trans->conn->lchan->ts->trx->bts->network;
+ struct gsm_network *net = trans->conn->bts->network;
struct gsm_sms *sms = trans->sms.sms;
u_int8_t cause_len = rph->data[0];
u_int8_t cause = rph->data[1];