blob: eaff1d80ec5369dff6630dc6e762cffa0cea7023 [file] [log] [blame]
Christopher Ferris48af7cb2017-02-21 12:35:09 -08001/****************************************************************************
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 Ferris48af7cb2017-02-21 12:35:09 -080023enum blk_zone_type {
24 BLK_ZONE_TYPE_CONVENTIONAL = 0x1,
25 BLK_ZONE_TYPE_SEQWRITE_REQ = 0x2,
26 BLK_ZONE_TYPE_SEQWRITE_PREF = 0x3,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080027};
28enum blk_zone_cond {
29 BLK_ZONE_COND_NOT_WP = 0x0,
30 BLK_ZONE_COND_EMPTY = 0x1,
Christopher Ferris48af7cb2017-02-21 12:35:09 -080031 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 Ferris48af7cb2017-02-21 12:35:09 -080035 BLK_ZONE_COND_FULL = 0xE,
36 BLK_ZONE_COND_OFFLINE = 0xF,
37};
38struct blk_zone {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080039 __u64 start;
40 __u64 len;
41 __u64 wp;
42 __u8 type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080043 __u8 cond;
44 __u8 non_seq;
45 __u8 reset;
46 __u8 reserved[36];
Christopher Ferris48af7cb2017-02-21 12:35:09 -080047};
48struct blk_zone_report {
49 __u64 sector;
50 __u32 nr_zones;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080051 __u8 reserved[4];
52 struct blk_zone zones[0];
Christopher Ferris9ce28842018-10-25 12:11:39 -070053};
Christopher Ferris48af7cb2017-02-21 12:35:09 -080054struct blk_zone_range {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080055 __u64 sector;
56 __u64 nr_sectors;
57};
58#define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080059#define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range)
60#endif