/* Reads data from a certain offset page inside a PBA, excluding redundancy data. Returns pagesize*pages bytes in data. Note that data must be big enough to hold (pagesize+64)*pages bytes of data, but you can ignore those 'extra' trailing bytes outside this function.  */
static int alauda_read_block(struct us_data *us, u16 pba, unsigned int page, unsigned int pages, unsigned char *data)
/* Reads data from a certain offset page inside a PBA, excluding redundancy data. Returns pagesize*pages bytes in data. Note that data must be big enough to hold (pagesize+64)*pages bytes of data, but you can ignore those 'extra' trailing bytes outside this function.  */
static int alauda_read_block(struct us_data *us, u16 pba, unsigned int page, unsigned int pages, unsigned char *data)
{
	int i, rc;
	unsigned int pagesize = MEDIA_INFO(us).pagesize;
	rc = alauda_read_block_raw(us, pba, page, pages, data);
	if (rc != USB_STOR_XFER_GOOD)
		return rc;
	for (i = 0; i < pages; i++) {
		int dest_offset = i * pagesize;
		int src_offset = i * (pagesize + 64);
		memmove(data + dest_offset, data + src_offset, pagesize);
	}
	return rc;
}