rlc: Make WS and SNS variable

Currently the values for WS and SNS are fixed to 64 (WS) and 128
(SNS) which are the only values that can be used with GPRS. On the
other hand, EGPRS requires an SNS of 2014 and a WS in the range of
64 to 1024.

This commit adds member variables and setters to both window
classes. By default, the GPRS values are being used.

Sponsored-by: On-Waves ehf
diff --git a/src/rlc.cpp b/src/rlc.cpp
index f6d6f4a..4f62f23 100644
--- a/src/rlc.cpp
+++ b/src/rlc.cpp
@@ -55,6 +55,22 @@
 	m_v_b.reset();
 }
 
+void gprs_rlc_dl_window::set_sns(uint16_t sns)
+{
+	OSMO_ASSERT(sns >= RLC_GPRS_SNS);
+	OSMO_ASSERT(sns <= RLC_MAX_SNS);
+	/* check for 2^n */
+	OSMO_ASSERT((sns & (-sns)) == sns);
+	m_sns = sns;
+}
+
+void gprs_rlc_dl_window::set_ws(uint16_t ws)
+{
+	OSMO_ASSERT(ws >= RLC_GPRS_SNS/2);
+	OSMO_ASSERT(ws <= RLC_MAX_SNS/2);
+	m_ws = ws;
+}
+
 int gprs_rlc_dl_window::resend_needed()
 {
 	for (uint16_t bsn = v_a(); bsn != v_s(); bsn = mod_sns(bsn + 1)) {
@@ -172,6 +188,22 @@
 		m_v_n[i] = GPRS_RLC_UL_BSN_INVALID;
 }
 
+void gprs_rlc_ul_window::set_sns(uint16_t sns)
+{
+	OSMO_ASSERT(sns >= RLC_GPRS_SNS);
+	OSMO_ASSERT(sns <= RLC_MAX_SNS);
+	/* check for 2^n */
+	OSMO_ASSERT((sns & (-sns)) == sns);
+	m_sns = sns;
+}
+
+void gprs_rlc_ul_window::set_ws(uint16_t ws)
+{
+	OSMO_ASSERT(ws >= RLC_GPRS_SNS/2);
+	OSMO_ASSERT(ws <= RLC_MAX_SNS/2);
+	m_ws = ws;
+}
+
 /* Update the receive block bitmap */
 void gprs_rlc_ul_window::update_rbb(char *rbb)
 {