1 #ifndef _OSMOCOM_LAPDM_H
2 #define _OSMOCOM_LAPDM_H
6 #include <osmocore/timer.h>
7 #include <osmocore/msgb.h>
9 #include <l1a_l23_interface.h>
14 LAPDm_STATE_SABM_SENT,
16 LAPDm_STATE_TIMER_RECOV,
17 LAPDm_STATE_OWN_RCVR_BUSY,
23 /* TS 04.06 / Section 3.5.2 */
24 struct lapdm_datalink {
25 uint8_t V_send; /* seq nr of next I frame to be transmitted */
26 uint8_t V_ack; /* last frame ACKed by peer */
27 uint8_t N_send; /* ? set to V_send at Tx time*/
28 uint8_t V_recv; /* seq nr of next I frame expected to be received */
29 uint8_t N_recv; /* expected send seq nr of the next received I frame */
30 enum lapdm_state state;
31 struct timer_list t200;
34 struct lapdm_entity *entity;
44 struct lapdm_datalink datalink[_NR_DL_SAPI];
45 struct osmocom_ms *ms;
48 /* initialize a LAPDm entity */
49 void lapdm_init(struct lapdm_entity *le, struct osmocom_ms *ms);
51 /* input into layer2 (from layer 1) */
52 int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, struct l1ctl_info_dl *l1i);
54 /* input into layer2 (from layer 3) */
55 int rslms_recvmsg(struct msgb *msg, struct osmocom_ms *ms);
57 /* sending messages up from L2 to L3 */
58 int rslms_sendmsg(struct msgb *msg, struct osmocom_ms *ms);
60 #endif /* _OSMOCOM_LAPDM_H */