aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-octphy/l1_if.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-01-15 19:12:04 +0100
committerHarald Welte <laforge@gnumonks.org>2016-01-16 17:26:24 +0100
commit7bd2251dcb15552d424b53e0e0e85a4d8150868c (patch)
tree30a4170c3f5d6740a016c744f028aa3eb1fa199b /src/osmo-bts-octphy/l1_if.c
parent0c017618cd335f88712174154575ce9569a4634c (diff)
OCTPHY: Print NOTICE message if we receive supervisory frame
Diffstat (limited to 'src/osmo-bts-octphy/l1_if.c')
-rw-r--r--src/osmo-bts-octphy/l1_if.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 9c523fb5..e1f8af0d 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -1161,6 +1161,30 @@ static int rx_octvc1_event_msg(struct msgb *msg)
return rx_octvc1_notif(msg, event_id);
}
+/* Receive a supervisory message from the PHY */
+static int rx_octvc1_supv(struct msgb *msg, uint32_t msg_id, uint32_t trans_id)
+{
+ tOCTVC1_MSG_HEADER *mh = (tOCTVC1_MSG_HEADER *) msg->l2h;
+ uint32_t return_code = ntohl(mh->ulReturnCode);
+ tOCTVC1_CTRL_MSG_MODULE_REJECT_SPV *rej;
+
+ switch (msg_id) {
+ case cOCTVC1_CTRL_MSG_MODULE_REJECT_SID:
+ rej = (tOCTVC1_CTRL_MSG_MODULE_REJECT_SPV *) mh;
+ mOCTVC1_CTRL_MSG_MODULE_REJECT_SPV_SWAP(rej);
+ LOGP(DL1C, LOGL_NOTICE, "Rx REJECT_SID (ExpectedTID=0x%08x, "
+ "RejectedCmdID=0x%08x)\n", rej->ulExpectedTransactionId,
+ rej->ulRejectedCmdId);
+ break;
+ default:
+ LOGP(DL1C, LOGL_NOTICE, "Rx unhandled supervisory msg_id "
+ "%u: ReturnCode:%u\n", msg_id, return_code);
+ break;
+ }
+
+ return 0;
+}
+
static int rx_octvc1_ctrl_msg(struct msgb *msg)
{
tOCTVC1_MSG_HEADER *mh = (tOCTVC1_MSG_HEADER *) msg->l2h;
@@ -1203,9 +1227,10 @@ static int rx_octvc1_ctrl_msg(struct msgb *msg)
switch (msg_type) {
case cOCTVC1_MSG_TYPE_RESPONSE:
return rx_octvc1_resp(msg, msg_id, ntohl(mh->ulTransactionId));
+ case cOCTVC1_MSG_TYPE_SUPERVISORY:
+ return rx_octvc1_supv(msg, msg_id, ntohl(mh->ulTransactionId));
case cOCTVC1_MSG_TYPE_NOTIFICATION:
case cOCTVC1_MSG_TYPE_COMMAND:
- case cOCTVC1_MSG_TYPE_SUPERVISORY:
LOGP(DL1C, LOGL_NOTICE, "Rx unhandled msg_type %s (%u)\n",
msg_name, msg_type);
msgb_free(msg);