static void awc_detach(dev_link_t *link)
{
	dev_link_t **linkp;
	unsigned long flags;
	int i=0;

	DEBUG(0, "awc_detach(0x%p)\n", link);

	/* Locate device structure */
	for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
		if (*linkp == link) break;
	if (*linkp == NULL)
	return;

	save_flags(flags);
	cli();
	if (link->state & DEV_RELEASE_PENDING) {
		del_timer(&link->release);
		link->state &= ~DEV_RELEASE_PENDING;
	}
	restore_flags(flags);

	if (link->state & DEV_CONFIG) {
		awc_release((u_long)link);
		if (link->state & DEV_STALE_CONFIG) {
			link->state |= DEV_STALE_LINK;
			return;
		}
	}

	if (link->handle)
		CardServices(DeregisterClient, link->handle);

	/* Unlink device structure, free bits */
	*linkp = link->next;

	i=0;
	while ( i < MAX_AWCS) {
		if (!aironet4500_devices[i])
			{i++; continue;}
		if (aironet4500_devices[i] == link->priv){
			if (awc_proc_unset_fun)
				awc_proc_unset_fun(i);

			aironet4500_devices[i]=0;
		}
		i++;
	}
	
	if (link->priv) {
		//struct net_device *dev = link->priv;
		// dam dam damn mif (dev->priv)
		//	kfree(dev->priv);
		kfree(link->priv);
	}
	kfree(link->dev);
	kfree(link);

} /* awc_detach */
예제 #2
0
static void awc_pnp_release(void) {

//	long flags;
    int i=0;
    struct isapnp_logdev *logdev;

    DEBUG(0, "awc_detach \n");

    i=0;
    while ( i < MAX_AWCS) {
        if (!aironet4500_devices[i])
        {
            i++;
            continue;
        }
        if (((struct awc_private *)aironet4500_devices[i]->priv)->card_type != AIRONET4500_PNP)
        {
            i++;
            continue;
        }

        logdev = ((struct isapnp_logdev *) ((struct awc_private *)aironet4500_devices[i]->priv)->bus);

        if (!logdev )
            printk("awc4500 no pnp logdev in pnp_release\n");

        if (awc_proc_unset_fun)
            awc_proc_unset_fun(i);
        if (isapnp_cfg_begin(logdev->PNP_BUS->PNP_BUS_NUMBER, logdev->PNP_DEV_NUMBER)<0)
            printk("isapnp cfg failed at release \n");
        isapnp_deactivate(logdev->PNP_DEV_NUMBER);
        isapnp_cfg_end();

        release_region(aironet4500_devices[i]->base_addr, AIRONET4X00_IO_SIZE);
//		release_region(isa_cisaddr, AIRONET4X00_CIS_SIZE, "aironet4x00 cis");
//		release_region(isa_memaddr, AIRONET4X00_MEM_SIZE, "aironet4x00 mem");

        unregister_netdev(aironet4500_devices[i]);
        free_irq(aironet4500_devices[i]->irq,aironet4500_devices[i]);
        kfree(aironet4500_devices[i]->priv);
        kfree(aironet4500_devices[i]);

        aironet4500_devices[i]=0;


        i++;
    }


}
예제 #3
0
static void awc_isa_release(void) {

//	long flags;
    int i=0;

    DEBUG(0, "awc_detach \n");

    i=0;
    while ( i < MAX_AWCS) {

        if (!aironet4500_devices[i])
        {
            i++;
            continue;
        }
        if (((struct awc_private *)aironet4500_devices[i]->priv)->card_type != AIRONET4500_ISA)
        {
            i++;
            continue;
        }

        if (awc_proc_unset_fun)
            awc_proc_unset_fun(i);
        release_region(aironet4500_devices[i]->base_addr, AIRONET4X00_IO_SIZE);
//		release_region(isa_cisaddr, AIRONET4X00_CIS_SIZE, "aironet4x00 cis");
//		release_region(isa_memaddr, AIRONET4X00_MEM_SIZE, "aironet4x00 mem");

        unregister_netdev(aironet4500_devices[i]);
        free_irq(aironet4500_devices[i]->irq,aironet4500_devices[i]);
        kfree(aironet4500_devices[i]->priv);
        kfree(aironet4500_devices[i]);

        aironet4500_devices[i]=0;


        i++;
    }


}
예제 #4
0
static void awc_i365_release(void) {

//	long flags;
    int i=0;

    DEBUG(0, "awc_detach \n");

    i=0;
    while ( i < MAX_AWCS) {

        if (!aironet4500_devices[i])
        {
            i++;
            continue;
        }

        if (((struct awc_private *)aironet4500_devices[i]->priv)->card_type != AIRONET4500_365)
        {
            i++;
            continue;
        }

        if (awc_proc_unset_fun)
            awc_proc_unset_fun(i);

        unregister_netdev(aironet4500_devices[i]);

        //kfree(aironet4500_devices[i]->priv);
        kfree(aironet4500_devices[i]);

        aironet4500_devices[i]=0;


        i++;
    }


}