aboutsummaryrefslogtreecommitdiffstats
path: root/src/tbf.h
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-24 20:36:36 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-11-26 21:00:51 +0100
commitf1593b7c49bd54caae9326c79156741e6078c412 (patch)
tree25104f4c817acd77276df41ece87ee59ff203d54 /src/tbf.h
parentab6cd921e3e47481ecdab93d1df1ce7f14b72e0a (diff)
tbf/rlc: Big change and move the window handling out to the rlc
The send and receive window is now managed by an external object. There are some issues that can only be solved with C++11 but it is progres and removes some of the spaghetti code. For GPRS the sns and ws is hardcoded. Move that into the window code.
Diffstat (limited to 'src/tbf.h')
-rw-r--r--src/tbf.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/tbf.h b/src/tbf.h
index 6f5c48ea..9560e3c3 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -157,9 +157,6 @@ struct gprs_rlcmac_tbf {
enum gprs_rlcmac_tbf_poll_state poll_state;
uint32_t poll_fn; /* frame number to poll */
- uint16_t m_ws; /* window size */
- uint16_t m_sns; /* sequence number space */
-
/* Please note that all variables here will be reset when changing
* from WAIT RELEASE back to FLOW state (re-use of TBF).
* All states that need reset must be in this struct, so this is why
@@ -167,17 +164,13 @@ struct gprs_rlcmac_tbf {
*/
union {
struct {
- uint16_t bsn; /* block sequence number */
- uint16_t v_s; /* send state */
- uint16_t v_a; /* ack state */
+ gprs_rlc_dl_window window;
gprs_rlc_v_b v_b;
int32_t tx_counter; /* count all transmitted blocks */
uint8_t wait_confirm; /* wait for CCCH IMM.ASS cnf */
} dl;
struct {
- uint16_t bsn; /* block sequence number */
- uint16_t v_r; /* receive state */
- uint16_t v_q; /* receive window state */
+ gprs_rlc_ul_window window;
char v_n[RLC_MAX_SNS/2]; /* receive state array */
int32_t rx_counter; /* count all received blocks */
uint8_t n3103; /* N3103 counter */
@@ -306,7 +299,8 @@ inline const char *gprs_rlcmac_tbf::imsi() const
inline uint16_t gprs_rlcmac_tbf::sns() const
{
- return m_sns;
+ /* assume dl/ul do the same thing */
+ return dir.dl.window.sns();
}
const char *tbf_name(gprs_rlcmac_tbf *tbf);