diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-01-16 09:57:06 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-01-16 09:57:06 +0100 |
commit | 53559b39e574d9c4d183d1b3eb6f55e694d8e3b8 (patch) | |
tree | daede66be59dac32a53c7aba4010b6f2ce6bf8ee /src/mtp_layer3.c | |
parent | 104280700a459163a03c647772ba40fa4dbdf8f6 (diff) |
mtp: Provide the method with the OPC and DPC
We want to submit on a link set but want to provide the OPC and
DPC of the callers choice.
Diffstat (limited to 'src/mtp_layer3.c')
-rw-r--r-- | src/mtp_layer3.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c index fb9d87f..d62440d 100644 --- a/src/mtp_layer3.c +++ b/src/mtp_layer3.c @@ -33,7 +33,7 @@ #include <string.h> -static int mtp_int_submit(struct mtp_link_set *set, int opc, int sls, int type, const uint8_t *data, unsigned int length); +static int mtp_int_submit(struct mtp_link_set *set, int opc, int dpc, int sls, int type, const uint8_t *data, unsigned int length); struct msgb *mtp_msg_alloc(struct mtp_link_set *set) { @@ -525,14 +525,14 @@ int mtp_link_set_submit_sccp_data(struct mtp_link_set *set, int sls, const uint8 } rate_ctr_inc(&set->ctrg->ctr[MTP_LSET_SCCP_OUT_MSG]); - return mtp_int_submit(set, set->sccp_opc, sls, MTP_SI_MNT_SCCP, data, length); + return mtp_int_submit(set, set->sccp_opc, set->dpc, sls, MTP_SI_MNT_SCCP, data, length); } int mtp_link_set_submit_isup_data(struct mtp_link_set *set, int sls, const uint8_t *data, unsigned int length) { rate_ctr_inc(&set->ctrg->ctr[MTP_LSET_ISUP_OUT_MSG]); - return mtp_int_submit(set, set->isup_opc, sls, MTP_SI_MNT_ISUP, data, length); + return mtp_int_submit(set, set->isup_opc, set->dpc, sls, MTP_SI_MNT_ISUP, data, length); } int mtp_link_set_send(struct mtp_link_set *set, struct msgb *msg) @@ -552,8 +552,9 @@ int mtp_link_set_send(struct mtp_link_set *set, struct msgb *msg) return 0; } -static int mtp_int_submit(struct mtp_link_set *set, int opc, int sls, int type, - const uint8_t *data, unsigned int length) +static int mtp_int_submit(struct mtp_link_set *set, int opc, int dpc, + int sls, int type, const uint8_t *data, + unsigned int length) { uint8_t *put_ptr; struct mtp_level_3_hdr *hdr; @@ -569,7 +570,7 @@ static int mtp_int_submit(struct mtp_link_set *set, int opc, int sls, int type, hdr = (struct mtp_level_3_hdr *) msg->l2h; hdr->ser_ind = type; - hdr->addr = MTP_ADDR(sls % 16, set->dpc, opc); + hdr->addr = MTP_ADDR(sls % 16, dpc, opc); /* copy the raw sccp data */ put_ptr = msgb_put(msg, length); |