Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame^] | 1 | #ifndef _GSM_DATA_H |
| 2 | #define _GSM_DATA_H |
| 3 | |
| 4 | #include <sys/types.h> |
| 5 | |
| 6 | #define GSM_MAX_BTS 8 |
| 7 | #define BTS_MAX_TRX 8 |
| 8 | |
| 9 | #define HARDCODED_ARFCN 123 |
| 10 | |
| 11 | /* communications link with a BTS */ |
| 12 | struct gsm_bts_link { |
| 13 | struct gsm_bts *bts; |
| 14 | }; |
| 15 | |
| 16 | #define BTS_TRX_F_ACTIVATED 0x0001 |
| 17 | /* One Timeslot in a TRX */ |
| 18 | struct gsm_bts_trx_ts { |
| 19 | struct gsm_bts_trx *trx; |
| 20 | /* number of this timeslot at the TRX */ |
| 21 | u_int8_t nr; |
| 22 | |
| 23 | unsigned int flags; |
| 24 | }; |
| 25 | |
| 26 | /* One TRX in a BTS */ |
| 27 | struct gsm_bts_trx { |
| 28 | struct gsm_bts *bts; |
| 29 | /* number of this TRX in the BTS */ |
| 30 | u_int8_t nr; |
| 31 | |
| 32 | u_int16_t arfcn; |
| 33 | struct gsm_bts_trx_ts ts[8]; |
| 34 | }; |
| 35 | |
| 36 | /* One BTS */ |
| 37 | struct gsm_bts { |
| 38 | struct gsm_network *network; |
| 39 | /* number of ths BTS in network */ |
| 40 | u_int8_t nr; |
| 41 | /* location area code of this BTS */ |
| 42 | u_int8_t location_area_code; |
| 43 | |
| 44 | /* Abis network management O&M handle */ |
| 45 | struct abis_nm_h *nmh; |
| 46 | /* number of this BTS on given E1 link */ |
| 47 | u_int8_t bts_nr; |
| 48 | |
| 49 | /* CCCH is on C0 */ |
| 50 | struct gsm_bts_trx *c0; |
| 51 | /* transceivers */ |
| 52 | int num_trx; |
| 53 | struct gsm_bts_trx trx[BTS_MAX_TRX+1]; |
| 54 | }; |
| 55 | |
| 56 | struct gsm_ms { |
| 57 | unsigned long imei; |
| 58 | }; |
| 59 | |
| 60 | struct gsm_network { |
| 61 | /* global parameters */ |
| 62 | u_int8_t country_code; |
| 63 | u_int8_t network_code; |
| 64 | |
| 65 | unsigned int num_bts; |
| 66 | /* private lists */ |
| 67 | struct gsm_bts bts[GSM_MAX_BTS+1]; |
| 68 | struct gsm_ms *ms; |
| 69 | struct gsm_subscriber *subscriber; |
| 70 | }; |
| 71 | |
| 72 | struct gsm_network *gsm_network_init(unsigned int num_bts, u_int8_t country_code, |
| 73 | u_int8_t network_code); |
| 74 | #endif |