Lines Matching refs:chp

28 #include "chp.h"
135 struct channel_path *chp;
139 chp = to_channelpath(device);
140 if (chp->cmg == -1)
143 return memory_read_from_buffer(buf, count, &off, &chp->cmg_chars,
144 sizeof(chp->cmg_chars));
182 struct channel_path *chp;
188 chp = to_channelpath(device);
189 css = to_css(chp->dev.parent);
196 chp_measurement_copy_block((struct cmg_entry *)buf, css, chp->chpid);
210 void chp_remove_cmg_attr(struct channel_path *chp)
212 device_remove_bin_file(&chp->dev, &chp_measurement_chars_attr);
213 device_remove_bin_file(&chp->dev, &chp_measurement_attr);
216 int chp_add_cmg_attr(struct channel_path *chp)
220 ret = device_create_bin_file(&chp->dev, &chp_measurement_chars_attr);
223 ret = device_create_bin_file(&chp->dev, &chp_measurement_attr);
225 device_remove_bin_file(&chp->dev, &chp_measurement_chars_attr);
235 struct channel_path *chp = to_channelpath(dev);
238 mutex_lock(&chp->lock);
239 status = chp->state;
240 mutex_unlock(&chp->lock);
317 struct channel_path *chp = to_channelpath(dev);
320 mutex_lock(&chp->lock);
321 type = chp->desc.desc;
322 mutex_unlock(&chp->lock);
331 struct channel_path *chp = to_channelpath(dev);
333 if (!chp)
335 if (chp->cmg == -1) /* channel measurements not available */
337 return sprintf(buf, "%x\n", chp->cmg);
345 struct channel_path *chp = to_channelpath(dev);
347 if (!chp)
349 if (chp->shared == -1) /* channel measurements not available */
351 return sprintf(buf, "%x\n", chp->shared);
359 struct channel_path *chp = to_channelpath(dev);
362 mutex_lock(&chp->lock);
363 if (chp->desc_fmt1.flags & 0x10)
364 rc = sprintf(buf, "%04x\n", chp->desc_fmt1.chid);
367 mutex_unlock(&chp->lock);
376 struct channel_path *chp = to_channelpath(dev);
379 mutex_lock(&chp->lock);
380 if (chp->desc_fmt1.flags & 0x10)
381 rc = sprintf(buf, "%x\n", chp->desc_fmt1.flags & 0x8 ? 1 : 0);
384 mutex_unlock(&chp->lock);
393 struct channel_path *chp = to_channelpath(dev);
396 mutex_lock(&chp->lock);
397 rc = sprintf(buf, "%x\n", chp->desc_fmt1.esc);
398 mutex_unlock(&chp->lock);
408 struct channel_path *chp = to_channelpath(kobj_to_dev(kobj));
411 mutex_lock(&chp->lock);
412 rc = memory_read_from_buffer(buf, count, &off, chp->desc_fmt3.util_str,
413 sizeof(chp->desc_fmt3.util_str));
414 mutex_unlock(&chp->lock);
456 * @chp: channel-path
462 int chp_update_desc(struct channel_path *chp)
466 rc = chsc_determine_fmt0_channel_path_desc(chp->chpid, &chp->desc);
474 chsc_determine_fmt1_channel_path_desc(chp->chpid, &chp->desc_fmt1);
475 chsc_determine_fmt3_channel_path_desc(chp->chpid, &chp->desc_fmt3);
476 chsc_get_channel_measurement_chars(chp);
491 struct channel_path *chp;
498 chp = kzalloc(sizeof(struct channel_path), GFP_KERNEL);
499 if (!chp) {
504 chp->chpid = chpid;
505 chp->state = 1;
506 chp->dev.parent = &css->device;
507 chp->dev.groups = chp_attr_groups;
508 chp->dev.release = chp_release;
509 mutex_init(&chp->lock);
512 ret = chp_update_desc(chp);
515 if ((chp->desc.flags & 0x80) == 0) {
519 dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id);
522 ret = device_register(&chp->dev);
524 CIO_MSG_EVENT(0, "Could not register chp%x.%02x: %d\n",
526 put_device(&chp->dev);
531 ret = chp_add_cmg_attr(chp);
533 device_unregister(&chp->dev);
537 css->chps[chpid.id] = chp;
540 kfree(chp);
555 struct channel_path *chp;
558 chp = chpid_to_chp(chpid);
559 if (!chp)
565 mutex_lock(&chp->lock);
566 memcpy(desc, &chp->desc, sizeof(*desc));
567 mutex_unlock(&chp->lock);
744 CIO_MSG_EVENT(2, "chp: sclp_chp_configure(%x.%02x)="
754 CIO_MSG_EVENT(2, "chp: sclp_chp_deconfigure(%x.%02x)="