spin_unlock(&tp->tx_lock); spin_unlock_irq(&tp->lock); 
tg3_full_unlock(tp); 
static int tg3_open(struct net_device *dev){	struct tg3 *tp = netdev_priv(dev);	int err;	spin_lock_irq(&tp->lock);	spin_lock(&tp->tx_lock);	tg3_disable_ints(tp);	tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;	spin_unlock(&tp->tx_lock);	spin_unlock_irq(&tp->lock);	/* The placement of this call is tied	 * to the setup and use of Host TX descriptors.	 */	err = tg3_alloc_consistent(tp);	if (err)		return err;	if ((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) &&	    (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5750_AX) &&	    (GET_CHIP_REV(tp->pci_chip_rev_id) != CHIPREV_5750_BX)) {		/* All MSI supporting chips should support tagged		 * status.  Assert that this is the case.		 */		if (!(tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)) {			printk(KERN_WARNING PFX "%s: MSI without TAGGED? "			       "Not using MSI.\n", tp->dev->name);		} else if (pci_enable_msi(tp->pdev) == 0) {			u32 msi_mode;			msi_mode = tr32(MSGINT_MODE);			tw32(MSGINT_MODE, msi_mode | MSGINT_MODE_ENABLE);			tp->tg3_flags2 |= TG3_FLG2_USING_MSI;		}	}	if (tp->tg3_flags2 & TG3_FLG2_USING_MSI)		err = request_irq(tp->pdev->irq, tg3_msi,				  SA_SAMPLE_RANDOM, dev->name, dev);	else {		irqreturn_t (*fn)(int, void *, struct pt_regs *)=tg3_interrupt;		if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)			fn = tg3_interrupt_tagged;		err = request_irq(tp->pdev->irq, fn,				  SA_SHIRQ | SA_SAMPLE_RANDOM, dev->name, dev);	}	if (err) {		if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) {			pci_disable_msi(tp->pdev);			tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI;		}		tg3_free_consistent(tp);		return err;	}	spin_lock_irq(&tp->lock);	spin_lock(&tp->tx_lock);	err = tg3_init_hw(tp);	if (err) {		tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);		tg3_free_rings(tp);	} else {		if (tp->tg3_flags & TG3_FLAG_TAGGED_STATUS)			tp->timer_offset = HZ;		else			tp->timer_offset = HZ / 10;		BUG_ON(tp->timer_offset > HZ);		tp->timer_counter = tp->timer_multiplier =			(HZ / tp->timer_offset);		tp->asf_counter = tp->asf_multiplier =			((HZ / tp->timer_offset) * 120);		init_timer(&tp->timer);		tp->timer.expires = jiffies + tp->timer_offset;		tp->timer.data = (unsigned long) tp;		tp->timer.function = tg3_timer;	}	spin_unlock(&tp->tx_lock);	spin_unlock_irq(&tp->lock);	if (err) {		free_irq(tp->pdev->irq, dev);		if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) {			pci_disable_msi(tp->pdev);			tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI;		}		tg3_free_consistent(tp);		return err;	}	if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) {		err = tg3_test_msi(tp);		if (err) {			spin_lock_irq(&tp->lock);			spin_lock(&tp->tx_lock);			if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) {				pci_disable_msi(tp->pdev);				tp->tg3_flags2 &= ~TG3_FLG2_USING_MSI;			}			tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);			tg3_free_rings(tp);			tg3_free_consistent(tp);			spin_unlock(&tp->tx_lock);			spin_unlock_irq(&tp->lock);			return err;		}	}	spin_lock_irq(&tp->lock);	spin_lock(&tp->tx_lock);	add_timer(&tp->timer);	tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;	tg3_enable_ints(tp);	spin_unlock(&tp->tx_lock);	spin_unlock_irq(&tp->lock);	netif_start_queue(dev);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f47c11eeccc8820010992eb32dbe7370a08f8bd3/tg3.c/buggy/drivers/net/tg3.c