aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs_bssgp_pcu.cpp
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2012-07-13 14:46:03 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2012-07-13 14:46:03 +0200
commitb0c7ea72c8157f1b8124bbe105aa05c46a77a005 (patch)
treedda9d26a9e6a8b12022a24bc3ae090b091cb2b97 /src/gprs_bssgp_pcu.cpp
parente266bd48aca6f5b7831eb7c44e4773e9884d4c56 (diff)
Changed data structures for TBF and PDCH instances, to allow multislot
The new data structure is required to define slot/TFI assigment for MS with multislot capability. Now there are two lists for TBFs: uplink and downlink. It is possible to have different TBFs with same TFI in the same direction, as long as they are assigned on different timeslots. See tbf.txt for description. Note: This does not implement any multislot support. It defines the new data structure. Currently only the first slot is assigned.
Diffstat (limited to 'src/gprs_bssgp_pcu.cpp')
-rw-r--r--src/gprs_bssgp_pcu.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp
index d1ef046e..c4d70afd 100644
--- a/src/gprs_bssgp_pcu.cpp
+++ b/src/gprs_bssgp_pcu.cpp
@@ -31,10 +31,9 @@ int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp)
{
struct bssgp_ud_hdr *budh;
- int tfi;
+ int8_t tfi; /* must be signed */
uint32_t tlli;
int i, j;
- uint8_t trx, ts;
uint8_t *data;
uint16_t len;
struct gprs_rlcmac_tbf *tbf;
@@ -101,19 +100,36 @@ int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp)
msgb_enqueue(&tbf->llc_queue, llc_msg);
}
} else {
- // Create new TBF
- tfi = tfi_alloc(&trx, &ts);
+ uint8_t trx, ts, use_trx, first_ts;
+
+ /* check for uplink data, so we copy our informations */
+ if ((tbf = tbf_by_tlli(tlli, GPRS_RLCMAC_UL_TBF))) {
+ use_trx = tbf->trx;
+ first_ts = tbf->first_ts;
+ } else {
+ use_trx = -1;
+ first_ts = -1;
+ }
+
+ // Create new TBF (any TRX)
+ tfi = tfi_alloc(GPRS_RLCMAC_DL_TBF, &trx, &ts, use_trx, first_ts);
if (tfi < 0) {
LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH ressource\n");
/* FIXME: send reject */
return -EBUSY;
}
- tbf = tbf_alloc(tfi, trx, ts);
- tbf->direction = GPRS_RLCMAC_DL_TBF;
+ /* FIXME: set number of downlink slots according to multislot
+ * class */
+ tbf = tbf_alloc(GPRS_RLCMAC_DL_TBF, tfi, trx, ts, 1);
+ if (!tbf) {
+ LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH ressource\n");
+ /* FIXME: send reject */
+ return -EBUSY;
+ }
tbf->tlli = tlli;
tbf->tlli_valid = 1;
- LOGP(DRLCMAC, LOGL_DEBUG, "TBF: [DOWNLINK] START TFI: %u TLLI: 0x%08x \n", tbf->tfi, tbf->tlli);
+ LOGP(DRLCMAC, LOGL_DEBUG, "TBF: [DOWNLINK] START TFI: %d TLLI: 0x%08x \n", tbf->tfi, tbf->tlli);
/* new TBF, so put first frame */
memcpy(tbf->llc_frame, data, len);