diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-09 09:34:56 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-21 06:46:18 -0400 |
commit | 80ccb51a0f970ab0935a8be70b677ecbcdf74e3e (patch) | |
tree | cd3edecad8522016a7de2545d34468c09dc511ab /drivers/media/common/siano/smsdvb.c | |
parent | fe802fd92d6abd1fce2ae8d03a073807d25e9453 (diff) |
[media] siano: simplify message endianness logic
Currently, every time a message is sent or received, the endiannes
need to be fixed on big endian machines. This is currently done
on every call to the send API, and on every msg reception logic.
Instead of doing that, move it to the send/receive functions.
That simplifies the logic and avoids the risk of forgetting to
fix it somewhere.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/siano/smsdvb.c')
-rw-r--r-- | drivers/media/common/siano/smsdvb.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/media/common/siano/smsdvb.c b/drivers/media/common/siano/smsdvb.c index dbb807e3a212..6335574e9342 100644 --- a/drivers/media/common/siano/smsdvb.c +++ b/drivers/media/common/siano/smsdvb.c | |||
@@ -29,7 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
29 | #include "dvb_frontend.h" | 29 | #include "dvb_frontend.h" |
30 | 30 | ||
31 | #include "smscoreapi.h" | 31 | #include "smscoreapi.h" |
32 | #include "smsendian.h" | ||
33 | #include "sms-cards.h" | 32 | #include "sms-cards.h" |
34 | 33 | ||
35 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | 34 | DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); |
@@ -324,8 +323,6 @@ static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb) | |||
324 | /*u32 MsgDataLen = phdr->msgLength - sizeof(struct SmsMsgHdr_ST);*/ | 323 | /*u32 MsgDataLen = phdr->msgLength - sizeof(struct SmsMsgHdr_ST);*/ |
325 | bool is_status_update = false; | 324 | bool is_status_update = false; |
326 | 325 | ||
327 | smsendian_handle_rx_message((struct SmsMsgData_ST *) phdr); | ||
328 | |||
329 | switch (phdr->msgType) { | 326 | switch (phdr->msgType) { |
330 | case MSG_SMS_DVBT_BDA_DATA: | 327 | case MSG_SMS_DVBT_BDA_DATA: |
331 | dvb_dmx_swfilter(&client->demux, (u8 *)(phdr + 1), | 328 | dvb_dmx_swfilter(&client->demux, (u8 *)(phdr + 1), |
@@ -545,7 +542,6 @@ static int smsdvb_start_feed(struct dvb_demux_feed *feed) | |||
545 | PidMsg.xMsgHeader.msgLength = sizeof(PidMsg); | 542 | PidMsg.xMsgHeader.msgLength = sizeof(PidMsg); |
546 | PidMsg.msgData[0] = feed->pid; | 543 | PidMsg.msgData[0] = feed->pid; |
547 | 544 | ||
548 | smsendian_handle_tx_message((struct SmsMsgHdr_ST *)&PidMsg); | ||
549 | return smsclient_sendrequest(client->smsclient, | 545 | return smsclient_sendrequest(client->smsclient, |
550 | &PidMsg, sizeof(PidMsg)); | 546 | &PidMsg, sizeof(PidMsg)); |
551 | } | 547 | } |
@@ -566,7 +562,6 @@ static int smsdvb_stop_feed(struct dvb_demux_feed *feed) | |||
566 | PidMsg.xMsgHeader.msgLength = sizeof(PidMsg); | 562 | PidMsg.xMsgHeader.msgLength = sizeof(PidMsg); |
567 | PidMsg.msgData[0] = feed->pid; | 563 | PidMsg.msgData[0] = feed->pid; |
568 | 564 | ||
569 | smsendian_handle_tx_message((struct SmsMsgHdr_ST *)&PidMsg); | ||
570 | return smsclient_sendrequest(client->smsclient, | 565 | return smsclient_sendrequest(client->smsclient, |
571 | &PidMsg, sizeof(PidMsg)); | 566 | &PidMsg, sizeof(PidMsg)); |
572 | } | 567 | } |
@@ -577,7 +572,6 @@ static int smsdvb_sendrequest_and_wait(struct smsdvb_client_t *client, | |||
577 | { | 572 | { |
578 | int rc; | 573 | int rc; |
579 | 574 | ||
580 | smsendian_handle_tx_message((struct SmsMsgHdr_ST *)buffer); | ||
581 | rc = smsclient_sendrequest(client->smsclient, buffer, size); | 575 | rc = smsclient_sendrequest(client->smsclient, buffer, size); |
582 | if (rc < 0) | 576 | if (rc < 0) |
583 | return rc; | 577 | return rc; |
@@ -606,8 +600,6 @@ static int smsdvb_send_statistics_request(struct smsdvb_client_t *client) | |||
606 | else | 600 | else |
607 | Msg.msgType = MSG_SMS_GET_STATISTICS_REQ; | 601 | Msg.msgType = MSG_SMS_GET_STATISTICS_REQ; |
608 | 602 | ||
609 | smsendian_handle_tx_message((struct SmsMsgHdr_S *)&Msg); | ||
610 | |||
611 | rc = smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), | 603 | rc = smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), |
612 | &client->stats_done); | 604 | &client->stats_done); |
613 | 605 | ||