blob: 588fbd812d8341268e7c90391454d3c42a3c858d [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
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 _UAPILINUX_NBD_H
20#define _UAPILINUX_NBD_H
21#include <linux/types.h>
Tao Baod7db5942015-01-28 10:07:51 -080022#define NBD_SET_SOCK _IO(0xab, 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080024#define NBD_SET_BLKSIZE _IO(0xab, 1)
25#define NBD_SET_SIZE _IO(0xab, 2)
26#define NBD_DO_IT _IO(0xab, 3)
27#define NBD_CLEAR_SOCK _IO(0xab, 4)
Ben Cheng655a7c02013-10-16 16:09:24 -070028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080029#define NBD_CLEAR_QUE _IO(0xab, 5)
30#define NBD_PRINT_DEBUG _IO(0xab, 6)
31#define NBD_SET_SIZE_BLOCKS _IO(0xab, 7)
32#define NBD_DISCONNECT _IO(0xab, 8)
Ben Cheng655a7c02013-10-16 16:09:24 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080034#define NBD_SET_TIMEOUT _IO(0xab, 9)
35#define NBD_SET_FLAGS _IO(0xab, 10)
Ben Cheng655a7c02013-10-16 16:09:24 -070036enum {
Tao Baod7db5942015-01-28 10:07:51 -080037 NBD_CMD_READ = 0,
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080039 NBD_CMD_WRITE = 1,
40 NBD_CMD_DISC = 2,
41 NBD_CMD_FLUSH = 3,
42 NBD_CMD_TRIM = 4
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44};
45#define NBD_FLAG_HAS_FLAGS (1 << 0)
46#define NBD_FLAG_READ_ONLY (1 << 1)
47#define NBD_FLAG_SEND_FLUSH (1 << 2)
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define NBD_FLAG_SEND_TRIM (1 << 5)
50#define nbd_cmd(req) ((req)->cmd[0])
51#define NBD_REQUEST_MAGIC 0x25609513
52#define NBD_REPLY_MAGIC 0x67446698
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54struct nbd_request {
Tao Baod7db5942015-01-28 10:07:51 -080055 __be32 magic;
56 __be32 type;
57 char handle[8];
Ben Cheng655a7c02013-10-16 16:09:24 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080059 __be64 from;
60 __be32 len;
Ben Cheng655a7c02013-10-16 16:09:24 -070061} __attribute__((packed));
62struct nbd_reply {
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080064 __be32 magic;
65 __be32 error;
66 char handle[8];
Ben Cheng655a7c02013-10-16 16:09:24 -070067};
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#endif