libosmoisdn  1.9.0
Osmocom ISDN library
i460_mux.h File Reference
#include <stdint.h>
#include <osmocom/core/bits.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/msgb.h>

Go to the source code of this file.

Data Structures

struct  osmo_i460_subchan_demux
 
struct  osmo_i460_subchan_mux
 
struct  osmo_i460_subchan
 
struct  osmo_i460_timeslot
 
struct  osmo_i460_schan_desc
 description of a sub-channel; passed by caller More...
 

Macros

#define OSMO_I460_NUM_SUBCHAN   8
 

Typedefs

typedef void(* out_cb_bits_t) (struct osmo_i460_subchan *schan, void *user_data, const ubit_t *bits, unsigned int num_bits)
 
typedef void(* out_cb_bytes_t) (struct osmo_i460_subchan *schan, void *user_data, const uint8_t *bytes, unsigned int num_bytes)
 
typedef void(* in_cb_queue_empty_t) (struct osmo_i460_subchan *schan, void *user_data)
 

Enumerations

enum  osmo_i460_rate {
  OSMO_I460_RATE_NONE,
  OSMO_I460_RATE_64k,
  OSMO_I460_RATE_32k,
  OSMO_I460_RATE_16k,
  OSMO_I460_RATE_8k
}
 

Functions

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. More...
 
void osmo_i460_mux_enqueue (struct osmo_i460_subchan *schan, struct msgb *msg)
 enqueue a to-be-transmitted message buffer containing unpacked bits More...
 
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). More...
 
void osmo_i460_ts_init (struct osmo_i460_timeslot *ts)
 initialize an I.460 timeslot More...
 
struct osmo_i460_subchanosmo_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 More...
 
void osmo_i460_subchan_del (struct osmo_i460_subchan *schan)
 
int osmo_i460_subchan_count (struct osmo_i460_timeslot *ts)
 count the number of sub-channels in this I.460 slot. More...
 

Detailed Description

ITU-T I.460 sub-channel multiplexer + demultiplexer

Macro Definition Documentation

◆ OSMO_I460_NUM_SUBCHAN

#define OSMO_I460_NUM_SUBCHAN   8

Typedef Documentation

◆ 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)

Enumeration Type Documentation

◆ osmo_i460_rate

Enumerator
OSMO_I460_RATE_NONE 
OSMO_I460_RATE_64k 
OSMO_I460_RATE_32k 
OSMO_I460_RATE_16k 
OSMO_I460_RATE_8k 

Function Documentation

◆ 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]tstimeslot state.
[in]datainput data bytes as received from E1/T1.
[in]data_lenlength 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()

void osmo_i460_mux_enqueue ( struct osmo_i460_subchan schan,
struct msgb msg 
)

enqueue a to-be-transmitted message buffer containing unpacked bits

References msgb_enqueue(), msgb_length(), osmo_i460_subchan::mux, OSMO_ASSERT, and osmo_i460_subchan_mux::tx_queue.

◆ osmo_i460_mux_out()

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).

Parameters
[in]tstimeslot state.
[out]outcaller-provided buffer where to store generated output bytes.
[in]out_lennumber of bytes to be stored at out.

References mux_timeslot_provide_bits(), and osmo_i460_subchan::ts.

◆ osmo_i460_subchan_add()

◆ osmo_i460_subchan_count()

int osmo_i460_subchan_count ( struct osmo_i460_timeslot ts)

count the number of sub-channels in this I.460 slot.

Parameters
[in]tstimeslot that holds the I.460 subchannels.
Returns
number of subchannels.

References ARRAY_SIZE, OSMO_I460_RATE_NONE, and ts.

Referenced by osmo_i460_has_single_64k_schan().

◆ osmo_i460_subchan_del()

void osmo_i460_subchan_del ( struct osmo_i460_subchan schan)

References subchan_reset().

◆ osmo_i460_ts_init()

void osmo_i460_ts_init ( struct osmo_i460_timeslot ts)

initialize an I.460 timeslot

References ARRAY_SIZE, osmo_i460_timeslot::schan, subchan_reset(), and osmo_i460_subchan::ts.

l2downstatelist
static const struct l2downstate l2downstatelist[]
msgb::list
struct llist_head list
PRIM_DL_REL
@ PRIM_DL_REL
DL-RLEEASE.
Definition: lapd_core.h:25
PRIM_DL_EST
@ PRIM_DL_EST
DL-ESTABLISH.
Definition: lapd_core.h:24
OSMO_V110_SYNC_RA1_28800
@ OSMO_V110_SYNC_RA1_28800
Definition: v110.h:37
LAPD_STATE_TIMER_RECOV
@ LAPD_STATE_TIMER_RECOV
Definition: lapd_core.h:84
lapd_rx_s
static int lapd_rx_s(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1295
osmo_i460_subchan_demux::out_cb_bits
out_cb_bits_t out_cb_bits
callback to be called once we have received out_bitbuf_size bits
Definition: i460_mux.h:51
lapd_cr_ent::resp
uint8_t resp
Definition: lapd_core.h:117
MDL_CAUSE_UFRM_INC_PARAM
#define MDL_CAUSE_UFRM_INC_PARAM
Definition: lapd_core.h:40
msgb::l3h
unsigned char * l3h
osmo_v110_sync_ra1_get_intermediate_rate
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
@ OSMO_V110_SYNC_RA1_19200
Definition: v110.h:35
osmo_v110_decoded_frame
a 'decoded' representation of a single V.110 frame.
Definition: v110.h:12
tall_lapd_ctx
void * tall_lapd_ctx
Definition: lapd_core.c:254
msgb_alloc_headroom
static struct msgb * msgb_alloc_headroom(uint16_t size, uint16_t headroom, const char *name)
LAPD_U_UI
#define LAPD_U_UI
Definition: lapd_core.c:89
osmo_i460_timeslot
Definition: i460_mux.h:73
osmo_i460_mux_out
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
msg_to_tx_hist0
static void msg_to_tx_hist0(struct lapd_datalink *dl, const struct msgb *msg)
Definition: lapd_core.c:1750
osmo_ubit2pbit
int osmo_ubit2pbit(pbit_t *out, const ubit_t *in, unsigned int num_bits)
LAPD_MODE_NETWORK
@ LAPD_MODE_NETWORK
behave like network
Definition: lapd_core.h:71
lapd_msg_ctx::length
int length
Definition: lapd_core.h:111
lapd_history::more
int more
Definition: lapd_core.h:122
PRIM_DL_SUSP
@ PRIM_DL_SUSP
DL-SUSPEND.
Definition: lapd_core.h:26
osmo_v110_sync_ra1_user_to_ir
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
LAPD_HEADROOM
#define LAPD_HEADROOM
Definition: lapd_core.c:103
i460_mux.h
get_value_string
const char * get_value_string(const struct value_string *vs, uint32_t val)
alloc_bitbuf
static int alloc_bitbuf(void *ctx, struct osmo_i460_subchan *schan, size_t num_bits)
Definition: i460_mux.c:288
osmo_pbit2ubit
int osmo_pbit2ubit(ubit_t *out, const pbit_t *in, unsigned int num_bits)
len
static size_t len(const char *str)
osmo_i460_schan_desc
description of a sub-channel; passed by caller
Definition: i460_mux.h:78
MDL_CAUSE_UNSOL_DM_RESP
#define MDL_CAUSE_UNSOL_DM_RESP
Definition: lapd_core.h:36
l2downstate
Definition: lapd_core.c:2141
lapd_res_req
static int lapd_res_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2002
lapd_msg_ctx::n_send
uint8_t n_send
Definition: lapd_core.h:107
OSMO_ASSERT
#define OSMO_ASSERT(exp)
lapd_rx_u_frmr
static int lapd_rx_u_frmr(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1253
subchan_reset
static void subchan_reset(struct osmo_i460_subchan *schan, bool first_time)
Definition: i460_mux.c:315
LAPD_STATE_IDLE
@ LAPD_STATE_IDLE
Definition: lapd_core.h:80
osmo_i460_subchan_mux::user_data
void * user_data
Definition: i460_mux.h:62
msgb_put
static unsigned char * msgb_put(struct msgb *msgb, unsigned int len)
osmo_prim_init
static void osmo_prim_init(struct osmo_prim_hdr *oph, unsigned int sap, unsigned int primitive, enum osmo_prim_operation operation, struct msgb *msg)
lapd_data_req
static int lapd_data_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1811
utils.h
lapd_msg_ctx::sapi
uint8_t sapi
Definition: lapd_core.h:101
msgb::data
unsigned char * data
MDL_CAUSE_IFRM_INC_MBITS
#define MDL_CAUSE_IFRM_INC_MBITS
Definition: lapd_core.h:42
OSMO_V110_SYNC_RA1_7200
@ OSMO_V110_SYNC_RA1_7200
Definition: v110.h:31
lapd_recv_dlsap
int lapd_recv_dlsap(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2200
MDL_CAUSE_SABM_MF
#define MDL_CAUSE_SABM_MF
Definition: lapd_core.h:45
osmo_i460_mux_enqueue
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
lapd_t203_cb
static void lapd_t203_cb(void *data)
Definition: lapd_core.c:712
SBIT
#define SBIT(a)
Definition: lapd_core.c:106
OSMO_V110_SYNC_RA1_1200
@ OSMO_V110_SYNC_RA1_1200
Definition: v110.h:28
msg_to_tx_hist
static void msg_to_tx_hist(struct lapd_history *tx_hist, const struct msgb *msg, int length, int more)
Definition: lapd_core.c:1741
lapd_dl_exit
void lapd_dl_exit(struct lapd_datalink *dl)
Definition: lapd_core.c:358
LAPD_MODE_USER
@ LAPD_MODE_USER
behave like user
Definition: lapd_core.h:70
lapd_msg_ctx::format
uint8_t format
Definition: lapd_core.h:105
lapd_msg_ctx::s_u
uint8_t s_u
Definition: lapd_core.h:109
PRIM_OP_INDICATION
PRIM_OP_INDICATION
lapd_rx_u_disc
static int lapd_rx_u_disc(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1082
OSMO_V110_SYNC_RA1_14400
@ OSMO_V110_SYNC_RA1_14400
Definition: v110.h:34
msgb.h
LAPD_STATE_ASS_TEI_WAIT
@ LAPD_STATE_ASS_TEI_WAIT
Definition: lapd_core.h:78
msgb_pull_u8
static uint8_t msgb_pull_u8(struct msgb *msgb)
PRIM_DL_UNIT_DATA
@ PRIM_DL_UNIT_DATA
DL-UNIT-DATA.
Definition: lapd_core.h:22
v110_adapt_600_to_IR8000
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
lapd_set_mode
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
osmo_i460_subchan::bit_offset
uint8_t bit_offset
Definition: i460_mux.h:68
PRIM_OP_REQUEST
PRIM_OP_REQUEST
osmo_v110_sync_ra1::intermediate_rate
unsigned int intermediate_rate
Definition: v110.c:431
lapd_dl_newstate
static void lapd_dl_newstate(struct lapd_datalink *dl, uint32_t state)
Definition: lapd_core.c:233
lapd_send_rnr
static int lapd_send_rnr(struct lapd_msg_ctx *lctx, uint8_t f_bit, uint8_t cmd)
Definition: lapd_core.c:497
llist_head::next
struct llist_head * next
osmo_dlsap_prim::oph
struct osmo_prim_hdr oph
generic primitive header
Definition: lapd_core.h:61
demux_subchan_append_bit
static void demux_subchan_append_bit(struct osmo_i460_subchan *schan, uint8_t bit)
Definition: i460_mux.c:58
lapd_dl_reset
void lapd_dl_reset(struct lapd_datalink *dl)
Definition: lapd_core.c:337
osmo_talloc_replace_string
static void osmo_talloc_replace_string(void *ctx, char **dst, const char *newstr)
osmo_i460_subchan_demux::out_bitbuf
uint8_t * out_bitbuf
bit-buffer for output bits
Definition: i460_mux.h:45
LAPD_S_RR
#define LAPD_S_RR
Definition: lapd_core.c:94
LAPD_U_DM
#define LAPD_U_DM
Definition: lapd_core.c:88
lapd_msgb_alloc
struct msgb * lapd_msgb_alloc(int length, const char *name)
Definition: lapd_core.c:116
osmo_i460_schan_desc::mux
struct osmo_i460_schan_desc::@1 mux
MDL_CAUSE_FRM_UNIMPL
#define MDL_CAUSE_FRM_UNIMPL
Definition: lapd_core.h:44
MDL_CAUSE_T200_EXPIRED
#define MDL_CAUSE_T200_EXPIRED
Definition: lapd_core.h:33
v110_adapt_IR_to_Nx4800
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
INIT_LLIST_HEAD
#define INIT_LLIST_HEAD(ptr)
osmo_i460_schan_desc::demux
struct osmo_i460_schan_desc::@0 demux
v110_adapt_IR_to_Nx3600
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
osmo_i460_has_single_64k_schan
static bool osmo_i460_has_single_64k_schan(struct osmo_i460_timeslot *ts)
Definition: i460_mux.c:42
v110_adapt_Nx3600_to_IR
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
osmo_i460_subchan_demux
Definition: i460_mux.h:43
msgb::len
uint16_t len
v110_adapt_IR8000_to_600
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
osmo_i460_schan_desc::out_cb_bytes
out_cb_bytes_t out_cb_bytes
out_cb_bytes call-back function called whenever we received num_bits.
Definition: i460_mux.h:92
osmo_v110_sync_ra1
Definition: v110.c:429
osmo_i460_subchan_demux::out_bitbuf_size
unsigned int out_bitbuf_size
size of out_bitbuf in bytes
Definition: i460_mux.h:47
sub_mod
static uint8_t sub_mod(uint8_t x, uint8_t y, uint8_t m)
Definition: lapd_core.c:139
osmo_i460_schan_desc::num_bits
size_t num_bits
Definition: i460_mux.h:83
OSMO_I460_RATE_32k
@ OSMO_I460_RATE_32k
Definition: i460_mux.h:31
l2downstate::name
const char * name
Definition: lapd_core.c:2144
OSMO_V110_SYNC_RA1_24000
@ OSMO_V110_SYNC_RA1_24000
Definition: v110.h:36
osmo_i460_timeslot::schan
struct osmo_i460_subchan schan[OSMO_I460_NUM_SUBCHAN]
Definition: i460_mux.h:74
msgb_length
uint16_t msgb_length(const struct msgb *msg)
llist_del
static void llist_del(struct llist_head *entry)
LOGDL
#define LOGDL(dl, level, fmt, args...)
Definition: lapd_core.h:17
osmo_dlsap_prim
primitive header for LAPD DL-SAP primitives
Definition: lapd_core.h:60
osmo_dlsap_prim::rel_req
struct dl_rel_req_param rel_req
Definition: lapd_core.h:64
lapd_send_resend
static int lapd_send_resend(struct lapd_datalink *dl)
Definition: lapd_core.c:541
osmo_i460_subchan::mux
struct osmo_i460_subchan_mux mux
Definition: i460_mux.h:70
OSMO_V110_SYNC_RA1_2400
@ OSMO_V110_SYNC_RA1_2400
Definition: v110.h:29
osmo_prim_hdr::operation
enum osmo_prim_operation operation
data
uint8_t data[0]
v110_adapt_IR_to_Nx12000
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
msgb
_NUM_OSMO_V110_SYNC_RA1
@ _NUM_OSMO_V110_SYNC_RA1
Definition: v110.h:39
LOGL_INFO
#define LOGL_INFO
OSMO_I460_RATE_NONE
@ OSMO_I460_RATE_NONE
Definition: i460_mux.h:29
MDL_CAUSE_SFRM_INC_PARAM
#define MDL_CAUSE_SFRM_INC_PARAM
Definition: lapd_core.h:41
msgb_l3len
static unsigned int msgb_l3len(const struct msgb *msgb)
v110_adapt_Nx12000_to_IR
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
dl_rel_req_param::mode
uint8_t mode
release mode
Definition: lapd_core.h:56
lapd_cr_ent::cmd
uint8_t cmd
Definition: lapd_core.h:116
LAPD_U_SABM
#define LAPD_U_SABM
Definition: lapd_core.c:86
lapd_ph_data_ind
int lapd_ph_data_ind(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1696
lapd_dl_init2
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
@ LAPD_STATE_TEI_UNASS
Definition: lapd_core.h:77
OSMO_V110_SYNC_RA1_12000
@ OSMO_V110_SYNC_RA1_12000
Definition: v110.h:33
LAPD_STATE_NULL
@ LAPD_STATE_NULL
Definition: lapd_core.h:76
msgb_free
void msgb_free(struct msgb *m)
PRIM_MDL_ERROR
@ PRIM_MDL_ERROR
MDL-ERROR.
Definition: lapd_core.h:29
osmo_i460_subchan_mux::in_cb_queue_empty
in_cb_queue_empty_t in_cb_queue_empty
Definition: i460_mux.h:61
LAPD_S_REJ
#define LAPD_S_REJ
Definition: lapd_core.c:96
osmo_v110_sync_ra1_get_user_data_rate
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
LAPD_U_DISC
#define LAPD_U_DISC
Definition: lapd_core.c:90
CR_USER2NET_RESP
#define CR_USER2NET_RESP
Definition: lapd_core.c:99
lapd_est_req
static int lapd_est_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1756
LAPD_U_FRMR
#define LAPD_U_FRMR
Definition: lapd_core.c:92
lapd_msg_ctx::p_f
uint8_t p_f
Definition: lapd_core.h:106
MDL_CAUSE_UNSOL_DM_RESP_MF
#define MDL_CAUSE_UNSOL_DM_RESP_MF
Definition: lapd_core.h:37
osmo_i460_subchan_add
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
osmo_timer_schedule
void osmo_timer_schedule(struct osmo_timer_list *timer, int seconds, int microseconds)
lapd_history
Definition: lapd_core.h:120
lapd_rx_u_sabm
static int lapd_rx_u_sabm(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:814
LAPD_S_RNR
#define LAPD_S_RNR
Definition: lapd_core.c:95
lapd_rx_u_dm
static int lapd_rx_u_dm(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:961
osmo_v110_ubit_dump
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
MDL_CAUSE_UNSOL_SPRV_RESP
#define MDL_CAUSE_UNSOL_SPRV_RESP
Definition: lapd_core.h:38
mux_subchan_provide_bits
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
mux_timeslot_provide_bits
static uint8_t mux_timeslot_provide_bits(struct osmo_i460_timeslot *ts)
Definition: i460_mux.c:246
lapd_msg_ctx::n201
int n201
Definition: lapd_core.h:98
osmo_i460_subchan_demux::out_cb_bytes
out_cb_bytes_t out_cb_bytes
Definition: i460_mux.h:52
lapd_send_dm
static int lapd_send_dm(struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:454
CR_NET2USER_CMD
#define CR_NET2USER_CMD
Definition: lapd_core.c:100
lapd_dl_set_name
void lapd_dl_set_name(struct lapd_datalink *dl, const char *name)
Definition: lapd_core.c:329
LAPD_STATE_EST_TEI_WAIT
@ LAPD_STATE_EST_TEI_WAIT
Definition: lapd_core.h:79
osmo_i460_subchan::demux
struct osmo_i460_subchan_demux demux
Definition: i460_mux.h:69
osmo_i460_ts_init
void osmo_i460_ts_init(struct osmo_i460_timeslot *ts)
initialize an I.460 timeslot
Definition: i460_mux.c:335
ts
struct @6 ts
PRIM_DL_RECON
@ PRIM_DL_RECON
DL-RECONNECT.
Definition: lapd_core.h:28
MDL_CAUSE_IFRM_INC_LEN
#define MDL_CAUSE_IFRM_INC_LEN
Definition: lapd_core.h:43
LAPD_U_SABME
#define LAPD_U_SABME
Definition: lapd_core.c:87
lapd_history::msg
struct msgb * msg
Definition: lapd_core.h:121
talloc.h
LAPD_FORM_U
@ LAPD_FORM_U
Definition: lapd_core.h:92
osmo_prim_hdr::msg
struct msgb * msg
name
const char * name
osmo_v110_sync_ra1_get_user_data_chunk_bitlen
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
lapd_rx_u
static int lapd_rx_u(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1269
osmo_v110_decode_frame
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
v110_adapt_IR8000_to_2400
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
lapd_start_t200
static void lapd_start_t200(struct lapd_datalink *dl)
Definition: lapd_core.c:200
osmo_v110_sync_ra1::user_data_chunk_bits
unsigned int user_data_chunk_bits
Definition: v110.c:432
inc_mod
static uint8_t inc_mod(uint8_t x, uint8_t m)
Definition: lapd_core.c:129
osmo_v110_sync_ra1::adapt_user_to_ir
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
osmo_i460_subchan_mux::tx_queue
struct llist_head tx_queue
list of to-be-transmitted message buffers
Definition: i460_mux.h:60
v110.h
msgb_trim
static int msgb_trim(struct msgb *msg, int len)
osmo_i460_subchan_demux::out_idx
unsigned int out_idx
offset of next bit to be written in out_bitbuf
Definition: i460_mux.h:49
lapd_dl_init
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
osmo_i460_schan_desc::out_cb_bits
out_cb_bits_t out_cb_bits
call-back function called whenever we received num_bits
Definition: i460_mux.h:85
lapd_reestablish
static int lapd_reestablish(struct lapd_datalink *dl)
Definition: lapd_core.c:573
OSMO_V110_SYNC_RA1_9600
@ OSMO_V110_SYNC_RA1_9600
Definition: v110.h:32
mdl_error
static int mdl_error(uint8_t cause, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:416
lapd_rx_u_ui
static int lapd_rx_u_ui(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1043
osmo_timer_setup
void osmo_timer_setup(struct osmo_timer_list *timer, void(*cb)(void *data), void *data)
ALL_STATES
#define ALL_STATES
Definition: lapd_core.c:107
OSMO_I460_RATE_64k
@ OSMO_I460_RATE_64k
Definition: i460_mux.h:30
OSMO_VALUE_STRING
#define OSMO_VALUE_STRING(x)
lapd_msg_ctx::cr
uint8_t cr
Definition: lapd_core.h:100
timer.h
lapd_stop_t203
static void lapd_stop_t203(struct lapd_datalink *dl)
Definition: lapd_core.c:225
osmo_i460_subchan_demux::user_data
void * user_data
Definition: i460_mux.h:53
lapd_dl_flush_hist
static void lapd_dl_flush_hist(struct lapd_datalink *dl)
Definition: lapd_core.c:157
lapd_send_ua
static int lapd_send_ua(struct lapd_msg_ctx *lctx, uint8_t len, uint8_t *data)
Definition: lapd_core.c:430
LAPD_FORM_I
@ LAPD_FORM_I
Definition: lapd_core.h:90
lapd_dl_flush_tx
static void lapd_dl_flush_tx(struct lapd_datalink *dl)
Definition: lapd_core.c:172
PRIM_DL_RES
@ PRIM_DL_RES
DL-RESUME.
Definition: lapd_core.h:27
osmo_i460_subchan_count
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
lapd_msg_ctx::n_recv
uint8_t n_recv
Definition: lapd_core.h:108
mux_schan_provide_bit
static ubit_t mux_schan_provide_bit(struct osmo_i460_subchan *schan)
Definition: i460_mux.c:170
CR_USER2NET_CMD
#define CR_USER2NET_CMD
Definition: lapd_core.c:98
lapd_send_rr
static int lapd_send_rr(struct lapd_msg_ctx *lctx, uint8_t f_bit, uint8_t cmd)
Definition: lapd_core.c:475
LOGL_NOTICE
#define LOGL_NOTICE
lapd_t200_cb
static void lapd_t200_cb(void *data)
Definition: lapd_core.c:587
osmo_v110_decoded_frame::d_bits
ubit_t d_bits[MAX_D_BITS]
Definition: v110.h:13
l2downstate::op
int op
Definition: lapd_core.c:2143
llist_add
static void llist_add(struct llist_head *_new, struct llist_head *head)
F
#define F
Definition: v110.c:144
MDL_CAUSE_FRMR
#define MDL_CAUSE_FRMR
Definition: lapd_core.h:47
osmo_v110_sync_ra1::data_rate
unsigned int data_rate
Definition: v110.c:430
value_string
osmo_i460_subchan
Definition: i460_mux.h:65
LAPD_STATE_DISC_SENT
@ LAPD_STATE_DISC_SENT
Definition: lapd_core.h:82
lapd_mode
lapd_mode
LAPD mode/role.
Definition: lapd_core.h:69
lapd_udata_req
static int lapd_udata_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1721
osmo_v110_sync_ra1::adapt_ir_to_user
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
lapd_state_name
static const char * lapd_state_name(enum lapd_state state)
Definition: lapd_core.c:195
lapd_msg_ctx
LAPD message context.
Definition: lapd_core.h:96
osmo_v110_decoded_frame::e_bits
ubit_t e_bits[MAX_E_BITS]
Definition: v110.h:14
ubit_t
uint8_t ubit_t
osmo_v110_decoded_frame::s_bits
ubit_t s_bits[MAX_S_BITS]
Definition: v110.h:15
osmo_v110_decoded_frame::x_bits
ubit_t x_bits[MAX_X_BITS]
Definition: v110.h:16
ARRAY_SIZE
#define ARRAY_SIZE(x)
osmo_dlsap_prim::u
union osmo_dlsap_prim::@2 u
request-specific data
lapd_rel_req
static int lapd_rel_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2067
OSMO_I460_RATE_16k
@ OSMO_I460_RATE_16k
Definition: i460_mux.h:32
osmo_timer_pending
int osmo_timer_pending(const struct osmo_timer_list *timer)
osmo_timer_del
void osmo_timer_del(struct osmo_timer_list *timer)
l2downstate::prim
int prim
Definition: lapd_core.c:2143
LAPD_FORM_S
@ LAPD_FORM_S
Definition: lapd_core.h:91
lapd_msg_ctx::dl
struct lapd_datalink * dl
Definition: lapd_core.h:97
llist_entry
#define llist_entry(ptr, type, member)
lapd_acknowledge
static void lapd_acknowledge(struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:742
MDL_CAUSE_UNSOL_UA_RESP
#define MDL_CAUSE_UNSOL_UA_RESP
Definition: lapd_core.h:35
osmo_i460_schan_desc::user_data
void * user_data
Definition: i460_mux.h:94
send_dl_simple
static int send_dl_simple(uint8_t prim, uint8_t op, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:409
send_dl_l3
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
@ OSMO_V110_SYNC_RA1_4800
Definition: v110.h:30
lapd_susp_req
static int lapd_susp_req(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1975
lapd_state_names
const struct value_string lapd_state_names[]
Definition: lapd_core.c:182
osmo_v110_sync_ra1_ir_to_user
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
MDL_CAUSE_SEQ_ERR
#define MDL_CAUSE_SEQ_ERR
Definition: lapd_core.h:39
l2downstate::rout
int(* rout)(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2145
msgb_queue_free
static void msgb_queue_free(struct llist_head *queue)
v110_adapt_IR8000_to_1200
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
lapd_rel_req_idle
static int lapd_rel_req_idle(struct osmo_dlsap_prim *dp, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:2128
osmo_i460_schan_desc::in_cb_queue_empty
in_cb_queue_empty_t in_cb_queue_empty
Definition: i460_mux.h:100
LAPD_U_UA
#define LAPD_U_UA
Definition: lapd_core.c:91
OSMO_V110_SYNC_RA1_38400
@ OSMO_V110_SYNC_RA1_38400
Definition: v110.h:38
osmo_i460_schan_desc::bit_offset
uint8_t bit_offset
Definition: i460_mux.h:80
lapd_send_rej
static int lapd_send_rej(struct lapd_msg_ctx *lctx, uint8_t f_bit)
Definition: lapd_core.c:519
do_mod
static uint8_t do_mod(uint8_t x, uint8_t m)
Definition: lapd_core.c:124
llist_empty
static int llist_empty(const struct llist_head *head)
osmo_i460_subchan_del
void osmo_i460_subchan_del(struct osmo_i460_subchan *schan)
Definition: i460_mux.c:382
osmo_i460_subchan::ts
struct osmo_i460_timeslot * ts
Definition: i460_mux.h:66
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.
Definition: i460_mux.c:128
osmo_i460_subchan_mux
Definition: i460_mux.h:58
find_unused_subchan_idx
static int find_unused_subchan_idx(const struct osmo_i460_timeslot *ts)
Definition: i460_mux.c:302
CR_NET2USER_RESP
#define CR_NET2USER_RESP
Definition: lapd_core.c:101
logging.h
bits.h
OSMO_I460_RATE_8k
@ OSMO_I460_RATE_8k
Definition: i460_mux.h:33
msgb_dequeue
struct msgb * msgb_dequeue(struct llist_head *queue)
MDL_CAUSE_SABM_INFO_NOTALL
#define MDL_CAUSE_SABM_INFO_NOTALL
Definition: lapd_core.h:46
lapd_msg_ctx::more
uint8_t more
Definition: lapd_core.h:112
osmo_i460_subchan::rate
enum osmo_i460_rate rate
Definition: i460_mux.h:67
LAPD_STATE_SABM_SENT
@ LAPD_STATE_SABM_SENT
Definition: lapd_core.h:81
v110_adapt_Nx4800_to_IR
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
lapd_rx_u_ua
static int lapd_rx_u_ua(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1160
lapd_stop_t200
static void lapd_stop_t200(struct lapd_datalink *dl)
Definition: lapd_core.c:217
mdl_error_ind_param::cause
uint8_t cause
generic cause value
Definition: lapd_core.h:51
OSMO_V110_SYNC_RA1_600
@ OSMO_V110_SYNC_RA1_600
Definition: v110.h:27
lapd_start_t203
static void lapd_start_t203(struct lapd_datalink *dl)
Definition: lapd_core.c:209
PRIM_DL_DATA
@ PRIM_DL_DATA
DL-DATA.
Definition: lapd_core.h:23
LOGL_DEBUG
#define LOGL_DEBUG
msgb_enqueue
void msgb_enqueue(struct llist_head *queue, struct msgb *msg)
v110_adapt_2400_to_IR8000
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
osmo_v110_sync_ra1_def
static const struct osmo_v110_sync_ra1 osmo_v110_sync_ra1_def[_NUM_OSMO_V110_SYNC_RA1]
Definition: v110.c:440
lapd_dl_flush_send
static void lapd_dl_flush_send(struct lapd_datalink *dl)
Definition: lapd_core.c:144
osmo_prim_hdr::primitive
unsigned int primitive
osmo_v100_sync_ra1_rate
osmo_v100_sync_ra1_rate
enum for each supported V.110 synchronous RA1 function (one for each user bitrate)
Definition: v110.h:26
L2DOWNSLLEN
#define L2DOWNSLLEN
Definition: lapd_core.c:2197
lapd_rx_i
static int lapd_rx_i(struct msgb *msg, struct lapd_msg_ctx *lctx)
Definition: lapd_core.c:1506
LOGL_ERROR
#define LOGL_ERROR
osmo_i460_schan_desc::rate
enum osmo_i460_rate rate
Definition: i460_mux.h:79
osmo_dlsap_prim::error_ind
struct mdl_error_ind_param error_ind
Definition: lapd_core.h:63
LAPD_STATE_MF_EST
@ LAPD_STATE_MF_EST
Definition: lapd_core.h:83
lapd_state
lapd_state
LAPD state (Figure B.2/Q.921)
Definition: lapd_core.h:75
l2downstate::states
uint32_t states
Definition: lapd_core.c:2142
PRIM_OP_CONFIRM
PRIM_OP_CONFIRM
lapd_core.h
LAPD_TAILROOM
#define LAPD_TAILROOM
Definition: lapd_core.c:104
osmo_v110_encode_frame
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
demux_subchan_extract_bits
static void demux_subchan_extract_bits(struct osmo_i460_subchan *schan, const uint8_t *data, size_t data_len)
Definition: i460_mux.c:83
add_mod
static uint8_t add_mod(uint8_t x, uint8_t y, uint8_t m)
Definition: lapd_core.c:134
v110_adapt_1200_to_IR8000
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
lapd_send_i
static int lapd_send_i(struct lapd_msg_ctx *lctx, int line)
Definition: lapd_core.c:1834