On Thu, Dec 05, 2013 at 04:02:36PM +0100, Andreas Eversberg wrote:
+struct bts_codec_conf {
+ uint8_t hr;
+ uint8_t efr;
+ uint8_t afs;
+ uint8_t ahs;
this naming appears odd. Where is it coming from? Do you know of a
BTS that supports AMR on TCH/F but not on TCH/H?
+DEFUN(cfg_bts_codec1, cfg_bts_codec1_cmd,
+DEFUN(cfg_bts_codec2, cfg_bts_codec2_cmd,
+DEFUN(cfg_bts_codec3, cfg_bts_codec3_cmd,
+DEFUN(cfg_bts_codec4, cfg_bts_codec4_cmd,
+DEFUN(cfg_bts_codec5, cfg_bts_codec5_cmd,
please remove the code duplication and add a VTY testcase for setting
and reading this value.
+static int apply_codec_restrictions(struct gsm_bts
*bts,
+ struct gsm_mncc_bearer_cap *bcap)
+{
+ int i, j;
+
+ /* remove unsupported speech versions from list */
+ for (i = 0, j = 0; bcap->speech_ver[i] >= 0; i++) {
+ if (bcap->speech_ver[i] == 0)
+ bcap->speech_ver[j++] = 0;
+ if (bcap->speech_ver[i] == 2 && bts->codec.efr)
+ bcap->speech_ver[j++] = 2;
+ if (bcap->speech_ver[i] == 4 && bts->codec.afs)
+ bcap->speech_ver[j++] = 4;
+ if (bcap->speech_ver[i] == 1 && bts->codec.hr)
+ bcap->speech_ver[j++] = 1;
+ if (bcap->speech_ver[i] == 5 && bts->codec.ahs)
+ bcap->speech_ver[j++] = 5;
+ }
please use the values of the gsm48_bcap_speech_ver enum instead of
the magic numbers.