int s2io_open(struct net_device *dev) 
static int s2io_open(struct net_device *dev) 
int s2io_open(struct net_device *dev){	nic_t *sp = dev->priv;	int err = 0;	int i;	u16 msi_control; /* Temp variable */	/*	 * Make sure you have link off by default every time	 * Nic is initialized	 */	netif_carrier_off(dev);	sp->last_link_state = 0;	/* Initialize H/W and enable interrupts */	if (s2io_card_up(sp)) {		DBG_PRINT(ERR_DBG, "%s: H/W initialization failed\n",			  dev->name);		err = -ENODEV;		goto hw_init_failed;	}	/* Store the values of the MSIX table in the nic_t structure */	store_xmsi_data(sp);	/* After proper initialization of H/W, register ISR */	if (sp->intr_type == MSI) {		err = request_irq((int) sp->pdev->irq, s2io_msi_handle, 			SA_SHIRQ, sp->name, dev);		if (err) {			DBG_PRINT(ERR_DBG, "%s: MSI registration \failed\n", dev->name);			goto isr_registration_failed;		}	}	if (sp->intr_type == MSI_X) {		for (i=1; (sp->s2io_entries[i].in_use == MSIX_FLG); i++) {			if (sp->s2io_entries[i].type == MSIX_FIFO_TYPE) {				sprintf(sp->desc1, "%s:MSI-X-%d-TX",					dev->name, i);				err = request_irq(sp->entries[i].vector,					  s2io_msix_fifo_handle, 0, sp->desc1,					  sp->s2io_entries[i].arg);				DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc1, 							sp->msix_info[i].addr);			} else {				sprintf(sp->desc2, "%s:MSI-X-%d-RX",					dev->name, i);				err = request_irq(sp->entries[i].vector,					  s2io_msix_ring_handle, 0, sp->desc2,					  sp->s2io_entries[i].arg);				DBG_PRINT(ERR_DBG, "%s @ 0x%llx\n", sp->desc2, 							sp->msix_info[i].addr);			}			if (err) {				DBG_PRINT(ERR_DBG, "%s: MSI-X-%d registration \failed\n", dev->name, i);				DBG_PRINT(ERR_DBG, "Returned: %d\n", err);				goto isr_registration_failed;			}			sp->s2io_entries[i].in_use = MSIX_REGISTERED_SUCCESS;		}	}	if (sp->intr_type == INTA) {		err = request_irq((int) sp->pdev->irq, s2io_isr, SA_SHIRQ,				sp->name, dev);		if (err) {			DBG_PRINT(ERR_DBG, "%s: ISR registration failed\n",				  dev->name);			goto isr_registration_failed;		}	}	if (s2io_set_mac_addr(dev, dev->dev_addr) == FAILURE) {		DBG_PRINT(ERR_DBG, "Set Mac Address Failed\n");		err = -ENODEV;		goto setting_mac_address_failed;	}	netif_start_queue(dev);	return 0;setting_mac_address_failed:	if (sp->intr_type != MSI_X)		free_irq(sp->pdev->irq, dev);isr_registration_failed:	del_timer_sync(&sp->alarm_timer);	if (sp->intr_type == MSI_X) {		if (sp->device_type == XFRAME_II_DEVICE) {			for (i=1; (sp->s2io_entries[i].in_use == 				MSIX_REGISTERED_SUCCESS); i++) {				int vector = sp->entries[i].vector;				void *arg = sp->s2io_entries[i].arg;				free_irq(vector, arg);			}			pci_disable_msix(sp->pdev);			/* Temp */			pci_read_config_word(sp->pdev, 0x42, &msi_control);			msi_control &= 0xFFFE; /* Disable MSI */			pci_write_config_word(sp->pdev, 0x42, msi_control);		}	}	else if (sp->intr_type == MSI)		pci_disable_msi(sp->pdev);	s2io_reset(sp);hw_init_failed:	if (sp->intr_type == MSI_X) {		if (sp->entries)			kfree(sp->entries);		if (sp->s2io_entries)			kfree(sp->s2io_entries);	}	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/ac1f60db6a62c8605b551497c8002ba267ea1f4a/s2io.c/clean/drivers/net/s2io.c