__constant_cpu_to_le16(GS_VERSION_NUM|0x0001); } else if (gadget_is_pxa(gadget)) { gs_device_desc.bcdDevice = __constant_cpu_to_le16(GS_VERSION_NUM|0x0002); } else if (gadget_is_sh(gadget)) { gs_device_desc.bcdDevice = __constant_cpu_to_le16(GS_VERSION_NUM|0x0003); /* sh doesn't support multiple interfaces or configs */ use_acm = 0; } else if (gadget_is_sa1100(gadget)) { gs_device_desc.bcdDevice = __constant_cpu_to_le16(GS_VERSION_NUM|0x0004); /* sa1100 doesn't support necessary endpoints */ use_acm = 0; } else if (gadget_is_goku(gadget)) { gs_device_desc.bcdDevice = __constant_cpu_to_le16(GS_VERSION_NUM|0x0005); } else if (gadget_is_mq11xx(gadget)) { gs_device_desc.bcdDevice = __constant_cpu_to_le16(GS_VERSION_NUM|0x0006); } else if (gadget_is_omap(gadget)) { gs_device_desc.bcdDevice = __constant_cpu_to_le16(GS_VERSION_NUM|0x0007); } else if (gadget_is_lh7a40x(gadget)) { gs_device_desc.bcdDevice = __constant_cpu_to_le16(GS_VERSION_NUM|0x0008); } else if (gadget_is_n9604(gadget)) { gs_device_desc.bcdDevice = __constant_cpu_to_le16(GS_VERSION_NUM|0x0009); } else if (gadget_is_pxa27x(gadget)) { gs_device_desc.bcdDevice = __constant_cpu_to_le16(GS_VERSION_NUM|0x0011); } else if (gadget_is_s3c2410(gadget)) { gs_device_desc.bcdDevice = __constant_cpu_to_le16(GS_VERSION_NUM|0x0012); } else if (gadget_is_at91(gadget)) { gs_device_desc.bcdDevice = __constant_cpu_to_le16(GS_VERSION_NUM|0x0013); } else { 
cpu_to_le16(GS_VERSION_NUM | gcnum); else { 
static int gs_bind(struct usb_gadget *gadget){	int ret;	struct usb_ep *ep;	struct gs_dev *dev;	/* device specific */	if (gadget_is_net2280(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0001);	} else if (gadget_is_pxa(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0002);	} else if (gadget_is_sh(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0003);		/* sh doesn't support multiple interfaces or configs */		use_acm = 0;	} else if (gadget_is_sa1100(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0004);		/* sa1100 doesn't support necessary endpoints */		use_acm = 0;	} else if (gadget_is_goku(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0005);	} else if (gadget_is_mq11xx(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0006);	} else if (gadget_is_omap(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0007);	} else if (gadget_is_lh7a40x(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0008);	} else if (gadget_is_n9604(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0009);	} else if (gadget_is_pxa27x(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0011);	} else if (gadget_is_s3c2410(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0012);	} else if (gadget_is_at91(gadget)) {		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0013);	} else {		printk(KERN_WARNING "gs_bind: controller '%s' not recognized\n",			gadget->name);		/* unrecognized, but safe unless bulk is REALLY quirky */		gs_device_desc.bcdDevice =			__constant_cpu_to_le16(GS_VERSION_NUM|0x0099);	}	usb_ep_autoconfig_reset(gadget);	ep = usb_ep_autoconfig(gadget, &gs_fullspeed_in_desc);	if (!ep)		goto autoconf_fail;	EP_IN_NAME = ep->name;	ep->driver_data = ep;	/* claim the endpoint */	ep = usb_ep_autoconfig(gadget, &gs_fullspeed_out_desc);	if (!ep)		goto autoconf_fail;	EP_OUT_NAME = ep->name;	ep->driver_data = ep;	/* claim the endpoint */	if (use_acm) {		ep = usb_ep_autoconfig(gadget, &gs_fullspeed_notify_desc);		if (!ep) {			printk(KERN_ERR "gs_bind: cannot run ACM on %s\n", gadget->name);			goto autoconf_fail;		}		gs_device_desc.idProduct = __constant_cpu_to_le16(						GS_CDC_PRODUCT_ID),		EP_NOTIFY_NAME = ep->name;		ep->driver_data = ep;	/* claim the endpoint */	}	gs_device_desc.bDeviceClass = use_acm		? USB_CLASS_COMM : USB_CLASS_VENDOR_SPEC;	gs_device_desc.bMaxPacketSize0 = gadget->ep0->maxpacket;#ifdef CONFIG_USB_GADGET_DUALSPEED	gs_qualifier_desc.bDeviceClass = use_acm		? USB_CLASS_COMM : USB_CLASS_VENDOR_SPEC;	/* assume ep0 uses the same packet size for both speeds */	gs_qualifier_desc.bMaxPacketSize0 = gs_device_desc.bMaxPacketSize0;	/* assume endpoints are dual-speed */	gs_highspeed_notify_desc.bEndpointAddress =		gs_fullspeed_notify_desc.bEndpointAddress;	gs_highspeed_in_desc.bEndpointAddress =		gs_fullspeed_in_desc.bEndpointAddress;	gs_highspeed_out_desc.bEndpointAddress =		gs_fullspeed_out_desc.bEndpointAddress;#endif /* CONFIG_USB_GADGET_DUALSPEED */	usb_gadget_set_selfpowered(gadget);	if (gadget->is_otg) {		gs_otg_descriptor.bmAttributes |= USB_OTG_HNP,		gs_bulk_config_desc.bmAttributes |= USB_CONFIG_ATT_WAKEUP;		gs_acm_config_desc.bmAttributes |= USB_CONFIG_ATT_WAKEUP;	}	gs_device = dev = kmalloc(sizeof(struct gs_dev), GFP_KERNEL);	if (dev == NULL)		return -ENOMEM;	snprintf(manufacturer, sizeof(manufacturer), "%s %s with %s",		system_utsname.sysname, system_utsname.release,		gadget->name);	memset(dev, 0, sizeof(struct gs_dev));	dev->dev_gadget = gadget;	spin_lock_init(&dev->dev_lock);	INIT_LIST_HEAD(&dev->dev_req_list);	set_gadget_data(gadget, dev);	if ((ret=gs_alloc_ports(dev, GFP_KERNEL)) != 0) {		printk(KERN_ERR "gs_bind: cannot allocate ports\n");		gs_unbind(gadget);		return ret;	}	/* preallocate control response and buffer */	dev->dev_ctrl_req = gs_alloc_req(gadget->ep0, GS_MAX_DESC_LEN,		GFP_KERNEL);	if (dev->dev_ctrl_req == NULL) {		gs_unbind(gadget);		return -ENOMEM;	}	dev->dev_ctrl_req->complete = gs_setup_complete;	gadget->ep0->driver_data = dev;	printk(KERN_INFO "gs_bind: %s %s bound\n",		GS_LONG_NAME, GS_VERSION_STR);	return 0;autoconf_fail:	printk(KERN_ERR "gs_bind: cannot autoconfigure on %s\n", gadget->name);	return -ENODEV;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/91e79c91fab10f5790159d8d0c1d16da2a9653f9/serial.c/clean/drivers/usb/gadget/serial.c