[PATCH] Uplink PAN header changes for FANR feature

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-net-gprs@lists.osmocom.org/.

sangamesh sajjan sangamesh.sajjan at radisys.com
Wed Mar 9 14:33:07 UTC 2016


Added structure definition for handling uplink PAN and added new
RLC state for Tentative Ack
---
 src/bts.h |    1 +
 src/rlc.h |   36 +++++++++++++++++++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/src/bts.h b/src/bts.h
index ccb8025..756cddf 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -48,6 +48,7 @@ struct GprsMs;
 #define  BITS_TO_BYTES(X)      (X ? (X/8):0)+1
 #define  MOD8(X)             (((X)+8)&0x07)
 #define  MOD64(X)            ((X + 64) & 0x3F)
+#define  MOD2048(X)            ((X + 2048) & 0x7FF)
 extern const uint8_t* one_run_len_code_list[MAX_CDWDTBL_LEN];
 extern const uint8_t* zero_run_len_code_list[MAX_CDWDTBL_LEN];
 
diff --git a/src/rlc.h b/src/rlc.h
index f7c5457..d29527d 100644
--- a/src/rlc.h
+++ b/src/rlc.h
@@ -52,6 +52,7 @@ enum gprs_rlc_dl_bsn_state {
 	GPRS_RLC_DL_BSN_ACKED,
 	GPRS_RLC_DL_BSN_UNACKED,
 	GPRS_RLC_DL_BSN_RESEND,
+	GPRS_RLC_DL_BSN_TENTATIVE_ACK,
 	GPRS_RLC_DL_BSN_MAX,
 };
 
@@ -85,6 +86,15 @@ struct gprs_rlc_ul_data_block_info {
 	unsigned int spb;
 };
 
+struct egprs_ssn_based_pan_info {
+	unsigned int bow;
+	unsigned int short_ssn_a;
+	unsigned int short_ssn_rb;
+	unsigned int rb_a;
+	unsigned int rb_b;
+	unsigned int tfi;
+};
+
 struct gprs_rlc_ul_header_generic{
 	GprsCodingScheme cs;
 	unsigned int r;
@@ -97,6 +107,7 @@ struct gprs_rlc_ul_header_generic{
 	unsigned int num_data_blocks;
         unsigned int data_offs_bytes[2];
 	struct gprs_rlc_ul_data_block_info block_info[2];
+	struct egprs_ssn_based_pan_info pan_info;
 };
 struct gprs_rlc_data {
 	uint8_t *prepare(size_t block_data_length);
@@ -161,7 +172,8 @@ struct gprs_rlc_v_b {
 	bool is_resend(int bsn) const;
 	bool is_invalid(int bsn) const;
 	gprs_rlc_dl_bsn_state get_state(int bsn) const;
-
+	bool is_tentative_acked(int bsn) const;
+	void mark_tentative_acked(int bsn);
 	/* Mark a RLC frame for something */
 	void mark_unacked(int bsn);
 	void mark_nacked(int bsn);
@@ -431,6 +443,18 @@ struct gprs_rlc_ul_header_egprs_1 {
 	uint8_t spare2:6,
 		dummy:2;
 } __attribute__ ((packed));
+
+/* TS 44.060 10.3a.5.1 */
+struct egprs_ssn_based_pan_header {
+        uint8_t bow:1,
+                short_ssn_a:7;
+        uint8_t short_ssn_rb:4,
+                rb_a:4;
+        uint8_t rb_b:4,
+                tfi_a:4;
+        uint8_t tfi_b:1;
+} __attribute__ ((packed));
+
 }
 
 inline bool gprs_rlc_v_b::is_state(int bsn, const gprs_rlc_dl_bsn_state type) const
@@ -468,6 +492,16 @@ inline bool gprs_rlc_v_b::is_invalid(int bsn) const
 	return is_state(bsn, GPRS_RLC_DL_BSN_INVALID);
 }
 
+inline bool gprs_rlc_v_b::is_tentative_acked(int bsn) const
+{
+	return is_state(bsn, GPRS_RLC_DL_BSN_TENTATIVE_ACK);
+}
+
+inline void gprs_rlc_v_b::mark_tentative_acked(int bsn)
+{
+	return mark(bsn, GPRS_RLC_DL_BSN_TENTATIVE_ACK);
+}
+
 inline gprs_rlc_dl_bsn_state gprs_rlc_v_b::get_state(int bsn) const
 {
 	return m_v_b[bsn & mod_sns_half()];
-- 
1.7.9.5





More information about the osmocom-net-gprs mailing list