1 #ifndef osmocom_l1ctl_h
2 #define osmocom_l1ctl_h
4 #include <osmocom/core/msgb.h>
5 #include <osmocom/bb/common/osmocom_data.h>
9 /* Receive incoming data from L1 using L1CTL format */
10 int l1ctl_recv(struct osmocom_ms *ms, struct msgb *msg);
12 /* Transmit L1CTL_DATA_REQ */
13 int l1ctl_tx_data_req(struct osmocom_ms *ms, struct msgb *msg, uint8_t chan_nr,
16 /* Transmit L1CTL_PARAM_REQ */
17 int l1ctl_tx_param_req(struct osmocom_ms *ms, uint8_t ta, uint8_t tx_power);
19 int l1ctl_tx_crypto_req(struct osmocom_ms *ms, uint8_t algo, uint8_t *key,
22 /* Transmit L1CTL_RACH_REQ */
23 int l1ctl_tx_rach_req(struct osmocom_ms *ms, uint8_t ra, uint16_t offset,
26 /* Transmit L1CTL_DM_EST_REQ */
27 int l1ctl_tx_dm_est_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
28 uint8_t chan_nr, uint8_t tsc, uint8_t tch_mode);
29 int l1ctl_tx_dm_est_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
30 uint16_t *ma, uint8_t ma_len, uint8_t chan_nr, uint8_t tsc,
33 /* Transmit L1CTL_DM_FREQ_REQ */
34 int l1ctl_tx_dm_freq_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
35 uint8_t tsc, uint16_t fn);
36 int l1ctl_tx_dm_freq_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
37 uint16_t *ma, uint8_t ma_len, uint8_t tsc, uint16_t fn);
39 /* Transmit L1CTL_DM_REL_REQ */
40 int l1ctl_tx_dm_rel_req(struct osmocom_ms *ms);
42 /* Transmit FBSB_REQ */
43 int l1ctl_tx_fbsb_req(struct osmocom_ms *ms, uint16_t arfcn,
44 uint8_t flags, uint16_t timeout, uint8_t sync_info_idx,
47 /* Transmit CCCH_MODE_REQ */
48 int l1ctl_tx_ccch_mode_req(struct osmocom_ms *ms, uint8_t ccch_mode);
50 /* Transmit TCH_MODE_REQ */
51 int l1ctl_tx_tch_mode_req(struct osmocom_ms *ms, uint8_t tch_mode);
53 /* Transmit ECHO_REQ */
54 int l1ctl_tx_echo_req(struct osmocom_ms *ms, unsigned int len);
56 /* Transmit L1CTL_RESET_REQ */
57 int l1ctl_tx_reset_req(struct osmocom_ms *ms, uint8_t type);
59 /* Transmit L1CTL_PM_REQ */
60 int l1ctl_tx_pm_req_range(struct osmocom_ms *ms, uint16_t arfcn_from,
63 int l1ctl_tx_sim_req(struct osmocom_ms *ms, uint8_t *data, uint16_t length);
66 /* LAPDm wants to send a PH-* primitive to the physical layer (L1) */
67 int l1ctl_ph_prim_cb(struct osmo_prim_hdr *oph, void *ctx);
69 /* Transmit L1CTL_NEIGH_PM_REQ */
70 int l1ctl_tx_neigh_pm_req(struct osmocom_ms *ms, int num, uint16_t *arfcn);