\doxysection{include/osmocom/gsm/lapdm.h File Reference}
\label{lapdm_8h}\index{include/osmocom/gsm/lapdm.h@{include/osmocom/gsm/lapdm.h}}
{\ttfamily \#include $<$osmocom/gsm/l1sap.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/gsm\+\_\+utils.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/gsm/lapd\+\_\+core.\+h$>$}\newline
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ lapdm\+\_\+msg\+\_\+ctx}
\begin{DoxyCompactList}\small\item\em LAPDm message context. \end{DoxyCompactList}\item 
struct \textbf{ lapdm\+\_\+datalink}
\begin{DoxyCompactList}\small\item\em LAPDm datalink like TS 04.\+06 / Section 3.\+5.\+2. \end{DoxyCompactList}\item 
struct \textbf{ lapdm\+\_\+entity}
\begin{DoxyCompactList}\small\item\em a LAPDm Entity \end{DoxyCompactList}\item 
struct \textbf{ lapdm\+\_\+channel}
\begin{DoxyCompactList}\small\item\em the two lapdm\+\_\+entities that form a GSM logical channel (ACCH + DCCH) \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ LAPDM\+\_\+\+ENT\+\_\+\+F\+\_\+\+EMPTY\+\_\+\+FRAME}~0x0001
\item 
\#define \textbf{ LAPDM\+\_\+\+ENT\+\_\+\+F\+\_\+\+POLLING\+\_\+\+ONLY}~0x0002
\item 
\#define \textbf{ LAPDM\+\_\+\+ENT\+\_\+\+F\+\_\+\+DROP\+\_\+2\+ND\+\_\+\+REJ}~0x0004
\item 
\#define \textbf{ LAPDM\+\_\+\+ENT\+\_\+\+F\+\_\+\+RTS}~0x0008
\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef int($\ast$ \textbf{ lapdm\+\_\+cb\+\_\+t}) (struct \textbf{ msgb} $\ast$\textbf{ msg}, struct \textbf{ lapdm\+\_\+entity} $\ast$le, void $\ast$ctx)
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ lapdm\+\_\+mode} \{ \newline
\textbf{ LAPDM\+\_\+\+MODE\+\_\+\+MS}
, \newline
\textbf{ LAPDM\+\_\+\+MODE\+\_\+\+BTS}
 \}
\begin{DoxyCompactList}\small\item\em LAPDm mode/role. \end{DoxyCompactList}\item 
enum \textbf{ lapdm\+\_\+dl\+\_\+sapi} \{ \newline
\textbf{ DL\+\_\+\+SAPI0} = 0
, \newline
\textbf{ DL\+\_\+\+SAPI3} = 1
, \newline
\textbf{ \+\_\+\+NR\+\_\+\+DL\+\_\+\+SAPI}
 \}
\begin{DoxyCompactList}\small\item\em LAPDm datalink SAPIs. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
const char $\ast$ \textbf{ get\+\_\+rsl\+\_\+name} (int value)
\item 
struct \textbf{ lapdm\+\_\+datalink} $\ast$ \textbf{ lapdm\+\_\+datalink\+\_\+for\+\_\+sapi} (struct \textbf{ lapdm\+\_\+entity} $\ast$le, uint8\+\_\+t sapi)
\item 
void \textbf{ lapdm\+\_\+entity\+\_\+init} (struct \textbf{ lapdm\+\_\+entity} $\ast$le, enum \textbf{ lapdm\+\_\+mode} \textbf{ mode}, int t200)
\begin{DoxyCompactList}\small\item\em initialize a LAPDm entity and all datalinks inside \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+entity\+\_\+init2} (struct \textbf{ lapdm\+\_\+entity} $\ast$le, enum \textbf{ lapdm\+\_\+mode} \textbf{ mode}, const int $\ast$t200\+\_\+ms, int n200)
\begin{DoxyCompactList}\small\item\em initialize a LAPDm entity and all datalinks inside \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+entity\+\_\+init3} (struct \textbf{ lapdm\+\_\+entity} $\ast$le, enum \textbf{ lapdm\+\_\+mode} \textbf{ mode}, const int $\ast$t200\+\_\+ms, int n200, const char $\ast$name\+\_\+pfx)
\begin{DoxyCompactList}\small\item\em initialize a LAPDm entity and all datalinks inside \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+channel\+\_\+init} (struct \textbf{ lapdm\+\_\+channel} $\ast$lc, enum \textbf{ lapdm\+\_\+mode} \textbf{ mode})
\begin{DoxyCompactList}\small\item\em initialize a LAPDm channel and all its channels \end{DoxyCompactList}\item 
int \textbf{ lapdm\+\_\+channel\+\_\+init2} (struct \textbf{ lapdm\+\_\+channel} $\ast$lc, enum \textbf{ lapdm\+\_\+mode} \textbf{ mode}, const int $\ast$t200\+\_\+ms\+\_\+dcch, const int $\ast$t200\+\_\+ms\+\_\+acch, enum \textbf{ gsm\+\_\+chan\+\_\+t} chan\+\_\+t)
\begin{DoxyCompactList}\small\item\em initialize a LAPDm channel and all its channels \end{DoxyCompactList}\item 
int \textbf{ lapdm\+\_\+channel\+\_\+init3} (struct \textbf{ lapdm\+\_\+channel} $\ast$lc, enum \textbf{ lapdm\+\_\+mode} \textbf{ mode}, const int $\ast$t200\+\_\+ms\+\_\+dcch, const int $\ast$t200\+\_\+ms\+\_\+acch, enum \textbf{ gsm\+\_\+chan\+\_\+t} chan\+\_\+t, const char $\ast$name\+\_\+pfx)
\begin{DoxyCompactList}\small\item\em initialize a LAPDm channel and all its channels \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+entity\+\_\+exit} (struct \textbf{ lapdm\+\_\+entity} $\ast$le)
\begin{DoxyCompactList}\small\item\em flush and release all resoures in LAPDm entity \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+channel\+\_\+exit} (struct \textbf{ lapdm\+\_\+channel} $\ast$lc)
\item 
int \textbf{ lapdm\+\_\+phsap\+\_\+up} (struct \textbf{ osmo\+\_\+prim\+\_\+hdr} $\ast$oph, struct \textbf{ lapdm\+\_\+entity} $\ast$le)
\begin{DoxyCompactList}\small\item\em Receive a PH-\/\+SAP primitive from L1. \end{DoxyCompactList}\item 
int \textbf{ lapdm\+\_\+rslms\+\_\+recvmsg} (struct \textbf{ msgb} $\ast$\textbf{ msg}, struct \textbf{ lapdm\+\_\+channel} $\ast$lc)
\begin{DoxyCompactList}\small\item\em Receive a RSLms \textbf{ Message buffers} from Layer 3. \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+channel\+\_\+set\+\_\+l3} (struct \textbf{ lapdm\+\_\+channel} $\ast$lc, \textbf{ lapdm\+\_\+cb\+\_\+t} cb, void $\ast$ctx)
\begin{DoxyCompactList}\small\item\em Set the L3 callback and context of a LAPDm channel. \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+channel\+\_\+set\+\_\+l1} (struct \textbf{ lapdm\+\_\+channel} $\ast$lc, \textbf{ osmo\+\_\+prim\+\_\+cb} cb, void $\ast$ctx)
\begin{DoxyCompactList}\small\item\em Set the L1 callback and context of a LAPDm channel. \end{DoxyCompactList}\item 
int \textbf{ lapdm\+\_\+entity\+\_\+set\+\_\+mode} (struct \textbf{ lapdm\+\_\+entity} $\ast$le, enum \textbf{ lapdm\+\_\+mode} \textbf{ mode})
\begin{DoxyCompactList}\small\item\em Set the \doxyref{lapdm\+\_\+mode}{p.}{group__lapdm_gae1114a473c0f1b35d2fddae1bf35ff81} of a LAPDm entity. \end{DoxyCompactList}\item 
int \textbf{ lapdm\+\_\+channel\+\_\+set\+\_\+mode} (struct \textbf{ lapdm\+\_\+channel} $\ast$lc, enum \textbf{ lapdm\+\_\+mode} \textbf{ mode})
\begin{DoxyCompactList}\small\item\em Set the \doxyref{lapdm\+\_\+mode}{p.}{group__lapdm_gae1114a473c0f1b35d2fddae1bf35ff81} of a LAPDm channel. \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+entity\+\_\+reset} (struct \textbf{ lapdm\+\_\+entity} $\ast$le)
\begin{DoxyCompactList}\small\item\em Reset an entire LAPDm entity and all its datalinks. \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+channel\+\_\+reset} (struct \textbf{ lapdm\+\_\+channel} $\ast$lc)
\begin{DoxyCompactList}\small\item\em Reset a LAPDm channel with all its entities. \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+entity\+\_\+set\+\_\+flags} (struct \textbf{ lapdm\+\_\+entity} $\ast$le, unsigned int \textbf{ flags})
\begin{DoxyCompactList}\small\item\em Set the flags of a LAPDm entity. \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+channel\+\_\+set\+\_\+flags} (struct \textbf{ lapdm\+\_\+channel} $\ast$lc, unsigned int \textbf{ flags})
\begin{DoxyCompactList}\small\item\em Set the flags of all LAPDm entities in a LAPDm channel. \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+entity\+\_\+set\+\_\+t200\+\_\+fn} (struct \textbf{ lapdm\+\_\+entity} $\ast$le, const uint32\+\_\+t $\ast$t200\+\_\+fn)
\begin{DoxyCompactList}\small\item\em Set the T200 FN timer of a LAPDm entity. \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+channel\+\_\+set\+\_\+t200\+\_\+fn} (struct \textbf{ lapdm\+\_\+channel} $\ast$lc, const uint32\+\_\+t $\ast$t200\+\_\+fn\+\_\+dcch, const uint32\+\_\+t $\ast$t200\+\_\+fn\+\_\+acch)
\begin{DoxyCompactList}\small\item\em Set the T200 FN timer of all LAPDm entities in a LAPDm channel. \end{DoxyCompactList}\item 
int \textbf{ lapdm\+\_\+phsap\+\_\+dequeue\+\_\+prim} (struct \textbf{ lapdm\+\_\+entity} $\ast$le, struct \textbf{ osmo\+\_\+phsap\+\_\+prim} $\ast$pp)
\begin{DoxyCompactList}\small\item\em dequeue a msg that\textquotesingle{}s pending transmission via L1 and wrap it into a \doxyref{osmo\+\_\+phsap\+\_\+prim}{p.}{structosmo__phsap__prim} \end{DoxyCompactList}\item 
int \textbf{ lapdm\+\_\+phsap\+\_\+dequeue\+\_\+prim\+\_\+fn} (struct \textbf{ lapdm\+\_\+entity} $\ast$le, struct \textbf{ osmo\+\_\+phsap\+\_\+prim} $\ast$pp, uint32\+\_\+t fn)
\begin{DoxyCompactList}\small\item\em dequeue a msg that\textquotesingle{}s pending transmission via L1 and wrap it into a \doxyref{osmo\+\_\+phsap\+\_\+prim}{p.}{structosmo__phsap__prim} \end{DoxyCompactList}\item 
void \textbf{ lapdm\+\_\+t200\+\_\+fn} (struct \textbf{ lapdm\+\_\+entity} $\ast$le, uint32\+\_\+t fn)
\begin{DoxyCompactList}\small\item\em Get receive frame number from L1. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const char $\ast$ \textbf{ lapdm\+\_\+state\+\_\+names} [$\,$]
\end{DoxyCompactItemize}
