Message ID | 204559.6386.qm@web110811.mail.gq1.yahoo.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
On Sun, 5 Apr 2009 01:59:50 -0700 (PDT) Uri Shkolnik <urishk@yahoo.com> wrote: > > Add code that modify the content of Siano's protocol > messages when running with big-endian target. Maybe due to one of the other patches that weren't applied, but this one didn't compile: /home/v4l/master/v4l/smsdvb.c:49: error: field 'sms_stat_dvb' has incomplete type /home/v4l/master/v4l/smsdvb.c: In function 'smsdvb_onresponse': /home/v4l/master/v4l/smsdvb.c:95: error: invalid application of 'sizeof' to incomplete type 'struct TRANSMISSION_STATISTICS_S' /home/v4l/master/v4l/smsdvb.c:95: error: invalid application of 'sizeof' to incomplete type 'struct TRANSMISSION_STATISTICS_S' /home/v4l/master/v4l/smsdvb.c:101: error: implicit declaration of function 'CORRECT_STAT_BANDWIDTH' /home/v4l/master/v4l/smsdvb.c:102: error: implicit declaration of function 'CORRECT_STAT_TRANSMISSON_MODE' /home/v4l/master/v4l/smsdvb.c:109: error: storage size of 'SignalStatusData' isn't known /home/v4l/master/v4l/smsdvb.c:125: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:126: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:127: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:128: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:129: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:130: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:131: error: implicit declaration of function 'CORRECT_STAT_RSSI' /home/v4l/master/v4l/smsdvb.c:133: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:134: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:135: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:136: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:141: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:145: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:148: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:149: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:151: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:152: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:153: error: dereferencing pointer to incomplete type /home/v4l/master/v4l/smsdvb.c:109: warning: unused variable 'SignalStatusData' make[3]: *** [/home/v4l/master/v4l/smsdvb.o] Error 1 Cheers, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, 20 Apr 2009 12:48:39 -0300 Mauro Carvalho Chehab <mchehab@infradead.org> wrote: > On Sun, 5 Apr 2009 01:59:50 -0700 (PDT) > Uri Shkolnik <urishk@yahoo.com> wrote: > > > > > Add code that modify the content of Siano's protocol > > messages when running with big-endian target. > > Maybe due to one of the other patches that weren't applied, but this one didn't compile: Sorry, my fault. This is some trash from a previous patch that got rejected. Patch added, thanks. Cheers, Mauro -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff -r 7b5d5a3a7b8e -r e8d224d81e2a linux/drivers/media/dvb/siano/smsendian.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux/drivers/media/dvb/siano/smsendian.c Thu Apr 02 21:27:06 2009 +0300 @@ -0,0 +1,100 @@ +/**************************************************************** + + Siano Mobile Silicon, Inc. + MDTV receiver kernel modules. + Copyright (C) 2006-2009, Uri Shkolnik + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + + ****************************************************************/ + +#include <asm/byteorder.h> + +#include "smsendian.h" +#include "smscoreapi.h" + +void smsendian_handle_tx_message(void *buffer) +{ +#ifdef __BIG_ENDIAN + struct SmsMsgData_ST *msg = (struct SmsMsgData_ST *)buffer; + int i; + int msgWords; + + switch (msg->xMsgHeader.msgType) { + case MSG_SMS_DATA_DOWNLOAD_REQ: + { + msg->msgData[0] = le32_to_cpu(msg->msgData[0]); + break; + } + + default: + msgWords = (msg->xMsgHeader.msgLength - + sizeof(struct SmsMsgHdr_ST))/4; + + for (i = 0; i < msgWords; i++) + msg->msgData[i] = le32_to_cpu(msg->msgData[i]); + + break; + } +#endif /* __BIG_ENDIAN */ +} + +void smsendian_handle_rx_message(void *buffer) +{ +#ifdef __BIG_ENDIAN + struct SmsMsgData_ST *msg = (struct SmsMsgData_ST *)buffer; + int i; + int msgWords; + + switch (msg->xMsgHeader.msgType) { + case MSG_SMS_GET_VERSION_EX_RES: + { + struct SmsVersionRes_ST *ver = + (struct SmsVersionRes_ST *) msg; + ver->ChipModel = le16_to_cpu(ver->ChipModel); + break; + } + + case MSG_SMS_DVBT_BDA_DATA: + case MSG_SMS_DAB_CHANNEL: + case MSG_SMS_DATA_MSG: + { + break; + } + + default: + { + msgWords = (msg->xMsgHeader.msgLength - + sizeof(struct SmsMsgHdr_ST))/4; + + for (i = 0; i < msgWords; i++) + msg->msgData[i] = le32_to_cpu(msg->msgData[i]); + + break; + } + } +#endif /* __BIG_ENDIAN */ +} + +void smsendian_handle_message_header(void *msg) +{ +#ifdef __BIG_ENDIAN + struct SmsMsgHdr_ST *phdr = (struct SmsMsgHdr_ST *)msg; + + phdr->msgType = le16_to_cpu(phdr->msgType); + phdr->msgLength = le16_to_cpu(phdr->msgLength); + phdr->msgFlags = le16_to_cpu(phdr->msgFlags); +#endif /* __BIG_ENDIAN */ +} + diff -r 7b5d5a3a7b8e -r e8d224d81e2a linux/drivers/media/dvb/siano/smsendian.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/linux/drivers/media/dvb/siano/smsendian.h Thu Apr 02 21:27:06 2009 +0300 @@ -0,0 +1,32 @@ +/**************************************************************** + +Siano Mobile Silicon, Inc. +MDTV receiver kernel modules. +Copyright (C) 2006-2009, Uri Shkolnik + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + + This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. + +****************************************************************/ + +#ifndef __SMS_ENDIAN_H__ +#define __SMS_ENDIAN_H__ + +#include <asm/byteorder.h> + +void smsendian_handle_tx_message(void *buffer); +void smsendian_handle_rx_message(void *buffer); +void smsendian_handle_message_header(void *msg); + +#endif /* __SMS_ENDIAN_H__ */ +