llc: Move static functions below related object

Move all static functions related to gprs_llc object below it, so that
it's easy finding all related APIs being together.

Change-Id: If781e66c6e8a119cc22948c82167ceb90270ea6d
This commit is contained in:
Pau Espin 2022-03-31 19:47:33 +02:00
parent 4f8384bfbb
commit ee1cb75127
1 changed files with 24 additions and 24 deletions

View File

@ -48,30 +48,6 @@ void llc_put_frame(struct gprs_llc *llc, const uint8_t *data, size_t len);
void llc_put_dummy_frame(struct gprs_llc *llc, size_t req_len);
void llc_append_frame(struct gprs_llc *llc, const uint8_t *data, size_t len);
struct MetaInfo {
struct timespec recv_time;
struct timespec expire_time;
};
/**
* I store the LLC frames that come from the SGSN.
*/
struct gprs_llc_queue {
uint32_t avg_queue_delay; /* Average delay of data going through the queue */
size_t queue_size;
size_t queue_octets;
struct llist_head queue; /* queued LLC DL data */
};
void llc_queue_calc_pdu_lifetime(struct gprs_rlcmac_bts *bts, const uint16_t pdu_delay_csec,
struct timespec *tv);
bool llc_queue_is_frame_expired(const struct timespec *tv_now, const struct timespec *tv);
void llc_queue_init(struct gprs_llc_queue *q);
void llc_queue_clear(struct gprs_llc_queue *q, struct gprs_rlcmac_bts *bts);
void llc_queue_move_and_merge(struct gprs_llc_queue *q, struct gprs_llc_queue *o);
void llc_queue_enqueue(struct gprs_llc_queue *q, struct msgb *llc_msg, const struct timespec *expire_time);
struct msgb *llc_queue_dequeue(struct gprs_llc_queue *q, const struct MetaInfo **info);
static inline uint16_t llc_chunk_size(const struct gprs_llc *llc)
{
return llc->length - llc->index;
@ -104,6 +80,30 @@ static inline bool llc_fits_in_current_frame(const struct gprs_llc *llc, uint8_t
return llc->length + chunk_size <= LLC_MAX_LEN;
}
struct MetaInfo {
struct timespec recv_time;
struct timespec expire_time;
};
/**
* I store the LLC frames that come from the SGSN.
*/
struct gprs_llc_queue {
uint32_t avg_queue_delay; /* Average delay of data going through the queue */
size_t queue_size;
size_t queue_octets;
struct llist_head queue; /* queued LLC DL data */
};
void llc_queue_calc_pdu_lifetime(struct gprs_rlcmac_bts *bts, const uint16_t pdu_delay_csec,
struct timespec *tv);
bool llc_queue_is_frame_expired(const struct timespec *tv_now, const struct timespec *tv);
void llc_queue_init(struct gprs_llc_queue *q);
void llc_queue_clear(struct gprs_llc_queue *q, struct gprs_rlcmac_bts *bts);
void llc_queue_move_and_merge(struct gprs_llc_queue *q, struct gprs_llc_queue *o);
void llc_queue_enqueue(struct gprs_llc_queue *q, struct msgb *llc_msg, const struct timespec *expire_time);
struct msgb *llc_queue_dequeue(struct gprs_llc_queue *q, const struct MetaInfo **info);
static inline size_t llc_queue_size(const struct gprs_llc_queue *q)
{
return q->queue_size;