dect
/
libdect
Archived
13
0
Fork 0

lce: move protocol registration to dect_lce_init

Perform protocol initialization outside of __init functions to avoid
multiple registration with threaded library users.

Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
Patrick McHardy 2010-09-03 12:18:20 +02:00
parent f5c9434230
commit 20d309fc70
9 changed files with 18 additions and 25 deletions

View File

@ -337,4 +337,6 @@ struct dect_call {
#define DECT_CC_SETUP_TIMEOUT 20 /* seconds */
extern const struct dect_nwk_protocol dect_cc_protocol;
#endif /* _LIBDECT_CC_H */

View File

@ -70,4 +70,6 @@ enum dect_clms_protocol_discriminators {
extern void dect_clms_rcv_fixed(struct dect_handle *dh, struct dect_msg_buf *mb);
extern const struct dect_nwk_protocol dect_clms_protocol;
#endif /* _LIBDECT_CLMS_H */

View File

@ -376,4 +376,6 @@ struct dect_mm_endpoint {
uint8_t priv[] __aligned(__alignof__(uint64_t));
};
extern const struct dect_nwk_protocol dect_mm_protocol;
#endif /* _LIBDECT_MM_H */

View File

@ -78,4 +78,6 @@ enum dect_crss_msg_types {
CRSS_FACILITY = 0x62,
};
extern const struct dect_nwk_protocol dect_ciss_protocol;
#endif /* _LIBDECT_SS_H */

View File

@ -1608,7 +1608,7 @@ static void dect_cc_shutdown(struct dect_handle *dh,
dect_call_destroy(dh, call);
}
static const struct dect_nwk_protocol cc_protocol = {
const struct dect_nwk_protocol dect_cc_protocol = {
.name = "Call Control",
.pd = DECT_PD_CC,
.max_transactions = 7,
@ -1617,9 +1617,4 @@ static const struct dect_nwk_protocol cc_protocol = {
.rcv = dect_cc_rcv,
};
static void __init dect_cc_init(void)
{
dect_lce_register_protocol(&cc_protocol);
}
/** @} */

View File

@ -216,16 +216,11 @@ static void dect_clms_open(struct dect_handle *dh,
}
}
static const struct dect_nwk_protocol clms_protocol = {
const struct dect_nwk_protocol dect_clms_protocol = {
.name = "ConnectionLess Message Service",
.pd = DECT_PD_CLMS,
.max_transactions = 1,
.open = dect_clms_open,
};
static void __init dect_clms_init(void)
{
dect_lce_register_protocol(&clms_protocol);
}
/** @} */

View File

@ -35,6 +35,8 @@
#include <b_fmt.h>
#include <clms.h>
#include <lce.h>
#include <cc.h>
#include <mm.h>
#include <ss.h>
#include <dect/auth.h>
@ -1499,6 +1501,10 @@ int dect_lce_init(struct dect_handle *dh)
}
dect_lce_register_protocol(&lce_protocol);
dect_lce_register_protocol(&dect_cc_protocol);
dect_lce_register_protocol(&dect_ciss_protocol);
dect_lce_register_protocol(&dect_clms_protocol);
dect_lce_register_protocol(&dect_mm_protocol);
return 0;
err4:

View File

@ -3317,7 +3317,7 @@ static void dect_mm_shutdown(struct dect_handle *dh,
proc->abort(dh, mme, mp);
}
static const struct dect_nwk_protocol mm_protocol = {
const struct dect_nwk_protocol dect_mm_protocol = {
.name = "Mobility Management",
.pd = DECT_PD_MM,
.max_transactions = 1,
@ -3327,9 +3327,4 @@ static const struct dect_nwk_protocol mm_protocol = {
.encrypt_ind = dect_mm_encrypt_ind,
};
static void __init dect_mm_init(void)
{
dect_lce_register_protocol(&mm_protocol);
}
/** @} */

View File

@ -355,7 +355,7 @@ static void dect_ciss_shutdown(struct dect_handle *dh,
dect_transaction_close(dh, &sse->transaction, DECT_DDL_RELEASE_NORMAL);
}
static const struct dect_nwk_protocol ciss_protocol = {
const struct dect_nwk_protocol dect_ciss_protocol = {
.name = "Call Independant Supplementary Services",
.pd = DECT_PD_CISS,
.max_transactions = 7,
@ -364,9 +364,3 @@ static const struct dect_nwk_protocol ciss_protocol = {
.rcv = dect_ciss_rcv,
};
static void __init dect_ciss_init(void)
{
dect_lce_register_protocol(&ciss_protocol);
}
/** @} */