diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-12-27 19:05:09 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-12-27 19:05:09 +0100 |
commit | 1f27fda1945cbddacce45bd5587a1909f7cb0bf6 (patch) | |
tree | 22b3ed1a41f05f03efa97ae76ac142a90d77db1f | |
parent | 5a906c7b725af6d73d5b38f666833d1e56c3a673 (diff) |
wip... handle
-rw-r--r-- | include/osmo-bts/paging.h | 6 | ||||
-rw-r--r-- | src/common/paging.c | 26 | ||||
-rw-r--r-- | src/common/vty.c | 20 |
3 files changed, 48 insertions, 4 deletions
diff --git a/include/osmo-bts/paging.h b/include/osmo-bts/paging.h index 38accd72..c3ac8074 100644 --- a/include/osmo-bts/paging.h +++ b/include/osmo-bts/paging.h @@ -49,4 +49,10 @@ int paging_group_queue_empty(struct paging_state *ps, uint8_t group); int paging_queue_length(struct paging_state *ps); int paging_buffer_space(struct paging_state *ps); +extern uint8_t etws_segment_data[4][17]; +extern uint8_t etws_segment_len[4]; +extern uint8_t etws_nr_seg; +extern uint8_t etws_data[60]; +extern size_t etws_len; + #endif diff --git a/src/common/paging.c b/src/common/paging.c index f75f12dc..ce60cdf3 100644 --- a/src/common/paging.c +++ b/src/common/paging.c @@ -262,7 +262,14 @@ int paging_add_imm_ass(struct paging_state *ps, const uint8_t *data, #define L2_PLEN(len) (((len - 1) << 2) | 0x01) -static int fill_paging_type_1(uint8_t *out_buf, const uint8_t *identity1_lv, +static int current_segment[MAX_PAGING_BLOCKS_CCCH*MAX_BS_PA_MFRMS]; +uint8_t etws_segment_data[4][17]; +uint8_t etws_segment_len[4]; +uint8_t etws_nr_seg; +uint8_t etws_data[60]; +size_t etws_len; + +static int fill_paging_type_1(int group, uint8_t *out_buf, const uint8_t *identity1_lv, uint8_t chan1, const uint8_t *identity2_lv, uint8_t chan2) { @@ -280,6 +287,17 @@ static int fill_paging_type_1(uint8_t *out_buf, const uint8_t *identity1_lv, if (identity2_lv) cur = lv_put(cur, identity2_lv[0], identity2_lv+1); + if (etws_nr_seg > 0) { + int cur_segment = current_segment[group]; + current_segment[group] += 1; + current_segment[group] %= etws_nr_seg; + + /* move the pointer */ + memcpy(cur, etws_segment_data[cur_segment], etws_segment_len[cur_segment]); + cur += etws_segment_len[cur_segment]; + } + + /* do we need to include it */ pt1->l2_plen = L2_PLEN(cur - out_buf); return cur - out_buf; @@ -400,7 +418,7 @@ int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *g /* There is nobody to be paged, send Type1 with two empty ID */ if (llist_empty(group_q)) { //DEBUGP(DPAG, "Tx PAGING TYPE 1 (empty)\n"); - len = fill_paging_type_1(out_buf, empty_id_lv, 0, + len = fill_paging_type_1(group, out_buf, empty_id_lv, 0, NULL, 0); *is_empty = 1; } else { @@ -474,7 +492,7 @@ int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *g } } else if (num_pr == 1) { DEBUGP(DPAG, "Tx PAGING TYPE 1 (1 xMSI,1 empty)\n"); - len = fill_paging_type_1(out_buf, + len = fill_paging_type_1(group, out_buf, pr[0]->u.paging.identity_lv, pr[0]->u.paging.chan_needed, NULL, 0); @@ -482,7 +500,7 @@ int paging_gen_msg(struct paging_state *ps, uint8_t *out_buf, struct gsm_time *g /* 2 (any type) or * 3 or 4, of which only 2 will be sent */ DEBUGP(DPAG, "Tx PAGING TYPE 1 (2 xMSI)\n"); - len = fill_paging_type_1(out_buf, + len = fill_paging_type_1(group, out_buf, pr[0]->u.paging.identity_lv, pr[0]->u.paging.chan_needed, pr[1]->u.paging.identity_lv, diff --git a/src/common/vty.c b/src/common/vty.c index 6b57b0b6..4db3930d 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -44,6 +44,7 @@ #include <osmo-bts/bts_model.h> #include <osmo-bts/measurement.h> #include <osmo-bts/vty.h> +#include <osmo-bts/paging.h> enum node_type bts_vty_go_parent(struct vty *vty) @@ -614,6 +615,24 @@ DEFUN(bts_t_t_l_jitter_buf, return CMD_SUCCESS; } +DEFUN(bts_etsw_idle, bts_etsw_idle_cmd, + "etsw-message MESSAGE", + "ETSW Message\nMessage in Hex\n") +{ + int rc; + + rc = osmo_hexparse(argv[0], etws_data, sizeof(etws_data)); + vty_out(vty, "%% parsed: %s%s", + osmo_hexdump(etws_data, rc), VTY_NEWLINE); + etws_len = rc; + + /* factor and segment.. */ + + + return CMD_SUCCESS; +} + + int bts_vty_init(const struct log_info *cat) { install_element_ve(&show_bts_cmd); @@ -646,6 +665,7 @@ int bts_vty_init(const struct log_info *cat) install_element(TRX_NODE, &cfg_trx_pr_step_interval_cmd); install_element(ENABLE_NODE, &bts_t_t_l_jitter_buf_cmd); + install_element(ENABLE_NODE, &bts_etsw_idle_cmd); return 0; } |