dmabuf = pci_map_single(tp->pdev, tp->Rpl[i].Skb->data, tp->MaxPacketSize, PCI_DMA_FROMDEVICE); 
dmabuf = dma_map_single(tp->pdev, tp->Rpl[i].Skb->data, tp->MaxPacketSize, DMA_FROM_DEVICE); 
static void tms380tr_init_net_local(struct net_device *dev){	struct net_local *tp = netdev_priv(dev);	int i;	dma_addr_t dmabuf;	tp->scb.CMD	= 0;	tp->scb.Parm[0] = 0;	tp->scb.Parm[1] = 0;	tp->ssb.STS	= 0;	tp->ssb.Parm[0] = 0;	tp->ssb.Parm[1] = 0;	tp->ssb.Parm[2] = 0;	tp->CMDqueue	= 0;	tp->AdapterOpenFlag	= 0;	tp->AdapterVirtOpenFlag = 0;	tp->ScbInUse		= 0;	tp->OpenCommandIssued	= 0;	tp->ReOpenInProgress	= 0;	tp->HaltInProgress	= 0;	tp->TransmitHaltScheduled = 0;	tp->LobeWireFaultLogged	= 0;	tp->LastOpenStatus	= 0;	tp->MaxPacketSize	= DEFAULT_PACKET_SIZE;	/* Create circular chain of transmit lists */	for (i = 0; i < TPL_NUM; i++)	{		tp->Tpl[i].NextTPLAddr = htonl(((char *)(&tp->Tpl[(i+1) % TPL_NUM]) - (char *)tp) + tp->dmabuffer); /* DMA buffer may be MMU driven */		tp->Tpl[i].Status	= 0;		tp->Tpl[i].FrameSize	= 0;		tp->Tpl[i].FragList[0].DataCount	= 0;		tp->Tpl[i].FragList[0].DataAddr		= 0;		tp->Tpl[i].NextTPLPtr	= &tp->Tpl[(i+1) % TPL_NUM];		tp->Tpl[i].MData	= NULL;		tp->Tpl[i].TPLIndex	= i;		tp->Tpl[i].DMABuff	= 0;		tp->Tpl[i].BusyFlag	= 0;	}	tp->TplFree = tp->TplBusy = &tp->Tpl[0];	/* Create circular chain of receive lists */	for (i = 0; i < RPL_NUM; i++)	{		tp->Rpl[i].NextRPLAddr = htonl(((char *)(&tp->Rpl[(i+1) % RPL_NUM]) - (char *)tp) + tp->dmabuffer); /* DMA buffer may be MMU driven */		tp->Rpl[i].Status = (RX_VALID | RX_START_FRAME | RX_END_FRAME | RX_FRAME_IRQ);		tp->Rpl[i].FrameSize = 0;		tp->Rpl[i].FragList[0].DataCount = cpu_to_be16((unsigned short)tp->MaxPacketSize);		/* Alloc skb and point adapter to data area */		tp->Rpl[i].Skb = dev_alloc_skb(tp->MaxPacketSize);			tp->Rpl[i].DMABuff = 0;		/* skb == NULL ? then use local buffer */		if(tp->Rpl[i].Skb == NULL)		{			tp->Rpl[i].SkbStat = SKB_UNAVAILABLE;			tp->Rpl[i].FragList[0].DataAddr = htonl(((char *)tp->LocalRxBuffers[i] - (char *)tp) + tp->dmabuffer);			tp->Rpl[i].MData = tp->LocalRxBuffers[i];		}		else	/* SKB != NULL */		{			tp->Rpl[i].Skb->dev = dev;			skb_put(tp->Rpl[i].Skb, tp->MaxPacketSize);			/* data unreachable for DMA ? then use local buffer */			dmabuf = pci_map_single(tp->pdev, tp->Rpl[i].Skb->data, tp->MaxPacketSize, PCI_DMA_FROMDEVICE);			if(tp->dmalimit && (dmabuf + tp->MaxPacketSize > tp->dmalimit))			{				tp->Rpl[i].SkbStat = SKB_DATA_COPY;				tp->Rpl[i].FragList[0].DataAddr = htonl(((char *)tp->LocalRxBuffers[i] - (char *)tp) + tp->dmabuffer);				tp->Rpl[i].MData = tp->LocalRxBuffers[i];			}			else	/* DMA directly in skb->data */			{				tp->Rpl[i].SkbStat = SKB_DMA_DIRECT;				tp->Rpl[i].FragList[0].DataAddr = htonl(dmabuf);				tp->Rpl[i].MData = tp->Rpl[i].Skb->data;				tp->Rpl[i].DMABuff = dmabuf;			}		}		tp->Rpl[i].NextRPLPtr = &tp->Rpl[(i+1) % RPL_NUM];		tp->Rpl[i].RPLIndex = i;	}	tp->RplHead = &tp->Rpl[0];	tp->RplTail = &tp->Rpl[RPL_NUM-1];	tp->RplTail->Status = (RX_START_FRAME | RX_END_FRAME | RX_FRAME_IRQ);	return;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/504ff16cecf2a788181eddc9d6e47d94ce50a9f6/tms380tr.c/clean/drivers/net/tokenring/tms380tr.c