1: uhs_status_t Usbh_Api_ClearFeature(
2:
struct usb_control_block* ucb,
3:
struct usbd_usb_deviceinfo* usbdev,
4:
const uhs_ubit8_t bmRequest,
5:
const uhs_ubit16_t feature_select,
6:
const uhs_ubit16_t wIndex
7: )
8: {
9: uhs_status_t retval =
UDI_OK;
10:
11:
12:
if( Usbh_susres_get_state() != USBH_SUSRES_STS_IDLE ){
13: uhs_debug_print (DBG_ERR, ("ERROR : Don't Call Current State!!"));
14: CORE_REPORT_ERROR(
USBC_ILLEGAL_ERROR );
15:
return UDI_STAT_INVALID_STATE;
16: }
17:
18:
if (( ucb == NULL ) || ( usbdev == NULL )) {
19: CORE_REPORT_ERROR(
USBC_INVALID_PARAMETER );
20:
return UDI_STAT_DATA_ERROR;
21: }
22:
23: 24:
Usbh_Api_FixupPipeInfo(
25: &ucb->pipe,
26: ucb->usbdev->usbdev_DevNum,
27:
USB_DEFAULT_EP_NUM,
28:
USB_PACKETID_OUT,
29:
USB_TRANS_CONTROL, 30: ucb->usbdev->usbdev_EpMaxpktOut[
USB_DEFAULT_EP_NUM]
31: );
32:
33: retval =
Usbh_Api_SyncControlMsg(
34: ucb,
35: bmRequest,
36: USB_DEVICE_REQUEST_CLEAR_FEATURE,
37: feature_select & 0xffU,
38: feature_select >> 8,
39: wIndex & 0xffU,
40: wIndex >> 8,
41: NULL,
42: 0 );
43:
44:
if( retval !=
UDI_OK) {
45: CORE_REPORT_WARNING(
USBC_ILLEGAL_ERROR);
46: }
47:
48:
return retval;
49: }