blk: define op_flag to handle some special block operation

Usage:
	If prepare to read & write block data, just do it like this:
		struct blk_desc desc;
		......
		desc.op_flag = BLK_PRE_RW;
		blk_dread(......);
		desc.op_flag = 0;

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I180bb7c09a7021e1f80760cc852169b3f750941d
This commit is contained in:
Jason Zhu 2020-08-06 09:14:15 +08:00
parent 7ddc1c3556
commit 1f3b6bbf4e
1 changed files with 5 additions and 0 deletions

View File

@ -51,6 +51,10 @@ enum if_type {
#define BLK_PRD_SIZE 20
#define BLK_REV_SIZE 8
/* define block device operation flags */
#define BLK_PRE_RW 1 /* Block prepare read & write*/
#define BLK_MTD_NBA_RW 2 /* MTD block non-block-aligned read & write */
/*
* Identifies the partition table type (ie. MBR vs GPT GUID) signature
*/
@ -79,6 +83,7 @@ struct blk_desc {
unsigned char hwpart; /* HW partition, e.g. for eMMC */
unsigned char type; /* device type */
unsigned char removable; /* removable device */
unsigned char op_flag; /* Some special operation flags */
#ifdef CONFIG_LBA48
/* device can use 48bit addr (ATA/ATAPI v7) */
unsigned char lba48;