libosmoisdn
1.9.0
Osmocom ISDN library
|
Go to the source code of this file.
ITU-T I.460 sub-channel multiplexer + demultiplexer
◆ OSMO_I460_NUM_SUBCHAN
#define OSMO_I460_NUM_SUBCHAN 8 |
◆ in_cb_queue_empty_t
typedef void(* in_cb_queue_empty_t) (struct osmo_i460_subchan *schan, void *user_data) |
◆ out_cb_bits_t
typedef void(* out_cb_bits_t) (struct osmo_i460_subchan *schan, void *user_data, const ubit_t *bits, unsigned int num_bits) |
◆ out_cb_bytes_t
typedef void(* out_cb_bytes_t) (struct osmo_i460_subchan *schan, void *user_data, const uint8_t *bytes, unsigned int num_bytes) |
◆ osmo_i460_rate
Enumerator |
---|
OSMO_I460_RATE_NONE | |
OSMO_I460_RATE_64k | |
OSMO_I460_RATE_32k | |
OSMO_I460_RATE_16k | |
OSMO_I460_RATE_8k | |
◆ osmo_i460_demux_in()
void osmo_i460_demux_in |
( |
struct osmo_i460_timeslot * |
ts, |
|
|
const uint8_t * |
data, |
|
|
size_t |
data_len |
|
) |
| |
Feed multiplexed data (from an E1 timeslot) into de-multiplexer.
- Parameters
-
[in] | ts | timeslot state. |
[in] | data | input data bytes as received from E1/T1. |
[in] | data_len | length of data in bytes. |
References ARRAY_SIZE, data, osmo_i460_subchan::demux, demux_subchan_extract_bits(), osmo_i460_has_single_64k_schan(), OSMO_I460_RATE_NONE, osmo_pbit2ubit(), osmo_i460_subchan_demux::out_cb_bits, osmo_i460_subchan_demux::out_cb_bytes, osmo_i460_subchan::rate, ts, and osmo_i460_subchan_demux::user_data.
◆ osmo_i460_mux_enqueue()
◆ osmo_i460_mux_out()
Get multiplexed data from de-multiplexer (for feeding it into an E1 timeslot).
- Parameters
-
[in] | ts | timeslot state. |
[out] | out | caller-provided buffer where to store generated output bytes. |
[in] | out_len | number of bytes to be stored at out. |
References mux_timeslot_provide_bits(), and osmo_i460_subchan::ts.
◆ osmo_i460_subchan_add()
add a new sub-channel to the given timeslot
- Parameters
-
[in] | ctx | talloc context from where to allocate the internal buffer |
[in] | ts | timeslot to which to add a sub-channel |
[in] | chd | description of the sub-channel to be added |
- Returns
- pointer to sub-channel on success, NULL on error
References alloc_bitbuf(), osmo_i460_subchan::bit_offset, osmo_i460_schan_desc::bit_offset, osmo_i460_subchan::demux, osmo_i460_schan_desc::demux, find_unused_subchan_idx(), osmo_i460_subchan_mux::in_cb_queue_empty, osmo_i460_schan_desc::in_cb_queue_empty, osmo_i460_subchan::mux, osmo_i460_schan_desc::mux, osmo_i460_schan_desc::num_bits, osmo_i460_subchan_demux::out_cb_bits, osmo_i460_schan_desc::out_cb_bits, osmo_i460_subchan_demux::out_cb_bytes, osmo_i460_schan_desc::out_cb_bytes, osmo_i460_subchan::rate, osmo_i460_schan_desc::rate, osmo_i460_timeslot::schan, subchan_reset(), osmo_i460_subchan::ts, osmo_i460_subchan_demux::user_data, osmo_i460_subchan_mux::user_data, and osmo_i460_schan_desc::user_data.
◆ osmo_i460_subchan_count()
◆ osmo_i460_subchan_del()
◆ osmo_i460_ts_init()
static const struct l2downstate l2downstatelist[]
@ PRIM_DL_REL
DL-RLEEASE.
Definition: lapd_core.h:25
@ PRIM_DL_EST
DL-ESTABLISH.
Definition: lapd_core.h:24
@ OSMO_V110_SYNC_RA1_28800
Definition: v110.h:37
@ LAPD_STATE_TIMER_RECOV
Definition: lapd_core.h:84
static int lapd_rx_s(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1295
out_cb_bits_t out_cb_bits
callback to be called once we have received out_bitbuf_size bits
Definition: i460_mux.h:51
uint8_t resp
Definition: lapd_core.h:117
#define MDL_CAUSE_UFRM_INC_PARAM
Definition: lapd_core.h:40
int osmo_v110_sync_ra1_get_intermediate_rate(enum osmo_v100_sync_ra1_rate rate)
obtain the intermediate rate (in bits/s) for specified RA1 rate
Definition: v110.c:547
@ OSMO_V110_SYNC_RA1_19200
Definition: v110.h:35
a 'decoded' representation of a single V.110 frame.
Definition: v110.h:12
int send_out
how much was sent from send_buffer
Definition: lapd_core.h:158
void * tall_lapd_ctx
Definition: lapd_core.c:254
static struct msgb * msgb_alloc_headroom(uint16_t size, uint16_t headroom, const char *name)
#define LAPD_U_UI
Definition: lapd_core.c:89
Definition: i460_mux.h:73
int osmo_i460_mux_out(struct osmo_i460_timeslot *ts, uint8_t *out, size_t out_len)
Get multiplexed data from de-multiplexer (for feeding it into an E1 timeslot).
Definition: i460_mux.c:269
static void msg_to_tx_hist0(struct lapd_datalink *dl, const struct msgb *msg)
Definition: lapd_core.c:1750
int use_sabme
use SABME instead of SABM
Definition: lapd_core.h:136
int osmo_ubit2pbit(pbit_t *out, const ubit_t *in, unsigned int num_bits)
@ LAPD_MODE_NETWORK
behave like network
Definition: lapd_core.h:71
int length
Definition: lapd_core.h:111
int more
Definition: lapd_core.h:122
@ PRIM_DL_SUSP
DL-SUSPEND.
Definition: lapd_core.h:26
int osmo_v110_sync_ra1_user_to_ir(enum osmo_v100_sync_ra1_rate rate, struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len)
perform V.110 RA1 function in user rate -> intermediate rate direction.
Definition: v110.c:561
#define LAPD_HEADROOM
Definition: lapd_core.c:103
const char * get_value_string(const struct value_string *vs, uint32_t val)
static int alloc_bitbuf(void *ctx, struct osmo_i460_subchan *schan, size_t num_bits)
Definition: i460_mux.c:288
int osmo_pbit2ubit(ubit_t *out, const pbit_t *in, unsigned int num_bits)
static size_t len(const char *str)
description of a sub-channel; passed by caller
Definition: i460_mux.h:78
#define MDL_CAUSE_UNSOL_DM_RESP
Definition: lapd_core.h:36
Definition: lapd_core.c:2141
static int lapd_res_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2002
uint8_t n_send
Definition: lapd_core.h:107
enum lapd_mode mode
current mode of link
Definition: lapd_core.h:135
static int lapd_rx_u_frmr(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1253
static void subchan_reset(struct osmo_i460_subchan *schan, bool first_time)
Definition: i460_mux.c:315
@ LAPD_STATE_IDLE
Definition: lapd_core.h:80
struct lapd_cr_ent rem2loc
Definition: lapd_core.h:133
void * user_data
Definition: i460_mux.h:62
static unsigned char * msgb_put(struct msgb *msgb, unsigned int len)
static void osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap, unsigned int primitive, enum osmo_prim_operation operation, struct msgb *msg)
static int lapd_data_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1811
int n200
Definition: lapd_core.h:138
uint8_t sapi
Definition: lapd_core.h:101
#define MDL_CAUSE_IFRM_INC_MBITS
Definition: lapd_core.h:42
@ OSMO_V110_SYNC_RA1_7200
Definition: v110.h:31
struct osmo_timer_list t200
T200 timer.
Definition: lapd_core.h:152
int lapd_recv_dlsap(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2200
#define MDL_CAUSE_SABM_MF
Definition: lapd_core.h:45
void osmo_i460_mux_enqueue(struct osmo_i460_subchan *schan, struct msgb *msg)
enqueue a to-be-transmitted message buffer containing unpacked bits
Definition: i460_mux.c:163
static void lapd_t203_cb(void *data)
Definition: lapd_core.c:712
#define SBIT(a)
Definition: lapd_core.c:106
@ OSMO_V110_SYNC_RA1_1200
Definition: v110.h:28
int seq_err_cond
condition of sequence error
Definition: lapd_core.h:147
static void msg_to_tx_hist(struct lapd_history *tx_hist, const struct msgb *msg, int length, int more)
Definition: lapd_core.c:1741
void lapd_dl_exit(struct lapd_datalink *dl)
Definition: lapd_core.c:358
@ LAPD_MODE_USER
behave like user
Definition: lapd_core.h:70
uint8_t format
Definition: lapd_core.h:105
uint8_t s_u
Definition: lapd_core.h:109
static int lapd_rx_u_disc(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1082
struct llist_head tx_queue
frames to L1
Definition: lapd_core.h:155
@ OSMO_V110_SYNC_RA1_14400
Definition: v110.h:34
struct lapd_cr_ent loc2rem
filled-in once we set the lapd_mode above
Definition: lapd_core.h:132
@ LAPD_STATE_ASS_TEI_WAIT
Definition: lapd_core.h:78
static uint8_t msgb_pull_u8(struct msgb *msgb)
@ PRIM_DL_UNIT_DATA
DL-UNIT-DATA.
Definition: lapd_core.h:22
static int v110_adapt_600_to_IR8000(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len)
Adapt from 6 synchronous 600bit/s input bits to a decoded V.110 frame.
Definition: v110.c:151
int lapd_set_mode(struct lapd_datalink *dl, enum lapd_mode mode)
Set the lapdm_mode of a LAPDm entity.
Definition: lapd_core.c:374
uint8_t bit_offset
Definition: i460_mux.h:68
unsigned int intermediate_rate
Definition: v110.c:431
static void lapd_dl_newstate(struct lapd_datalink *dl, uint32_t state)
Definition: lapd_core.c:233
static int lapd_send_rnr(struct lapd_msg_ctx *lctx, uint8_t f_bit, uint8_t cmd)
Definition: lapd_core.c:497
struct osmo_prim_hdr oph
generic primitive header
Definition: lapd_core.h:61
static void demux_subchan_append_bit(struct osmo_i460_subchan *schan, uint8_t bit)
Definition: i460_mux.c:58
void lapd_dl_reset(struct lapd_datalink *dl)
Definition: lapd_core.c:337
static void osmo_talloc_replace_string(void *ctx, char **dst, const char *newstr)
uint8_t * out_bitbuf
bit-buffer for output bits
Definition: i460_mux.h:45
#define LAPD_S_RR
Definition: lapd_core.c:94
#define LAPD_U_DM
Definition: lapd_core.c:88
struct msgb * lapd_msgb_alloc(int length, const char *name)
Definition: lapd_core.c:116
struct osmo_i460_schan_desc::@1 mux
#define MDL_CAUSE_FRM_UNIMPL
Definition: lapd_core.h:44
#define MDL_CAUSE_T200_EXPIRED
Definition: lapd_core.h:33
static int v110_adapt_IR_to_Nx4800(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr)
Definition: v110.c:343
int maxf
maximum frame size (after defragmentation)
Definition: lapd_core.h:140
#define INIT_LLIST_HEAD(ptr)
struct osmo_i460_schan_desc::@0 demux
static int v110_adapt_IR_to_Nx3600(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr)
Definition: v110.c:293
static bool osmo_i460_has_single_64k_schan(struct osmo_i460_timeslot *ts)
Definition: i460_mux.c:42
static int v110_adapt_Nx3600_to_IR(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len)
Adapt from 36 synchronous N x 3600bit/s input bits to a decoded V.110 frame.
Definition: v110.c:262
Definition: i460_mux.h:43
static int v110_adapt_IR8000_to_600(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr)
Definition: v110.c:166
out_cb_bytes_t out_cb_bytes
out_cb_bytes call-back function called whenever we received num_bits.
Definition: i460_mux.h:92
struct osmo_timer_list t203
T203 timer.
Definition: lapd_core.h:153
unsigned int out_bitbuf_size
size of out_bitbuf in bytes
Definition: i460_mux.h:47
static uint8_t sub_mod(uint8_t x, uint8_t y, uint8_t m)
Definition: lapd_core.c:139
size_t num_bits
Definition: i460_mux.h:83
@ OSMO_I460_RATE_32k
Definition: i460_mux.h:31
const char * name
Definition: lapd_core.c:2144
int(* send_dlsap)(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.h:127
@ OSMO_V110_SYNC_RA1_24000
Definition: v110.h:36
struct osmo_i460_subchan schan[OSMO_I460_NUM_SUBCHAN]
Definition: i460_mux.h:74
uint16_t msgb_length(const struct msgb *msg)
static void llist_del(struct llist_head *entry)
#define LOGDL(dl, level, fmt, args...)
Definition: lapd_core.h:17
primitive header for LAPD DL-SAP primitives
Definition: lapd_core.h:60
struct dl_rel_req_param rel_req
Definition: lapd_core.h:64
static int lapd_send_resend(struct lapd_datalink *dl)
Definition: lapd_core.c:541
struct osmo_i460_subchan_mux mux
Definition: i460_mux.h:70
@ OSMO_V110_SYNC_RA1_2400
Definition: v110.h:29
enum osmo_prim_operation operation
uint8_t range_hist
range of history buffer 2..2^n
Definition: lapd_core.h:160
static int v110_adapt_IR_to_Nx12000(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr)
Definition: v110.c:395
uint8_t own_busy
receiver busy on our side
Definition: lapd_core.h:148
uint32_t state
LAPD state (lapd_state)
Definition: lapd_core.h:146
@ _NUM_OSMO_V110_SYNC_RA1
Definition: v110.h:39
struct msgb * cont_res
buffer to store content resolution data on network side, to detect multiple phones on same channel
Definition: lapd_core.h:162
@ OSMO_I460_RATE_NONE
Definition: i460_mux.h:29
#define MDL_CAUSE_SFRM_INC_PARAM
Definition: lapd_core.h:41
static unsigned int msgb_l3len(const struct msgb *msgb)
int t203_usec
retry timer (default 10 secs)
Definition: lapd_core.h:151
LAPD datalink.
Definition: lapd_core.h:126
static int v110_adapt_Nx12000_to_IR(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len)
Adapt from 30 synchronous N x 12000bit/s input bits to a decoded V.110 frame.
Definition: v110.c:361
uint8_t mode
release mode
Definition: lapd_core.h:56
uint8_t cmd
Definition: lapd_core.h:116
#define LAPD_U_SABM
Definition: lapd_core.c:86
int lapd_ph_data_ind(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1696
void lapd_dl_init2(struct lapd_datalink *dl, uint8_t k, uint8_t v_range, int maxf, const char *name)
Initialize LAPD datalink instance and allocate history.
Definition: lapd_core.c:262
@ LAPD_STATE_TEI_UNASS
Definition: lapd_core.h:77
@ OSMO_V110_SYNC_RA1_12000
Definition: v110.h:33
@ LAPD_STATE_NULL
Definition: lapd_core.h:76
void msgb_free(struct msgb *m)
@ PRIM_MDL_ERROR
MDL-ERROR.
Definition: lapd_core.h:29
in_cb_queue_empty_t in_cb_queue_empty
Definition: i460_mux.h:61
#define LAPD_S_REJ
Definition: lapd_core.c:96
int osmo_v110_sync_ra1_get_user_data_rate(enum osmo_v100_sync_ra1_rate rate)
obtain the user data rate (in bits/s) for specified RA1 rate
Definition: v110.c:538
#define LAPD_U_DISC
Definition: lapd_core.c:90
uint8_t peer_busy
receiver busy on remote side
Definition: lapd_core.h:149
#define CR_USER2NET_RESP
Definition: lapd_core.c:99
static int lapd_est_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1756
#define LAPD_U_FRMR
Definition: lapd_core.c:92
uint8_t p_f
Definition: lapd_core.h:106
#define MDL_CAUSE_UNSOL_DM_RESP_MF
Definition: lapd_core.h:37
struct osmo_i460_subchan * osmo_i460_subchan_add(void *ctx, struct osmo_i460_timeslot *ts, const struct osmo_i460_schan_desc *chd)
add a new sub-channel to the given timeslot
Definition: i460_mux.c:352
int n200_est_rel
number of retranmissions
Definition: lapd_core.h:138
void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int microseconds)
Definition: lapd_core.h:120
static int lapd_rx_u_sabm(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:814
#define LAPD_S_RNR
Definition: lapd_core.c:95
int(* send_ph_data_req)(struct lapd_msg_ctx *lctx, struct msgb *msg)
Definition: lapd_core.h:128
static int lapd_rx_u_dm(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:961
void osmo_v110_ubit_dump(FILE *outf, const ubit_t *fr, size_t in_len)
Print a encoded V.110 frame in the same table-like structure as the spec.
Definition: v110.c:127
#define MDL_CAUSE_UNSOL_SPRV_RESP
Definition: lapd_core.h:38
static uint8_t mux_subchan_provide_bits(struct osmo_i460_subchan *schan, uint8_t *mask)
provide one byte with the subchan-specific bits of given sub-channel.
Definition: i460_mux.c:202
static uint8_t mux_timeslot_provide_bits(struct osmo_i460_timeslot *ts)
Definition: i460_mux.c:246
int n201
Definition: lapd_core.h:98
out_cb_bytes_t out_cb_bytes
Definition: i460_mux.h:52
static int lapd_send_dm(struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:454
int t203_sec
Definition: lapd_core.h:151
#define CR_NET2USER_CMD
Definition: lapd_core.c:100
void lapd_dl_set_name(struct lapd_datalink *dl, const char *name)
Definition: lapd_core.c:329
@ LAPD_STATE_EST_TEI_WAIT
Definition: lapd_core.h:79
struct osmo_i460_subchan_demux demux
Definition: i460_mux.h:69
void osmo_i460_ts_init(struct osmo_i460_timeslot *ts)
initialize an I.460 timeslot
Definition: i460_mux.c:335
uint8_t k
maximum number of unacknowledged frames
Definition: lapd_core.h:141
@ PRIM_DL_RECON
DL-RECONNECT.
Definition: lapd_core.h:28
#define MDL_CAUSE_IFRM_INC_LEN
Definition: lapd_core.h:43
#define LAPD_U_SABME
Definition: lapd_core.c:87
uint8_t v_recv
seq nr of next I frame expected to be received
Definition: lapd_core.h:145
struct msgb * msg
Definition: lapd_core.h:121
@ LAPD_FORM_U
Definition: lapd_core.h:92
int osmo_v110_sync_ra1_get_user_data_chunk_bitlen(enum osmo_v100_sync_ra1_rate rate)
obtain the size (in number of bits) of the user data bits in one V.110 frame for specified RA1 rate
Definition: v110.c:529
struct lapd_msg_ctx lctx
LAPD context.
Definition: lapd_core.h:139
static int lapd_rx_u(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1269
int osmo_v110_decode_frame(struct osmo_v110_decoded_frame *fr, const ubit_t *ra_bits, size_t n_bits)
Decode a 80-bit V.110 frame present as 80 ubits into a struct osmo_v110_decoded_frame.
Definition: v110.c:45
static int v110_adapt_IR8000_to_2400(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr)
Definition: v110.c:240
static void lapd_start_t200(struct lapd_datalink *dl)
Definition: lapd_core.c:200
struct msgb * send_buffer
current frame transmitting
Definition: lapd_core.h:157
unsigned int user_data_chunk_bits
Definition: v110.c:432
static uint8_t inc_mod(uint8_t x, uint8_t m)
Definition: lapd_core.c:129
int(* adapt_user_to_ir)(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len)
RA1 function in user bitrate -> intermediate rate direction.
Definition: v110.c:434
struct llist_head tx_queue
list of to-be-transmitted message buffers
Definition: i460_mux.h:60
static int msgb_trim(struct msgb *msg, int len)
int(* update_pending_frames)(struct lapd_msg_ctx *lctx)
Definition: lapd_core.h:129
unsigned int out_idx
offset of next bit to be written in out_bitbuf
Definition: i460_mux.h:49
void lapd_dl_init(struct lapd_datalink *dl, uint8_t k, uint8_t v_range, int maxf) OSMO_DEPRECATED("Use lapd_dl_init2() instead")
Initialize LAPD datalink instance and allocate history.
Definition: lapd_core.c:324
out_cb_bits_t out_cb_bits
call-back function called whenever we received num_bits
Definition: i460_mux.h:85
static int lapd_reestablish(struct lapd_datalink *dl)
Definition: lapd_core.c:573
@ OSMO_V110_SYNC_RA1_9600
Definition: v110.h:32
static int mdl_error(uint8_t cause, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:416
static int lapd_rx_u_ui(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1043
void osmo_timer_setup(struct osmo_timer_list *timer, void(*cb)(void *data), void *data)
#define ALL_STATES
Definition: lapd_core.c:107
@ OSMO_I460_RATE_64k
Definition: i460_mux.h:30
#define OSMO_VALUE_STRING(x)
uint8_t cr
Definition: lapd_core.h:100
static void lapd_stop_t203(struct lapd_datalink *dl)
Definition: lapd_core.c:225
int t200_sec
Definition: lapd_core.h:150
uint8_t retrans_ctr
re-transmission counter
Definition: lapd_core.h:154
void * user_data
Definition: i460_mux.h:53
static void lapd_dl_flush_hist(struct lapd_datalink *dl)
Definition: lapd_core.c:157
static int lapd_send_ua(struct lapd_msg_ctx *lctx, uint8_t len, uint8_t *data)
Definition: lapd_core.c:430
@ LAPD_FORM_I
Definition: lapd_core.h:90
static void lapd_dl_flush_tx(struct lapd_datalink *dl)
Definition: lapd_core.c:172
@ PRIM_DL_RES
DL-RESUME.
Definition: lapd_core.h:27
int osmo_i460_subchan_count(struct osmo_i460_timeslot *ts)
count the number of sub-channels in this I.460 slot.
Definition: i460_mux.c:29
uint8_t n_recv
Definition: lapd_core.h:108
static ubit_t mux_schan_provide_bit(struct osmo_i460_subchan *schan)
Definition: i460_mux.c:170
#define CR_USER2NET_CMD
Definition: lapd_core.c:98
static int lapd_send_rr(struct lapd_msg_ctx *lctx, uint8_t f_bit, uint8_t cmd)
Definition: lapd_core.c:475
static void lapd_t200_cb(void *data)
Definition: lapd_core.c:587
ubit_t d_bits[MAX_D_BITS]
Definition: v110.h:13
int op
Definition: lapd_core.c:2143
static void llist_add(struct llist_head *_new, struct llist_head *head)
#define F
Definition: v110.c:144
struct llist_head send_queue
frames from L3
Definition: lapd_core.h:156
#define MDL_CAUSE_FRMR
Definition: lapd_core.h:47
unsigned int data_rate
Definition: v110.c:430
Definition: i460_mux.h:65
@ LAPD_STATE_DISC_SENT
Definition: lapd_core.h:82
lapd_mode
LAPD mode/role.
Definition: lapd_core.h:69
static int lapd_udata_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1721
int(* adapt_ir_to_user)(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr)
RA1 function in intermediate rate -> user bitrate direction.
Definition: v110.c:436
struct lapd_datalink::@3 cr
static const char * lapd_state_name(enum lapd_state state)
Definition: lapd_core.c:195
struct lapd_history * tx_hist
tx history structure array
Definition: lapd_core.h:159
LAPD message context.
Definition: lapd_core.h:96
ubit_t e_bits[MAX_E_BITS]
Definition: v110.h:14
ubit_t s_bits[MAX_S_BITS]
Definition: v110.h:15
ubit_t x_bits[MAX_X_BITS]
Definition: v110.h:16
int t200_usec
retry timer (default 1 sec)
Definition: lapd_core.h:150
union osmo_dlsap_prim::@2 u
request-specific data
static int lapd_rel_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2067
@ OSMO_I460_RATE_16k
Definition: i460_mux.h:32
uint8_t v_send
seq nr of next I frame to be transmitted
Definition: lapd_core.h:143
int osmo_timer_pending(const struct osmo_timer_list *timer)
void osmo_timer_del(struct osmo_timer_list *timer)
int prim
Definition: lapd_core.c:2143
@ LAPD_FORM_S
Definition: lapd_core.h:91
struct lapd_datalink * dl
Definition: lapd_core.h:97
#define llist_entry(ptr, type, member)
static void lapd_acknowledge(struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:742
#define MDL_CAUSE_UNSOL_UA_RESP
Definition: lapd_core.h:35
int reestablish
enable reestablish support
Definition: lapd_core.h:137
void * user_data
Definition: i460_mux.h:94
static int send_dl_simple(uint8_t prim, uint8_t op, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:409
static int send_dl_l3(uint8_t prim, uint8_t op, struct lapd_msg_ctx *lctx, struct msgb *msg)
Definition: lapd_core.c:398
@ OSMO_V110_SYNC_RA1_4800
Definition: v110.h:30
static int lapd_susp_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1975
const struct value_string lapd_state_names[]
Definition: lapd_core.c:182
int osmo_v110_sync_ra1_ir_to_user(enum osmo_v100_sync_ra1_rate rate, ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr)
perform V.110 RA1 function in intermediate rate -> user rate direction.
Definition: v110.c:576
#define MDL_CAUSE_SEQ_ERR
Definition: lapd_core.h:39
int(* rout)(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2145
static void msgb_queue_free(struct llist_head *queue)
static int v110_adapt_IR8000_to_1200(ubit_t *d_out, size_t out_len, const struct osmo_v110_decoded_frame *fr)
Definition: v110.c:202
static int lapd_rel_req_idle(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2128
in_cb_queue_empty_t in_cb_queue_empty
Definition: i460_mux.h:100
#define LAPD_U_UA
Definition: lapd_core.c:91
@ OSMO_V110_SYNC_RA1_38400
Definition: v110.h:38
uint8_t bit_offset
Definition: i460_mux.h:80
struct msgb * rcv_buffer
buffer to assemble the received message
Definition: lapd_core.h:161
static int lapd_send_rej(struct lapd_msg_ctx *lctx, uint8_t f_bit)
Definition: lapd_core.c:519
static uint8_t do_mod(uint8_t x, uint8_t m)
Definition: lapd_core.c:124
static int llist_empty(const struct llist_head *head)
void osmo_i460_subchan_del(struct osmo_i460_subchan *schan)
Definition: i460_mux.c:382
struct osmo_i460_timeslot * ts
Definition: i460_mux.h:66
void osmo_i460_demux_in(struct osmo_i460_timeslot *ts, const uint8_t *data, size_t data_len)
Feed multiplexed data (from an E1 timeslot) into de-multiplexer.
Definition: i460_mux.c:128
Definition: i460_mux.h:58
static int find_unused_subchan_idx(const struct osmo_i460_timeslot *ts)
Definition: i460_mux.c:302
#define CR_NET2USER_RESP
Definition: lapd_core.c:101
char * name
user-provided name
Definition: lapd_core.h:163
@ OSMO_I460_RATE_8k
Definition: i460_mux.h:33
struct msgb * msgb_dequeue(struct llist_head *queue)
#define MDL_CAUSE_SABM_INFO_NOTALL
Definition: lapd_core.h:46
uint8_t more
Definition: lapd_core.h:112
enum osmo_i460_rate rate
Definition: i460_mux.h:67
@ LAPD_STATE_SABM_SENT
Definition: lapd_core.h:81
static int v110_adapt_Nx4800_to_IR(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len)
Adapt from 48 synchronous N x 4800bit/s input bits to a decoded V.110 frame.
Definition: v110.c:328
uint8_t v_range
range of sequence numbers
Definition: lapd_core.h:142
static int lapd_rx_u_ua(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1160
static void lapd_stop_t200(struct lapd_datalink *dl)
Definition: lapd_core.c:217
uint8_t cause
generic cause value
Definition: lapd_core.h:51
@ OSMO_V110_SYNC_RA1_600
Definition: v110.h:27
static void lapd_start_t203(struct lapd_datalink *dl)
Definition: lapd_core.c:209
@ PRIM_DL_DATA
DL-DATA.
Definition: lapd_core.h:23
void msgb_enqueue(struct llist_head *queue, struct msgb *msg)
static int v110_adapt_2400_to_IR8000(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len)
Adapt from 24 synchronous 2400bit/s input bits to a decoded V.110 frame.
Definition: v110.c:223
static const struct osmo_v110_sync_ra1 osmo_v110_sync_ra1_def[_NUM_OSMO_V110_SYNC_RA1]
Definition: v110.c:440
static void lapd_dl_flush_send(struct lapd_datalink *dl)
Definition: lapd_core.c:144
osmo_v100_sync_ra1_rate
enum for each supported V.110 synchronous RA1 function (one for each user bitrate)
Definition: v110.h:26
#define L2DOWNSLLEN
Definition: lapd_core.c:2197
static int lapd_rx_i(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1506
enum osmo_i460_rate rate
Definition: i460_mux.h:79
struct mdl_error_ind_param error_ind
Definition: lapd_core.h:63
uint8_t v_ack
last frame ACKed by peer
Definition: lapd_core.h:144
@ LAPD_STATE_MF_EST
Definition: lapd_core.h:83
lapd_state
LAPD state (Figure B.2/Q.921)
Definition: lapd_core.h:75
uint32_t states
Definition: lapd_core.c:2142
#define LAPD_TAILROOM
Definition: lapd_core.c:104
int osmo_v110_encode_frame(ubit_t *ra_bits, size_t n_bits, const struct osmo_v110_decoded_frame *fr)
Encode a struct osmo_v110_decoded_frame into an 80-bit V.110 frame as ubits.
Definition: v110.c:84
static void demux_subchan_extract_bits(struct osmo_i460_subchan *schan, const uint8_t *data, size_t data_len)
Definition: i460_mux.c:83
static uint8_t add_mod(uint8_t x, uint8_t y, uint8_t m)
Definition: lapd_core.c:134
static int v110_adapt_1200_to_IR8000(struct osmo_v110_decoded_frame *fr, const ubit_t *d_in, size_t in_len)
Adapt from 12 synchronous 1200bit/s input bits to a decoded V.110 frame.
Definition: v110.c:187
static int lapd_send_i(struct lapd_msg_ctx *lctx, int line)
Definition: lapd_core.c:1834