示例#1
0
static void bridge_disconnect(struct usb_interface *intf)
{
	struct data_bridge	*dev = usb_get_intfdata(intf);
	struct list_head	*head;
	struct urb		*rx_urb;
	unsigned long		flags;

	if (!dev) {
		err("%s: data device not found\n", __func__);
		return;
	}

	ch_id--;
	ctrl_bridge_disconnect(ch_id);
	platform_device_del(dev->pdev);
	usb_set_intfdata(intf, NULL);
	__dev[ch_id] = NULL;

	cancel_work_sync(&dev->process_rx_w);
	cancel_work_sync(&dev->kevent);

	/*free rx urbs*/
	head = &dev->rx_idle;
	spin_lock_irqsave(&dev->rx_done.lock, flags);
	while (!list_empty(head)) {
		rx_urb = list_entry(head->next, struct urb, urb_list);
		list_del(&rx_urb->urb_list);
		usb_free_urb(rx_urb);
	}
	spin_unlock_irqrestore(&dev->rx_done.lock, flags);

	usb_put_dev(dev->udev);
	kfree(dev);
}
示例#2
0
static void bridge_disconnect(struct usb_interface *intf)
{
	struct data_bridge	*dev = usb_get_intfdata(intf);
	int			chid;

	if (!dev) {
		err("%s: data device not found\n", __func__);
		return;
	}

	ch_id--;	/* leave it for now */

	chid = get_chid(intf);

	if (chid < 0) {
		err("%s: invalid interface\n", __func__);
		return;
	}

	ctrl_bridge_disconnect(chid);
	platform_device_unregister(dev->pdev);
	usb_set_intfdata(intf, NULL);

	free_rx_urbs(dev);

	usb_put_dev(dev->udev);

	set_chid(NULL, chid);
}
static void bridge_disconnect(struct usb_interface *intf)
{
	struct data_bridge	*dev = usb_get_intfdata(intf);

	if (!dev) {
		err("%s: data device not found\n", __func__);
		return;
	}

	/*set device name to none to get correct channel id
	 * at the time of bridge open
	 */
	dev->name = "none";

	ctrl_bridge_disconnect(dev->id);
	platform_device_unregister(dev->pdev);
	usb_set_intfdata(intf, NULL);

	free_rx_urbs(dev);
	cancel_work_sync(&dev->process_rx_w);

	usb_kill_anchored_urbs(&dev->tx_active);
	usb_kill_anchored_urbs(&dev->rx_active);
// ASUS_BSP+++ Wenli "tty device for AT command"
#ifndef DISABLE_ASUS_DUN
	if (dev->id == DUN_DATA_ID) {
		s_is_bridge_init = false;
		pr_info("%s: gdun disconnect\n", __func__);
	}
#endif
// ASUS_BSP--- Wenli "tty device for AT command"
	usb_put_dev(dev->udev);

	clear_bit(CLAIMED, &dev->flags);
}
示例#4
0
static void bridge_disconnect(struct usb_interface *intf)
{
	struct data_bridge	*dev = usb_get_intfdata(intf);

	if (!dev) {
		err("%s: data device not found\n", __func__);
		return;
	}

	dev->name = "none";

	ctrl_bridge_disconnect(dev->id);
	platform_device_unregister(dev->pdev);
	usb_set_intfdata(intf, NULL);

	free_rx_urbs(dev);

	usb_put_dev(dev->udev);

	clear_bit(CLAIMED, &dev->flags);
}