libosmogsm 1.13.1.1-afb4 Osmocom GSM library

Files | Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
LAPDm implementation according to GSM TS 04.06

## Files
file | lapdm.h
file | lapdm.c
| GSM LAPDm (TS 04.06) implementation.

## Data Structures
struct | lapdm_msg_ctx
| LAPDm message context. More...
struct | lapdm_datalink
| LAPDm datalink like TS 04.06 / Section 3.5.2. More...
struct | lapdm_entity
| a LAPDm Entity More...
struct | lapdm_channel
| the two lapdm_entities that form a GSM logical channel (ACCH + DCCH) More...

## Macros
#define | LAPDM_ENT_F_EMPTY_FRAME 0x0001
#define | LAPDM_ENT_F_POLLING_ONLY 0x0002
#define | LAPDM_ENT_F_DROP_2ND_REJ 0x0004
#define | LAPDM_ENT_F_RTS 0x0008
#define | LAPD_U_SABM 0x7
#define | LAPDm_LPD_NORMAL 0
#define | LAPDm_LPD_SMSCB 1
#define | LAPDm_SAPI_NORMAL 0
#define | LAPDm_SAPI_SMS 3
#define | LAPDm_ADDR(lpd, sapi, cr) ((((lpd) & 0x3) << 5) | (((sapi) & 0x7) << 2) | (((cr) & 0x1) << 1) | 0x1)
#define | LAPDm_ADDR_LPD(addr) (((addr) >> 5) & 0x3)
#define | LAPDm_ADDR_SAPI(addr) (((addr) >> 2) & 0x7)
#define | LAPDm_ADDR_CR(addr) (((addr) >> 1) & 0x1)
#define | LAPDm_ADDR_EA(addr) ((addr) & 0x1)
#define | LAPDm_ADDR_SHORT_L2(addr) ((addr) & 0x3)
#define | LAPDm_CTRL_I(nr, ns, p) ((((nr) & 0x7) << 5) | (((p) & 0x1) << 4) | (((ns) & 0x7) << 1))
#define | LAPDm_CTRL_S(nr, s, p) ((((nr) & 0x7) << 5) | (((p) & 0x1) << 4) | (((s) & 0x3) << 2) | 0x1)
#define | LAPDm_CTRL_U(u, p) ((((u) & 0x1c) << (5-2)) | (((p) & 0x1) << 4) | (((u) & 0x3) << 2) | 0x3)
#define | LAPDm_CTRL_is_I(ctrl) (((ctrl) & 0x1) == 0)
#define | LAPDm_CTRL_is_S(ctrl) (((ctrl) & 0x3) == 1)
#define | LAPDm_CTRL_is_U(ctrl) (((ctrl) & 0x3) == 3)
#define | LAPDm_CTRL_U_BITS(ctrl) ((((ctrl) & 0xC) >> 2) | ((ctrl) & 0xE0) >> 3)
#define | LAPDm_CTRL_PF_BIT(ctrl) (((ctrl) >> 4) & 0x1)
#define | LAPDm_CTRL_S_BITS(ctrl) (((ctrl) & 0xC) >> 2)
#define | LAPDm_CTRL_I_Ns(ctrl) (((ctrl) & 0xE) >> 1)
#define | LAPDm_CTRL_Nr(ctrl) (((ctrl) & 0xE0) >> 5)
#define | LAPDm_LEN(len) ((len << 2) | 0x1)
#define | LAPDm_MORE 0x2
#define | LAPDm_EL 0x1
#define | LAPDm_U_UI 0x0
#define | N201_AB_SACCH 18
#define | N201_AB_SDCCH 20
#define | N201_AB_FACCH 20
#define | N201_Bbis 23
#define | N201_Bter_SACCH 21
#define | N201_Bter_SDCCH 23
#define | N201_Bter_FACCH 23
#define | N201_B4 19
#define | N200_EST_REL 5
#define | N200_TR_SACCH 5
#define | N200_TR_SDCCH 23
#define | N200_TR_FACCH_FR 34
#define | N200_TR_EFACCH_FR 48
#define | N200_TR_FACCH_HR 29
#define | N200 N200_TR_SDCCH

## Typedefs
typedef int(* | lapdm_cb_t) (struct msgb *msg, struct lapdm_entity *le, void *ctx)

## Enumerations
enum | lapdm_mode { LAPDM_MODE_MS , LAPDM_MODE_BTS }
| LAPDm mode/role. More...
enum | lapdm_dl_sapi { DL_SAPI0 = 0 , DL_SAPI3 = 1 , _NR_DL_SAPI }
| LAPDm datalink SAPIs. More...
enum | lapdm_format { LAPDm_FMT_A , LAPDm_FMT_B , LAPDm_FMT_Bbis , LAPDm_FMT_Bter , LAPDm_FMT_B4 }

## Functions
const char * | get_rsl_name (int value)
struct lapdm_datalink * | lapdm_datalink_for_sapi (struct lapdm_entity *le, uint8_t sapi)
void | lapdm_entity_init (struct lapdm_entity *le, enum lapdm_mode mode, int t200)
| initialize a LAPDm entity and all datalinks inside More...
void | lapdm_entity_init2 (struct lapdm_entity *le, enum lapdm_mode mode, const int *t200_ms, int n200)
| initialize a LAPDm entity and all datalinks inside More...
void | lapdm_entity_init3 (struct lapdm_entity *le, enum lapdm_mode mode, const int *t200_ms, int n200, const char *name_pfx)
| initialize a LAPDm entity and all datalinks inside More...
void | lapdm_channel_init (struct lapdm_channel *lc, enum lapdm_mode mode)
| initialize a LAPDm channel and all its channels More...
int | lapdm_channel_init2 (struct lapdm_channel *lc, enum lapdm_mode mode, const int *t200_ms_dcch, const int *t200_ms_acch, enum gsm_chan_t chan_t)
| initialize a LAPDm channel and all its channels More...
int | lapdm_channel_init3 (struct lapdm_channel *lc, enum lapdm_mode mode, const int *t200_ms_dcch, const int *t200_ms_acch, enum gsm_chan_t chan_t, const char *name_pfx)
| initialize a LAPDm channel and all its channels More...
void | lapdm_entity_exit (struct lapdm_entity *le)
| flush and release all resoures in LAPDm entity More...
void | lapdm_channel_exit (struct lapdm_channel *lc)
int | lapdm_phsap_up (struct osmo_prim_hdr *oph, struct lapdm_entity *le)
| Receive a PH-SAP primitive from L1. More...
int | lapdm_rslms_recvmsg (struct msgb *msg, struct lapdm_channel *lc)
| Receive a RSLms Message buffers from Layer 3. More...
void | lapdm_channel_set_l3 (struct lapdm_channel *lc, lapdm_cb_t cb, void *ctx)
| Set the L3 callback and context of a LAPDm channel. More...
void | lapdm_channel_set_l1 (struct lapdm_channel *lc, osmo_prim_cb cb, void *ctx)
| Set the L1 callback and context of a LAPDm channel. More...
int | lapdm_entity_set_mode (struct lapdm_entity *le, enum lapdm_mode mode)
| Set the lapdm_mode of a LAPDm entity. More...
int | lapdm_channel_set_mode (struct lapdm_channel *lc, enum lapdm_mode mode)
| Set the lapdm_mode of a LAPDm channel. More...
void | lapdm_entity_reset (struct lapdm_entity *le)
| Reset an entire LAPDm entity and all its datalinks. More...
void | lapdm_channel_reset (struct lapdm_channel *lc)
| Reset a LAPDm channel with all its entities. More...
void | lapdm_entity_set_flags (struct lapdm_entity *le, unsigned int flags)
| Set the flags of a LAPDm entity. More...
void | lapdm_channel_set_flags (struct lapdm_channel *lc, unsigned int flags)
| Set the flags of all LAPDm entities in a LAPDm channel. More...
void | lapdm_entity_set_t200_fn (struct lapdm_entity *le, const uint32_t *t200_fn)
| Set the T200 FN timer of a LAPDm entity. More...
void | lapdm_channel_set_t200_fn (struct lapdm_channel *lc, const uint32_t *t200_fn_dcch, const uint32_t *t200_fn_acch)
| Set the T200 FN timer of all LAPDm entities in a LAPDm channel. More...
int | lapdm_phsap_dequeue_prim (struct lapdm_entity *le, struct osmo_phsap_prim *pp)
| dequeue a msg that's pending transmission via L1 and wrap it into a osmo_phsap_prim More...
int | lapdm_phsap_dequeue_prim_fn (struct lapdm_entity *le, struct osmo_phsap_prim *pp, uint32_t fn)
| dequeue a msg that's pending transmission via L1 and wrap it into a osmo_phsap_prim More...
void | lapdm_t200_fn (struct lapdm_entity *le, uint32_t fn)
| Get receive frame number from L1. More...
static int | lapdm_send_ph_data_req (struct lapd_msg_ctx *lctx, struct msgb *msg)
static int | send_rslms_dlsap (struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
static int | update_pending_frames (struct lapd_msg_ctx *lctx)
static void | lapdm_dl_init (struct lapdm_datalink *dl, struct lapdm_entity *entity, int t200_ms, uint32_t n200, const char *name)
static int | get_n200_dcch (enum gsm_chan_t chan_t)
static void | lapdm_pad_msgb (struct msgb *msg, uint8_t n201)
static int | rslms_sendmsg (struct msgb *msg, struct lapdm_entity *le)
static int | tx_ph_data_enqueue (struct lapdm_datalink *dl, struct msgb *msg, uint8_t chan_nr, uint8_t link_id, uint8_t pad)
static int | tx_ph_data_enqueue_ui (struct lapdm_datalink *dl, struct msgb *msg, uint8_t chan_nr, uint8_t link_id, uint8_t pad)
static struct msgb * | tx_dequeue_msgb (struct lapdm_datalink *dl, uint32_t fn)
static struct msgb * | tx_dequeue_dcch_msgb (struct lapdm_entity *le, uint32_t fn)
static struct msgb * | tx_dequeue_acch_msgb (struct lapdm_entity *le, uint32_t fn)
static void | lapdm_t200_fn_dl (struct lapdm_datalink *dl, uint32_t fn)
static int | l2_ph_data_conf (struct msgb *msg, struct lapdm_entity *le)
static int | rsl_is_transparent (uint8_t msg_type)
static int | send_rslms_rll_l3 (uint8_t msg_type, struct lapdm_msg_ctx *mctx, struct msgb *msg)
static int | send_rslms_rll_l3_ui (struct lapdm_msg_ctx *mctx, struct msgb *msg)
static int | send_rll_simple (uint8_t msg_type, struct lapdm_msg_ctx *mctx)
static int | rsl_rll_error (uint8_t cause, struct lapdm_msg_ctx *mctx)
static int | lapdm_rx_not_permitted (const struct lapdm_entity *le, const struct lapd_msg_ctx *lctx)
static int | l2_ph_data_ind (struct msgb *msg, struct lapdm_entity *le, uint8_t chan_nr, uint8_t link_id, uint32_t fn)
static int | l2_ph_rach_ind (struct lapdm_entity *le, uint8_t ra, uint32_t fn, uint8_t acc_delay)
static int | l2_ph_chan_conf (struct msgb *msg, struct lapdm_entity *le, uint32_t frame_nr)
static int | set_lapdm_context (struct lapdm_datalink *dl, uint8_t chan_nr, uint8_t link_id, int n201, uint8_t sapi)
static int | rslms_rx_rll_est_req (struct msgb *msg, struct lapdm_datalink *dl)
static int | rslms_rx_rll_udata_req (struct msgb *msg, struct lapdm_datalink *dl)
static int | rslms_rx_rll_data_req (struct msgb *msg, struct lapdm_datalink *dl)
static int | rslms_rx_rll_susp_req (struct msgb *msg, struct lapdm_datalink *dl)
static int | rslms_rx_rll_res_req (struct msgb *msg, struct lapdm_datalink *dl)
static int | rslms_rx_rll_rel_req (struct msgb *msg, struct lapdm_datalink *dl)
static int | rslms_rx_chan_rqd (struct lapdm_channel *lc, struct msgb *msg)
static int | rslms_rx_rll (struct msgb *msg, struct lapdm_channel *lc)
static int | rslms_rx_com_chan (struct msgb *msg, struct lapdm_channel *lc)

## Variables
const char * | lapdm_state_names []
const struct value_string | osmo_ph_prim_names []
void * | tall_lapd_ctx

## Detailed Description

## Macro Definition Documentation

## ◆ LAPD_U_SABM

#define LAPD_U_SABM 0x7

## ◆ LAPDm_ADDR

#define LAPDm_ADDR | ( |  | lpd,
|  |  | sapi,
|  |  | cr
| ) |  | ((((lpd) & 0x3) << 5) | (((sapi) & 0x7) << 2) | (((cr) & 0x1) << 1) | 0x1)

## ◆ LAPDm_ADDR_CR

#define LAPDm_ADDR_CR | ( |  | addr | ) | (((addr) >> 1) & 0x1)

## ◆ LAPDm_ADDR_EA

#define LAPDm_ADDR_EA | ( |  | addr | ) | ((addr) & 0x1)

## ◆ LAPDm_ADDR_LPD

#define LAPDm_ADDR_LPD | ( |  | addr | ) | (((addr) >> 5) & 0x3)

## ◆ LAPDm_ADDR_SAPI

#define LAPDm_ADDR_SAPI | ( |  | addr | ) | (((addr) >> 2) & 0x7)

## ◆ LAPDm_ADDR_SHORT_L2

#define LAPDm_ADDR_SHORT_L2 | ( |  | addr | ) | ((addr) & 0x3)

## ◆ LAPDm_CTRL_I

#define LAPDm_CTRL_I | ( |  | nr,
|  |  | ns,
|  |  | p
| ) |  | ((((nr) & 0x7) << 5) | (((p) & 0x1) << 4) | (((ns) & 0x7) << 1))

## ◆ LAPDm_CTRL_I_Ns

#define LAPDm_CTRL_I_Ns | ( |  | ctrl | ) | (((ctrl) & 0xE) >> 1)

## ◆ LAPDm_CTRL_is_I

#define LAPDm_CTRL_is_I | ( |  | ctrl | ) | (((ctrl) & 0x1) == 0)

## ◆ LAPDm_CTRL_is_S

#define LAPDm_CTRL_is_S | ( |  | ctrl | ) | (((ctrl) & 0x3) == 1)

## ◆ LAPDm_CTRL_is_U

#define LAPDm_CTRL_is_U | ( |  | ctrl | ) | (((ctrl) & 0x3) == 3)

## ◆ LAPDm_CTRL_Nr

#define LAPDm_CTRL_Nr | ( |  | ctrl | ) | (((ctrl) & 0xE0) >> 5)

## ◆ LAPDm_CTRL_PF_BIT

#define LAPDm_CTRL_PF_BIT | ( |  | ctrl | ) | (((ctrl) >> 4) & 0x1)

## ◆ LAPDm_CTRL_S

#define LAPDm_CTRL_S | ( |  | nr,
|  |  | s,
|  |  | p
| ) |  | ((((nr) & 0x7) << 5) | (((p) & 0x1) << 4) | (((s) & 0x3) << 2) | 0x1)

## ◆ LAPDm_CTRL_S_BITS

#define LAPDm_CTRL_S_BITS | ( |  | ctrl | ) | (((ctrl) & 0xC) >> 2)

## ◆ LAPDm_CTRL_U

#define LAPDm_CTRL_U | ( |  | u,
|  |  | p
| ) |  | ((((u) & 0x1c) << (5-2)) | (((p) & 0x1) << 4) | (((u) & 0x3) << 2) | 0x3)

## ◆ LAPDm_CTRL_U_BITS

#define LAPDm_CTRL_U_BITS | ( |  | ctrl | ) | ((((ctrl) & 0xC) >> 2) | ((ctrl) & 0xE0) >> 3)

## ◆ LAPDm_EL

#define LAPDm_EL 0x1

## ◆ LAPDM_ENT_F_DROP_2ND_REJ

#define LAPDM_ENT_F_DROP_2ND_REJ 0x0004

## ◆ LAPDM_ENT_F_EMPTY_FRAME

#define LAPDM_ENT_F_EMPTY_FRAME 0x0001

## ◆ LAPDM_ENT_F_POLLING_ONLY

#define LAPDM_ENT_F_POLLING_ONLY 0x0002

## ◆ LAPDM_ENT_F_RTS

#define LAPDM_ENT_F_RTS 0x0008

## ◆ LAPDm_LEN

#define LAPDm_LEN | ( |  | len | ) | ((len << 2) | 0x1)

## ◆ LAPDm_LPD_NORMAL

#define LAPDm_LPD_NORMAL 0

## ◆ LAPDm_LPD_SMSCB

#define LAPDm_LPD_SMSCB 1

## ◆ LAPDm_MORE

#define LAPDm_MORE 0x2

## ◆ LAPDm_SAPI_NORMAL

#define LAPDm_SAPI_NORMAL 0

## ◆ LAPDm_SAPI_SMS

#define LAPDm_SAPI_SMS 3

## ◆ LAPDm_U_UI

#define LAPDm_U_UI 0x0

## ◆ N200

#define N200 N200_TR_SDCCH

## ◆ N200_EST_REL

#define N200_EST_REL 5

## ◆ N200_TR_EFACCH_FR

#define N200_TR_EFACCH_FR 48

## ◆ N200_TR_FACCH_FR

#define N200_TR_FACCH_FR 34

## ◆ N200_TR_FACCH_HR

#define N200_TR_FACCH_HR 29

## ◆ N200_TR_SACCH

#define N200_TR_SACCH 5

## ◆ N200_TR_SDCCH

#define N200_TR_SDCCH 23

## ◆ N201_AB_FACCH

#define N201_AB_FACCH 20

## ◆ N201_AB_SACCH

#define N201_AB_SACCH 18

## ◆ N201_AB_SDCCH

#define N201_AB_SDCCH 20

## ◆ N201_B4

#define N201_B4 19

## ◆ N201_Bbis

#define N201_Bbis 23

## ◆ N201_Bter_FACCH

#define N201_Bter_FACCH 23

## ◆ N201_Bter_SACCH

#define N201_Bter_SACCH 21

## ◆ N201_Bter_SDCCH

#define N201_Bter_SDCCH 23

## Typedef Documentation

## ◆ lapdm_cb_t

typedef int(* lapdm_cb_t) (struct msgb *msg, struct lapdm_entity *le, void *ctx)

## Enumeration Type Documentation

## ◆ lapdm_dl_sapi

enum lapdm_dl_sapi

LAPDm datalink SAPIs.

Enumerator
DL_SAPI0 | SAPI 0.
DL_SAPI3 | SAPI 1.
_NR_DL_SAPI |

## ◆ lapdm_format

enum lapdm_format

Enumerator
LAPDm_FMT_A |
LAPDm_FMT_B |
LAPDm_FMT_Bbis |
LAPDm_FMT_Bter |
LAPDm_FMT_B4 |

## ◆ lapdm_mode

enum lapdm_mode

LAPDm mode/role.

Enumerator
LAPDM_MODE_MS | behave like a MS (mobile phone)
LAPDM_MODE_BTS | behave like a BTS (network)

## Function Documentation

## ◆ get_n200_dcch()

static int get_n200_dcch | ( | enum gsm_chan_t | chan_t | ) |
| static

References GSM_LCHAN_SDCCH, GSM_LCHAN_TCH_F, GSM_LCHAN_TCH_H, N200_TR_FACCH_FR, N200_TR_FACCH_HR, and N200_TR_SDCCH.

Referenced by lapdm_channel_init3().

## ◆ get_rsl_name()

const char * get_rsl_name | ( | int | value | ) |

References OSMO_DEPRECATED, and OSMO_DEPRECATED_OUTSIDE.

## ◆ l2_ph_chan_conf()

static int l2_ph_chan_conf | ( | struct msgb * | msg,
|  | struct lapdm_entity * | le,
|  | uint32_t | frame_nr
| ) |  |
| static

References abis_rsl_cchan_hdr::chan_nr, abis_rsl_cchan_hdr::data, gsm_fn2gsmtime(), msg, msgb_pull_to_l3(), msgb_push(), RSL_CHAN_RACH, RSL_IE_REQ_REFERENCE, rsl_init_cchan_hdr(), RSL_MT_CHAN_CONF, rslms_sendmsg(), gsm_time::t1, gsm_time::t2, and gsm_time::t3.

Referenced by lapdm_phsap_up().

## ◆ l2_ph_data_conf()

static int l2_ph_data_conf | ( | struct msgb * | msg,
|  | struct lapdm_entity * | le
| ) |  |
| static

References lapdm_entity::flags, lapdm_entity::l1_ctx, lapdm_entity::l1_prim_cb, LAPDM_ENT_F_EMPTY_FRAME, lapdm_phsap_dequeue_prim(), msg, msgb_free(), osmo_phsap_prim::oph, osmo_prim_init(), PRIM_OP_REQUEST, PRIM_PH_EMPTY_FRAME, SAP_GSM_PH, and lapdm_entity::tx_pending.

Referenced by lapdm_phsap_up().

## ◆ l2_ph_data_ind()

static int l2_ph_data_ind | ( | struct msgb * | msg,
|  | struct lapdm_entity * | le,
|  | uint8_t | chan_nr,
|  | uint8_t | link_id,
|  | uint32_t | fn
| ) |  |
| static

References lapdm_msg_ctx::chan_nr, chan_nr, lapd_msg_ctx::cr, lapd_msg_ctx::dl, lapdm_msg_ctx::dl, lapdm_datalink::dl, DLLAPD, lapdm_msg_ctx::fn, lapd_msg_ctx::format, LAPD_FORM_I, LAPD_FORM_S, LAPD_FORM_U, LAPD_FORM_UKN, lapd_ph_data_ind(), LAPDm_ADDR_CR, LAPDm_ADDR_EA, LAPDm_ADDR_LPD, LAPDm_ADDR_SAPI, LAPDm_ADDR_SHORT_L2, LAPDm_CTRL_I_Ns, LAPDm_CTRL_is_I, LAPDm_CTRL_is_S, LAPDm_CTRL_is_U, LAPDm_CTRL_Nr, LAPDm_CTRL_PF_BIT, LAPDm_CTRL_S_BITS, LAPDm_CTRL_U_BITS, lapdm_datalink_for_sapi(), LAPDm_EL, lapdm_msg_ctx::lapdm_fmt, LAPDm_FMT_A, LAPDm_FMT_B, LAPDm_FMT_B4, LAPDm_FMT_Bbis, LAPDm_FMT_Bter, LAPDM_MODE_MS, LAPDm_MORE, lapdm_rx_not_permitted(), LAPDm_SAPI_NORMAL, LAPDm_SAPI_SMS, LAPDm_U_UI, lapd_msg_ctx::length, lapdm_msg_ctx::link_id, link_id, LOGDL, LOGL_DEBUG, LOGL_INFO, LOGL_NOTICE, LOGP, lapd_msg_ctx::lpd, lapdm_datalink::mctx, lapdm_entity::mode, lapd_msg_ctx::more, msg, msgb_free(), msgb_pull(), msgb_pull_to_l3(), lapd_msg_ctx::n201, N201_AB_SACCH, N201_AB_SDCCH, N201_B4, N201_Bbis, N201_Bter_SACCH, N201_Bter_SDCCH, lapd_msg_ctx::n_recv, lapd_msg_ctx::n_send, lapd_msg_ctx::p_f, RLL_CAUSE_FRM_UNIMPL, RSL_MT_UNIT_DATA_IND, rsl_rll_error(), lapd_msg_ctx::s_u, lapd_msg_ctx::sapi, send_rslms_rll_l3(), lapdm_msg_ctx::ta_ind, and lapdm_msg_ctx::tx_power_ind.

Referenced by lapdm_phsap_up().

## ◆ l2_ph_rach_ind()

static int l2_ph_rach_ind | ( | struct lapdm_entity * | le,
|  | uint8_t | ra,
|  | uint32_t | fn,
|  | uint8_t | acc_delay
| ) |  |
| static

References abis_rsl_cchan_hdr::chan_nr, gsm_fn2gsmtime(), msg, msgb_alloc_headroom(), msgb_push(), msgb_tv_fixed_put(), msgb_tv_put(), req_ref, RSL_CHAN_RACH, RSL_IE_ACCESS_DELAY, RSL_IE_REQ_REFERENCE, rsl_init_cchan_hdr(), RSL_MT_CHAN_RQD, rslms_sendmsg(), gsm_time::t1, gsm_time::t2, and gsm_time::t3.

Referenced by lapdm_phsap_up().

## ◆ lapdm_channel_exit()

void lapdm_channel_exit | ( | struct lapdm_channel * | lc | ) |

References lapdm_channel::lapdm_acch, lapdm_channel::lapdm_dcch, and lapdm_entity_exit().

## ◆ lapdm_channel_init()

void lapdm_channel_init | ( | struct lapdm_channel * | lc,
|  | enum lapdm_mode | mode
| ) |  |

initialize a LAPDm channel and all its channels

Parameters

  [in] | lc | lapdm_channel to be initialized
  [in] | mode | lapdm_mode (BTS/MS)

Don't use this function; It doesn't support different T200 values per API and doesn't set the correct N200 counter, both of which are required by GSM specs and supported by lapdm_channel_init2().

References _NR_DL_SAPI, GSM_LCHAN_SDCCH, lapdm_channel_init3(), and mode.

## ◆ lapdm_channel_init2()

int lapdm_channel_init2 | ( | struct lapdm_channel * | lc,
|  | enum lapdm_mode | mode,
|  | const int * | t200_ms_dcch,
|  | const int * | t200_ms_acch,
|  | enum gsm_chan_t | chan_t
| ) |  |

initialize a LAPDm channel and all its channels

Parameters

  [in] | lc | lapdm_channel to be initialized
  [in] | mode | lapdm_mode (BTS/MS)
  [in] | t200_ms_dcch | per-SAPI array of T200 in milli-seconds for DCCH
  [in] | t200_ms_acch | per-SAPI array of T200 in milli-seconds for SACCH
  [in] | chan_t | GSM channel type (to correctly set N200)

References lapdm_channel_init3(), and mode.

## ◆ lapdm_channel_init3()

int lapdm_channel_init3 | ( | struct lapdm_channel * | lc,
|  | enum lapdm_mode | mode,
|  | const int * | t200_ms_dcch,
|  | const int * | t200_ms_acch,
|  | enum gsm_chan_t | chan_t,
|  | const char * | name_pfx
| ) |  |

initialize a LAPDm channel and all its channels

Parameters

  [in] | lc | lapdm_channel to be initialized
  [in] | mode | lapdm_mode (BTS/MS)
  [in] | t200_ms_dcch | per-SAPI array of T200 in milli-seconds for DCCH
  [in] | t200_ms_acch | per-SAPI array of T200 in milli-seconds for SACCH
  [in] | chan_t | GSM channel type (to correctly set N200)
  [in] | name_pfx | human-readable name (copied by function + extended with ACCH/DCCH)

References get_n200_dcch(), lapdm_channel::lapdm_acch, lapdm_entity::lapdm_ch, lapdm_channel::lapdm_dcch, lapdm_entity_init3(), mode, N200_TR_SACCH, name, lapdm_channel::name, namebuf, osmo_talloc_replace_string(), and tall_lapd_ctx.

Referenced by lapdm_channel_init(), and lapdm_channel_init2().

## ◆ lapdm_channel_reset()

void lapdm_channel_reset | ( | struct lapdm_channel * | lc | ) |

Reset a LAPDm channel with all its entities.

References lapdm_channel::lapdm_acch, lapdm_channel::lapdm_dcch, and lapdm_entity_reset().

## ◆ lapdm_channel_set_flags()

void lapdm_channel_set_flags | ( | struct lapdm_channel * | lc,
|  | unsigned int | flags
| ) |  |

Set the flags of all LAPDm entities in a LAPDm channel.

References flags, lapdm_channel::lapdm_acch, lapdm_channel::lapdm_dcch, and lapdm_entity_set_flags().

## ◆ lapdm_channel_set_l1()

void lapdm_channel_set_l1 | ( | struct lapdm_channel * | lc,
|  | osmo_prim_cb | cb,
|  | void * | ctx
| ) |  |

Set the L1 callback and context of a LAPDm channel.

References lapdm_entity::l1_ctx, lapdm_entity::l1_prim_cb, lapdm_channel::lapdm_acch, and lapdm_channel::lapdm_dcch.

## ◆ lapdm_channel_set_l3()

void lapdm_channel_set_l3 | ( | struct lapdm_channel * | lc,
|  | lapdm_cb_t | cb,
|  | void * | ctx
| ) |  |

Set the L3 callback and context of a LAPDm channel.

References lapdm_entity::l3_cb, lapdm_entity::l3_ctx, lapdm_channel::lapdm_acch, and lapdm_channel::lapdm_dcch.

## ◆ lapdm_channel_set_mode()

int lapdm_channel_set_mode | ( | struct lapdm_channel * | lc,
|  | enum lapdm_mode | mode
| ) |  |

Set the lapdm_mode of a LAPDm channel.

References lapdm_channel::lapdm_acch, lapdm_channel::lapdm_dcch, lapdm_entity_set_mode(), and mode.

## ◆ lapdm_channel_set_t200_fn()

void lapdm_channel_set_t200_fn | ( | struct lapdm_channel * | lc,
|  | const uint32_t * | t200_fn_dcch,
|  | const uint32_t * | t200_fn_acch
| ) |  |

Set the T200 FN timer of all LAPDm entities in a LAPDm channel.

Parameters

  [in] |  |

ref lapdm_channel

Parameters

  [in] | t200_fn_dcch | Array of T200 timeout in frame numbers for all SAPIs (0, 3) on SDCCH/FACCH
  [in] | t200_fn_acch | Array of T200 timeout in frame numbers for all SAPIs (0, 3) on SACCH

References lapdm_channel::lapdm_acch, lapdm_channel::lapdm_dcch, and lapdm_entity_set_t200_fn().

## ◆ lapdm_datalink_for_sapi()

struct lapdm_datalink * lapdm_datalink_for_sapi | ( | struct lapdm_entity * | le,
|  | uint8_t | sapi
| ) |  |

References lapdm_entity::datalink, LAPDm_SAPI_NORMAL, and LAPDm_SAPI_SMS.

Referenced by l2_ph_data_ind(), and rslms_rx_rll().

## ◆ lapdm_dl_init()

static void lapdm_dl_init | ( | struct lapdm_datalink * | dl,
|  | struct lapdm_entity * | entity,
|  | int | t200_ms,
|  | uint32_t | n200,
|  | const char * | name
| ) |  |
| static

References lapdm_datalink::dl, lapdm_datalink::entity, INIT_LLIST_HEAD, lapd_dl_init2(), lapdm_send_ph_data_req(), lapd_datalink::n200, lapd_datalink::n200_est_rel, N200_EST_REL, name, lapd_datalink::reestablish, lapd_datalink::send_dlsap, lapd_datalink::send_ph_data_req, send_rslms_dlsap(), lapd_datalink::t200_sec, lapd_datalink::t200_usec, lapd_datalink::t203_sec, lapd_datalink::t203_usec, lapdm_datalink::tx_ui_queue, update_pending_frames(), and lapd_datalink::update_pending_frames.

Referenced by lapdm_entity_init3().

## ◆ lapdm_entity_exit()

void lapdm_entity_exit | ( | struct lapdm_entity * | le | ) |

flush and release all resoures in LAPDm entity

References ARRAY_SIZE, lapdm_entity::datalink, lapdm_datalink::dl, lapd_dl_exit(), and msgb_queue_free().

Referenced by lapdm_channel_exit().

## ◆ lapdm_entity_init()

void lapdm_entity_init | ( | struct lapdm_entity * | le,
|  | enum lapdm_mode | mode,
|  | int | t200
| ) |  |

initialize a LAPDm entity and all datalinks inside

Parameters

  [in] | le | LAPDm entity
  [in] | mode | lapdm_mode (BTS/MS)
  [in] | t200 | T200 re-transmission timer for all SAPIs in seconds

Don't use this function; It doesn't support different T200 values per API and doesn't permit the caller to specify the N200 counter, both of which are required by GSM specs and supported by lapdm_entity_init2().

References _NR_DL_SAPI, ARRAY_SIZE, lapdm_entity_init3(), mode, and N200.

## ◆ lapdm_entity_init2()

void lapdm_entity_init2 | ( | struct lapdm_entity * | le,
|  | enum lapdm_mode | mode,
|  | const int * | t200_ms,
|  | int | n200
| ) |  |

initialize a LAPDm entity and all datalinks inside

Parameters

  [in] | le | LAPDm entity
  [in] | mode | lapdm_mode (BTS/MS)
  [in] | t200_ms | per-SAPI array of T200 re-transmission timer in milli-seconds
  [in] | n200 | N200 re-transmisison count

References lapdm_entity_init3(), and mode.

## ◆ lapdm_entity_init3()

void lapdm_entity_init3 | ( | struct lapdm_entity * | le,
|  | enum lapdm_mode | mode,
|  | const int * | t200_ms,
|  | int | n200,
|  | const char * | name_pfx
| ) |  |

initialize a LAPDm entity and all datalinks inside

Parameters

  [in] | le | LAPDm entity
  [in] | mode | lapdm_mode (BTS/MS)
  [in] | t200_ms | per-SAPI array of T200 re-transmission timer in milli-seconds
  [in] | n200 | N200 re-transmisison count
  [in] | name | human-readable name (will be copied internally + extended with SAPI)

References ARRAY_SIZE, lapdm_entity::datalink, lapdm_dl_init(), lapdm_entity_set_mode(), mode, and name.

Referenced by lapdm_channel_init3(), lapdm_entity_init(), and lapdm_entity_init2().

## ◆ lapdm_entity_reset()

void lapdm_entity_reset | ( | struct lapdm_entity * | le | ) |

Reset an entire LAPDm entity and all its datalinks.

References ARRAY_SIZE, lapdm_entity::datalink, lapdm_datalink::dl, lapd_dl_reset(), and msgb_queue_free().

Referenced by lapdm_channel_reset().

## ◆ lapdm_entity_set_flags()

void lapdm_entity_set_flags | ( | struct lapdm_entity * | le,
|  | unsigned int | flags
| ) |  |

Set the flags of a LAPDm entity.

References ARRAY_SIZE, lapdm_entity::datalink, lapdm_datalink::dl, flags, lapdm_entity::flags, lapd_dl_set_flags(), LAPD_F_DROP_2ND_REJ, LAPD_F_RTS, LAPDM_ENT_F_DROP_2ND_REJ, and LAPDM_ENT_F_RTS.

Referenced by lapdm_channel_set_flags().

## ◆ lapdm_entity_set_mode()

int lapdm_entity_set_mode | ( | struct lapdm_entity * | le,
|  | enum lapdm_mode | mode
| ) |  |

Set the lapdm_mode of a LAPDm entity.

References ARRAY_SIZE, lapdm_entity::datalink, lapdm_datalink::dl, LAPD_MODE_NETWORK, LAPD_MODE_USER, lapd_set_mode(), LAPDM_MODE_BTS, LAPDM_MODE_MS, lapdm_entity::mode, and mode.

Referenced by lapdm_channel_set_mode(), and lapdm_entity_init3().

## ◆ lapdm_entity_set_t200_fn()

void lapdm_entity_set_t200_fn | ( | struct lapdm_entity * | le,
|  | const uint32_t * | t200_fn
| ) |  |

Set the T200 FN timer of a LAPDm entity.

Parameters

  [in] |  |

ref lapdm_entity

Parameters

  [in] | t200_fn | Array of T200 timeout in frame numbers for all SAPIs (0, 3)

References ARRAY_SIZE, lapdm_entity::datalink, and lapdm_datalink::t200_fn.

Referenced by lapdm_channel_set_t200_fn().

## ◆ lapdm_pad_msgb()

static void lapdm_pad_msgb | ( | struct msgb * | msg,
|  | uint8_t | n201
| ) |  |
| static

References data, DLLAPD, GSM_MACBLOCK_PADDING, LOGL_ERROR, LOGP, msg, msgb_l2len(), and msgb_put().

Referenced by lapdm_phsap_dequeue_prim_fn(), tx_ph_data_enqueue(), and tx_ph_data_enqueue_ui().

## ◆ lapdm_phsap_dequeue_prim()

int lapdm_phsap_dequeue_prim | ( | struct lapdm_entity * | le,
|  | struct osmo_phsap_prim * | pp
| ) |  |

dequeue a msg that's pending transmission via L1 and wrap it into a osmo_phsap_prim

References lapdm_phsap_dequeue_prim_fn().

Referenced by l2_ph_data_conf().

## ◆ lapdm_phsap_dequeue_prim_fn()

int lapdm_phsap_dequeue_prim_fn | ( | struct lapdm_entity * | le,
|  | struct osmo_phsap_prim * | pp,
|  | uint32_t | fn
| ) |  |

dequeue a msg that's pending transmission via L1 and wrap it into a osmo_phsap_prim

References ph_data_param::chan_nr, osmo_phsap_prim::data, lapdm_entity::lapdm_ch, lapdm_channel::lapdm_dcch, lapdm_pad_msgb(), ph_data_param::link_id, msg, msgb_pull(), osmo_phsap_prim::oph, osmo_prim_init(), PRIM_OP_REQUEST, PRIM_PH_DATA, SAP_GSM_PH, tx_dequeue_acch_msgb(), tx_dequeue_dcch_msgb(), and osmo_phsap_prim::u.

Referenced by lapdm_phsap_dequeue_prim().

## ◆ lapdm_phsap_up()

int lapdm_phsap_up | ( | struct osmo_prim_hdr * | oph,
|  | struct lapdm_entity * | le
| ) |  |

Receive a PH-SAP primitive from L1.

References ph_rach_ind_param::acc_delay, ph_data_param::chan_nr, osmo_phsap_prim::data, DLLAPD, ph_rach_ind_param::fn, ph_data_param::fn, l2_ph_chan_conf(), l2_ph_data_conf(), l2_ph_data_ind(), l2_ph_rach_ind(), ph_data_param::link_id, LOGL_ERROR, LOGP, osmo_prim_hdr::msg, msgb_free(), osmo_phsap_prim::oph, OSMO_PRIM, OSMO_PRIM_HDR, PRIM_OP_CONFIRM, PRIM_OP_INDICATION, PRIM_PH_DATA, PRIM_PH_RACH, PRIM_PH_RTS, osmo_prim_hdr::primitive, ph_rach_ind_param::ra, osmo_phsap_prim::rach_ind, osmo_prim_hdr::sap, SAP_GSM_PH, and osmo_phsap_prim::u.

## ◆ lapdm_rslms_recvmsg()

int lapdm_rslms_recvmsg | ( | struct msgb * | msg,
|  | struct lapdm_channel * | lc
| ) |  |

Receive a RSLms Message buffers from Layer 3.

'msg' ownership is transferred, i.e. caller must not free it

References ABIS_RSL_MDISC_COM_CHAN, ABIS_RSL_MDISC_RLL, DLLAPD, LOGL_ERROR, LOGP, msg, abis_rsl_common_hdr::msg_discr, msgb_free(), msgb_l2, msgb_l2len(), rslms_rx_com_chan(), and rslms_rx_rll().

## ◆ lapdm_rx_not_permitted()

static int lapdm_rx_not_permitted | ( | const struct lapdm_entity * | le,
|  | const struct lapd_msg_ctx * | lctx
| ) |  |
| static

References lapd_msg_ctx::format, LAPD_FORM_U, LAPD_U_SABM, lapdm_channel::lapdm_acch, lapdm_entity::lapdm_ch, LAPDM_MODE_BTS, LAPDM_MODE_MS, lapd_msg_ctx::length, lapdm_entity::mode, RLL_CAUSE_SABM_INFO_NOTALL, lapd_msg_ctx::s_u, and lapd_msg_ctx::sapi.

Referenced by l2_ph_data_ind().

## ◆ lapdm_send_ph_data_req()

static int lapdm_send_ph_data_req | ( | struct lapd_msg_ctx * | lctx,
|  | struct msgb * | msg
| ) |  |
| static

References lapdm_msg_ctx::chan_nr, container_of, lapd_msg_ctx::cr, lapd_msg_ctx::dl, lapdm_msg_ctx::dl, lapdm_datalink::dl, lapdm_datalink::entity, lapd_msg_ctx::format, LAPD_FORM_I, LAPD_FORM_S, LAPD_FORM_U, LAPDm_ADDR, LAPDm_CTRL_I, LAPDm_CTRL_S, LAPDm_CTRL_U, LAPDm_LEN, LAPDm_MORE, lapd_datalink::lctx, lapdm_msg_ctx::link_id, lapd_msg_ctx::lpd, lapdm_datalink::mctx, lapd_msg_ctx::more, msg, msgb_free(), msgb_push(), lapd_msg_ctx::n_recv, lapd_msg_ctx::n_send, lapd_msg_ctx::p_f, lapd_msg_ctx::s_u, lapd_msg_ctx::sapi, lapdm_entity::ta, tx_ph_data_enqueue(), and lapdm_entity::tx_power.

Referenced by lapdm_dl_init().

## ◆ lapdm_t200_fn()

void lapdm_t200_fn | ( | struct lapdm_entity * | le,
|  | uint32_t | fn
| ) |  |

Get receive frame number from L1.

It is used to check the T200 timeout. This function is used if LAPD is in RTS mode only. (Applies if the LAPDM_ENT_F_POLLING_ONLY flag is set.) This function must be called for every valid or invalid data frame received. The frame number fn must be the frame number of the first burst of a data frame. This function must be called after the frame is delivered to layer 2. In case of TCH, this this function must be called for every speech frame received, meaning that there was no valid data frame.

References ARRAY_SIZE, lapdm_entity::datalink, DLLAPD, lapdm_entity::flags, LAPDM_ENT_F_POLLING_ONLY, lapdm_t200_fn_dl(), LOGL_ERROR, and LOGP.

## ◆ lapdm_t200_fn_dl()

static void lapdm_t200_fn_dl | ( | struct lapdm_datalink * | dl,
|  | uint32_t | fn
| ) |  |
| static

References ADD_MODULO, lapdm_datalink::dl, GSM_MAX_FN, LAPD_F_RTS, lapd_datalink::lapd_flags, LAPD_T200_RTS_RUNNING, lapd_t200_timeout(), LOGDL, LOGL_INFO, OSMO_ASSERT, lapd_datalink::t200_rts, and lapdm_datalink::t200_timeout.

Referenced by lapdm_t200_fn().

## ◆ rsl_is_transparent()

static int rsl_is_transparent | ( | uint8_t | msg_type | ) |
| static

References msg_type, RSL_MT_DATA_IND, RSL_MT_DATA_REQ, RSL_MT_UNIT_DATA_IND, and RSL_MT_UNIT_DATA_REQ.

Referenced by send_rll_simple(), and send_rslms_rll_l3().

## ◆ rsl_rll_error()

static int rsl_rll_error | ( | uint8_t | cause,
|  | struct lapdm_msg_ctx * | mctx
| ) |  |
| static

References cause, lapdm_msg_ctx::chan_nr, lapdm_msg_ctx::dl, lapdm_datalink::dl, lapdm_datalink::entity, lapdm_msg_ctx::link_id, LOGDL, LOGL_NOTICE, msg, msgb_tlv_put(), RSL_IE_RLM_CAUSE, RSL_MT_ERROR_IND, rsl_rll_simple(), and rslms_sendmsg().

Referenced by l2_ph_data_ind(), and send_rslms_dlsap().

## ◆ rslms_rx_chan_rqd()

static int rslms_rx_chan_rqd | ( | struct lapdm_channel * | lc,
|  | struct msgb * | msg
| ) |  |
| static

References abis_rsl_cchan_hdr::data, DLLAPD, ph_rach_req_param::is_combined_ccch, lapdm_entity::l1_ctx, lapdm_entity::l1_prim_cb, lapdm_channel::lapdm_dcch, LOGL_ERROR, LOGP, msg, msgb_free(), msgb_l2, msgb_l2len(), ph_rach_req_param::offset, osmo_phsap_prim::oph, osmo_prim_init(), PRIM_OP_REQUEST, PRIM_PH_RACH, ph_rach_req_param::ra, osmo_phsap_prim::rach_req, RSL_IE_ACCESS_DELAY, RSL_IE_MS_POWER, RSL_IE_REQ_REFERENCE, SAP_GSM_PH, ph_rach_req_param::ta, ph_rach_req_param::tx_power, and osmo_phsap_prim::u.

Referenced by rslms_rx_com_chan().

## ◆ rslms_rx_com_chan()

static int rslms_rx_com_chan | ( | struct msgb * | msg,
|  | struct lapdm_channel * | lc
| ) |  |
| static

References abis_rsl_cchan_hdr::c, DLLAPD, LOGL_ERROR, LOGL_NOTICE, LOGP, msg, msg_type, abis_rsl_common_hdr::msg_type, msgb_free(), msgb_l2, msgb_l2len(), RSL_MT_CHAN_RQD, and rslms_rx_chan_rqd().

Referenced by lapdm_rslms_recvmsg().

## ◆ rslms_rx_rll()

static int rslms_rx_rll | ( | struct msgb * | msg,
|  | struct lapdm_channel * | lc
| ) |  |
| static

References abis_rsl_rll_hdr::c, lapd_msg_ctx::dl, lapdm_datalink::dl, DLLAPD, lapdm_channel::lapdm_acch, lapdm_datalink_for_sapi(), lapdm_channel::lapdm_dcch, LAPDM_MODE_BTS, lapd_datalink::lctx, abis_rsl_rll_hdr::link_id, LOGL_ERROR, LOGL_INFO, LOGL_NOTICE, LOGP, lapdm_entity::mode, msg, msg_type, abis_rsl_common_hdr::msg_type, msgb_free(), msgb_l2, msgb_l2len(), lapdm_channel::name, rsl_msg_name(), RSL_MT_DATA_REQ, RSL_MT_EST_REQ, RSL_MT_RECON_REQ, RSL_MT_REL_REQ, RSL_MT_RES_REQ, RSL_MT_SUSP_REQ, RSL_MT_UNIT_DATA_REQ, rslms_rx_rll_data_req(), rslms_rx_rll_est_req(), rslms_rx_rll_rel_req(), rslms_rx_rll_res_req(), rslms_rx_rll_susp_req(), and rslms_rx_rll_udata_req().

Referenced by lapdm_rslms_recvmsg().

## ◆ rslms_rx_rll_data_req()

static int rslms_rx_rll_data_req | ( | struct msgb * | msg,
|  | struct lapdm_datalink * | dl
| ) |  |
| static

References abis_rsl_rll_hdr::data, lapdm_datalink::dl, lapd_recv_dlsap(), lapd_datalink::lctx, length, LOGDL, LOGL_ERROR, msg, msgb_free(), msgb_l2, msgb_l2len(), msgb_pull_to_l3(), msgb_trim(), osmo_dlsap_prim::oph, osmo_prim_init(), PRIM_DL_DATA, PRIM_OP_REQUEST, RSL_IE_L3_INFO, rsl_tlv_parse, TLVP_LEN, TLVP_PRESENT, and TLVP_VAL.

Referenced by rslms_rx_rll().

## ◆ rslms_rx_rll_est_req()

static int rslms_rx_rll_est_req | ( | struct msgb * | msg,
|  | struct lapdm_datalink * | dl
| ) |  |
| static

References chan_nr, abis_rsl_rll_hdr::chan_nr, abis_rsl_rll_hdr::data, lapdm_datalink::dl, lapd_recv_dlsap(), lapd_datalink::lctx, length, link_id, abis_rsl_rll_hdr::link_id, LOGDL, LOGL_ERROR, lapdm_datalink::mctx, msg, msgb_free(), msgb_l2, msgb_l2len(), msgb_pull_to_l3(), msgb_trim(), N201_AB_SACCH, N201_AB_SDCCH, osmo_dlsap_prim::oph, osmo_prim_init(), PRIM_DL_EST, PRIM_OP_REQUEST, RSL_IE_L3_INFO, RSL_MT_REL_IND, rsl_tlv_parse, send_rll_simple(), set_lapdm_context(), TLVP_LEN, TLVP_PRESENT, and TLVP_VAL.

Referenced by rslms_rx_rll().

## ◆ rslms_rx_rll_rel_req()

static int rslms_rx_rll_rel_req | ( | struct msgb * | msg,
|  | struct lapdm_datalink * | dl
| ) |  |
| static

References abis_rsl_rll_hdr::data, lapdm_datalink::dl, lapd_recv_dlsap(), lapd_datalink::lctx, dl_rel_req_param::mode, mode, msg, msgb_l2, msgb_pull_to_l3(), msgb_trim(), osmo_dlsap_prim::oph, osmo_prim_init(), PRIM_DL_REL, PRIM_OP_REQUEST, osmo_dlsap_prim::rel_req, RSL_IE_RELEASE_MODE, and osmo_dlsap_prim::u.

Referenced by rslms_rx_rll().

## ◆ rslms_rx_rll_res_req()

static int rslms_rx_rll_res_req | ( | struct msgb * | msg,
|  | struct lapdm_datalink * | dl
| ) |  |
| static

References abis_rsl_rll_hdr::c, chan_nr, abis_rsl_rll_hdr::chan_nr, abis_rsl_rll_hdr::data, lapdm_datalink::dl, lapd_recv_dlsap(), lapd_datalink::lctx, length, link_id, abis_rsl_rll_hdr::link_id, LOGDL, LOGL_ERROR, lapdm_datalink::mctx, msg, msg_type, abis_rsl_common_hdr::msg_type, msgb_free(), msgb_l2, msgb_l2len(), msgb_pull_to_l3(), msgb_trim(), N201_AB_SACCH, N201_AB_SDCCH, osmo_dlsap_prim::oph, osmo_prim_init(), PRIM_DL_RECON, PRIM_DL_RES, PRIM_OP_REQUEST, RSL_IE_L3_INFO, RSL_MT_REL_IND, RSL_MT_RES_REQ, rsl_tlv_parse, send_rll_simple(), set_lapdm_context(), TLVP_LEN, TLVP_PRESENT, and TLVP_VAL.

Referenced by rslms_rx_rll().

## ◆ rslms_rx_rll_susp_req()

static int rslms_rx_rll_susp_req | ( | struct msgb * | msg,
|  | struct lapdm_datalink * | dl
| ) |  |
| static

References lapdm_datalink::dl, lapd_recv_dlsap(), lapd_datalink::lctx, abis_rsl_rll_hdr::link_id, LOGDL, LOGL_ERROR, msg, msgb_free(), msgb_l2, osmo_dlsap_prim::oph, osmo_prim_init(), PRIM_DL_SUSP, and PRIM_OP_REQUEST.

Referenced by rslms_rx_rll().

## ◆ rslms_rx_rll_udata_req()

static int rslms_rx_rll_udata_req | ( | struct msgb * | msg,
|  | struct lapdm_datalink * | dl
| ) |  |
| static

References chan_nr, abis_rsl_rll_hdr::chan_nr, lapd_cr_ent::cmd, lapd_datalink::cr, abis_rsl_rll_hdr::data, lapdm_datalink::dl, lapdm_datalink::entity, LAPDm_ADDR, LAPDm_CTRL_U, LAPDm_LEN, LAPDm_LPD_NORMAL, LAPDM_MODE_BTS, LAPDm_U_UI, length, link_id, abis_rsl_rll_hdr::link_id, lapd_datalink::loc2rem, LOGDL, LOGL_ERROR, LOGL_INFO, lapdm_entity::mode, msg, msgb_free(), msgb_l2, msgb_l2len(), msgb_pull_to_l3(), msgb_push(), msgb_trim(), RSL_IE_L3_INFO, RSL_IE_MS_POWER, RSL_IE_TIMING_ADVANCE, rsl_tlv_parse, lapdm_entity::ta, TLVP_LEN, TLVP_PRESENT, TLVP_VAL, tx_ph_data_enqueue_ui(), and lapdm_entity::tx_power.

Referenced by rslms_rx_rll().

## ◆ rslms_sendmsg()

static int rslms_sendmsg | ( | struct msgb * | msg,
|  | struct lapdm_entity * | le
| ) |  |
| static

References lapdm_entity::l3_cb, lapdm_entity::l3_ctx, msg, and msgb_free().

Referenced by l2_ph_chan_conf(), l2_ph_rach_ind(), rsl_rll_error(), send_rll_simple(), send_rslms_rll_l3(), and send_rslms_rll_l3_ui().

## ◆ send_rll_simple()

static int send_rll_simple | ( | uint8_t | msg_type,
|  | struct lapdm_msg_ctx * | mctx
| ) |  |
| static

References lapdm_msg_ctx::chan_nr, lapdm_msg_ctx::dl, lapdm_datalink::entity, lapdm_msg_ctx::link_id, msg, msg_type, rsl_is_transparent(), rsl_rll_simple(), and rslms_sendmsg().

Referenced by rslms_rx_rll_est_req(), rslms_rx_rll_res_req(), and send_rslms_dlsap().

## ◆ send_rslms_dlsap()

static int send_rslms_dlsap | ( | struct osmo_dlsap_prim * | dp,
|  | struct lapd_msg_ctx * | lctx
| ) |  |
| static

References mdl_error_ind_param::cause, container_of, lapd_msg_ctx::dl, lapdm_msg_ctx::dl, lapdm_datalink::dl, osmo_dlsap_prim::error_ind, lapd_datalink::lctx, LOGDL, LOGL_ERROR, lapdm_datalink::mctx, osmo_prim_hdr::msg, msgb_free(), osmo_prim_hdr::operation, osmo_dlsap_prim::oph, OSMO_PRIM, OSMO_PRIM_HDR, PRIM_DL_DATA, PRIM_DL_EST, PRIM_DL_REL, PRIM_DL_SUSP, PRIM_DL_UNIT_DATA, PRIM_MDL_ERROR, PRIM_OP_CONFIRM, PRIM_OP_INDICATION, osmo_prim_hdr::primitive, RSL_MT_DATA_IND, RSL_MT_EST_CONF, RSL_MT_EST_IND, RSL_MT_REL_CONF, RSL_MT_REL_IND, RSL_MT_SUSP_CONF, rsl_rll_error(), send_rll_simple(), send_rslms_rll_l3(), send_rslms_rll_l3_ui(), and osmo_dlsap_prim::u.

Referenced by lapdm_dl_init().

## ◆ send_rslms_rll_l3()

static int send_rslms_rll_l3 | ( | uint8_t | msg_type,
|  | struct lapdm_msg_ctx * | mctx,
|  | struct msgb * | msg
| ) |  |
| static

References lapdm_msg_ctx::chan_nr, lapdm_msg_ctx::dl, lapdm_datalink::entity, lapdm_msg_ctx::link_id, msg, msg_type, rsl_is_transparent(), rsl_rll_push_l3(), and rslms_sendmsg().

Referenced by l2_ph_data_ind(), and send_rslms_dlsap().

## ◆ send_rslms_rll_l3_ui()

static int send_rslms_rll_l3_ui | ( | struct lapdm_msg_ctx * | mctx,
|  | struct msgb * | msg
| ) |  |
| static

References lapdm_msg_ctx::chan_nr, lapdm_msg_ctx::dl, lapdm_datalink::entity, lapdm_msg_ctx::lapdm_fmt, LAPDm_FMT_B4, lapdm_msg_ctx::link_id, msg, msgb_l3, msgb_tv16_push(), msgb_tv_push(), RSL_IE_L3_INFO, RSL_IE_MS_POWER, RSL_IE_TIMING_ADVANCE, RSL_MT_UNIT_DATA_IND, rsl_rll_push_hdr(), rslms_sendmsg(), lapdm_msg_ctx::ta_ind, and lapdm_msg_ctx::tx_power_ind.

Referenced by send_rslms_dlsap().

## ◆ set_lapdm_context()

static int set_lapdm_context | ( | struct lapdm_datalink * | dl,
|  | uint8_t | chan_nr,
|  | uint8_t | link_id,
|  | int | n201,
|  | uint8_t | sapi
| ) |  |
| static

References lapdm_msg_ctx::chan_nr, chan_nr, lapd_msg_ctx::dl, lapdm_msg_ctx::dl, lapdm_datalink::dl, lapd_datalink::lctx, lapdm_msg_ctx::link_id, link_id, lapdm_datalink::mctx, lapd_msg_ctx::n201, and lapd_msg_ctx::sapi.

Referenced by rslms_rx_rll_est_req(), and rslms_rx_rll_res_req().

## ◆ tx_dequeue_acch_msgb()

static struct msgb * tx_dequeue_acch_msgb | ( | struct lapdm_entity * | le,
|  | uint32_t | fn
| ) |  |
| static

References ARRAY_SIZE, lapdm_entity::datalink, lapdm_datalink::dl, lapdm_entity::last_tx_dequeue, msg, n, and tx_dequeue_msgb().

Referenced by lapdm_phsap_dequeue_prim_fn().

## ◆ tx_dequeue_dcch_msgb()

static struct msgb * tx_dequeue_dcch_msgb | ( | struct lapdm_entity * | le,
|  | uint32_t | fn
| ) |  |
| static

References lapdm_entity::datalink, DL_SAPI0, DL_SAPI3, msg, and tx_dequeue_msgb().

Referenced by lapdm_phsap_dequeue_prim_fn().

## ◆ tx_dequeue_msgb()

static struct msgb * tx_dequeue_msgb | ( | struct lapdm_datalink * | dl,
|  | uint32_t | fn
| ) |  |
| static

References ADD_MODULO, lapd_msg_ctx::dl, lapdm_datalink::entity, lapdm_entity::flags, GSM_MAX_FN, lapd_ph_rts_ind(), LAPDM_ENT_F_RTS, LOGDL, LOGL_INFO, msg, msgb_dequeue(), and lapd_datalink::tx_queue.

Referenced by tx_dequeue_acch_msgb(), and tx_dequeue_dcch_msgb().

## ◆ tx_ph_data_enqueue()

static int tx_ph_data_enqueue | ( | struct lapdm_datalink * | dl,
|  | struct msgb * | msg,
|  | uint8_t | chan_nr,
|  | uint8_t | link_id,
|  | uint8_t | pad
| ) |  |
| static

References ph_data_param::chan_nr, chan_nr, osmo_phsap_prim::data, lapdm_datalink::dl, lapdm_datalink::entity, lapdm_entity::flags, lapdm_entity::l1_ctx, lapdm_entity::l1_prim_cb, LAPDM_ENT_F_POLLING_ONLY, LAPDM_ENT_F_RTS, lapdm_pad_msgb(), ph_data_param::link_id, link_id, msg, msgb_dequeue(), msgb_enqueue(), msgb_free(), msgb_push(), osmo_phsap_prim::oph, osmo_prim_init(), PRIM_OP_REQUEST, PRIM_PH_DATA, SAP_GSM_PH, tall_lapd_ctx, lapdm_entity::tx_pending, lapd_datalink::tx_queue, osmo_phsap_prim::u, lapd_datalink::v_ack, and lapd_datalink::v_send.

Referenced by lapdm_send_ph_data_req().

## ◆ tx_ph_data_enqueue_ui()

static int tx_ph_data_enqueue_ui | ( | struct lapdm_datalink * | dl,
|  | struct msgb * | msg,
|  | uint8_t | chan_nr,
|  | uint8_t | link_id,
|  | uint8_t | pad
| ) |  |
| static

References ph_data_param::chan_nr, chan_nr, osmo_phsap_prim::data, lapdm_datalink::entity, lapdm_entity::flags, lapdm_entity::l1_ctx, lapdm_entity::l1_prim_cb, LAPDM_ENT_F_POLLING_ONLY, lapdm_pad_msgb(), ph_data_param::link_id, link_id, msg, msgb_enqueue(), msgb_push(), osmo_phsap_prim::oph, osmo_prim_init(), PRIM_OP_REQUEST, PRIM_PH_DATA, SAP_GSM_PH, tall_lapd_ctx, lapdm_entity::tx_pending, lapdm_datalink::tx_ui_queue, and osmo_phsap_prim::u.

Referenced by rslms_rx_rll_udata_req().

## ◆ update_pending_frames()

static int update_pending_frames | ( | struct lapd_msg_ctx * | lctx | ) |
| static

References lapd_msg_ctx::dl, LAPDm_CTRL_I, LAPDm_CTRL_I_Ns, LAPDm_CTRL_is_I, LAPDm_CTRL_is_S, LAPDm_CTRL_PF_BIT, LAPDm_CTRL_S, LAPDm_CTRL_S_BITS, lapd_datalink::lctx, msgb::list, llist_for_each_entry, msg, lapd_datalink::tx_queue, and lapd_datalink::v_recv.

Referenced by lapdm_dl_init().

## Variable Documentation

## ◆ lapdm_state_names

const char* lapdm_state_names[]
| extern

## ◆ osmo_ph_prim_names

const struct value_string osmo_ph_prim_names[]

Initial value:
= {
{ PRIM_PH_DATA, "PH-DATA" },
{ PRIM_PH_RACH, "PH-RANDOM_ACCESS" },
{ PRIM_PH_CONN, "PH-CONNECT" },
{ PRIM_PH_EMPTY_FRAME, "PH-EMPTY_FRAME" },
{ PRIM_PH_RTS, "PH-RTS" },
{ PRIM_MPH_INFO, "MPH-INFO" },
{ PRIM_TCH, "TCH" },
{ PRIM_TCH_RTS, "TCH-RTS" },
{ 0, NULL }
}
PRIM_PH_CONN
@ PRIM_PH_CONN
PH-CONNECT.
Definition: l1sap.h:11
PRIM_PH_RTS
@ PRIM_PH_RTS
PH-RTS.
Definition: l1sap.h:13
PRIM_PH_DATA
@ PRIM_PH_DATA
PH-DATA.
Definition: l1sap.h:9
PRIM_PH_RACH
@ PRIM_PH_RACH
PH-RANDOM_ACCESS.
Definition: l1sap.h:10
PRIM_TCH_RTS
@ PRIM_TCH_RTS
TCH.
Definition: l1sap.h:16
PRIM_PH_EMPTY_FRAME
@ PRIM_PH_EMPTY_FRAME
PH-EMPTY_FRAME.
Definition: l1sap.h:12
PRIM_MPH_INFO
@ PRIM_MPH_INFO
MPH-INFO.
Definition: l1sap.h:14
PRIM_TCH
@ PRIM_TCH
TCH.
Definition: l1sap.h:15

## ◆ tall_lapd_ctx

void* tall_lapd_ctx
| extern

Referenced by lapdm_channel_init3(), tx_ph_data_enqueue(), and tx_ph_data_enqueue_ui().