aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gsm_subscriber.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-12-29 09:33:34 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-06 14:52:52 +0100
commit68c3bf6de887463eb5bbc94594f28b22ab2f349f (patch)
treefdadaa2fb4bca1e922f2e4fe48ce150ca2ba40f1 /openbsc/src/gsm_subscriber.c
parentc02b12086c365ed473e034b3363f1cf4ce5226c1 (diff)
subscr: Store the state of a subscr request for inspection.
Diffstat (limited to 'openbsc/src/gsm_subscriber.c')
-rw-r--r--openbsc/src/gsm_subscriber.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/openbsc/src/gsm_subscriber.c b/openbsc/src/gsm_subscriber.c
index ec639a93..9b8adeba 100644
--- a/openbsc/src/gsm_subscriber.c
+++ b/openbsc/src/gsm_subscriber.c
@@ -58,11 +58,22 @@ struct subscr_request {
/* the requested channel type */
int channel_type;
+ /* what did we do */
+ int state;
+
/* the callback data */
gsm_cbfn *cbfn;
void *param;
};
+enum {
+ REQ_STATE_INITIAL,
+ REQ_STATE_QUEUED,
+ REQ_STATE_PAGED,
+ REQ_STATE_FAILED_START,
+ REQ_STATE_DISPATCHED,
+};
+
/*
* We got the channel assigned and can now hand this channel
* over to one of our callbacks.
@@ -98,6 +109,7 @@ static int subscr_paging_dispatch(unsigned int hooknum, unsigned int event,
* the subscr_put_channel work as required...
*/
request = (struct subscr_request *)subscr->requests.next;
+ request->state = REQ_STATE_DISPATCHED;
llist_del(&request->entry);
subscr->in_callback = 1;
request->cbfn(hooknum, event, msg, data, request->param);
@@ -178,11 +190,13 @@ static void subscr_send_paging_request(struct gsm_subscriber *subscr)
assert(!llist_empty(&subscr->requests));
request = (struct subscr_request *)subscr->requests.next;
+ request->state = REQ_STATE_PAGED;
rc = paging_request(subscr->net, subscr, request->channel_type,
subscr_paging_cb, subscr);
/* paging failed, quit now */
if (rc <= 0) {
+ request->state = REQ_STATE_FAILED_START;
subscr_paging_cb(GSM_HOOK_RR_PAGING, GSM_PAGING_BUSY,
NULL, NULL, subscr);
}
@@ -206,6 +220,7 @@ void subscr_get_channel(struct gsm_subscriber *subscr,
request->channel_type = type;
request->cbfn = cbfn;
request->param = param;
+ request->state = REQ_STATE_INITIAL;
/*
* FIXME: We might be able to assign more than one
@@ -219,6 +234,7 @@ void subscr_get_channel(struct gsm_subscriber *subscr,
} else {
/* this will be picked up later, from subscr_put_channel */
llist_add_tail(&request->entry, &subscr->requests);
+ request->state = REQ_STATE_QUEUED;
}
}