Motr  M0
chs.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-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_DESIM_CHS_H__
26 #define __MOTR_DESIM_CHS_H__
27 
33 /*
34  * CHS: Cylinder-head-sector rotational storage.
35  */
36 #include "desim/sim.h"
37 #include "desim/storage.h"
38 
39 struct chs_dev;
40 
41 struct chs_conf {
43 
44  unsigned cc_heads;
45  unsigned cc_cylinders;
46  unsigned cc_track_skew;
47  unsigned cc_cylinder_skew;
48  unsigned cc_sectors_min;
49  unsigned cc_sectors_max;
50  unsigned cc_cyl_in_zone;
51 
58 
59  unsigned cc_rps; /* revolutions per second */
60 
61  long long cc_alpha;
62  long long cc_beta;
63 
64  struct {
68  } *cc_zone;
69 };
70 
74 };
75 
76 struct chs_dev {
78  struct chs_conf *cd_conf;
80  unsigned cd_head;
81  unsigned cd_cylinder;
82  struct sim_chan cd_wait;
84 
85  struct cnt cd_seek_time;
87  struct cnt cd_xfer_time;
88  struct cnt cd_read_size;
90 };
91 
92 M0_INTERNAL void chs_conf_init(struct chs_conf *conf);
93 M0_INTERNAL void chs_conf_fini(struct chs_conf *conf);
94 
95 M0_INTERNAL void chs_dev_init(struct chs_dev *dev, struct sim *sim,
96  struct chs_conf *conf);
97 M0_INTERNAL void chs_dev_fini(struct chs_dev *dev);
98 
99 #endif /* __MOTR_DESIM_CHS_H__ */
100 
103 /*
104  * Local variables:
105  * c-indentation-style: "K&R"
106  * c-basic-offset: 8
107  * tab-width: 8
108  * fill-column: 80
109  * scroll-step: 1
110  * End:
111  */
unsigned cc_sectors_min
Definition: chs.h:48
unsigned cc_cyl_in_zone
Definition: chs.h:50
struct chs_conf * cd_conf
Definition: chs.h:78
struct sim_callout cd_todo
Definition: chs.h:83
Definition: sim.h:152
Definition: chs.h:72
sector_t cyl_sectors
Definition: chs.h:66
long long cc_beta
Definition: chs.h:62
unsigned cc_heads
Definition: chs.h:44
M0_INTERNAL void chs_dev_fini(struct chs_dev *dev)
Definition: chs.c:147
M0_INTERNAL void chs_conf_fini(struct chs_conf *conf)
Definition: chs.c:123
sim_time_t cc_seek_track_to_track
Definition: chs.h:53
Definition: chs.h:41
Definition: conf.py:1
struct chs_conf::@140 * cc_zone
sim_time_t cc_head_switch
Definition: chs.h:56
unsigned long long sector_t
Definition: storage.h:34
struct cnt cd_write_size
Definition: chs.h:89
sim_time_t cc_seek_full_stroke
Definition: chs.h:54
Definition: cnt.h:36
M0_INTERNAL void chs_conf_init(struct chs_conf *conf)
Definition: chs.c:43
struct cnt cd_read_size
Definition: chs.h:88
sim_time_t cc_seek_avg
Definition: chs.h:52
sim_time_t cc_command_latency
Definition: chs.h:57
sector_t track_sectors
Definition: chs.h:65
chs_dev_state
Definition: chs.h:71
unsigned cc_sectors_max
Definition: chs.h:49
unsigned cc_rps
Definition: chs.h:59
unsigned long long sim_time_t
Definition: sim.h:111
long long cc_alpha
Definition: chs.h:61
Definition: sim.h:237
unsigned cd_cylinder
Definition: chs.h:81
Definition: chs.h:76
struct cnt cd_xfer_time
Definition: chs.h:87
unsigned cc_cylinder_skew
Definition: chs.h:47
Definition: chs.h:73
unsigned cd_head
Definition: chs.h:80
struct storage_conf cc_storage
Definition: chs.h:42
unsigned cc_track_skew
Definition: chs.h:46
M0_INTERNAL void chs_dev_init(struct chs_dev *dev, struct sim *sim, struct chs_conf *conf)
Definition: chs.c:129
struct sim_chan cd_wait
Definition: chs.h:82
sim_time_t cc_write_settle
Definition: chs.h:55
struct cnt cd_rotation_time
Definition: chs.h:86
struct storage_dev cd_storage
Definition: chs.h:77
sector_t cyl_first
Definition: chs.h:67
struct cnt cd_seek_time
Definition: chs.h:85
enum chs_dev_state cd_state
Definition: chs.h:79
unsigned cc_cylinders
Definition: chs.h:45