sky2_qset(hw, rxqaddr[port], is_pciex(hw) ? 0x80 : 0x600); 
static int sky2_up(struct net_device *dev){	struct sky2_port *sky2 = netdev_priv(dev);	struct sky2_hw *hw = sky2->hw;	unsigned port = sky2->port;	u32 ramsize, rxspace;	int err = -ENOMEM;	if (netif_msg_ifup(sky2))		printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);	/* must be power of 2 */	sky2->tx_le = pci_alloc_consistent(hw->pdev,					   TX_RING_SIZE *					   sizeof(struct sky2_tx_le),					   &sky2->tx_le_map);	if (!sky2->tx_le)		goto err_out;	sky2->tx_ring = kmalloc(TX_RING_SIZE * sizeof(struct ring_info),				GFP_KERNEL);	if (!sky2->tx_ring)		goto err_out;	sky2->tx_prod = sky2->tx_cons = 0;	memset(sky2->tx_ring, 0, TX_RING_SIZE * sizeof(struct ring_info));	sky2->rx_le = pci_alloc_consistent(hw->pdev, RX_LE_BYTES,					   &sky2->rx_le_map);	if (!sky2->rx_le)		goto err_out;	memset(sky2->rx_le, 0, RX_LE_BYTES);	sky2->rx_ring = kmalloc(sky2->rx_pending * sizeof(struct ring_info),				GFP_KERNEL);	if (!sky2->rx_ring)		goto err_out;	sky2_mac_init(hw, port);	/* Configure RAM buffers */	if (hw->chip_id == CHIP_ID_YUKON_FE ||	    (hw->chip_id == CHIP_ID_YUKON_EC && hw->chip_rev == 2))		ramsize = 4096;	else {		u8 e0 = sky2_read8(hw, B2_E_0);		ramsize = (e0 == 0) ? (128 * 1024) : (e0 * 4096);	}	/* 2/3 for Rx */	rxspace = (2 * ramsize) / 3;	sky2_ramset(hw, rxqaddr[port], 0, rxspace);	sky2_ramset(hw, txqaddr[port], rxspace, ramsize - rxspace);	/* Make sure SyncQ is disabled */	sky2_write8(hw, RB_ADDR(port == 0 ? Q_XS1 : Q_XS2, RB_CTRL),		    RB_RST_SET);	sky2_qset(hw, rxqaddr[port], is_pciex(hw) ? 0x80 : 0x600);	sky2_qset(hw, txqaddr[port], 0x600);	sky2->rx_put = sky2->rx_next = 0;	sky2_prefetch_init(hw, rxqaddr[port], sky2->rx_le_map, RX_LE_SIZE - 1);	rx_set_checksum(sky2);	err = sky2_rx_fill(sky2);	if (err)		goto err_out;	/* Give buffers to receiver */	sky2_write16(sky2->hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_PUT_IDX),		     sky2->rx_put);	sky2->rx_last_put = sky2_read16(sky2->hw,					Y2_QADDR(rxqaddr[port],						 PREF_UNIT_PUT_IDX));	sky2_prefetch_init(hw, txqaddr[port], sky2->tx_le_map,			   TX_RING_SIZE - 1);	/* Enable interrupts from phy/mac for port */	hw->intr_mask |= (port == 0) ? Y2_IS_PORT_1 : Y2_IS_PORT_2;	sky2_write32(hw, B0_IMSK, hw->intr_mask);	return 0;err_out:	if (sky2->rx_le)		pci_free_consistent(hw->pdev, RX_LE_BYTES,				    sky2->rx_le, sky2->rx_le_map);	if (sky2->tx_le)		pci_free_consistent(hw->pdev,				    TX_RING_SIZE * sizeof(struct sky2_tx_le),				    sky2->tx_le, sky2->tx_le_map);	if (sky2->tx_ring)		kfree(sky2->tx_ring);	if (sky2->rx_ring)		kfree(sky2->rx_ring);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6b1a3aefd897fd9be410d192f950656ef2b59694/sky2.c/buggy/drivers/net/sky2.c