aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-10-03 14:21:36 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2012-10-03 14:21:36 +0200
commit499ff415a92909d125499d70ba8288bbc6ed8f60 (patch)
treec5f100fc12b6341580db29b2f755053fc9cc2f23
parent3b1332cdb4a2b9e61ca71386072e915e6f5d30ba (diff)
Allow setting of seperate coding schemes for uplink and downlink
-rw-r--r--src/gprs_rlcmac.cpp6
-rw-r--r--src/gprs_rlcmac.h2
-rw-r--r--src/gprs_rlcmac_data.cpp2
-rw-r--r--src/pcu_l1_if.cpp5
-rw-r--r--src/pcu_main.cpp3
-rw-r--r--src/pcu_vty.c18
6 files changed, 23 insertions, 13 deletions
diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp
index e434c4b..b38722d 100644
--- a/src/gprs_rlcmac.cpp
+++ b/src/gprs_rlcmac.cpp
@@ -1275,7 +1275,7 @@ int write_immediate_assignment(bitvec * dest, uint8_t downlink, uint8_t ra,
bitvec_write_field(dest, wp, usf, 3); // USF
bitvec_write_field(dest, wp, 0, 1); // USF_GRANULARITY
bitvec_write_field(dest, wp, 0, 1); // "0" power control: Not Present
- bitvec_write_field(dest, wp, bts->initial_cs-1, 2); // CHANNEL_CODING_COMMAND
+ bitvec_write_field(dest, wp, bts->initial_cs_ul-1, 2); // CHANNEL_CODING_COMMAND
bitvec_write_field(dest, wp, 1, 1); // TLLI_BLOCK_CHANNEL_CODING
if (alpha) {
bitvec_write_field(dest, wp,0x1,1); // ALPHA = present
@@ -1321,7 +1321,7 @@ void write_packet_uplink_assignment(bitvec * dest, uint8_t old_tfi,
}
bitvec_write_field(dest, wp,0x0,1); // Message escape
- bitvec_write_field(dest, wp,bts->initial_cs-1, 2); // CHANNEL_CODING_COMMAND
+ bitvec_write_field(dest, wp,bts->initial_cs_ul-1, 2); // CHANNEL_CODING_COMMAND
bitvec_write_field(dest, wp,0x1,1); // TLLI_BLOCK_CHANNEL_CODING
bitvec_write_field(dest, wp,0x1,1); // switch TIMING_ADVANCE_VALUE = on
@@ -1461,7 +1461,7 @@ void write_packet_uplink_ack(RlcMacDownlink_t * block, struct gprs_rlcmac_tbf *t
block->u.Packet_Uplink_Ack_Nack.UPLINK_TFI = tbf->tfi; // Uplink TFI
block->u.Packet_Uplink_Ack_Nack.UnionType = 0x0; // PU_AckNack_GPRS = on
- block->u.Packet_Uplink_Ack_Nack.u.PU_AckNack_GPRS_Struct.CHANNEL_CODING_COMMAND = bts->initial_cs - 1; // CS1
+ block->u.Packet_Uplink_Ack_Nack.u.PU_AckNack_GPRS_Struct.CHANNEL_CODING_COMMAND = bts->initial_cs_ul - 1; // CS1
block->u.Packet_Uplink_Ack_Nack.u.PU_AckNack_GPRS_Struct.Ack_Nack_Description.FINAL_ACK_INDICATION = final; // FINAL ACK INDICATION
block->u.Packet_Uplink_Ack_Nack.u.PU_AckNack_GPRS_Struct.Ack_Nack_Description.STARTING_SEQUENCE_NUMBER = tbf->dir.ul.v_r; // STARTING_SEQUENCE_NUMBER
// RECEIVE_BLOCK_BITMAP
diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h
index 6479754..1699627 100644
--- a/src/gprs_rlcmac.h
+++ b/src/gprs_rlcmac.h
@@ -67,7 +67,7 @@ struct gprs_rlcmac_bts {
uint8_t cs2;
uint8_t cs3;
uint8_t cs4;
- uint8_t initial_cs;
+ uint8_t initial_cs_dl, initial_cs_ul;
uint8_t force_cs; /* 0=use from BTS 1=use from VTY */
uint16_t force_llc_lifetime; /* overrides lifetime from SGSN */
uint8_t t3142;
diff --git a/src/gprs_rlcmac_data.cpp b/src/gprs_rlcmac_data.cpp
index 2d03ac5..7b0d83f 100644
--- a/src/gprs_rlcmac_data.cpp
+++ b/src/gprs_rlcmac_data.cpp
@@ -1290,7 +1290,7 @@ do_resend:
index = tbf->dir.dl.v_s & mod_sns_half;
data = tbf->rlc_block[index];
if (tbf->cs == 0) {
- tbf->cs = bts->initial_cs;
+ tbf->cs = bts->initial_cs_dl;
if (tbf->cs < 1 || tbf->cs > 4)
tbf->cs = 1;
}
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 9e5e2f2..1498182 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -405,9 +405,10 @@ bssgp_failed:
}
if (!bts->force_cs) {
if (info_ind->initial_cs < 1 || info_ind->initial_cs > 4)
- bts->initial_cs = 1;
+ bts->initial_cs_dl = 1;
else
- bts->initial_cs = info_ind->initial_cs;
+ bts->initial_cs_dl = info_ind->initial_cs;
+ bts->initial_cs_ul = bts->initial_cs_dl;
}
for (trx = 0; trx < 8; trx++) {
diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index ba31ca7..ee6f70c 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -141,9 +141,8 @@ int main(int argc, char *argv[])
struct gprs_rlcmac_bts);
if (!gprs_rlcmac_bts)
return -ENOMEM;
- gprs_rlcmac_bts->initial_cs = 1;
bts->fc_interval = 1;
- bts->initial_cs = 1;
+ bts->initial_cs_dl = bts->initial_cs_ul = 1;
bts->cs1 = 1;
bts->t3142 = 20;
bts->t3169 = 5;
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index d7c2c2c..c55a9ee 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -82,7 +82,12 @@ static int config_write_pcu(struct vty *vty)
vty_out(vty, " flow-control-interval %d%s", bts->fc_interval,
VTY_NEWLINE);
if (bts->force_cs)
- vty_out(vty, " cs %d%s", bts->initial_cs, VTY_NEWLINE);
+ if (bts->initial_cs_ul == bts->initial_cs_dl)
+ vty_out(vty, " cs %d%s", bts->initial_cs_dl,
+ VTY_NEWLINE);
+ else
+ vty_out(vty, " cs %d %d%s", bts->initial_cs_dl,
+ bts->initial_cs_ul, VTY_NEWLINE);
if (bts->force_llc_lifetime == 0xffff)
vty_out(vty, " queue lifetime infinite%s", VTY_NEWLINE);
else if (bts->force_llc_lifetime)
@@ -125,14 +130,19 @@ DEFUN(cfg_pcu_fc_interval,
DEFUN(cfg_pcu_cs,
cfg_pcu_cs_cmd,
- "cs <1-4>",
- "Set the Coding Scheme to be used, (overrides BTS config)\n")
+ "cs <1-4> [<1-4>]",
+ "Set the Coding Scheme to be used, (overrides BTS config)\n"
+ "Initial CS used\nAlternative uplink CS")
{
struct gprs_rlcmac_bts *bts = gprs_rlcmac_bts;
uint8_t cs = atoi(argv[0]);
bts->force_cs = 1;
- bts->initial_cs = cs;
+ bts->initial_cs_dl = cs;
+ if (argc > 1)
+ bts->initial_cs_ul = atoi(argv[1]);
+ else
+ bts->initial_cs_ul = cs;
return CMD_SUCCESS;
}