streamlining.
[~madcoder/pwqr.git] / kernel / pwqr.h
index a7aa086..aaf2aa4 100644 (file)
 #define _LINUX_PWQR_H
 #include <linux/ioctl.h>
 
+#ifdef __KERNEL__
+#include <linux/fcntl.h>
+#else
+#include <fcntl.h>
+#endif
+
 #define PWQR_DEVICE_NAME       "pwq"
 #define PWQR_IO                        '}'
 
@@ -30,13 +36,18 @@ struct pwqr_ioc_wait {
        void   *pwqr_uaddr;
 };
 
-#define PWQR_GET_CONC          _IO (PWQR_IO, 0)
-#define PWQR_SET_CONC          _IO (PWQR_IO, 1)
-#define PWQR_REGISTER          _IO (PWQR_IO, 2)
-#define PWQR_UNREGISTER                _IO (PWQR_IO, 3)
-#define PWQR_WAKE              _IO (PWQR_IO, 4)
-#define PWQR_WAKE_OC           _IO (PWQR_IO, 5)
-#define PWQR_WAIT              _IOW(PWQR_IO, 6, struct pwqr_ioc_wait)
-#define PWQR_PARK              _IO (PWQR_IO, 7)
+#define PWQR_CTL_GET_CONC      _IO (PWQR_IO, 0)
+#define PWQR_CTL_SET_CONC      _IO (PWQR_IO, 1)
+#define PWQR_CTL_REGISTER      _IO (PWQR_IO, 2)
+#define PWQR_CTL_UNREGISTER    _IO (PWQR_IO, 3)
+#define PWQR_CTL_WAKE          _IO (PWQR_IO, 4)
+#define PWQR_CTL_WAKE_OC       _IO (PWQR_IO, 5)
+#define PWQR_CTL_WAIT          _IOW(PWQR_IO, 6, struct pwqr_ioc_wait)
+#define PWQR_CTL_PARK          _IO (PWQR_IO, 7)
+
+#define PWQR_FL_NONBLOCK       O_NONBLOCK
+#define PWQR_FL_CLOEXEC                O_CLOEXEC
+#define PWQR_FL__FCTNL_FLAGS   (PWQR_FL_NONBLOCK | PWQR_FL_CLOEXEC)
+#define PWQR_FL__SET           (PWQR_FL__FCTNL_FLAGS)
 
 #endif