/* Description: Extract DIF parameters from the command if possible. Otherwise, use default parameters.  */
static void lpfc_get_cmd_dif_parms(struct scsi_cmnd *sc, uint16_t *apptagmask, uint16_t *apptagval, uint32_t *reftag)
/* Description: Extract DIF parameters from the command if possible. Otherwise, use default parameters.  */
static void lpfc_get_cmd_dif_parms(struct scsi_cmnd *sc, uint16_t *apptagmask, uint16_t *apptagval, uint32_t *reftag)
{
	struct  scsi_dif_tuple *spt;
	unsigned char op = scsi_get_prot_op(sc);
	unsigned int protcnt = scsi_prot_sg_count(sc);
	static int cnt;
	if (protcnt && (op == SCSI_PROT_WRITE_STRIP ||
				op == SCSI_PROT_WRITE_PASS)) {
		cnt++;
		spt = page_address(sg_page(scsi_prot_sglist(sc))) +
			scsi_prot_sglist(sc)[0].offset;
		*apptagmask = 0;
		*apptagval = 0;
		*reftag = cpu_to_be32(spt->ref_tag);
	} else {
		*reftag = (uint32_t) (0xffffffff & scsi_get_lba(sc));
		*apptagmask = 0;
		*apptagval = 0;
	}
}