Merge "wlan_cfg80211: Set the hidden ssid scan properly." into tizen
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / drivers / misc / tizen_global_lock.h
1 /*
2  * Tizen Global Lock device driver
3  *
4  * Copyright (C) 2014 Samsung Electronics Co., Ltd.
5  *
6  * Author: YoungJun Cho <yj44.cho@samsung.com>
7  *
8  * This program is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License version 2, as published
10  * by the Free Software Foundation.
11  */
12
13 #ifndef __TGL__
14 #define __TGL__
15
16 #define TGL_IOCTL_BASE          0x32
17 #define TGL_IO(nr)              _IO(TGL_IOCTL_BASE, nr)
18 #define TGL_IOR(nr, type)       _IOR(TGL_IOCTL_BASE, nr, type)
19 #define TGL_IOW(nr, type)       _IOW(TGL_IOCTL_BASE, nr, type)
20 #define TGL_IOWR(nr, type)      _IOWR(TGL_IOCTL_BASE, nr, type)
21
22 /**
23  * struct tgl_reg_data - tgl register data structure
24  * @key: lookup key
25  * @timeout_ms: timeout value for waiting event
26  */
27 struct tgl_reg_data {
28         unsigned int key;
29         unsigned int timeout_ms;
30 };
31
32 enum tgl_type_data {
33         TGL_TYPE_NONE = 0,
34         TGL_TYPE_READ = (1 << 0),
35         TGL_TYPE_WRITE = (1 << 1),
36 };
37
38 /**
39  * struct tgl_lock_data - tgl lock data structure
40  * @key: lookup key
41  * @type: lock type that is in tgl_type_data
42  */
43 struct tgl_lock_data {
44         unsigned int key;
45         enum tgl_type_data type;
46 };
47
48 enum tgl_status_data {
49         TGL_STATUS_UNLOCKED,
50         TGL_STATUS_LOCKED,
51 };
52
53 /**
54  * struct tgl_usr_data - tgl user data structure
55  * @key: lookup key
56  * @data1: user data 1
57  * @data2: user data 2
58  * @status: lock status that is in tgl_status_data
59  */
60 struct tgl_usr_data {
61         unsigned int key;
62         unsigned int data1;
63         unsigned int data2;
64         enum tgl_status_data status;
65 };
66
67 enum {
68         _TGL_REGISTER = 1,
69         _TGL_UNREGISTER,
70         _TGL_LOCK,
71         _TGL_UNLOCK,
72         _TGL_SET_DATA,
73         _TGL_GET_DATA,
74 };
75
76 /* register key */
77 #define TGL_IOCTL_REGISTER      TGL_IOW(_TGL_REGISTER, struct tgl_reg_data)
78 /* unregister key */
79 #define TGL_IOCTL_UNREGISTER    TGL_IOW(_TGL_UNREGISTER, struct tgl_reg_data)
80 /* lock with key */
81 #define TGL_IOCTL_LOCK          TGL_IOW(_TGL_LOCK, struct tgl_lock_data)
82 /* unlock with key */
83 #define TGL_IOCTL_UNLOCK        TGL_IOW(_TGL_UNLOCK, struct tgl_lock_data)
84 /* set user data with key */
85 #define TGL_IOCTL_SET_DATA      TGL_IOW(_TGL_SET_DATA, struct tgl_usr_data)
86 /* get user data with key */
87 #define TGL_IOCTL_GET_DATA      TGL_IOR(_TGL_GET_DATA, struct tgl_usr_data)
88
89 #endif  /* __TGL__ */