llc: Remove one of the two variants to put data into the frame
This commit is contained in:
parent
d26318e4a7
commit
857281f7ff
14
src/llc.cpp
14
src/llc.cpp
|
@ -22,6 +22,8 @@
|
||||||
#include <tbf.h>
|
#include <tbf.h>
|
||||||
#include <bts.h>
|
#include <bts.h>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <osmocom/core/msgb.h>
|
#include <osmocom/core/msgb.h>
|
||||||
}
|
}
|
||||||
|
@ -45,6 +47,10 @@ void gprs_llc::enqueue(struct msgb *llc_msg)
|
||||||
|
|
||||||
void gprs_llc::put_frame(const uint8_t *data, size_t len)
|
void gprs_llc::put_frame(const uint8_t *data, size_t len)
|
||||||
{
|
{
|
||||||
|
/* only put frames when we are empty */
|
||||||
|
OSMO_ASSERT(index == 0 && length == 0);
|
||||||
|
|
||||||
|
/* TODO: bounds check */
|
||||||
memcpy(frame, data, len);
|
memcpy(frame, data, len);
|
||||||
length = len;
|
length = len;
|
||||||
}
|
}
|
||||||
|
@ -68,11 +74,3 @@ struct msgb *gprs_llc::dequeue()
|
||||||
{
|
{
|
||||||
return msgb_dequeue(&queue);
|
return msgb_dequeue(&queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gprs_llc::update_frame(struct msgb *msg)
|
|
||||||
{
|
|
||||||
/* TODO: assert that index is 0 now */
|
|
||||||
/* TODO: bounds check */
|
|
||||||
memcpy(frame, msg->data, msg->len);
|
|
||||||
length = msg->len;
|
|
||||||
}
|
|
||||||
|
|
|
@ -34,7 +34,6 @@ struct gprs_llc {
|
||||||
void enqueue(struct msgb *llc_msg);
|
void enqueue(struct msgb *llc_msg);
|
||||||
struct msgb *dequeue();
|
struct msgb *dequeue();
|
||||||
|
|
||||||
void update_frame(struct msgb *msg);
|
|
||||||
void put_frame(const uint8_t *data, size_t len);
|
void put_frame(const uint8_t *data, size_t len);
|
||||||
void consume(uint8_t *data, size_t len);
|
void consume(uint8_t *data, size_t len);
|
||||||
void clear(BTS *bts);
|
void clear(BTS *bts);
|
||||||
|
|
|
@ -1096,7 +1096,7 @@ do_resend:
|
||||||
if (msg) {
|
if (msg) {
|
||||||
LOGP(DRLCMACDL, LOGL_INFO, "- Dequeue next LLC for "
|
LOGP(DRLCMACDL, LOGL_INFO, "- Dequeue next LLC for "
|
||||||
"%s (len=%d)\n", tbf_name(this), msg->len);
|
"%s (len=%d)\n", tbf_name(this), msg->len);
|
||||||
m_llc.update_frame(msg);
|
m_llc.put_frame(msg->data, msg->len);
|
||||||
msgb_free(msg);
|
msgb_free(msg);
|
||||||
}
|
}
|
||||||
/* if we have more data and we have space left */
|
/* if we have more data and we have space left */
|
||||||
|
@ -1551,7 +1551,7 @@ int gprs_rlcmac_tbf::snd_dl_ack(uint8_t final, uint8_t ssn, uint8_t *rbb)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#warning "Copy and paste on the sender path"
|
#warning "Copy and paste on the sender path"
|
||||||
m_llc.update_frame(msg);
|
m_llc.put_frame(msg->data, msg->len);
|
||||||
msgb_free(msg);
|
msgb_free(msg);
|
||||||
|
|
||||||
/* we have a message, so we trigger downlink assignment, and there
|
/* we have a message, so we trigger downlink assignment, and there
|
||||||
|
|
Loading…
Reference in New Issue