struct scatterlist *sg = qc->sg; 
struct scatterlist *sg; 
static void pdc20621_dma_prep(struct ata_queued_cmd *qc){	struct scatterlist *sg = qc->sg;	struct ata_port *ap = qc->ap;	struct pdc_port_priv *pp = ap->private_data;	void __iomem *mmio = ap->host_set->mmio_base;	struct pdc_host_priv *hpriv = ap->host_set->private_data;	void __iomem *dimm_mmio = hpriv->dimm_mmio;	unsigned int portno = ap->port_no;	unsigned int i, last, idx, total_len = 0, sgt_len;	u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ];	assert(qc->flags & ATA_QCFLAG_DMAMAP);	VPRINTK("ata%u: ENTER\n", ap->id);	/* hard-code chip #0 */	mmio += PDC_CHIP0_OFS;	/*	 * Build S/G table	 */	last = qc->n_elem;	idx = 0;	for (i = 0; i < last; i++) {		buf[idx++] = cpu_to_le32(sg_dma_address(&sg[i]));		buf[idx++] = cpu_to_le32(sg_dma_len(&sg[i]));		total_len += sg_dma_len(&sg[i]);	}	buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT);	sgt_len = idx * 4;	/*	 * Build ATA, host DMA packets	 */	pdc20621_host_sg(&qc->tf, &pp->dimm_buf[0], portno, total_len);	pdc20621_host_pkt(&qc->tf, &pp->dimm_buf[0], portno);	pdc20621_ata_sg(&qc->tf, &pp->dimm_buf[0], portno, total_len);	i = pdc20621_ata_pkt(&qc->tf, qc->dev->devno, &pp->dimm_buf[0], portno);	if (qc->tf.flags & ATA_TFLAG_LBA48)		i = pdc_prep_lba48(&qc->tf, &pp->dimm_buf[0], i);	else		i = pdc_prep_lba28(&qc->tf, &pp->dimm_buf[0], i);	pdc_pkt_footer(&qc->tf, &pp->dimm_buf[0], i);	/* copy three S/G tables and two packets to DIMM MMIO window */	memcpy_toio(dimm_mmio + (portno * PDC_DIMM_WINDOW_STEP),		    &pp->dimm_buf, PDC_DIMM_HEADER_SZ);	memcpy_toio(dimm_mmio + (portno * PDC_DIMM_WINDOW_STEP) +		    PDC_DIMM_HOST_PRD,		    &pp->dimm_buf[PDC_DIMM_HEADER_SZ], sgt_len);	/* force host FIFO dump */	writel(0x00000001, mmio + PDC_20621_GENERAL_CTL);	readl(dimm_mmio);	/* MMIO PCI posting flush */	VPRINTK("ata pkt buf ofs %u, prd size %u, mmio copied\n", i, sgt_len);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/cedc9a478d8c6265879dc3839ef3d4849a709184/sata_sx4.c/buggy/drivers/scsi/sata_sx4.c