remove l1ctl data structure from l2_ph_data_ind()

This commit is contained in:
Harald Welte 2011-06-22 23:01:18 +02:00
parent f47de03fe1
commit 4d5f74375a
3 changed files with 8 additions and 11 deletions

View File

@ -98,7 +98,7 @@ void lapdm_entity_exit(struct lapdm_entity *le);
void lapdm_channel_exit(struct lapdm_channel *lc);
/* input into layer2 (from layer 1) */
int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, struct l1ctl_info_dl *l1i);
int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, uint8_t chan_nr, uint8_t link_id);
int l2_ph_data_conf(struct msgb *msg, struct lapdm_entity *le);
/* L1 confirms channel request */

View File

@ -130,7 +130,7 @@ static int rx_l1_rach_conf(struct osmocom_ms *ms, struct msgb *msg)
/* Receive L1CTL_DATA_IND (Data Indication from L1) */
static int rx_ph_data_ind(struct osmocom_ms *ms, struct msgb *msg)
{
struct l1ctl_info_dl *dl, dl_cpy;
struct l1ctl_info_dl *dl;
struct l1ctl_data_ind *ccch;
struct lapdm_entity *le;
struct rx_meas_stat *meas = &ms->meas;
@ -225,16 +225,13 @@ printf("Dropping frame with %u bit errors\n", dl->num_biterr);
le = &ms->lapdm_channel.lapdm_acch;
else
le = &ms->lapdm_channel.lapdm_dcch;
/* make local stack copy of l1ctl_info_dl, as LAPDm will
* overwrite skb hdr */
memcpy(&dl_cpy, dl, sizeof(dl_cpy));
/* pull the L1 header from the msgb */
msgb_pull(msg, msg->l2h - (msg->l1h-sizeof(struct l1ctl_hdr)));
msg->l1h = NULL;
/* send it up into LAPDm */
l2_ph_data_ind(msg, le, &dl_cpy);
l2_ph_data_ind(msg, le, dl->chan_nr, dl->link_id);
return 0;
}

View File

@ -1513,10 +1513,10 @@ static int lapdm_ph_data_ind(struct msgb *msg, struct lapdm_msg_ctx *mctx)
}
/* input into layer2 (from layer 1) */
int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, struct l1ctl_info_dl *l1i)
int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, uint8_t chan_nr, uint8_t link_id)
{
uint8_t cbits = l1i->chan_nr >> 3;
uint8_t sapi = l1i->link_id & 7;
uint8_t cbits = chan_nr >> 3;
uint8_t sapi = link_id & 7;
struct lapdm_msg_ctx mctx;
int rc = 0;
@ -1524,8 +1524,8 @@ int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, struct l1ctl_info_
* 23byte mac block. The l1h has already been purged. */
mctx.dl = datalink_for_sapi(le, sapi);
mctx.chan_nr = l1i->chan_nr;
mctx.link_id = l1i->link_id;
mctx.chan_nr = chan_nr;
mctx.link_id = link_id;
mctx.addr = mctx.ctrl = 0;
/* G.2.1 No action schall be taken on frames containing an unallocated