Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
| 19 | #ifndef _UAPI_BLKZONED_H |
| 20 | #define _UAPI_BLKZONED_H |
| 21 | #include <linux/types.h> |
| 22 | #include <linux/ioctl.h> |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 23 | enum blk_zone_type { |
| 24 | BLK_ZONE_TYPE_CONVENTIONAL = 0x1, |
| 25 | BLK_ZONE_TYPE_SEQWRITE_REQ = 0x2, |
| 26 | BLK_ZONE_TYPE_SEQWRITE_PREF = 0x3, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 27 | }; |
| 28 | enum blk_zone_cond { |
| 29 | BLK_ZONE_COND_NOT_WP = 0x0, |
| 30 | BLK_ZONE_COND_EMPTY = 0x1, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 31 | BLK_ZONE_COND_IMP_OPEN = 0x2, |
| 32 | BLK_ZONE_COND_EXP_OPEN = 0x3, |
| 33 | BLK_ZONE_COND_CLOSED = 0x4, |
| 34 | BLK_ZONE_COND_READONLY = 0xD, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 35 | BLK_ZONE_COND_FULL = 0xE, |
| 36 | BLK_ZONE_COND_OFFLINE = 0xF, |
| 37 | }; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 38 | enum blk_zone_report_flags { |
| 39 | BLK_ZONE_REP_CAPACITY = (1 << 0), |
| 40 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 41 | struct blk_zone { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 42 | __u64 start; |
| 43 | __u64 len; |
| 44 | __u64 wp; |
| 45 | __u8 type; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 46 | __u8 cond; |
| 47 | __u8 non_seq; |
| 48 | __u8 reset; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 49 | __u8 resv[4]; |
| 50 | __u64 capacity; |
| 51 | __u8 reserved[24]; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 52 | }; |
| 53 | struct blk_zone_report { |
| 54 | __u64 sector; |
| 55 | __u32 nr_zones; |
Christopher Ferris | 25c18d4 | 2020-10-14 17:42:58 -0700 | [diff] [blame] | 56 | __u32 flags; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 57 | struct blk_zone zones[0]; |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 58 | }; |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 59 | struct blk_zone_range { |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 60 | __u64 sector; |
| 61 | __u64 nr_sectors; |
| 62 | }; |
| 63 | #define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 64 | #define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range) |
Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 65 | #define BLKGETZONESZ _IOR(0x12, 132, __u32) |
| 66 | #define BLKGETNRZONES _IOR(0x12, 133, __u32) |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 67 | #define BLKOPENZONE _IOW(0x12, 134, struct blk_zone_range) |
| 68 | #define BLKCLOSEZONE _IOW(0x12, 135, struct blk_zone_range) |
| 69 | #define BLKFINISHZONE _IOW(0x12, 136, struct blk_zone_range) |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 70 | #endif |