aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-06-21 10:46:44 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-21 16:40:09 +0800
commitdb4ef0d3699bb289e2cb333b5fa822ce279a4841 (patch)
tree7a4dbdaea688f244c37393760e964bb56cdc64b3
parent758f4dfa17f57ff4f1be98b47f5282471d83f592 (diff)
bsc_api: Remove the lchan usage from the Paging Response handling.
-rw-r--r--openbsc/include/openbsc/gsm_04_08.h2
-rw-r--r--openbsc/src/gsm_04_08.c8
-rw-r--r--openbsc/src/gsm_04_08_utils.c17
3 files changed, 14 insertions, 13 deletions
diff --git a/openbsc/include/openbsc/gsm_04_08.h b/openbsc/include/openbsc/gsm_04_08.h
index b855aa577..33da5e5a5 100644
--- a/openbsc/include/openbsc/gsm_04_08.h
+++ b/openbsc/include/openbsc/gsm_04_08.h
@@ -55,7 +55,7 @@ int decode_bcd_number(char *output, int output_len, const u_int8_t *bcd_lv,
int send_siemens_mrpci(struct gsm_lchan *lchan, u_int8_t *classmark2_lv);
int gsm48_extract_mi(uint8_t *classmark2, int length, char *mi_string, uint8_t *mi_type);
int gsm48_paging_extract_mi(struct gsm48_pag_resp *pag, int length, char *mi_string, u_int8_t *mi_type);
-int gsm48_handle_paging_resp(struct msgb *msg, struct gsm_subscriber *subscr);
+int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn, struct msgb *msg, struct gsm_subscriber *subscr);
int gsm48_lchan_modify(struct gsm_lchan *lchan, u_int8_t lchan_mode);
int gsm48_rx_rr_modif_ack(struct msgb *msg);
diff --git a/openbsc/src/gsm_04_08.c b/openbsc/src/gsm_04_08.c
index 520eed0b5..e8070522d 100644
--- a/openbsc/src/gsm_04_08.c
+++ b/openbsc/src/gsm_04_08.c
@@ -971,9 +971,9 @@ static int gsm0408_rcv_mm(struct gsm_subscriber_connection *conn, struct msgb *m
}
/* Receive a PAGING RESPONSE message from the MS */
-static int gsm48_rx_rr_pag_resp(struct msgb *msg)
+static int gsm48_rx_rr_pag_resp(struct gsm_subscriber_connection *conn, struct msgb *msg)
{
- struct gsm_bts *bts = msg->lchan->ts->trx->bts;
+ struct gsm_bts *bts = conn->bts;
struct gsm48_hdr *gh = msgb_l3(msg);
struct gsm48_pag_resp *resp;
u_int8_t *classmark2_lv = gh->data + 1;
@@ -1010,7 +1010,7 @@ static int gsm48_rx_rr_pag_resp(struct msgb *msg)
memcpy(subscr->equipment.classmark2, classmark2_lv+1, *classmark2_lv);
db_sync_equipment(&subscr->equipment);
- rc = gsm48_handle_paging_resp(msg, subscr);
+ rc = gsm48_handle_paging_resp(conn, msg, subscr);
return rc;
}
@@ -1172,7 +1172,7 @@ static int gsm0408_rcv_rr(struct gsm_subscriber_connection *conn, struct msgb *m
DEBUGP(DRR, "GRPS SUSPEND REQUEST\n");
break;
case GSM48_MT_RR_PAG_RESP:
- rc = gsm48_rx_rr_pag_resp(msg);
+ rc = gsm48_rx_rr_pag_resp(conn, msg);
break;
case GSM48_MT_RR_CHAN_MODE_MODIF_ACK:
rc = gsm48_rx_rr_modif_ack(msg);
diff --git a/openbsc/src/gsm_04_08_utils.c b/openbsc/src/gsm_04_08_utils.c
index 0b009d154..72de3b421 100644
--- a/openbsc/src/gsm_04_08_utils.c
+++ b/openbsc/src/gsm_04_08_utils.c
@@ -244,7 +244,8 @@ int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
mi_string, mi_type);
}
-int gsm48_handle_paging_resp(struct msgb *msg, struct gsm_subscriber *subscr)
+int gsm48_handle_paging_resp(struct gsm_subscriber_connection *conn,
+ struct msgb *msg, struct gsm_subscriber *subscr)
{
struct gsm_bts *bts = msg->lchan->ts->trx->bts;
struct gsm48_hdr *gh = msgb_l3(msg);
@@ -254,28 +255,28 @@ 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->conn.subscr) {
- msg->lchan->conn.subscr = subscr;
- } else if (msg->lchan->conn.subscr != subscr) {
+ if (!conn->subscr) {
+ conn->subscr = subscr;
+ } else if (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->conn.subscr;
+ subscr = conn->subscr;
}
sig_data.subscr = subscr;
- sig_data.bts = msg->lchan->ts->trx->bts;
- sig_data.conn = &msg->lchan->conn;
+ sig_data.bts = conn->bts;
+ sig_data.conn = conn;
counter_inc(bts->network->stats.paging.completed);
dispatch_signal(SS_PAGING, S_PAGING_SUCCEEDED, &sig_data);
/* Stop paging on the bts we received the paging response */
- paging_request_stop(msg->trx->bts, subscr, &msg->lchan->conn);
+ paging_request_stop(conn->bts, subscr, conn);
return 0;
}