mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-16 21:01:31 +00:00
Fix incorrect error codes returned on pip config failure in the host class drivers.
This commit is contained in:
parent
00ddff45c1
commit
261284f5e1
@ -7,7 +7,10 @@
|
|||||||
/** \page Page_ChangeLog Project Changelog
|
/** \page Page_ChangeLog Project Changelog
|
||||||
*
|
*
|
||||||
* \section Sec_ChangeLogXXXXXX Version XXXXXX
|
* \section Sec_ChangeLogXXXXXX Version XXXXXX
|
||||||
* None
|
* <b>Fixed:</b>
|
||||||
|
* - Core:
|
||||||
|
* - Fixed device class driver pipe configuration routines returning success with a partially constructed instance
|
||||||
|
* when a pipe configuration failed (thanks to Helge Suess)
|
||||||
*
|
*
|
||||||
* \section Sec_ChangeLog140302 Version 140302
|
* \section Sec_ChangeLog140302 Version 140302
|
||||||
* <b>New:</b>
|
* <b>New:</b>
|
||||||
|
@ -98,10 +98,10 @@ uint8_t AOA_Host_ConfigurePipes(USB_ClassInfo_AOA_Host_t* const AOAInterfaceInfo
|
|||||||
AOAInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
|
AOAInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&AOAInterfaceInfo->Config.DataINPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&AOAInterfaceInfo->Config.DataINPipe, 1)))
|
||||||
return false;
|
return AOA_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&AOAInterfaceInfo->Config.DataOUTPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&AOAInterfaceInfo->Config.DataOUTPipe, 1)))
|
||||||
return false;
|
return AOA_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
AOAInterfaceInfo->State.IsActive = true;
|
AOAInterfaceInfo->State.IsActive = true;
|
||||||
AOAInterfaceInfo->State.InterfaceNumber = AOAInterface->InterfaceNumber;
|
AOAInterfaceInfo->State.InterfaceNumber = AOAInterface->InterfaceNumber;
|
||||||
|
@ -104,10 +104,10 @@ uint8_t Audio_Host_ConfigurePipes(USB_ClassInfo_Audio_Host_t* const AudioInterfa
|
|||||||
AudioInterfaceInfo->Config.DataOUTPipe.Banks = 2;
|
AudioInterfaceInfo->Config.DataOUTPipe.Banks = 2;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&AudioInterfaceInfo->Config.DataINPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&AudioInterfaceInfo->Config.DataINPipe, 1)))
|
||||||
return false;
|
return AUDIO_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&AudioInterfaceInfo->Config.DataOUTPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&AudioInterfaceInfo->Config.DataOUTPipe, 1)))
|
||||||
return false;
|
return AUDIO_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
AudioInterfaceInfo->State.ControlInterfaceNumber = AudioControlInterface->InterfaceNumber;
|
AudioInterfaceInfo->State.ControlInterfaceNumber = AudioControlInterface->InterfaceNumber;
|
||||||
AudioInterfaceInfo->State.StreamingInterfaceNumber = AudioStreamingInterface->InterfaceNumber;
|
AudioInterfaceInfo->State.StreamingInterfaceNumber = AudioStreamingInterface->InterfaceNumber;
|
||||||
|
@ -112,13 +112,13 @@ uint8_t CDC_Host_ConfigurePipes(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo
|
|||||||
CDCInterfaceInfo->Config.NotificationPipe.Type = EP_TYPE_INTERRUPT;
|
CDCInterfaceInfo->Config.NotificationPipe.Type = EP_TYPE_INTERRUPT;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.DataINPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.DataINPipe, 1)))
|
||||||
return false;
|
return CDC_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.DataOUTPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.DataOUTPipe, 1)))
|
||||||
return false;
|
return CDC_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.NotificationPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&CDCInterfaceInfo->Config.NotificationPipe, 1)))
|
||||||
return false;
|
return CDC_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
CDCInterfaceInfo->State.ControlInterfaceNumber = CDCControlInterface->InterfaceNumber;
|
CDCInterfaceInfo->State.ControlInterfaceNumber = CDCControlInterface->InterfaceNumber;
|
||||||
CDCInterfaceInfo->State.ControlLineStates.HostToDevice = (CDC_CONTROL_LINE_OUT_RTS | CDC_CONTROL_LINE_OUT_DTR);
|
CDCInterfaceInfo->State.ControlLineStates.HostToDevice = (CDC_CONTROL_LINE_OUT_RTS | CDC_CONTROL_LINE_OUT_DTR);
|
||||||
|
@ -99,7 +99,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
|
|||||||
HIDInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_INTERRUPT;
|
HIDInterfaceInfo->Config.DataINPipe.Type = EP_TYPE_INTERRUPT;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataINPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataINPipe, 1)))
|
||||||
return false;
|
return HID_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (DataOUTEndpoint)
|
if (DataOUTEndpoint)
|
||||||
{
|
{
|
||||||
@ -108,7 +108,7 @@ uint8_t HID_Host_ConfigurePipes(USB_ClassInfo_HID_Host_t* const HIDInterfaceInfo
|
|||||||
HIDInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_INTERRUPT;
|
HIDInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_INTERRUPT;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataOUTPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&HIDInterfaceInfo->Config.DataOUTPipe, 1)))
|
||||||
return false;
|
return HID_ENUMERROR_PipeConfigurationFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDInterfaceInfo->State.InterfaceNumber = HIDInterface->InterfaceNumber;
|
HIDInterfaceInfo->State.InterfaceNumber = HIDInterface->InterfaceNumber;
|
||||||
|
@ -87,10 +87,10 @@ uint8_t MIDI_Host_ConfigurePipes(USB_ClassInfo_MIDI_Host_t* const MIDIInterfaceI
|
|||||||
MIDIInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
|
MIDIInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&MIDIInterfaceInfo->Config.DataINPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&MIDIInterfaceInfo->Config.DataINPipe, 1)))
|
||||||
return false;
|
return MIDI_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&MIDIInterfaceInfo->Config.DataOUTPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&MIDIInterfaceInfo->Config.DataOUTPipe, 1)))
|
||||||
return false;
|
return MIDI_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
MIDIInterfaceInfo->State.InterfaceNumber = MIDIInterface->InterfaceNumber;
|
MIDIInterfaceInfo->State.InterfaceNumber = MIDIInterface->InterfaceNumber;
|
||||||
MIDIInterfaceInfo->State.IsActive = true;
|
MIDIInterfaceInfo->State.IsActive = true;
|
||||||
|
@ -87,10 +87,10 @@ uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
|
|||||||
MSInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
|
MSInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&MSInterfaceInfo->Config.DataINPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&MSInterfaceInfo->Config.DataINPipe, 1)))
|
||||||
return false;
|
return MS_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&MSInterfaceInfo->Config.DataOUTPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&MSInterfaceInfo->Config.DataOUTPipe, 1)))
|
||||||
return false;
|
return MS_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
MSInterfaceInfo->State.InterfaceNumber = MassStorageInterface->InterfaceNumber;
|
MSInterfaceInfo->State.InterfaceNumber = MassStorageInterface->InterfaceNumber;
|
||||||
MSInterfaceInfo->State.IsActive = true;
|
MSInterfaceInfo->State.IsActive = true;
|
||||||
|
@ -87,10 +87,10 @@ uint8_t PRNT_Host_ConfigurePipes(USB_ClassInfo_PRNT_Host_t* const PRNTInterfaceI
|
|||||||
PRNTInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
|
PRNTInterfaceInfo->Config.DataOUTPipe.Type = EP_TYPE_BULK;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&PRNTInterfaceInfo->Config.DataINPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&PRNTInterfaceInfo->Config.DataINPipe, 1)))
|
||||||
return false;
|
return PRNT_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&PRNTInterfaceInfo->Config.DataOUTPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&PRNTInterfaceInfo->Config.DataOUTPipe, 1)))
|
||||||
return false;
|
return PRNT_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
PRNTInterfaceInfo->State.InterfaceNumber = PrinterInterface->InterfaceNumber;
|
PRNTInterfaceInfo->State.InterfaceNumber = PrinterInterface->InterfaceNumber;
|
||||||
PRNTInterfaceInfo->State.AlternateSetting = PrinterInterface->AlternateSetting;
|
PRNTInterfaceInfo->State.AlternateSetting = PrinterInterface->AlternateSetting;
|
||||||
|
@ -114,13 +114,13 @@ uint8_t RNDIS_Host_ConfigurePipes(USB_ClassInfo_RNDIS_Host_t* const RNDISInterfa
|
|||||||
RNDISInterfaceInfo->Config.NotificationPipe.Type = EP_TYPE_INTERRUPT;
|
RNDISInterfaceInfo->Config.NotificationPipe.Type = EP_TYPE_INTERRUPT;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.DataINPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.DataINPipe, 1)))
|
||||||
return false;
|
return RNDIS_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.DataOUTPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.DataOUTPipe, 1)))
|
||||||
return false;
|
return RNDIS_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.NotificationPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&RNDISInterfaceInfo->Config.NotificationPipe, 1)))
|
||||||
return false;
|
return RNDIS_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
RNDISInterfaceInfo->State.ControlInterfaceNumber = RNDISControlInterface->InterfaceNumber;
|
RNDISInterfaceInfo->State.ControlInterfaceNumber = RNDISControlInterface->InterfaceNumber;
|
||||||
RNDISInterfaceInfo->State.IsActive = true;
|
RNDISInterfaceInfo->State.IsActive = true;
|
||||||
|
@ -100,13 +100,13 @@ uint8_t SI_Host_ConfigurePipes(USB_ClassInfo_SI_Host_t* const SIInterfaceInfo,
|
|||||||
SIInterfaceInfo->Config.EventsPipe.Type = EP_TYPE_INTERRUPT;
|
SIInterfaceInfo->Config.EventsPipe.Type = EP_TYPE_INTERRUPT;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.DataINPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.DataINPipe, 1)))
|
||||||
return false;
|
return SI_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.DataOUTPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.DataOUTPipe, 1)))
|
||||||
return false;
|
return SI_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.EventsPipe, 1)))
|
if (!(Pipe_ConfigurePipeTable(&SIInterfaceInfo->Config.EventsPipe, 1)))
|
||||||
return false;
|
return SI_ENUMERROR_PipeConfigurationFailed;
|
||||||
|
|
||||||
SIInterfaceInfo->State.InterfaceNumber = StillImageInterface->InterfaceNumber;
|
SIInterfaceInfo->State.InterfaceNumber = StillImageInterface->InterfaceNumber;
|
||||||
SIInterfaceInfo->State.IsActive = true;
|
SIInterfaceInfo->State.IsActive = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user