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, |
| 169 | OM2K_DEI_BSIC = 0x09, |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 170 | OM2K_DEI_CAL_TIME = 0x0d, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 171 | OM2K_DEI_COMBINATION = 0x0f, |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 172 | OM2K_DEI_CON_CONN_LIST = 0x10, |
Harald Welte | 8bcb1a0 | 2011-02-12 20:23:40 +0100 | [diff] [blame] | 173 | OM2K_DEI_END_LIST_NR = 0x13, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 174 | OM2K_DEI_FILLING_MARKER = 0x1c, |
| 175 | OM2K_DEI_FN_OFFSET = 0x1d, |
| 176 | OM2K_DEI_FREQ_LIST = 0x1e, |
| 177 | OM2K_DEI_FREQ_SPEC_RX = 0x1f, |
| 178 | OM2K_DEI_FREQ_SPEC_TX = 0x20, |
| 179 | OM2K_DEI_HSN = 0x21, |
Harald Welte | 8bcb1a0 | 2011-02-12 20:23:40 +0100 | [diff] [blame] | 180 | OM2K_DEI_IS_CONN_LIST = 0x27, |
| 181 | OM2K_DEI_LIST_NR = 0x28, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 182 | OM2K_DEI_MAIO = 0x2b, |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 183 | OM2K_DEI_OP_INFO = 0x2e, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 184 | OM2K_DEI_POWER = 0x2f, |
| 185 | OM2K_DEI_RX_DIVERSITY = 0x33, |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame^] | 186 | OM2K_DEI_TF_MODE = 0x3a, |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 187 | OM2K_DEI_TS_NR = 0x3c, |
| 188 | OM2K_DEI_EXT_RANGE = 0x47, |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 189 | OM2K_DEI_NEGOT_REC1 = 0x90, |
| 190 | OM2K_DEI_NEGOT_REC2 = 0x91, |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame^] | 191 | OM2K_DEI_FS_OFFSET = 0x98, |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 192 | }; |
| 193 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 194 | static const struct value_string om2k_msgcode_vals[] = { |
| 195 | { 0x0000, "Abort SP Command" }, |
| 196 | { 0x0002, "Abort SP Complete" }, |
| 197 | { 0x0004, "Alarm Report ACK" }, |
| 198 | { 0x0005, "Alarm Report NACK" }, |
| 199 | { 0x0006, "Alarm Report" }, |
| 200 | { 0x0008, "Alarm Status Request" }, |
| 201 | { 0x000a, "Alarm Status Request Accept" }, |
| 202 | { 0x000b, "Alarm Status Request Reject" }, |
| 203 | { 0x000c, "Alarm Status Result ACK" }, |
| 204 | { 0x000d, "Alarm Status Result NACK" }, |
| 205 | { 0x000e, "Alarm Status Result" }, |
| 206 | { 0x0010, "Calendar Time Response" }, |
| 207 | { 0x0011, "Calendar Time Reject" }, |
| 208 | { 0x0012, "Calendar Time Request" }, |
| 209 | { 0x0014, "CON Configuration Request" }, |
| 210 | { 0x0016, "CON Configuration Request Accept" }, |
| 211 | { 0x0017, "CON Configuration Request Reject" }, |
| 212 | { 0x0018, "CON Configuration Result ACK" }, |
| 213 | { 0x0019, "CON Configuration Result NACK" }, |
| 214 | { 0x001a, "CON Configuration Result" }, |
| 215 | { 0x001c, "Connect Command" }, |
| 216 | { 0x001e, "Connect Complete" }, |
| 217 | { 0x001f, "Connect Rejecte" }, |
| 218 | { 0x0028, "Disable Request" }, |
| 219 | { 0x002a, "Disable Request Accept" }, |
| 220 | { 0x002b, "Disable Request Reject" }, |
| 221 | { 0x002c, "Disable Result ACK" }, |
| 222 | { 0x002d, "Disable Result NACK" }, |
| 223 | { 0x002e, "Disable Result" }, |
| 224 | { 0x0030, "Disconnect Command" }, |
| 225 | { 0x0032, "Disconnect Complete" }, |
| 226 | { 0x0033, "Disconnect Reject" }, |
| 227 | { 0x0034, "Enable Request" }, |
| 228 | { 0x0036, "Enable Request Accept" }, |
| 229 | { 0x0037, "Enable Request Reject" }, |
| 230 | { 0x0038, "Enable Result ACK" }, |
| 231 | { 0x0039, "Enable Result NACK" }, |
| 232 | { 0x003a, "Enable Result" }, |
| 233 | { 0x003c, "Escape Downlink Normal" }, |
| 234 | { 0x003d, "Escape Downlink NACK" }, |
| 235 | { 0x003e, "Escape Uplink Normal" }, |
| 236 | { 0x003f, "Escape Uplink NACK" }, |
| 237 | { 0x0040, "Fault Report ACK" }, |
| 238 | { 0x0041, "Fault Report NACK" }, |
| 239 | { 0x0042, "Fault Report" }, |
| 240 | { 0x0044, "File Package End Command" }, |
| 241 | { 0x0046, "File Package End Result" }, |
| 242 | { 0x0047, "File Package End Reject" }, |
| 243 | { 0x0048, "File Relation Request" }, |
| 244 | { 0x004a, "File Relation Response" }, |
| 245 | { 0x004b, "File Relation Request Reject" }, |
| 246 | { 0x004c, "File Segment Transfer" }, |
| 247 | { 0x004e, "File Segment Transfer Complete" }, |
| 248 | { 0x004f, "File Segment Transfer Reject" }, |
| 249 | { 0x0050, "HW Information Request" }, |
| 250 | { 0x0052, "HW Information Request Accept" }, |
| 251 | { 0x0053, "HW Information Request Reject" }, |
| 252 | { 0x0054, "HW Information Result ACK" }, |
| 253 | { 0x0055, "HW Information Result NACK" }, |
| 254 | { 0x0056, "HW Information Result" }, |
| 255 | { 0x0060, "IS Configuration Request" }, |
| 256 | { 0x0062, "IS Configuration Request Accept" }, |
| 257 | { 0x0063, "IS Configuration Request Reject" }, |
| 258 | { 0x0064, "IS Configuration Result ACK" }, |
| 259 | { 0x0065, "IS Configuration Result NACK" }, |
| 260 | { 0x0066, "IS Configuration Result" }, |
| 261 | { 0x0068, "Load Data End" }, |
| 262 | { 0x006a, "Load Data End Result" }, |
| 263 | { 0x006b, "Load Data End Reject" }, |
| 264 | { 0x006c, "Load Data Init" }, |
| 265 | { 0x006e, "Load Data Init Accept" }, |
| 266 | { 0x006f, "Load Data Init Reject" }, |
| 267 | { 0x0070, "Loop Control Command" }, |
| 268 | { 0x0072, "Loop Control Complete" }, |
| 269 | { 0x0073, "Loop Control Reject" }, |
| 270 | { 0x0074, "Operational Information" }, |
| 271 | { 0x0076, "Operational Information Accept" }, |
| 272 | { 0x0077, "Operational Information Reject" }, |
| 273 | { 0x0078, "Reset Command" }, |
| 274 | { 0x007a, "Reset Complete" }, |
| 275 | { 0x007b, "Reset Reject" }, |
| 276 | { 0x007c, "RX Configuration Request" }, |
| 277 | { 0x007e, "RX Configuration Request Accept" }, |
| 278 | { 0x007f, "RX Configuration Request Reject" }, |
| 279 | { 0x0080, "RX Configuration Result ACK" }, |
| 280 | { 0x0081, "RX Configuration Result NACK" }, |
| 281 | { 0x0082, "RX Configuration Result" }, |
| 282 | { 0x0084, "Start Request" }, |
| 283 | { 0x0086, "Start Request Accept" }, |
| 284 | { 0x0087, "Start Request Reject" }, |
| 285 | { 0x0088, "Start Result ACK" }, |
| 286 | { 0x0089, "Start Result NACK" }, |
| 287 | { 0x008a, "Start Result" }, |
| 288 | { 0x008c, "Status Request" }, |
| 289 | { 0x008e, "Status Response" }, |
| 290 | { 0x008f, "Status Reject" }, |
| 291 | { 0x0094, "Test Request" }, |
| 292 | { 0x0096, "Test Request Accept" }, |
| 293 | { 0x0097, "Test Request Reject" }, |
| 294 | { 0x0098, "Test Result ACK" }, |
| 295 | { 0x0099, "Test Result NACK" }, |
| 296 | { 0x009a, "Test Result" }, |
| 297 | { 0x00a0, "TF Configuration Request" }, |
| 298 | { 0x00a2, "TF Configuration Request Accept" }, |
| 299 | { 0x00a3, "TF Configuration Request Reject" }, |
| 300 | { 0x00a4, "TF Configuration Result ACK" }, |
| 301 | { 0x00a5, "TF Configuration Result NACK" }, |
| 302 | { 0x00a6, "TF Configuration Result" }, |
| 303 | { 0x00a8, "TS Configuration Request" }, |
| 304 | { 0x00aa, "TS Configuration Request Accept" }, |
| 305 | { 0x00ab, "TS Configuration Request Reject" }, |
| 306 | { 0x00ac, "TS Configuration Result ACK" }, |
| 307 | { 0x00ad, "TS Configuration Result NACK" }, |
| 308 | { 0x00ae, "TS Configuration Result" }, |
| 309 | { 0x00b0, "TX Configuration Request" }, |
| 310 | { 0x00b2, "TX Configuration Request Accept" }, |
| 311 | { 0x00b3, "TX Configuration Request Reject" }, |
| 312 | { 0x00b4, "TX Configuration Result ACK" }, |
| 313 | { 0x00b5, "TX Configuration Result NACK" }, |
| 314 | { 0x00b6, "TX Configuration Result" }, |
| 315 | { 0x00bc, "DIP Alarm Report ACK" }, |
| 316 | { 0x00bd, "DIP Alarm Report NACK" }, |
| 317 | { 0x00be, "DIP Alarm Report" }, |
| 318 | { 0x00c0, "DIP Alarm Status Request" }, |
| 319 | { 0x00c2, "DIP Alarm Status Response" }, |
| 320 | { 0x00c3, "DIP Alarm Status Reject" }, |
| 321 | { 0x00c4, "DIP Quality Report I ACK" }, |
| 322 | { 0x00c5, "DIP Quality Report I NACK" }, |
| 323 | { 0x00c6, "DIP Quality Report I" }, |
| 324 | { 0x00c8, "DIP Quality Report II ACK" }, |
| 325 | { 0x00c9, "DIP Quality Report II NACK" }, |
| 326 | { 0x00ca, "DIP Quality Report II" }, |
| 327 | { 0x00dc, "DP Configuration Request" }, |
| 328 | { 0x00de, "DP Configuration Request Accept" }, |
| 329 | { 0x00df, "DP Configuration Request Reject" }, |
| 330 | { 0x00e0, "DP Configuration Result ACK" }, |
| 331 | { 0x00e1, "DP Configuration Result NACK" }, |
| 332 | { 0x00e2, "DP Configuration Result" }, |
| 333 | { 0x00e4, "Capabilities HW Info Report ACK" }, |
| 334 | { 0x00e5, "Capabilities HW Info Report NACK" }, |
| 335 | { 0x00e6, "Capabilities HW Info Report" }, |
| 336 | { 0x00e8, "Capabilities Request" }, |
| 337 | { 0x00ea, "Capabilities Request Accept" }, |
| 338 | { 0x00eb, "Capabilities Request Reject" }, |
| 339 | { 0x00ec, "Capabilities Result ACK" }, |
| 340 | { 0x00ed, "Capabilities Result NACK" }, |
| 341 | { 0x00ee, "Capabilities Result" }, |
| 342 | { 0x00f0, "FM Configuration Request" }, |
| 343 | { 0x00f2, "FM Configuration Request Accept" }, |
| 344 | { 0x00f3, "FM Configuration Request Reject" }, |
| 345 | { 0x00f4, "FM Configuration Result ACK" }, |
| 346 | { 0x00f5, "FM Configuration Result NACK" }, |
| 347 | { 0x00f6, "FM Configuration Result" }, |
| 348 | { 0x00f8, "FM Report Request" }, |
| 349 | { 0x00fa, "FM Report Response" }, |
| 350 | { 0x00fb, "FM Report Reject" }, |
| 351 | { 0x00fc, "FM Start Command" }, |
| 352 | { 0x00fe, "FM Start Complete" }, |
| 353 | { 0x00ff, "FM Start Reject" }, |
| 354 | { 0x0100, "FM Stop Command" }, |
| 355 | { 0x0102, "FM Stop Complete" }, |
| 356 | { 0x0103, "FM Stop Reject" }, |
| 357 | { 0x0104, "Negotiation Request ACK" }, |
| 358 | { 0x0105, "Negotiation Request NACK" }, |
| 359 | { 0x0106, "Negotiation Request" }, |
| 360 | { 0x0108, "BTS Initiated Request ACK" }, |
| 361 | { 0x0109, "BTS Initiated Request NACK" }, |
| 362 | { 0x010a, "BTS Initiated Request" }, |
| 363 | { 0x010c, "Radio Channels Release Command" }, |
| 364 | { 0x010e, "Radio Channels Release Complete" }, |
| 365 | { 0x010f, "Radio Channels Release Reject" }, |
| 366 | { 0x0118, "Feature Control Command" }, |
| 367 | { 0x011a, "Feature Control Complete" }, |
| 368 | { 0x011b, "Feature Control Reject" }, |
| 369 | |
| 370 | { 0, NULL } |
| 371 | }; |
| 372 | |
| 373 | /* TS 12.21 Section 9.4: Attributes */ |
| 374 | static const struct value_string om2k_attr_vals[] = { |
| 375 | { 0x00, "Accordance indication" }, |
| 376 | { 0x01, "Alarm Id" }, |
| 377 | { 0x02, "Alarm Data" }, |
| 378 | { 0x03, "Alarm Severity" }, |
| 379 | { 0x04, "Alarm Status" }, |
| 380 | { 0x05, "Alarm Status Type" }, |
| 381 | { 0x06, "BCC" }, |
| 382 | { 0x07, "BS_AG_BKS_RES" }, |
| 383 | { 0x09, "BSIC" }, |
| 384 | { 0x0a, "BA_PA_MFRMS" }, |
| 385 | { 0x0b, "CBCH Indicator" }, |
| 386 | { 0x0c, "CCCH Options" }, |
| 387 | { 0x0d, "Calendar Time" }, |
| 388 | { 0x0f, "Channel Combination" }, |
| 389 | { 0x10, "CON Connection List" }, |
| 390 | { 0x11, "Data End Indication" }, |
| 391 | { 0x12, "DRX_DEV_MAX" }, |
| 392 | { 0x13, "End List Number" }, |
| 393 | { 0x14, "External Condition Map Class 1" }, |
| 394 | { 0x15, "External Condition Map Class 2" }, |
| 395 | { 0x16, "File Relation Indication" }, |
| 396 | { 0x17, "File Revision" }, |
| 397 | { 0x18, "File Segment Data" }, |
| 398 | { 0x19, "File Segment Length" }, |
| 399 | { 0x1a, "File Segment Sequence Number" }, |
| 400 | { 0x1b, "File Size" }, |
| 401 | { 0x1c, "Filling Marker" }, |
| 402 | { 0x1d, "FN Offset" }, |
| 403 | { 0x1e, "Frequency List" }, |
| 404 | { 0x1f, "Frequency Specifier RX" }, |
| 405 | { 0x20, "Frequency Specifier TX" }, |
| 406 | { 0x21, "HSN" }, |
| 407 | { 0x22, "ICM Indicator" }, |
| 408 | { 0x23, "Internal Fault Map Class 1A" }, |
| 409 | { 0x24, "Internal Fault Map Class 1B" }, |
| 410 | { 0x25, "Internal Fault Map Class 2A" }, |
| 411 | { 0x26, "Internal Fault Map Class 2A Extension" }, |
| 412 | { 0x27, "IS Connection List" }, |
| 413 | { 0x28, "List Number" }, |
| 414 | { 0x29, "File Package State Indication" }, |
| 415 | { 0x2a, "Local Access State" }, |
| 416 | { 0x2b, "MAIO" }, |
| 417 | { 0x2c, "MO State" }, |
| 418 | { 0x2d, "Ny1" }, |
| 419 | { 0x2e, "Operational Information" }, |
| 420 | { 0x2f, "Power" }, |
| 421 | { 0x30, "RU Position Data" }, |
| 422 | { 0x31, "Protocol Error" }, |
| 423 | { 0x32, "Reason Code" }, |
| 424 | { 0x33, "Receiver Diversity" }, |
| 425 | { 0x34, "Replacement Unit Map" }, |
| 426 | { 0x35, "Result Code" }, |
| 427 | { 0x36, "RU Revision Data" }, |
| 428 | { 0x38, "T3105" }, |
| 429 | { 0x39, "Test Loop Setting" }, |
| 430 | { 0x3a, "TF Mode" }, |
| 431 | { 0x3b, "TF Compensation Value" }, |
| 432 | { 0x3c, "Time Slot Number" }, |
| 433 | { 0x3d, "TSC" }, |
| 434 | { 0x3e, "RU Logical Id" }, |
| 435 | { 0x3f, "RU Serial Number Data" }, |
| 436 | { 0x40, "BTS Version" }, |
| 437 | { 0x41, "OML IWD Version" }, |
| 438 | { 0x42, "RWL IWD Version" }, |
| 439 | { 0x43, "OML Function Map 1" }, |
| 440 | { 0x44, "OML Function Map 2" }, |
| 441 | { 0x45, "RSL Function Map 1" }, |
| 442 | { 0x46, "RSL Function Map 2" }, |
| 443 | { 0x47, "Extended Range Indicator" }, |
| 444 | { 0x48, "Request Indicators" }, |
| 445 | { 0x49, "DIP Alarm Condition Map" }, |
| 446 | { 0x4a, "ES Incoming" }, |
| 447 | { 0x4b, "ES Outgoing" }, |
| 448 | { 0x4e, "SES Incoming" }, |
| 449 | { 0x4f, "SES Outgoing" }, |
| 450 | { 0x50, "Replacement Unit Map Extension" }, |
| 451 | { 0x52, "UAS Incoming" }, |
| 452 | { 0x53, "UAS Outgoing" }, |
| 453 | { 0x58, "DF Incoming" }, |
| 454 | { 0x5a, "DF Outgoing" }, |
| 455 | { 0x5c, "SF" }, |
| 456 | { 0x60, "S Bits Setting" }, |
| 457 | { 0x61, "CRC-4 Use Option" }, |
| 458 | { 0x62, "T Parameter" }, |
| 459 | { 0x63, "N Parameter" }, |
| 460 | { 0x64, "N1 Parameter" }, |
| 461 | { 0x65, "N3 Parameter" }, |
| 462 | { 0x66, "N4 Parameter" }, |
| 463 | { 0x67, "P Parameter" }, |
| 464 | { 0x68, "Q Parameter" }, |
| 465 | { 0x69, "BI_Q1" }, |
| 466 | { 0x6a, "BI_Q2" }, |
| 467 | { 0x74, "ICM Boundary Parameters" }, |
| 468 | { 0x77, "AFT" }, |
| 469 | { 0x78, "AFT RAI" }, |
| 470 | { 0x79, "Link Supervision Control" }, |
| 471 | { 0x7a, "Link Supervision Filtering Time" }, |
| 472 | { 0x7b, "Call Supervision Time" }, |
| 473 | { 0x7c, "Interval Length UAS Incoming" }, |
| 474 | { 0x7d, "Interval Length UAS Outgoing" }, |
| 475 | { 0x7e, "ICM Channel Rate" }, |
| 476 | { 0x7f, "Attribute Identifier" }, |
| 477 | { 0x80, "FM Frequency List" }, |
| 478 | { 0x81, "FM Frequency Report" }, |
| 479 | { 0x82, "FM Percentile" }, |
| 480 | { 0x83, "FM Clear Indication" }, |
| 481 | { 0x84, "HW Info Signature" }, |
| 482 | { 0x85, "MO Record" }, |
| 483 | { 0x86, "TF Synchronisation Source" }, |
| 484 | { 0x87, "TTA" }, |
| 485 | { 0x88, "End Segment Number" }, |
| 486 | { 0x89, "Segment Number" }, |
| 487 | { 0x8a, "Capabilities Signature" }, |
| 488 | { 0x8c, "File Relation List" }, |
| 489 | { 0x90, "Negotiation Record I" }, |
| 490 | { 0x91, "Negotiation Record II" }, |
| 491 | { 0x92, "Encryption Algorithm" }, |
| 492 | { 0x94, "Interference Rejection Combining" }, |
| 493 | { 0x95, "Dedication Information" }, |
| 494 | { 0x97, "Feature Code" }, |
| 495 | { 0x98, "FS Offset" }, |
| 496 | { 0x99, "ESB Timeslot" }, |
| 497 | { 0x9a, "Master TG Instance" }, |
| 498 | { 0x9b, "Master TX Chain Delay" }, |
| 499 | { 0x9c, "External Condition Class 2 Extension" }, |
| 500 | { 0x9d, "TSs MO State" }, |
| 501 | { 0, NULL } |
| 502 | }; |
| 503 | |
Harald Welte | e1d5eca | 2011-02-12 14:42:59 +0100 | [diff] [blame] | 504 | const struct value_string om2k_mo_class_short_vals[] = { |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 505 | { 0x01, "TRXC" }, |
| 506 | { 0x03, "TS" }, |
| 507 | { 0x04, "TF" }, |
| 508 | { 0x05, "IS" }, |
| 509 | { 0x06, "CON" }, |
| 510 | { 0x07, "DP" }, |
| 511 | { 0x0a, "CF" }, |
| 512 | { 0x0b, "TX" }, |
| 513 | { 0x0c, "RX" }, |
| 514 | { 0, NULL } |
| 515 | }; |
| 516 | |
| 517 | static struct msgb *om2k_msgb_alloc(void) |
| 518 | { |
| 519 | return msgb_alloc_headroom(OM_ALLOC_SIZE, OM_HEADROOM_SIZE, |
| 520 | "OM2000"); |
| 521 | } |
| 522 | |
Harald Welte | d88a387 | 2011-02-14 15:26:13 +0100 | [diff] [blame] | 523 | static char *om2k_mo_name(const struct abis_om2k_mo *mo) |
| 524 | { |
| 525 | static char mo_buf[64]; |
| 526 | |
| 527 | memset(mo_buf, 0, sizeof(mo_buf)); |
| 528 | snprintf(mo_buf, sizeof(mo_buf), "%s/%02x/%02x/%02x", |
| 529 | get_value_string(om2k_mo_class_short_vals, mo->class), |
| 530 | mo->bts, mo->assoc_so, mo->inst); |
| 531 | return mo_buf; |
| 532 | } |
| 533 | |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 534 | static int abis_om2k_sendmsg(struct gsm_bts *bts, struct msgb *msg) |
| 535 | { |
Harald Welte | d88a387 | 2011-02-14 15:26:13 +0100 | [diff] [blame] | 536 | struct abis_om2k_hdr *o2h; |
| 537 | int to_trx_oml; |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 538 | |
Harald Welte | d88a387 | 2011-02-14 15:26:13 +0100 | [diff] [blame] | 539 | msg->l2h = msg->data; |
| 540 | o2h = (struct abis_om2k_hdr *) msg->l2h; |
| 541 | |
| 542 | switch (o2h->mo.class) { |
| 543 | case OM2K_MO_CLS_TRXC: |
| 544 | case OM2K_MO_CLS_TX: |
| 545 | case OM2K_MO_CLS_RX: |
| 546 | case OM2K_MO_CLS_TS: |
| 547 | /* Route through per-TRX OML Link to the appropriate TRX */ |
| 548 | to_trx_oml = 1; |
| 549 | msg->trx = gsm_bts_trx_by_nr(bts, o2h->mo.inst); |
| 550 | if (!msg->trx) { |
| 551 | LOGP(DNM, LOGL_ERROR, "MO=%s Tx Dropping msg to " |
| 552 | "non-existing TRX\n", om2k_mo_name(&o2h->mo)); |
| 553 | return -ENODEV; |
| 554 | } |
| 555 | break; |
| 556 | default: |
| 557 | /* Route through the IXU/DXU OML Link */ |
| 558 | msg->trx = bts->c0; |
| 559 | to_trx_oml = 0; |
| 560 | break; |
| 561 | } |
| 562 | |
| 563 | return _abis_nm_sendmsg(msg, to_trx_oml); |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 564 | } |
| 565 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 566 | static void fill_om2k_hdr(struct abis_om2k_hdr *o2h, const struct abis_om2k_mo *mo, |
| 567 | uint16_t msg_type, uint8_t attr_len) |
| 568 | { |
| 569 | o2h->om.mdisc = ABIS_OM_MDISC_FOM; |
| 570 | o2h->om.placement = ABIS_OM_PLACEMENT_ONLY; |
| 571 | o2h->om.sequence = 0; |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 572 | o2h->om.length = 6 + attr_len; |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 573 | o2h->msg_type = htons(msg_type); |
| 574 | memcpy(&o2h->mo, mo, sizeof(o2h->mo)); |
| 575 | } |
| 576 | |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 577 | 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] | 578 | 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] | 579 | 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^] | 580 | 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] | 581 | |
| 582 | static int abis_om2k_cal_time_resp(struct gsm_bts *bts) |
| 583 | { |
| 584 | struct msgb *msg = om2k_msgb_alloc(); |
| 585 | struct abis_om2k_hdr *o2k; |
| 586 | time_t tm_t; |
| 587 | struct tm *tm; |
| 588 | |
| 589 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
| 590 | fill_om2k_hdr(o2k, &om2k_mo_cf, OM2K_MSGT_CAL_TIME_RESP, 7); |
| 591 | |
| 592 | tm_t = time(NULL); |
| 593 | tm = localtime(&tm_t); |
| 594 | |
| 595 | msgb_put_u8(msg, OM2K_DEI_CAL_TIME); |
| 596 | msgb_put_u8(msg, tm->tm_year % 100); |
| 597 | msgb_put_u8(msg, tm->tm_mon + 1); |
| 598 | msgb_put_u8(msg, tm->tm_mday); |
| 599 | msgb_put_u8(msg, tm->tm_hour); |
| 600 | msgb_put_u8(msg, tm->tm_min); |
| 601 | msgb_put_u8(msg, tm->tm_sec); |
| 602 | |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 603 | return abis_om2k_sendmsg(bts, msg); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 604 | } |
| 605 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 606 | 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] | 607 | uint8_t msg_type) |
| 608 | { |
| 609 | struct msgb *msg = om2k_msgb_alloc(); |
| 610 | struct abis_om2k_hdr *o2k; |
| 611 | |
| 612 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
| 613 | fill_om2k_hdr(o2k, mo, msg_type, 0); |
| 614 | |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 615 | DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(mo), |
| 616 | get_value_string(om2k_msgcode_vals, msg_type)); |
| 617 | |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 618 | return abis_om2k_sendmsg(bts, msg); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 619 | } |
| 620 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 621 | 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] | 622 | { |
| 623 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_RESET_CMD); |
| 624 | } |
| 625 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 626 | 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] | 627 | { |
| 628 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_START_REQ); |
| 629 | } |
| 630 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 631 | 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] | 632 | { |
| 633 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_STATUS_REQ); |
| 634 | } |
| 635 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 636 | int abis_om2k_tx_connect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
| 637 | { |
| 638 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_CONNECT_CMD); |
| 639 | } |
| 640 | |
| 641 | int abis_om2k_tx_disconnect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
| 642 | { |
| 643 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_DISCONNECT_CMD); |
| 644 | } |
| 645 | |
Harald Welte | 8024d8f | 2011-02-12 15:07:30 +0100 | [diff] [blame] | 646 | int abis_om2k_tx_test_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
| 647 | { |
| 648 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_TEST_REQ); |
| 649 | } |
| 650 | |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 651 | int abis_om2k_tx_enable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
| 652 | { |
| 653 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_ENABLE_REQ); |
| 654 | } |
| 655 | |
| 656 | int abis_om2k_tx_disable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo) |
| 657 | { |
| 658 | return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_DISABLE_REQ); |
| 659 | } |
| 660 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 661 | int abis_om2k_tx_op_info(struct gsm_bts *bts, const struct abis_om2k_mo *mo, |
| 662 | uint8_t operational) |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 663 | { |
| 664 | struct msgb *msg = om2k_msgb_alloc(); |
| 665 | struct abis_om2k_hdr *o2k; |
| 666 | |
| 667 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
| 668 | fill_om2k_hdr(o2k, mo, OM2K_MSGT_OP_INFO, 2); |
| 669 | |
| 670 | msgb_tv_put(msg, OM2K_DEI_OP_INFO, operational); |
| 671 | |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 672 | DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(mo), |
| 673 | get_value_string(om2k_msgcode_vals, OM2K_MSGT_OP_INFO)); |
| 674 | |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 675 | return abis_om2k_sendmsg(bts, msg); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 676 | } |
| 677 | |
Harald Welte | 8bcb1a0 | 2011-02-12 20:23:40 +0100 | [diff] [blame] | 678 | int abis_om2k_tx_is_conf_req(struct gsm_bts *bts, struct om2k_is_conn_grp *cg, |
| 679 | unsigned int num_cg ) |
| 680 | { |
| 681 | struct msgb *msg = om2k_msgb_alloc(); |
| 682 | struct abis_om2k_hdr *o2k; |
| 683 | |
| 684 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
| 685 | fill_om2k_hdr(o2k, &om2k_mo_is, OM2K_MSGT_IS_CONF_REQ, |
| 686 | 2 + 2 + TLV_GROSS_LEN(num_cg * sizeof(*cg))); |
| 687 | |
| 688 | msgb_tv_put(msg, OM2K_DEI_LIST_NR, 1); |
| 689 | msgb_tv_put(msg, OM2K_DEI_END_LIST_NR, 1); |
| 690 | |
| 691 | msgb_tlv_put(msg, OM2K_DEI_IS_CONN_LIST, |
| 692 | num_cg * sizeof(*cg), (uint8_t *)cg); |
| 693 | |
| 694 | return abis_om2k_sendmsg(bts, msg); |
| 695 | } |
| 696 | |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 697 | int abis_om2k_tx_con_conf_req(struct gsm_bts *bts, uint8_t *data, |
| 698 | unsigned int len) |
| 699 | { |
| 700 | struct msgb *msg = om2k_msgb_alloc(); |
| 701 | struct abis_om2k_hdr *o2k; |
| 702 | |
| 703 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
| 704 | fill_om2k_hdr(o2k, &om2k_mo_con, OM2K_MSGT_CON_CONF_REQ, |
| 705 | 2 + 2 + TLV_GROSS_LEN(len)); |
| 706 | |
| 707 | msgb_tv_put(msg, OM2K_DEI_LIST_NR, 1); |
| 708 | msgb_tv_put(msg, OM2K_DEI_END_LIST_NR, 1); |
| 709 | |
| 710 | msgb_tlv_put(msg, OM2K_DEI_CON_CONN_LIST, len, data); |
| 711 | |
| 712 | return abis_om2k_sendmsg(bts, msg); |
| 713 | } |
| 714 | |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 715 | static void om2k_trx_to_mo(struct abis_om2k_mo *mo, |
| 716 | const struct gsm_bts_trx *trx, |
| 717 | enum abis_om2k_mo_cls cls) |
| 718 | { |
| 719 | mo->class = cls; |
| 720 | mo->bts = 0; |
| 721 | mo->inst = trx->nr; |
| 722 | mo->assoc_so = 0; |
| 723 | } |
| 724 | |
| 725 | static void om2k_ts_to_mo(struct abis_om2k_mo *mo, |
| 726 | const struct gsm_bts_trx_ts *ts) |
| 727 | { |
| 728 | mo->class = OM2K_MO_CLS_TS; |
| 729 | mo->bts = 0; |
| 730 | mo->inst = ts->nr; |
| 731 | mo->assoc_so = ts->trx->nr; |
| 732 | } |
| 733 | |
| 734 | /* Configure a Receiver MO */ |
| 735 | int abis_om2k_tx_rx_conf_req(struct gsm_bts_trx *trx) |
| 736 | { |
| 737 | struct msgb *msg = om2k_msgb_alloc(); |
| 738 | struct abis_om2k_hdr *o2k; |
| 739 | struct abis_om2k_mo mo; |
| 740 | |
| 741 | om2k_trx_to_mo(&mo, trx, OM2K_MO_CLS_RX); |
| 742 | |
| 743 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
| 744 | fill_om2k_hdr(o2k, &mo, OM2K_MSGT_RX_CONF_REQ, 3+2); |
| 745 | |
| 746 | msgb_tv16_put(msg, OM2K_DEI_FREQ_SPEC_RX, trx->arfcn); |
| 747 | msgb_tv_put(msg, OM2K_DEI_RX_DIVERSITY, 0x03); /* A+B */ |
| 748 | |
| 749 | return abis_om2k_sendmsg(trx->bts, msg); |
| 750 | } |
| 751 | |
| 752 | /* Configure a Transmitter MO */ |
| 753 | int abis_om2k_tx_tx_conf_req(struct gsm_bts_trx *trx) |
| 754 | { |
| 755 | struct msgb *msg = om2k_msgb_alloc(); |
| 756 | struct abis_om2k_hdr *o2k; |
| 757 | struct abis_om2k_mo mo; |
| 758 | |
| 759 | om2k_trx_to_mo(&mo, trx, OM2K_MO_CLS_TX); |
| 760 | |
| 761 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
| 762 | fill_om2k_hdr(o2k, &mo, OM2K_MSGT_TX_CONF_REQ, 3+2+2+2); |
| 763 | |
| 764 | msgb_tv16_put(msg, OM2K_DEI_FREQ_SPEC_TX, trx->arfcn); |
| 765 | msgb_tv_put(msg, OM2K_DEI_POWER, trx->nominal_power-trx->max_power_red); |
| 766 | msgb_tv_put(msg, OM2K_DEI_FILLING_MARKER, 0); /* Filling enabled */ |
| 767 | msgb_tv_put(msg, OM2K_DEI_BCC, trx->bts->bsic & 0x7); |
| 768 | /* Dedication Information is optional */ |
| 769 | |
| 770 | return abis_om2k_sendmsg(trx->bts, msg); |
| 771 | } |
| 772 | |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame^] | 773 | enum abis_om2k_tf_mode { |
| 774 | OM2K_TF_MODE_MASTER = 0x00, |
| 775 | OM2K_TF_MODE_STANDALONE = 0x01, |
| 776 | OM2K_TF_MODE_SLAVE = 0x02, |
| 777 | OM2K_TF_MODE_UNDEFINED = 0xff, |
| 778 | }; |
| 779 | |
| 780 | static const uint8_t fs_offset_undef[5] = { 0xff, 0xff, 0xff, 0xff, 0xff }; |
| 781 | |
| 782 | int abis_om2k_tx_tf_conf_req(struct gsm_bts *bts) |
| 783 | { |
| 784 | struct msgb *msg = om2k_msgb_alloc(); |
| 785 | struct abis_om2k_hdr *o2k; |
| 786 | |
| 787 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
| 788 | fill_om2k_hdr(o2k, &om2k_mo_tf, OM2K_MSGT_TF_CONF_REQ, |
| 789 | 2+1+sizeof(fs_offset_undef)); |
| 790 | |
| 791 | msgb_tv_put(msg, OM2K_DEI_TF_MODE, OM2K_TF_MODE_STANDALONE); |
| 792 | msgb_tv_fixed_put(msg, OM2K_DEI_FS_OFFSET, |
| 793 | sizeof(fs_offset_undef), fs_offset_undef); |
| 794 | |
| 795 | return abis_om2k_sendmsg(bts, msg); |
| 796 | } |
| 797 | |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 798 | static uint8_t pchan2comb(enum gsm_phys_chan_config pchan) |
| 799 | { |
| 800 | switch (pchan) { |
| 801 | case GSM_PCHAN_CCCH: |
| 802 | return 4; |
| 803 | case GSM_PCHAN_CCCH_SDCCH4: |
| 804 | return 5; |
| 805 | case GSM_PCHAN_SDCCH8_SACCH8C: |
| 806 | return 3; |
| 807 | case GSM_PCHAN_TCH_F: |
| 808 | case GSM_PCHAN_TCH_H: |
| 809 | case GSM_PCHAN_PDCH: |
| 810 | case GSM_PCHAN_TCH_F_PDCH: |
| 811 | return 8; |
| 812 | default: |
| 813 | return 0; |
| 814 | } |
| 815 | } |
| 816 | |
| 817 | /* Compute a frequency list in OM2000 fomrmat */ |
| 818 | static int om2k_gen_freq_list(uint8_t *list, struct gsm_bts_trx_ts *ts) |
| 819 | { |
| 820 | uint8_t *cur = list; |
| 821 | |
| 822 | if (ts->hopping.enabled) { |
| 823 | unsigned int i; |
| 824 | for (i = 0; i < ts->hopping.arfcns.data_len*8; i++) { |
| 825 | if (bitvec_get_bit_pos(&ts->hopping.arfcns, i)) { |
| 826 | *cur++ = 0x00; |
| 827 | *cur++ = i >> 8; |
| 828 | *cur++ = i & 0xff; |
| 829 | } |
| 830 | } |
| 831 | } else { |
| 832 | *cur++ = 0x00; /* TX/RX address */ |
| 833 | *cur++ = ts->trx->arfcn >> 8; |
| 834 | *cur++ = ts->trx->arfcn && 0xff; |
| 835 | } |
| 836 | return (cur - list); |
| 837 | } |
| 838 | |
| 839 | int abis_om2k_tx_ts_conf_req(struct gsm_bts_trx_ts *ts) |
| 840 | { |
| 841 | struct msgb *msg = om2k_msgb_alloc(); |
| 842 | struct abis_om2k_hdr *o2k; |
| 843 | struct abis_om2k_mo mo; |
| 844 | uint8_t freq_list[64*3]; /* BA max size: 64 ARFCN */ |
| 845 | int freq_list_len; |
| 846 | |
| 847 | om2k_ts_to_mo(&mo, ts); |
| 848 | |
| 849 | freq_list_len = om2k_gen_freq_list(freq_list, ts); |
| 850 | if (freq_list_len < 0) |
| 851 | return freq_list_len; |
| 852 | |
| 853 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
| 854 | fill_om2k_hdr(o2k, &mo, OM2K_MSGT_TS_CONF_REQ, |
| 855 | 2+2+TLV_GROSS_LEN(freq_list_len)+2+2+2+2+3+2); |
| 856 | |
| 857 | msgb_tv_put(msg, OM2K_DEI_COMBINATION, pchan2comb(ts->pchan)); |
| 858 | msgb_tv_put(msg, OM2K_DEI_TS_NR, ts->nr); |
| 859 | msgb_tlv_put(msg, OM2K_DEI_FREQ_LIST, freq_list_len, freq_list); |
| 860 | msgb_tv_put(msg, OM2K_DEI_HSN, ts->hopping.hsn); |
| 861 | msgb_tv_put(msg, OM2K_DEI_MAIO, ts->hopping.maio); |
| 862 | msgb_tv_put(msg, OM2K_DEI_BSIC, ts->trx->bts->bsic); |
| 863 | msgb_tv_put(msg, OM2K_DEI_RX_DIVERSITY, 0x03); /* A+B */ |
| 864 | msgb_tv16_put(msg, OM2K_DEI_FN_OFFSET, 0); |
| 865 | msgb_tv_put(msg, OM2K_DEI_EXT_RANGE, 0); /* Off */ |
| 866 | /* Optional: Interference Rejection Combining */ |
| 867 | |
| 868 | return abis_om2k_sendmsg(ts->trx->bts, msg); |
| 869 | } |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 870 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 871 | 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] | 872 | uint8_t *data, unsigned int len) |
| 873 | { |
| 874 | struct msgb *msg = om2k_msgb_alloc(); |
| 875 | struct abis_om2k_hdr *o2k; |
| 876 | |
| 877 | o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); |
| 878 | fill_om2k_hdr(o2k, mo, OM2K_MSGT_NEGOT_REQ_ACK, 2+len); |
| 879 | |
| 880 | msgb_tlv_put(msg, OM2K_DEI_NEGOT_REC2, len, data); |
| 881 | |
| 882 | DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(mo), |
| 883 | get_value_string(om2k_msgcode_vals, OM2K_MSGT_NEGOT_REQ_ACK)); |
| 884 | |
| 885 | return abis_om2k_sendmsg(bts, msg); |
| 886 | } |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 887 | |
Harald Welte | 563d316 | 2011-02-12 18:11:16 +0100 | [diff] [blame] | 888 | struct iwd_version { |
| 889 | uint8_t gen_char[3+1]; |
| 890 | uint8_t rev_char[3+1]; |
| 891 | }; |
| 892 | |
| 893 | struct iwd_type { |
| 894 | uint8_t num_vers; |
| 895 | struct iwd_version v[8]; |
| 896 | }; |
| 897 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 898 | static int om2k_rx_negot_req(struct msgb *msg) |
| 899 | { |
| 900 | struct abis_om2k_hdr *o2h = msgb_l2(msg); |
Harald Welte | 563d316 | 2011-02-12 18:11:16 +0100 | [diff] [blame] | 901 | struct iwd_type iwd_types[16]; |
| 902 | uint8_t num_iwd_types = o2h->data[2]; |
| 903 | uint8_t *cur = o2h->data+3; |
| 904 | unsigned int i, v; |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 905 | |
Harald Welte | 563d316 | 2011-02-12 18:11:16 +0100 | [diff] [blame] | 906 | uint8_t out_buf[1024]; |
| 907 | uint8_t *out_cur = out_buf+1; |
| 908 | uint8_t out_num_types = 0; |
| 909 | |
| 910 | memset(iwd_types, 0, sizeof(iwd_types)); |
| 911 | |
| 912 | /* Parse the RBS-supported IWD versions into iwd_types array */ |
| 913 | for (i = 0; i < num_iwd_types; i++) { |
| 914 | uint8_t num_versions = *cur++; |
| 915 | uint8_t iwd_type = *cur++; |
| 916 | |
| 917 | iwd_types[iwd_type].num_vers = num_versions; |
| 918 | |
| 919 | for (v = 0; v < num_versions; v++) { |
| 920 | struct iwd_version *iwd_v = &iwd_types[iwd_type].v[v]; |
| 921 | |
| 922 | memcpy(iwd_v->gen_char, cur, 3); |
Harald Welte | 56ee6b8 | 2011-02-12 18:13:37 +0100 | [diff] [blame] | 923 | cur += 3; |
| 924 | memcpy(iwd_v->rev_char, cur, 3); |
| 925 | cur += 3; |
| 926 | |
Harald Welte | 563d316 | 2011-02-12 18:11:16 +0100 | [diff] [blame] | 927 | DEBUGP(DNM, "\tIWD Type %u Gen %s Rev %s\n", iwd_type, |
| 928 | iwd_v->gen_char, iwd_v->rev_char); |
| 929 | } |
| 930 | } |
| 931 | |
| 932 | /* Select the last version for each IWD type */ |
| 933 | for (i = 0; i < ARRAY_SIZE(iwd_types); i++) { |
| 934 | struct iwd_type *type = &iwd_types[i]; |
| 935 | struct iwd_version *last_v; |
| 936 | |
| 937 | if (type->num_vers == 0) |
| 938 | continue; |
| 939 | |
| 940 | out_num_types++; |
| 941 | |
| 942 | last_v = &type->v[type->num_vers-1]; |
| 943 | |
| 944 | *out_cur++ = i; |
| 945 | memcpy(out_cur, last_v->gen_char, 3); |
| 946 | out_cur += 3; |
| 947 | memcpy(out_cur, last_v->rev_char, 3); |
| 948 | out_cur += 3; |
| 949 | } |
| 950 | |
| 951 | out_buf[0] = out_num_types; |
| 952 | |
| 953 | 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] | 954 | } |
| 955 | |
| 956 | static int om2k_rx_start_res(struct msgb *msg) |
| 957 | { |
| 958 | struct abis_om2k_hdr *o2h = msgb_l2(msg); |
| 959 | int rc; |
| 960 | |
| 961 | rc = abis_om2k_tx_simple(msg->trx->bts, &o2h->mo, OM2K_MSGT_START_RES_ACK); |
| 962 | rc = abis_om2k_tx_op_info(msg->trx->bts, &o2h->mo, 1); |
| 963 | |
| 964 | return rc; |
| 965 | } |
| 966 | |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 967 | static int om2k_rx_op_info_ack(struct msgb *msg) |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 968 | { |
| 969 | struct abis_om2k_hdr *o2h = msgb_l2(msg); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 970 | |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 971 | /* FIXME: update Operational state in our structures */ |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 972 | |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 973 | return 0; |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 974 | } |
| 975 | |
| 976 | int abis_om2k_rcvmsg(struct msgb *msg) |
| 977 | { |
| 978 | struct gsm_bts *bts = msg->trx->bts; |
| 979 | struct abis_om2k_hdr *o2h = msgb_l2(msg); |
| 980 | struct abis_om_hdr *oh = &o2h->om; |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 981 | uint16_t msg_type = ntohs(o2h->msg_type); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 982 | int rc = 0; |
| 983 | |
| 984 | /* Various consistency checks */ |
| 985 | if (oh->placement != ABIS_OM_PLACEMENT_ONLY) { |
| 986 | LOGP(DNM, LOGL_ERROR, "ABIS OML placement 0x%x not supported\n", |
| 987 | oh->placement); |
| 988 | if (oh->placement != ABIS_OM_PLACEMENT_FIRST) |
| 989 | return -EINVAL; |
| 990 | } |
| 991 | if (oh->sequence != 0) { |
| 992 | LOGP(DNM, LOGL_ERROR, "ABIS OML sequence 0x%x != 0x00\n", |
| 993 | oh->sequence); |
| 994 | return -EINVAL; |
| 995 | } |
| 996 | |
| 997 | msg->l3h = (unsigned char *)o2h + sizeof(*o2h); |
| 998 | |
| 999 | if (oh->mdisc != ABIS_OM_MDISC_FOM) { |
| 1000 | LOGP(DNM, LOGL_ERROR, "unknown ABIS OM2000 message discriminator 0x%x\n", |
| 1001 | oh->mdisc); |
| 1002 | return -EINVAL; |
| 1003 | } |
| 1004 | |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 1005 | 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] | 1006 | get_value_string(om2k_msgcode_vals, msg_type), |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1007 | hexdump(msg->l2h, msgb_l2len(msg))); |
| 1008 | |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 1009 | switch (msg_type) { |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1010 | case OM2K_MSGT_CAL_TIME_REQ: |
| 1011 | rc = abis_om2k_cal_time_resp(bts); |
| 1012 | break; |
| 1013 | case OM2K_MSGT_FAULT_REP: |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1014 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_FAULT_REP_ACK); |
| 1015 | break; |
| 1016 | case OM2K_MSGT_NEGOT_REQ: |
| 1017 | rc = om2k_rx_negot_req(msg); |
| 1018 | break; |
| 1019 | case OM2K_MSGT_START_RES: |
| 1020 | rc = om2k_rx_start_res(msg); |
| 1021 | break; |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 1022 | case OM2K_MSGT_OP_INFO_ACK: |
| 1023 | rc = om2k_rx_op_info_ack(msg); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1024 | break; |
| 1025 | case OM2K_MSGT_IS_CONF_RES: |
| 1026 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_IS_CONF_RES_ACK); |
| 1027 | break; |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 1028 | case OM2K_MSGT_CON_CONF_RES: |
| 1029 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_CON_CONF_RES_ACK); |
| 1030 | break; |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 1031 | case OM2K_MSGT_TX_CONF_RES: |
| 1032 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TX_CONF_RES_ACK); |
| 1033 | break; |
| 1034 | case OM2K_MSGT_RX_CONF_RES: |
| 1035 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_RX_CONF_RES_ACK); |
| 1036 | break; |
| 1037 | case OM2K_MSGT_TS_CONF_RES: |
| 1038 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TS_CONF_RES_ACK); |
| 1039 | break; |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame^] | 1040 | case OM2K_MSGT_TF_CONF_RES: |
| 1041 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TF_CONF_RES_ACK); |
| 1042 | break; |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1043 | case OM2K_MSGT_CONNECT_COMPL: |
| 1044 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_RESET_CMD); |
| 1045 | break; |
| 1046 | case OM2K_MSGT_RESET_COMPL: |
| 1047 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_START_REQ); |
| 1048 | break; |
Harald Welte | b3d70fd | 2011-02-13 12:43:44 +0100 | [diff] [blame] | 1049 | case OM2K_MSGT_ENABLE_RES: |
| 1050 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_ENABLE_RES_ACK); |
| 1051 | break; |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 1052 | case OM2K_MSGT_DISABLE_RES: |
| 1053 | rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_DISABLE_RES_ACK); |
| 1054 | break; |
| 1055 | case OM2K_MSGT_TEST_RES: |
| 1056 | 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] | 1057 | break; |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 1058 | case OM2K_MSGT_STATUS_RESP: |
| 1059 | break; |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 1060 | case OM2K_MSGT_START_REQ_ACK: |
| 1061 | case OM2K_MSGT_CON_CONF_REQ_ACK: |
| 1062 | case OM2K_MSGT_IS_CONF_REQ_ACK: |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 1063 | case OM2K_MSGT_TX_CONF_REQ_ACK: |
| 1064 | case OM2K_MSGT_RX_CONF_REQ_ACK: |
| 1065 | case OM2K_MSGT_TS_CONF_REQ_ACK: |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame^] | 1066 | case OM2K_MSGT_TF_CONF_REQ_ACK: |
Harald Welte | fdb7194 | 2011-02-14 15:31:43 +0100 | [diff] [blame] | 1067 | case OM2K_MSGT_ENABLE_REQ_ACK: |
| 1068 | case OM2K_MSGT_ALARM_STATUS_REQ_ACK: |
| 1069 | case OM2K_MSGT_DISABLE_REQ_ACK: |
| 1070 | break; |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1071 | default: |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 1072 | LOGP(DNM, LOGL_NOTICE, "Rx unhandled OM2000 msg %s\n", |
Harald Welte | bc867d9 | 2011-02-12 13:09:38 +0100 | [diff] [blame] | 1073 | get_value_string(om2k_msgcode_vals, msg_type)); |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1074 | } |
| 1075 | |
| 1076 | msgb_free(msg); |
| 1077 | return rc; |
| 1078 | } |