20e9481c032a6de573c020704c7cad1eb37efb4e
[osmocom-bb.git] / src / host / layer23 / include / osmocom / bb / common / l1ctl.h
1 #ifndef osmocom_l1ctl_h
2 #define osmocom_l1ctl_h
3
4 #include <osmocore/msgb.h>
5 #include <osmocom/bb/common/osmocom_data.h>
6
7 struct osmocom_ms;
8
9 /* Receive incoming data from L1 using L1CTL format */
10 int l1ctl_recv(struct osmocom_ms *ms, struct msgb *msg);
11
12 /* Transmit L1CTL_DATA_REQ */
13 int l1ctl_tx_data_req(struct osmocom_ms *ms, struct msgb *msg, uint8_t chan_nr,
14         uint8_t link_id);
15
16 /* Transmit L1CTL_PARAM_REQ */
17 int l1ctl_tx_param_req(struct osmocom_ms *ms, uint8_t ta, uint8_t tx_power);
18
19 int l1ctl_tx_crypto_req(struct osmocom_ms *ms, uint8_t algo, uint8_t *key,
20         uint8_t len);
21
22 /* Transmit L1CTL_RACH_REQ */
23 int l1ctl_tx_rach_req(struct osmocom_ms *ms, uint8_t ra, uint8_t fn51,
24         uint8_t mf_off);
25
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);
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);
31
32 /* Transmit L1CTL_DM_FREQ_REQ */
33 int l1ctl_tx_dm_freq_req_h0(struct osmocom_ms *ms, uint16_t band_arfcn,
34         uint8_t tsc, uint16_t fn);
35 int l1ctl_tx_dm_freq_req_h1(struct osmocom_ms *ms, uint8_t maio, uint8_t hsn,
36         uint16_t *ma, uint8_t ma_len, uint8_t tsc, uint16_t fn);
37
38 /* Transmit L1CTL_DM_REL_REQ */
39 int l1ctl_tx_dm_rel_req(struct osmocom_ms *ms);
40
41 /* Transmit FBSB_REQ */
42 int l1ctl_tx_fbsb_req(struct osmocom_ms *ms, uint16_t arfcn,
43                       uint8_t flags, uint16_t timeout, uint8_t sync_info_idx,
44                       uint8_t ccch_mode);
45
46 /* Transmit CCCH_MODE_REQ */
47 int l1ctl_tx_ccch_mode_req(struct osmocom_ms *ms, uint8_t ccch_mode);
48
49 /* Transmit TCH_MODE_REQ */
50 int l1ctl_tx_tch_mode_req(struct osmocom_ms *ms, uint8_t tch_mode);
51
52 /* Transmit ECHO_REQ */
53 int l1ctl_tx_echo_req(struct osmocom_ms *ms, unsigned int len);
54
55 /* Transmit L1CTL_RESET_REQ */
56 int l1ctl_tx_reset_req(struct osmocom_ms *ms, uint8_t type);
57
58 /* Transmit L1CTL_PM_REQ */
59 int l1ctl_tx_pm_req_range(struct osmocom_ms *ms, uint16_t arfcn_from,
60                           uint16_t arfcm_to);
61
62 int l1ctl_tx_sim_req(struct osmocom_ms *ms, uint8_t *data, uint16_t length);
63
64 #endif