respect the link_id, not only the SAPI from SMS code
SMS related messages are all sent over SAPI=3. But in addition to that, we also need to send it over the correct link identifier, i.e. SACCH or main signalling channel
This commit is contained in:
parent
c89a511616
commit
daef606502
|
@ -691,7 +691,7 @@ struct gsm_trans;
|
||||||
void gsm0408_allow_everyone(int allow);
|
void gsm0408_allow_everyone(int allow);
|
||||||
void gsm0408_set_reject_cause(int cause);
|
void gsm0408_set_reject_cause(int cause);
|
||||||
|
|
||||||
int gsm0408_rcvmsg(struct msgb *msg);
|
int gsm0408_rcvmsg(struct msgb *msg, u_int8_t link_id);
|
||||||
void gsm0408_generate_lai(struct gsm48_loc_area_id *lai48, u_int16_t mcc,
|
void gsm0408_generate_lai(struct gsm48_loc_area_id *lai48, u_int16_t mcc,
|
||||||
u_int16_t mnc, u_int16_t lac);
|
u_int16_t mnc, u_int16_t lac);
|
||||||
enum gsm_chan_t get_ctype_by_chreq(struct gsm_bts *bts, u_int8_t ra);
|
enum gsm_chan_t get_ctype_by_chreq(struct gsm_bts *bts, u_int8_t ra);
|
||||||
|
|
|
@ -203,7 +203,7 @@ struct sms_deliver {
|
||||||
|
|
||||||
struct msgb;
|
struct msgb;
|
||||||
|
|
||||||
int gsm0411_rcv_sms(struct msgb *msg);
|
int gsm0411_rcv_sms(struct msgb *msg, u_int8_t link_id);
|
||||||
|
|
||||||
int gsm411_send_sms_lchan(struct gsm_lchan *lchan, struct gsm_sms *sms);
|
int gsm411_send_sms_lchan(struct gsm_lchan *lchan, struct gsm_sms *sms);
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ struct gsm_trans {
|
||||||
struct gsm_mncc msg; /* stores setup/disconnect/release message */
|
struct gsm_mncc msg; /* stores setup/disconnect/release message */
|
||||||
} cc;
|
} cc;
|
||||||
struct {
|
struct {
|
||||||
|
u_int8_t link_id; /* RSL Link ID to be used for this trans */
|
||||||
int is_mt; /* is this a MO (0) or MT (1) transfer */
|
int is_mt; /* is this a MO (0) or MT (1) transfer */
|
||||||
enum gsm411_cp_state cp_state;
|
enum gsm411_cp_state cp_state;
|
||||||
struct timer_list cp_timer;
|
struct timer_list cp_timer;
|
||||||
|
|
|
@ -923,7 +923,7 @@ static int rsl_rx_meas_res(struct msgb *msg)
|
||||||
if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) {
|
if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) {
|
||||||
DEBUGPC(DMEAS, "L3\n");
|
DEBUGPC(DMEAS, "L3\n");
|
||||||
msg->l3h = TLVP_VAL(&tp, RSL_IE_L3_INFO);
|
msg->l3h = TLVP_VAL(&tp, RSL_IE_L3_INFO);
|
||||||
return gsm0408_rcvmsg(msg);
|
return gsm0408_rcvmsg(msg, 0);
|
||||||
} else
|
} else
|
||||||
DEBUGPC(DMEAS, "\n");
|
DEBUGPC(DMEAS, "\n");
|
||||||
|
|
||||||
|
@ -1206,10 +1206,12 @@ static int abis_rsl_rx_rll(struct msgb *msg)
|
||||||
struct abis_rsl_rll_hdr *rllh = msgb_l2(msg);
|
struct abis_rsl_rll_hdr *rllh = msgb_l2(msg);
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
char *ts_name;
|
char *ts_name;
|
||||||
|
u_int8_t sapi = rllh->link_id & 7;
|
||||||
|
|
||||||
msg->lchan = lchan_lookup(msg->trx, rllh->chan_nr);
|
msg->lchan = lchan_lookup(msg->trx, rllh->chan_nr);
|
||||||
ts_name = gsm_ts_name(msg->lchan->ts);
|
ts_name = gsm_ts_name(msg->lchan->ts);
|
||||||
DEBUGP(DRLL, "channel=%s chan_nr=0x%02x ", ts_name, rllh->chan_nr);
|
DEBUGP(DRLL, "channel=%s chan_nr=0x%02x sapi=%u ", ts_name,
|
||||||
|
rllh->chan_nr, sapi);
|
||||||
|
|
||||||
switch (rllh->c.msg_type) {
|
switch (rllh->c.msg_type) {
|
||||||
case RSL_MT_DATA_IND:
|
case RSL_MT_DATA_IND:
|
||||||
|
@ -1218,7 +1220,7 @@ static int abis_rsl_rx_rll(struct msgb *msg)
|
||||||
sizeof(struct abis_rsl_common_hdr) + sizeof(*rllh) &&
|
sizeof(struct abis_rsl_common_hdr) + sizeof(*rllh) &&
|
||||||
rllh->data[0] == RSL_IE_L3_INFO) {
|
rllh->data[0] == RSL_IE_L3_INFO) {
|
||||||
msg->l3h = &rllh->data[3];
|
msg->l3h = &rllh->data[3];
|
||||||
return gsm0408_rcvmsg(msg);
|
return gsm0408_rcvmsg(msg, rllh->link_id);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RSL_MT_EST_IND:
|
case RSL_MT_EST_IND:
|
||||||
|
@ -1229,7 +1231,7 @@ static int abis_rsl_rx_rll(struct msgb *msg)
|
||||||
sizeof(struct abis_rsl_common_hdr) + sizeof(*rllh) &&
|
sizeof(struct abis_rsl_common_hdr) + sizeof(*rllh) &&
|
||||||
rllh->data[0] == RSL_IE_L3_INFO) {
|
rllh->data[0] == RSL_IE_L3_INFO) {
|
||||||
msg->l3h = &rllh->data[3];
|
msg->l3h = &rllh->data[3];
|
||||||
return gsm0408_rcvmsg(msg);
|
return gsm0408_rcvmsg(msg, rllh->link_id);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RSL_MT_EST_CONF:
|
case RSL_MT_EST_CONF:
|
||||||
|
|
|
@ -3745,7 +3745,7 @@ static int gsm0408_rcv_cc(struct msgb *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* here we pass in a msgb from the RSL->RLL. We expect the l3 pointer to be set */
|
/* here we pass in a msgb from the RSL->RLL. We expect the l3 pointer to be set */
|
||||||
int gsm0408_rcvmsg(struct msgb *msg)
|
int gsm0408_rcvmsg(struct msgb *msg, u_int8_t link_id)
|
||||||
{
|
{
|
||||||
struct gsm48_hdr *gh = msgb_l3(msg);
|
struct gsm48_hdr *gh = msgb_l3(msg);
|
||||||
u_int8_t pdisc = gh->proto_discr & 0x0f;
|
u_int8_t pdisc = gh->proto_discr & 0x0f;
|
||||||
|
@ -3762,7 +3762,7 @@ int gsm0408_rcvmsg(struct msgb *msg)
|
||||||
rc = gsm0408_rcv_rr(msg);
|
rc = gsm0408_rcv_rr(msg);
|
||||||
break;
|
break;
|
||||||
case GSM48_PDISC_SMS:
|
case GSM48_PDISC_SMS:
|
||||||
rc = gsm0411_rcv_sms(msg);
|
rc = gsm0411_rcv_sms(msg, link_id);
|
||||||
break;
|
break;
|
||||||
case GSM48_PDISC_MM_GPRS:
|
case GSM48_PDISC_MM_GPRS:
|
||||||
case GSM48_PDISC_SM_GPRS:
|
case GSM48_PDISC_SM_GPRS:
|
||||||
|
|
|
@ -139,7 +139,7 @@ struct msgb *gsm411_msgb_alloc(void)
|
||||||
"GSM 04.11");
|
"GSM 04.11");
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gsm411_sendmsg(struct msgb *msg)
|
static int gsm411_sendmsg(struct msgb *msg, u_int8_t link_id)
|
||||||
{
|
{
|
||||||
if (msg->lchan)
|
if (msg->lchan)
|
||||||
msg->trx = msg->lchan->ts->trx;
|
msg->trx = msg->lchan->ts->trx;
|
||||||
|
@ -148,7 +148,7 @@ static int gsm411_sendmsg(struct msgb *msg)
|
||||||
|
|
||||||
DEBUGP(DSMS, "GSM4.11 TX %s\n", hexdump(msg->data, msg->len));
|
DEBUGP(DSMS, "GSM4.11 TX %s\n", hexdump(msg->data, msg->len));
|
||||||
|
|
||||||
return rsl_data_request(msg, UM_SAPI_SMS);
|
return rsl_data_request(msg, link_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* SMC TC1* is expired */
|
/* SMC TC1* is expired */
|
||||||
|
@ -197,7 +197,7 @@ static int gsm411_cp_sendmsg(struct msgb *msg, struct gsm_trans *trans,
|
||||||
|
|
||||||
DEBUGPC(DSMS, "trans=%x\n", trans->transaction_id);
|
DEBUGPC(DSMS, "trans=%x\n", trans->transaction_id);
|
||||||
|
|
||||||
return gsm411_sendmsg(msg);
|
return gsm411_sendmsg(msg, trans->sms.link_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prefix msg with a RP-DATA header and send as CP-DATA */
|
/* Prefix msg with a RP-DATA header and send as CP-DATA */
|
||||||
|
@ -645,7 +645,7 @@ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans,
|
||||||
if (sms)
|
if (sms)
|
||||||
gsm411_send_sms_lchan(msg->lchan, sms);
|
gsm411_send_sms_lchan(msg->lchan, sms);
|
||||||
else
|
else
|
||||||
rsl_release_request(msg->lchan, UM_SAPI_SMS);
|
rsl_release_request(msg->lchan, trans->sms.link_id);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -710,7 +710,7 @@ static int gsm411_rx_rp_smma(struct msgb *msg, struct gsm_trans *trans,
|
||||||
if (sms)
|
if (sms)
|
||||||
gsm411_send_sms_lchan(msg->lchan, sms);
|
gsm411_send_sms_lchan(msg->lchan, sms);
|
||||||
else
|
else
|
||||||
rsl_release_request(msg->lchan, UM_SAPI_SMS);
|
rsl_release_request(msg->lchan, trans->sms.link_id);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -784,7 +784,7 @@ static int gsm411_tx_cp_error(struct gsm_trans *trans, u_int8_t cause)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Entry point for incoming GSM48_PDISC_SMS from abis_rsl.c */
|
/* Entry point for incoming GSM48_PDISC_SMS from abis_rsl.c */
|
||||||
int gsm0411_rcv_sms(struct msgb *msg)
|
int gsm0411_rcv_sms(struct msgb *msg, u_int8_t link_id)
|
||||||
{
|
{
|
||||||
struct gsm48_hdr *gh = msgb_l3(msg);
|
struct gsm48_hdr *gh = msgb_l3(msg);
|
||||||
u_int8_t msg_type = gh->msg_type;
|
u_int8_t msg_type = gh->msg_type;
|
||||||
|
@ -812,6 +812,7 @@ int gsm0411_rcv_sms(struct msgb *msg)
|
||||||
trans->sms.cp_state = GSM411_CPS_IDLE;
|
trans->sms.cp_state = GSM411_CPS_IDLE;
|
||||||
trans->sms.rp_state = GSM411_RPS_IDLE;
|
trans->sms.rp_state = GSM411_RPS_IDLE;
|
||||||
trans->sms.is_mt = 0;
|
trans->sms.is_mt = 0;
|
||||||
|
trans->sms.link_id = link_id;
|
||||||
|
|
||||||
trans->lchan = lchan;
|
trans->lchan = lchan;
|
||||||
use_lchan(lchan);
|
use_lchan(lchan);
|
||||||
|
@ -826,12 +827,17 @@ int gsm0411_rcv_sms(struct msgb *msg)
|
||||||
* CP-DATA, including sending of the assoc. CP-ACK */
|
* CP-DATA, including sending of the assoc. CP-ACK */
|
||||||
trans->sms.cp_state = GSM411_CPS_MM_ESTABLISHED;
|
trans->sms.cp_state = GSM411_CPS_MM_ESTABLISHED;
|
||||||
|
|
||||||
|
/* SMC instance acknowledges the CP-DATA frame */
|
||||||
|
gsm411_tx_cp_ack(trans);
|
||||||
|
|
||||||
rc = gsm411_rx_cp_data(msg, gh, trans);
|
rc = gsm411_rx_cp_data(msg, gh, trans);
|
||||||
|
#if 0
|
||||||
/* Send CP-ACK or CP-ERORR in response */
|
/* Send CP-ACK or CP-ERORR in response */
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
rc = gsm411_tx_cp_error(trans, GSM411_CP_CAUSE_NET_FAIL);
|
rc = gsm411_tx_cp_error(trans, GSM411_CP_CAUSE_NET_FAIL);
|
||||||
} else
|
} else
|
||||||
rc = gsm411_tx_cp_ack(trans);
|
rc = gsm411_tx_cp_ack(trans);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case GSM411_MT_CP_ACK:
|
case GSM411_MT_CP_ACK:
|
||||||
/* previous CP-DATA in this transaction was confirmed */
|
/* previous CP-DATA in this transaction was confirmed */
|
||||||
|
@ -908,6 +914,7 @@ int gsm411_send_sms_lchan(struct gsm_lchan *lchan, struct gsm_sms *sms)
|
||||||
trans->sms.rp_state = GSM411_RPS_IDLE;
|
trans->sms.rp_state = GSM411_RPS_IDLE;
|
||||||
trans->sms.is_mt = 1;
|
trans->sms.is_mt = 1;
|
||||||
trans->sms.sms = sms;
|
trans->sms.sms = sms;
|
||||||
|
trans->sms.link_id = UM_SAPI_SMS; /* FIXME: main or SACCH ? */
|
||||||
|
|
||||||
trans->lchan = lchan;
|
trans->lchan = lchan;
|
||||||
use_lchan(lchan);
|
use_lchan(lchan);
|
||||||
|
|
Loading…
Reference in New Issue