tbf, gprs_bssgp_pcu: Move some methods to DL TBF
These methods are only used on DL TBFs and can be moved to the subclass. Ticket: SYS#389 Sponsored by: On-Waves ehf
This commit is contained in:
parent
532a4b54f5
commit
3016888ee0
|
@ -152,7 +152,7 @@ static int gprs_bssgp_pcu_rx_dl_ud(struct msgb *msg, struct tlv_parsed *tp)
|
|||
|
||||
LOGP(DBSSGP, LOGL_INFO, "LLC [SGSN -> PCU] = TLLI: 0x%08x IMSI: %s len: %d\n", tlli, imsi, len);
|
||||
|
||||
return gprs_rlcmac_tbf::handle(the_pcu.bts, tlli, imsi, ms_class, delay_csec, data, len);
|
||||
return gprs_rlcmac_dl_tbf::handle(the_pcu.bts, tlli, imsi, ms_class, delay_csec, data, len);
|
||||
}
|
||||
|
||||
int gprs_bssgp_pcu_rx_paging_ps(struct msgb *msg, struct tlv_parsed *tp)
|
||||
|
|
10
src/tbf.cpp
10
src/tbf.cpp
|
@ -196,7 +196,7 @@ static int tbf_new_dl_assignment(struct gprs_rlcmac_bts *bts,
|
|||
/**
|
||||
* TODO: split into unit test-able parts...
|
||||
*/
|
||||
int gprs_rlcmac_tbf::handle(struct gprs_rlcmac_bts *bts,
|
||||
int gprs_rlcmac_dl_tbf::handle(struct gprs_rlcmac_bts *bts,
|
||||
const uint32_t tlli, const char *imsi,
|
||||
const uint8_t ms_class, const uint16_t delay_csec,
|
||||
const uint8_t *data, const uint16_t len)
|
||||
|
@ -1400,7 +1400,7 @@ struct msgb *gprs_rlcmac_tbf::create_ul_ack(uint32_t fn)
|
|||
return msg;
|
||||
}
|
||||
|
||||
int gprs_rlcmac_tbf::update_window(const uint8_t ssn, const uint8_t *rbb)
|
||||
int gprs_rlcmac_dl_tbf::update_window(const uint8_t ssn, const uint8_t *rbb)
|
||||
{
|
||||
int16_t dist; /* must be signed */
|
||||
uint16_t lost = 0, received = 0;
|
||||
|
@ -1455,7 +1455,7 @@ int gprs_rlcmac_tbf::update_window(const uint8_t ssn, const uint8_t *rbb)
|
|||
}
|
||||
|
||||
|
||||
int gprs_rlcmac_tbf::maybe_start_new_window()
|
||||
int gprs_rlcmac_dl_tbf::maybe_start_new_window()
|
||||
{
|
||||
struct msgb *msg;
|
||||
uint16_t received;
|
||||
|
@ -1781,7 +1781,7 @@ const char *tbf_name(gprs_rlcmac_tbf *tbf)
|
|||
}
|
||||
|
||||
|
||||
void gprs_rlcmac_tbf::reuse_tbf(const uint8_t *data, const uint16_t len)
|
||||
void gprs_rlcmac_dl_tbf::reuse_tbf(const uint8_t *data, const uint16_t len)
|
||||
{
|
||||
bts->tbf_reused();
|
||||
m_llc.put_frame(data, len);
|
||||
|
@ -1803,7 +1803,7 @@ void gprs_rlcmac_tbf::reuse_tbf(const uint8_t *data, const uint16_t len)
|
|||
bts->trigger_dl_ass(this, this, NULL);
|
||||
}
|
||||
|
||||
bool gprs_rlcmac_tbf::dl_window_stalled() const
|
||||
bool gprs_rlcmac_dl_tbf::dl_window_stalled() const
|
||||
{
|
||||
return dir.dl.window.window_stalled();
|
||||
}
|
||||
|
|
19
src/tbf.h
19
src/tbf.h
|
@ -128,12 +128,6 @@ struct gprs_rlcmac_tbf {
|
|||
|
||||
/* blocks were acked */
|
||||
int rcv_data_block_acknowledged(const uint8_t *data, size_t len, int8_t rssi);
|
||||
|
||||
/* dispatch Unitdata.DL messages */
|
||||
static int handle(struct gprs_rlcmac_bts *bts,
|
||||
const uint32_t tlli, const char *imsi, const uint8_t ms_class,
|
||||
const uint16_t delay_csec, const uint8_t *data, const uint16_t len);
|
||||
|
||||
uint8_t tsc() const;
|
||||
|
||||
int rlcmac_diag();
|
||||
|
@ -260,11 +254,7 @@ struct gprs_rlcmac_tbf {
|
|||
char m_imsi[16];
|
||||
|
||||
protected:
|
||||
int update_window(const uint8_t ssn, const uint8_t *rbb);
|
||||
int maybe_start_new_window();
|
||||
void reuse_tbf(const uint8_t *data, const uint16_t len);
|
||||
gprs_rlcmac_bts *bts_data() const;
|
||||
bool dl_window_stalled() const;
|
||||
|
||||
int extract_tlli(const uint8_t *data, const size_t len);
|
||||
void maybe_schedule_uplink_acknack(const rlc_ul_header *rh);
|
||||
|
@ -345,6 +335,11 @@ inline time_t gprs_rlcmac_tbf::created_ts() const
|
|||
}
|
||||
|
||||
struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf {
|
||||
/* dispatch Unitdata.DL messages */
|
||||
static int handle(struct gprs_rlcmac_bts *bts,
|
||||
const uint32_t tlli, const char *imsi, const uint8_t ms_class,
|
||||
const uint16_t delay_csec, const uint8_t *data, const uint16_t len);
|
||||
|
||||
int append_data(const uint8_t ms_class,
|
||||
const uint16_t pdu_delay_csec,
|
||||
const uint8_t *data, const uint16_t len);
|
||||
|
@ -356,6 +351,10 @@ protected:
|
|||
struct msgb *create_new_bsn(const uint32_t fn, const uint8_t ts);
|
||||
struct msgb *create_dl_acked_block(const uint32_t fn, const uint8_t ts,
|
||||
const int index, const bool fin_first_ack);
|
||||
int update_window(const uint8_t ssn, const uint8_t *rbb);
|
||||
int maybe_start_new_window();
|
||||
bool dl_window_stalled() const;
|
||||
void reuse_tbf(const uint8_t *data, const uint16_t len);
|
||||
};
|
||||
|
||||
struct gprs_rlcmac_ul_tbf : public gprs_rlcmac_tbf {
|
||||
|
|
Loading…
Reference in New Issue