struct gsm_bts_trx *trx;
struct gsm_lchan *lchan;
+ /* the Layer1 header (if any) */
+ unsigned char *l1h;
+ /* the A-bis layer 2 header: OML, RSL(RLL), NS */
unsigned char *l2h;
+ /* the layer 3 header. For OML: FOM; RSL: 04.08; GPRS: BSSGP */
unsigned char *l3h;
- unsigned char *smsh;
+
+ /* the layer 4 header */
+ union {
+ unsigned char *smsh;
+ unsigned char *llch;
+ };
+
+ /* the layer 5 header, GPRS: GMM header */
+ unsigned char *gmmh;
+ uint32_t tlli;
uint16_t data_len;
uint16_t len;
extern struct msgb *msgb_dequeue(struct llist_head *queue);
extern void msgb_reset(struct msgb *m);
+#define msgb_l1(m) ((void *)(m->l1h))
#define msgb_l2(m) ((void *)(m->l2h))
#define msgb_l3(m) ((void *)(m->l3h))
#define msgb_sms(m) ((void *)(m->smsh))
+static inline unsigned int msgb_l1len(const struct msgb *msgb)
+{
+ return msgb->tail - (uint8_t *)msgb_l1(msgb);
+}
+
static inline unsigned int msgb_l2len(const struct msgb *msgb)
{
return msgb->tail - (uint8_t *)msgb_l2(msgb);
}
static inline int msgb_tailroom(const struct msgb *msgb)
{
- return (msgb->data + msgb->data_len) - msgb->tail;
+ return (msgb->head + msgb->data_len) - msgb->tail;
}
/* increase the headroom of an empty msgb, reducing the tailroom */