Commit 4c3bdb5e authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] siano: better debug send/receive messages

Instead of printing a message for some random messages, print
it for all sent/received ones. That helps a lot to debug
what's going on.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f251001c
This diff is collapsed.
......@@ -937,6 +937,8 @@ struct smscore_config_gpio {
u8 outputdriving;
};
char *smscore_translate_msg(enum msg_types msgtype);
extern void smscore_registry_setmode(char *devpath, int mode);
extern int smscore_registry_getmode(char *devpath);
......
......@@ -249,20 +249,16 @@ static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb)
break;
case MSG_SMS_SIGNAL_DETECTED_IND:
sms_info("MSG_SMS_SIGNAL_DETECTED_IND");
client->sms_stat_dvb.TransmissionData.IsDemodLocked = true;
is_status_update = true;
break;
case MSG_SMS_NO_SIGNAL_IND:
sms_info("MSG_SMS_NO_SIGNAL_IND");
client->sms_stat_dvb.TransmissionData.IsDemodLocked = false;
is_status_update = true;
break;
case MSG_SMS_TRANSMISSION_IND: {
sms_info("MSG_SMS_TRANSMISSION_IND");
pMsgData++;
memcpy(&client->sms_stat_dvb.TransmissionData, pMsgData,
sizeof(struct TRANSMISSION_STATISTICS_S));
......@@ -281,7 +277,6 @@ static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb)
&client->sms_stat_dvb.ReceptionData;
struct SRVM_SIGNAL_STATUS_S SignalStatusData;
/*sms_info("MSG_SMS_HO_PER_SLICES_IND");*/
pMsgData++;
SignalStatusData.result = pMsgData[0];
SignalStatusData.snr = pMsgData[1];
......@@ -336,8 +331,6 @@ static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb)
struct RECEPTION_STATISTICS_S *pReceptionData =
&client->sms_stat_dvb.ReceptionData;
sms_info("MSG_SMS_GET_STATISTICS_RES");
is_status_update = true;
switch (smscore_get_device_mode(client->coredev)) {
......@@ -360,8 +353,7 @@ static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb)
break;
}
default:
sms_info("Unhandled message %d", phdr->msgType);
sms_info("message not handled");
}
smscore_putbuffer(client->coredev, cb);
......
......@@ -106,6 +106,10 @@ static void smsusb_onresponse(struct urb *urb)
} else
surb->cb->offset = 0;
sms_debug("received %s(%d) size: %d",
smscore_translate_msg(phdr->msgType),
phdr->msgType, phdr->msgLength);
smscore_onresponse(dev->coredev, surb->cb);
surb->cb = NULL;
} else {
......@@ -181,8 +185,13 @@ static int smsusb_start_streaming(struct smsusb_device_t *dev)
static int smsusb_sendrequest(void *context, void *buffer, size_t size)
{
struct smsusb_device_t *dev = (struct smsusb_device_t *) context;
struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *) buffer;
int dummy;
sms_debug("sending %s(%d) size: %d",
smscore_translate_msg(phdr->msgType), phdr->msgType,
phdr->msgLength);
smsendian_handle_message_header((struct SmsMsgHdr_ST *)buffer);
return usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2),
buffer, size, &dummy, 1000);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment