Motr  M0
kem_dev.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2019-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 
23 #pragma once
24 
25 #ifndef __MOTR_SCRIPTS_SYSTEMTAP_KEM_KEM_DEV_H__
26 #define __MOTR_SCRIPTS_SYSTEMTAP_KEM_KEM_DEV_H__
27 
28 #include <linux/types.h>
29 #include <linux/cdev.h>
30 #include "kem.h"
31 
32 #define KEMD_BUFFER_SIZE (4*1024)
33 #define KEMD_READ_PORTION 20
34 
35 /*
36  * Major number 60 has been chosen as it's number for local/experimental
37  * devices. Refer to Linux Kernel documentation for details:
38  *
39  * https://www.kernel.org/doc/Documentation/admin-guide/devices.txt
40  */
41 #define KEMD_MAJOR 60
42 #define KEMD_MINOR 0
43 
50 struct kem_rb {
51  struct ke_msg *kr_buf;
52  unsigned int kr_size;
53  unsigned int kr_read_idx;
54  unsigned int kr_write_idx;
55  atomic_t kr_written;
56  unsigned int kr_logged;
57  unsigned int kr_occurred;
58 };
59 
60 struct kem_dev {
61  struct cdev kd_cdev;
62  atomic_t kd_busy;
63  int kd_num;
64  struct kem_rb *kd_rb;
65 };
66 
69 #endif /* __MOTR_SCRIPTS_SYSTEMTAP_KEM_KEM_DEV_H__ */
70 
71 /*
72  * Local variables:
73  * c-indentation-style: "K&R"
74  * c-basic-offset: 8
75  * tab-width: 8
76  * fill-column: 80
77  * scroll-step: 1
78  * End:
79  */
80 /*
81  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
82  */
unsigned int kr_logged
Definition: kem_dev.h:56
atomic_t kr_written
Definition: kem_dev.h:55
unsigned int kr_read_idx
Definition: kem_dev.h:53
struct kem_rb * kd_rb
Definition: kem_dev.h:64
unsigned int kr_occurred
Definition: kem_dev.h:57
struct cdev kd_cdev
Definition: kem_dev.h:61
struct ke_msg * kr_buf
Definition: kem_dev.h:51
Definition: kem.h:70
int kd_num
Definition: kem_dev.h:63
atomic_t kd_busy
Definition: kem_dev.h:62
Definition: kem_dev.h:50
unsigned int kr_size
Definition: kem_dev.h:52
unsigned int kr_write_idx
Definition: kem_dev.h:54