mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 16:14:03 +00:00
bsc: Keep all active subscriber connections in a list.
This commit is contained in:
@@ -228,6 +228,8 @@ enum gsm_lchan_state {
|
|||||||
|
|
||||||
/* the per subscriber data for lchan */
|
/* the per subscriber data for lchan */
|
||||||
struct gsm_subscriber_connection {
|
struct gsm_subscriber_connection {
|
||||||
|
struct llist_head entry;
|
||||||
|
|
||||||
/* To whom we are allocated at the moment */
|
/* To whom we are allocated at the moment */
|
||||||
struct gsm_subscriber *subscr;
|
struct gsm_subscriber *subscr;
|
||||||
|
|
||||||
|
@@ -33,6 +33,8 @@
|
|||||||
|
|
||||||
#include <osmocore/talloc.h>
|
#include <osmocore/talloc.h>
|
||||||
|
|
||||||
|
static LLIST_HEAD(sub_connections);
|
||||||
|
|
||||||
static void rll_ind_cb(struct gsm_lchan *, uint8_t, void *, enum bsc_rllr_ind);
|
static void rll_ind_cb(struct gsm_lchan *, uint8_t, void *, enum bsc_rllr_ind);
|
||||||
static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id);
|
static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id);
|
||||||
|
|
||||||
@@ -48,6 +50,7 @@ struct gsm_subscriber_connection *subscr_con_allocate(struct gsm_lchan *lchan)
|
|||||||
conn->lchan = lchan;
|
conn->lchan = lchan;
|
||||||
conn->bts = lchan->ts->trx->bts;
|
conn->bts = lchan->ts->trx->bts;
|
||||||
lchan->conn = conn;
|
lchan->conn = conn;
|
||||||
|
llist_add_tail(&conn->entry, &sub_connections);
|
||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,6 +73,8 @@ void subscr_con_free(struct gsm_subscriber_connection *conn)
|
|||||||
if (conn->ho_lchan)
|
if (conn->ho_lchan)
|
||||||
LOGP(DNM, LOGL_ERROR, "The ho_lchan should have been cleared.\n");
|
LOGP(DNM, LOGL_ERROR, "The ho_lchan should have been cleared.\n");
|
||||||
|
|
||||||
|
llist_del(&conn->entry);
|
||||||
|
|
||||||
lchan = conn->lchan;
|
lchan = conn->lchan;
|
||||||
talloc_free(conn);
|
talloc_free(conn);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user