2012-03-05 15:24:57 +00:00
|
|
|
/* gprs_rlcmac.h
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Ivan Klyuchnikov
|
2013-08-24 19:16:55 +00:00
|
|
|
* Copyright (C) 2013 by Holger Hans Peter Freyther
|
2012-03-05 15:24:57 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GPRS_RLCMAC_H
|
|
|
|
#define GPRS_RLCMAC_H
|
|
|
|
|
2012-07-20 19:50:31 +00:00
|
|
|
#ifdef __cplusplus
|
2012-04-30 14:00:36 +00:00
|
|
|
#include <bitvector.h>
|
2012-03-05 15:24:57 +00:00
|
|
|
#include <gsm_rlcmac.h>
|
2012-04-12 11:22:06 +00:00
|
|
|
#include <gsm_timer.h>
|
2012-03-05 15:24:57 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
#include <osmocom/core/linuxlist.h>
|
2012-04-12 11:22:06 +00:00
|
|
|
#include <osmocom/core/timer.h>
|
2012-03-05 15:24:57 +00:00
|
|
|
}
|
2012-07-20 19:50:31 +00:00
|
|
|
#endif
|
2012-03-05 15:24:57 +00:00
|
|
|
|
2012-07-03 11:36:03 +00:00
|
|
|
/* This special feature will delay assignment of downlink TBF by one second,
|
|
|
|
* in case there is already a TBF.
|
|
|
|
* This is usefull to debug downlink establishment during packet idle mode.
|
|
|
|
*/
|
|
|
|
//#define DEBUG_DL_ASS_IDLE
|
|
|
|
|
2012-06-27 13:52:04 +00:00
|
|
|
|
|
|
|
struct gprs_rlcmac_tbf;
|
2013-10-17 17:41:11 +00:00
|
|
|
struct gprs_rlcmac_bts;
|
2013-10-19 19:10:38 +00:00
|
|
|
struct BTS;
|
2015-06-18 15:16:26 +00:00
|
|
|
struct GprsMs;
|
2012-06-27 13:52:04 +00:00
|
|
|
|
2012-07-20 19:50:31 +00:00
|
|
|
#ifdef __cplusplus
|
2012-07-19 11:06:26 +00:00
|
|
|
/*
|
|
|
|
* paging entry
|
|
|
|
*/
|
|
|
|
struct gprs_rlcmac_paging {
|
|
|
|
struct llist_head list;
|
|
|
|
uint8_t chan_needed;
|
|
|
|
uint8_t identity_lv[9];
|
|
|
|
};
|
|
|
|
|
2012-10-03 12:20:53 +00:00
|
|
|
/*
|
|
|
|
* coding scheme info
|
|
|
|
*/
|
|
|
|
struct gprs_rlcmac_cs {
|
|
|
|
uint8_t block_length;
|
|
|
|
uint8_t block_data;
|
|
|
|
uint8_t block_payload;
|
2012-03-05 15:24:57 +00:00
|
|
|
};
|
|
|
|
|
2014-08-08 09:21:04 +00:00
|
|
|
int gprs_rlcmac_received_lost(struct gprs_rlcmac_dl_tbf *tbf, uint16_t received,
|
2013-03-16 15:22:02 +00:00
|
|
|
uint16_t lost);
|
|
|
|
|
2014-08-08 09:21:04 +00:00
|
|
|
int gprs_rlcmac_lost_rep(struct gprs_rlcmac_dl_tbf *tbf);
|
2013-03-16 15:22:02 +00:00
|
|
|
|
|
|
|
int gprs_rlcmac_meas_rep(Packet_Measurement_Report_t *pmr);
|
|
|
|
|
|
|
|
int gprs_rlcmac_rssi(struct gprs_rlcmac_tbf *tbf, int8_t rssi);
|
|
|
|
|
|
|
|
int gprs_rlcmac_rssi_rep(struct gprs_rlcmac_tbf *tbf);
|
|
|
|
|
2014-08-08 09:21:04 +00:00
|
|
|
int gprs_rlcmac_dl_bw(struct gprs_rlcmac_dl_tbf *tbf, uint16_t octets);
|
2013-03-16 15:22:02 +00:00
|
|
|
|
2012-03-05 15:24:57 +00:00
|
|
|
/* TS 44.060 Section 10.4.7 Table 10.4.7.1: Payload Type field */
|
|
|
|
enum gprs_rlcmac_block_type {
|
|
|
|
GPRS_RLCMAC_DATA_BLOCK = 0x0,
|
|
|
|
GPRS_RLCMAC_CONTROL_BLOCK = 0x1,
|
|
|
|
GPRS_RLCMAC_CONTROL_BLOCK_OPT = 0x2,
|
|
|
|
GPRS_RLCMAC_RESERVED = 0x3
|
|
|
|
};
|
2012-06-17 04:30:06 +00:00
|
|
|
|
2012-07-06 07:28:15 +00:00
|
|
|
int gprs_rlcmac_tx_ul_ud(gprs_rlcmac_tbf *tbf);
|
2012-03-05 15:24:57 +00:00
|
|
|
|
2012-10-08 10:30:56 +00:00
|
|
|
int gprs_rlcmac_paging_request(uint8_t *ptmsi, uint16_t ptmsi_len,
|
|
|
|
const char *imsi);
|
|
|
|
|
2013-10-17 16:12:18 +00:00
|
|
|
int gprs_rlcmac_rcv_rts_block(struct gprs_rlcmac_bts *bts,
|
|
|
|
uint8_t trx, uint8_t ts, uint16_t arfcn,
|
2012-07-03 11:36:03 +00:00
|
|
|
uint32_t fn, uint8_t block_nr);
|
2012-06-29 18:53:15 +00:00
|
|
|
|
2015-07-17 09:38:49 +00:00
|
|
|
int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts,
|
|
|
|
uint8_t ms_class = 0);
|
|
|
|
|
2012-07-22 06:58:09 +00:00
|
|
|
extern "C" {
|
|
|
|
#endif
|
2013-07-28 16:55:14 +00:00
|
|
|
int alloc_algorithm_a(struct gprs_rlcmac_bts *bts,
|
2015-06-18 15:16:26 +00:00
|
|
|
struct GprsMs *ms,
|
2015-07-10 08:41:36 +00:00
|
|
|
struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single,
|
|
|
|
int use_trx);
|
2012-07-22 06:58:09 +00:00
|
|
|
|
2013-07-28 16:55:14 +00:00
|
|
|
int alloc_algorithm_b(struct gprs_rlcmac_bts *bts,
|
2015-06-18 15:16:26 +00:00
|
|
|
struct GprsMs *ms,
|
2015-07-10 08:41:36 +00:00
|
|
|
struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single,
|
|
|
|
int use_trx);
|
2015-07-14 11:31:48 +00:00
|
|
|
|
|
|
|
int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts,
|
|
|
|
struct GprsMs *ms,
|
|
|
|
struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single,
|
|
|
|
int use_trx);
|
2012-07-22 06:58:09 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2012-07-20 19:50:31 +00:00
|
|
|
#endif
|
2012-07-19 11:06:26 +00:00
|
|
|
|
2012-03-05 15:24:57 +00:00
|
|
|
#endif // GPRS_RLCMAC_H
|