Added fixups for msgb len field whenever the tail is modified
Also, added some clarifying comments
Change-Id: Ia725edbeafe26bd2ea9b5a1810d0b26bc79d84db
The tcs (Tetra Crypto State) struct now maintains information relevant for decryption, such as the current network, colour code, hyperframe, etcetera.
Also, the upper mac now calls a stub decryption function when receiving an encrypted resource.
Change-Id: I92d718789d6b7e84c1901d09165fce59cdf8c1ca
the rx_tm_sdu and rx_tl_sdu did not belong in tetra_upper_mac and are removed. Instead, we use rx_tm_sdu in tetra_llc.c, who in turn invokes rx_tl_sdu in tetra_mle.c. The llc can now also make use of the advanced link defragmentation code that was already there but unused.
Change-Id: I294c684e97c55876f1a207a7152a83dad4ebaa26
The upper mac now maintains a defragmentation buffer for each timeslot. Resources with length -1 (fragmentation start) are added to the buf for that slot, further mac/frag frames are appended. When a mac/end is encountered, the reconstructed l2 message is passed to rx_tm_sdu. The tetra_llc_pdu struct now uses a uint32_t for tl_sdu_len in order to account for the possibly longer sdus. Fill bits processing was required in order to reliably determine the end of a MAC PDU.
Change-Id: I41c9438b0b12c2fac9dff1b226eec5b33f30fbb4
According to the tetra_tdma_time struct definition, the tn should be in range 1-4. Also, tetra_burst_sync_in increments the timeslot number when in a synchronized state. The timeslot is then normalized with normalize_tn which also expects the tn to be within the 1-4 range.
Change-Id: Ib0967fdeef3bf37c612124626a74d240aa571a66
fill_bits and grant_position bits are now parsed and stored in the tetra_resrc_decoded struct
A flag is_encrypted is set to to true if resource was not encrypted or if the calling function
states that the frame has been decrypted successfully before passing it to tetra_resrc_decoded.
Lastly, the channel_alloc element is only parsed if the frame is unencrypted.
Change-Id: I6c85c93b70a34e01fd1a96a863f0e113be6424d3
All our MM/CMCE/SNDCP 'decodes' were broken previously, as they
assumed that the MM/CMCE/SNDCP message follows immediately after the
MAC header. However, there's the LLC layer in between.
This is just simple LLC decoding and does not do re-assembly yet.