summaryrefslogtreecommitdiff
path: root/gsmstack/gsmstack.c
blob: 5e69e93a04d1c996ce6a7e7e9604402fdf22e69b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <errno.h>

#include "gsmstack.h"


struct gsm_rf_chan *gsm_init_rfchan(unsigned int arfcn)
{
	struct gsm_rf_chan *rf;
	int i;

	rf = malloc(sizeof(*rf));
	if (!rf)
		return NULL;
	memset(rf, 0, sizeof(*rf));

	rf->arfcn = arfcn;

	for (i = 0; i < NR_TIMESLOTS; i++) {
		struct gsm_phys_chan *pchan;

		pchan = &rf->phys_chan[i];
		pchan->timeslot = i;
		pchan->rf_chan = rf;
	}
	
	return rf;
}
personal git repositories of Harald Welte. Your mileage may vary