mirror of https://gerrit.osmocom.org/libosmocore
lapdm: Make lapdm_datalink_for_sapi public
This API allows you to get the lapdm_datalink for a SAPI. It's needed in the lapdm_test, so make it public.
This commit is contained in:
parent
e4c50d5a43
commit
55405fb40b
|
@ -81,6 +81,8 @@ struct lapdm_channel {
|
||||||
const char *get_rsl_name(int value);
|
const char *get_rsl_name(int value);
|
||||||
extern const char *lapdm_state_names[];
|
extern const char *lapdm_state_names[];
|
||||||
|
|
||||||
|
struct lapdm_datalink *lapdm_datalink_for_sapi(struct lapdm_entity *le, uint8_t sapi);
|
||||||
|
|
||||||
/* initialize a LAPDm entity */
|
/* initialize a LAPDm entity */
|
||||||
void lapdm_entity_init(struct lapdm_entity *le, enum lapdm_mode mode, int t200);
|
void lapdm_entity_init(struct lapdm_entity *le, enum lapdm_mode mode, int t200);
|
||||||
void lapdm_channel_init(struct lapdm_channel *lc, enum lapdm_mode mode);
|
void lapdm_channel_init(struct lapdm_channel *lc, enum lapdm_mode mode);
|
||||||
|
|
|
@ -181,7 +181,7 @@ void lapdm_channel_exit(struct lapdm_channel *lc)
|
||||||
lapdm_entity_exit(&lc->lapdm_dcch);
|
lapdm_entity_exit(&lc->lapdm_dcch);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct lapdm_datalink *datalink_for_sapi(struct lapdm_entity *le, uint8_t sapi)
|
struct lapdm_datalink *lapdm_datalink_for_sapi(struct lapdm_entity *le, uint8_t sapi)
|
||||||
{
|
{
|
||||||
switch (sapi) {
|
switch (sapi) {
|
||||||
case LAPDm_SAPI_NORMAL:
|
case LAPDm_SAPI_NORMAL:
|
||||||
|
@ -543,7 +543,7 @@ static int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mctx.dl = datalink_for_sapi(le, sapi);
|
mctx.dl = lapdm_datalink_for_sapi(le, sapi);
|
||||||
/* G.2.1 No action on frames containing an unallocated SAPI. */
|
/* G.2.1 No action on frames containing an unallocated SAPI. */
|
||||||
if (!mctx.dl) {
|
if (!mctx.dl) {
|
||||||
LOGP(DLLAPD, LOGL_NOTICE, "Received frame for unsupported "
|
LOGP(DLLAPD, LOGL_NOTICE, "Received frame for unsupported "
|
||||||
|
@ -1071,7 +1071,7 @@ static int rslms_rx_rll(struct msgb *msg, struct lapdm_channel *lc)
|
||||||
/* G.2.1 No action shall be taken on frames containing an unallocated
|
/* G.2.1 No action shall be taken on frames containing an unallocated
|
||||||
* SAPI.
|
* SAPI.
|
||||||
*/
|
*/
|
||||||
dl = datalink_for_sapi(le, sapi);
|
dl = lapdm_datalink_for_sapi(le, sapi);
|
||||||
if (!dl) {
|
if (!dl) {
|
||||||
LOGP(DLLAPD, LOGL_ERROR, "No instance for SAPI %d!\n", sapi);
|
LOGP(DLLAPD, LOGL_ERROR, "No instance for SAPI %d!\n", sapi);
|
||||||
msgb_free(msg);
|
msgb_free(msg);
|
||||||
|
|
|
@ -172,6 +172,7 @@ lapdm_channel_set_flags;
|
||||||
lapdm_channel_set_l1;
|
lapdm_channel_set_l1;
|
||||||
lapdm_channel_set_l3;
|
lapdm_channel_set_l3;
|
||||||
lapdm_channel_set_mode;
|
lapdm_channel_set_mode;
|
||||||
|
lapdm_datalink_for_sapi;
|
||||||
lapdm_entity_exit;
|
lapdm_entity_exit;
|
||||||
lapdm_entity_init;
|
lapdm_entity_init;
|
||||||
lapdm_entity_reset;
|
lapdm_entity_reset;
|
||||||
|
|
Loading…
Reference in New Issue