diff options
Diffstat (limited to 'LUFA/Drivers/USB/Class')
31 files changed, 89 insertions, 82 deletions
diff --git a/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h b/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h index 00eedd8e8..c2528d99e 100644 --- a/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h +++ b/LUFA/Drivers/USB/Class/AndroidAccessoryClass.h @@ -73,3 +73,4 @@ /** @} */
+ diff --git a/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h b/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h index 45e7ca540..b9a8dd53a 100644 --- a/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h @@ -125,3 +125,4 @@ /** @} */
+ diff --git a/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h b/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h index 32a66409b..8f9a10758 100644 --- a/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/AudioClassCommon.h @@ -218,7 +218,7 @@ * allows for pitch adjustments to be made via control requests directed at the endpoint. */ #define AUDIO_EP_PITCH_CONTROL (1 << 1) - + /* Enums: */ /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Audio * device class. @@ -244,7 +244,7 @@ * interface belongs to the Streaming Audio protocol. */ }; - + /** Audio class specific interface description subtypes, for the Audio Control interface. */ enum Audio_CSInterface_AC_SubTypes_t { @@ -287,7 +287,7 @@ AUDIO_REQ_GetMemory = 0x85, /**< Audio class-specific request to get the memory value of a parameter within the device. */ AUDIO_REQ_GetStatus = 0xFF, /**< Audio class-specific request to get the device status. */ }; - + /** Enum for Audio class specific Endpoint control modifiers which can be set and retrieved by a USB host, if the corresponding * endpoint control is indicated to be supported in the Endpoint's Audio-class specific endpoint descriptor. */ diff --git a/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h b/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h index 45e0c5851..1d01c82f5 100644 --- a/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/CDCClassCommon.h @@ -111,7 +111,7 @@ */ #define CDC_CONTROL_LINE_IN_OVERRUNERROR (1 << 6) //@} - + /** Macro to define a CDC class-specific functional descriptor. CDC functional descriptors have a * uniform structure but variable sized data payloads, thus cannot be represented accurately by * a single typedef struct. A macro is used instead so that functional descriptors can be created @@ -161,7 +161,7 @@ * belongs to no specific protocol of the CDC data class. */ }; - + /** Enum for the CDC class specific control requests that can be issued by the USB bus host. */ enum CDC_ClassRequests_t { @@ -355,7 +355,7 @@ uint8_t bMasterInterface; /**< Interface number of the CDC Control interface. */ uint8_t bSlaveInterface0; /**< Interface number of the CDC Data interface. */ } ATTR_PACKED USB_CDC_StdDescriptor_FunctionalUnion_t; - + /** \brief CDC Virtual Serial Port Line Encoding Settings Structure. * * Type define for a CDC Line Encoding structure, used to hold the various encoding parameters for a virtual diff --git a/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h b/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h index 95b3484fd..6e5187bbf 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/HIDClassCommon.h @@ -91,7 +91,7 @@ /** Constant for a keyboard report modifier byte, indicating that the keyboard's right GUI key is currently pressed. */ #define HID_KEYBOARD_MODIFIER_RIGHTGUI (1 << 7) //@} - + /** \name Keyboard Standard Report LED Masks */ //@{ /** Constant for a keyboard output report LED byte, indicating that the host's NUM LOCK mode is currently set. */ @@ -108,7 +108,7 @@ //@} /** \name Keyboard Standard Report Key Scan-codes */ - //@{ + //@{ #define HID_KEYBOARD_SC_ERROR_ROLLOVER 0x01 #define HID_KEYBOARD_SC_POST_FAIL 0x02 #define HID_KEYBOARD_SC_ERROR_UNDEFINED 0x03 @@ -208,7 +208,7 @@ #define HID_KEYBOARD_SC_KEYPAD_9_AND_PAGE_UP 0x61 #define HID_KEYBOARD_SC_KEYPAD_0_AND_INSERT 0x62 #define HID_KEYBOARD_SC_KEYPAD_DOT_AND_DELETE 0x63 - #define HID_KEYBOARD_SC_NON_US_BACKSLASH_AND_PIPE 0x64 + #define HID_KEYBOARD_SC_NON_US_BACKSLASH_AND_PIPE 0x64 #define HID_KEYBOARD_SC_POWER 0x66 #define HID_KEYBOARD_SC_EQUAL_SIGN 0x67 #define HID_KEYBOARD_SC_F13 0x68 @@ -496,7 +496,7 @@ * \param[in] VendorPageNum Vendor Defined HID Usage Page index, ranging from 0x00 to 0xFF. * \param[in] CollectionUsage Vendor Usage for the encompassing report IN and OUT collection, ranging from 0x00 to 0xFF. * \param[in] DataINUsage Vendor Usage for the IN report data, ranging from 0x00 to 0xFF. - * \param[in] DataOUTUsage Vendor Usage for the OUT report data, ranging from 0x00 to 0xFF. + * \param[in] DataOUTUsage Vendor Usage for the OUT report data, ranging from 0x00 to 0xFF. * \param[in] NumBytes Length of the data IN and OUT reports. */ #define HID_DESCRIPTOR_VENDOR(VendorPageNum, CollectionUsage, DataINUsage, DataOUTUsage, NumBytes) \ @@ -517,7 +517,7 @@ HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), \ HID_RI_END_COLLECTION(0) //@} - + /* Type Defines: */ /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the HID * device class. @@ -543,7 +543,7 @@ * belongs to the Mouse HID boot protocol. */ }; - + /** Enum for the HID class specific control requests that can be issued by the USB bus host. */ enum HID_ClassRequests_t { diff --git a/LUFA/Drivers/USB/Class/Common/HIDParser.c b/LUFA/Drivers/USB/Class/Common/HIDParser.c index 903b039df..24b284c1d 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDParser.c +++ b/LUFA/Drivers/USB/Class/Common/HIDParser.c @@ -98,7 +98,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData, case HID_RI_USAGE_PAGE(0): if ((HIDReportItem & HID_RI_DATA_SIZE_MASK) == HID_RI_DATA_BITS_32) CurrStateTable->Attributes.Usage.Page = (ReportItemData >> 16); - + CurrStateTable->Attributes.Usage.Page = ReportItemData; break; case HID_RI_LOGICAL_MINIMUM(0): @@ -359,3 +359,4 @@ uint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData, return 0; } + diff --git a/LUFA/Drivers/USB/Class/Common/HIDParser.h b/LUFA/Drivers/USB/Class/Common/HIDParser.h index 3e3bb237e..25e201b36 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDParser.h +++ b/LUFA/Drivers/USB/Class/Common/HIDParser.h @@ -71,7 +71,7 @@ #include "HIDReportData.h" #include "HIDClassCommon.h" - + /* Enable C linkage for C++ Compilers: */ #if defined(__cplusplus) extern "C" { diff --git a/LUFA/Drivers/USB/Class/Common/HIDReportData.h b/LUFA/Drivers/USB/Class/Common/HIDReportData.h index 2b96eeabc..2c36e8ea8 100644 --- a/LUFA/Drivers/USB/Class/Common/HIDReportData.h +++ b/LUFA/Drivers/USB/Class/Common/HIDReportData.h @@ -63,15 +63,15 @@ #define HID_RI_DATA_BITS_32 0x03 #define HID_RI_DATA_BITS(DataBits) HID_RI_DATA_BITS_ ## DataBits - #define _HID_RI_ENCODE_0(Data) + #define _HID_RI_ENCODE_0(Data) #define _HID_RI_ENCODE_8(Data) , (Data & 0xFF) #define _HID_RI_ENCODE_16(Data) _HID_RI_ENCODE_8(Data) _HID_RI_ENCODE_8(Data >> 8) #define _HID_RI_ENCODE_32(Data) _HID_RI_ENCODE_16(Data) _HID_RI_ENCODE_16(Data >> 16) #define _HID_RI_ENCODE(DataBits, ...) _HID_RI_ENCODE_ ## DataBits(__VA_ARGS__) - + #define _HID_RI_ENTRY(Type, Tag, DataBits, ...) (Type | Tag | HID_RI_DATA_BITS(DataBits)) _HID_RI_ENCODE(DataBits, (__VA_ARGS__)) #endif - + /* Public Interface - May be used in end-application: */ /* Macros: */ /** \name HID Input, Output and Feature Report Descriptor Item Flags */ @@ -95,7 +95,7 @@ #define HID_IOF_BUFFERED_BYTES (1 << 8) #define HID_IOF_BITFIELD (0 << 8) //@} - + /** \name HID Report Descriptor Item Macros */ //@{ #define HID_RI_INPUT(DataBits, ...) _HID_RI_ENTRY(HID_RI_TYPE_MAIN , 0x80, DataBits, __VA_ARGS__) diff --git a/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h b/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h index 49246ba7d..9d37b3db5 100644 --- a/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/MassStorageClassCommon.h @@ -117,7 +117,7 @@ /** SCSI Command Code for a MODE SENSE (10) command. */ #define SCSI_CMD_MODE_SENSE_10 0x5A //@} - + /** \name SCSI Sense Key Values */ //@{ /** SCSI Sense Code to indicate no error has occurred. */ @@ -164,7 +164,7 @@ /** SCSI Sense Code to indicate that the source data did not match the data read from the medium. */ #define SCSI_SENSE_KEY_MISCOMPARE 0x0E //@} - + /** \name SCSI Additional Sense Codes */ //@{ /** SCSI Additional Sense Code to indicate no additional sense information is available. */ @@ -196,7 +196,7 @@ /** SCSI Additional Sense Code to indicate that no removable medium is inserted into the device. */ #define SCSI_ASENSE_MEDIUM_NOT_PRESENT 0x3A //@} - + /** \name SCSI Additional Sense Key Code Qualifiers */ //@{ /** SCSI Additional Sense Qualifier Code to indicate no additional sense qualifier information is available. */ @@ -213,7 +213,7 @@ /** SCSI Additional Sense Qualifier Code to indicate that an operation is currently in progress. */ #define SCSI_ASENSEQ_OPERATION_IN_PROGRESS 0x07 //@} - + /* Enums: */ /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the Mass * Storage device class. @@ -231,7 +231,7 @@ * belongs to the Bulk Only Transport protocol of the Mass Storage class. */ }; - + /** Enum for the Mass Storage class specific control requests that can be issued by the USB bus host. */ enum MS_ClassRequests_t { diff --git a/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h b/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h index 3d52be306..c370bbc9b 100644 --- a/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/PrinterClassCommon.h @@ -92,7 +92,7 @@ * belongs to the Bidirectional protocol of the Printer class. */ }; - + /** Enum for the Printer class specific control requests that can be issued by the USB bus host. */ enum PRNT_ClassRequests_t { @@ -106,7 +106,7 @@ PRNT_REQ_SoftReset = 0x02, /**< Printer class-specific request to reset the device, ready for new * printer commands. */ - }; + }; /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) diff --git a/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h b/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h index 30840f5a3..82c2a9592 100644 --- a/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/RNDISClassCommon.h @@ -113,7 +113,7 @@ #define REMOTE_NDIS_MEDIA_STATE_CONNECTED 0x00000000UL #define REMOTE_NDIS_MEDIA_STATE_DISCONNECTED 0x00000001UL //@} - + /** \name RNDIS Media Types */ //@{ #define REMOTE_NDIS_MEDIUM_802_3 0x00000000UL @@ -124,7 +124,7 @@ #define REMOTE_NDIS_DF_CONNECTIONLESS 0x00000001UL #define REMOTE_NDIS_DF_CONNECTION_ORIENTED 0x00000002UL //@} - + /** \name RNDIS Packet Types */ //@{ #define REMOTE_NDIS_PACKET_DIRECTED 0x00000001UL @@ -140,7 +140,7 @@ #define REMOTE_NDIS_PACKET_FUNCTIONAL 0x00004000UL #define REMOTE_NDIS_PACKET_MAC_FRAME 0x00008000UL //@} - + /** \name RNDIS OID Values */ //@{ #define OID_GEN_SUPPORTED_LIST 0x00010101UL diff --git a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c index d8c5d29eb..3ac47d567 100644 --- a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c @@ -50,16 +50,16 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi else if ((USB_ControlRequest.bmRequestType & CONTROL_REQTYPE_RECIPIENT) == REQREC_ENDPOINT) { bool EndpointFilterMatch = false; - + EndpointFilterMatch |= (AudioInterfaceInfo->Config.DataINEndpointNumber && ((uint8_t)USB_ControlRequest.wIndex == (ENDPOINT_DIR_IN | AudioInterfaceInfo->Config.DataINEndpointNumber))); - + EndpointFilterMatch |= (AudioInterfaceInfo->Config.DataOUTEndpointNumber && ((uint8_t)USB_ControlRequest.wIndex == (ENDPOINT_DIR_OUT | AudioInterfaceInfo->Config.DataOUTEndpointNumber))); if (!(EndpointFilterMatch)) return; - } + } switch (USB_ControlRequest.bRequest) { @@ -92,20 +92,20 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi uint8_t EndpointProperty = USB_ControlRequest.bRequest; uint8_t EndpointAddress = (uint8_t)USB_ControlRequest.wIndex; uint8_t EndpointControl = (USB_ControlRequest.wValue >> 8); - + if (CALLBACK_Audio_Device_GetSetEndpointProperty(AudioInterfaceInfo, EndpointProperty, EndpointAddress, EndpointControl, NULL, NULL)) { uint16_t ValueLength = USB_ControlRequest.wLength; uint8_t Value[ValueLength]; - + Endpoint_ClearSETUP(); Endpoint_Read_Control_Stream_LE(Value, ValueLength); - Endpoint_ClearIN(); + Endpoint_ClearIN(); CALLBACK_Audio_Device_GetSetEndpointProperty(AudioInterfaceInfo, EndpointProperty, EndpointAddress, EndpointControl, &ValueLength, Value); - } + } } break; @@ -126,7 +126,7 @@ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const Audi { Endpoint_ClearSETUP(); Endpoint_Write_Control_Stream_LE(Value, ValueLength); - Endpoint_ClearOUT(); + Endpoint_ClearOUT(); } } @@ -180,3 +180,4 @@ void Audio_Device_Event_Stub(void) } #endif + diff --git a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h index 0f2185b8b..aba4248fc 100644 --- a/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h +++ b/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h @@ -126,7 +126,7 @@ * \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state. */ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1); - + /** Audio class driver callback for the setting and retrieval of streaming endpoint properties. This callback must be implemented * in the user application to handle property manipulations on streaming audio endpoints. * @@ -357,12 +357,12 @@ /* Function Prototypes: */ #if defined(__INCLUDE_FROM_AUDIO_DEVICE_C) void Audio_Device_Event_Stub(void) ATTR_CONST; - + void EVENT_Audio_Device_StreamStartStop(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(Audio_Device_Event_Stub); #endif - #endif + #endif /* Disable C linkage for C++ Compilers: */ #if defined(__cplusplus) diff --git a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c index e3b05e037..016744087 100644 --- a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c @@ -78,7 +78,7 @@ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const CDCInter Endpoint_ClearOUT(); Endpoint_ClearStatusStage(); - + EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo); } diff --git a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h index 24942560f..a172e4ac1 100644 --- a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h +++ b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h @@ -334,7 +334,7 @@ #endif void CDC_Device_Event_Stub(void) ATTR_CONST; - + void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Device_Event_Stub); void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) diff --git a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c index 9b5a7dd35..071f55f49 100644 --- a/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c @@ -64,7 +64,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter memcpy(HIDInterfaceInfo->Config.PrevReportINBuffer, ReportData, HIDInterfaceInfo->Config.PrevReportINBufferSize); } - + Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP); Endpoint_ClearSETUP(); @@ -84,7 +84,7 @@ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInter Endpoint_ClearSETUP(); Endpoint_Read_Control_Stream_LE(ReportData, ReportSize); Endpoint_ClearIN(); - + CALLBACK_HID_Device_ProcessHIDReport(HIDInterfaceInfo, ReportID, ReportType, &ReportData[ReportID ? 1 : 0], ReportSize - (ReportID ? 1 : 0)); } diff --git a/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h b/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h index 350978033..603b05f61 100644 --- a/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h +++ b/LUFA/Drivers/USB/Class/Device/MIDIClassDevice.h @@ -91,7 +91,7 @@ } Config; /**< Config data for the USB class interface within the device. All elements in this section * <b>must</b> be set or the interface will fail to enumerate and operate correctly. */ - + struct { // No state information for this class diff --git a/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c b/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c index 1e3fe3412..d95b95e0d 100644 --- a/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/MassStorageClassDevice.c @@ -160,7 +160,7 @@ static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_Device_t* const MSInte uint16_t BytesProcessed; Endpoint_SelectEndpoint(MSInterfaceInfo->Config.DataOUTEndpointNumber); - + BytesProcessed = 0; while (Endpoint_Read_Stream_LE(&MSInterfaceInfo->State.CommandBlock, (sizeof(MS_CommandBlockWrapper_t) - 16), &BytesProcessed) == @@ -231,8 +231,9 @@ static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_Device_t* const MSInt if (MSInterfaceInfo->State.IsMassStoreReset) return; } - + Endpoint_ClearIN(); } #endif + diff --git a/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c b/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c index 12115ee5e..1db5ec42c 100644 --- a/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/RNDISClassDevice.c @@ -238,7 +238,7 @@ void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const uint16_t ResponseSize; QUERY_Response->MessageType = CPU_TO_LE32(REMOTE_NDIS_QUERY_CMPLT); - + if (RNDIS_Device_ProcessNDISQuery(RNDISInterfaceInfo, Query_Oid, QueryData, le32_to_cpu(QUERY_Message->InformationBufferLength), ResponseData, &ResponseSize)) { @@ -453,7 +453,7 @@ bool RNDIS_Device_IsPacketReceived(USB_ClassInfo_RNDIS_Device_t* const RNDISInte { return false; } - + Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpointNumber); return Endpoint_IsOUTReceived(); } @@ -467,15 +467,15 @@ uint8_t RNDIS_Device_ReadPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfa { return ENDPOINT_RWSTREAM_DeviceDisconnected; } - + Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataOUTEndpointNumber); - + *PacketLength = 0; if (!(Endpoint_IsOUTReceived())) return ENDPOINT_RWSTREAM_NoError; - RNDIS_Packet_Message_t RNDISPacketHeader; + RNDIS_Packet_Message_t RNDISPacketHeader; Endpoint_Read_Stream_LE(&RNDISPacketHeader, sizeof(RNDIS_Packet_Message_t), NULL); if (le32_to_cpu(RNDISPacketHeader.DataLength) > ETHERNET_FRAME_SIZE_MAX) @@ -484,12 +484,12 @@ uint8_t RNDIS_Device_ReadPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfa return RNDIS_ERROR_LOGICAL_CMD_FAILED; } - + *PacketLength = (uint16_t)le32_to_cpu(RNDISPacketHeader.DataLength); Endpoint_Read_Stream_LE(Buffer, *PacketLength, NULL); Endpoint_ClearOUT(); - + return ENDPOINT_RWSTREAM_NoError; } @@ -504,7 +504,7 @@ uint8_t RNDIS_Device_SendPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfa { return ENDPOINT_RWSTREAM_DeviceDisconnected; } - + Endpoint_SelectEndpoint(RNDISInterfaceInfo->Config.DataINEndpointNumber); if ((ErrorCode = Endpoint_WaitUntilReady()) != ENDPOINT_READYWAIT_NoError) diff --git a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c index 8ff64299f..2bac70dad 100644 --- a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c @@ -443,3 +443,4 @@ static int AOA_Host_getchar_Blocking(FILE* Stream) #endif
+ diff --git a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h index 262ecbe73..a6d024a41 100644 --- a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.h @@ -325,3 +325,4 @@ /** @} */
+ diff --git a/LUFA/Drivers/USB/Class/Host/AudioClassHost.c b/LUFA/Drivers/USB/Class/Host/AudioClassHost.c index af6f0ec53..8caea9be1 100644 --- a/LUFA/Drivers/USB/Class/Host/AudioClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/AudioClassHost.c @@ -68,7 +68,7 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa return AUDIO_ENUMERROR_NoCompatibleInterfaceFound; } - AudioControlInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t); + AudioControlInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t); if (USB_GetNextDescriptorComp(&ConfigDescriptorSize, &ConfigDescriptorData, DCOMP_Audio_Host_NextAudioStreamInterface) != DESCRIPTOR_SEARCH_COMP_Found) @@ -78,7 +78,7 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa } AudioStreamingInterface = DESCRIPTOR_PCAST(ConfigDescriptorData, USB_Descriptor_Interface_t); - + DataINEndpoint = NULL; DataOUTEndpoint = NULL; @@ -125,7 +125,7 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa { continue; } - + if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size, DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE))) { @@ -137,7 +137,7 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa AudioInterfaceInfo->State.StreamingInterfaceNumber = AudioStreamingInterface->InterfaceNumber; AudioInterfaceInfo->State.EnabledStreamingAltIndex = AudioStreamingInterface->AlternateSetting; AudioInterfaceInfo->State.IsActive = true; - + return AUDIO_ENUMERROR_NoError; } @@ -225,7 +225,7 @@ uint8_t Audio_Host_GetSetEndpointProperty(USB_ClassInfo_Audio_Host_t* const Audi RequestType = (REQDIR_DEVICETOHOST | REQTYPE_CLASS | REQREC_ENDPOINT); else RequestType = (REQDIR_HOSTTODEVICE | REQTYPE_CLASS | REQREC_ENDPOINT); - + Pipe_SelectPipe(DataPipeIndex); EndpointAddress = Pipe_GetBoundEndpointAddress(); diff --git a/LUFA/Drivers/USB/Class/Host/AudioClassHost.h b/LUFA/Drivers/USB/Class/Host/AudioClassHost.h index 1940c0de5..781220ee6 100644 --- a/LUFA/Drivers/USB/Class/Host/AudioClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/AudioClassHost.h @@ -98,7 +98,7 @@ */ uint8_t ControlInterfaceNumber; /**< Interface index of the Audio Control interface within the attached device. */ uint8_t StreamingInterfaceNumber; /**< Interface index of the Audio Streaming interface within the attached device. */ - + uint8_t EnabledStreamingAltIndex; /**< Alternative setting index of the Audio Streaming interface when the stream is enabled. */ uint16_t DataINPipeSize; /**< Size in bytes of the Audio interface's IN data pipe. */ @@ -331,7 +331,7 @@ const int8_t Sample) { (void)AudioInterfaceInfo; - + Pipe_Write_8(Sample); if (!(Pipe_IsReadWriteAllowed())) @@ -357,7 +357,7 @@ const int16_t Sample) { (void)AudioInterfaceInfo; - + Pipe_Write_16_LE(Sample); if (!(Pipe_IsReadWriteAllowed())) @@ -395,7 +395,7 @@ Pipe_Freeze(); } } - + /* Private Interface - For use in library only: */ #if !defined(__DOXYGEN__) /* Function Prototypes: */ diff --git a/LUFA/Drivers/USB/Class/Host/CDCClassHost.c b/LUFA/Drivers/USB/Class/Host/CDCClassHost.c index 184406643..dfe491ad7 100644 --- a/LUFA/Drivers/USB/Class/Host/CDCClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/CDCClassHost.c @@ -145,13 +145,13 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo { continue; } - + if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size, DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE))) { return CDC_ENUMERROR_PipeConfigurationFailed; } - + if (InterruptPeriod) Pipe_SetInterruptPeriod(InterruptPeriod); } diff --git a/LUFA/Drivers/USB/Class/Host/CDCClassHost.h b/LUFA/Drivers/USB/Class/Host/CDCClassHost.h index 247bf2426..3ab01927a 100644 --- a/LUFA/Drivers/USB/Class/Host/CDCClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/CDCClassHost.h @@ -334,7 +334,7 @@ #endif void CDC_Host_Event_Stub(void) ATTR_CONST; - + void EVENT_CDC_Host_ControLineStateChanged(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Host_Event_Stub); diff --git a/LUFA/Drivers/USB/Class/Host/HIDClassHost.c b/LUFA/Drivers/USB/Class/Host/HIDClassHost.c index 88e3c4993..5254f71c4 100644 --- a/LUFA/Drivers/USB/Class/Host/HIDClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/HIDClassHost.c @@ -118,7 +118,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo { if (DataOUTEndpoint == NULL) continue; - + Size = le16_to_cpu(DataOUTEndpoint->EndpointSize); EndpointAddress = DataOUTEndpoint->EndpointAddress; Token = PIPE_TOKEN_OUT; @@ -139,7 +139,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo { return HID_ENUMERROR_PipeConfigurationFailed; } - + if (InterruptPeriod) Pipe_SetInterruptPeriod(InterruptPeriod); } diff --git a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c index 109b075d9..6795d2adb 100644 --- a/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/MIDIClassHost.c @@ -171,7 +171,7 @@ void MIDI_Host_USBTask(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo) #if !defined(NO_CLASS_DRIVER_AUTOFLUSH) MIDI_Host_Flush(MIDIInterfaceInfo); - #endif + #endif } uint8_t MIDI_Host_Flush(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceInfo) diff --git a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c index 8a69d1578..7422a5e1a 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.c @@ -103,7 +103,7 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo, Token = PIPE_TOKEN_OUT; Type = EP_TYPE_BULK; DoubleBanked = MSInterfaceInfo->Config.DataOUTPipeDoubleBank; - + MSInterfaceInfo->State.DataOUTPipeSize = DataOUTEndpoint->EndpointSize; } else @@ -186,7 +186,7 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInf { return ErrorCode; } - + Pipe_ClearOUT(); Pipe_WaitUntilReady(); @@ -195,14 +195,14 @@ static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInf if (BufferPtr != NULL) { ErrorCode = MS_Host_SendReceiveData(MSInterfaceInfo, SCSICommandBlock, (void*)BufferPtr); - + if ((ErrorCode != PIPE_RWSTREAM_NoError) && (ErrorCode != PIPE_RWSTREAM_PipeStalled)) { Pipe_Freeze(); return ErrorCode; } } - + MS_CommandStatusWrapper_t SCSIStatusBlock; return MS_Host_GetReturnedStatus(MSInterfaceInfo, &SCSIStatusBlock); } @@ -348,9 +348,9 @@ uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) if ((ErrorCode = USB_Host_SendControlRequest(NULL)) != HOST_SENDCONTROL_Successful) return ErrorCode; - + Pipe_SelectPipe(MSInterfaceInfo->Config.DataINPipeNumber); - + if ((ErrorCode = USB_Host_ClearEndpointStall(Pipe_GetBoundEndpointAddress())) != HOST_SENDCONTROL_Successful) return ErrorCode; diff --git a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h index c03ba2027..772c46bc1 100644 --- a/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h +++ b/LUFA/Drivers/USB/Class/Host/MassStorageClassHost.h @@ -149,7 +149,7 @@ void* DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3); /** Sends a MASS STORAGE RESET control request to the attached device, resetting the Mass Storage Interface - * and readying it for the next Mass Storage command. This should be called after a failed SCSI request to + * and readying it for the next Mass Storage command. This should be called after a failed SCSI request to * ensure the attached Mass Storage device is ready to receive the next command. * * \param[in,out] MSInterfaceInfo Pointer to a structure containing a MS Class host configuration and state. diff --git a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c index 61f14020c..c06968c23 100644 --- a/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/RNDISClassHost.c @@ -147,13 +147,13 @@ uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfa { continue; } - + if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size, DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE))) { return CDC_ENUMERROR_PipeConfigurationFailed; } - + if (InterruptPeriod) Pipe_SetInterruptPeriod(InterruptPeriod); } @@ -241,7 +241,7 @@ static uint8_t RNDIS_SendEncapsulatedCommand(USB_ClassInfo_RNDIS_Host_t* const R }; Pipe_SelectPipe(PIPE_CONTROLPIPE); - + return USB_Host_SendControlRequest(Buffer); } @@ -259,7 +259,7 @@ static uint8_t RNDIS_GetEncapsulatedResponse(USB_ClassInfo_RNDIS_Host_t* const R }; Pipe_SelectPipe(PIPE_CONTROLPIPE); - + return USB_Host_SendControlRequest(Buffer); } diff --git a/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c b/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c index 31f581355..62fe4e585 100644 --- a/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/StillImageClassHost.c @@ -133,13 +133,13 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo, { continue; } - + if (!(Pipe_ConfigurePipe(PipeNum, Type, Token, EndpointAddress, Size, DoubleBanked ? PIPE_BANK_DOUBLE : PIPE_BANK_SINGLE))) { return SI_ENUMERROR_PipeConfigurationFailed; } - + if (InterruptPeriod) Pipe_SetInterruptPeriod(InterruptPeriod); } |