aboutsummaryrefslogtreecommitdiffstats
path: root/src/bts.h
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2018-02-19 17:17:28 +0100
committerMax <msuraev@sysmocom.de>2018-02-19 17:41:24 +0100
commit6dc90b8c86768a9b1beb429c610dcbae6488e21c (patch)
tree1fe643c594599ff24deb203e7f706f7dc92f5a69 /src/bts.h
parent2afec6dba54e4426664b3bd866a7fb5dc363b2c8 (diff)
Move PDCH-related functions into separate files
The PDCH class and corresponding functions are rather self-contained and independent from BTS implementation. Let's move them into separate file to make bts.cpp more manageable. As additional benefit it allow us to somewhat untangle all the different cross-dependent includes. Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 Related: OS#1539
Diffstat (limited to 'src/bts.h')
-rw-r--r--src/bts.h121
1 files changed, 1 insertions, 120 deletions
diff --git a/src/bts.h b/src/bts.h
index 9b38ba9..9c75369 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -37,6 +37,7 @@ extern "C" {
#include "gprs_ms_storage.h"
#include "gprs_coding_scheme.h"
#include <cxx_linuxlist.h>
+#include <pdch.h>
#endif
#include <stdint.h>
@@ -65,86 +66,6 @@ enum pcu_gsmtap_category {
struct BTS;
struct GprsMs;
-/*
- * PDCH instance
- */
-struct gprs_rlcmac_pdch {
-#ifdef __cplusplus
- struct gprs_rlcmac_paging *dequeue_paging();
- struct msgb *packet_paging_request();
-
- bool add_paging(uint8_t chan_needed, uint8_t *identity_lv);
-
- void free_resources();
-
- bool is_enabled() const;
-
- void enable();
- void disable();
-
- /* dispatching of messages */
- int rcv_block(uint8_t *data, uint8_t len, uint32_t fn,
- struct pcu_l1_meas *meas);
- int rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn,
- struct pcu_l1_meas *meas, GprsCodingScheme cs);
- int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn,
- struct pcu_l1_meas *meas, GprsCodingScheme cs);
-
- gprs_rlcmac_bts *bts_data() const;
- BTS *bts() const;
- uint8_t trx_no() const;
-
- struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi);
- struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi);
-
- void attach_tbf(gprs_rlcmac_tbf *tbf);
- void detach_tbf(gprs_rlcmac_tbf *tbf);
-
- unsigned num_tbfs(enum gprs_rlcmac_tbf_direction dir) const;
-
- void reserve(enum gprs_rlcmac_tbf_direction dir);
- void unreserve(enum gprs_rlcmac_tbf_direction dir);
- unsigned num_reserved(enum gprs_rlcmac_tbf_direction dir) const;
-
- uint8_t assigned_usf() const;
- uint32_t assigned_tfi(enum gprs_rlcmac_tbf_direction dir) const;
-#endif
-
- uint8_t m_is_enabled; /* TS is enabled */
- uint8_t tsc; /* TSC of this slot */
- uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */
- uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */
- uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */
- struct llist_head paging_list; /* list of paging messages */
- uint32_t last_rts_fn; /* store last frame number of RTS */
-
- /* back pointers */
- struct gprs_rlcmac_trx *trx;
- uint8_t ts_no;
-
-#ifdef __cplusplus
-private:
- int rcv_control_block(const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn);
-
- void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn);
- void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn);
- void rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *, uint32_t fn);
- void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn);
- void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn);
- gprs_rlcmac_tbf *tbf_from_list_by_tfi(
- LListHead<gprs_rlcmac_tbf> *tbf_list, uint8_t tfi,
- enum gprs_rlcmac_tbf_direction dir);
- gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi,
- enum gprs_rlcmac_tbf_direction dir);
-#endif
-
- uint8_t m_num_tbfs[2];
- uint8_t m_num_reserved[2];
- uint8_t m_assigned_usf; /* bit set */
- uint32_t m_assigned_tfi[2]; /* bit set */
- struct gprs_rlcmac_tbf *m_tbfs[2][32];
-};
-
struct gprs_rlcmac_trx {
void *fl1h;
uint16_t arfcn;
@@ -540,33 +461,6 @@ inline LListHead<gprs_rlcmac_tbf>& BTS::dl_tbfs()
return m_dl_tbfs;
}
-inline BTS *gprs_rlcmac_pdch::bts() const
-{
- return trx->bts;
-}
-
-inline unsigned gprs_rlcmac_pdch::num_tbfs(enum gprs_rlcmac_tbf_direction dir) const
-{
- return m_num_tbfs[dir];
-}
-
-inline unsigned gprs_rlcmac_pdch::num_reserved(
- enum gprs_rlcmac_tbf_direction dir) const
-{
- return gprs_rlcmac_pdch::m_num_reserved[dir];
-}
-
-inline uint8_t gprs_rlcmac_pdch::assigned_usf() const
-{
- return m_assigned_usf;
-}
-
-inline uint32_t gprs_rlcmac_pdch::assigned_tfi(
- enum gprs_rlcmac_tbf_direction dir) const
-{
- return m_assigned_tfi[dir];
-}
-
inline struct rate_ctr_group *BTS::rate_counters() const
{
return m_ratectrs;
@@ -687,15 +581,6 @@ CREATE_STAT_INLINE(ms_present, ms_present_get, STAT_MS_PRESENT);
#undef CREATE_STAT_INLINE
-inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const
-{
- return trx->bts->bts_data();
-}
-
-inline uint8_t gprs_rlcmac_pdch::trx_no() const
-{
- return trx->trx_no;
-}
#endif
#ifdef __cplusplus
@@ -707,8 +592,4 @@ extern "C" {
#ifdef __cplusplus
}
-inline bool gprs_rlcmac_pdch::is_enabled() const
-{
- return m_is_enabled;
-}
#endif