コード例 #1
0
ファイル: mod_gadget.c プロジェクト: Abioy/kasan
/*
 *		USB_TYPE_STANDARD / set feature functions
 */
static int usbhsg_recip_handler_std_set_device(struct usbhs_priv *priv,
						 struct usbhsg_uep *uep,
						 struct usb_ctrlrequest *ctrl)
{
	switch (le16_to_cpu(ctrl->wValue)) {
	case USB_DEVICE_TEST_MODE:
		usbhsg_recip_handler_std_control_done(priv, uep, ctrl);
		udelay(100);
		usbhs_sys_set_test_mode(priv, le16_to_cpu(ctrl->wIndex >> 8));
		break;
	default:
		usbhsg_recip_handler_std_control_done(priv, uep, ctrl);
		break;
	}

	return 0;
}
コード例 #2
0
ファイル: mod_gadget.c プロジェクト: Abioy/kasan
static int usbhsg_recip_handler_std_set_endpoint(struct usbhs_priv *priv,
						 struct usbhsg_uep *uep,
						 struct usb_ctrlrequest *ctrl)
{
	struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep);

	usbhs_pipe_stall(pipe);

	usbhsg_recip_handler_std_control_done(priv, uep, ctrl);

	return 0;
}
コード例 #3
0
static int usbhsg_recip_handler_std_clear_endpoint(struct usbhs_priv *priv,
						   struct usbhsg_uep *uep,
						   struct usb_ctrlrequest *ctrl)
{
	struct usbhsg_gpriv *gpriv = usbhsg_uep_to_gpriv(uep);
	struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep);

	if (!usbhsg_status_has(gpriv, USBHSG_STATUS_WEDGE)) {
		usbhs_pipe_disable(pipe);
		usbhs_pipe_clear_sequence(pipe);
		usbhs_pipe_enable(pipe);
	}

	usbhsg_recip_handler_std_control_done(priv, uep, ctrl);

	return 0;
}