diff options
Diffstat (limited to 'src/bts.h')
-rw-r--r-- | src/bts.h | 64 |
1 files changed, 35 insertions, 29 deletions
@@ -13,10 +13,6 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #pragma once @@ -32,6 +28,7 @@ extern "C" { #include <osmocom/core/rate_ctr.h> #include <osmocom/core/stat_item.h> #include <osmocom/core/tdef.h> +#include <osmocom/core/time_cc.h> #include <osmocom/gprs/gprs_ns2.h> #include <osmocom/gsm/l1sap.h> #include <osmocom/gsm/protocol/gsm_04_08.h> @@ -47,6 +44,10 @@ extern "C" { #include "tbf.h" #include "coding_scheme.h" +#ifdef __cplusplus +extern "C" { +#endif + struct GprsMs; struct gprs_rlcmac_bts; @@ -67,9 +68,6 @@ struct gprs_rlcmac_trx { }; -#ifdef __cplusplus -extern "C" { -#endif void bts_trx_init(struct gprs_rlcmac_trx *trx, struct gprs_rlcmac_bts *bts, uint8_t trx_no); void bts_trx_reserve_slots(struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t slots); void bts_trx_unreserve_slots(struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t slots); @@ -77,13 +75,9 @@ void bts_trx_free_all_tbf(struct gprs_rlcmac_trx *trx); void bts_update_tbf_ta(struct gprs_rlcmac_bts *bts, const char *p, uint32_t fn, uint8_t trx_no, uint8_t ts, int8_t ta, bool is_rach); -#ifdef __cplusplus -} -#endif - - enum { + CTR_PDCH_ALL_ALLOCATED, CTR_TBF_DL_ALLOCATED, CTR_TBF_DL_FREED, CTR_TBF_DL_ABORTED, @@ -126,14 +120,21 @@ enum { CTR_LLC_DL_BYTES, CTR_LLC_UL_BYTES, CTR_PCH_REQUESTS, + CTR_PCH_REQUESTS_ALREADY, CTR_PCH_REQUESTS_TIMEDOUT, CTR_RACH_REQUESTS, - CTR_11BIT_RACH_REQUESTS, + CTR_RACH_REQUESTS_11BIT, + CTR_RACH_REQUESTS_ONE_PHASE, + CTR_RACH_REQUESTS_TWO_PHASE, + CTR_RACH_REQUESTS_UNEXPECTED, CTR_SPB_UL_FIRST_SEGMENT, CTR_SPB_UL_SECOND_SEGMENT, CTR_SPB_DL_FIRST_SEGMENT, CTR_SPB_DL_SECOND_SEGMENT, CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_UL_TBF_ONE_PHASE, + CTR_IMMEDIATE_ASSIGN_UL_TBF_TWO_PHASE, + CTR_IMMEDIATE_ASSIGN_UL_TBF_CONTENTION_RESOLUTION_SUCCESS, CTR_IMMEDIATE_ASSIGN_REJ, CTR_IMMEDIATE_ASSIGN_DL_TBF, CTR_CHANNEL_REQUEST_DESCRIPTION, @@ -195,7 +196,8 @@ struct rach_ind_params { uint16_t ra; uint8_t trx_nr; uint8_t ts_nr; - uint32_t rfn; + uint16_t rfn; + uint32_t fn; int16_t qta; }; @@ -206,7 +208,6 @@ struct chan_req_params { bool single_block; }; -struct GprsMsStorage; struct pcu_l1_meas; /** @@ -267,15 +268,21 @@ struct gprs_rlcmac_bts { struct rate_ctr_group *ratectrs; struct osmo_stat_item_group *statg; - struct GprsMsStorage *ms_store; + struct llist_head ms_list; /* list of struct GprsMs */ /* List of struct bts_pch_timer for active PCH pagings */ struct llist_head pch_timer; -}; -#ifdef __cplusplus -extern "C" { -#endif + struct osmo_time_cc all_allocated_pdch; + + /* BTS hardware model, see pcuif_proto.h */ + uint8_t bts_model; + + /* When the PDCH is idle, the timeslot is expected to transmit dummy blocks. Some BTS models will generate + * those dummy blocks automatically when no data is transmitted. In contrast, other BTS models may require a + * continuous stream of PDCH blocks that already has the gaps filled with dummy blocks. */ + bool gen_idle_blocks_C0; +}; struct paging_req_cs { uint8_t chan_needed; @@ -286,15 +293,14 @@ struct paging_req_cs { struct osmo_mobile_identity mi_imsi; }; -struct GprsMs *bts_alloc_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class, uint8_t egprs_ms_class); int bts_add_paging(struct gprs_rlcmac_bts *bts, const struct paging_req_cs *req, struct GprsMs *ms); -uint32_t bts_rfn_to_fn(const struct gprs_rlcmac_bts *bts, int32_t rfn); +uint32_t bts_rfn_to_fn(const struct gprs_rlcmac_bts *bts, uint32_t rfn); struct gprs_rlcmac_dl_tbf *bts_dl_tbf_by_tfi(struct gprs_rlcmac_bts *bts, uint8_t tfi, uint8_t trx, uint8_t ts); struct gprs_rlcmac_ul_tbf *bts_ul_tbf_by_tfi(struct gprs_rlcmac_bts *bts, uint8_t tfi, uint8_t trx, uint8_t ts); -void bts_snd_dl_ass(struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_tbf *tbf, uint16_t pgroup); +void bts_snd_dl_ass(struct gprs_rlcmac_bts *bts, const struct gprs_rlcmac_dl_tbf *tbf); void bts_set_current_frame_number(struct gprs_rlcmac_bts *bts, uint32_t frame_number); void bts_set_current_block_frame_number(struct gprs_rlcmac_bts *bts, int frame_number); @@ -308,7 +314,7 @@ int bts_tfi_find_free(const struct gprs_rlcmac_bts *bts, enum gprs_rlcmac_tbf_di int bts_rcv_rach(struct gprs_rlcmac_bts *bts, const struct rach_ind_params *rip); int bts_rcv_ptcch_rach(struct gprs_rlcmac_bts *bts, const struct rach_ind_params *rip); -int bts_rcv_imm_ass_cnf(struct gprs_rlcmac_bts *bts, const uint8_t *data, uint32_t fn); +int bts_rcv_imm_ass_cnf(struct gprs_rlcmac_bts *bts, const uint8_t *data, uint32_t tlli); void bts_send_gsmtap(struct gprs_rlcmac_bts *bts, enum pcu_gsmtap_category categ, bool uplink, uint8_t trx_no, @@ -322,9 +328,10 @@ void bts_send_gsmtap_rach(struct gprs_rlcmac_bts *bts, enum pcu_gsmtap_category categ, uint8_t channel, const struct rach_ind_params *rip); -struct GprsMsStorage *bts_ms_store(const struct gprs_rlcmac_bts *bts); - -struct GprsMs *bts_ms_by_tlli(struct gprs_rlcmac_bts *bts, uint32_t tlli, uint32_t old_tlli); +struct GprsMs *bts_get_ms(const struct gprs_rlcmac_bts *bts, uint32_t tlli, uint32_t old_tlli, + const char *imsi); +struct GprsMs *bts_get_ms_by_tlli(const struct gprs_rlcmac_bts *bts, uint32_t tlli, uint32_t old_tlli); +struct GprsMs *bts_get_ms_by_imsi(const struct gprs_rlcmac_bts *bts, const char *imsi); static inline struct rate_ctr_group *bts_rate_counters(struct gprs_rlcmac_bts *bts) { @@ -362,7 +369,6 @@ void bts_recalc_initial_cs(struct gprs_rlcmac_bts *bts); void bts_recalc_initial_mcs(struct gprs_rlcmac_bts *bts); void bts_recalc_max_cs(struct gprs_rlcmac_bts *bts); void bts_recalc_max_mcs(struct gprs_rlcmac_bts *bts); -struct GprsMs *bts_ms_by_imsi(struct gprs_rlcmac_bts *bts, const char *imsi); uint8_t bts_max_cs_dl(const struct gprs_rlcmac_bts *bts); uint8_t bts_max_cs_ul(const struct gprs_rlcmac_bts *bts); uint8_t bts_max_mcs_dl(const struct gprs_rlcmac_bts *bts); @@ -372,8 +378,8 @@ void bts_set_max_cs_ul(struct gprs_rlcmac_bts *bts, uint8_t cs_ul); void bts_set_max_mcs_dl(struct gprs_rlcmac_bts *bts, uint8_t mcs_dl); void bts_set_max_mcs_ul(struct gprs_rlcmac_bts *bts, uint8_t mcs_ul); bool bts_cs_dl_is_supported(const struct gprs_rlcmac_bts *bts, enum CodingScheme cs); -const struct llist_head* bts_ms_list(struct gprs_rlcmac_bts *bts); uint8_t bts_get_ms_pwr_alpha(const struct gprs_rlcmac_bts *bts); +bool bts_all_pdch_allocated(const struct gprs_rlcmac_bts *bts); #ifdef __cplusplus } #endif |