diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2007-10-12 10:11:16 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-10-12 10:12:59 -0400 |
commit | c02087162af5d8880ff2d688999d71e1bfa16f2f (patch) | |
tree | 5d4250db2ba2225f417f634eebb404311bf60402 | |
parent | fc5019c5c7067bcea1e49fe9cd5190285f0c8927 (diff) |
[S390] cio: Kerneldoc comments for cmf.
- Fix existing kerneldoc-style comments.
- Move descriptions of functions from cmb.h to cmf.c.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
-rw-r--r-- | drivers/s390/cio/cmf.c | 87 | ||||
-rw-r--r-- | include/asm-s390/cmb.h | 65 |
2 files changed, 89 insertions, 63 deletions
diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c index ff1e442d4b09..6ef0ab895477 100644 --- a/drivers/s390/cio/cmf.c +++ b/drivers/s390/cio/cmf.c | |||
@@ -74,19 +74,20 @@ enum cmb_index { | |||
74 | * enum cmb_format - types of supported measurement block formats | 74 | * enum cmb_format - types of supported measurement block formats |
75 | * | 75 | * |
76 | * @CMF_BASIC: traditional channel measurement blocks supported | 76 | * @CMF_BASIC: traditional channel measurement blocks supported |
77 | * by all machines that we run on | 77 | * by all machines that we run on |
78 | * @CMF_EXTENDED: improved format that was introduced with the z990 | 78 | * @CMF_EXTENDED: improved format that was introduced with the z990 |
79 | * machine | 79 | * machine |
80 | * @CMF_AUTODETECT: default: use extended format when running on a z990 | 80 | * @CMF_AUTODETECT: default: use extended format when running on a machine |
81 | * or later machine, otherwise fall back to basic format | 81 | * supporting extended format, otherwise fall back to |
82 | **/ | 82 | * basic format |
83 | */ | ||
83 | enum cmb_format { | 84 | enum cmb_format { |
84 | CMF_BASIC, | 85 | CMF_BASIC, |
85 | CMF_EXTENDED, | 86 | CMF_EXTENDED, |
86 | CMF_AUTODETECT = -1, | 87 | CMF_AUTODETECT = -1, |
87 | }; | 88 | }; |
88 | 89 | ||
89 | /** | 90 | /* |
90 | * format - actual format for all measurement blocks | 91 | * format - actual format for all measurement blocks |
91 | * | 92 | * |
92 | * The format module parameter can be set to a value of 0 (zero) | 93 | * The format module parameter can be set to a value of 0 (zero) |
@@ -107,6 +108,7 @@ module_param(format, bool, 0444); | |||
107 | * either with the help of a special pool or with kmalloc | 108 | * either with the help of a special pool or with kmalloc |
108 | * @free: free memory allocated with @alloc | 109 | * @free: free memory allocated with @alloc |
109 | * @set: enable or disable measurement | 110 | * @set: enable or disable measurement |
111 | * @read: read a measurement entry at an index | ||
110 | * @readall: read a measurement block in a common format | 112 | * @readall: read a measurement block in a common format |
111 | * @reset: clear the data in the associated measurement block and | 113 | * @reset: clear the data in the associated measurement block and |
112 | * reset its time stamp | 114 | * reset its time stamp |
@@ -120,7 +122,7 @@ struct cmb_operations { | |||
120 | int (*readall)(struct ccw_device *, struct cmbdata *); | 122 | int (*readall)(struct ccw_device *, struct cmbdata *); |
121 | void (*reset) (struct ccw_device *); | 123 | void (*reset) (struct ccw_device *); |
122 | void *(*align) (void *); | 124 | void *(*align) (void *); |
123 | 125 | /* private: */ | |
124 | struct attribute_group *attr_group; | 126 | struct attribute_group *attr_group; |
125 | }; | 127 | }; |
126 | static struct cmb_operations *cmbops; | 128 | static struct cmb_operations *cmbops; |
@@ -471,6 +473,7 @@ static void cmf_generic_reset(struct ccw_device *cdev) | |||
471 | * | 473 | * |
472 | * @mem: pointer to CMBs (only in basic measurement mode) | 474 | * @mem: pointer to CMBs (only in basic measurement mode) |
473 | * @list: contains a linked list of all subchannels | 475 | * @list: contains a linked list of all subchannels |
476 | * @num_channels: number of channels to be measured | ||
474 | * @lock: protect concurrent access to @mem and @list | 477 | * @lock: protect concurrent access to @mem and @list |
475 | */ | 478 | */ |
476 | struct cmb_area { | 479 | struct cmb_area { |
@@ -503,10 +506,20 @@ module_param_named(maxchannels, cmb_area.num_channels, uint, 0444); | |||
503 | 506 | ||
504 | /** | 507 | /** |
505 | * struct cmb - basic channel measurement block | 508 | * struct cmb - basic channel measurement block |
509 | * @ssch_rsch_count: number of ssch and rsch | ||
510 | * @sample_count: number of samples | ||
511 | * @device_connect_time: time of device connect | ||
512 | * @function_pending_time: time of function pending | ||
513 | * @device_disconnect_time: time of device disconnect | ||
514 | * @control_unit_queuing_time: time of control unit queuing | ||
515 | * @device_active_only_time: time of device active only | ||
516 | * @reserved: unused in basic measurement mode | ||
517 | * | ||
518 | * The measurement block as used by the hardware. The fields are described | ||
519 | * further in z/Architecture Principles of Operation, chapter 17. | ||
506 | * | 520 | * |
507 | * cmb as used by the hardware the fields are described in z/Architecture | 521 | * The cmb area made up from these blocks must be a contiguous array and may |
508 | * Principles of Operation, chapter 17. | 522 | * not be reallocated or freed. |
509 | * The area to be a contiguous array and may not be reallocated or freed. | ||
510 | * Only one cmb area can be present in the system. | 523 | * Only one cmb area can be present in the system. |
511 | */ | 524 | */ |
512 | struct cmb { | 525 | struct cmb { |
@@ -804,9 +817,20 @@ static struct cmb_operations cmbops_basic = { | |||
804 | 817 | ||
805 | /** | 818 | /** |
806 | * struct cmbe - extended channel measurement block | 819 | * struct cmbe - extended channel measurement block |
820 | * @ssch_rsch_count: number of ssch and rsch | ||
821 | * @sample_count: number of samples | ||
822 | * @device_connect_time: time of device connect | ||
823 | * @function_pending_time: time of function pending | ||
824 | * @device_disconnect_time: time of device disconnect | ||
825 | * @control_unit_queuing_time: time of control unit queuing | ||
826 | * @device_active_only_time: time of device active only | ||
827 | * @device_busy_time: time of device busy | ||
828 | * @initial_command_response_time: initial command response time | ||
829 | * @reserved: unused | ||
807 | * | 830 | * |
808 | * cmb as used by the hardware, may be in any 64 bit physical location, | 831 | * The measurement block as used by the hardware. May be in any 64 bit physical |
809 | * the fields are described in z/Architecture Principles of Operation, | 832 | * location. |
833 | * The fields are described further in z/Architecture Principles of Operation, | ||
810 | * third edition, chapter 17. | 834 | * third edition, chapter 17. |
811 | */ | 835 | */ |
812 | struct cmbe { | 836 | struct cmbe { |
@@ -1218,7 +1242,15 @@ static ssize_t cmb_enable_store(struct device *dev, | |||
1218 | 1242 | ||
1219 | DEVICE_ATTR(cmb_enable, 0644, cmb_enable_show, cmb_enable_store); | 1243 | DEVICE_ATTR(cmb_enable, 0644, cmb_enable_show, cmb_enable_store); |
1220 | 1244 | ||
1221 | /* enable_cmf/disable_cmf: module interface for cmf (de)activation */ | 1245 | /** |
1246 | * enable_cmf() - switch on the channel measurement for a specific device | ||
1247 | * @cdev: The ccw device to be enabled | ||
1248 | * | ||
1249 | * Returns %0 for success or a negative error value. | ||
1250 | * | ||
1251 | * Context: | ||
1252 | * non-atomic | ||
1253 | */ | ||
1222 | int enable_cmf(struct ccw_device *cdev) | 1254 | int enable_cmf(struct ccw_device *cdev) |
1223 | { | 1255 | { |
1224 | int ret; | 1256 | int ret; |
@@ -1240,6 +1272,15 @@ int enable_cmf(struct ccw_device *cdev) | |||
1240 | return ret; | 1272 | return ret; |
1241 | } | 1273 | } |
1242 | 1274 | ||
1275 | /** | ||
1276 | * disable_cmf() - switch off the channel measurement for a specific device | ||
1277 | * @cdev: The ccw device to be disabled | ||
1278 | * | ||
1279 | * Returns %0 for success or a negative error value. | ||
1280 | * | ||
1281 | * Context: | ||
1282 | * non-atomic | ||
1283 | */ | ||
1243 | int disable_cmf(struct ccw_device *cdev) | 1284 | int disable_cmf(struct ccw_device *cdev) |
1244 | { | 1285 | { |
1245 | int ret; | 1286 | int ret; |
@@ -1252,11 +1293,31 @@ int disable_cmf(struct ccw_device *cdev) | |||
1252 | return ret; | 1293 | return ret; |
1253 | } | 1294 | } |
1254 | 1295 | ||
1296 | /** | ||
1297 | * cmf_read() - read one value from the current channel measurement block | ||
1298 | * @cdev: the channel to be read | ||
1299 | * @index: the index of the value to be read | ||
1300 | * | ||
1301 | * Returns the value read or %0 if the value cannot be read. | ||
1302 | * | ||
1303 | * Context: | ||
1304 | * any | ||
1305 | */ | ||
1255 | u64 cmf_read(struct ccw_device *cdev, int index) | 1306 | u64 cmf_read(struct ccw_device *cdev, int index) |
1256 | { | 1307 | { |
1257 | return cmbops->read(cdev, index); | 1308 | return cmbops->read(cdev, index); |
1258 | } | 1309 | } |
1259 | 1310 | ||
1311 | /** | ||
1312 | * cmf_readall() - read the current channel measurement block | ||
1313 | * @cdev: the channel to be read | ||
1314 | * @data: a pointer to a data block that will be filled | ||
1315 | * | ||
1316 | * Returns %0 on success, a negative error value otherwise. | ||
1317 | * | ||
1318 | * Context: | ||
1319 | * any | ||
1320 | */ | ||
1260 | int cmf_readall(struct ccw_device *cdev, struct cmbdata *data) | 1321 | int cmf_readall(struct ccw_device *cdev, struct cmbdata *data) |
1261 | { | 1322 | { |
1262 | return cmbops->readall(cdev, data); | 1323 | return cmbops->readall(cdev, data); |
diff --git a/include/asm-s390/cmb.h b/include/asm-s390/cmb.h index 2e84eebaf8f4..50196857d27a 100644 --- a/include/asm-s390/cmb.h +++ b/include/asm-s390/cmb.h | |||
@@ -1,29 +1,29 @@ | |||
1 | #ifndef S390_CMB_H | 1 | #ifndef S390_CMB_H |
2 | #define S390_CMB_H | 2 | #define S390_CMB_H |
3 | /** | 3 | /** |
4 | * struct cmbdata -- channel measurement block data for user space | 4 | * struct cmbdata - channel measurement block data for user space |
5 | * @size: size of the stored data | ||
6 | * @elapsed_time: time since last sampling | ||
7 | * @ssch_rsch_count: number of ssch and rsch | ||
8 | * @sample_count: number of samples | ||
9 | * @device_connect_time: time of device connect | ||
10 | * @function_pending_time: time of function pending | ||
11 | * @device_disconnect_time: time of device disconnect | ||
12 | * @control_unit_queuing_time: time of control unit queuing | ||
13 | * @device_active_only_time: time of device active only | ||
14 | * @device_busy_time: time of device busy (ext. format) | ||
15 | * @initial_command_response_time: initial command response time (ext. format) | ||
5 | * | 16 | * |
6 | * @size: size of the stored data | 17 | * All values are stored as 64 bit for simplicity, especially |
7 | * @ssch_rsch_count: XXX | ||
8 | * @sample_count: | ||
9 | * @device_connect_time: | ||
10 | * @function_pending_time: | ||
11 | * @device_disconnect_time: | ||
12 | * @control_unit_queuing_time: | ||
13 | * @device_active_only_time: | ||
14 | * @device_busy_time: | ||
15 | * @initial_command_response_time: | ||
16 | * | ||
17 | * all values are stored as 64 bit for simplicity, especially | ||
18 | * in 32 bit emulation mode. All time values are normalized to | 18 | * in 32 bit emulation mode. All time values are normalized to |
19 | * nanoseconds. | 19 | * nanoseconds. |
20 | * Currently, two formats are known, which differ by the size of | 20 | * Currently, two formats are known, which differ by the size of |
21 | * this structure, i.e. the last two members are only set when | 21 | * this structure, i.e. the last two members are only set when |
22 | * the extended channel measurement facility (first shipped in | 22 | * the extended channel measurement facility (first shipped in |
23 | * z990 machines) is activated. | 23 | * z990 machines) is activated. |
24 | * Potentially, more fields could be added, which results in a | 24 | * Potentially, more fields could be added, which would result in a |
25 | * new ioctl number. | 25 | * new ioctl number. |
26 | **/ | 26 | */ |
27 | struct cmbdata { | 27 | struct cmbdata { |
28 | __u64 size; | 28 | __u64 size; |
29 | __u64 elapsed_time; | 29 | __u64 elapsed_time; |
@@ -49,44 +49,9 @@ struct cmbdata { | |||
49 | 49 | ||
50 | #ifdef __KERNEL__ | 50 | #ifdef __KERNEL__ |
51 | struct ccw_device; | 51 | struct ccw_device; |
52 | /** | ||
53 | * enable_cmf() - switch on the channel measurement for a specific device | ||
54 | * @cdev: The ccw device to be enabled | ||
55 | * returns 0 for success or a negative error value. | ||
56 | * | ||
57 | * Context: | ||
58 | * non-atomic | ||
59 | **/ | ||
60 | extern int enable_cmf(struct ccw_device *cdev); | 52 | extern int enable_cmf(struct ccw_device *cdev); |
61 | |||
62 | /** | ||
63 | * disable_cmf() - switch off the channel measurement for a specific device | ||
64 | * @cdev: The ccw device to be disabled | ||
65 | * returns 0 for success or a negative error value. | ||
66 | * | ||
67 | * Context: | ||
68 | * non-atomic | ||
69 | **/ | ||
70 | extern int disable_cmf(struct ccw_device *cdev); | 53 | extern int disable_cmf(struct ccw_device *cdev); |
71 | |||
72 | /** | ||
73 | * cmf_read() - read one value from the current channel measurement block | ||
74 | * @cmf: the channel to be read | ||
75 | * @index: the name of the value that is read | ||
76 | * | ||
77 | * Context: | ||
78 | * any | ||
79 | **/ | ||
80 | |||
81 | extern u64 cmf_read(struct ccw_device *cdev, int index); | 54 | extern u64 cmf_read(struct ccw_device *cdev, int index); |
82 | /** | ||
83 | * cmf_readall() - read one value from the current channel measurement block | ||
84 | * @cmf: the channel to be read | ||
85 | * @data: a pointer to a data block that will be filled | ||
86 | * | ||
87 | * Context: | ||
88 | * any | ||
89 | **/ | ||
90 | extern int cmf_readall(struct ccw_device *cdev, struct cmbdata *data); | 55 | extern int cmf_readall(struct ccw_device *cdev, struct cmbdata *data); |
91 | 56 | ||
92 | #endif /* __KERNEL__ */ | 57 | #endif /* __KERNEL__ */ |