aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/gsm_data.h
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-03-23 06:41:45 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-03-25 09:07:28 +0100
commit68884aa156126e30e435fe4e2c5847340c61f0d3 (patch)
tree7d963601663fc7be7afc49cef3021191377e0837 /openbsc/include/openbsc/gsm_data.h
parentfe6bf777c3f76f4dc5835411828c9ebbdd7db83e (diff)
lchan: Create a structure for MSC data of the lchan
Prepare to split the BSC and the MSC part by putting the MSC data for a connection into a "gsm_subscriber_connection" struct and renaming the macros.
Diffstat (limited to 'openbsc/include/openbsc/gsm_data.h')
-rw-r--r--openbsc/include/openbsc/gsm_data.h63
1 files changed, 36 insertions, 27 deletions
diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h
index 88e7f16c3..de69ee36a 100644
--- a/openbsc/include/openbsc/gsm_data.h
+++ b/openbsc/include/openbsc/gsm_data.h
@@ -84,18 +84,18 @@ typedef int gsm_cbfn(unsigned int hooknum,
* will be started.
*/
#define LCHAN_RELEASE_TIMEOUT 20, 0
-#define use_lchan(lchan) \
- do { lchan->use_count++; \
+#define use_subscr_con(con) \
+ do { (con)->use_count++; \
DEBUGP(DREF, "lchan (bts=%d,trx=%d,ts=%d,ch=%d) increases usage to: %d\n", \
- lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, \
- lchan->nr, lchan->use_count); \
- bsc_schedule_timer(&lchan->release_timer, LCHAN_RELEASE_TIMEOUT); } while(0);
+ (con)->lchan->ts->trx->bts->nr, (con)->lchan->ts->trx->nr, (con)->lchan->ts->nr, \
+ (con)->lchan->nr, (con)->use_count); \
+ bsc_schedule_timer(&(con)->release_timer, LCHAN_RELEASE_TIMEOUT); } while(0);
-#define put_lchan(lchan) \
- do { lchan->use_count--; \
+#define put_subscr_con(con) \
+ do { (con)->use_count--; \
DEBUGP(DREF, "lchan (bts=%d,trx=%d,ts=%d,ch=%d) decreases usage to: %d\n", \
- lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, \
- lchan->nr, lchan->use_count); \
+ (con)->lchan->ts->trx->bts->nr, (con)->lchan->ts->trx->nr, (con)->lchan->ts->nr, \
+ (con)->lchan->nr, (con)->use_count); \
} while(0);
@@ -182,6 +182,29 @@ enum gsm_lchan_state {
LCHAN_S_INACTIVE, /* channel is set inactive */
};
+/* the per subscriber data for lchan */
+struct gsm_subscriber_connection {
+ /* To whom we are allocated at the moment */
+ struct gsm_subscriber *subscr;
+
+ /* Timer started to release the channel */
+ struct timer_list release_timer;
+
+ /*
+ * Operations that have a state and might be pending
+ */
+ struct gsm_loc_updating_operation *loc_operation;
+
+ /* use count. how many users use this channel */
+ unsigned int use_count;
+
+ /* Are we part of a special "silent" call */
+ int silent_call;
+
+ /* back pointer to the gsm_lchan */
+ struct gsm_lchan *lchan;
+};
+
struct gsm_lchan {
/* The TS that we're part of */
struct gsm_bts_trx_ts *ts;
@@ -204,31 +227,15 @@ struct gsm_lchan {
u_int8_t key_len;
u_int8_t key[MAX_A5_KEY_LEN];
} encr;
- /* Are we part of a special "silent" call */
- int silent_call;
+
+ struct timer_list T3101;
/* AMR bits */
struct gsm48_multi_rate_conf mr_conf;
- /* To whom we are allocated at the moment */
- struct gsm_subscriber *subscr;
-
- /* Timer started to release the channel */
- struct timer_list release_timer;
-
- struct timer_list T3101;
-
/* Established data link layer services */
u_int8_t sapis[8];
- /*
- * Operations that have a state and might be pending
- */
- struct gsm_loc_updating_operation *loc_operation;
-
- /* use count. how many users use this channel */
- unsigned int use_count;
-
/* cache of last measurement reports on this lchan */
struct gsm_meas_rep meas_rep[6];
int meas_rep_idx;
@@ -246,6 +253,8 @@ struct gsm_lchan {
u_int8_t speech_mode;
struct rtp_socket *rtp_socket;
} abis_ip;
+
+ struct gsm_subscriber_connection conn;
};
struct gsm_e1_subslot {