AnsweredAssumed Answered

Cavalier treatment of status returns in 5.0 Usb_Composite_Requests() in usb_composite.c

Question asked by John Strohm on Feb 25, 2015
Latest reply on Feb 27, 2015 by Kan_Li

In the Freescale 5.0 Beta USB stack, in file usb_composite.c, in routine Usb_Composite_Requests(), the following lines appear (line numbers added for convenience):

 

456:                    USB_HID_Requests(setup_packet,data,size,(void *)devicePtr->hid_handle);

468:                USB_Audio_Requests(setup_packet,data,size,(void *)devicePtr->audio_handle);

478:                        status = USB_CDC_Other_Requests(setup_packet,data,size, (void *)devicePtr->cdc_handle);

490:                        status = USB_MSC_Requests(setup_packet,data,size, (void *)devicePtr->msc_handle);

504:                    USB_PHDC_Requests(setup_packet,data,size,(void *)devicePtr->phdc_handle);

 

USB_HID_Requests() returns a status.

USB_Audio_Requests() returns a status.  (Also, usb_audio.c contains a prototype for Usb_Audio_Other_Requests().  That should probably change to Usb_Audio_Requests().)

USB_PHDC_Requests() returns a status.

 

All of them may return error status, not just USB_OK.

 

The lines should probably be changed to:

 

456:                    status = USB_HID_Requests(setup_packet,data,size,(void *)devicePtr->hid_handle);

468:                status = USB_Audio_Requests(setup_packet,data,size,(void *)devicePtr->audio_handle);

478:                        status = USB_CDC_Other_Requests(setup_packet,data,size, (void *)devicePtr->cdc_handle);

490:                        status = USB_MSC_Requests(setup_packet,data,size, (void *)devicePtr->msc_handle);

504:                    status = USB_PHDC_Requests(setup_packet,data,size,(void *)devicePtr->phdc_handle);

Outcomes