usb: gadget: ccid: Fix data types of header structures

Replace unsigned long with __u32 as 4 bytes is the length
of field where as unsigned long could be 8 bytes on 64 bit
machine. Also, replace short and char with u16 and u8
respectively for better readability.

Change-Id: I8637f6b32d56d90c01b4453b4677f40d5b865bf6
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
This commit is contained in:
Manu Gautam 2017-03-20 17:00:52 +05:30
parent f39a5999e2
commit 741ee54947
2 changed files with 40 additions and 40 deletions

View file

@ -55,29 +55,29 @@
#define CCID_READ_DTR _IOR('C', 3, int) #define CCID_READ_DTR _IOR('C', 3, int)
struct usb_ccid_notification { struct usb_ccid_notification {
unsigned char buf[4]; __u8 buf[4];
} __packed; } __packed;
struct ccid_bulk_in_header { struct ccid_bulk_in_header {
unsigned char bMessageType; __u8 bMessageType;
unsigned long wLength; __u32 wLength;
unsigned char bSlot; __u8 bSlot;
unsigned char bSeq; __u8 bSeq;
unsigned char bStatus; __u8 bStatus;
unsigned char bError; __u8 bError;
unsigned char bSpecific; __u8 bSpecific;
unsigned char abData[ABDATA_SIZE]; __u8 abData[ABDATA_SIZE];
unsigned char bSizeToSend; __u8 bSizeToSend;
} __packed; } __packed;
struct ccid_bulk_out_header { struct ccid_bulk_out_header {
unsigned char bMessageType; __u8 bMessageType;
unsigned long wLength; __u32 wLength;
unsigned char bSlot; __u8 bSlot;
unsigned char bSeq; __u8 bSeq;
unsigned char bSpecific_0; __u8 bSpecific_0;
unsigned char bSpecific_1; __u8 bSpecific_1;
unsigned char bSpecific_2; __u8 bSpecific_2;
unsigned char APDU[ABDATA_SIZE]; __u8 APDU[ABDATA_SIZE];
} __packed; } __packed;
#endif #endif

View file

@ -86,27 +86,27 @@
* Table 5.1-1 Smart Card Device Class descriptors * Table 5.1-1 Smart Card Device Class descriptors
*/ */
struct usb_ccid_class_descriptor { struct usb_ccid_class_descriptor {
unsigned char bLength; __u8 bLength;
unsigned char bDescriptorType; __u8 bDescriptorType;
unsigned short bcdCCID; __u16 bcdCCID;
unsigned char bMaxSlotIndex; __u8 bMaxSlotIndex;
unsigned char bVoltageSupport; __u8 bVoltageSupport;
unsigned long dwProtocols; __u32 dwProtocols;
unsigned long dwDefaultClock; __u32 dwDefaultClock;
unsigned long dwMaximumClock; __u32 dwMaximumClock;
unsigned char bNumClockSupported; __u8 bNumClockSupported;
unsigned long dwDataRate; __u32 dwDataRate;
unsigned long dwMaxDataRate; __u32 dwMaxDataRate;
unsigned char bNumDataRatesSupported; __u8 bNumDataRatesSupported;
unsigned long dwMaxIFSD; __u32 dwMaxIFSD;
unsigned long dwSynchProtocols; __u32 dwSynchProtocols;
unsigned long dwMechanical; __u32 dwMechanical;
unsigned long dwFeatures; __u32 dwFeatures;
unsigned long dwMaxCCIDMessageLength; __u32 dwMaxCCIDMessageLength;
unsigned char bClassGetResponse; __u8 bClassGetResponse;
unsigned char bClassEnvelope; __u8 bClassEnvelope;
unsigned short wLcdLayout; __u16 wLcdLayout;
unsigned char bPINSupport; __u8 bPINSupport;
unsigned char bMaxCCIDBusySlots; __u8 bMaxCCIDBusySlots;
} __packed; } __packed;
#endif #endif