blob: f7b1b78f6c4d3ce0819224c3a2d36b9b8f6d7404 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
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 Ferris48af7cb2017-02-21 12:35:09 -08007#ifndef _UAPI_BLKZONED_H
8#define _UAPI_BLKZONED_H
9#include <linux/types.h>
10#include <linux/ioctl.h>
Christopher Ferris48af7cb2017-02-21 12:35:09 -080011enum blk_zone_type {
12 BLK_ZONE_TYPE_CONVENTIONAL = 0x1,
13 BLK_ZONE_TYPE_SEQWRITE_REQ = 0x2,
14 BLK_ZONE_TYPE_SEQWRITE_PREF = 0x3,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080015};
16enum blk_zone_cond {
17 BLK_ZONE_COND_NOT_WP = 0x0,
18 BLK_ZONE_COND_EMPTY = 0x1,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080019 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 Ferris48af7cb2017-02-21 12:35:09 -080023 BLK_ZONE_COND_FULL = 0xE,
24 BLK_ZONE_COND_OFFLINE = 0xF,
25};
Christopher Ferris25c18d42020-10-14 17:42:58 -070026enum blk_zone_report_flags {
27 BLK_ZONE_REP_CAPACITY = (1 << 0),
28};
Christopher Ferris48af7cb2017-02-21 12:35:09 -080029struct blk_zone {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080030 __u64 start;
31 __u64 len;
32 __u64 wp;
33 __u8 type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080034 __u8 cond;
35 __u8 non_seq;
36 __u8 reset;
Christopher Ferris25c18d42020-10-14 17:42:58 -070037 __u8 resv[4];
38 __u64 capacity;
39 __u8 reserved[24];
Christopher Ferris48af7cb2017-02-21 12:35:09 -080040};
41struct blk_zone_report {
42 __u64 sector;
43 __u32 nr_zones;
Christopher Ferris25c18d42020-10-14 17:42:58 -070044 __u32 flags;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070045 struct blk_zone zones[];
Christopher Ferris9ce28842018-10-25 12:11:39 -070046};
Christopher Ferris48af7cb2017-02-21 12:35:09 -080047struct blk_zone_range {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080048 __u64 sector;
49 __u64 nr_sectors;
50};
51#define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080052#define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range)
Christopher Ferris86a48372019-01-10 14:14:59 -080053#define BLKGETZONESZ _IOR(0x12, 132, __u32)
54#define BLKGETNRZONES _IOR(0x12, 133, __u32)
Christopher Ferrisd32ca142020-02-04 16:16:51 -080055#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 Ferris48af7cb2017-02-21 12:35:09 -080058#endif