/* spider_net_remove is called to remove the device and unregisters the net_device  */
static void __devexit spider_net_remove(struct pci_dev *pdev)
/* spider_net_remove is called to remove the device and unregisters the net_device  */
static void __devexit spider_net_remove(struct pci_dev *pdev)
{
	struct net_device *netdev;
	struct spider_net_card *card;
	netdev = pci_get_drvdata(pdev);
	card = netdev_priv(netdev);
	wait_event(card->waitq,
		   atomic_read(&card->tx_timeout_task_counter) == 0);
	unregister_netdev(netdev);
	spider_net_write_reg(card, SPIDER_NET_CKRCTRL,
			     SPIDER_NET_CKRCTRL_STOP_VALUE);
	spider_net_write_reg(card, SPIDER_NET_CKRCTRL,
			     SPIDER_NET_CKRCTRL_RUN_VALUE);
	spider_net_undo_pci_setup(card);
	free_netdev(netdev);
}