w_value, w_index, ctrl->wLength); 
w_value, w_index, le16_to_cpu(ctrl->wLength)); 
static int standard_setup_req(struct fsg_dev *fsg,		const struct usb_ctrlrequest *ctrl){	struct usb_request	*req = fsg->ep0req;	int			value = -EOPNOTSUPP;	u16			w_index = ctrl->wIndex;	u16			w_value = ctrl->wValue;	/* Usually this just stores reply data in the pre-allocated ep0 buffer,	 * but config change events will also reconfigure hardware. */	switch (ctrl->bRequest) {	case USB_REQ_GET_DESCRIPTOR:		if (ctrl->bRequestType != (USB_DIR_IN | USB_TYPE_STANDARD |				USB_RECIP_DEVICE))			break;		switch (w_value >> 8) {		case USB_DT_DEVICE:			VDBG(fsg, "get device descriptor\n");			value = sizeof device_desc;			memcpy(req->buf, &device_desc, value);			break;#ifdef CONFIG_USB_GADGET_DUALSPEED		case USB_DT_DEVICE_QUALIFIER:			VDBG(fsg, "get device qualifier\n");			if (!fsg->gadget->is_dualspeed)				break;			value = sizeof dev_qualifier;			memcpy(req->buf, &dev_qualifier, value);			break;		case USB_DT_OTHER_SPEED_CONFIG:			VDBG(fsg, "get other-speed config descriptor\n");			if (!fsg->gadget->is_dualspeed)				break;			goto get_config;#endif		case USB_DT_CONFIG:			VDBG(fsg, "get configuration descriptor\n");#ifdef CONFIG_USB_GADGET_DUALSPEED		get_config:#endif			value = populate_config_buf(fsg->gadget,					req->buf,					w_value >> 8,					w_value & 0xff);			break;		case USB_DT_STRING:			VDBG(fsg, "get string descriptor\n");			/* wIndex == language code */			value = usb_gadget_get_string(&stringtab,					w_value & 0xff, req->buf);			break;		}		break;	/* One config, two speeds */	case USB_REQ_SET_CONFIGURATION:		if (ctrl->bRequestType != (USB_DIR_OUT | USB_TYPE_STANDARD |				USB_RECIP_DEVICE))			break;		VDBG(fsg, "set configuration\n");		if (w_value == CONFIG_VALUE || w_value == 0) {			fsg->new_config = w_value;			/* Raise an exception to wipe out previous transaction			 * state (queued bufs, etc) and set the new config. */			raise_exception(fsg, FSG_STATE_CONFIG_CHANGE);			value = DELAYED_STATUS;		}		break;	case USB_REQ_GET_CONFIGURATION:		if (ctrl->bRequestType != (USB_DIR_IN | USB_TYPE_STANDARD |				USB_RECIP_DEVICE))			break;		VDBG(fsg, "get configuration\n");		*(u8 *) req->buf = fsg->config;		value = 1;		break;	case USB_REQ_SET_INTERFACE:		if (ctrl->bRequestType != (USB_DIR_OUT| USB_TYPE_STANDARD |				USB_RECIP_INTERFACE))			break;		if (fsg->config && w_index == 0) {			/* Raise an exception to wipe out previous transaction			 * state (queued bufs, etc) and install the new			 * interface altsetting. */			raise_exception(fsg, FSG_STATE_INTERFACE_CHANGE);			value = DELAYED_STATUS;		}		break;	case USB_REQ_GET_INTERFACE:		if (ctrl->bRequestType != (USB_DIR_IN | USB_TYPE_STANDARD |				USB_RECIP_INTERFACE))			break;		if (!fsg->config)			break;		if (w_index != 0) {			value = -EDOM;			break;		}		VDBG(fsg, "get interface\n");		*(u8 *) req->buf = 0;		value = 1;		break;	default:		VDBG(fsg,			"unknown control req %02x.%02x v%04x i%04x l%u\n",			ctrl->bRequestType, ctrl->bRequest,			w_value, w_index, ctrl->wLength);	}	return value;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/1bbc169621cbe502b9143a27eb12802a0f1d43a0/file_storage.c/buggy/drivers/usb/gadget/file_storage.c