Move v5x_le_pstn_fsm.h to src/v5x_le_pstn_fsm.h
Also changed serveral names of functions/structures/defintions.
This commit is contained in:
parent
1031d5e3e6
commit
c7be79b668
|
@ -34,8 +34,8 @@
|
|||
|
||||
#include "v5x_internal.h"
|
||||
#include "v5x_protocol.h"
|
||||
#include "v5x_l2_mgmt.h"
|
||||
#include "v5x_le_pstn_fsm.h"
|
||||
#include "v5x_le_management.h"
|
||||
#include "logging.h"
|
||||
|
||||
/* Table 28/G.964 Timers in the LE */
|
||||
|
@ -124,15 +124,15 @@ static const struct value_string v5x_ctrl_le_port_fsm_event_names[] = {
|
|||
/* G.964 Section 13.3.1 / Table 5 */
|
||||
static struct msgb *v5x_enc_establish(struct v5x_user_port *v5up, uint8_t *cond_ie, uint8_t cond_len)
|
||||
{
|
||||
struct v51_l3_hdr *l3h;
|
||||
struct v5x_l3_hdr *l3h;
|
||||
struct msgb *msg = msgb_alloc_v5x();
|
||||
if (!msg)
|
||||
return NULL;
|
||||
|
||||
l3h = (struct v51_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V51_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v51_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V51_CTRL_MSGT_ESTABLISH;
|
||||
l3h = (struct v5x_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V5X_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v5x_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V5X_CTRL_MSGT_ESTABLISH;
|
||||
|
||||
/* optional conditional IE */
|
||||
if (cond_ie && cond_len)
|
||||
|
@ -144,15 +144,15 @@ static struct msgb *v5x_enc_establish(struct v5x_user_port *v5up, uint8_t *cond_
|
|||
/* G.964 Section 13.3.1 / Table 6 */
|
||||
static struct msgb *v5x_enc_establish_ack(struct v5x_user_port *v5up, uint8_t *cond_ie, uint8_t cond_len)
|
||||
{
|
||||
struct v51_l3_hdr *l3h;
|
||||
struct v5x_l3_hdr *l3h;
|
||||
struct msgb *msg = msgb_alloc_v5x();
|
||||
if (!msg)
|
||||
return NULL;
|
||||
|
||||
l3h = (struct v51_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V51_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v51_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V51_CTRL_MSGT_ESTABLISH_ACK;
|
||||
l3h = (struct v5x_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V5X_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v5x_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V5X_CTRL_MSGT_ESTABLISH_ACK;
|
||||
|
||||
/* optional conditional IE */
|
||||
if (cond_ie && cond_len)
|
||||
|
@ -165,18 +165,18 @@ static struct msgb *v5x_enc_establish_ack(struct v5x_user_port *v5up, uint8_t *c
|
|||
static struct msgb *v5x_enc_signal(struct v5x_user_port *v5up, uint8_t seq_nr, uint8_t *cond_ie, uint8_t cond_len)
|
||||
{
|
||||
uint8_t seq_ie = seq_nr | 0x80;
|
||||
struct v51_l3_hdr *l3h;
|
||||
struct v5x_l3_hdr *l3h;
|
||||
struct msgb *msg = msgb_alloc_v5x();
|
||||
if (!msg)
|
||||
return NULL;
|
||||
|
||||
l3h = (struct v51_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V51_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v51_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V51_CTRL_MSGT_SIGNAL;
|
||||
l3h = (struct v5x_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V5X_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v5x_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V5X_CTRL_MSGT_SIGNAL;
|
||||
|
||||
/* Sequence-number */
|
||||
msgb_tlv_put(msg, V51_CTRL_IEI_SEQUENCE_NR, 1, &seq_ie);
|
||||
msgb_tlv_put(msg, V5X_CTRL_IEI_SEQUENCE_NR, 1, &seq_ie);
|
||||
/* manatory conditional IE */
|
||||
OSMO_ASSERT(cond_ie && cond_len);
|
||||
memcpy(msgb_put(msg, cond_len), cond_ie, cond_len);
|
||||
|
@ -188,18 +188,18 @@ static struct msgb *v5x_enc_signal(struct v5x_user_port *v5up, uint8_t seq_nr, u
|
|||
static struct msgb *v5x_enc_signal_ack(struct v5x_user_port *v5up, uint8_t seq_nr)
|
||||
{
|
||||
uint8_t seq_ie = seq_nr | 0x80;
|
||||
struct v51_l3_hdr *l3h;
|
||||
struct v5x_l3_hdr *l3h;
|
||||
struct msgb *msg = msgb_alloc_v5x();
|
||||
if (!msg)
|
||||
return NULL;
|
||||
|
||||
l3h = (struct v51_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V51_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v51_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V51_CTRL_MSGT_SIGNAL_ACK;
|
||||
l3h = (struct v5x_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V5X_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v5x_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V5X_CTRL_MSGT_SIGNAL_ACK;
|
||||
|
||||
/* Sequence-number */
|
||||
msgb_tlv_put(msg, V51_CTRL_IEI_SEQUENCE_NR, 1, &seq_ie);
|
||||
msgb_tlv_put(msg, V5X_CTRL_IEI_SEQUENCE_NR, 1, &seq_ie);
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
@ -207,15 +207,15 @@ static struct msgb *v5x_enc_signal_ack(struct v5x_user_port *v5up, uint8_t seq_n
|
|||
/* G.964 Section 13.3.1 / Table 10 */
|
||||
static struct msgb *v5x_enc_status_enquiry(struct v5x_user_port *v5up)
|
||||
{
|
||||
struct v51_l3_hdr *l3h;
|
||||
struct v5x_l3_hdr *l3h;
|
||||
struct msgb *msg = msgb_alloc_v5x();
|
||||
if (!msg)
|
||||
return NULL;
|
||||
|
||||
l3h = (struct v51_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V51_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v51_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V51_CTRL_MSGT_STATUS_ENQUIRY;
|
||||
l3h = (struct v5x_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V5X_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v5x_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V5X_CTRL_MSGT_STATUS_ENQUIRY;
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
@ -223,15 +223,15 @@ static struct msgb *v5x_enc_status_enquiry(struct v5x_user_port *v5up)
|
|||
/* G.964 Section 13.3.1 / Table 11 */
|
||||
static struct msgb *v5x_enc_disconnect(struct v5x_user_port *v5up, uint8_t *steady_ie, uint8_t steady_len)
|
||||
{
|
||||
struct v51_l3_hdr *l3h;
|
||||
struct v5x_l3_hdr *l3h;
|
||||
struct msgb *msg = msgb_alloc_v5x();
|
||||
if (!msg)
|
||||
return NULL;
|
||||
|
||||
l3h = (struct v51_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V51_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v51_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V51_CTRL_MSGT_DISCONNECT;
|
||||
l3h = (struct v5x_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V5X_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v5x_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V5X_CTRL_MSGT_DISCONNECT;
|
||||
|
||||
/* optional conditional IE */
|
||||
if (steady_ie && steady_len)
|
||||
|
@ -243,15 +243,15 @@ static struct msgb *v5x_enc_disconnect(struct v5x_user_port *v5up, uint8_t *stea
|
|||
/* G.964 Section 13.3.1 / Table 12 */
|
||||
static struct msgb *v5x_enc_disconnect_compl(struct v5x_user_port *v5up, uint8_t *steady_ie, uint8_t steady_len)
|
||||
{
|
||||
struct v51_l3_hdr *l3h;
|
||||
struct v5x_l3_hdr *l3h;
|
||||
struct msgb *msg = msgb_alloc_v5x();
|
||||
if (!msg)
|
||||
return NULL;
|
||||
|
||||
l3h = (struct v51_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V51_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v51_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V51_CTRL_MSGT_DISCONNECT_COMPLETE;
|
||||
l3h = (struct v5x_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V5X_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v5x_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V5X_CTRL_MSGT_DISCONNECT_COMPLETE;
|
||||
|
||||
/* optional conditional IE */
|
||||
if (steady_ie && steady_len)
|
||||
|
@ -264,18 +264,18 @@ static struct msgb *v5x_enc_disconnect_compl(struct v5x_user_port *v5up, uint8_t
|
|||
static struct msgb *v5x_enc_protocol_param(struct v5x_user_port *v5up, uint8_t seq_nr, uint8_t *cond_ie, uint8_t cond_len)
|
||||
{
|
||||
uint8_t seq_ie = seq_nr | 0x80;
|
||||
struct v51_l3_hdr *l3h;
|
||||
struct v5x_l3_hdr *l3h;
|
||||
struct msgb *msg = msgb_alloc_v5x();
|
||||
if (!msg)
|
||||
return NULL;
|
||||
|
||||
l3h = (struct v51_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V51_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v51_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V51_CTRL_MSGT_PROTOCOL_PARAMETER;
|
||||
l3h = (struct v5x_l3_hdr *) msgb_put(msg, sizeof(*l3h));
|
||||
l3h->pdisc = V5X_CTRL_PDISC;
|
||||
l3h->l3_addr = ntohs(v5x_l3_addr_enc(v5up->nr, false));
|
||||
l3h->msg_type = V5X_CTRL_MSGT_PROTOCOL_PARAMETER;
|
||||
|
||||
/* Sequence-number */
|
||||
msgb_tlv_put(msg, V51_CTRL_IEI_SEQUENCE_NR, 1, &seq_ie);
|
||||
msgb_tlv_put(msg, V5X_CTRL_IEI_SEQUENCE_NR, 1, &seq_ie);
|
||||
/* manatory conditional IE */
|
||||
OSMO_ASSERT(cond_ie && cond_len);
|
||||
memcpy(msgb_put(msg, cond_len), cond_ie, cond_len);
|
||||
|
@ -299,47 +299,47 @@ static void rcv_fe(struct osmo_fsm_inst *fi, enum v5x_fe_prim prim, const struct
|
|||
/* add IE, if tp was given */
|
||||
if (tp) {
|
||||
/* single octet */
|
||||
if (TLVP_PRESENT(tp, V51_CTRL_IEI_PULSE_NOTIFICATION))
|
||||
*msgb_put(msg, 1) = *TLVP_VAL(tp, V51_CTRL_IEI_PULSE_NOTIFICATION);
|
||||
if (TLVP_PRESENT(tp, V51_CTRL_IEI_LINE_INFORMATION))
|
||||
*msgb_put(msg, 1) = *TLVP_VAL(tp, V51_CTRL_IEI_LINE_INFORMATION);
|
||||
if (TLVP_PRESENT(tp, V51_CTRL_IEI_SEQUENCE_RESPONSE))
|
||||
*msgb_put(msg, 1) = *TLVP_VAL(tp, V51_CTRL_IEI_SEQUENCE_RESPONSE);
|
||||
if (TLVP_PRESENT(tp, V5X_CTRL_IEI_PULSE_NOTIFICATION))
|
||||
*msgb_put(msg, 1) = *TLVP_VAL(tp, V5X_CTRL_IEI_PULSE_NOTIFICATION);
|
||||
if (TLVP_PRESENT(tp, V5X_CTRL_IEI_LINE_INFORMATION))
|
||||
*msgb_put(msg, 1) = *TLVP_VAL(tp, V5X_CTRL_IEI_LINE_INFORMATION);
|
||||
if (TLVP_PRESENT(tp, V5X_CTRL_IEI_SEQUENCE_RESPONSE))
|
||||
*msgb_put(msg, 1) = *TLVP_VAL(tp, V5X_CTRL_IEI_SEQUENCE_RESPONSE);
|
||||
/* multiple octets */
|
||||
if (TLVP_PRESENT(tp, V51_CTRL_IEI_PULSED_SIGNAL)) {
|
||||
len = TLVP_LEN(tp, V51_CTRL_IEI_PULSED_SIGNAL);
|
||||
if (TLVP_PRESENT(tp, V5X_CTRL_IEI_PULSED_SIGNAL)) {
|
||||
len = TLVP_LEN(tp, V5X_CTRL_IEI_PULSED_SIGNAL);
|
||||
tlv = msgb_put(msg, 2 + len);
|
||||
tlv[0] = V51_CTRL_IEI_PULSED_SIGNAL;
|
||||
tlv[0] = V5X_CTRL_IEI_PULSED_SIGNAL;
|
||||
tlv[1] = len;
|
||||
memcpy(tlv + 2, TLVP_VAL(tp, V51_CTRL_IEI_PULSED_SIGNAL), len);
|
||||
memcpy(tlv + 2, TLVP_VAL(tp, V5X_CTRL_IEI_PULSED_SIGNAL), len);
|
||||
}
|
||||
if (TLVP_PRESENT(tp, V51_CTRL_IEI_STEADY_SIGNAL)) {
|
||||
len = TLVP_LEN(tp, V51_CTRL_IEI_STEADY_SIGNAL);
|
||||
if (TLVP_PRESENT(tp, V5X_CTRL_IEI_STEADY_SIGNAL)) {
|
||||
len = TLVP_LEN(tp, V5X_CTRL_IEI_STEADY_SIGNAL);
|
||||
tlv = msgb_put(msg, 2 + len);
|
||||
tlv[0] = V51_CTRL_IEI_STEADY_SIGNAL;
|
||||
tlv[0] = V5X_CTRL_IEI_STEADY_SIGNAL;
|
||||
tlv[1] = len;
|
||||
memcpy(tlv + 2, TLVP_VAL(tp, V51_CTRL_IEI_STEADY_SIGNAL), len);
|
||||
memcpy(tlv + 2, TLVP_VAL(tp, V5X_CTRL_IEI_STEADY_SIGNAL), len);
|
||||
}
|
||||
if (TLVP_PRESENT(tp, V51_CTRL_IEI_DIGIT_SIGNAL)) {
|
||||
len = TLVP_LEN(tp, V51_CTRL_IEI_DIGIT_SIGNAL);
|
||||
if (TLVP_PRESENT(tp, V5X_CTRL_IEI_DIGIT_SIGNAL)) {
|
||||
len = TLVP_LEN(tp, V5X_CTRL_IEI_DIGIT_SIGNAL);
|
||||
tlv = msgb_put(msg, 2 + len);
|
||||
tlv[0] = V51_CTRL_IEI_DIGIT_SIGNAL;
|
||||
tlv[0] = V5X_CTRL_IEI_DIGIT_SIGNAL;
|
||||
tlv[1] = len;
|
||||
memcpy(tlv + 2, TLVP_VAL(tp, V51_CTRL_IEI_DIGIT_SIGNAL), len);
|
||||
memcpy(tlv + 2, TLVP_VAL(tp, V5X_CTRL_IEI_DIGIT_SIGNAL), len);
|
||||
}
|
||||
if (TLVP_PRESENT(tp, V51_CTRL_IEI_RESOURCE_UNAVAILABLE)) {
|
||||
len = TLVP_LEN(tp, V51_CTRL_IEI_RESOURCE_UNAVAILABLE);
|
||||
if (TLVP_PRESENT(tp, V5X_CTRL_IEI_RESOURCE_UNAVAILABLE)) {
|
||||
len = TLVP_LEN(tp, V5X_CTRL_IEI_RESOURCE_UNAVAILABLE);
|
||||
tlv = msgb_put(msg, 2 + len);
|
||||
tlv[0] = V51_CTRL_IEI_RESOURCE_UNAVAILABLE;
|
||||
tlv[0] = V5X_CTRL_IEI_RESOURCE_UNAVAILABLE;
|
||||
tlv[1] = len;
|
||||
memcpy(tlv + 2, TLVP_VAL(tp, V51_CTRL_IEI_RESOURCE_UNAVAILABLE), len);
|
||||
memcpy(tlv + 2, TLVP_VAL(tp, V5X_CTRL_IEI_RESOURCE_UNAVAILABLE), len);
|
||||
}
|
||||
if (TLVP_PRESENT(tp, V51_CTRL_IEI_METERING_REPORT)) {
|
||||
len = TLVP_LEN(tp, V51_CTRL_IEI_METERING_REPORT);
|
||||
if (TLVP_PRESENT(tp, V5X_CTRL_IEI_METERING_REPORT)) {
|
||||
len = TLVP_LEN(tp, V5X_CTRL_IEI_METERING_REPORT);
|
||||
tlv = msgb_put(msg, 2 + len);
|
||||
tlv[0] = V51_CTRL_IEI_METERING_REPORT;
|
||||
tlv[0] = V5X_CTRL_IEI_METERING_REPORT;
|
||||
tlv[1] = len;
|
||||
memcpy(tlv + 2, TLVP_VAL(tp, V51_CTRL_IEI_METERING_REPORT), len);
|
||||
memcpy(tlv + 2, TLVP_VAL(tp, V5X_CTRL_IEI_METERING_REPORT), len);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -423,7 +423,7 @@ static void start_timer(struct osmo_fsm_inst *fi, enum v5x_le_pstn_fsm_event eve
|
|||
osmo_timer_schedule(&fi->timer, timeout, 0);
|
||||
}
|
||||
|
||||
void v5x_pstn_fe_snd(struct v5x_user_port *v5up, enum v5x_fe_prim prim, struct msgb *msg)
|
||||
void v5x_le_pstn_fe_snd(struct v5x_user_port *v5up, enum v5x_fe_prim prim, struct msgb *msg)
|
||||
{
|
||||
struct v5x_pstn_proto *pstn = v5up->pstn.proto;
|
||||
struct osmo_fsm_inst *fi = pstn->fi;
|
||||
|
@ -462,7 +462,7 @@ void v5x_pstn_fe_snd(struct v5x_user_port *v5up, enum v5x_fe_prim prim, struct m
|
|||
msgb_free(msg);
|
||||
}
|
||||
|
||||
void v5x_pstn_mdu_snd(struct v5x_user_port *v5up, enum v5x_mgmt_prim prim)
|
||||
void v5x_le_pstn_mdu_snd(struct v5x_user_port *v5up, enum v5x_mgmt_prim prim)
|
||||
{
|
||||
struct v5x_pstn_proto *pstn = v5up->pstn.proto;
|
||||
struct osmo_fsm_inst *fi = pstn->fi;
|
||||
|
@ -526,7 +526,7 @@ static void do_status_enquiry(struct osmo_fsm_inst *fi)
|
|||
/* start T4 */
|
||||
start_timer(fi, V5x_PSTN_LE_TIMEOUT_T4, 1);
|
||||
/* send STATUS ENQUIRY */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
}
|
||||
|
||||
static void do_establish_request(struct osmo_fsm_inst *fi, struct msgb *msg)
|
||||
|
@ -544,7 +544,7 @@ static void do_establish_request(struct osmo_fsm_inst *fi, struct msgb *msg)
|
|||
msgb_free(pstn->tx_msg);
|
||||
pstn->tx_msg = msgb_copy(msg, NULL);
|
||||
/* send ESTABLISH */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_establish(pstn->v5up, msg->data, msg->len));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_establish(pstn->v5up, msg->data, msg->len));
|
||||
msgb_free(msg);
|
||||
}
|
||||
|
||||
|
@ -584,7 +584,7 @@ static void do_disconnect_with_error(struct osmo_fsm_inst *fi)
|
|||
pstn->tx_msg = NULL;
|
||||
}
|
||||
/* send DISCONNECT */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, NULL, 0));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, NULL, 0));
|
||||
/* send MDU-error_indication */
|
||||
rcv_mdu(fi, MDU_error_ind);
|
||||
}
|
||||
|
@ -637,7 +637,7 @@ static void pstn_le0_out_of_service(struct osmo_fsm_inst *fi, uint32_t event, vo
|
|||
/* ignore */
|
||||
break;
|
||||
case V5x_PSTN_LE_STATUS:
|
||||
cause = *TLVP_VAL(tp, V51_CTRL_IEI_CAUSE) & 0x7f;
|
||||
cause = *TLVP_VAL(tp, V5X_CTRL_IEI_CAUSE) & 0x7f;
|
||||
if (cause == 0) {
|
||||
/* stop T4 */
|
||||
stop_timer(fi);
|
||||
|
@ -675,7 +675,7 @@ static void pstn_le0_out_of_service(struct osmo_fsm_inst *fi, uint32_t event, vo
|
|||
/* start T4 */
|
||||
start_timer(fi, V5x_PSTN_LE_TIMEOUT_T4, pstn->timeout_count + 1);
|
||||
/* send STATUS ENQUIRY again */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
} else {
|
||||
/* send MDU-error_indication */
|
||||
rcv_mdu(fi, MDU_error_ind);
|
||||
|
@ -704,7 +704,7 @@ static void pstn_le1_null(struct osmo_fsm_inst *fi, uint32_t event, void *data)
|
|||
break;
|
||||
case V5x_PSTN_LE_DISCONNECT:
|
||||
/* send DISCONNECT COMPLETE */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
break;
|
||||
case V5x_PSTN_LE_ESTABLISH_ACK:
|
||||
case V5x_PSTN_LE_SIGNAL:
|
||||
|
@ -713,7 +713,7 @@ static void pstn_le1_null(struct osmo_fsm_inst *fi, uint32_t event, void *data)
|
|||
do_status_enquiry(fi);
|
||||
break;
|
||||
case V5x_PSTN_LE_STATUS:
|
||||
cause = *TLVP_VAL(tp, V51_CTRL_IEI_CAUSE) & 0x7f;
|
||||
cause = *TLVP_VAL(tp, V5X_CTRL_IEI_CAUSE) & 0x7f;
|
||||
if (cause == 0) {
|
||||
/* stop T4 */
|
||||
stop_timer(fi);
|
||||
|
@ -743,7 +743,7 @@ static void pstn_le1_null(struct osmo_fsm_inst *fi, uint32_t event, void *data)
|
|||
/* start T4 */
|
||||
start_timer(fi, V5x_PSTN_LE_TIMEOUT_T4, pstn->timeout_count + 1);
|
||||
/* send STATUS ENQUIRY again */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
} else {
|
||||
/* do several thing here */
|
||||
do_disconnect_with_error(fi);
|
||||
|
@ -766,7 +766,7 @@ static void pstn_le2_path_initiated_le(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
break;
|
||||
case V5x_PSTN_LE_DISCONNECT:
|
||||
/* send DISCONNECT COMPLETE */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
/* do several thing here */
|
||||
do_disconnect_complete(fi, tp);
|
||||
break;
|
||||
|
@ -780,7 +780,7 @@ static void pstn_le2_path_initiated_le(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
/* stop T1 */
|
||||
stop_timer(fi);
|
||||
/* send ESTABLISH ACK */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_establish_ack(pstn->v5up, msg->data, msg->len));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_establish_ack(pstn->v5up, msg->data, msg->len));
|
||||
msgb_free(msg);
|
||||
break;
|
||||
case V5x_PSTN_LE_ESTABLISH_ACK:
|
||||
|
@ -797,7 +797,7 @@ static void pstn_le2_path_initiated_le(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
do_status_enquiry(fi);
|
||||
break;
|
||||
case V5x_PSTN_LE_STATUS:
|
||||
cause = *TLVP_VAL(tp, V51_CTRL_IEI_CAUSE) & 0x7f;
|
||||
cause = *TLVP_VAL(tp, V5X_CTRL_IEI_CAUSE) & 0x7f;
|
||||
if (cause == 0) {
|
||||
/* stop T4 */
|
||||
stop_timer(fi);
|
||||
|
@ -822,7 +822,7 @@ static void pstn_le2_path_initiated_le(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
msgb_free(pstn->tx_msg);
|
||||
pstn->tx_msg = msgb_copy(msg, NULL);
|
||||
/* send DISCONNECT */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, msg->data, msg->len));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, msg->data, msg->len));
|
||||
msgb_free(msg);
|
||||
break;
|
||||
case V5x_PSTN_LE_FE_disconnect_compl_req:
|
||||
|
@ -839,7 +839,7 @@ static void pstn_le2_path_initiated_le(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
break;
|
||||
case V5x_PSTN_LE_MDU_CTRL_restart_req:
|
||||
/* send DISCONNECT COMPLETE */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
/* do several thing here */
|
||||
do_restart(fi);
|
||||
break;
|
||||
|
@ -853,7 +853,7 @@ static void pstn_le2_path_initiated_le(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
start_timer(fi, V5x_PSTN_LE_TIMEOUT_T1, 2);
|
||||
/* send ESTABLISH again */
|
||||
OSMO_ASSERT(pstn->tx_msg);
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_establish(pstn->v5up, pstn->tx_msg->data,
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_establish(pstn->v5up, pstn->tx_msg->data,
|
||||
pstn->tx_msg->len));
|
||||
} else {
|
||||
/* do several thing here */
|
||||
|
@ -866,7 +866,7 @@ static void pstn_le2_path_initiated_le(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
/* start T4 */
|
||||
start_timer(fi, V5x_PSTN_LE_TIMEOUT_T4, pstn->timeout_count + 1);
|
||||
/* send STATUS ENQUIRY again */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
} else {
|
||||
/* do several thing here */
|
||||
do_disconnect_with_error(fi);
|
||||
|
@ -893,7 +893,7 @@ static void pstn_le3_path_initiated_an(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
break;
|
||||
case V5x_PSTN_LE_DISCONNECT:
|
||||
/* send DISCONNECT COMPLETE */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
/* do several thing here */
|
||||
do_disconnect_complete(fi, tp);
|
||||
break;
|
||||
|
@ -905,7 +905,7 @@ static void pstn_le3_path_initiated_an(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
/* change state to LE4 */
|
||||
osmo_fsm_inst_state_chg(fi, V5x_LE_PTSN_S_LE4_PATH_ACTIVE, 0, 0);
|
||||
/* send ESTABLISH ACK */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_establish_ack(pstn->v5up, msg->data, msg->len));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_establish_ack(pstn->v5up, msg->data, msg->len));
|
||||
msgb_free(msg);
|
||||
break;
|
||||
case V5x_PSTN_LE_ESTABLISH_ACK:
|
||||
|
@ -915,7 +915,7 @@ static void pstn_le3_path_initiated_an(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
do_status_enquiry(fi);
|
||||
break;
|
||||
case V5x_PSTN_LE_STATUS:
|
||||
cause = *TLVP_VAL(tp, V51_CTRL_IEI_CAUSE) & 0x7f;
|
||||
cause = *TLVP_VAL(tp, V5X_CTRL_IEI_CAUSE) & 0x7f;
|
||||
if (cause == 0) {
|
||||
/* stop T4 */
|
||||
stop_timer(fi);
|
||||
|
@ -940,7 +940,7 @@ static void pstn_le3_path_initiated_an(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
msgb_free(pstn->tx_msg);
|
||||
pstn->tx_msg = msgb_copy(msg, NULL);
|
||||
/* Send DISCONNECT */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, msg->data, msg->len));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, msg->data, msg->len));
|
||||
msgb_free(msg);
|
||||
break;
|
||||
case V5x_PSTN_LE_FE_disconnect_compl_req:
|
||||
|
@ -950,7 +950,7 @@ static void pstn_le3_path_initiated_an(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
/* stop all timers */
|
||||
stop_timer(fi);
|
||||
/* send DISCONNECT COMPLETE */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, msg->data, msg->len));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, msg->data, msg->len));
|
||||
msgb_free(msg);
|
||||
break;
|
||||
case V5x_PSTN_LE_MDU_CTRL_port_blocked:
|
||||
|
@ -962,7 +962,7 @@ static void pstn_le3_path_initiated_an(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
break;
|
||||
case V5x_PSTN_LE_MDU_CTRL_restart_req:
|
||||
/* send DISCONNECT COMPLETE */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
/* do several thing here */
|
||||
do_restart(fi);
|
||||
break;
|
||||
|
@ -975,7 +975,7 @@ static void pstn_le3_path_initiated_an(struct osmo_fsm_inst *fi, uint32_t event,
|
|||
/* start T4 */
|
||||
start_timer(fi, V5x_PSTN_LE_TIMEOUT_T4, pstn->timeout_count + 1);
|
||||
/* send STATUS ENQUIRY again */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
} else {
|
||||
/* do several thing here */
|
||||
do_disconnect_with_error(fi);
|
||||
|
@ -998,7 +998,7 @@ static void pstn_le4_path_active(struct osmo_fsm_inst *fi, uint32_t event, void
|
|||
break;
|
||||
case V5x_PSTN_LE_DISCONNECT:
|
||||
/* send DISCONNECT COMPLETE */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
/* do several thing here */
|
||||
do_disconnect_complete(fi, tp);
|
||||
break;
|
||||
|
@ -1012,11 +1012,11 @@ static void pstn_le4_path_active(struct osmo_fsm_inst *fi, uint32_t event, void
|
|||
/* start T4 */
|
||||
start_timer(fi, V5x_PSTN_LE_TIMEOUT_T4, 1);
|
||||
/* send STATUS ENQUIRY */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
break;
|
||||
case V5x_PSTN_LE_SIGNAL:
|
||||
/* get sequence number and check if msg is in sequence */
|
||||
seq_nr = *TLVP_VAL(tp, V51_CTRL_IEI_SEQUENCE_NR) & 0x7f;
|
||||
seq_nr = *TLVP_VAL(tp, V5X_CTRL_IEI_SEQUENCE_NR) & 0x7f;
|
||||
if (pstn->S_r == seq_nr) {
|
||||
LOGP(DV5PSTN, LOGL_DEBUG, "Received expected 'receive' sequence number: S(R)=%d == M(R)=%d\n", pstn->S_r, seq_nr);
|
||||
/* start Tr, if not pending */
|
||||
|
@ -1035,7 +1035,7 @@ static void pstn_le4_path_active(struct osmo_fsm_inst *fi, uint32_t event, void
|
|||
}
|
||||
break;
|
||||
case V5x_PSTN_LE_SIGNAL_ACK:
|
||||
seq_nr = *TLVP_VAL(tp, V51_CTRL_IEI_SEQUENCE_NR) & 0x7f;
|
||||
seq_nr = *TLVP_VAL(tp, V5X_CTRL_IEI_SEQUENCE_NR) & 0x7f;
|
||||
unacked = (pstn->S_s - pstn->S_a) & 127;
|
||||
acked = (pstn->S_s - seq_nr) & 127;
|
||||
if (acked <= unacked) {
|
||||
|
@ -1059,7 +1059,7 @@ static void pstn_le4_path_active(struct osmo_fsm_inst *fi, uint32_t event, void
|
|||
}
|
||||
break;
|
||||
case V5x_PSTN_LE_STATUS:
|
||||
cause = *TLVP_VAL(tp, V51_CTRL_IEI_CAUSE) & 0x7f;
|
||||
cause = *TLVP_VAL(tp, V5X_CTRL_IEI_CAUSE) & 0x7f;
|
||||
if (cause == 0) {
|
||||
/* stop T4 */
|
||||
stop_timer(fi);
|
||||
|
@ -1079,14 +1079,14 @@ static void pstn_le4_path_active(struct osmo_fsm_inst *fi, uint32_t event, void
|
|||
msgb_free(pstn->tx_msg);
|
||||
pstn->tx_msg = msgb_copy(msg, NULL);
|
||||
/* send SIGNAL */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_signal(pstn->v5up, pstn->S_s, msg->data,
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_signal(pstn->v5up, pstn->S_s, msg->data,
|
||||
msg->len));
|
||||
msgb_free(msg);
|
||||
/* increment send sequence number */
|
||||
pstn->S_s = (pstn->S_s + 1) & 127;
|
||||
} else {
|
||||
/* send SIGNAL */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_signal(pstn->v5up, pstn->S_s, msg->data,
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_signal(pstn->v5up, pstn->S_s, msg->data,
|
||||
msg->len));
|
||||
msgb_free(msg);
|
||||
/* do several thing here */
|
||||
|
@ -1099,14 +1099,14 @@ static void pstn_le4_path_active(struct osmo_fsm_inst *fi, uint32_t event, void
|
|||
/* start Tt */
|
||||
start_timer_Tt(pstn);
|
||||
/* send SIGNAL */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_protocol_param(pstn->v5up, pstn->S_s, msg->data,
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_protocol_param(pstn->v5up, pstn->S_s, msg->data,
|
||||
msg->len));
|
||||
msgb_free(msg);
|
||||
/* increment send sequence number */
|
||||
pstn->S_s = (pstn->S_s + 1) & 127;
|
||||
} else {
|
||||
/* send SIGNAL */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_protocol_param(pstn->v5up, pstn->S_s, msg->data,
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_protocol_param(pstn->v5up, pstn->S_s, msg->data,
|
||||
msg->len));
|
||||
msgb_free(msg);
|
||||
/* do several thing here */
|
||||
|
@ -1125,7 +1125,7 @@ static void pstn_le4_path_active(struct osmo_fsm_inst *fi, uint32_t event, void
|
|||
msgb_free(pstn->tx_msg);
|
||||
pstn->tx_msg = msgb_copy(msg, NULL);
|
||||
/* Send DISCONNECT */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, msg->data, msg->len));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, msg->data, msg->len));
|
||||
msgb_free(msg);
|
||||
break;
|
||||
case V5x_PSTN_LE_FE_disconnect_compl_req:
|
||||
|
@ -1141,7 +1141,7 @@ static void pstn_le4_path_active(struct osmo_fsm_inst *fi, uint32_t event, void
|
|||
break;
|
||||
case V5x_PSTN_LE_MDU_CTRL_restart_req:
|
||||
/* send DISCONNECT COMPLETE */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
/* do several thing here */
|
||||
do_restart(fi);
|
||||
break;
|
||||
|
@ -1154,7 +1154,7 @@ static void pstn_le4_path_active(struct osmo_fsm_inst *fi, uint32_t event, void
|
|||
/* start T4 */
|
||||
start_timer(fi, V5x_PSTN_LE_TIMEOUT_T4, pstn->timeout_count + 1);
|
||||
/* send STATUS ENQUIRY again */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
} else {
|
||||
/* do several thing here */
|
||||
do_disconnect_with_error(fi);
|
||||
|
@ -1163,7 +1163,7 @@ static void pstn_le4_path_active(struct osmo_fsm_inst *fi, uint32_t event, void
|
|||
case V5x_PSTN_LE_TIMEOUT_Tr:
|
||||
/* send SIGNAL ACK */
|
||||
LOGP(DV5PSTN, LOGL_DEBUG, "Sending recent 'receive' sequence number: S(R)=%d as acknowledge.\n", pstn->S_r);
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_signal_ack(pstn->v5up, pstn->S_r));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_signal_ack(pstn->v5up, pstn->S_r));
|
||||
break;
|
||||
case V5x_PSTN_LE_TIMEOUT_Tt:
|
||||
/* do several thing here */
|
||||
|
@ -1225,7 +1225,7 @@ static void pstn_le5_path_disconnect_req(struct osmo_fsm_inst *fi, uint32_t even
|
|||
break;
|
||||
case V5x_PSTN_LE_MDU_CTRL_restart_req:
|
||||
/* send DISCONNECT COMPLETE */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect_compl(pstn->v5up, NULL, 0));
|
||||
/* do several thing here */
|
||||
do_restart(fi);
|
||||
break;
|
||||
|
@ -1235,10 +1235,10 @@ static void pstn_le5_path_disconnect_req(struct osmo_fsm_inst *fi, uint32_t even
|
|||
case V5x_PSTN_LE_TIMEOUT_T3:
|
||||
/* send DISCONNECT again */
|
||||
if (pstn->tx_msg)
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, pstn->tx_msg->data,
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, pstn->tx_msg->data,
|
||||
pstn->tx_msg->len));
|
||||
else
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, NULL, 0));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_disconnect(pstn->v5up, NULL, 0));
|
||||
/* start T3 */
|
||||
start_timer(fi, V5x_PSTN_LE_TIMEOUT_T3, pstn->timeout_count + 1);
|
||||
/* third timeout ? */
|
||||
|
@ -1297,7 +1297,7 @@ static void pstn_le6_port_blocked(struct osmo_fsm_inst *fi, uint32_t event, void
|
|||
/* start T4 */
|
||||
start_timer(fi, V5x_PSTN_LE_TIMEOUT_T4, pstn->timeout_count + 1);
|
||||
/* send STATUS ENQUIRY again */
|
||||
v5x_snd(pstn->v5up->inst, V51_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
v5x_snd(pstn->v5up->inst, V5X_DLADDR_PSTN, v5x_enc_status_enquiry(pstn->v5up));
|
||||
} else {
|
||||
/* send MDU-error_indication */
|
||||
rcv_mdu(fi, MDU_error_ind);
|
||||
|
@ -1472,7 +1472,7 @@ static const struct osmo_fsm_state v5x_le_pstn_fsm_states[] = {
|
|||
};
|
||||
|
||||
struct osmo_fsm v5x_le_pstn_fsm = {
|
||||
.name = "V51_LE_PSTN",
|
||||
.name = "V5X_LE_PSTN",
|
||||
.states = v5x_le_pstn_fsm_states,
|
||||
.num_states = ARRAY_SIZE(v5x_le_pstn_fsm_states),
|
||||
.allstate_event_mask = 0,
|
||||
|
@ -1483,7 +1483,7 @@ struct osmo_fsm v5x_le_pstn_fsm = {
|
|||
.event_names = v5x_ctrl_le_port_fsm_event_names,
|
||||
};
|
||||
|
||||
struct v5x_pstn_proto *v5x_pstn_create(struct v5x_user_port *v5up, uint16_t nr)
|
||||
struct v5x_pstn_proto *v5x_le_pstn_create(struct v5x_user_port *v5up, uint16_t nr)
|
||||
{
|
||||
struct v5x_pstn_proto *pstn;
|
||||
|
||||
|
@ -1506,7 +1506,7 @@ struct v5x_pstn_proto *v5x_pstn_create(struct v5x_user_port *v5up, uint16_t nr)
|
|||
return pstn;
|
||||
}
|
||||
|
||||
void v5x_pstn_destroy(struct v5x_pstn_proto *pstn)
|
||||
void v5x_le_pstn_destroy(struct v5x_pstn_proto *pstn)
|
||||
{
|
||||
/* free pending message */
|
||||
if (pstn->tx_msg)
|
||||
|
@ -1518,10 +1518,10 @@ void v5x_pstn_destroy(struct v5x_pstn_proto *pstn)
|
|||
osmo_fsm_inst_free(pstn->fi);
|
||||
}
|
||||
|
||||
free(pstn);
|
||||
talloc_free(pstn);
|
||||
}
|
||||
|
||||
void v51_pstn_init(void)
|
||||
void v5x_le_pstn_init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
|
@ -1536,30 +1536,30 @@ void v51_pstn_init(void)
|
|||
***********************************************************************/
|
||||
|
||||
/* receive message from lower (DL) layer */
|
||||
int v5x_rcv_pstn(struct v5x_user_port *v5up, uint16_t l3_addr, uint8_t msg_type, const struct tlv_parsed *tp)
|
||||
int v5x_le_pstn_rcv(struct v5x_user_port *v5up, uint16_t l3_addr, uint8_t msg_type, const struct tlv_parsed *tp)
|
||||
{
|
||||
enum v5x_le_pstn_fsm_event event;
|
||||
|
||||
switch (msg_type) {
|
||||
case V51_CTRL_MSGT_ESTABLISH:
|
||||
case V5X_CTRL_MSGT_ESTABLISH:
|
||||
event = V5x_PSTN_LE_ESTABLISH;
|
||||
break;
|
||||
case V51_CTRL_MSGT_ESTABLISH_ACK:
|
||||
case V5X_CTRL_MSGT_ESTABLISH_ACK:
|
||||
event = V5x_PSTN_LE_ESTABLISH_ACK;
|
||||
break;
|
||||
case V51_CTRL_MSGT_SIGNAL:
|
||||
case V5X_CTRL_MSGT_SIGNAL:
|
||||
event = V5x_PSTN_LE_SIGNAL;
|
||||
break;
|
||||
case V51_CTRL_MSGT_SIGNAL_ACK:
|
||||
case V5X_CTRL_MSGT_SIGNAL_ACK:
|
||||
event = V5x_PSTN_LE_SIGNAL_ACK;
|
||||
break;
|
||||
case V51_CTRL_MSGT_DISCONNECT:
|
||||
case V5X_CTRL_MSGT_DISCONNECT:
|
||||
event = V5x_PSTN_LE_DISCONNECT;
|
||||
break;
|
||||
case V51_CTRL_MSGT_DISCONNECT_COMPLETE:
|
||||
case V5X_CTRL_MSGT_DISCONNECT_COMPLETE:
|
||||
event = V5x_PSTN_LE_DISCONNECT_COMPL;
|
||||
break;
|
||||
case V51_CTRL_MSGT_STATUS:
|
||||
case V5X_CTRL_MSGT_STATUS:
|
||||
event = V5x_PSTN_LE_STATUS;
|
||||
break;
|
||||
default:
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
struct v5x_pstn_proto *v5x_le_pstn_create(struct v5x_user_port *v5up, uint16_t nr);
|
||||
void v5x_le_pstn_destroy(struct v5x_pstn_proto *pstn);
|
||||
void v5x_le_pstn_init(void);
|
||||
void v5x_le_pstn_fe_snd(struct v5x_user_port *v5up, enum v5x_fe_prim prim, struct msgb *msg);
|
||||
void v5x_le_pstn_mdu_snd(struct v5x_user_port *v5up, enum v5x_mgmt_prim prim);
|
||||
int v5x_le_pstn_rcv(struct v5x_user_port *v5up, uint16_t l3_addr, uint8_t msg_type, const struct tlv_parsed *tp);
|
|
@ -1,7 +0,0 @@
|
|||
|
||||
struct v5x_pstn_proto *v5x_pstn_create(struct v5x_user_port *v5up, uint16_t nr);
|
||||
void v5x_pstn_destroy(struct v5x_pstn_proto *pstn);
|
||||
void v51_pstn_init(void);
|
||||
void v5x_pstn_fe_snd(struct v5x_user_port *v5up, enum v5x_fe_prim prim, struct msgb *msg);
|
||||
void v5x_pstn_mdu_snd(struct v5x_user_port *v5up, enum v5x_mgmt_prim prim);
|
||||
int v5x_rcv_pstn(struct v5x_user_port *v5up, uint16_t l3_addr, uint8_t msg_type, const struct tlv_parsed *tp);
|
Loading…
Reference in New Issue