/* Things to do upon first use of a card. This must run with the rtnl lock held.  */
static int cxgb_up(struct adapter *adapter)
/* Things to do upon first use of a card. This must run with the rtnl lock held.  */
static int cxgb_up(struct adapter *adapter)
{
	int err = 0;
	if (!(adapter->flags & FULL_INIT_DONE)) {
		err = t1_init_hw_modules(adapter);
		if (err)
			goto out_err;
		enable_hw_csum(adapter);
		adapter->flags |= FULL_INIT_DONE;
	}
	t1_interrupts_clear(adapter);
	adapter->params.has_msi = !disable_msi && !pci_enable_msi(adapter->pdev);
	err = request_irq(adapter->pdev->irq, t1_interrupt,
			  adapter->params.has_msi ? 0 : IRQF_SHARED,
			  adapter->name, adapter);
	if (err) {
		if (adapter->params.has_msi)
			pci_disable_msi(adapter->pdev);
		goto out_err;
	}
	t1_sge_start(adapter->sge);
	t1_interrupts_enable(adapter);
out_err:
	return err;
}