struct e1000_adapter *adapter = netdev->priv; 
struct e1000_adapter *adapter = netdev_priv(netdev); 
e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev){	struct e1000_adapter *adapter = netdev->priv;	unsigned int first, max_per_txd = E1000_MAX_DATA_PER_TXD;	unsigned int max_txd_pwr = E1000_MAX_TXD_PWR;	unsigned int tx_flags = 0;	unsigned int len = skb->len;	unsigned long flags;	unsigned int nr_frags = 0;	unsigned int mss = 0;	int count = 0;	int tso;	unsigned int f;	len -= skb->data_len;	if(unlikely(skb->len <= 0)) {		dev_kfree_skb_any(skb);		return NETDEV_TX_OK;	}#ifdef NETIF_F_TSO	mss = skb_shinfo(skb)->tso_size;	/* The controller does a simple calculation to 	 * make sure there is enough room in the FIFO before	 * initiating the DMA for each buffer.  The calc is:	 * 4 = ceil(buffer len/mss).  To make sure we don't	 * overrun the FIFO, adjust the max buffer len if mss	 * drops. */	if(mss) {		max_per_txd = min(mss << 2, max_per_txd);		max_txd_pwr = fls(max_per_txd) - 1;	}	if((mss) || (skb->ip_summed == CHECKSUM_HW))		count++;	count++;#else	if(skb->ip_summed == CHECKSUM_HW)		count++;#endif	count += TXD_USE_COUNT(len, max_txd_pwr);	if(adapter->pcix_82544)		count++;	/* work-around for errata 10 and it applies to all controllers 	 * in PCI-X mode, so add one more descriptor to the count	 */	if(unlikely((adapter->hw.bus_type == e1000_bus_type_pcix) &&			(len > 2015)))		count++;	nr_frags = skb_shinfo(skb)->nr_frags;	for(f = 0; f < nr_frags; f++)		count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size,				       max_txd_pwr);	if(adapter->pcix_82544)		count += nr_frags; 	local_irq_save(flags);  	if (!spin_trylock(&adapter->tx_lock)) {  		/* Collision - tell upper layer to requeue */  		local_irq_restore(flags);  		return NETDEV_TX_LOCKED;  	} 	if(adapter->hw.tx_pkt_filtering && (adapter->hw.mac_type == e1000_82573) )		e1000_transfer_dhcp_info(adapter, skb);	/* need: count + 2 desc gap to keep tail from touching	 * head, otherwise try next time */	if(unlikely(E1000_DESC_UNUSED(&adapter->tx_ring) < count + 2)) {		netif_stop_queue(netdev);		spin_unlock_irqrestore(&adapter->tx_lock, flags);		return NETDEV_TX_BUSY;	}	if(unlikely(adapter->hw.mac_type == e1000_82547)) {		if(unlikely(e1000_82547_fifo_workaround(adapter, skb))) {			netif_stop_queue(netdev);			mod_timer(&adapter->tx_fifo_stall_timer, jiffies);			spin_unlock_irqrestore(&adapter->tx_lock, flags);			return NETDEV_TX_BUSY;		}	}	if(unlikely(adapter->vlgrp && vlan_tx_tag_present(skb))) {		tx_flags |= E1000_TX_FLAGS_VLAN;		tx_flags |= (vlan_tx_tag_get(skb) << E1000_TX_FLAGS_VLAN_SHIFT);	}	first = adapter->tx_ring.next_to_use;		tso = e1000_tso(adapter, skb);	if (tso < 0) {		dev_kfree_skb_any(skb);		spin_unlock_irqrestore(&adapter->tx_lock, flags);		return NETDEV_TX_OK;	}	if (likely(tso))		tx_flags |= E1000_TX_FLAGS_TSO;	else if(likely(e1000_tx_csum(adapter, skb)))		tx_flags |= E1000_TX_FLAGS_CSUM;	/* Old method was to assume IPv4 packet by default if TSO was enabled.	 * 82573 hardware supports TSO capabilities for IPv6 as well...	 * no longer assume, we must. */	if(likely(skb->protocol == ntohs(ETH_P_IP)))		tx_flags |= E1000_TX_FLAGS_IPV4;	e1000_tx_queue(adapter,		e1000_tx_map(adapter, skb, first, max_per_txd, nr_frags, mss),		tx_flags);	netdev->trans_start = jiffies;	/* Make sure there is space in the ring for the next send. */	if(unlikely(E1000_DESC_UNUSED(&adapter->tx_ring) < MAX_SKB_FRAGS + 2))		netif_stop_queue(netdev);	spin_unlock_irqrestore(&adapter->tx_lock, flags);	return NETDEV_TX_OK;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/60490fe030f3969a8706d94c7cf8469be6330678/e1000_main.c/clean/drivers/net/e1000/e1000_main.c