Пример #1
0
void data_bridge_close(unsigned int id)
{
	struct data_bridge	*dev;
	struct sk_buff		*skb;
	unsigned long		flags;

	if (id >= MAX_BRIDGE_DEVICES)
		return;

	dev  = __dev[id];
	if (!dev || !dev->brdg)
		return;

	dev_dbg(&dev->udev->dev, "%s:\n", __func__);

	usb_unlink_anchored_urbs(&dev->tx_active);
	usb_unlink_anchored_urbs(&dev->rx_active);
	usb_unlink_anchored_urbs(&dev->delayed);

	spin_lock_irqsave(&dev->rx_done.lock, flags);
	while ((skb = __skb_dequeue(&dev->rx_done)))
		dev_kfree_skb_any(skb);
	spin_unlock_irqrestore(&dev->rx_done.lock, flags);

	dev->brdg = NULL;
}
Пример #2
0
static void defer_kevent(struct work_struct *work)
{
	int			status;
	struct data_bridge	*dev =
		container_of(work, struct data_bridge, kevent);

	if (!dev)
		return;

	if (test_bit(TX_HALT, &dev->flags)) {
		usb_unlink_anchored_urbs(&dev->tx_active);

		status = usb_autopm_get_interface(dev->intf);
		if (status < 0) {
			dev_err(&dev->udev->dev,
				"can't acquire interface, status %d\n", status);
			return;
		}

		status = usb_clear_halt(dev->udev, dev->bulk_out);
		usb_autopm_put_interface(dev->intf);
		if (status < 0 && status != -EPIPE && status != -ESHUTDOWN)
			dev_err(&dev->udev->dev,
				"can't clear tx halt, status %d\n", status);
		else
			clear_bit(TX_HALT, &dev->flags);
	}

	if (test_bit(RX_HALT, &dev->flags)) {
		usb_unlink_anchored_urbs(&dev->rx_active);

		status = usb_autopm_get_interface(dev->intf);
		if (status < 0) {
			dev_err(&dev->udev->dev,
				"can't acquire interface, status %d\n", status);
			return;
		}

		status = usb_clear_halt(dev->udev, dev->bulk_in);
		usb_autopm_put_interface(dev->intf);
		if (status < 0 && status != -EPIPE && status != -ESHUTDOWN)
			dev_err(&dev->udev->dev,
				"can't clear rx halt, status %d\n", status);
		else {
			clear_bit(RX_HALT, &dev->flags);
			if (dev->brdg)
				queue_work(dev->wq, &dev->process_rx_w);
		}
	}
}
void ctrl_bridge_disconnect(unsigned int id)
{
	struct ctrl_bridge	*dev = __dev[id];

	dev_dbg(&dev->intf->dev, "%s:\n", __func__);

	platform_device_unregister(dev->pdev);

	usb_unlink_anchored_urbs(&dev->tx_submitted);

	kfree(dev->in_ctlreq);
	kfree(dev->readbuf);
	kfree(dev->intbuf);

	usb_free_urb(dev->readurb);
	usb_free_urb(dev->inturb);

	cancel_work_sync(&dev->get_encap_work);
	destroy_workqueue(dev->wq);

	__dev[id] = NULL;
	ch_id--;

	kfree(dev);
}
Пример #4
0
void ctrl_bridge_close(unsigned int id)
{
    struct ctrl_bridge	*dev;

    if (id >= MAX_BRIDGE_DEVICES)
        return;

    dev  = __dev[id];
    if (!dev || !dev->brdg)
        return;

    dev_dbg(&dev->intf->dev, "%s:\n", __func__);

    ctrl_bridge_set_cbits(dev->brdg->ch_id, 0);


    dev_err(&dev->intf->dev, "%s: usb_wait_anchor_empty_timeout tx_submitted\n", __func__);

    usb_wait_anchor_empty_timeout(&dev->tx_submitted, 500);


    dev_err(&dev->intf->dev, "%s: tx_submitted usb_anchor_empty:%d\n", __func__, usb_anchor_empty(&dev->tx_submitted));

    usb_unlink_anchored_urbs(&dev->tx_submitted);

    dev->brdg = NULL;
}
Пример #5
0
void ctrl_bridge_close(unsigned int id)
{
	struct ctrl_bridge	*dev;

	if (id >= MAX_BRIDGE_DEVICES)
		return;

	dev  = __dev[id];
	if (!dev || !dev->brdg)
		return;

	dev_dbg(&dev->udev->dev, "%s:\n", __func__);

	ctrl_bridge_set_cbits(dev->brdg->ch_id, 0);
	usb_unlink_anchored_urbs(&dev->tx_submitted);

	dev->brdg = NULL;
}
Пример #6
0
void ctrl_bridge_close(unsigned int id)
{
	struct ctrl_bridge	*dev;

	if (id >= MAX_BRIDGE_DEVICES)
		return;

	dev  = __dev[id];
	if (!dev || !dev->brdg)
		return;

	dev_dbg(&dev->intf->dev, "%s:\n", __func__);

	ctrl_bridge_set_cbits(dev->brdg->ch_id, 0);
//(+)12/11/08 p10919 : mdm remotefs hello fail fix by case 01013984
	usb_wait_anchor_empty_timeout(&dev->tx_submitted,500); 
//(+)12/11/08 p10919
	usb_unlink_anchored_urbs(&dev->tx_submitted);

	dev->brdg = NULL;
}