/* Type 1 and Type 2 protection use the same format: 16 bit guard tag, 16 bit app tag, 32 bit reference tag.  */
static void sd_dif_type1_generate(struct blk_integrity_exchg *bix, csum_fn *fn)
/* Type 1 and Type 2 protection use the same format: 16 bit guard tag, 16 bit app tag, 32 bit reference tag.  */
static void sd_dif_type1_generate(struct blk_integrity_exchg *bix, csum_fn *fn)
{
	void *buf = bix->data_buf;
	struct sd_dif_tuple *sdt = bix->prot_buf;
	sector_t sector = bix->sector;
	unsigned int i;
	for (i = 0 ; i < bix->data_size ; i += bix->sector_size, sdt++) {
		sdt->guard_tag = fn(buf, bix->sector_size);
		sdt->ref_tag = cpu_to_be32(sector & 0xffffffff);
		sdt->app_tag = 0;
		buf += bix->sector_size;
		sector++;
	}
}