diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index 71ff6086..55aef9d7 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -221,12 +221,6 @@ struct gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_tbf *old_tbf, enum gprs_rlcmac_tbf_direction dir, uint8_t tfi, uint8_t trx, uint8_t first_ts, uint8_t ms_class, uint8_t single_slot); -int alloc_algorithm_a(struct gprs_rlcmac_tbf *old_tbf, - struct gprs_rlcmac_tbf *tbf, uint32_t cust); - -int alloc_algorithm_b(struct gprs_rlcmac_tbf *old_tbf, - struct gprs_rlcmac_tbf *tbf, uint32_t cust); - struct gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts, enum gprs_rlcmac_tbf_direction dir); @@ -324,6 +318,16 @@ struct gprs_rlcmac_paging *gprs_rlcmac_dequeue_paging( struct msgb *gprs_rlcmac_send_packet_paging_request( struct gprs_rlcmac_pdch *pdch); + +extern "C" { +#endif +int alloc_algorithm_a(struct gprs_rlcmac_tbf *old_tbf, + struct gprs_rlcmac_tbf *tbf, uint32_t cust); + +int alloc_algorithm_b(struct gprs_rlcmac_tbf *old_tbf, + struct gprs_rlcmac_tbf *tbf, uint32_t cust); +#ifdef __cplusplus +} #endif #endif // GPRS_RLCMAC_H diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 2413f21d..e5d37658 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -86,6 +86,11 @@ static int config_write_pcu(struct vty *vty) else if (bts->force_llc_lifetime) vty_out(vty, " queue lifetime %d%s", bts->force_llc_lifetime, VTY_NEWLINE); + if (bts->alloc_algorithm == alloc_algorithm_a) + vty_out(vty, " alloc-algorithm a%s", VTY_NEWLINE); + if (bts->alloc_algorithm == alloc_algorithm_b) + vty_out(vty, " alloc-algorithm b%s", VTY_NEWLINE); + } /* per-BTS configuration */ @@ -167,6 +172,27 @@ DEFUN(cfg_pcu_no_queue_lifetime, return CMD_SUCCESS; } +DEFUN(cfg_pcu_alloc, + cfg_pcu_alloc_cmd, + "alloc-algorithm (a|b)", + "Select slot allocation algorithm to use when assigning timeslots on " + "PACCH\nSingle slot is assigned only\nMultiple slots are assigned for " + "semi-duplex operation") +{ + struct gprs_rlcmac_bts *bts = gprs_rlcmac_bts; + + switch (argv[0][0]) { + case 'a': + bts->alloc_algorithm = alloc_algorithm_a; + break; + case 'b': + bts->alloc_algorithm = alloc_algorithm_b; + break; + } + + return CMD_SUCCESS; +} + static const char pcu_copyright[] = "Copyright (C) 2012 by ...\r\n" "License GNU GPL version 2 or later\r\n" @@ -195,6 +221,7 @@ int pcu_vty_init(const struct log_info *cat) install_element(PCU_NODE, &cfg_pcu_queue_lifetime_cmd); install_element(PCU_NODE, &cfg_pcu_queue_lifetime_inf_cmd); install_element(PCU_NODE, &cfg_pcu_no_queue_lifetime_cmd); + install_element(PCU_NODE, &cfg_pcu_alloc_cmd); install_element(PCU_NODE, &ournode_end_cmd); return 0;