libosmoisdn 1.13.1.1-afb4 Osmocom ISDN library

Data Structures | Macros | Typedefs | Enumerations | Functions
i460_mux.h File Reference

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

`#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_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 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

enum 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] | 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()

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] | 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()

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

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

int osmo_i460_subchan_count | ( | struct osmo_i460_timeslot * | ts | ) |

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

Parameters

  [in] | ts | timeslot 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.