add code to GSM 04.08 to send MRPCI message once we have classmark2

* afert we receive a CM SERVICE REQUEST
* after we receive a PAGING RESPONSE
This commit is contained in:
Harald Welte 2009-08-10 10:12:45 +02:00
parent 5b570676cd
commit 3ac7f10450
1 changed files with 22 additions and 0 deletions

View File

@ -1420,6 +1420,21 @@ static int gsm48_tx_mm_serv_rej(struct gsm_lchan *lchan,
return gsm48_sendmsg(msg, NULL);
}
static int send_siemens_mrpci(struct gsm_lchan *lchan,
u_int8_t *classmark2_lv)
{
struct rsl_mrpci mrpci;
if (classmark2_lv[0] < 2)
return -EINVAL;
mrpci.power_class = classmark2_lv[1] & 0x7;
mrpci.vgcs_capable = classmark2_lv[2] & (1 << 1);
mrpci.vbs_capable = classmark2_lv[2] & (1 <<2);
mrpci.gsm_phase = (classmark2_lv[1]) >> 5 & 0x3;
return rsl_siemens_mrpci(lchan, &mrpci);
}
/*
* Handle CM Service Requests
@ -1470,6 +1485,9 @@ static int gsm48_rx_mm_serv_req(struct msgb *msg)
DEBUGPC(DMM, "serv_type=0x%02x mi_type=0x%02x M(%s)\n",
req->cm_service_type, mi_type, mi_string);
if (is_siemens_bts(bts))
send_siemens_mrpci(msg->lchan, classmark2-1);
subscr = subscr_get_by_tmsi(bts->network, mi_string);
/* FIXME: if we don't know the TMSI, inquire abit IMSI and allocate new TMSI */
@ -1603,6 +1621,10 @@ static int gsm48_rr_rx_pag_resp(struct msgb *msg)
mi_to_string(mi_string, sizeof(mi_string), mi_lv+1, *mi_lv);
DEBUGP(DRR, "PAGING RESPONSE: mi_type=0x%02x MI(%s)\n",
mi_type, mi_string);
if (is_siemens_bts(bts))
send_siemens_mrpci(msg->lchan, classmark2_lv);
switch (mi_type) {
case GSM_MI_TYPE_TMSI:
subscr = subscr_get_by_tmsi(bts->network, mi_string);