aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-02 20:24:08 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-17 11:21:11 +0100
commitc8405692b381e4079eeaf52f38610a6a24f64773 (patch)
tree1e60aff422dfe1dd703f2b0eecb7230e401faa1d /src/main.c
parent569f1e171df2f055d0be5fc637e050a523a9ae8a (diff)
mtp: Propagate link and linkset failures in two stages
Handle a single link failure in links.c and if all the links have failed propagate it up. This is preparing the multiple links support.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/main.c b/src/main.c
index c764cc2..7a66cd8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,7 +1,7 @@
/* Bloated main routine, refactor */
/*
- * (C) 2010 by Holger Hans Peter Freyther <zecke@selfish.org>
- * (C) 2010 by On-Waves
+ * (C) 2010-2011 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2010-2011 by On-Waves
* All Rights Reserved
*
* This program is free software: you can redistribute it and/or modify
@@ -284,34 +284,28 @@ void release_bsc_resources(struct bsc_data *bsc)
}
}
-void bsc_link_down(struct link_data *data)
+void mtp_linkset_down(struct mtp_link_set *set)
{
- int was_up;
- struct mtp_link_set *link = data->the_link;
-
- link->available = 0;
- was_up = link->sccp_up;
- mtp_link_set_stop(link);
- clear_connections(data->bsc);
- mgcp_reset(data->bsc);
-
- data->clear_queue(data);
+ set->available = 0;
+ mtp_link_set_stop(set);
+ clear_connections(set->bsc);
+ mgcp_reset(set->bsc);
/* If we have an A link send a reset to the MSC */
- msc_send_reset(data->bsc);
+ msc_send_reset(set->bsc);
}
-void bsc_link_up(struct link_data *data)
+void mtp_linkset_up(struct mtp_link_set *set)
{
- data->the_link->available = 1;
+ set->available = 1;
/* we have not gone through link down */
- if (data->bsc->msc_link_down) {
- clear_connections(data->bsc);
- bsc_resources_released(data->bsc);
+ if (set->bsc->msc_link_down) {
+ clear_connections(set->bsc);
+ bsc_resources_released(set->bsc);
}
- mtp_link_set_reset(data->the_link);
+ mtp_link_set_reset(set);
}
/**