Lines Matching +full:report +full:- +full:speed +full:- +full:hz
1 // SPDX-License-Identifier: GPL-2.0
31 #define CHP_INFO_UPDATE_INTERVAL 1*HZ
43 /* Map for channel-path status. */
47 /* Time after which channel-path status may be outdated. */
58 chpid_to_chp(chpid)->state = onoff; in set_chp_logically_online()
61 /* On success return 0 if channel-path is varied offline, 1 if it is varied
62 * online. Return -ENODEV if channel-path is not registered. */
65 return (chpid_to_chp(chpid) ? chpid_to_chp(chpid)->state : -ENODEV); in chp_get_status()
69 * chp_get_sch_opm - return opm for subchannel
73 * used by the subchannel and the status of the associated channel-paths.
85 chpid.id = sch->schib.pmcw.chpid[i]; in chp_get_sch_opm()
94 * chp_is_registered - check if a channel-path is registered
95 * @chpid: channel-path ID
97 * Return non-zero if a channel-path with the given chpid is registered,
139 if (chp->cmg == -1) in measurement_chars_read()
142 return memory_read_from_buffer(buf, count, &off, &chp->cmg_chars, in measurement_chars_read()
143 sizeof(chp->cmg_chars)); in measurement_chars_read()
159 css = to_css(chp->dev.parent); in chp_measurement_copy_block()
160 id = chp->chpid.id; in chp_measurement_copy_block()
164 if (!chp->extended) in chp_measurement_copy_block()
168 area = css->ecub[id / CSS_ECUES_PER_PAGE]; in chp_measurement_copy_block()
172 area = css->cub[id / CSS_CUES_PER_PAGE]; in chp_measurement_copy_block()
212 device_remove_groups(&chp->dev, measurement_groups); in chp_remove_cmg_attr()
217 return device_add_groups(&chp->dev, measurement_groups); in chp_add_cmg_attr()
229 mutex_lock(&chp->lock); in chp_status_show()
230 status = chp->state; in chp_status_show()
231 mutex_unlock(&chp->lock); in chp_status_show()
253 mutex_lock(&cp->lock); in chp_status_write()
254 error = s390_vary_chpid(cp->chpid, 1); in chp_status_write()
255 mutex_unlock(&cp->lock); in chp_status_write()
257 mutex_lock(&cp->lock); in chp_status_write()
258 error = s390_vary_chpid(cp->chpid, 0); in chp_status_write()
259 mutex_unlock(&cp->lock); in chp_status_write()
261 error = -EINVAL; in chp_status_write()
275 status = chp_info_get_status(cp->chpid); in chp_configure_show()
293 return -EINVAL; in chp_configure_write()
295 return -EINVAL; in chp_configure_write()
297 chp_cfg_schedule(cp->chpid, val); in chp_configure_write()
311 mutex_lock(&chp->lock); in chp_type_show()
312 type = chp->desc.desc; in chp_type_show()
313 mutex_unlock(&chp->lock); in chp_type_show()
326 if (chp->cmg == -1) /* channel measurements not available */ in chp_cmg_show()
328 return sprintf(buf, "%d\n", chp->cmg); in chp_cmg_show()
340 if (chp->shared == -1) /* channel measurements not available */ in chp_shared_show()
342 return sprintf(buf, "%x\n", chp->shared); in chp_shared_show()
353 mutex_lock(&chp->lock); in chp_chid_show()
354 if (chp->desc_fmt1.flags & 0x10) in chp_chid_show()
355 rc = sprintf(buf, "%04x\n", chp->desc_fmt1.chid); in chp_chid_show()
358 mutex_unlock(&chp->lock); in chp_chid_show()
370 mutex_lock(&chp->lock); in chp_chid_external_show()
371 if (chp->desc_fmt1.flags & 0x10) in chp_chid_external_show()
372 rc = sprintf(buf, "%x\n", chp->desc_fmt1.flags & 0x8 ? 1 : 0); in chp_chid_external_show()
375 mutex_unlock(&chp->lock); in chp_chid_external_show()
387 mutex_lock(&chp->lock); in chp_esc_show()
388 rc = sprintf(buf, "%x\n", chp->desc_fmt1.esc); in chp_esc_show()
389 mutex_unlock(&chp->lock); in chp_esc_show()
400 for (i = 0; i < ARRAY_SIZE(suffixes) - 1; i++) { in apply_max_suffix()
413 unsigned long speed = chp->speed; in speed_bps_show() local
416 suffix = apply_max_suffix(&speed, 1000); in speed_bps_show()
418 return suffix ? sysfs_emit(buf, "%lu%c\n", speed, suffix) : in speed_bps_show()
419 sysfs_emit(buf, "%lu\n", speed); in speed_bps_show()
431 mutex_lock(&chp->lock); in util_string_read()
432 rc = memory_read_from_buffer(buf, count, &off, chp->desc_fmt3.util_str, in util_string_read()
433 sizeof(chp->desc_fmt3.util_str)); in util_string_read()
434 mutex_unlock(&chp->lock); in util_string_read()
439 sizeof(((struct channel_path_desc_fmt3 *)0)->util_str));
476 * chp_update_desc - update channel-path description
477 * @chp: channel-path
479 * Update the channel-path description of the specified channel-path
481 * Return zero on success, non-zero otherwise.
487 rc = chsc_determine_fmt0_channel_path_desc(chp->chpid, &chp->desc); in chp_update_desc()
495 chsc_determine_fmt1_channel_path_desc(chp->chpid, &chp->desc_fmt1); in chp_update_desc()
496 chsc_determine_fmt3_channel_path_desc(chp->chpid, &chp->desc_fmt3); in chp_update_desc()
503 * chp_new - register a new channel-path
504 * @chpid: channel-path ID
506 * Create and register data structure representing new channel-path. Return
507 * zero on success, non-zero otherwise.
515 mutex_lock(&css->mutex); in chp_new()
521 ret = -ENOMEM; in chp_new()
525 chp->chpid = chpid; in chp_new()
526 chp->state = 1; in chp_new()
527 chp->dev.parent = &css->device; in chp_new()
528 chp->dev.groups = chp_attr_groups; in chp_new()
529 chp->dev.release = chp_release; in chp_new()
530 mutex_init(&chp->lock); in chp_new()
536 if ((chp->desc.flags & 0x80) == 0) { in chp_new()
537 ret = -ENODEV; in chp_new()
540 dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id); in chp_new()
543 ret = device_register(&chp->dev); in chp_new()
547 put_device(&chp->dev); in chp_new()
551 if (css->cm_enabled) { in chp_new()
554 device_unregister(&chp->dev); in chp_new()
558 css->chps[chpid.id] = chp; in chp_new()
563 mutex_unlock(&css->mutex); in chp_new()
568 * chp_get_chp_desc - return newly allocated channel-path description
569 * @chpid: channel-path ID
571 * On success return a newly allocated copy of the channel-path description
572 * data associated with the given channel-path ID. Return %NULL on error.
586 mutex_lock(&chp->lock); in chp_get_chp_desc()
587 memcpy(desc, &chp->desc, sizeof(*desc)); in chp_get_chp_desc()
588 mutex_unlock(&chp->lock); in chp_get_chp_desc()
593 * chp_process_crw - process channel-path status change
594 * @crw0: channel report-word to handler
595 * @crw1: second channel-report word (always NULL)
598 * Handle channel-report-words indicating that the status of a channel-path
612 crw0->slct, crw0->oflw, crw0->chn, crw0->rsc, crw0->anc, in chp_process_crw()
613 crw0->erc, crw0->rsid); in chp_process_crw()
619 if (crw0->slct) { in chp_process_crw()
621 "channel path %02X\n", crw0->rsid); in chp_process_crw()
625 chpid.id = crw0->rsid; in chp_process_crw()
626 switch (crw0->erc) { in chp_process_crw()
638 crw0->erc); in chp_process_crw()
649 if (!(ssd->path_mask & mask)) in chp_ssd_get_mask()
651 if (!chp_id_is_equal(&ssd->chpid[i], &link->chpid)) in chp_ssd_get_mask()
653 if ((ssd->fla_valid_mask & mask) && in chp_ssd_get_mask()
654 ((ssd->fla[i] & link->fla_mask) != link->fla)) in chp_ssd_get_mask()
671 chp_info_expires = jiffies - 1; in info_expire()
675 /* Ensure that chp_info is up-to-date. */
693 * chp_info_get_status - retrieve configure status of a channel-path
694 * @chpid: channel-path ID
796 * chp_cfg_schedule - schedule chpid configuration request
797 * @chpid: channel-path ID
798 * @configure: Non-zero for configure, zero for deconfigure
800 * Schedule a channel-path configuration/deconfiguration request.
813 * chp_cfg_cancel_deconfigure - cancel chpid deconfiguration request
814 * @chpid: channel-path ID
816 * Cancel an active channel-path deconfiguration request if it has not yet
843 return -ERESTARTSYS; in cfg_wait_idle()
858 /* Register available channel-paths. */ in chp_init()