Пример #1
0
static void
airport_detach(dldwd_priv_t *priv)
{
	dldwd_card_t* card = (dldwd_card_t *)priv->card;

	priv->hw_ready = 0;
	
	/* Unregister proc entry */
	dldwd_proc_dev_cleanup(priv);

#ifdef CONFIG_PMAC_PBOOK
	pmu_unregister_sleep_notifier(&airport_sleep_notifier);
#endif
	if (card->ndev_registered)
		unregister_netdev(&priv->ndev);
	card->ndev_registered = 0;
	
	if (card->irq_requested)
		free_irq(priv->ndev.irq, priv);
	card->irq_requested = 0;

// FIXME
//	if (ndev->base_addr)
//		iounmap(ndev->base_addr + _IO_BASE);
//	ndev->base_addr = 0;
	
	feature_set_airport_power(card->node, 0);
	current->state = TASK_UNINTERRUPTIBLE;
	schedule_timeout(HZ);
	
	kfree(card);
}				/* airport_detach */
Пример #2
0
static void
dldwd_cs_release(u_long arg)
{
	dev_link_t *link = (dev_link_t *) arg;
	dldwd_priv_t *priv = link->priv;

	TRACE_ENTER(link->dev->dev_name);

	/*
	   If the device is currently in use, we won't release until it
	   is actually closed, because until then, we can't be sure that
	   no one will try to access the device or its data structures.
	 */
	if (link->open) {
		DEBUG(0, "orinoco_cs: release postponed, '%s' still open\n",
		      link->dev->dev_name);
		link->state |= DEV_STALE_CONFIG;
		return;
	}

	/* Unregister proc entry */
	dldwd_proc_dev_cleanup(priv);

	/* Don't bother checking to see if these succeed or not */
	CardServices(ReleaseConfiguration, link->handle);
	if (link->io.NumPorts1)
		CardServices(ReleaseIO, link->handle, &link->io);
	if (link->irq.AssignedIRQ)
		CardServices(ReleaseIRQ, link->handle, &link->irq);
	link->state &= ~DEV_CONFIG;

	TRACE_EXIT(link->dev->dev_name);
}				/* dldwd_cs_release */