Beispiel #1
0
static void usblp_disconnect(struct usb_interface *intf)
{
	struct usblp *usblp = usb_get_intfdata(intf);

	usb_deregister_dev(intf, &usblp_class);

	if (!usblp || !usblp->dev) {
		dev_err(&intf->dev, "bogus disconnect\n");
		BUG();
	}

	device_remove_file(&intf->dev, &dev_attr_ieee1284_id);

	mutex_lock(&usblp_mutex);
	mutex_lock(&usblp->mut);
	usblp->present = 0;
        if(pan_count > 0)       // tmp fix
                --pan_count;

	wake_up(&usblp->wwait);
	wake_up(&usblp->rwait);
	usb_set_intfdata(intf, NULL);

	usblp_unlink_urbs(usblp);
	mutex_unlock(&usblp->mut);

	if (!usblp->used)
		usblp_cleanup(usblp);
	mutex_unlock(&usblp_mutex);
}
Beispiel #2
0
static void usblp_disconnect(struct usb_interface *intf)
{
    struct usblp *usblp = usb_get_intfdata (intf);

    usb_deregister_dev(intf, &usblp_class);

    if (!usblp || !usblp->dev) {
        err("bogus disconnect");
        BUG ();
    }

    device_remove_file(&intf->dev, &dev_attr_ieee1284_id);

    down (&usblp_sem);
    down (&usblp->sem);
    usblp->present = 0;
    usb_set_intfdata (intf, NULL);

    usblp_unlink_urbs(usblp);
    usb_buffer_free (usblp->dev, USBLP_BUF_SIZE,
                     usblp->writebuf, usblp->writeurb->transfer_dma);
    usb_buffer_free (usblp->dev, USBLP_BUF_SIZE,
                     usblp->readbuf, usblp->readurb->transfer_dma);
    up (&usblp->sem);

    if (!usblp->used)
        usblp_cleanup (usblp);
    up (&usblp_sem);
}
Beispiel #3
0
static int usblp_release(struct inode *inode, struct file *file)
{
	struct usblp *usblp = file->private_data;

	down (&usblp_sem);
	usblp->used = 0;
	if (usblp->present) {
		usblp_unlink_urbs(usblp);
	} else 		/* finish cleanup from disconnect */
		usblp_cleanup (usblp);
	up (&usblp_sem);
	return 0;
}
static int usblp_release( int nPort )
{
	struct usblp *usblp = usblp_table[nPort];

	usblp->used = 0;
	if (usblp->dev) {
		if (usblp->bidir)
			usb_unlink_urb(&usblp->readurb);
		usb_unlink_urb(&usblp->writeurb);
//		up(&usblp->sem);
	} else 		/* finish cleanup from disconnect */
		usblp_cleanup (usblp);
//	unlock_kernel();
	return 0;
}
Beispiel #5
0
static int usblp_release(struct inode *inode, struct file *file)
{
	struct usblp *usblp = file->private_data;

	usblp->flags &= ~LP_ABORT;

	mutex_lock(&usblp_mutex);
	usblp->used = 0;
	if (usblp->present) {
		usblp_unlink_urbs(usblp);
		usb_autopm_put_interface(usblp->intf);
	} else		/* finish cleanup from disconnect */
		usblp_cleanup(usblp);
	mutex_unlock(&usblp_mutex);
	return 0;
}
Beispiel #6
0
static int usblp_release(struct inode *inode, struct file *file)
{
	struct usblp *usblp = file->private_data;

	down (&usblp->sem);
	lock_kernel();
	usblp->used = 0;
	if (usblp->dev) {
		if (usblp->bidir)
			usb_unlink_urb(&usblp->readurb);
		usb_unlink_urb(&usblp->writeurb);
		up(&usblp->sem);
	} else 		/* finish cleanup from disconnect */
		usblp_cleanup (usblp);
	unlock_kernel();
	return 0;
}
Beispiel #7
0
static void usblp_disconnect(struct usb_device *dev, void *ptr)
{
	struct usblp *usblp = ptr;

	if (!usblp || !usblp->dev) {
		err("bogus disconnect");
		BUG ();
	}

	down (&usblp_sem);
	down (&usblp->sem);
	usblp->present = 0;

	usblp_unlink_urbs(usblp);
	up (&usblp->sem);

	if (!usblp->used)
		usblp_cleanup (usblp);
	up (&usblp_sem);
}
Beispiel #8
0
static void usblp_disconnect(struct usb_device *dev, void *ptr)
{
	struct usblp *usblp = ptr;

	if (!usblp || !usblp->dev) {
		err("bogus disconnect");
		BUG ();
	}

	down (&usblp->sem);
	lock_kernel();
	usblp->dev = NULL;

	usblp_unlink_urbs(usblp);

	if (!usblp->used)
		usblp_cleanup (usblp);
	else 	/* cleanup later, on close */
		up (&usblp->sem);
	unlock_kernel();
}
static void usblp_disconnect(struct usb_device *dev, void *ptr)
{
	struct usblp *usblp = ptr;

	usbprn_unattach( usblp->minor );

	if (!usblp || !usblp->dev) {
//{{MARK_DEBUG
//		err("disconnect on nonexisting interface");
//}}MARK_DEBUG
		return;
	}

	usblp->dev = NULL;

	usb_unlink_urb(&usblp->writeurb);
	if (usblp->bidir)
		usb_unlink_urb(&usblp->readurb);

	if( !usblp->used )
		usblp_cleanup (usblp);
}