le->opcode = OP_TCPLISW|HW_OWNER; 
le->opcode = OP_TCPLISW | HW_OWNER; 
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 i, len;	dma_addr_t mapping;	u32 addr64;	u16 mss;	u8 ctrl;	skb = skb_padto(skb, ETH_ZLEN);	if (!skb)		return NETDEV_TX_OK;	if (!spin_trylock(&sky2->tx_lock))		return NETDEV_TX_LOCKED;	if (unlikely(sky2_xmit_avail(sky2) < MAX_SKB_TX_LE)) {		netif_stop_queue(dev);		spin_unlock(&sky2->tx_lock);		printk(KERN_WARNING PFX "%s: ring full when queue awake!\n",		       dev->name);		return NETDEV_TX_BUSY;	}	if (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);	/* Check for TCP Segmentation Offload */	mss = skb_shinfo(skb)->tso_size;	if (mss) {		/* 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(skb);			return NETDEV_TX_OK;		}		mss += ((skb->h.th->doff - 5) * 4);	/* TCP options */		mss += (skb->nh.iph->ihl * 4) + sizeof(struct tcphdr);		mss += ETH_HLEN;		le = get_tx_le(sky2);		le->tx.tso.size = cpu_to_le16(mss);		le->ctrl = 0;		le->opcode = OP_LRGLEN | HW_OWNER;	}	/* Handle Hi DMA */	if (sizeof(mapping) > sizeof(u32)) {		addr64 = (u64)mapping >> 32;		le = get_tx_le(sky2);		le->tx.addr = cpu_to_le32(addr64);		le->ctrl = 0;		le->opcode = OP_ADDR64 | HW_OWNER;	}	/* Handle TCP checksum offload */	ctrl = 0;	if (skb->ip_summed == CHECKSUM_HW) {		ptrdiff_t hdr = skb->h.raw - skb->data;		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(hdr + skb->csum);		le->length = 0;		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 : OP_PACKET) |HW_OWNER;	re = &sky2->tx_ring[le - sky2->tx_le];	re->skb = skb;	pci_unmap_addr_set(re, mapaddr, mapping);	pci_unmap_len_set(re, maplen, len);	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {		skb_frag_t *frag = &skb_shinfo(skb)->frags[i];		mapping = pci_map_page(hw->pdev, frag->page, frag->page_offset,				       frag->size, PCI_DMA_TODEVICE);		if (sizeof(mapping) > sizeof(u32)) {			u32 hi = (u64) mapping  >> 32;			if (hi != addr64) {				le = get_tx_le(sky2);				le->tx.addr = cpu_to_le32(hi);				le->ctrl = 0;				le->opcode = OP_ADDR64|HW_OWNER;				addr64 = hi;			}		}		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;		re = &sky2->tx_ring[le - sky2->tx_le];		pci_unmap_addr_set(re, mapaddr, mapping);		pci_unmap_len_set(re, maplen, frag->size);	}	le->ctrl |= EOP;	sky2_put_idx(sky2->hw, txqaddr[sky2->port], sky2->tx_prod,		     &sky2->tx_last_put, TX_RING_SIZE);	if (sky2_xmit_avail(sky2) < MAX_SKB_TX_LE) {		pr_debug("%s: transmit queue full\n", dev->name);		netif_stop_queue(dev);	}	spin_unlock(&sky2->tx_lock);	dev->trans_start = jiffies;	return NETDEV_TX_OK;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/793b883ed12a6ae6e2901ddb5e038b77d6f0c0ac/sky2.c/buggy/drivers/net/sky2.c