bts, tbf: Change the TBF return type of functions to the ul/dl version
Many functions only ever deal with or return a UL or a DL TBF. Explicitly change the type to reflect which TBF is used where. Ticket: SYS#389 Sponsored-by: On-Waves ehf
This commit is contained in:
parent
fe6e2e4a08
commit
0d12a2fa89
45
src/bts.cpp
45
src/bts.cpp
|
@ -417,7 +417,7 @@ int BTS::rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn)
|
||||||
|
|
||||||
int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta)
|
int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta)
|
||||||
{
|
{
|
||||||
struct gprs_rlcmac_tbf *tbf;
|
struct gprs_rlcmac_ul_tbf *tbf;
|
||||||
uint8_t trx_no, ts_no = 0;
|
uint8_t trx_no, ts_no = 0;
|
||||||
int8_t tfi; /* must be signed */
|
int8_t tfi; /* must be signed */
|
||||||
uint8_t sb = 0;
|
uint8_t sb = 0;
|
||||||
|
@ -461,7 +461,7 @@ int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
/* set class to 0, since we don't know the multislot class yet */
|
/* set class to 0, since we don't know the multislot class yet */
|
||||||
tbf = tbf_alloc(&m_bts, NULL, GPRS_RLCMAC_UL_TBF, tfi, trx_no, 0, 1);
|
tbf = (gprs_rlcmac_ul_tbf *)tbf_alloc(&m_bts, NULL, GPRS_RLCMAC_UL_TBF, tfi, trx_no, 0, 1);
|
||||||
if (!tbf) {
|
if (!tbf) {
|
||||||
LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n");
|
LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n");
|
||||||
/* FIXME: send reject */
|
/* FIXME: send reject */
|
||||||
|
@ -692,7 +692,7 @@ void gprs_rlcmac_pdch::add_paging(struct gprs_rlcmac_paging *pag)
|
||||||
*/
|
*/
|
||||||
int gprs_rlcmac_pdch::rcv_data_block_acknowledged(uint8_t *data, uint8_t len, int8_t rssi)
|
int gprs_rlcmac_pdch::rcv_data_block_acknowledged(uint8_t *data, uint8_t len, int8_t rssi)
|
||||||
{
|
{
|
||||||
struct gprs_rlcmac_tbf *tbf;
|
struct gprs_rlcmac_ul_tbf *tbf;
|
||||||
struct rlc_ul_header *rh = (struct rlc_ul_header *)data;
|
struct rlc_ul_header *rh = (struct rlc_ul_header *)data;
|
||||||
|
|
||||||
switch (len) {
|
switch (len) {
|
||||||
|
@ -867,24 +867,24 @@ void gprs_rlcmac_pdch::rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *ack_n
|
||||||
|
|
||||||
void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn)
|
void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn)
|
||||||
{
|
{
|
||||||
struct gprs_rlcmac_tbf *tbf;
|
|
||||||
struct gprs_rlcmac_sba *sba;
|
struct gprs_rlcmac_sba *sba;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
if (request->ID.UnionType) {
|
if (request->ID.UnionType) {
|
||||||
|
struct gprs_rlcmac_ul_tbf *ul_tbf;
|
||||||
|
struct gprs_rlcmac_dl_tbf *dl_tbf;
|
||||||
uint32_t tlli = request->ID.u.TLLI;
|
uint32_t tlli = request->ID.u.TLLI;
|
||||||
uint8_t ms_class = 0;
|
uint8_t ms_class = 0;
|
||||||
struct gprs_rlcmac_tbf *dl_tbf;
|
|
||||||
uint8_t ta;
|
uint8_t ta;
|
||||||
|
|
||||||
tbf = bts()->ul_tbf_by_tlli(tlli);
|
ul_tbf = bts()->ul_tbf_by_tlli(tlli);
|
||||||
if (tbf) {
|
if (ul_tbf) {
|
||||||
LOGP(DRLCMACUL, LOGL_NOTICE, "Got RACH from "
|
LOGP(DRLCMACUL, LOGL_NOTICE, "Got RACH from "
|
||||||
"TLLI=0x%08x while %s still "
|
"TLLI=0x%08x while %s still "
|
||||||
"exists. Killing pending DL TBF\n",
|
"exists. Killing pending DL TBF\n",
|
||||||
tlli, tbf_name(tbf));
|
tlli, tbf_name(ul_tbf));
|
||||||
tbf_free(tbf);
|
tbf_free(ul_tbf);
|
||||||
tbf = NULL;
|
ul_tbf = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dl_tbf = bts()->dl_tbf_by_tlli(tlli))) {
|
if ((dl_tbf = bts()->dl_tbf_by_tlli(tlli))) {
|
||||||
|
@ -918,34 +918,41 @@ void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request,
|
||||||
ms_class = Decoding::get_ms_class_by_capability(&request->MS_Radio_Access_capability);
|
ms_class = Decoding::get_ms_class_by_capability(&request->MS_Radio_Access_capability);
|
||||||
if (!ms_class)
|
if (!ms_class)
|
||||||
LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n");
|
LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n");
|
||||||
tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, tlli, ta, NULL);
|
ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, tlli, ta, NULL);
|
||||||
if (!tbf)
|
if (!ul_tbf)
|
||||||
return;
|
return;
|
||||||
/* set control ts to current MS's TS, until assignment complete */
|
/* set control ts to current MS's TS, until assignment complete */
|
||||||
LOGP(DRLCMAC, LOGL_DEBUG, "Change control TS to %d until assinment is complete.\n", ts_no);
|
LOGP(DRLCMAC, LOGL_DEBUG, "Change control TS to %d until assinment is complete.\n", ts_no);
|
||||||
tbf->control_ts = ts_no;
|
ul_tbf->control_ts = ts_no;
|
||||||
/* schedule uplink assignment */
|
/* schedule uplink assignment */
|
||||||
tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS;
|
ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (request->ID.u.Global_TFI.UnionType) {
|
if (request->ID.u.Global_TFI.UnionType) {
|
||||||
|
struct gprs_rlcmac_dl_tbf *dl_tbf;
|
||||||
int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI;
|
int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI;
|
||||||
tbf = bts()->dl_tbf_by_tfi(tfi, trx_no());
|
dl_tbf = bts()->dl_tbf_by_tfi(tfi, trx_no());
|
||||||
if (!tbf) {
|
if (!dl_tbf) {
|
||||||
LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi);
|
LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
LOGP(DRLCMAC, LOGL_ERROR,
|
||||||
|
"RX: [PCU <- BTS] %s FIXME: Packet resource request\n",
|
||||||
|
tbf_name(dl_tbf));
|
||||||
} else {
|
} else {
|
||||||
|
struct gprs_rlcmac_ul_tbf *ul_tbf;
|
||||||
int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI;
|
int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI;
|
||||||
tbf = bts()->ul_tbf_by_tfi(tfi, trx_no());
|
ul_tbf = bts()->ul_tbf_by_tfi(tfi, trx_no());
|
||||||
if (!tbf) {
|
if (!ul_tbf) {
|
||||||
LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi);
|
LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
LOGP(DRLCMAC, LOGL_ERROR,
|
||||||
|
"RX: [PCU <- BTS] %s FIXME: Packet resource request\n",
|
||||||
|
tbf_name(ul_tbf));
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGP(DRLCMAC, LOGL_ERROR, "RX: [PCU <- BTS] %s FIXME: Packet resource request\n", tbf_name(tbf));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn)
|
void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn)
|
||||||
|
|
|
@ -214,12 +214,12 @@ int gprs_rlcmac_tbf::handle(struct gprs_rlcmac_bts *bts,
|
||||||
return tbf_new_dl_assignment(bts, imsi, tlli, ms_class, data, len);
|
return tbf_new_dl_assignment(bts, imsi, tlli, ms_class, data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct gprs_rlcmac_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts,
|
gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts,
|
||||||
int8_t use_trx, uint8_t ms_class,
|
int8_t use_trx, uint8_t ms_class,
|
||||||
uint32_t tlli, uint8_t ta, struct gprs_rlcmac_tbf *dl_tbf)
|
uint32_t tlli, uint8_t ta, struct gprs_rlcmac_tbf *dl_tbf)
|
||||||
{
|
{
|
||||||
uint8_t trx;
|
uint8_t trx;
|
||||||
struct gprs_rlcmac_tbf *tbf;
|
struct gprs_rlcmac_ul_tbf *tbf;
|
||||||
int8_t tfi; /* must be signed */
|
int8_t tfi; /* must be signed */
|
||||||
|
|
||||||
#warning "Copy and paste with tbf_new_dl_assignment"
|
#warning "Copy and paste with tbf_new_dl_assignment"
|
||||||
|
@ -231,7 +231,7 @@ struct gprs_rlcmac_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* use multislot class of downlink TBF */
|
/* use multislot class of downlink TBF */
|
||||||
tbf = tbf_alloc(bts, dl_tbf, GPRS_RLCMAC_UL_TBF, tfi, trx, ms_class, 0);
|
tbf = (gprs_rlcmac_ul_tbf *)tbf_alloc(bts, dl_tbf, GPRS_RLCMAC_UL_TBF, tfi, trx, ms_class, 0);
|
||||||
if (!tbf) {
|
if (!tbf) {
|
||||||
LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n");
|
LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n");
|
||||||
/* FIXME: send reject */
|
/* FIXME: send reject */
|
||||||
|
|
|
@ -259,7 +259,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct gprs_rlcmac_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts,
|
struct gprs_rlcmac_ul_tbf *tbf_alloc_ul(struct gprs_rlcmac_bts *bts,
|
||||||
int8_t use_trx, uint8_t ms_class,
|
int8_t use_trx, uint8_t ms_class,
|
||||||
uint32_t tlli, uint8_t ta, struct gprs_rlcmac_tbf *dl_tbf);
|
uint32_t tlli, uint8_t ta, struct gprs_rlcmac_tbf *dl_tbf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue