Skip to contentSkip to conversation

[0905_02] Siano: smsusb - handle byte ordering and big endianity

PATCH New Uri Shkolnik 1 participant 1 message May 12, 2009 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 [0905_02] Siano: smsusb - handle byte ordering and big endianity

# HG changeset patch
# User Uri Shkolnik <[email protected]>
# Date 1242127626 -10800
# Node ID 26c02c133d7e1f9932c1968f669ab0bfaf2761fa
# Parent 766d02fa7c5c42cc6480eaefb14c7dd6f9c0d370 [0905_02] Siano: smsusb - handle byte ordering and big endianity

From: Uri Shkolnik <[email protected]>

This patch adds support for byte ordering and big endianity handling for the USB interface driver

Priority: normal

linux/drivers/media/dvb/siano/smsusb.c +4 -2
diff -r 766d02fa7c5c -r 26c02c133d7e linux/drivers/media/dvb/siano/smsusb.c
@@ -26,6 +26,7 @@ along with this program.  If not, see <h
 
 #include "smscoreapi.h"
 #include "sms-cards.h"
+#include "smsendian.h"
 
 static int sms_dbg;
 module_param_named(debug, sms_dbg, int, 0644);
@@ -180,6 +181,7 @@ static int smsusb_sendrequest(void *cont
 	struct smsusb_device_t *dev = (struct smsusb_device_t *) context;
 	int dummy;
 
+	smsendian_handle_message_header((struct SmsMsgHdr_ST *)buffer);
 	return usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2),
 			    buffer, size, &dummy, 1000);
 }
@@ -337,8 +339,8 @@ static int smsusb_init_device(struct usb
 	case SMS_VEGA:
 		dev->buffer_size = USB2_BUFFER_SIZE;
 		dev->response_alignment =
-			dev->udev->ep_in[1]->desc.wMaxPacketSize -
-			sizeof(struct SmsMsgHdr_ST);
+		    le16_to_cpu(dev->udev->ep_in[1]->desc.wMaxPacketSize) -
+		    sizeof(struct SmsMsgHdr_ST);
 
 		params.flags |= SMS_DEVICE_FAMILY2;
 		break;