Exemplo n.º 1
0
static int elp_close(struct net_device *dev)
{
	elp_device *adapter;

	adapter = dev->priv;

	if (elp_debug >= 3)
		printk(KERN_DEBUG "%s: request to close device\n", dev->name);

	netif_stop_queue(dev);

	/* Someone may request the device statistic information even when
	 * the interface is closed. The following will update the statistics
	 * structure in the driver, so we'll be able to give current statistics.
	 */
	(void) elp_get_stats(dev);

	/*
	 * disable interrupts on the board
	 */
	outb_control(0, dev);

	/*
	 * release the IRQ
	 */
	free_irq(dev->irq, dev);

	free_dma(dev->dma);
	free_pages((unsigned long) adapter->dma_buffer, get_order(DMA_BUFFER_SIZE));

	return 0;
}
Exemplo n.º 2
0
static int elp_close(struct net_device *dev)
{
	elp_device *adapter = netdev_priv(dev);

	if (elp_debug >= 3)
		pr_debug("%s: request to close device\n", dev->name);

	netif_stop_queue(dev);

	/*                                                               
                                                                     
                                                                         
  */
	(void) elp_get_stats(dev);

	/*
                                   
  */
	outb_control(0, dev);

	/*
                   
  */
	free_irq(dev->irq, dev);

	free_dma(dev->dma);
	free_pages((unsigned long) adapter->dma_buffer, get_order(DMA_BUFFER_SIZE));

	return 0;
}
Exemplo n.º 3
0
static int elp_close (struct device *dev)

{
    elp_device * adapter = (elp_device *) dev->priv;

    CHECK_NULL(dev);
    CHECK_NULL(adapter);

    if (elp_debug >= 3)
        printk("%s: request to close device\n", dev->name);

    /* Someone may request the device statistic information even when
     * the interface is closed. The following will update the statistics
     * structure in the driver, so we'll be able to give current statistics.
     */
    (void) elp_get_stats(dev);

    /*
     * disable interrupts on the board
     */
    OUTB(0x00, adapter->io_addr+PORT_CONTROL);

    /*
     *  flag transmitter as busy (i.e. not available)
     */
    dev->tbusy = 1;

    /*
     *  indicate device is closed
     */
    dev->start = 0;

    /*
     * release the IRQ
     */
    free_irq(dev->irq);

    /*
     * and we no longer have to map irq to dev either
     */
    irq2dev_map[dev->irq] = 0;

    return 0;
}