[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>
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
|
||||
#include "smscoreapi.h"
|
||||
#include "sms-cards.h"
|
||||
#include "smsendian.h"
|
||||
|
||||
/* Registers */
|
||||
|
||||
@@ -97,6 +98,7 @@ static int smssdio_sendrequest(void *context, void *buffer, size_t size)
|
||||
|
||||
sdio_claim_host(smsdev->func);
|
||||
|
||||
smsendian_handle_tx_message((struct SmsMsgData_ST *) buffer);
|
||||
while (size >= smsdev->func->cur_blksize) {
|
||||
ret = sdio_memcpy_toio(smsdev->func, SMSSDIO_DATA,
|
||||
buffer, smsdev->func->cur_blksize);
|
||||
@@ -231,6 +233,7 @@ static void smssdio_interrupt(struct sdio_func *func)
|
||||
cb->size = hdr->msgLength;
|
||||
cb->offset = 0;
|
||||
|
||||
smsendian_handle_rx_message((struct SmsMsgData_ST *) cb->p);
|
||||
smscore_onresponse(smsdev->coredev, cb);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user