lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42621?usp=email )


Change subject: octsim: usb_descriptors: use LE16/LE32 for consistancy
......................................................................

octsim: usb_descriptors: use LE16/LE32 for consistancy

Even this is ran on ARM and most likely on x86, add byte ordering
function (LE16/LE32) to 16 bit and 32 bit fields as the remaining
usb descriptor does.

Change-Id: Ia77d65faf56c5d3c57cc76c91af33fce4fbbff5c
---
M sysmoOCTSIM/usb_descriptors.c
1 file changed, 7 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware 
refs/changes/21/42621/1

diff --git a/sysmoOCTSIM/usb_descriptors.c b/sysmoOCTSIM/usb_descriptors.c
index c4fa5ea..fec95fc 100644
--- a/sysmoOCTSIM/usb_descriptors.c
+++ b/sysmoOCTSIM/usb_descriptors.c
@@ -45,13 +45,13 @@
        .cfg = {
                .bLength = sizeof(struct usb_config_desc),
                .bDescriptorType = USB_DT_CONFIG,
-               .wTotalLength = sizeof(usb_fs_descs.cfg) +
+               .wTotalLength = LE32(sizeof(usb_fs_descs.cfg) +
 #ifdef WITH_DEBUG_CDC
                                sizeof(usb_fs_descs.cdc) +
 #endif
                                sizeof(usb_fs_descs.ccid) +
                                sizeof(usb_fs_descs.dfu_rt) +
-                               sizeof(usb_fs_descs.func_dfu),
+                               sizeof(usb_fs_descs.func_dfu)),
 #ifdef WITH_DEBUG_CDC
                .bNumInterfaces = 4,
 #else
@@ -165,7 +165,7 @@
                        .bcdCCID = LE16(0x0110),
                        .bMaxSlotIndex = 7,
                        .bVoltageSupport = 0x07, /* 5/3/1.8V */
-                       .dwProtocols = 0x01, /* only t0 */
+                       .dwProtocols = LE16(0x01), /* only t0 */
                        .dwDefaultClock = LE32(2500),
                        .dwMaximumClock = LE32(20000),
                        .bNumClockSupported = CCID_NUM_CLK_SUPPORTED,
@@ -182,7 +182,7 @@
                         * 0x10 Automatic ICC clock frequency change according 
to active parameters
                         *  provided by the Host or self determined */
                        .dwFeatures = LE32(0x10 | 0x20 | 0x80 | 0x00010000),
-                       .dwMaxCCIDMessageLength = 272,
+                       .dwMaxCCIDMessageLength = LE16(272),
                        .bClassGetResponse = 0xff,
                        .bClassEnvelope = 0xff,
                        .wLcdLayout = LE16(0),
@@ -195,7 +195,7 @@
                                .bDescriptorType = USB_DT_ENDPOINT,
                                .bEndpointAddress = 0x02,
                                .bmAttributes = USB_EP_TYPE_BULK,
-                               .wMaxPacketSize = 64,
+                               .wMaxPacketSize = LE16(64),
                                .bInterval = 0,
                        },
                        {       /* Bulk-IN descriptor */
@@ -203,7 +203,7 @@
                                .bDescriptorType = USB_DT_ENDPOINT,
                                .bEndpointAddress = 0x83,
                                .bmAttributes = USB_EP_TYPE_BULK,
-                               .wMaxPacketSize = 64,
+                               .wMaxPacketSize = LE16(64),
                                .bInterval = 0,
                        },
                        {       /* Interrupt dscriptor */
@@ -211,7 +211,7 @@
                                .bDescriptorType = USB_DT_ENDPOINT,
                                .bEndpointAddress = 0x84,
                                .bmAttributes = USB_EP_TYPE_INTERRUPT,
-                               .wMaxPacketSize = 4,
+                               .wMaxPacketSize = LE16(4),
                                .bInterval = 0x10,
                        },
                },

--
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/42621?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: Ia77d65faf56c5d3c57cc76c91af33fce4fbbff5c
Gerrit-Change-Number: 42621
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <[email protected]>

Reply via email to