dev_kfree_skb(skb); return 0; 
goto out; 
static int ibmveth_start_xmit(struct sk_buff *skb, struct net_device *netdev){	struct ibmveth_adapter *adapter = netdev->priv;	union ibmveth_buf_desc desc[IbmVethMaxSendFrags];	unsigned long lpar_rc;	int nfrags = 0, curfrag;	unsigned long correlator;	unsigned int retry_count;	if ((skb_shinfo(skb)->nr_frags + 1) > IbmVethMaxSendFrags) {		adapter->stats.tx_dropped++;		dev_kfree_skb(skb);		return 0;	}	memset(&desc, 0, sizeof(desc));	/* nfrags = number of frags after the initial fragment */	nfrags = skb_shinfo(skb)->nr_frags;	if(nfrags)		adapter->tx_multidesc_send++;	/* map the initial fragment */	desc[0].fields.length  = nfrags ? skb->len - skb->data_len : skb->len;	desc[0].fields.address = dma_map_single(&adapter->vdev->dev, skb->data,					desc[0].fields.length, DMA_TO_DEVICE);	desc[0].fields.valid   = 1;	if(dma_mapping_error(desc[0].fields.address)) {		ibmveth_error_printk("tx: unable to map initial fragment\n");		adapter->tx_map_failed++;		adapter->stats.tx_dropped++;		dev_kfree_skb(skb);		return 0;	}	curfrag = nfrags;	/* map fragments past the initial portion if there are any */	while(curfrag--) {		skb_frag_t *frag = &skb_shinfo(skb)->frags[curfrag];		desc[curfrag+1].fields.address			= dma_map_single(&adapter->vdev->dev,				page_address(frag->page) + frag->page_offset,				frag->size, DMA_TO_DEVICE);		desc[curfrag+1].fields.length = frag->size;		desc[curfrag+1].fields.valid  = 1;		if(dma_mapping_error(desc[curfrag+1].fields.address)) {			ibmveth_error_printk("tx: unable to map fragment %d\n", curfrag);			adapter->tx_map_failed++;			adapter->stats.tx_dropped++;			/* Free all the mappings we just created */			while(curfrag < nfrags) {				dma_unmap_single(&adapter->vdev->dev,						 desc[curfrag+1].fields.address,						 desc[curfrag+1].fields.length,						 DMA_TO_DEVICE);				curfrag++;			}			dev_kfree_skb(skb);			return 0;		}	}	/* send the frame. Arbitrarily set retrycount to 1024 */	correlator = 0;	retry_count = 1024;	do {		lpar_rc = h_send_logical_lan(adapter->vdev->unit_address,					     desc[0].desc,					     desc[1].desc,					     desc[2].desc,					     desc[3].desc,					     desc[4].desc,					     desc[5].desc,					     correlator);	} while ((lpar_rc == H_Busy) && (retry_count--));    	if(lpar_rc != H_Success && lpar_rc != H_Dropped) {		int i;		ibmveth_error_printk("tx: h_send_logical_lan failed with rc=%ld\n", lpar_rc);		for(i = 0; i < 6; i++) {			ibmveth_error_printk("tx: desc[%i] valid=%d, len=%d, address=0x%d\n", i,					     desc[i].fields.valid, desc[i].fields.length, desc[i].fields.address);		}		adapter->tx_send_failed++;		adapter->stats.tx_dropped++;	} else {		adapter->stats.tx_packets++;		adapter->stats.tx_bytes += skb->len;		netdev->trans_start = jiffies;	}	do {		dma_unmap_single(&adapter->vdev->dev,				desc[nfrags].fields.address,				desc[nfrags].fields.length, DMA_TO_DEVICE);	} while(--nfrags >= 0);	dev_kfree_skb(skb);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/60296d9e4be1cd9e096f7804ce6e839e0cbd97cf/ibmveth.c/clean/drivers/net/ibmveth.c