return -ENODEV;  if (ignore_dga && id->driver_info & HCI_DIGIANSWER) 
static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id){	struct usb_device *udev = interface_to_usbdev(intf);	struct usb_host_endpoint *bulk_out_ep = NULL;	struct usb_host_endpoint *bulk_in_ep = NULL;	struct usb_host_endpoint *intr_in_ep = NULL;	struct usb_host_endpoint  *ep;	struct usb_host_interface *uif;	struct usb_interface *isoc_iface;	struct hci_usb *husb;	struct hci_dev *hdev;	int i, e, size, isoc_ifnum, isoc_alts;	BT_DBG("udev %p intf %p", udev, intf);	if (!id->driver_info) {		const struct usb_device_id *match;		match = usb_match_id(intf, blacklist_ids);		if (match)			id = match;	}	if (ignore || id->driver_info & HCI_IGNORE)		return -ENODEV;	if (ignore_csr && id->driver_info & HCI_CSR)		return -ENODEV;	if (ignore_sniffer && id->driver_info & HCI_SNIFFER)		return -ENODEV;	if (intf->cur_altsetting->desc.bInterfaceNumber > 0)		return -ENODEV;	/* Find endpoints that we need */	uif = intf->cur_altsetting;	for (e = 0; e < uif->desc.bNumEndpoints; e++) {		ep = &uif->endpoint[e];		switch (ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {		case USB_ENDPOINT_XFER_INT:			if (ep->desc.bEndpointAddress & USB_DIR_IN)				intr_in_ep = ep;			break;		case USB_ENDPOINT_XFER_BULK:			if (ep->desc.bEndpointAddress & USB_DIR_IN)				bulk_in_ep  = ep;			else				bulk_out_ep = ep;			break;		}	}	if (!bulk_in_ep || !bulk_out_ep || !intr_in_ep) {		BT_DBG("Bulk endpoints not found");		goto done;	}	if (!(husb = kzalloc(sizeof(struct hci_usb), GFP_KERNEL))) {		BT_ERR("Can't allocate: control structure");		goto done;	}	husb->udev = udev;	husb->bulk_out_ep = bulk_out_ep;	husb->bulk_in_ep  = bulk_in_ep;	husb->intr_in_ep  = intr_in_ep;	if (id->driver_info & HCI_DIGIANSWER)		husb->ctrl_req = USB_TYPE_VENDOR;	else		husb->ctrl_req = USB_TYPE_CLASS;	/* Find isochronous endpoints that we can use */	size = 0; 	isoc_iface = NULL;	isoc_alts  = 0;	isoc_ifnum = 1;#ifdef CONFIG_BT_HCIUSB_SCO	if (isoc && !(id->driver_info & (HCI_BROKEN_ISOC | HCI_SNIFFER)))		isoc_iface = usb_ifnum_to_if(udev, isoc_ifnum);	if (isoc_iface) {		int a;		struct usb_host_endpoint *isoc_out_ep = NULL;		struct usb_host_endpoint *isoc_in_ep = NULL;		for (a = 0; a < isoc_iface->num_altsetting; a++) {			uif = &isoc_iface->altsetting[a];			for (e = 0; e < uif->desc.bNumEndpoints; e++) {				ep = &uif->endpoint[e];				switch (ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {				case USB_ENDPOINT_XFER_ISOC:					if (le16_to_cpu(ep->desc.wMaxPacketSize) < size ||							uif->desc.bAlternateSetting != isoc)						break;					size = le16_to_cpu(ep->desc.wMaxPacketSize);					isoc_alts = uif->desc.bAlternateSetting;					if (ep->desc.bEndpointAddress & USB_DIR_IN)						isoc_in_ep  = ep;					else						isoc_out_ep = ep;					break;				}			}		}		if (!isoc_in_ep || !isoc_out_ep)			BT_DBG("Isoc endpoints not found");		else {			BT_DBG("isoc ifnum %d alts %d", isoc_ifnum, isoc_alts);			if (usb_driver_claim_interface(&hci_usb_driver, isoc_iface, husb) != 0)				BT_ERR("Can't claim isoc interface");			else if (usb_set_interface(udev, isoc_ifnum, isoc_alts)) {				BT_ERR("Can't set isoc interface settings");				husb->isoc_iface = isoc_iface;				usb_driver_release_interface(&hci_usb_driver, isoc_iface);				husb->isoc_iface = NULL;			} else {				husb->isoc_iface  = isoc_iface;				husb->isoc_in_ep  = isoc_in_ep;				husb->isoc_out_ep = isoc_out_ep;			}		}	}#endif	rwlock_init(&husb->completion_lock);	for (i = 0; i < 4; i++) {		skb_queue_head_init(&husb->transmit_q[i]);		_urb_queue_init(&husb->pending_q[i]);		_urb_queue_init(&husb->completed_q[i]);	}	/* Initialize and register HCI device */	hdev = hci_alloc_dev();	if (!hdev) {		BT_ERR("Can't allocate HCI device");		goto probe_error;	}	husb->hdev = hdev;	hdev->type = HCI_USB;	hdev->driver_data = husb;	SET_HCIDEV_DEV(hdev, &intf->dev);	hdev->open     = hci_usb_open;	hdev->close    = hci_usb_close;	hdev->flush    = hci_usb_flush;	hdev->send     = hci_usb_send_frame;	hdev->destruct = hci_usb_destruct;	hdev->notify   = hci_usb_notify;	hdev->owner = THIS_MODULE;	if (reset || id->driver_info & HCI_RESET)		set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);	if (id->driver_info & HCI_SNIFFER) {		if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997)			set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);	}	if (id->driver_info & HCI_BCM92035) {		unsigned char cmd[] = { 0x3b, 0xfc, 0x01, 0x00 };		struct sk_buff *skb;		skb = bt_skb_alloc(sizeof(cmd), GFP_KERNEL);		if (skb) {			memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));			skb_queue_tail(&hdev->driver_init, skb);		}	}	if (hci_register_dev(hdev) < 0) {		BT_ERR("Can't register HCI device");		hci_free_dev(hdev);		goto probe_error;	}	usb_set_intfdata(intf, husb);	return 0;probe_error:	if (husb->isoc_iface)		usb_driver_release_interface(&hci_usb_driver, husb->isoc_iface);	kfree(husb);done:	return -EIO;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/7ef934b3b73f74aea23aa0e98affe86d7ea816a3/hci_usb.c/clean/drivers/bluetooth/hci_usb.c