/* @dev: Device to access @buffer: Data buffer @buflen: Length of the buffer. @rw: True to write.  */
static unsigned int octeon_cf_data_xfer8(struct ata_device *dev, unsigned char *buffer, unsigned int buflen, int rw)
/* @dev: Device to access @buffer: Data buffer @buflen: Length of the buffer. @rw: True to write.  */
static unsigned int octeon_cf_data_xfer8(struct ata_device *dev, unsigned char *buffer, unsigned int buflen, int rw)
{
	struct ata_port *ap		= dev->link->ap;
	void __iomem *data_addr		= ap->ioaddr.data_addr;
	unsigned long words;
	int count;
	words = buflen;
	if (rw) {
		count = 16;
		while (words--) {
			iowrite8(*buffer, data_addr);
			buffer++;
			if (--count == 0) {
				ioread8(ap->ioaddr.altstatus_addr);
				count = 16;
			}
		}
	} else {
		ioread8_rep(data_addr, buffer, words);
	}
	return buflen;
}