/* s2io_rem_nic - Free the PCI device @pdev: structure containing the PCI related information of the device. Description: This function is called by the Pci subsystem to release a PCI device and free up all resource held up by the device. This could be in response to a Hot plug event or when the driver is to be removed from memory.  */
static void __devexit s2io_rem_nic(struct pci_dev *pdev)
/* s2io_rem_nic - Free the PCI device @pdev: structure containing the PCI related information of the device. Description: This function is called by the Pci subsystem to release a PCI device and free up all resource held up by the device. This could be in response to a Hot plug event or when the driver is to be removed from memory.  */
static void __devexit s2io_rem_nic(struct pci_dev *pdev)
{
	struct net_device *dev =
		(struct net_device *)pci_get_drvdata(pdev);
	struct s2io_nic *sp;
	if (dev == NULL) {
		DBG_PRINT(ERR_DBG, "Driver Data is NULL!!\n");
		return;
	}
	flush_scheduled_work();
	sp = netdev_priv(dev);
	unregister_netdev(dev);
	free_shared_mem(sp);
	iounmap(sp->bar0);
	iounmap(sp->bar1);
	pci_release_regions(pdev);
	pci_set_drvdata(pdev, NULL);
	free_netdev(dev);
	pci_disable_device(pdev);
}