Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1 | /* Ericsson RBS 2xxx GSM O&M (OM2000) messages on the A-bis interface |
| 2 | * implemented based on protocol trace analysis, no formal documentation */ |
| 3 | |
| 4 | /* (C) 2010-2011 by Harald Welte <laforge@gnumonks.org> |
| 5 | * |
| 6 | * All Rights Reserved |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU Affero General Public License as published by |
| 10 | * the Free Software Foundation; either version 3 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU Affero General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU Affero General Public License |
| 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | |
| 24 | #include <errno.h> |
| 25 | #include <unistd.h> |
| 26 | #include <stdio.h> |
| 27 | #include <stdlib.h> |
| 28 | #include <time.h> |
| 29 | #include <stdint.h> |
| 30 | |
| 31 | #include <arpa/inet.h> |
| 32 | |
| 33 | #include <osmocore/msgb.h> |
| 34 | #include <osmocore/tlv.h> |
| 35 | #include <osmocore/talloc.h> |
| 36 | #include <osmocore/utils.h> |
| 37 | |
| 38 | #include <openbsc/gsm_data.h> |
| 39 | #include <openbsc/debug.h> |
| 40 | #include <openbsc/abis_nm.h> |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 41 | #include <openbsc/abis_om2000.h> |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 42 | #include <openbsc/signal.h> |
Harald Welte | d88a387 | 2011-02-14 15:26:13 +0100 | [diff] [blame] | 43 | #include <openbsc/e1_input.h> |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 44 | |
| 45 | #define OM_ALLOC_SIZE 1024 |
| 46 | #define OM_HEADROOM_SIZE 128 |
| 47 | |
| 48 | /* use following functions from abis_nm.c: |
| 49 | * om2k_msgb_alloc() |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 50 | * abis_om2k_sendmsg() |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 51 | */ |
| 52 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 53 | struct abis_om2k_hdr { |
| 54 | struct abis_om_hdr om; |
| 55 | uint16_t msg_type; |
| 56 | struct abis_om2k_mo mo; |
| 57 | uint8_t data[0]; |
| 58 | } __attribute__ ((packed)); |
| 59 | |
| 60 | enum abis_om2k_msgtype { |
| 61 | OM2K_MSGT_ABORT_SP_CMD = 0x0000, |
| 62 | OM2K_MSGT_ABORT_SP_COMPL = 0x0002, |
| 63 | OM2K_MSGT_ALARM_REP_ACK = 0x0004, |
| 64 | OM2K_MSGT_ALARM_REP_NACK = 0x0005, |
| 65 | OM2K_MSGT_ALARM_REP = 0x0006, |
| 66 | OM2K_MSGT_ALARM_STATUS_REQ = 0x0008, |
| 67 | OM2K_MSGT_ALARM_STATUS_REQ_ACK = 0x000a, |
| 68 | OM2K_MSGT_ALARM_STATUS_REQ_REJ = 0x000b, |
| 69 | OM2K_MSGT_ALARM_STATUS_RES_ACK = 0x000c, |
| 70 | OM2K_MSGT_ALARM_STATUS_RES_NACK = 0x000d, |
| 71 | OM2K_MSGT_ALARM_STATUS_RES = 0x000e, |
| 72 | OM2K_MSGT_CAL_TIME_RESP = 0x0010, |
| 73 | OM2K_MSGT_CAL_TIME_REJ = 0x0011, |
| 74 | OM2K_MSGT_CAL_TIME_REQ = 0x0012, |
| 75 | |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 76 | OM2K_MSGT_CON_CONF_REQ = 0x0014, |
| 77 | OM2K_MSGT_CON_CONF_REQ_ACK = 0x0016, |
| 78 | OM2K_MSGT_CON_CONF_REQ_REJ = 0x0017, |
| 79 | OM2K_MSGT_CON_CONF_RES_ACK = 0x0018, |
| 80 | OM2K_MSGT_CON_CONF_RES_NACK = 0x0019, |
| 81 | OM2K_MSGT_CON_CONF_RES = 0x001a, |
| 82 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 83 | OM2K_MSGT_CONNECT_CMD = 0x001c, |
| 84 | OM2K_MSGT_CONNECT_COMPL = 0x001e, |
| 85 | OM2K_MSGT_CONNECT_REJ = 0x001f, |
| 86 | |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 87 | OM2K_MSGT_DISABLE_REQ = 0x0028, |
| 88 | OM2K_MSGT_DISABLE_REQ_ACK = 0x002a, |
| 89 | OM2K_MSGT_DISABLE_REQ_REJ = 0x002b, |
| 90 | OM2K_MSGT_DISABLE_RES_ACK = 0x002c, |
| 91 | OM2K_MSGT_DISABLE_RES_NACK = 0x002d, |
| 92 | OM2K_MSGT_DISABLE_RES = 0x002e, |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 93 | OM2K_MSGT_DISCONNECT_CMD = 0x0030, |
| 94 | OM2K_MSGT_DISCONNECT_COMPL = 0x0032, |
| 95 | OM2K_MSGT_DISCONNECT_REJ = 0x0033, |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 96 | OM2K_MSGT_ENABLE_REQ = 0x0034, |
| 97 | OM2K_MSGT_ENABLE_REQ_ACK = 0x0036, |
| 98 | OM2K_MSGT_ENABLE_REQ_REJ = 0x0037, |
| 99 | OM2K_MSGT_ENABLE_RES_ACK = 0x0038, |
| 100 | OM2K_MSGT_ENABLE_RES_NACK = 0x0039, |
| 101 | OM2K_MSGT_ENABLE_RES = 0x003a, |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 102 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 103 | OM2K_MSGT_FAULT_REP_ACK = 0x0040, |
| 104 | OM2K_MSGT_FAULT_REP_NACK = 0x0041, |
| 105 | OM2K_MSGT_FAULT_REP = 0x0042, |
| 106 | |
| 107 | OM2K_MSGT_IS_CONF_REQ = 0x0060, |
| 108 | OM2K_MSGT_IS_CONF_REQ_ACK = 0x0062, |
| 109 | OM2K_MSGT_IS_CONF_REQ_REJ = 0x0063, |
| 110 | OM2K_MSGT_IS_CONF_RES_ACK = 0x0064, |
| 111 | OM2K_MSGT_IS_CONF_RES_NACK = 0x0065, |
| 112 | OM2K_MSGT_IS_CONF_RES = 0x0066, |
| 113 | |
| 114 | OM2K_MSGT_OP_INFO = 0x0074, |
| 115 | OM2K_MSGT_OP_INFO_ACK = 0x0076, |
| 116 | OM2K_MSGT_OP_INFO_REJ = 0x0077, |
| 117 | OM2K_MSGT_RESET_CMD = 0x0078, |
| 118 | OM2K_MSGT_RESET_COMPL = 0x007a, |
| 119 | OM2K_MSGT_RESET_REJ = 0x007b, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 120 | OM2K_MSGT_RX_CONF_REQ = 0x007c, |
| 121 | OM2K_MSGT_RX_CONF_REQ_ACK = 0x007e, |
| 122 | OM2K_MSGT_RX_CONF_REQ_REJ = 0x007f, |
| 123 | OM2K_MSGT_RX_CONF_RES_ACK = 0x0080, |
| 124 | OM2K_MSGT_RX_CONF_RES_NACK = 0x0081, |
| 125 | OM2K_MSGT_RX_CONF_RES = 0x0082, |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 126 | OM2K_MSGT_START_REQ = 0x0084, |
| 127 | OM2K_MSGT_START_REQ_ACK = 0x0086, |
| 128 | OM2K_MSGT_START_REQ_REJ = 0x0087, |
| 129 | OM2K_MSGT_START_RES_ACK = 0x0088, |
| 130 | OM2K_MSGT_START_RES_NACK = 0x0089, |
| 131 | OM2K_MSGT_START_RES = 0x008a, |
Harald Welte | e1d5eca | 2011-02-12 14:42:59 +0100 | [diff] [blame] | 132 | OM2K_MSGT_STATUS_REQ = 0x008c, |
| 133 | OM2K_MSGT_STATUS_RESP = 0x008e, |
| 134 | OM2K_MSGT_STATUS_REJ = 0x008f, |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 135 | |
Harald Welte | 8024d8f | 2011-02-12 15:07:30 +0100 | [diff] [blame] | 136 | OM2K_MSGT_TEST_REQ = 0x0094, |
| 137 | OM2K_MSGT_TEST_REQ_ACK = 0x0096, |
| 138 | OM2K_MSGT_TEST_REQ_REJ = 0x0097, |
| 139 | OM2K_MSGT_TEST_RES_ACK = 0x0098, |
| 140 | OM2K_MSGT_TEST_RES_NACK = 0x0099, |
| 141 | OM2K_MSGT_TEST_RES = 0x009a, |
| 142 | |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame] | 143 | OM2K_MSGT_TF_CONF_REQ = 0x00a0, |
| 144 | OM2K_MSGT_TF_CONF_REQ_ACK = 0x00a2, |
| 145 | OM2K_MSGT_TF_CONF_REQ_REJ = 0x00a3, |
| 146 | OM2K_MSGT_TF_CONF_RES_ACK = 0x00a4, |
| 147 | OM2K_MSGT_TF_CONF_RES_NACK = 0x00a5, |
| 148 | OM2K_MSGT_TF_CONF_RES = 0x00a6, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 149 | OM2K_MSGT_TS_CONF_REQ = 0x00a8, |
| 150 | OM2K_MSGT_TS_CONF_REQ_ACK = 0x00aa, |
| 151 | OM2K_MSGT_TS_CONF_REQ_REJ = 0x00ab, |
| 152 | OM2K_MSGT_TS_CONF_RES_ACK = 0x00ac, |
| 153 | OM2K_MSGT_TS_CONF_RES_NACK = 0x00ad, |
| 154 | OM2K_MSGT_TS_CONF_RES = 0x00ae, |
| 155 | OM2K_MSGT_TX_CONF_REQ = 0x00b0, |
| 156 | OM2K_MSGT_TX_CONF_REQ_ACK = 0x00b2, |
| 157 | OM2K_MSGT_TX_CONF_REQ_REJ = 0x00b3, |
| 158 | OM2K_MSGT_TX_CONF_RES_ACK = 0x00b4, |
| 159 | OM2K_MSGT_TX_CONF_RES_NACK = 0x00b5, |
| 160 | OM2K_MSGT_TX_CONF_RES = 0x00b6, |
| 161 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 162 | OM2K_MSGT_NEGOT_REQ_ACK = 0x0104, |
| 163 | OM2K_MSGT_NEGOT_REQ_NACK = 0x0105, |
| 164 | OM2K_MSGT_NEGOT_REQ = 0x0106, |
| 165 | }; |
| 166 | |
| 167 | enum abis_om2k_dei { |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 168 | OM2K_DEI_BCC = 0x06, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 169 | OM2K_DEI_BS_AG_BKS_RES = 0x07, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 170 | OM2K_DEI_BSIC = 0x09, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 171 | OM2K_DEI_BA_PA_MFRMS = 0x0a, |
| 172 | OM2K_DEI_CBCH_INDICATOR = 0x0b, |
| 173 | OM2K_DEI_CCCH_OPTIONS = 0x0c, |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 174 | OM2K_DEI_CAL_TIME = 0x0d, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 175 | OM2K_DEI_COMBINATION = 0x0f, |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 176 | OM2K_DEI_CON_CONN_LIST = 0x10, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 177 | OM2K_DEI_DRX_DEV_MAX = 0x12, |
Harald Welte | 8bcb1a0 | 2011-02-12 20:23:40 +0100 | [diff] [blame] | 178 | OM2K_DEI_END_LIST_NR = 0x13, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 179 | OM2K_DEI_EXT_COND_MAP_1 = 0x14, |
| 180 | OM2K_DEI_EXT_COND_MAP_2 = 0x15, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 181 | OM2K_DEI_FILLING_MARKER = 0x1c, |
| 182 | OM2K_DEI_FN_OFFSET = 0x1d, |
| 183 | OM2K_DEI_FREQ_LIST = 0x1e, |
| 184 | OM2K_DEI_FREQ_SPEC_RX = 0x1f, |
| 185 | OM2K_DEI_FREQ_SPEC_TX = 0x20, |
| 186 | OM2K_DEI_HSN = 0x21, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 187 | OM2K_DEI_ICM_INDICATOR = 0x22, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 188 | OM2K_DEI_INT_FAULT_MAP_1A = 0x23, |
| 189 | OM2K_DEI_INT_FAULT_MAP_1B = 0x24, |
| 190 | OM2K_DEI_INT_FAULT_MAP_2A = 0x25, |
| 191 | OM2K_DEI_INT_FAULT_MAP_2A_EXT = 0x26, |
Harald Welte | 8bcb1a0 | 2011-02-12 20:23:40 +0100 | [diff] [blame] | 192 | OM2K_DEI_IS_CONN_LIST = 0x27, |
| 193 | OM2K_DEI_LIST_NR = 0x28, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 194 | OM2K_DEI_LOCAL_ACCESS = 0x2a, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 195 | OM2K_DEI_MAIO = 0x2b, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 196 | OM2K_DEI_MO_STATE = 0x2c, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 197 | OM2K_DEI_NY1 = 0x2d, |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 198 | OM2K_DEI_OP_INFO = 0x2e, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 199 | OM2K_DEI_POWER = 0x2f, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 200 | OM2K_DEI_REASON_CODE = 0x32, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 201 | OM2K_DEI_RX_DIVERSITY = 0x33, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 202 | OM2K_DEI_RESULT_CODE = 0x35, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 203 | OM2K_DEI_T3105 = 0x38, |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame] | 204 | OM2K_DEI_TF_MODE = 0x3a, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 205 | OM2K_DEI_TS_NR = 0x3c, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 206 | OM2K_DEI_TSC = 0x3d, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 207 | OM2K_DEI_BTS_VERSION = 0x40, |
| 208 | OM2K_DEI_OML_IWD_VERSION = 0x41, |
| 209 | OM2K_DEI_RSL_IWD_VERSION = 0x42, |
| 210 | OM2K_DEI_OML_FUNC_MAP_1 = 0x43, |
| 211 | OM2K_DEI_OML_FUNC_MAP_2 = 0x44, |
| 212 | OM2K_DEI_RSL_FUNC_MAP_1 = 0x45, |
| 213 | OM2K_DEI_RSL_FUNC_MAP_2 = 0x46, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 214 | OM2K_DEI_EXT_RANGE = 0x47, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 215 | OM2K_DEI_REQ_IND = 0x48, |
| 216 | OM2K_DEI_REPL_UNIT_MAP = 0x50, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 217 | OM2K_DEI_LSC = 0x79, |
| 218 | OM2K_DEI_LSC_FILT_TIME = 0x7a, |
| 219 | OM2K_DEI_CALL_SUPV_TIME = 0x7b, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 220 | OM2K_DEI_HW_INFO_SIG = 0x84, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 221 | OM2K_DEI_TTA = 0x87, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 222 | OM2K_DEI_CAPA_SIG = 0x8a, |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 223 | OM2K_DEI_NEGOT_REC1 = 0x90, |
| 224 | OM2K_DEI_NEGOT_REC2 = 0x91, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 225 | OM2K_DEI_ENCR_ALG = 0x92, |
| 226 | OM2K_DEI_INTERF_REJ_COMB = 0x94, |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame] | 227 | OM2K_DEI_FS_OFFSET = 0x98, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 228 | OM2K_DEI_EXT_COND_MAP_2_EXT = 0x9c, |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 229 | }; |
| 230 | |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 231 | const struct tlv_definition om2k_att_tlvdef = { |
| 232 | .def = { |
| 233 | [OM2K_DEI_BCC] = { TLV_TYPE_TV }, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 234 | [OM2K_DEI_BS_AG_BKS_RES] = { TLV_TYPE_TV }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 235 | [OM2K_DEI_BSIC] = { TLV_TYPE_TV }, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 236 | [OM2K_DEI_BA_PA_MFRMS] = { TLV_TYPE_TV }, |
| 237 | [OM2K_DEI_CBCH_INDICATOR] = { TLV_TYPE_TV }, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 238 | [OM2K_DEI_INT_FAULT_MAP_1A] = { TLV_TYPE_FIXED, 6 }, |
| 239 | [OM2K_DEI_INT_FAULT_MAP_1B] = { TLV_TYPE_FIXED, 6 }, |
| 240 | [OM2K_DEI_INT_FAULT_MAP_2A] = { TLV_TYPE_FIXED, 6 }, |
| 241 | [OM2K_DEI_INT_FAULT_MAP_2A_EXT]={ TLV_TYPE_FIXED, 6 }, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 242 | [OM2K_DEI_CCCH_OPTIONS] = { TLV_TYPE_TV }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 243 | [OM2K_DEI_CAL_TIME] = { TLV_TYPE_FIXED, 6 }, |
| 244 | [OM2K_DEI_COMBINATION] = { TLV_TYPE_TV }, |
| 245 | [OM2K_DEI_CON_CONN_LIST] = { TLV_TYPE_TLV }, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 246 | [OM2K_DEI_DRX_DEV_MAX] = { TLV_TYPE_TV }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 247 | [OM2K_DEI_END_LIST_NR] = { TLV_TYPE_TV }, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 248 | [OM2K_DEI_EXT_COND_MAP_1] = { TLV_TYPE_FIXED, 2 }, |
| 249 | [OM2K_DEI_EXT_COND_MAP_2] = { TLV_TYPE_FIXED, 2 }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 250 | [OM2K_DEI_FILLING_MARKER] = { TLV_TYPE_TV }, |
| 251 | [OM2K_DEI_FN_OFFSET] = { TLV_TYPE_FIXED, 2 }, |
| 252 | [OM2K_DEI_FREQ_LIST] = { TLV_TYPE_TLV }, |
| 253 | [OM2K_DEI_FREQ_SPEC_RX] = { TLV_TYPE_FIXED, 2 }, |
| 254 | [OM2K_DEI_FREQ_SPEC_TX] = { TLV_TYPE_FIXED, 2 }, |
| 255 | [OM2K_DEI_HSN] = { TLV_TYPE_TV }, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 256 | [OM2K_DEI_ICM_INDICATOR] = { TLV_TYPE_TV }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 257 | [OM2K_DEI_IS_CONN_LIST] = { TLV_TYPE_TLV }, |
| 258 | [OM2K_DEI_LIST_NR] = { TLV_TYPE_TV }, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 259 | [OM2K_DEI_LOCAL_ACCESS] = { TLV_TYPE_TV }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 260 | [OM2K_DEI_MAIO] = { TLV_TYPE_TV }, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 261 | [OM2K_DEI_MO_STATE] = { TLV_TYPE_TV }, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 262 | [OM2K_DEI_NY1] = { TLV_TYPE_TV }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 263 | [OM2K_DEI_OP_INFO] = { TLV_TYPE_TV }, |
| 264 | [OM2K_DEI_POWER] = { TLV_TYPE_TV }, |
| 265 | [OM2K_DEI_REASON_CODE] = { TLV_TYPE_TV }, |
| 266 | [OM2K_DEI_RX_DIVERSITY] = { TLV_TYPE_TV }, |
| 267 | [OM2K_DEI_RESULT_CODE] = { TLV_TYPE_TV }, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 268 | [OM2K_DEI_T3105] = { TLV_TYPE_TV }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 269 | [OM2K_DEI_TF_MODE] = { TLV_TYPE_TV }, |
| 270 | [OM2K_DEI_TS_NR] = { TLV_TYPE_TV }, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 271 | [OM2K_DEI_TSC] = { TLV_TYPE_TV }, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 272 | [OM2K_DEI_BTS_VERSION] = { TLV_TYPE_FIXED, 12 }, |
| 273 | [OM2K_DEI_OML_IWD_VERSION] = { TLV_TYPE_FIXED, 6 }, |
| 274 | [OM2K_DEI_RSL_IWD_VERSION] = { TLV_TYPE_FIXED, 6 }, |
| 275 | [OM2K_DEI_OML_FUNC_MAP_1] = { TLV_TYPE_TLV }, |
| 276 | [OM2K_DEI_OML_FUNC_MAP_2] = { TLV_TYPE_TLV }, |
| 277 | [OM2K_DEI_RSL_FUNC_MAP_1] = { TLV_TYPE_TLV }, |
| 278 | [OM2K_DEI_RSL_FUNC_MAP_2] = { TLV_TYPE_TLV }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 279 | [OM2K_DEI_EXT_RANGE] = { TLV_TYPE_TV }, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 280 | [OM2K_DEI_REQ_IND] = { TLV_TYPE_TV }, |
| 281 | [OM2K_DEI_REPL_UNIT_MAP] = { TLV_TYPE_FIXED, 6 }, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 282 | [OM2K_DEI_LSC] = { TLV_TYPE_TV }, |
| 283 | [OM2K_DEI_LSC_FILT_TIME] = { TLV_TYPE_TV }, |
| 284 | [OM2K_DEI_CALL_SUPV_TIME] = { TLV_TYPE_TV }, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 285 | [OM2K_DEI_HW_INFO_SIG] = { TLV_TYPE_FIXED, 2 }, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 286 | [OM2K_DEI_TTA] = { TLV_TYPE_TV }, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 287 | [OM2K_DEI_CAPA_SIG] = { TLV_TYPE_FIXED, 2 }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 288 | [OM2K_DEI_NEGOT_REC1] = { TLV_TYPE_TLV }, |
| 289 | [OM2K_DEI_NEGOT_REC2] = { TLV_TYPE_TLV }, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 290 | [OM2K_DEI_ENCR_ALG] = { TLV_TYPE_TV }, |
| 291 | [OM2K_DEI_INTERF_REJ_COMB] = { TLV_TYPE_TV }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 292 | [OM2K_DEI_FS_OFFSET] = { TLV_TYPE_FIXED, 5 }, |
Harald Welte | f6d6b21 | 2011-03-05 20:13:52 +0100 | [diff] [blame^] | 293 | [OM2K_DEI_EXT_COND_MAP_2_EXT] = { TLV_TYPE_FIXED, 4 }, |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 294 | }, |
| 295 | }; |
| 296 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 297 | static const struct value_string om2k_msgcode_vals[] = { |
| 298 | { 0x0000, "Abort SP Command" }, |
| 299 | { 0x0002, "Abort SP Complete" }, |
| 300 | { 0x0004, "Alarm Report ACK" }, |
| 301 | { 0x0005, "Alarm Report NACK" }, |
| 302 | { 0x0006, "Alarm Report" }, |
| 303 | { 0x0008, "Alarm Status Request" }, |
| 304 | { 0x000a, "Alarm Status Request Accept" }, |
| 305 | { 0x000b, "Alarm Status Request Reject" }, |
| 306 | { 0x000c, "Alarm Status Result ACK" }, |
| 307 | { 0x000d, "Alarm Status Result NACK" }, |
| 308 | { 0x000e, "Alarm Status Result" }, |
| 309 | { 0x0010, "Calendar Time Response" }, |
| 310 | { 0x0011, "Calendar Time Reject" }, |
| 311 | { 0x0012, "Calendar Time Request" }, |
| 312 | { 0x0014, "CON Configuration Request" }, |
| 313 | { 0x0016, "CON Configuration Request Accept" }, |
| 314 | { 0x0017, "CON Configuration Request Reject" }, |
| 315 | { 0x0018, "CON Configuration Result ACK" }, |
| 316 | { 0x0019, "CON Configuration Result NACK" }, |
| 317 | { 0x001a, "CON Configuration Result" }, |
| 318 | { 0x001c, "Connect Command" }, |
| 319 | { 0x001e, "Connect Complete" }, |
Harald Welte | 3ede723 | 2011-03-05 17:58:13 +0100 | [diff] [blame] | 320 | { 0x001f, "Connect Reject" }, |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 321 | { 0x0028, "Disable Request" }, |
| 322 | { 0x002a, "Disable Request Accept" }, |
| 323 | { 0x002b, "Disable Request Reject" }, |
| 324 | { 0x002c, "Disable Result ACK" }, |
| 325 | { 0x002d, "Disable Result NACK" }, |
| 326 | { 0x002e, "Disable Result" }, |
| 327 | { 0x0030, "Disconnect Command" }, |
| 328 | { 0x0032, "Disconnect Complete" }, |
| 329 | { 0x0033, "Disconnect Reject" }, |
| 330 | { 0x0034, "Enable Request" }, |
| 331 | { 0x0036, "Enable Request Accept" }, |
| 332 | { 0x0037, "Enable Request Reject" }, |
| 333 | { 0x0038, "Enable Result ACK" }, |
| 334 | { 0x0039, "Enable Result NACK" }, |
| 335 | { 0x003a, "Enable Result" }, |
| 336 | { 0x003c, "Escape Downlink Normal" }, |
| 337 | { 0x003d, "Escape Downlink NACK" }, |
| 338 | { 0x003e, "Escape Uplink Normal" }, |
| 339 | { 0x003f, "Escape Uplink NACK" }, |
| 340 | { 0x0040, "Fault Report ACK" }, |
| 341 | { 0x0041, "Fault Report NACK" }, |
| 342 | { 0x0042, "Fault Report" }, |
| 343 | { 0x0044, "File Package End Command" }, |
| 344 | { 0x0046, "File Package End Result" }, |
| 345 | { 0x0047, "File Package End Reject" }, |
| 346 | { 0x0048, "File Relation Request" }, |
| 347 | { 0x004a, "File Relation Response" }, |
| 348 | { 0x004b, "File Relation Request Reject" }, |
| 349 | { 0x004c, "File Segment Transfer" }, |
| 350 | { 0x004e, "File Segment Transfer Complete" }, |
| 351 | { 0x004f, "File Segment Transfer Reject" }, |
| 352 | { 0x0050, "HW Information Request" }, |
| 353 | { 0x0052, "HW Information Request Accept" }, |
| 354 | { 0x0053, "HW Information Request Reject" }, |
| 355 | { 0x0054, "HW Information Result ACK" }, |
| 356 | { 0x0055, "HW Information Result NACK" }, |
| 357 | { 0x0056, "HW Information Result" }, |
| 358 | { 0x0060, "IS Configuration Request" }, |
| 359 | { 0x0062, "IS Configuration Request Accept" }, |
| 360 | { 0x0063, "IS Configuration Request Reject" }, |
| 361 | { 0x0064, "IS Configuration Result ACK" }, |
| 362 | { 0x0065, "IS Configuration Result NACK" }, |
| 363 | { 0x0066, "IS Configuration Result" }, |
| 364 | { 0x0068, "Load Data End" }, |
| 365 | { 0x006a, "Load Data End Result" }, |
| 366 | { 0x006b, "Load Data End Reject" }, |
| 367 | { 0x006c, "Load Data Init" }, |
| 368 | { 0x006e, "Load Data Init Accept" }, |
| 369 | { 0x006f, "Load Data Init Reject" }, |
| 370 | { 0x0070, "Loop Control Command" }, |
| 371 | { 0x0072, "Loop Control Complete" }, |
| 372 | { 0x0073, "Loop Control Reject" }, |
| 373 | { 0x0074, "Operational Information" }, |
| 374 | { 0x0076, "Operational Information Accept" }, |
| 375 | { 0x0077, "Operational Information Reject" }, |
| 376 | { 0x0078, "Reset Command" }, |
| 377 | { 0x007a, "Reset Complete" }, |
| 378 | { 0x007b, "Reset Reject" }, |
| 379 | { 0x007c, "RX Configuration Request" }, |
| 380 | { 0x007e, "RX Configuration Request Accept" }, |
| 381 | { 0x007f, "RX Configuration Request Reject" }, |
| 382 | { 0x0080, "RX Configuration Result ACK" }, |
| 383 | { 0x0081, "RX Configuration Result NACK" }, |
| 384 | { 0x0082, "RX Configuration Result" }, |
| 385 | { 0x0084, "Start Request" }, |
| 386 | { 0x0086, "Start Request Accept" }, |
| 387 | { 0x0087, "Start Request Reject" }, |
| 388 | { 0x0088, "Start Result ACK" }, |
| 389 | { 0x0089, "Start Result NACK" }, |
| 390 | { 0x008a, "Start Result" }, |
| 391 | { 0x008c, "Status Request" }, |
| 392 | { 0x008e, "Status Response" }, |
| 393 | { 0x008f, "Status Reject" }, |
| 394 | { 0x0094, "Test Request" }, |
| 395 | { 0x0096, "Test Request Accept" }, |
| 396 | { 0x0097, "Test Request Reject" }, |
| 397 | { 0x0098, "Test Result ACK" }, |
| 398 | { 0x0099, "Test Result NACK" }, |
| 399 | { 0x009a, "Test Result" }, |
| 400 | { 0x00a0, "TF Configuration Request" }, |
| 401 | { 0x00a2, "TF Configuration Request Accept" }, |
| 402 | { 0x00a3, "TF Configuration Request Reject" }, |
| 403 | { 0x00a4, "TF Configuration Result ACK" }, |
| 404 | { 0x00a5, "TF Configuration Result NACK" }, |
| 405 | { 0x00a6, "TF Configuration Result" }, |
| 406 | { 0x00a8, "TS Configuration Request" }, |
| 407 | { 0x00aa, "TS Configuration Request Accept" }, |
| 408 | { 0x00ab, "TS Configuration Request Reject" }, |
| 409 | { 0x00ac, "TS Configuration Result ACK" }, |
| 410 | { 0x00ad, "TS Configuration Result NACK" }, |
| 411 | { 0x00ae, "TS Configuration Result" }, |
| 412 | { 0x00b0, "TX Configuration Request" }, |
| 413 | { 0x00b2, "TX Configuration Request Accept" }, |
| 414 | { 0x00b3, "TX Configuration Request Reject" }, |
| 415 | { 0x00b4, "TX Configuration Result ACK" }, |
| 416 | { 0x00b5, "TX Configuration Result NACK" }, |
| 417 | { 0x00b6, "TX Configuration Result" }, |
| 418 | { 0x00bc, "DIP Alarm Report ACK" }, |
| 419 | { 0x00bd, "DIP Alarm Report NACK" }, |
| 420 | { 0x00be, "DIP Alarm Report" }, |
| 421 | { 0x00c0, "DIP Alarm Status Request" }, |
| 422 | { 0x00c2, "DIP Alarm Status Response" }, |
| 423 | { 0x00c3, "DIP Alarm Status Reject" }, |
| 424 | { 0x00c4, "DIP Quality Report I ACK" }, |
| 425 | { 0x00c5, "DIP Quality Report I NACK" }, |
| 426 | { 0x00c6, "DIP Quality Report I" }, |
| 427 | { 0x00c8, "DIP Quality Report II ACK" }, |
| 428 | { 0x00c9, "DIP Quality Report II NACK" }, |
| 429 | { 0x00ca, "DIP Quality Report II" }, |
| 430 | { 0x00dc, "DP Configuration Request" }, |
| 431 | { 0x00de, "DP Configuration Request Accept" }, |
| 432 | { 0x00df, "DP Configuration Request Reject" }, |
| 433 | { 0x00e0, "DP Configuration Result ACK" }, |
| 434 | { 0x00e1, "DP Configuration Result NACK" }, |
| 435 | { 0x00e2, "DP Configuration Result" }, |
| 436 | { 0x00e4, "Capabilities HW Info Report ACK" }, |
| 437 | { 0x00e5, "Capabilities HW Info Report NACK" }, |
| 438 | { 0x00e6, "Capabilities HW Info Report" }, |
| 439 | { 0x00e8, "Capabilities Request" }, |
| 440 | { 0x00ea, "Capabilities Request Accept" }, |
| 441 | { 0x00eb, "Capabilities Request Reject" }, |
| 442 | { 0x00ec, "Capabilities Result ACK" }, |
| 443 | { 0x00ed, "Capabilities Result NACK" }, |
| 444 | { 0x00ee, "Capabilities Result" }, |
| 445 | { 0x00f0, "FM Configuration Request" }, |
| 446 | { 0x00f2, "FM Configuration Request Accept" }, |
| 447 | { 0x00f3, "FM Configuration Request Reject" }, |
| 448 | { 0x00f4, "FM Configuration Result ACK" }, |
| 449 | { 0x00f5, "FM Configuration Result NACK" }, |
| 450 | { 0x00f6, "FM Configuration Result" }, |
| 451 | { 0x00f8, "FM Report Request" }, |
| 452 | { 0x00fa, "FM Report Response" }, |
| 453 | { 0x00fb, "FM Report Reject" }, |
| 454 | { 0x00fc, "FM Start Command" }, |
| 455 | { 0x00fe, "FM Start Complete" }, |
| 456 | { 0x00ff, "FM Start Reject" }, |
| 457 | { 0x0100, "FM Stop Command" }, |
| 458 | { 0x0102, "FM Stop Complete" }, |
| 459 | { 0x0103, "FM Stop Reject" }, |
| 460 | { 0x0104, "Negotiation Request ACK" }, |
| 461 | { 0x0105, "Negotiation Request NACK" }, |
| 462 | { 0x0106, "Negotiation Request" }, |
| 463 | { 0x0108, "BTS Initiated Request ACK" }, |
| 464 | { 0x0109, "BTS Initiated Request NACK" }, |
| 465 | { 0x010a, "BTS Initiated Request" }, |
| 466 | { 0x010c, "Radio Channels Release Command" }, |
| 467 | { 0x010e, "Radio Channels Release Complete" }, |
| 468 | { 0x010f, "Radio Channels Release Reject" }, |
| 469 | { 0x0118, "Feature Control Command" }, |
| 470 | { 0x011a, "Feature Control Complete" }, |
| 471 | { 0x011b, "Feature Control Reject" }, |
| 472 | |
| 473 | { 0, NULL } |
| 474 | }; |
| 475 | |
| 476 | /* TS 12.21 Section 9.4: Attributes */ |
| 477 | static const struct value_string om2k_attr_vals[] = { |
| 478 | { 0x00, "Accordance indication" }, |
| 479 | { 0x01, "Alarm Id" }, |
| 480 | { 0x02, "Alarm Data" }, |
| 481 | { 0x03, "Alarm Severity" }, |
| 482 | { 0x04, "Alarm Status" }, |
| 483 | { 0x05, "Alarm Status Type" }, |
| 484 | { 0x06, "BCC" }, |
| 485 | { 0x07, "BS_AG_BKS_RES" }, |
| 486 | { 0x09, "BSIC" }, |
| 487 | { 0x0a, "BA_PA_MFRMS" }, |
| 488 | { 0x0b, "CBCH Indicator" }, |
| 489 | { 0x0c, "CCCH Options" }, |
| 490 | { 0x0d, "Calendar Time" }, |
| 491 | { 0x0f, "Channel Combination" }, |
| 492 | { 0x10, "CON Connection List" }, |
| 493 | { 0x11, "Data End Indication" }, |
| 494 | { 0x12, "DRX_DEV_MAX" }, |
| 495 | { 0x13, "End List Number" }, |
| 496 | { 0x14, "External Condition Map Class 1" }, |
| 497 | { 0x15, "External Condition Map Class 2" }, |
| 498 | { 0x16, "File Relation Indication" }, |
| 499 | { 0x17, "File Revision" }, |
| 500 | { 0x18, "File Segment Data" }, |
| 501 | { 0x19, "File Segment Length" }, |
| 502 | { 0x1a, "File Segment Sequence Number" }, |
| 503 | { 0x1b, "File Size" }, |
| 504 | { 0x1c, "Filling Marker" }, |
| 505 | { 0x1d, "FN Offset" }, |
| 506 | { 0x1e, "Frequency List" }, |
| 507 | { 0x1f, "Frequency Specifier RX" }, |
| 508 | { 0x20, "Frequency Specifier TX" }, |
| 509 | { 0x21, "HSN" }, |
| 510 | { 0x22, "ICM Indicator" }, |
| 511 | { 0x23, "Internal Fault Map Class 1A" }, |
| 512 | { 0x24, "Internal Fault Map Class 1B" }, |
| 513 | { 0x25, "Internal Fault Map Class 2A" }, |
| 514 | { 0x26, "Internal Fault Map Class 2A Extension" }, |
| 515 | { 0x27, "IS Connection List" }, |
| 516 | { 0x28, "List Number" }, |
| 517 | { 0x29, "File Package State Indication" }, |
| 518 | { 0x2a, "Local Access State" }, |
| 519 | { 0x2b, "MAIO" }, |
| 520 | { 0x2c, "MO State" }, |
| 521 | { 0x2d, "Ny1" }, |
| 522 | { 0x2e, "Operational Information" }, |
| 523 | { 0x2f, "Power" }, |
| 524 | { 0x30, "RU Position Data" }, |
| 525 | { 0x31, "Protocol Error" }, |
| 526 | { 0x32, "Reason Code" }, |
| 527 | { 0x33, "Receiver Diversity" }, |
| 528 | { 0x34, "Replacement Unit Map" }, |
| 529 | { 0x35, "Result Code" }, |
| 530 | { 0x36, "RU Revision Data" }, |
| 531 | { 0x38, "T3105" }, |
| 532 | { 0x39, "Test Loop Setting" }, |
| 533 | { 0x3a, "TF Mode" }, |
| 534 | { 0x3b, "TF Compensation Value" }, |
| 535 | { 0x3c, "Time Slot Number" }, |
| 536 | { 0x3d, "TSC" }, |
| 537 | { 0x3e, "RU Logical Id" }, |
| 538 | { 0x3f, "RU Serial Number Data" }, |
| 539 | { 0x40, "BTS Version" }, |
| 540 | { 0x41, "OML IWD Version" }, |
| 541 | { 0x42, "RWL IWD Version" }, |
| 542 | { 0x43, "OML Function Map 1" }, |
| 543 | { 0x44, "OML Function Map 2" }, |
| 544 | { 0x45, "RSL Function Map 1" }, |
| 545 | { 0x46, "RSL Function Map 2" }, |
| 546 | { 0x47, "Extended Range Indicator" }, |
| 547 | { 0x48, "Request Indicators" }, |
| 548 | { 0x49, "DIP Alarm Condition Map" }, |
| 549 | { 0x4a, "ES Incoming" }, |
| 550 | { 0x4b, "ES Outgoing" }, |
| 551 | { 0x4e, "SES Incoming" }, |
| 552 | { 0x4f, "SES Outgoing" }, |
| 553 | { 0x50, "Replacement Unit Map Extension" }, |
| 554 | { 0x52, "UAS Incoming" }, |
| 555 | { 0x53, "UAS Outgoing" }, |
| 556 | { 0x58, "DF Incoming" }, |
| 557 | { 0x5a, "DF Outgoing" }, |
| 558 | { 0x5c, "SF" }, |
| 559 | { 0x60, "S Bits Setting" }, |
| 560 | { 0x61, "CRC-4 Use Option" }, |
| 561 | { 0x62, "T Parameter" }, |
| 562 | { 0x63, "N Parameter" }, |
| 563 | { 0x64, "N1 Parameter" }, |
| 564 | { 0x65, "N3 Parameter" }, |
| 565 | { 0x66, "N4 Parameter" }, |
| 566 | { 0x67, "P Parameter" }, |
| 567 | { 0x68, "Q Parameter" }, |
| 568 | { 0x69, "BI_Q1" }, |
| 569 | { 0x6a, "BI_Q2" }, |
| 570 | { 0x74, "ICM Boundary Parameters" }, |
| 571 | { 0x77, "AFT" }, |
| 572 | { 0x78, "AFT RAI" }, |
| 573 | { 0x79, "Link Supervision Control" }, |
| 574 | { 0x7a, "Link Supervision Filtering Time" }, |
| 575 | { 0x7b, "Call Supervision Time" }, |
| 576 | { 0x7c, "Interval Length UAS Incoming" }, |
| 577 | { 0x7d, "Interval Length UAS Outgoing" }, |
| 578 | { 0x7e, "ICM Channel Rate" }, |
| 579 | { 0x7f, "Attribute Identifier" }, |
| 580 | { 0x80, "FM Frequency List" }, |
| 581 | { 0x81, "FM Frequency Report" }, |
| 582 | { 0x82, "FM Percentile" }, |
| 583 | { 0x83, "FM Clear Indication" }, |
| 584 | { 0x84, "HW Info Signature" }, |
| 585 | { 0x85, "MO Record" }, |
| 586 | { 0x86, "TF Synchronisation Source" }, |
| 587 | { 0x87, "TTA" }, |
| 588 | { 0x88, "End Segment Number" }, |
| 589 | { 0x89, "Segment Number" }, |
| 590 | { 0x8a, "Capabilities Signature" }, |
| 591 | { 0x8c, "File Relation List" }, |
| 592 | { 0x90, "Negotiation Record I" }, |
| 593 | { 0x91, "Negotiation Record II" }, |
| 594 | { 0x92, "Encryption Algorithm" }, |
| 595 | { 0x94, "Interference Rejection Combining" }, |
| 596 | { 0x95, "Dedication Information" }, |
| 597 | { 0x97, "Feature Code" }, |
| 598 | { 0x98, "FS Offset" }, |
| 599 | { 0x99, "ESB Timeslot" }, |
| 600 | { 0x9a, "Master TG Instance" }, |
| 601 | { 0x9b, "Master TX Chain Delay" }, |
| 602 | { 0x9c, "External Condition Class 2 Extension" }, |
| 603 | { 0x9d, "TSs MO State" }, |
| 604 | { 0, NULL } |
| 605 | }; |
| 606 | |
Harald Welte | e1d5eca | 2011-02-12 14:42:59 +0100 | [diff] [blame] | 607 | const struct value_string om2k_mo_class_short_vals[] = { |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 608 | { 0x01, "TRXC" }, |
| 609 | { 0x03, "TS" }, |
| 610 | { 0x04, "TF" }, |
| 611 | { 0x05, "IS" }, |
| 612 | { 0x06, "CON" }, |
| 613 | { 0x07, "DP" }, |
| 614 | { 0x0a, "CF" }, |
| 615 | { 0x0b, "TX" }, |
| 616 | { 0x0c, "RX" }, |
| 617 | { 0, NULL } |
| 618 | }; |
| 619 | |
| 620 | static struct msgb *om2k_msgb_alloc(void) |
| 621 | { |
| 622 | return msgb_alloc_headroom(OM_ALLOC_SIZE, OM_HEADROOM_SIZE, |
| 623 | "OM2000"); |
| 624 | } |
| 625 | |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 626 | static int abis_om2k_tlv_parse(struct tlv_parsed *tp, const u_int8_t *buf, int len) |
| 627 | { |
| 628 | return tlv_parse(tp, &om2k_att_tlvdef, buf, len, 0, 0); |
| 629 | } |
| 630 | |
Harald Welte | d88a387 | 2011-02-14 15:26:13 +0100 | [diff] [blame] | 631 | static char *om2k_mo_name(const struct abis_om2k_mo *mo) |
| 632 | { |
| 633 | static char mo_buf[64]; |
| 634 | |
| 635 | memset(mo_buf, 0, sizeof(mo_buf)); |
| 636 | snprintf(mo_buf, sizeof(mo_buf), "%s/%02x/%02x/%02x", |
| 637 | get_value_string(om2k_mo_class_short_vals, mo->class), |
| 638 | mo->bts, mo->assoc_so, mo->inst); |
| 639 | return mo_buf; |
| 640 | } |
| 641 | |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 642 | static int abis_om2k_sendmsg(struct gsm_bts *bts, struct msgb *msg) |
| 643 | { |
Harald Welte | d88a387 | 2011-02-14 15:26:13 +0100 | [diff] [blame] | 644 | struct abis_om2k_hdr *o2h; |
| 645 | int to_trx_oml; |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 646 | |
Harald Welte | d88a387 | 2011-02-14 15:26:13 +0100 | [diff] [blame] | 647 | msg->l2h = msg->data; |
| 648 | o2h = (struct abis_om2k_hdr *) msg->l2h; |
| 649 | |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 650 | /* Compute the length in the OML header */ |
| 651 | o2h->om.length = 6 + msgb_l2len(msg)-sizeof(*o2h); |
| 652 | |
Harald Welte | d88a387 | 2011-02-14 15:26:13 +0100 | [diff] [blame] | 653 | switch (o2h->mo.class) { |
| 654 | case OM2K_MO_CLS_TRXC: |
| 655 | case OM2K_MO_CLS_TX: |
| 656 | case OM2K_MO_CLS_RX: |
| 657 | case OM2K_MO_CLS_TS: |
| 658 | /* Route through per-TRX OML Link to the appropriate TRX */ |
| 659 | to_trx_oml = 1; |
| 660 | msg->trx = gsm_bts_trx_by_nr(bts, o2h->mo.inst); |
| 661 | if (!msg->trx) { |
| 662 | LOGP(DNM, LOGL_ERROR, "MO=%s Tx Dropping msg to " |
| 663 | "non-existing TRX\n", om2k_mo_name(&o2h->mo)); |
| 664 | return -ENODEV; |
| 665 | } |
| 666 | break; |
| 667 | default: |
| 668 | /* Route through the IXU/DXU OML Link */ |
| 669 | msg->trx = bts->c0; |
| 670 | to_trx_oml = 0; |
| 671 | break; |
| 672 | } |
| 673 | |
| 674 | return _abis_nm_sendmsg(msg, to_trx_oml); |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 675 | } |
| 676 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 677 | static void fill_om2k_hdr(struct abis_om2k_hdr *o2h, const struct abis_om2k_mo *mo, |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 678 | uint16_t msg_type) |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 679 | { |
| 680 | o2h->om.mdisc = ABIS_OM_MDISC_FOM; |
| 681 | o2h->om.placement = ABIS_OM_PLACEMENT_ONLY; |
| 682 | o2h->om.sequence = 0; |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 683 | /* We fill o2h->om.length later during om2k_sendmsg() */ |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 684 | o2h->msg_type = htons(msg_type); |
| 685 | memcpy(&o2h->mo, mo, sizeof(o2h->mo)); |
| 686 | } |
| 687 | |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 688 | const struct abis_om2k_mo om2k_mo_cf = { OM2K_MO_CLS_CF, 0, 0xFF, 0 }; |
Harald Welte | 8bcb1a0 | 2011-02-12 20:23:40 +0100 | [diff] [blame] | 689 | const struct abis_om2k_mo om2k_mo_is = { OM2K_MO_CLS_IS, 0, 0xFF, 0 }; |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 690 | const struct abis_om2k_mo om2k_mo_con = { OM2K_MO_CLS_CON, 0, 0xFF, 0 }; |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame] | 691 | const struct abis_om2k_mo om2k_mo_tf = { OM2K_MO_CLS_TF, 0, 0xFF, 0 }; |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 692 | |
| 693 | static int abis_om2k_cal_time_resp(struct gsm_bts *bts) |
| 694 | { |
| 695 | struct msgb *msg = om2k_msgb_alloc(); |
| 696 | struct abis_om2k_hdr *o2k; |
| 697 | time_t tm_t; |
| 698 | struct tm *tm; |
| 699 | |
| 700 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 701 | fill_om2k_hdr(o2k, &om2k_mo_cf, OM2K_MSGT_CAL_TIME_RESP); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 702 | |
| 703 | tm_t = time(NULL); |
| 704 | tm = localtime(&tm_t); |
| 705 | |
| 706 | msgb_put_u8(msg, OM2K_DEI_CAL_TIME); |
| 707 | msgb_put_u8(msg, tm->tm_year % 100); |
| 708 | msgb_put_u8(msg, tm->tm_mon + 1); |
| 709 | msgb_put_u8(msg, tm->tm_mday); |
| 710 | msgb_put_u8(msg, tm->tm_hour); |
| 711 | msgb_put_u8(msg, tm->tm_min); |
| 712 | msgb_put_u8(msg, tm->tm_sec); |
| 713 | |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 714 | return abis_om2k_sendmsg(bts, msg); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 715 | } |
| 716 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 717 | static int abis_om2k_tx_simple(struct gsm_bts *bts, const struct abis_om2k_mo *mo, |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 718 | uint8_t msg_type) |
| 719 | { |
| 720 | struct msgb *msg = om2k_msgb_alloc(); |
| 721 | struct abis_om2k_hdr *o2k; |
| 722 | |
| 723 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 724 | fill_om2k_hdr(o2k, mo, msg_type); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 725 | |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 726 | DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(mo), |
| 727 | get_value_string(om2k_msgcode_vals, msg_type)); |
| 728 | |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 729 | return abis_om2k_sendmsg(bts, msg); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 730 | } |
| 731 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 732 | int abis_om2k_tx_reset_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 733 | { |
| 734 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_RESET_CMD); |
| 735 | } |
| 736 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 737 | int abis_om2k_tx_start_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 738 | { |
| 739 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_START_REQ); |
| 740 | } |
| 741 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 742 | int abis_om2k_tx_status_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
Harald Welte | e1d5eca | 2011-02-12 14:42:59 +0100 | [diff] [blame] | 743 | { |
| 744 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_STATUS_REQ); |
| 745 | } |
| 746 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 747 | int abis_om2k_tx_connect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
| 748 | { |
| 749 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_CONNECT_CMD); |
| 750 | } |
| 751 | |
| 752 | int abis_om2k_tx_disconnect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
| 753 | { |
| 754 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_DISCONNECT_CMD); |
| 755 | } |
| 756 | |
Harald Welte | 8024d8f | 2011-02-12 15:07:30 +0100 | [diff] [blame] | 757 | int abis_om2k_tx_test_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
| 758 | { |
| 759 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_TEST_REQ); |
| 760 | } |
| 761 | |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 762 | int abis_om2k_tx_enable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
| 763 | { |
| 764 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_ENABLE_REQ); |
| 765 | } |
| 766 | |
| 767 | int abis_om2k_tx_disable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
| 768 | { |
| 769 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_DISABLE_REQ); |
| 770 | } |
| 771 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 772 | int abis_om2k_tx_op_info(struct gsm_bts *bts, const struct abis_om2k_mo *mo, |
| 773 | uint8_t operational) |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 774 | { |
| 775 | struct msgb *msg = om2k_msgb_alloc(); |
| 776 | struct abis_om2k_hdr *o2k; |
| 777 | |
| 778 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 779 | fill_om2k_hdr(o2k, mo, OM2K_MSGT_OP_INFO); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 780 | |
| 781 | msgb_tv_put(msg, OM2K_DEI_OP_INFO, operational); |
| 782 | |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 783 | DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(mo), |
| 784 | get_value_string(om2k_msgcode_vals, OM2K_MSGT_OP_INFO)); |
| 785 | |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 786 | return abis_om2k_sendmsg(bts, msg); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 787 | } |
| 788 | |
Harald Welte | 8bcb1a0 | 2011-02-12 20:23:40 +0100 | [diff] [blame] | 789 | int abis_om2k_tx_is_conf_req(struct gsm_bts *bts, struct om2k_is_conn_grp *cg, |
| 790 | unsigned int num_cg ) |
| 791 | { |
| 792 | struct msgb *msg = om2k_msgb_alloc(); |
| 793 | struct abis_om2k_hdr *o2k; |
| 794 | |
| 795 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 796 | fill_om2k_hdr(o2k, &om2k_mo_is, OM2K_MSGT_IS_CONF_REQ); |
Harald Welte | 8bcb1a0 | 2011-02-12 20:23:40 +0100 | [diff] [blame] | 797 | |
| 798 | msgb_tv_put(msg, OM2K_DEI_LIST_NR, 1); |
| 799 | msgb_tv_put(msg, OM2K_DEI_END_LIST_NR, 1); |
| 800 | |
| 801 | msgb_tlv_put(msg, OM2K_DEI_IS_CONN_LIST, |
| 802 | num_cg * sizeof(*cg), (uint8_t *)cg); |
| 803 | |
| 804 | return abis_om2k_sendmsg(bts, msg); |
| 805 | } |
| 806 | |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 807 | int abis_om2k_tx_con_conf_req(struct gsm_bts *bts, uint8_t *data, |
| 808 | unsigned int len) |
| 809 | { |
| 810 | struct msgb *msg = om2k_msgb_alloc(); |
| 811 | struct abis_om2k_hdr *o2k; |
| 812 | |
| 813 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 814 | fill_om2k_hdr(o2k, &om2k_mo_con, OM2K_MSGT_CON_CONF_REQ); |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 815 | |
| 816 | msgb_tv_put(msg, OM2K_DEI_LIST_NR, 1); |
| 817 | msgb_tv_put(msg, OM2K_DEI_END_LIST_NR, 1); |
| 818 | |
| 819 | msgb_tlv_put(msg, OM2K_DEI_CON_CONN_LIST, len, data); |
| 820 | |
| 821 | return abis_om2k_sendmsg(bts, msg); |
| 822 | } |
| 823 | |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 824 | static void om2k_trx_to_mo(struct abis_om2k_mo *mo, |
| 825 | const struct gsm_bts_trx *trx, |
| 826 | enum abis_om2k_mo_cls cls) |
| 827 | { |
| 828 | mo->class = cls; |
| 829 | mo->bts = 0; |
| 830 | mo->inst = trx->nr; |
Harald Welte | 53492c8 | 2011-03-05 16:21:01 +0100 | [diff] [blame] | 831 | mo->assoc_so = 255; |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 832 | } |
| 833 | |
| 834 | static void om2k_ts_to_mo(struct abis_om2k_mo *mo, |
| 835 | const struct gsm_bts_trx_ts *ts) |
| 836 | { |
| 837 | mo->class = OM2K_MO_CLS_TS; |
| 838 | mo->bts = 0; |
| 839 | mo->inst = ts->nr; |
| 840 | mo->assoc_so = ts->trx->nr; |
| 841 | } |
| 842 | |
| 843 | /* Configure a Receiver MO */ |
| 844 | int abis_om2k_tx_rx_conf_req(struct gsm_bts_trx *trx) |
| 845 | { |
| 846 | struct msgb *msg = om2k_msgb_alloc(); |
| 847 | struct abis_om2k_hdr *o2k; |
| 848 | struct abis_om2k_mo mo; |
| 849 | |
| 850 | om2k_trx_to_mo(&mo, trx, OM2K_MO_CLS_RX); |
| 851 | |
| 852 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 853 | fill_om2k_hdr(o2k, &mo, OM2K_MSGT_RX_CONF_REQ); |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 854 | |
| 855 | msgb_tv16_put(msg, OM2K_DEI_FREQ_SPEC_RX, trx->arfcn); |
| 856 | msgb_tv_put(msg, OM2K_DEI_RX_DIVERSITY, 0x03); /* A+B */ |
| 857 | |
| 858 | return abis_om2k_sendmsg(trx->bts, msg); |
| 859 | } |
| 860 | |
| 861 | /* Configure a Transmitter MO */ |
| 862 | int abis_om2k_tx_tx_conf_req(struct gsm_bts_trx *trx) |
| 863 | { |
| 864 | struct msgb *msg = om2k_msgb_alloc(); |
| 865 | struct abis_om2k_hdr *o2k; |
| 866 | struct abis_om2k_mo mo; |
| 867 | |
| 868 | om2k_trx_to_mo(&mo, trx, OM2K_MO_CLS_TX); |
| 869 | |
| 870 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 871 | fill_om2k_hdr(o2k, &mo, OM2K_MSGT_TX_CONF_REQ); |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 872 | |
| 873 | msgb_tv16_put(msg, OM2K_DEI_FREQ_SPEC_TX, trx->arfcn); |
| 874 | msgb_tv_put(msg, OM2K_DEI_POWER, trx->nominal_power-trx->max_power_red); |
| 875 | msgb_tv_put(msg, OM2K_DEI_FILLING_MARKER, 0); /* Filling enabled */ |
| 876 | msgb_tv_put(msg, OM2K_DEI_BCC, trx->bts->bsic & 0x7); |
| 877 | /* Dedication Information is optional */ |
| 878 | |
| 879 | return abis_om2k_sendmsg(trx->bts, msg); |
| 880 | } |
| 881 | |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame] | 882 | enum abis_om2k_tf_mode { |
| 883 | OM2K_TF_MODE_MASTER = 0x00, |
| 884 | OM2K_TF_MODE_STANDALONE = 0x01, |
| 885 | OM2K_TF_MODE_SLAVE = 0x02, |
| 886 | OM2K_TF_MODE_UNDEFINED = 0xff, |
| 887 | }; |
| 888 | |
| 889 | static const uint8_t fs_offset_undef[5] = { 0xff, 0xff, 0xff, 0xff, 0xff }; |
| 890 | |
| 891 | int abis_om2k_tx_tf_conf_req(struct gsm_bts *bts) |
| 892 | { |
| 893 | struct msgb *msg = om2k_msgb_alloc(); |
| 894 | struct abis_om2k_hdr *o2k; |
| 895 | |
| 896 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 897 | fill_om2k_hdr(o2k, &om2k_mo_tf, OM2K_MSGT_TF_CONF_REQ); |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame] | 898 | |
| 899 | msgb_tv_put(msg, OM2K_DEI_TF_MODE, OM2K_TF_MODE_STANDALONE); |
| 900 | msgb_tv_fixed_put(msg, OM2K_DEI_FS_OFFSET, |
| 901 | sizeof(fs_offset_undef), fs_offset_undef); |
| 902 | |
| 903 | return abis_om2k_sendmsg(bts, msg); |
| 904 | } |
| 905 | |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 906 | static uint8_t pchan2comb(enum gsm_phys_chan_config pchan) |
| 907 | { |
| 908 | switch (pchan) { |
| 909 | case GSM_PCHAN_CCCH: |
| 910 | return 4; |
| 911 | case GSM_PCHAN_CCCH_SDCCH4: |
| 912 | return 5; |
| 913 | case GSM_PCHAN_SDCCH8_SACCH8C: |
| 914 | return 3; |
| 915 | case GSM_PCHAN_TCH_F: |
| 916 | case GSM_PCHAN_TCH_H: |
| 917 | case GSM_PCHAN_PDCH: |
| 918 | case GSM_PCHAN_TCH_F_PDCH: |
| 919 | return 8; |
| 920 | default: |
| 921 | return 0; |
| 922 | } |
| 923 | } |
| 924 | |
Harald Welte | 5748c20 | 2011-03-05 17:30:07 +0100 | [diff] [blame] | 925 | static int put_freq_list(uint8_t *buf, uint16_t arfcn) |
| 926 | { |
| 927 | buf[0] = 0x00; /* TX/RX address */ |
| 928 | buf[1] = (arfcn >> 8); |
| 929 | buf[2] = (arfcn & 0xff); |
| 930 | |
| 931 | return 3; |
| 932 | } |
| 933 | |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 934 | /* Compute a frequency list in OM2000 fomrmat */ |
| 935 | static int om2k_gen_freq_list(uint8_t *list, struct gsm_bts_trx_ts *ts) |
| 936 | { |
| 937 | uint8_t *cur = list; |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 938 | int len; |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 939 | |
| 940 | if (ts->hopping.enabled) { |
| 941 | unsigned int i; |
| 942 | for (i = 0; i < ts->hopping.arfcns.data_len*8; i++) { |
Harald Welte | 5748c20 | 2011-03-05 17:30:07 +0100 | [diff] [blame] | 943 | if (bitvec_get_bit_pos(&ts->hopping.arfcns, i)) |
| 944 | cur += put_freq_list(cur, i); |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 945 | } |
Harald Welte | 5748c20 | 2011-03-05 17:30:07 +0100 | [diff] [blame] | 946 | } else |
| 947 | cur += put_freq_list(cur, ts->trx->arfcn); |
| 948 | |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 949 | len = cur - list; |
| 950 | |
| 951 | return len; |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 952 | } |
| 953 | |
| 954 | int abis_om2k_tx_ts_conf_req(struct gsm_bts_trx_ts *ts) |
| 955 | { |
| 956 | struct msgb *msg = om2k_msgb_alloc(); |
| 957 | struct abis_om2k_hdr *o2k; |
| 958 | struct abis_om2k_mo mo; |
| 959 | uint8_t freq_list[64*3]; /* BA max size: 64 ARFCN */ |
| 960 | int freq_list_len; |
| 961 | |
| 962 | om2k_ts_to_mo(&mo, ts); |
| 963 | |
Harald Welte | 5748c20 | 2011-03-05 17:30:07 +0100 | [diff] [blame] | 964 | memset(freq_list, 0, sizeof(freq_list)); |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 965 | freq_list_len = om2k_gen_freq_list(freq_list, ts); |
| 966 | if (freq_list_len < 0) |
| 967 | return freq_list_len; |
| 968 | |
| 969 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 970 | fill_om2k_hdr(o2k, &mo, OM2K_MSGT_TS_CONF_REQ); |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 971 | |
| 972 | msgb_tv_put(msg, OM2K_DEI_COMBINATION, pchan2comb(ts->pchan)); |
| 973 | msgb_tv_put(msg, OM2K_DEI_TS_NR, ts->nr); |
| 974 | msgb_tlv_put(msg, OM2K_DEI_FREQ_LIST, freq_list_len, freq_list); |
| 975 | msgb_tv_put(msg, OM2K_DEI_HSN, ts->hopping.hsn); |
| 976 | msgb_tv_put(msg, OM2K_DEI_MAIO, ts->hopping.maio); |
| 977 | msgb_tv_put(msg, OM2K_DEI_BSIC, ts->trx->bts->bsic); |
| 978 | msgb_tv_put(msg, OM2K_DEI_RX_DIVERSITY, 0x03); /* A+B */ |
| 979 | msgb_tv16_put(msg, OM2K_DEI_FN_OFFSET, 0); |
| 980 | msgb_tv_put(msg, OM2K_DEI_EXT_RANGE, 0); /* Off */ |
| 981 | /* Optional: Interference Rejection Combining */ |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 982 | msgb_tv_put(msg, OM2K_DEI_INTERF_REJ_COMB, 0x00); |
| 983 | switch (ts->pchan) { |
| 984 | case GSM_PCHAN_CCCH: |
| 985 | case GSM_PCHAN_CCCH_SDCCH4: |
| 986 | msgb_tv_put(msg, OM2K_DEI_BA_PA_MFRMS, 0x06); |
| 987 | msgb_tv_put(msg, OM2K_DEI_BS_AG_BKS_RES, 0x01); |
| 988 | msgb_tv_put(msg, OM2K_DEI_DRX_DEV_MAX, 0x05); |
| 989 | /* Repeat Paging/IMM.ASS: True, Allow Paging Type 3: Yes, Page for 5 seconds (default) */ |
| 990 | msgb_tv_put(msg, OM2K_DEI_CCCH_OPTIONS, 0x01); |
| 991 | break; |
| 992 | case GSM_PCHAN_SDCCH8_SACCH8C: |
| 993 | msgb_tv_put(msg, OM2K_DEI_T3105, 0x04); |
| 994 | msgb_tv_put(msg, OM2K_DEI_NY1, 35); |
| 995 | msgb_tv_put(msg, OM2K_DEI_CBCH_INDICATOR, 0); |
| 996 | msgb_tv_put(msg, OM2K_DEI_TSC, ts->trx->bts->tsc); |
| 997 | /* Disable RF RESOURCE INDICATION on idle channels */ |
| 998 | msgb_tv_put(msg, OM2K_DEI_ICM_INDICATOR, 0); |
| 999 | break; |
| 1000 | default: |
| 1001 | msgb_tv_put(msg, OM2K_DEI_T3105, 0x04); |
| 1002 | msgb_tv_put(msg, OM2K_DEI_NY1, 35); |
| 1003 | msgb_tv_put(msg, OM2K_DEI_CBCH_INDICATOR, 0); |
| 1004 | msgb_tv_put(msg, OM2K_DEI_TSC, ts->trx->bts->tsc); |
| 1005 | /* Disable RF RESOURCE INDICATION on idle channels */ |
| 1006 | msgb_tv_put(msg, OM2K_DEI_ICM_INDICATOR, 0); |
| 1007 | msgb_tv_put(msg, OM2K_DEI_TTA, 10); /* Timer for Time Alignment */ |
| 1008 | msgb_tv_put(msg, OM2K_DEI_LSC, 1); /* enabled */ |
| 1009 | msgb_tv_put(msg, OM2K_DEI_LSC_FILT_TIME, 160); /* units of 100ms */ |
| 1010 | msgb_tv_put(msg, OM2K_DEI_CALL_SUPV_TIME, 8); |
| 1011 | msgb_tv_put(msg, OM2K_DEI_ENCR_ALG, 0x00); |
| 1012 | /* FIXME: do we need 9e/9f/a0? */ |
| 1013 | break; |
| 1014 | } |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 1015 | |
| 1016 | return abis_om2k_sendmsg(ts->trx->bts, msg); |
| 1017 | } |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 1018 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 1019 | static int abis_om2k_tx_negot_req_ack(struct gsm_bts *bts, const struct abis_om2k_mo *mo, |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 1020 | uint8_t *data, unsigned int len) |
| 1021 | { |
| 1022 | struct msgb *msg = om2k_msgb_alloc(); |
| 1023 | struct abis_om2k_hdr *o2k; |
| 1024 | |
| 1025 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
Harald Welte | 1164dce | 2011-03-05 19:21:26 +0100 | [diff] [blame] | 1026 | fill_om2k_hdr(o2k, mo, OM2K_MSGT_NEGOT_REQ_ACK); |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 1027 | |
| 1028 | msgb_tlv_put(msg, OM2K_DEI_NEGOT_REC2, len, data); |
| 1029 | |
| 1030 | DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(mo), |
| 1031 | get_value_string(om2k_msgcode_vals, OM2K_MSGT_NEGOT_REQ_ACK)); |
| 1032 | |
| 1033 | return abis_om2k_sendmsg(bts, msg); |
| 1034 | } |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1035 | |
Harald Welte | 563d316 | 2011-02-12 18:11:16 +0100 | [diff] [blame] | 1036 | struct iwd_version { |
| 1037 | uint8_t gen_char[3+1]; |
| 1038 | uint8_t rev_char[3+1]; |
| 1039 | }; |
| 1040 | |
| 1041 | struct iwd_type { |
| 1042 | uint8_t num_vers; |
| 1043 | struct iwd_version v[8]; |
| 1044 | }; |
| 1045 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1046 | static int om2k_rx_negot_req(struct msgb *msg) |
| 1047 | { |
| 1048 | struct abis_om2k_hdr *o2h = msgb_l2(msg); |
Harald Welte | 563d316 | 2011-02-12 18:11:16 +0100 | [diff] [blame] | 1049 | struct iwd_type iwd_types[16]; |
| 1050 | uint8_t num_iwd_types = o2h->data[2]; |
| 1051 | uint8_t *cur = o2h->data+3; |
| 1052 | unsigned int i, v; |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1053 | |
Harald Welte | 563d316 | 2011-02-12 18:11:16 +0100 | [diff] [blame] | 1054 | uint8_t out_buf[1024]; |
| 1055 | uint8_t *out_cur = out_buf+1; |
| 1056 | uint8_t out_num_types = 0; |
| 1057 | |
| 1058 | memset(iwd_types, 0, sizeof(iwd_types)); |
| 1059 | |
| 1060 | /* Parse the RBS-supported IWD versions into iwd_types array */ |
| 1061 | for (i = 0; i < num_iwd_types; i++) { |
| 1062 | uint8_t num_versions = *cur++; |
| 1063 | uint8_t iwd_type = *cur++; |
| 1064 | |
| 1065 | iwd_types[iwd_type].num_vers = num_versions; |
| 1066 | |
| 1067 | for (v = 0; v < num_versions; v++) { |
| 1068 | struct iwd_version *iwd_v = &iwd_types[iwd_type].v[v]; |
| 1069 | |
| 1070 | memcpy(iwd_v->gen_char, cur, 3); |
Harald Welte | 56ee6b8 | 2011-02-12 18:13:37 +0100 | [diff] [blame] | 1071 | cur += 3; |
| 1072 | memcpy(iwd_v->rev_char, cur, 3); |
| 1073 | cur += 3; |
| 1074 | |
Harald Welte | 563d316 | 2011-02-12 18:11:16 +0100 | [diff] [blame] | 1075 | DEBUGP(DNM, "\tIWD Type %u Gen %s Rev %s\n", iwd_type, |
| 1076 | iwd_v->gen_char, iwd_v->rev_char); |
| 1077 | } |
| 1078 | } |
| 1079 | |
| 1080 | /* Select the last version for each IWD type */ |
| 1081 | for (i = 0; i < ARRAY_SIZE(iwd_types); i++) { |
| 1082 | struct iwd_type *type = &iwd_types[i]; |
| 1083 | struct iwd_version *last_v; |
| 1084 | |
| 1085 | if (type->num_vers == 0) |
| 1086 | continue; |
| 1087 | |
| 1088 | out_num_types++; |
| 1089 | |
| 1090 | last_v = &type->v[type->num_vers-1]; |
| 1091 | |
| 1092 | *out_cur++ = i; |
| 1093 | memcpy(out_cur, last_v->gen_char, 3); |
| 1094 | out_cur += 3; |
| 1095 | memcpy(out_cur, last_v->rev_char, 3); |
| 1096 | out_cur += 3; |
| 1097 | } |
| 1098 | |
| 1099 | out_buf[0] = out_num_types; |
| 1100 | |
| 1101 | return abis_om2k_tx_negot_req_ack(msg->trx->bts, &o2h->mo, out_buf, out_cur - out_buf); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1102 | } |
| 1103 | |
| 1104 | static int om2k_rx_start_res(struct msgb *msg) |
| 1105 | { |
| 1106 | struct abis_om2k_hdr *o2h = msgb_l2(msg); |
| 1107 | int rc; |
| 1108 | |
| 1109 | rc = abis_om2k_tx_simple(msg->trx->bts, &o2h->mo, OM2K_MSGT_START_RES_ACK); |
| 1110 | rc = abis_om2k_tx_op_info(msg->trx->bts, &o2h->mo, 1); |
| 1111 | |
| 1112 | return rc; |
| 1113 | } |
| 1114 | |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 1115 | static int om2k_rx_op_info_ack(struct msgb *msg) |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1116 | { |
| 1117 | struct abis_om2k_hdr *o2h = msgb_l2(msg); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1118 | |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 1119 | /* FIXME: update Operational state in our structures */ |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1120 | |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 1121 | return 0; |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1122 | } |
| 1123 | |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 1124 | const struct value_string om2k_result_strings[] = { |
| 1125 | { 0x02, "Wrong state or out of sequence" }, |
| 1126 | { 0x03, "File error" }, |
| 1127 | { 0x04, "Fault, unspecified" }, |
| 1128 | { 0x05, "Tuning fault" }, |
| 1129 | { 0x06, "Protocol error" }, |
| 1130 | { 0x07, "MO not connected" }, |
| 1131 | { 0x08, "Parameter error" }, |
| 1132 | { 0x09, "Optional function not supported" }, |
| 1133 | { 0x0a, "Local access state LOCALLY DISCONNECTED" }, |
| 1134 | { 0, NULL } |
| 1135 | }; |
| 1136 | |
| 1137 | static int om2k_rx_nack(struct msgb *msg) |
| 1138 | { |
| 1139 | struct abis_om2k_hdr *o2h = msgb_l2(msg); |
| 1140 | uint16_t msg_type = ntohs(o2h->msg_type); |
| 1141 | struct tlv_parsed tp; |
| 1142 | |
| 1143 | LOGP(DNM, LOGL_ERROR, "Rx MO=%s %s", om2k_mo_name(&o2h->mo), |
| 1144 | get_value_string(om2k_msgcode_vals, msg_type)); |
| 1145 | |
| 1146 | abis_om2k_tlv_parse(&tp, o2h->data, o2h->om.length - 6); |
| 1147 | if (TLVP_PRESENT(&tp, OM2K_DEI_REASON_CODE)) |
| 1148 | LOGPC(DNM, LOGL_ERROR, ", Reason 0x%02x", |
| 1149 | *TLVP_VAL(&tp, OM2K_DEI_REASON_CODE)); |
| 1150 | |
| 1151 | if (TLVP_PRESENT(&tp, OM2K_DEI_RESULT_CODE)) |
| 1152 | LOGPC(DNM, LOGL_ERROR, ", Result %s", |
| 1153 | get_value_string(om2k_result_strings, |
| 1154 | *TLVP_VAL(&tp, OM2K_DEI_RESULT_CODE))); |
| 1155 | LOGPC(DNM, LOGL_ERROR, "\n"); |
| 1156 | |
| 1157 | return 0; |
| 1158 | } |
| 1159 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1160 | int abis_om2k_rcvmsg(struct msgb *msg) |
| 1161 | { |
| 1162 | struct gsm_bts *bts = msg->trx->bts; |
| 1163 | struct abis_om2k_hdr *o2h = msgb_l2(msg); |
| 1164 | struct abis_om_hdr *oh = &o2h->om; |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 1165 | uint16_t msg_type = ntohs(o2h->msg_type); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1166 | int rc = 0; |
| 1167 | |
| 1168 | /* Various consistency checks */ |
| 1169 | if (oh->placement != ABIS_OM_PLACEMENT_ONLY) { |
| 1170 | LOGP(DNM, LOGL_ERROR, "ABIS OML placement 0x%x not supported\n", |
| 1171 | oh->placement); |
| 1172 | if (oh->placement != ABIS_OM_PLACEMENT_FIRST) |
| 1173 | return -EINVAL; |
| 1174 | } |
| 1175 | if (oh->sequence != 0) { |
| 1176 | LOGP(DNM, LOGL_ERROR, "ABIS OML sequence 0x%x != 0x00\n", |
| 1177 | oh->sequence); |
| 1178 | return -EINVAL; |
| 1179 | } |
| 1180 | |
| 1181 | msg->l3h = (unsigned char *)o2h + sizeof(*o2h); |
| 1182 | |
| 1183 | if (oh->mdisc != ABIS_OM_MDISC_FOM) { |
| 1184 | LOGP(DNM, LOGL_ERROR, "unknown ABIS OM2000 message discriminator 0x%x\n", |
| 1185 | oh->mdisc); |
| 1186 | return -EINVAL; |
| 1187 | } |
| 1188 | |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 1189 | DEBUGP(DNM, "Rx MO=%s %s (%s)\n", om2k_mo_name(&o2h->mo), |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 1190 | get_value_string(om2k_msgcode_vals, msg_type), |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1191 | hexdump(msg->l2h, msgb_l2len(msg))); |
| 1192 | |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 1193 | switch (msg_type) { |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1194 | case OM2K_MSGT_CAL_TIME_REQ: |
| 1195 | rc = abis_om2k_cal_time_resp(bts); |
| 1196 | break; |
| 1197 | case OM2K_MSGT_FAULT_REP: |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1198 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_FAULT_REP_ACK); |
| 1199 | break; |
| 1200 | case OM2K_MSGT_NEGOT_REQ: |
| 1201 | rc = om2k_rx_negot_req(msg); |
| 1202 | break; |
| 1203 | case OM2K_MSGT_START_RES: |
| 1204 | rc = om2k_rx_start_res(msg); |
| 1205 | break; |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 1206 | case OM2K_MSGT_OP_INFO_ACK: |
| 1207 | rc = om2k_rx_op_info_ack(msg); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1208 | break; |
| 1209 | case OM2K_MSGT_IS_CONF_RES: |
| 1210 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_IS_CONF_RES_ACK); |
| 1211 | break; |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 1212 | case OM2K_MSGT_CON_CONF_RES: |
| 1213 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_CON_CONF_RES_ACK); |
| 1214 | break; |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 1215 | case OM2K_MSGT_TX_CONF_RES: |
| 1216 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TX_CONF_RES_ACK); |
| 1217 | break; |
| 1218 | case OM2K_MSGT_RX_CONF_RES: |
| 1219 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_RX_CONF_RES_ACK); |
| 1220 | break; |
| 1221 | case OM2K_MSGT_TS_CONF_RES: |
| 1222 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TS_CONF_RES_ACK); |
| 1223 | break; |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame] | 1224 | case OM2K_MSGT_TF_CONF_RES: |
| 1225 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TF_CONF_RES_ACK); |
| 1226 | break; |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1227 | case OM2K_MSGT_CONNECT_COMPL: |
| 1228 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_RESET_CMD); |
| 1229 | break; |
| 1230 | case OM2K_MSGT_RESET_COMPL: |
| 1231 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_START_REQ); |
| 1232 | break; |
Harald Welte | b3d70fd | 2011-02-13 12:43:44 +0100 | [diff] [blame] | 1233 | case OM2K_MSGT_ENABLE_RES: |
| 1234 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_ENABLE_RES_ACK); |
| 1235 | break; |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 1236 | case OM2K_MSGT_DISABLE_RES: |
| 1237 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_DISABLE_RES_ACK); |
| 1238 | break; |
| 1239 | case OM2K_MSGT_TEST_RES: |
| 1240 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TEST_RES_ACK); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1241 | break; |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 1242 | case OM2K_MSGT_STATUS_RESP: |
| 1243 | break; |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 1244 | case OM2K_MSGT_START_REQ_ACK: |
| 1245 | case OM2K_MSGT_CON_CONF_REQ_ACK: |
| 1246 | case OM2K_MSGT_IS_CONF_REQ_ACK: |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 1247 | case OM2K_MSGT_TX_CONF_REQ_ACK: |
| 1248 | case OM2K_MSGT_RX_CONF_REQ_ACK: |
| 1249 | case OM2K_MSGT_TS_CONF_REQ_ACK: |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame] | 1250 | case OM2K_MSGT_TF_CONF_REQ_ACK: |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 1251 | case OM2K_MSGT_ENABLE_REQ_ACK: |
| 1252 | case OM2K_MSGT_ALARM_STATUS_REQ_ACK: |
| 1253 | case OM2K_MSGT_DISABLE_REQ_ACK: |
| 1254 | break; |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 1255 | case OM2K_MSGT_START_REQ_REJ: |
Harald Welte | 3ede723 | 2011-03-05 17:58:13 +0100 | [diff] [blame] | 1256 | case OM2K_MSGT_CONNECT_REJ: |
Harald Welte | aff63bc | 2011-03-05 19:42:16 +0100 | [diff] [blame] | 1257 | case OM2K_MSGT_OP_INFO_REJ: |
Harald Welte | 3ede723 | 2011-03-05 17:58:13 +0100 | [diff] [blame] | 1258 | case OM2K_MSGT_DISCONNECT_REJ: |
Harald Welte | aff63bc | 2011-03-05 19:42:16 +0100 | [diff] [blame] | 1259 | case OM2K_MSGT_TEST_REQ_REJ: |
Harald Welte | e6e8383 | 2011-03-05 17:52:09 +0100 | [diff] [blame] | 1260 | case OM2K_MSGT_CON_CONF_REQ_REJ: |
| 1261 | case OM2K_MSGT_IS_CONF_REQ_REJ: |
| 1262 | case OM2K_MSGT_TX_CONF_REQ_REJ: |
| 1263 | case OM2K_MSGT_RX_CONF_REQ_REJ: |
| 1264 | case OM2K_MSGT_TS_CONF_REQ_REJ: |
| 1265 | case OM2K_MSGT_TF_CONF_REQ_REJ: |
| 1266 | case OM2K_MSGT_ENABLE_REQ_REJ: |
| 1267 | case OM2K_MSGT_ALARM_STATUS_REQ_REJ: |
| 1268 | case OM2K_MSGT_DISABLE_REQ_REJ: |
| 1269 | rc = om2k_rx_nack(msg); |
| 1270 | break; |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1271 | default: |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 1272 | LOGP(DNM, LOGL_NOTICE, "Rx unhandled OM2000 msg %s\n", |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 1273 | get_value_string(om2k_msgcode_vals, msg_type)); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1274 | } |
| 1275 | |
| 1276 | msgb_free(msg); |
| 1277 | return rc; |
| 1278 | } |