Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 7 | #ifndef _UAPI_BLKZONED_H |
| 8 | #define _UAPI_BLKZONED_H |
| 9 | #include <linux/types.h> |
| 10 | #include <linux/ioctl.h> |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 11 | enum blk_zone_type { |
| 12 | BLK_ZONE_TYPE_CONVENTIONAL = 0x1, |
| 13 | BLK_ZONE_TYPE_SEQWRITE_REQ = 0x2, |
| 14 | BLK_ZONE_TYPE_SEQWRITE_PREF = 0x3, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 15 | }; |
| 16 | enum blk_zone_cond { |
| 17 | BLK_ZONE_COND_NOT_WP = 0x0, |
| 18 | BLK_ZONE_COND_EMPTY = 0x1, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 19 | BLK_ZONE_COND_IMP_OPEN = 0x2, |
| 20 | BLK_ZONE_COND_EXP_OPEN = 0x3, |
| 21 | BLK_ZONE_COND_CLOSED = 0x4, |
| 22 | BLK_ZONE_COND_READONLY = 0xD, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 23 | BLK_ZONE_COND_FULL = 0xE, |
| 24 | BLK_ZONE_COND_OFFLINE = 0xF, |
| 25 | }; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 26 | enum blk_zone_report_flags { |
| 27 | BLK_ZONE_REP_CAPACITY = (1 << 0), |
| 28 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 29 | struct blk_zone { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 30 | __u64 start; |
| 31 | __u64 len; |
| 32 | __u64 wp; |
| 33 | __u8 type; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 34 | __u8 cond; |
| 35 | __u8 non_seq; |
| 36 | __u8 reset; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 37 | __u8 resv[4]; |
| 38 | __u64 capacity; |
| 39 | __u8 reserved[24]; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 40 | }; |
| 41 | struct blk_zone_report { |
| 42 | __u64 sector; |
| 43 | __u32 nr_zones; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 44 | __u32 flags; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame] | 45 | struct blk_zone zones[]; |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 46 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 47 | struct blk_zone_range { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 48 | __u64 sector; |
| 49 | __u64 nr_sectors; |
| 50 | }; |
| 51 | #define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 52 | #define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range) |
Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 53 | #define BLKGETZONESZ _IOR(0x12, 132, __u32) |
| 54 | #define BLKGETNRZONES _IOR(0x12, 133, __u32) |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 55 | #define BLKOPENZONE _IOW(0x12, 134, struct blk_zone_range) |
| 56 | #define BLKCLOSEZONE _IOW(0x12, 135, struct blk_zone_range) |
| 57 | #define BLKFINISHZONE _IOW(0x12, 136, struct blk_zone_range) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 58 | #endif |