2010-03-03 13:22:04 +00:00
|
|
|
#ifndef osmocom_l1ctl_h
|
|
|
|
#define osmocom_l1ctl_h
|
|
|
|
|
2011-04-26 00:55:30 +00:00
|
|
|
#include <osmocom/core/msgb.h>
|
2023-01-12 16:13:55 +00:00
|
|
|
#include <osmocom/core/prim.h>
|
2010-07-27 18:44:46 +00:00
|
|
|
#include <osmocom/bb/common/osmocom_data.h>
|
2010-03-03 13:22:04 +00:00
|
|
|
|
|
|
|
struct osmocom_ms;
|
|
|
|
|
|
|
|
/* Receive incoming data from L1 using L1CTL format */
|
|
|
|
int l1ctl_recv(struct osmocom_ms *ms, struct msgb *msg);
|
|
|
|
|
|
|
|
/* Transmit L1CTL_DATA_REQ */
|
2010-07-25 22:26:11 +00:00
|
|
|
int l1ctl_tx_data_req(struct osmocom_ms *ms, struct msgb *msg, uint8_t chan_nr,
|
2010-07-13 14:12:54 +00:00
|
|
|
uint8_t link_id);
|
|
|
|
|
|
|
|
/* Transmit L1CTL_PARAM_REQ */
|
2018-09-06 17:36:35 +00:00
|
|
|
int l1ctl_tx_param_req(struct osmocom_ms *ms, int8_t ta, uint8_t tx_power);
|
2010-03-03 13:22:04 +00:00
|
|
|
|
2017-12-16 10:52:31 +00:00
|
|
|
int l1ctl_tx_crypto_req(struct osmocom_ms *ms, uint8_t chan_nr,
|
|
|
|
uint8_t algo, uint8_t *key, uint8_t len);
|
2010-09-11 12:10:31 +00:00
|
|
|
|
2010-03-03 13:22:04 +00:00
|
|
|
/* Transmit L1CTL_RACH_REQ */
|
2022-08-20 21:38:21 +00:00
|
|
|
int l1ctl_tx_rach_req(struct osmocom_ms *ms,
|
|
|
|
uint8_t chan_nr, uint8_t link_id,
|
|
|
|
uint8_t ra, uint16_t offset, uint8_t combined);
|
2010-03-03 13:22:04 +00:00
|
|
|
|
|
|
|
/* Transmit L1CTL_DM_EST_REQ */
|
2010-07-25 22:26:11 +00:00
|
|
|
int l1ctl_tx_dm_est_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
|
2011-07-28 18:54:42 +00:00
|
|
|
uint8_t chan_nr, uint8_t tsc, uint8_t tch_mode, uint8_t audio_mode);
|
2010-07-25 22:26:11 +00:00
|
|
|
int l1ctl_tx_dm_est_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
|
2010-09-26 20:55:02 +00:00
|
|
|
uint16_t *ma, uint8_t ma_len, uint8_t chan_nr, uint8_t tsc,
|
2011-07-28 18:54:42 +00:00
|
|
|
uint8_t tch_mode, uint8_t audio_mode);
|
2010-06-26 09:35:27 +00:00
|
|
|
|
2010-08-21 15:09:48 +00:00
|
|
|
/* Transmit L1CTL_DM_FREQ_REQ */
|
|
|
|
int l1ctl_tx_dm_freq_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
|
|
|
|
uint8_t tsc, uint16_t fn);
|
|
|
|
int l1ctl_tx_dm_freq_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
|
|
|
|
uint16_t *ma, uint8_t ma_len, uint8_t tsc, uint16_t fn);
|
|
|
|
|
2010-06-26 09:35:27 +00:00
|
|
|
/* Transmit L1CTL_DM_REL_REQ */
|
2010-07-25 22:26:11 +00:00
|
|
|
int l1ctl_tx_dm_rel_req(struct osmocom_ms *ms);
|
2010-06-26 09:35:27 +00:00
|
|
|
|
2010-05-19 19:41:24 +00:00
|
|
|
/* Transmit FBSB_REQ */
|
|
|
|
int l1ctl_tx_fbsb_req(struct osmocom_ms *ms, uint16_t arfcn,
|
2010-06-20 20:40:03 +00:00
|
|
|
uint8_t flags, uint16_t timeout, uint8_t sync_info_idx,
|
2012-11-20 09:13:44 +00:00
|
|
|
uint8_t ccch_mode, uint8_t rxlev_exp);
|
2010-06-20 20:40:03 +00:00
|
|
|
|
2010-07-25 22:26:11 +00:00
|
|
|
/* Transmit CCCH_MODE_REQ */
|
2010-06-20 20:40:03 +00:00
|
|
|
int l1ctl_tx_ccch_mode_req(struct osmocom_ms *ms, uint8_t ccch_mode);
|
2010-03-03 13:22:04 +00:00
|
|
|
|
2010-09-26 17:06:06 +00:00
|
|
|
/* Transmit TCH_MODE_REQ */
|
2011-07-28 18:54:42 +00:00
|
|
|
int l1ctl_tx_tch_mode_req(struct osmocom_ms *ms, uint8_t tch_mode,
|
2020-07-30 11:28:46 +00:00
|
|
|
uint8_t audio_mode, uint8_t tch_loop_mode);
|
2010-09-26 17:06:06 +00:00
|
|
|
|
2010-07-25 22:26:11 +00:00
|
|
|
/* Transmit ECHO_REQ */
|
2010-03-27 04:32:10 +00:00
|
|
|
int l1ctl_tx_echo_req(struct osmocom_ms *ms, unsigned int len);
|
|
|
|
|
2010-06-26 11:12:25 +00:00
|
|
|
/* Transmit L1CTL_RESET_REQ */
|
|
|
|
int l1ctl_tx_reset_req(struct osmocom_ms *ms, uint8_t type);
|
|
|
|
|
2010-03-27 10:40:21 +00:00
|
|
|
/* Transmit L1CTL_PM_REQ */
|
|
|
|
int l1ctl_tx_pm_req_range(struct osmocom_ms *ms, uint16_t arfcn_from,
|
2013-01-07 10:52:50 +00:00
|
|
|
uint16_t arfcn_to);
|
2010-03-27 10:40:21 +00:00
|
|
|
|
2010-09-18 19:15:15 +00:00
|
|
|
int l1ctl_tx_sim_req(struct osmocom_ms *ms, uint8_t *data, uint16_t length);
|
|
|
|
|
2011-07-28 18:54:42 +00:00
|
|
|
/* Transmit L1CTL_VOICE_REQ */
|
|
|
|
int l1ctl_tx_traffic_req(struct osmocom_ms *ms, struct msgb *msg,
|
|
|
|
uint8_t chan_nr, uint8_t link_id);
|
2011-06-23 21:55:20 +00:00
|
|
|
|
|
|
|
/* LAPDm wants to send a PH-* primitive to the physical layer (L1) */
|
|
|
|
int l1ctl_ph_prim_cb(struct osmo_prim_hdr *oph, void *ctx);
|
|
|
|
|
2011-07-17 07:36:49 +00:00
|
|
|
/* Transmit L1CTL_NEIGH_PM_REQ */
|
|
|
|
int l1ctl_tx_neigh_pm_req(struct osmocom_ms *ms, int num, uint16_t *arfcn);
|
|
|
|
|
2023-02-17 17:03:02 +00:00
|
|
|
/* Transmit L1CTL_GPRS_UL_BLOCK_REQ */
|
|
|
|
int l1ctl_tx_gprs_ul_block_req(struct osmocom_ms *ms, uint32_t fn, uint8_t tn,
|
|
|
|
const uint8_t *data, size_t data_len);
|
|
|
|
|
|
|
|
/* Transmit L1CTL_GPRS_UL_TBF_CFG_REQ */
|
|
|
|
int l1ctl_tx_gprs_ul_tbf_cfg_req(struct osmocom_ms *ms, uint8_t tbf_ref,
|
2023-06-07 16:06:24 +00:00
|
|
|
uint8_t slotmask, uint32_t start_fn);
|
2023-02-17 17:03:02 +00:00
|
|
|
|
|
|
|
/* Transmit L1CTL_GPRS_DL_TBF_CFG_REQ */
|
|
|
|
int l1ctl_tx_gprs_dl_tbf_cfg_req(struct osmocom_ms *ms, uint8_t tbf_ref,
|
2023-06-07 16:06:24 +00:00
|
|
|
uint8_t slotmask, uint32_t start_fn,
|
|
|
|
uint8_t dl_tfi);
|
2023-02-17 17:03:02 +00:00
|
|
|
|
2010-03-03 13:22:04 +00:00
|
|
|
#endif
|