aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUri Shkolnik <uris@siano-ms.com>2009-05-12 10:37:09 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 18:14:28 -0400
commitba79bb2c381f01224786270d0914d46f31667cf0 (patch)
tree7103992b8ad650ef9671f1f35971881c8652b5ae
parent2c5582e58ce2982fd64da21907dfad4061fc1f71 (diff)
V4L/DVB (11781): Siano: smsdvb - add big endian support
Add support for Siano protocol messages with big endian systems. Signed-off-by: Uri Shkolnik <uris@siano-ms.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/siano/smsdvb.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/dvb/siano/smsdvb.c b/drivers/media/dvb/siano/smsdvb.c
index 9d6aab59a05e..8fb283b85b6b 100644
--- a/drivers/media/dvb/siano/smsdvb.c
+++ b/drivers/media/dvb/siano/smsdvb.c
@@ -23,6 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
23#include <linux/init.h> 23#include <linux/init.h>
24 24
25#include "smscoreapi.h" 25#include "smscoreapi.h"
26#include "smsendian.h"
26#include "sms-cards.h" 27#include "sms-cards.h"
27 28
28DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 29DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
@@ -60,6 +61,8 @@ static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb)
60 struct SmsMsgHdr_ST *phdr = 61 struct SmsMsgHdr_ST *phdr =
61 (struct SmsMsgHdr_ST *)(((u8 *) cb->p) + cb->offset); 62 (struct SmsMsgHdr_ST *)(((u8 *) cb->p) + cb->offset);
62 63
64 smsendian_handle_rx_message((struct SmsMsgData_ST *) phdr);
65
63 switch (phdr->msgType) { 66 switch (phdr->msgType) {
64 case MSG_SMS_DVBT_BDA_DATA: 67 case MSG_SMS_DVBT_BDA_DATA:
65 dvb_dmx_swfilter(&client->demux, (u8 *)(phdr + 1), 68 dvb_dmx_swfilter(&client->demux, (u8 *)(phdr + 1),
@@ -149,6 +152,7 @@ static int smsdvb_start_feed(struct dvb_demux_feed *feed)
149 PidMsg.xMsgHeader.msgLength = sizeof(PidMsg); 152 PidMsg.xMsgHeader.msgLength = sizeof(PidMsg);
150 PidMsg.msgData[0] = feed->pid; 153 PidMsg.msgData[0] = feed->pid;
151 154
155 smsendian_handle_tx_message((struct SmsMsgHdr_ST *)&PidMsg);
152 return smsclient_sendrequest(client->smsclient, 156 return smsclient_sendrequest(client->smsclient,
153 &PidMsg, sizeof(PidMsg)); 157 &PidMsg, sizeof(PidMsg));
154} 158}
@@ -169,6 +173,7 @@ static int smsdvb_stop_feed(struct dvb_demux_feed *feed)
169 PidMsg.xMsgHeader.msgLength = sizeof(PidMsg); 173 PidMsg.xMsgHeader.msgLength = sizeof(PidMsg);
170 PidMsg.msgData[0] = feed->pid; 174 PidMsg.msgData[0] = feed->pid;
171 175
176 smsendian_handle_tx_message((struct SmsMsgHdr_ST *)&PidMsg);
172 return smsclient_sendrequest(client->smsclient, 177 return smsclient_sendrequest(client->smsclient,
173 &PidMsg, sizeof(PidMsg)); 178 &PidMsg, sizeof(PidMsg));
174} 179}
@@ -177,7 +182,10 @@ static int smsdvb_sendrequest_and_wait(struct smsdvb_client_t *client,
177 void *buffer, size_t size, 182 void *buffer, size_t size,
178 struct completion *completion) 183 struct completion *completion)
179{ 184{
180 int rc = smsclient_sendrequest(client->smsclient, buffer, size); 185 int rc;
186
187 smsendian_handle_tx_message((struct SmsMsgHdr_ST *)buffer);
188 rc = smsclient_sendrequest(client->smsclient, buffer, size);
181 if (rc < 0) 189 if (rc < 0)
182 return rc; 190 return rc;
183 191