Commit Graph

362 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther e23102602c llc: Move some more secrets from the TBF into the LLC
Introduce a method to append data to a TBF and then reset the
read pointer when the frame has been sent.
2013-11-13 17:08:07 +01:00
Holger Hans Peter Freyther b3d5ee2934 bts: Count the number of llc frames that were "scheduled" to be sent
This does not mean that they have been successfully transferred
to the SGSN/MS but at least that they have reached a certain point
in the message flow.
2013-11-13 16:43:26 +01:00
Holger Hans Peter Freyther 51e093bd1c llc: Use timeradd and timercmp and fix for < 1s PDU llc timeouts 2013-11-13 15:35:45 +01:00
Holger Hans Peter Freyther 985fd114f2 llc: Change the flow. Exit early for the special case and initialize the tv 2013-11-13 15:19:39 +01:00
Holger Hans Peter Freyther fce431cf3a llc: Move the timeout calculation into the TBF 2013-11-13 15:17:12 +01:00
Holger Hans Peter Freyther aa35ba7584 tbf: Count how often we re-use a TBF that was already being deactivated 2013-11-13 15:02:50 +01:00
Holger Hans Peter Freyther 857281f7ff llc: Remove one of the two variants to put data into the frame 2013-11-13 14:58:19 +01:00
Holger Hans Peter Freyther d26318e4a7 misc: Fix coverity warning about indention
So we had one intended line inside the if for "SMS VALUE" and
at the same time one line with "SMS VALUE" at the same indention.
Assume it is copy and paste and remove the line. Currently we
are only parsing the ms_class so this change should not have any
semantic change.

Fixes: Coverity CID 1058761
2013-11-11 20:28:29 +01:00
Holger Hans Peter Freyther 4e8b50cd8d misc: Fix a potential leak on config parsing
Fixes: Coverity CID 1040949
2013-11-11 20:12:30 +01:00
Holger Hans Peter Freyther 0e0f2f5faf pcu: Address the return without value
Fixes: Coverity CID 1040959
2013-11-11 20:10:04 +01:00
Holger Hans Peter Freyther a6e47c7f54 llc: Add another warning for me to take a look 2013-11-11 20:08:35 +01:00
Holger Hans Peter Freyther 5697b4ccfa tbf: Make sure that tfi is signed so we can make a < 0 check
For the failure check we need this variable to be < 0.

Fixes: Coverity CID 1107941
2013-11-11 16:22:39 +01:00
Holger Hans Peter Freyther acb5427bda llc: Move all direct accesses to the frame into the llc structure
Add some todo items where we could add assertions now that I see
the constraints and invariants of this code.
2013-11-07 08:15:58 +01:00
Holger Hans Peter Freyther be57081721 llc: Move the llc structure to a new header file 2013-11-07 08:02:10 +01:00
Holger Hans Peter Freyther b7840466ce tbf: Split create_dl_acked_block into two methods
The method was more than 300 hundred lines of code. Split the
selection of the index and the creation of the dl_msg.
2013-11-07 07:50:26 +01:00
Holger Hans Peter Freyther a1da251c10 tbf: Move the tbf_handle and tbf_append_data into the class 2013-11-07 07:32:51 +01:00
Holger Hans Peter Freyther 096f6f9f39 llc: Move the llc code out of the tbf.cpp into a new dedicated one 2013-11-07 07:21:06 +01:00
Holger Hans Peter Freyther 758dc12c9f llc: First routines moved from the TBF into the LLC 2013-11-07 07:16:21 +01:00
Holger Hans Peter Freyther 28e5378b55 llc: Begin creating a LLC class and move counts into it.
Begin to move state of the LLC into a separate object. This will
allow to make side-effects more clear and kill some code duplication.
2013-11-06 20:23:56 +01:00
Holger Hans Peter Freyther 9948514086 tbf: Move the tx part into the tbf as it accesses internal data 2013-11-06 20:15:11 +01:00
Holger Hans Peter Freyther 77e05971b4 tbf: Move the llc handling into the tbf (from the bts)
This will be moved to a LLC class in the future but after this
we can make the sns/ws private now and have little to update
outside the tbf.
2013-11-06 19:16:43 +01:00
Holger Hans Peter Freyther bc1626e5de tbf: Update the timing advance for the new tlli based on the old one 2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther b809866be5 tbf: Learn and propagate the TLLI changes due a new P-TMSI
During a routing area update a new P-TMSI was assigned. During
the PACKET CONTROL ACK on the DL we notice the change of TLLI
but didn't propagate this. This means that a Routing Area Update
Complete was only sent after a new RACH request.

Addresses:
<0007> gprs_rlcmac_meas.cpp:103 UL RSSI of TLLI=0x88661bc6: -67 dBm
<0002> bts.cpp:945 Got ACK, but UL TBF is gone TLLI=0xe512eba3
<0007> gprs_rlcmac_meas.cpp:158 DL packet loss of IMSI=274080000004765 / TLLI=0xe512eba3: 0%
<0002> tbf.cpp:668 TBF TFI=0 TLLI=0x88661bc6 T3169 timeout during transsmission
<0002> tbf.cpp:690 - Assignment was on PACCH
<0002> tbf.cpp:694 - No uplink data received yet
2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther 5464c9baf2 tbf: Have one imsi field and assign it through a function
Have one IMSI field per TBF and assign through a function call.
The IMSI should be used to look-up the TBF on the SGSN->PCU
direction.
2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther 34f6e5ebe6 tbf: Make tfi private and update the code
All logging code that used tbf->tfi is now using tbf_name to
print the the TBF. External code is now using tfi() which is
inlined and should result in the same code being generated as
before (+debug code that can be stripped).
2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther 474685e26e tbf: Make the tlli "private" and update the updating code
Now all updates to the tlli/tlli_valid are in one place. If we
implement the policy to update the matching/linked TBF we can
now to do it in a single place. Add a todo item for that as I
am waiting for feedback from the mailinglist.
2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther bd449f57a7 tbf: Create tbf_name and use it in log statements
This is like gsm_lchan_name and should be used in log statements.
This way we can easily change the information that is printed and
we know how to search things. The other part is that direct use
of tfi/tlli is removed which will allow us to make them private
and at the same time start to resolve the "tlli" updated in many
places.

Not old log statements are changed yet. This will done whenever
a bad log statement is seen on the console...
2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther 870c601f1d tbf: TODO:Mark TLLI changes as todo item in the code
The TLLI can change when a new P-TMSI is assigned to the phone,
e.g. during a (periodic) routing area update. When the TLLI
changes we need to update all TBFs and maybe even register the
timing advance for the new TLLI..
2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther 6b88cddc21 bts: Simplify rcv_resource_request, remove logically dead code
tbf = find
 if (tbf) {
   tbf_free(tbf);
   tbf = NULL;
 }
 if (!tbf) {
   code...
 }

Remove the if (!tbf) and indention as the tbf is always to be
NULL.
2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther 8021644e9d bts: Kill dead stores of the tlli/tfi, fix the log message again
The code meant to print the tfi and not the tlli. Update it.
2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther ec80f82824 tbf: Remove the trx_no field from the tbf, go through the trx object 2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther fc498c9e7b tbf: Go through the trx to get the ARFCN 2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther 875fc895a8 bts: Further logging improvements for TFI/TLLI output 2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther e1a075ab59 bts: Pass the Packet_Control_Acknowledgement_t into the recv method 2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther 53a336f0e5 bts: Log the TLLI inside the report we get 2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther 8d0e489484 tbf: Log the TFI and TLLI so we can try to figure out more from logs
<0002> tbf.cpp:444 Poll timeout for DL TBF=0
<0002> tbf.cpp:513 - Timeout for polling PACKET DOWNLINK ACK.
<0002> tbf.cpp:688 - Assignment was on PACCH
<0002> tbf.cpp:694 - Downlink ACK was received
<0008> gprs_bssgp_pcu.cpp:154 LLC [SGSN -> PCU] = TLLI: 0xd6942c78 IMSI: 274080000004765 len: 506
<0002> bts.cpp:974 PACKET DOWNLINK ACK with unknown FN=2213128 TFI=0 (TRX 0 TS 6)
2013-10-30 21:24:13 +01:00
Holger Hans Peter Freyther 15bb1a2a51 misc: Change the logging for the tbf and what to log
TLLIs got printed as TBF. Fix that but also rename things to
TFI. The TFI is not required to be unique per BTS but it is
the indicator we use right now.
2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 5da2014f13 bts: Use Packet_Downlink_Ack_Nack_t as parameter 2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 7a344716a6 bts: Simplify the code and use Packet_Resource_Request_t* 2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther cb5c49b581 bts: Work with the Packet_Measurement_Report_t 2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 750ca67ce9 bts: Move the MT_PACKET_MEASUREMENT_REPORT handling to a new method 2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 842808848c bts: Move handling of MT_PACKET_RESOURCE_REQUEST to a method
Move the code to a new method
2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 5a9658168a bts: Move handling of MT_PACKET_DOWNLINK_ACK_NACK to separate function
Kill the tlli assignment as it is never used.
2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 396f4161cb pdch: Move handling of control_ack to a separate method
Kill the unused tfi parameter
2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther c1ae22694c bts: Count the rach frames we receive 2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 90b87ea5e6 misc: Fix typo.. resource in english only has one 's' 2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 180def907b bts: Print the kind of message type not known. 2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 1997787c52 llc: Count timedout and silently dropped frames
A DL tbf can be discarded and then the already queued LLCs will
be silently dropped. Count this event.
2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther b98dd9e240 sba: Move freeing a sba into a central place 2013-10-30 21:24:12 +01:00
Holger Hans Peter Freyther 93e048fe27 sba: Count SBA allocation, frees and timeouts
Add a warning about the receive message poking in the internal
of the sba. This will be cleaned up in a follow up commit
2013-10-30 21:24:12 +01:00