bsc_api: Remove the lchan usage from the Paging Response handling.

This commit is contained in:
Holger Hans Peter Freyther 2010-06-21 10:46:44 +08:00
parent 758f4dfa17
commit db4ef0d369
3 changed files with 14 additions and 13 deletions

View File

@ -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 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_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_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_lchan_modify(struct gsm_lchan *lchan, u_int8_t lchan_mode);
int gsm48_rx_rr_modif_ack(struct msgb *msg); int gsm48_rx_rr_modif_ack(struct msgb *msg);

View File

@ -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 */ /* 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_hdr *gh = msgb_l3(msg);
struct gsm48_pag_resp *resp; struct gsm48_pag_resp *resp;
u_int8_t *classmark2_lv = gh->data + 1; 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); memcpy(subscr->equipment.classmark2, classmark2_lv+1, *classmark2_lv);
db_sync_equipment(&subscr->equipment); db_sync_equipment(&subscr->equipment);
rc = gsm48_handle_paging_resp(msg, subscr); rc = gsm48_handle_paging_resp(conn, msg, subscr);
return rc; 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"); DEBUGP(DRR, "GRPS SUSPEND REQUEST\n");
break; break;
case GSM48_MT_RR_PAG_RESP: case GSM48_MT_RR_PAG_RESP:
rc = gsm48_rx_rr_pag_resp(msg); rc = gsm48_rx_rr_pag_resp(conn, msg);
break; break;
case GSM48_MT_RR_CHAN_MODE_MODIF_ACK: case GSM48_MT_RR_CHAN_MODE_MODIF_ACK:
rc = gsm48_rx_rr_modif_ack(msg); rc = gsm48_rx_rr_modif_ack(msg);

View File

@ -244,7 +244,8 @@ int gsm48_paging_extract_mi(struct gsm48_pag_resp *resp, int length,
mi_string, mi_type); 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 gsm_bts *bts = msg->lchan->ts->trx->bts;
struct gsm48_hdr *gh = msgb_l3(msg); 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)) if (is_siemens_bts(bts))
send_siemens_mrpci(msg->lchan, classmark2_lv); send_siemens_mrpci(msg->lchan, classmark2_lv);
if (!msg->lchan->conn.subscr) { if (!conn->subscr) {
msg->lchan->conn.subscr = subscr; conn->subscr = subscr;
} else if (msg->lchan->conn.subscr != subscr) { } else if (conn->subscr != subscr) {
LOGP(DRR, LOGL_ERROR, "<- Channel already owned by someone else?\n"); LOGP(DRR, LOGL_ERROR, "<- Channel already owned by someone else?\n");
subscr_put(subscr); subscr_put(subscr);
return -EINVAL; return -EINVAL;
} else { } else {
DEBUGP(DRR, "<- Channel already owned by us\n"); DEBUGP(DRR, "<- Channel already owned by us\n");
subscr_put(subscr); subscr_put(subscr);
subscr = msg->lchan->conn.subscr; subscr = conn->subscr;
} }
sig_data.subscr = subscr; sig_data.subscr = subscr;
sig_data.bts = msg->lchan->ts->trx->bts; sig_data.bts = conn->bts;
sig_data.conn = &msg->lchan->conn; sig_data.conn = conn;
counter_inc(bts->network->stats.paging.completed); counter_inc(bts->network->stats.paging.completed);
dispatch_signal(SS_PAGING, S_PAGING_SUCCEEDED, &sig_data); dispatch_signal(SS_PAGING, S_PAGING_SUCCEEDED, &sig_data);
/* Stop paging on the bts we received the paging response */ /* 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; return 0;
} }