aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/diag_dpl.c16
-rw-r--r--src/diag_io.c4
-rw-r--r--src/diag_log.c10
-rw-r--r--src/diag_msg.c2
-rw-r--r--src/osmo-qcdiag-log.c38
5 files changed, 60 insertions, 10 deletions
diff --git a/src/diag_dpl.c b/src/diag_dpl.c
index 192f43a..b9fd901 100644
--- a/src/diag_dpl.c
+++ b/src/diag_dpl.c
@@ -100,12 +100,16 @@ int diag_dpl_set_if_log(struct diag_instance *di, uint8_t iface_id,
silr = (struct dpl_set_if_log_req *) msgb_put(msg, sizeof(*silr));
silr->iface_id = iface_id;
- silr->num_log_flags = 1;
- msgb_put(msg, sizeof(silr->log_flags[0]));
- silr->log_flags[0].iid = iid;
- silr->log_flags[0].link_type = link_type;
-
- rx = diag_transceive_msg(di, msg);
+ silr->num_log_flags = 0;
+ for (int i = 0; i < 1; i++) {
+ msgb_put(msg, sizeof(silr->log_flags[0]));
+ silr->num_log_flags++;
+ iid.link_instance = i;
+ silr->log_flags[i].iid = iid;
+ silr->log_flags[i].link_type = link_type;
+ }
+ rx = diag_subsys_transceive_msg(di, msg, DIAG_SUBSYS_PS_DATA_LOGGING,
+ DIAG_DPL_SET_IFACE_LOGGING);
/* FIXME */
msgb_free(rx);
diff --git a/src/diag_io.c b/src/diag_io.c
index dab784a..f5b1d52 100644
--- a/src/diag_io.c
+++ b/src/diag_io.c
@@ -28,6 +28,10 @@
#include "diag_cmd.h"
#include "diagchar_hdlc.h"
+#include <termios.h>
+#include <stdio.h>
+#include <errno.h>
+
struct msgb *msgb_alloc_diag(void)
{
return msgb_alloc_headroom(DIAG_MAX_REQ_SIZE+16, 16, "DIAG Tx");
diff --git a/src/diag_log.c b/src/diag_log.c
index 3f09a8b..b670a8b 100644
--- a/src/diag_log.c
+++ b/src/diag_log.c
@@ -114,6 +114,9 @@ void diag_log_enable_all_supported_family(struct diag_instance *di, uint8_t fami
}
}
+ if (family == 1)
+ max = 0x1586;
+
if (!max)
return;
@@ -125,6 +128,13 @@ void diag_log_enable_all_supported_family(struct diag_instance *di, uint8_t fami
log_config_set_mask_bit(msg, i-family_base);
}
+ if (family == 1) {
+ for (i = 0x572; i < 0x585; i++) {
+ printf("Setting log 0x%04x\n", i);
+ log_config_set_mask_bit(msg, i);
+ }
+ }
+
rx = diag_transceive_msg(di, msg);
if (rx->l2h[0] != DIAG_LOG_CONFIG_F)
fprintf(stderr, "Error enabling logs for family %d\n", family);
diff --git a/src/diag_msg.c b/src/diag_msg.c
index 12f1a0a..0a96ce6 100644
--- a/src/diag_msg.c
+++ b/src/diag_msg.c
@@ -46,7 +46,7 @@ struct msgb *gen_msg_config_set_rt_mask(uint16_t ssid, uint32_t runtime_mask)
struct diag_set_rt_mask_req *dsrmr;
msg->l2h = msgb_put(msg, sizeof(*dsrmr));
- dsrmr = (struct diag_set_rt_mask_req *) msg->l2h;
+ dsrmr = (struct diag_set_rt_mask_req *) msgb_l2(msg);
dsrmr->cmd_code = DIAG_EXT_MSG_CONFIG_F;
dsrmr->sub_cmd = MSG_EXT_SUBCMD_SET_RT_MASK;
osmo_store16le(ssid, &dsrmr->ssid_start);
diff --git a/src/osmo-qcdiag-log.c b/src/osmo-qcdiag-log.c
index 39bfb2b..8905576 100644
--- a/src/osmo-qcdiag-log.c
+++ b/src/osmo-qcdiag-log.c
@@ -41,8 +41,10 @@
#include "diag_log.h"
#include "diag_msg.h"
#include "diag_cmd.h"
+#include "diag_dpl.h"
#include "protocol/protocol.h"
#include "protocol/diagcmd.h"
+#include "protocol/diag_log_gsm.h"
static void do_configure(struct diag_instance *di)
{
@@ -70,10 +72,16 @@ static void do_configure(struct diag_instance *di)
/* response: 5d 5d 04 94 13 94 13 01 00 ff ff ff ff */
diag_msg_config_set_rt_mask(di, MSG_SSID_DS, 0xffffffff);
/* response: 5d 5d 04 88 13 88 13 01 00 ff ff ff ff */
- diag_msg_config_set_rt_mask(di, MSG_SSID_DS_IPA, 0xffffffff);
+ //diag_msg_config_set_rt_mask(di, MSG_SSID_DS_IPA, 0xffffffff);
/* response: 5d 5d 04 a6 13 a6 13 01 00 ff ff ff ff */
diag_msg_config_set_rt_mask(di, MSG_SSID_DS_GPRS, 0xffffffff);
/* response: 5d 5d 04 91 13 91 13 01 00 ff ff ff ff */
+ diag_msg_config_set_rt_mask(di, MSG_SSID_DS_GSM, 0xffffffff);
+ diag_msg_config_set_rt_mask(di, MSG_SSID_DS_UMTS, 0xffffffff);
+ diag_msg_config_set_rt_mask(di, MSG_SSID_DS_SOCKETS, 0xffffffff);
+ diag_msg_config_set_rt_mask(di, MSG_SSID_DS_SIO, 0xffffffff);
+ diag_msg_config_set_rt_mask(di, MSG_SSID_DS_APPS, 0xffffffff);
+ diag_msg_config_set_rt_mask(di, MSG_SSID_DIAG, 0xffffffff);
#if 0
printf("GSM\n");
@@ -119,6 +127,20 @@ static void do_configure(struct diag_instance *di)
#endif
}
+static void enable_pcap(struct diag_instance *di, uint8_t if_num)
+{
+ struct dpl_iid iid = { .flags = 0, .if_name = if_num,
+ .protocol = DIAG_DPL_IID_PROT_NET_IP,
+ .link_instance = 64 };
+#if 1
+ iid.flags &= ~DIAG_DPL_IID_FLAG_DIR_TX;
+ diag_dpl_set_if_log(di, if_num, iid, DIAG_DPL_IID_PROT_LINK_ANY);
+#else
+ iid.flags |= DIAG_DPL_IID_FLAG_DIR_TX;
+ diag_dpl_set_if_log(di, if_num, iid, DIAG_DPL_IID_PROT_LINK_ANY);
+#endif
+}
+
int main(int argc, char **argv)
{
struct diag_instance di;
@@ -133,14 +155,24 @@ int main(int argc, char **argv)
memset(&di, 0, sizeof(di));
di.fd = osmo_serial_init(argv[1], 921600);
+ //di.flags = 1;
if (di.fd < 0)
return EXIT_FAILURE;
- do_configure(&di);
-
di.gsmtap = gsmtap_source_init("localhost", GSMTAP_UDP_PORT, 0);
gsmtap_source_add_sink(di.gsmtap);
+ printf("\n===> CONFIGURING\n");
+
+ do_configure(&di);
+ diag_dpl_get_sup_if(&di);
+ for (i = 1; i < 0x56; i++) {
+ diag_dpl_get_if_desc(&di, i);
+ enable_pcap(&di, i);
+ }
+
+ printf("\n===> ENTERING MAIN\n");
+
while (1) {
i++;
struct msgb *rx = diag_read_msg(&di);