[gsm0408] Move send_siemens_mrpci to gsm_04_08_utils.c

This commit is contained in:
Holger Hans Peter Freyther 2009-08-21 04:57:35 +02:00
parent 9f16a869a5
commit adc1478a47
3 changed files with 20 additions and 16 deletions

View File

@ -736,4 +736,6 @@ int decode_bcd_number(char *output, int output_len, const u_int8_t *bcd_lv,
extern const char *gsm0408_cc_msg_names[];
int send_siemens_mrpci(struct gsm_lchan *lchan, u_int8_t *classmark2_lv);
#endif

View File

@ -1282,22 +1282,6 @@ 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
* a) Verify that the packet is long enough to contain the information

View File

@ -25,6 +25,7 @@
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <netinet/in.h>
#include <openbsc/msgb.h>
@ -395,3 +396,20 @@ int gsm48_mi_to_string(char *string, const int str_len, const u_int8_t *mi, cons
return str_cur - string;
}
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);
}