1 /* GSM utility functions, e.g. coding and decoding */
3 * (C) 2008 by Daniel Willmann <daniel@totalueberwachung.de>
4 * (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
5 * (C) 2009-2010 by Harald Welte <laforge@gnumonks.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
41 char *gsm_band_name(enum gsm_band band);
42 enum gsm_band gsm_band_parse(const char *mhz);
44 int gsm_7bit_decode(char *decoded, const uint8_t *user_data, uint8_t length);
45 int gsm_7bit_encode(uint8_t *result, const char *data);
47 int ms_pwr_ctl_lvl(enum gsm_band band, unsigned int dbm);
48 int ms_pwr_dbm(enum gsm_band band, uint8_t lvl);
50 /* According to TS 08.05 Chapter 8.1.4 */
51 int rxlev2dbm(uint8_t rxlev);
52 uint8_t dbm2rxlev(int dbm);
54 /* According to GSM 04.08 Chapter 10.5.2.29 */
55 static inline int rach_max_trans_val2raw(int val) { return (val >> 1) & 3; }
56 static inline int rach_max_trans_raw2val(int raw) {
57 const int tbl[4] = { 1, 2, 4, 7 };
61 void generate_backtrace();