ctrl = 0; 
static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev){	struct sky2_port *sky2 = netdev_priv(dev);	struct sky2_hw *hw = sky2->hw;	struct sky2_tx_le *le;	struct ring_info *re;	unsigned long flags;	unsigned i, len;	dma_addr_t mapping;	u32 addr64;	u16 mss;	u8 ctrl;	local_irq_save(flags);	if (!spin_trylock(&sky2->tx_lock)) {		local_irq_restore(flags);		return NETDEV_TX_LOCKED;	}	if (unlikely(tx_avail(sky2) < tx_le_req(skb))) {		netif_stop_queue(dev);		spin_unlock_irqrestore(&sky2->tx_lock, flags);		printk(KERN_WARNING PFX "%s: ring full when queue awake!\n",		       dev->name);		return NETDEV_TX_BUSY;	}	if (unlikely(netif_msg_tx_queued(sky2)))		printk(KERN_DEBUG "%s: tx queued, slot %u, len %d\n",		       dev->name, sky2->tx_prod, skb->len);	len = skb_headlen(skb);	mapping = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE);	addr64 = (mapping >> 16) >> 16;	re = sky2->tx_ring + sky2->tx_prod;	/* Send high bits if changed */	if (addr64 != sky2->tx_addr64) {		le = get_tx_le(sky2);		le->tx.addr = cpu_to_le32(addr64);		le->ctrl = 0;		le->opcode = OP_ADDR64 | HW_OWNER;		sky2->tx_addr64 = addr64;	}	/* Check for TCP Segmentation Offload */	mss = skb_shinfo(skb)->tso_size;	if (mss != 0) {		/* just drop the packet if non-linear expansion fails */		if (skb_header_cloned(skb) &&		    pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {			dev_kfree_skb_any(skb);			goto out_unlock;		}		mss += ((skb->h.th->doff - 5) * 4);	/* TCP options */		mss += (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr);		mss += ETH_HLEN;	}	if (mss != sky2->tx_last_mss) {		le = get_tx_le(sky2);		le->tx.tso.size = cpu_to_le16(mss);		le->tx.tso.rsvd = 0;		le->opcode = OP_LRGLEN | HW_OWNER;		le->ctrl = 0;		sky2->tx_last_mss = mss;	}	/* Handle TCP checksum offload */	ctrl = 0;	if (skb->ip_summed == CHECKSUM_HW) {		u16 hdr = skb->h.raw - skb->data;		u16 offset = hdr + skb->csum;		ctrl = CALSUM | WR_SUM | INIT_SUM | LOCK_SUM;		if (skb->nh.iph->protocol == IPPROTO_UDP)			ctrl |= UDPTCP;		le = get_tx_le(sky2);		le->tx.csum.start = cpu_to_le16(hdr);		le->tx.csum.offset = cpu_to_le16(offset);		le->length = 0;	/* initial checksum value */		le->ctrl = 1;	/* one packet */		le->opcode = OP_TCPLISW | HW_OWNER;	}	le = get_tx_le(sky2);	le->tx.addr = cpu_to_le32((u32) mapping);	le->length = cpu_to_le16(len);	le->ctrl = ctrl;	le->opcode = mss ? (OP_LARGESEND | HW_OWNER) : (OP_PACKET | HW_OWNER);	/* Record the transmit mapping info */	re->skb = skb;	re->mapaddr = mapping;	re->maplen = len;	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {		skb_frag_t *frag = &skb_shinfo(skb)->frags[i];		struct ring_info *fre;		mapping = pci_map_page(hw->pdev, frag->page, frag->page_offset,				       frag->size, PCI_DMA_TODEVICE);		addr64 = (mapping >> 16) >> 16;		if (addr64 != sky2->tx_addr64) {			le = get_tx_le(sky2);			le->tx.addr = cpu_to_le32(addr64);			le->ctrl = 0;			le->opcode = OP_ADDR64 | HW_OWNER;			sky2->tx_addr64 = addr64;		}		le = get_tx_le(sky2);		le->tx.addr = cpu_to_le32((u32) mapping);		le->length = cpu_to_le16(frag->size);		le->ctrl = ctrl;		le->opcode = OP_BUFFER | HW_OWNER;		fre = sky2->tx_ring		    + ((re - sky2->tx_ring) + i + 1) % TX_RING_SIZE;		fre->skb = NULL;		fre->mapaddr = mapping;		fre->maplen = frag->size;	}	re->idx = sky2->tx_prod;	le->ctrl |= EOP;	sky2_put_idx(sky2->hw, txqaddr[sky2->port], sky2->tx_prod,		     &sky2->tx_last_put, TX_RING_SIZE);	if (tx_avail(sky2) < MAX_SKB_TX_LE + 1)		netif_stop_queue(dev);out_unlock:	mmiowb();	spin_unlock_irqrestore(&sky2->tx_lock, flags);	dev->trans_start = jiffies;	return NETDEV_TX_OK;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/d1f1370863f7fa3d76dc7d7779debdda854a5a60/sky2.c/clean/drivers/net/sky2.c