aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmo-bts
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-06-25 18:23:14 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-06-27 12:51:02 +0700
commitb06cd9f439200869c96ed5d82113c3eba0453229 (patch)
tree4c25c2cd29ae55e0d64b17f19398b8d390314d5e /include/osmo-bts
parentd1e7d0dafa93220ffb657661b3a1c9bc2b7a700a (diff)
osmo-bts-trx/trx_if.c: introduce TRXD header version handling
It may be necessary to extend the message specific header with more information. Since this is not a TLV-based protocol, we need to include the header format version. +-----------------+---------------------------+ | 7 6 5 4 3 2 1 0 | bit numbers (value range) | +-----------------+---------------------------+ | X X X X . . . . | header version (0..15) | +-----------------+---------------------------+ | . . . . . X X X | TDMA TN (0..7) | +-----------------+---------------------------+ | . . . . X . . . | RESERVED (0) | +-----------------+---------------------------+ Instead of prepending an additional byte, it was decided to use 4 MSB bits of the first octet, which used to be zero-initialized due to the value range of TDMA TN (0..7). Therefore the current header format has implicit version 0. Otherwise Wireshark (or trx_sniff.py) would have to guess the header version, or alternatively follow the control channel looking for the version setting command. This change introduces a new structure 'trx_ul_burst_ind', which represents an Uplink burst and the corresponding meta info. The purpose of this structure is to avoid overloading the existing functions, such as trx_sched_ul_burst(), with more and more arguments every time we bump the version. On receipt of a TRXD message, trx_data_read_cb() now parses the header version, and calls the corresponding dissector functions, e.g. trx_data_handle_(hdr|burst)_v0(). Change-Id: I171c18229ca3e5cab70de0064a31e47c78602c0c Related: OS#4006
Diffstat (limited to 'include/osmo-bts')
-rw-r--r--include/osmo-bts/scheduler.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index c8623079..9748d45c 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -173,10 +173,6 @@ int trx_sched_tch_req(struct l1sched_trx *l1t, struct osmo_phsap_prim *l1sap);
/*! \brief PHY informs us of new (current) GSM frame number */
int trx_sched_clock(struct gsm_bts *bts, uint32_t fn);
-/*! \brief handle an UL burst received by PHY */
-int trx_sched_ul_burst(struct l1sched_trx *l1t, uint8_t tn, uint32_t fn,
- sbit_t *bits, uint16_t nbits, int8_t rssi, int16_t toa);
-
/*! \brief set multiframe scheduler to given physical channel config */
int trx_sched_set_pchan(struct l1sched_trx *l1t, uint8_t tn,
enum gsm_phys_chan_config pchan);
@@ -231,4 +227,20 @@ int find_sched_mframe_idx(enum gsm_phys_chan_config pchan, uint8_t tn);
bool trx_sched_is_sacch_fn(struct gsm_bts_trx_ts *ts, uint32_t fn, bool uplink);
extern const struct trx_sched_multiframe trx_sched_multiframes[];
+/*! UL burst indication with the corresponding meta info */
+struct trx_ul_burst_ind {
+ /* Mandatory fields */
+ uint32_t fn; /*!< TDMA frame number */
+ uint8_t tn; /*!< TDMA time-slot number */
+ int16_t toa256; /*!< Timing of Arrival in units of 1/256 of symbol */
+ int8_t rssi; /*!< Received Signal Strength Indication */
+
+ /*! Burst soft-bits buffer */
+ sbit_t burst[EGPRS_BURST_LEN];
+ size_t burst_len;
+};
+
+/*! Handle an UL burst received by PHY */
+int trx_sched_ul_burst(struct l1sched_trx *l1t, struct trx_ul_burst_ind *bi);
+
#endif /* TRX_SCHEDULER_H */